Re: [PATCH] drm/panfrost: Use drm_gem_dump_map_offset()

From: Chris Wilson
Date: Mon May 13 2019 - 10:49:11 EST


Quoting Daniel Vetter (2019-05-13 15:39:21)
> On Mon, May 13, 2019 at 03:32:44PM +0100, Steven Price wrote:
> > panfrost_ioctl_mmap_bo() contains a reimplementation of
> > drm_gem_dump_map_offset() but with a bug - it allows mapping imported
> > objects (without going through the exporter). Fix this by switching to
> > use the generic drm_gem_dump_map_offset() function instead which has the
> > bonus of simplifying the code.
>
> gem_dumb stuff is for kms drivers, panfrost is a render driver. We're
> generally trying to separate these two worlds somewhat cleanly.
>
> I think it'd be good to have a non-dumb version of this in the core, and
> use that. Or upgrade the dumb version to be that helper for everyone (and
> drop the _dumb).

More specifically, since panfrost is using the drm_gem_shmem helper and
vm_ops, it too can provide the wrapper as it is the drm_gem_shmem layer
that implies that trying to mmap an imported object is an issue as that
is not a universal problem.
-Chris