From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752237AbdEDUXo (ORCPT ); Thu, 4 May 2017 16:23:44 -0400 Received: from mail.fireflyinternet.com ([109.228.58.192]:59895 "EHLO fireflyinternet.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751428AbdEDUXn (ORCPT ); Thu, 4 May 2017 16:23:43 -0400 X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.65.138; Date: Thu, 4 May 2017 21:23:31 +0100 From: Chris Wilson To: Laura Abbott Cc: Daniel Vetter , Sean Paul , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Sumit Semwal , intel-gfx@lists.freedesktop.org, Joonas Lahtinen Subject: Re: [PATCHv4 1/3] drm/vgem: Add a dummy platform device Message-ID: <20170504202331.GO24019@nuc-i3427.alporthouse.com> Mail-Followup-To: Chris Wilson , Laura Abbott , Daniel Vetter , Sean Paul , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Sumit Semwal , intel-gfx@lists.freedesktop.org, Joonas Lahtinen References: <1493923548-20878-1-git-send-email-labbott@redhat.com> <1493923548-20878-2-git-send-email-labbott@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1493923548-20878-2-git-send-email-labbott@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > Signed-off-by: Laura Abbott > --- > 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