From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751216AbdECPHf (ORCPT ); Wed, 3 May 2017 11:07:35 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:33723 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751243AbdECPHK (ORCPT ); Wed, 3 May 2017 11:07:10 -0400 Date: Wed, 3 May 2017 17:07:03 +0200 From: Daniel Vetter To: Laura Abbott Cc: Chris Wilson , Sean Paul , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Sumit Semwal , intel-gfx@lists.freedesktop.org, Joonas Lahtinen Subject: Re: [PATCHv3 2/3] drm/prime: Introduce drm_gem_prime_import_platform Message-ID: <20170503150703.o2oenjd4gy65uwva@phenom.ffwll.local> Mail-Followup-To: Laura Abbott , Chris Wilson , Sean Paul , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Sumit Semwal , intel-gfx@lists.freedesktop.org, Joonas Lahtinen References: <1493744528-25768-1-git-send-email-labbott@redhat.com> <1493744528-25768-3-git-send-email-labbott@redhat.com> <20170502202213.GI19680@nuc-i3427.alporthouse.com> <20170503073945.44j65kon3f4xatll@phenom.ffwll.local> <4d8dc485-2688-d46b-270c-fcb71833e893@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4d8dc485-2688-d46b-270c-fcb71833e893@redhat.com> X-Operating-System: Linux phenom 4.9.0-2-amd64 User-Agent: NeoMutt/20170306 (1.8.0) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 03, 2017 at 07:40:51AM -0700, Laura Abbott wrote: > On 05/03/2017 12:39 AM, Daniel Vetter wrote: > > On Tue, May 02, 2017 at 09:22:13PM +0100, Chris Wilson wrote: > >> On Tue, May 02, 2017 at 10:02:07AM -0700, Laura Abbott wrote: > >>> /** > >>> + * drm_gem_prime_import_platform - alternate implementation of the import callback > >>> + * @dev: drm_device to import into > >>> + * @dma_buf: dma-buf object to import > >>> + * > >>> + * This is identical to drm_gem_prime_import except the device used for dma_buf > >>> + * attachment is an internal platform device instead of the standard device > >>> + * structure. The use of this function should be limited to drivers that do not > >>> + * set up an underlying device structure. > >>> + */ > >>> +struct drm_gem_object *drm_gem_prime_import_platform(struct drm_device *dev, > >> > >> Simpler soluation will be for the caller to provide the platformdev? > >> > >> That works nicely for the vgem case, I think. > > > > Yeah looking at this again, do we really need this patch? Couldn't we > > instead change patch 1 to first allocate the fake platform device, then > > pass that to drm_dev_alloc (instead of NULL like we do now)? > > > > That was what I proposed in the first version and it was rejected. > It's useful to have at least one driver with a NULL device for testing > edge cases. Oh drat :( I'd say dropping the coverage for NULL testing is ok, there's no other driver than vgem using this. And now that we have vgem dma-buf (or will, soonish) I'd expect that the same will hold for vkms, if it ever happens. -Daniel > > That way no resurrection of drm_device.platform_dev is needed (and I'd > > really like this zombie to stay dead on 2nd thought). > > > > I had a hunch this would be unpopular but I figured it was worth a > shot. I think an even cleaner solution is to allow passing of any > struct device. I'll see about reworking this. > > > Sry about this yet-another-round review :-/ > > -Daniel > > > > Thanks for your patience. > > Laura > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch