[Intel-gfx] [PATCHv4 1/3] drm/vgem: Add a dummy platform device

Chris Wilson chris at chris-wilson.co.uk
Thu May 4 20:23:31 UTC 2017


On Thu, May 04, 2017 at 11:45:46AM -0700, Laura Abbott wrote:
> 
> The vgem driver is currently registered independent of any actual
> device. Some usage of the dmabuf APIs require an actual device structure
> to do anything. Register a dummy platform device for use with dmabuf.
> 
> Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
> Signed-off-by: Laura Abbott <labbott at redhat.com>
> ---
> v4: Switch from the now removed platformdev to a static platform device.

I was thinking of avoiding the static, i.e.

static struct vgem_device {
	struct drm_device drm;

	struct device *platform;
} *vgem_device;

vgem_init():

vgem_device = kzalloc(sizeof(*vgem_device), GFP_KERNEEL);

ret = drm_dev_init(&vgem_device->drm, &vgem_drv, NULL);

vgem_device->platform = platform_device_register_simple("vgem");

And then platform_device_unregister() should be done in a new
vgem_drv.release callback.

I'm not going to insist upon it as I can send a patch to move over to
the "modern" drm_device subclassing later.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list