From: Sascha Hauer Subject: Re: [PATCH] DRM: add drm gem CMA helper Date: Tue, 29 May 2012 18:06:44 +0200 Message-ID: <20120529160644.GW30400@pengutronix.de> References: <1338300627-2176-1-git-send-email-s.hauer@pengutronix.de> <4FC4E14C.90601@metafoo.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [92.198.50.35]) by gabe.freedesktop.org (Postfix) with ESMTP id 76F599E782 for ; Tue, 29 May 2012 09:06:47 -0700 (PDT) Content-Disposition: inline In-Reply-To: <4FC4E14C.90601@metafoo.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Lars-Peter Clausen Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org, Rob Clark List-Id: dri-devel@lists.freedesktop.org Hi Lars, Thanks for your quick comments. On Tue, May 29, 2012 at 04:46:36PM +0200, Lars-Peter Clausen wrote: > On 05/29/2012 04:10 PM, Sascha Hauer wrote: > > > > diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig > > index e354bc0..f62717e 100644 > > --- a/drivers/gpu/drm/Kconfig > > +++ b/drivers/gpu/drm/Kconfig > > @@ -53,6 +53,12 @@ config DRM_TTM > > GPU memory types. Will be enabled automatically if a device driver > > uses it. > > > > +config DRM_GEM_CMA_HELPER > > + tristate > > + depends on DRM > > + help > > + Choose this if you need the GEM cma helper functions > > This shouldn't have a help text as it should be selected by the driver and > not by the user. Also the 'depends on DRM' can go away, since it becomes > meaningless if the symbol is not user-selectable. The other helpers also have a depends on DRM in them. You are right, it's quite meaningless. The only advantage I can think of is that it would produce a 'has unmet direct dependencies' if someone outside DRM would select this. I'll drop it. > > + > > +static const struct file_operations drm_gem_cma_fops = { > > + .mmap = drm_gem_cma_mmap_buffer, > > +}; > > This and the function above seem to be unused. I think it's a relict from > the old Exynos code. Indeed. I wonder why my compiler hasn't warned me about this. Will remove. > > Do you think it makes sense to have generic vm_operations struct as well, I > think it will look the same for most drivers: > > struct vm_operations_struct drm_gem_cma_vm_ops = { > .fault = drm_gem_cma_fault, > .open = drm_gem_vm_open, > .close = drm_gem_vm_close, > }; As we both can make use of this I'll add it. People who need something else can still add their own vm_operations_struct. I integrated your other comments, will repost tomorrow unless there are more comments on this. Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |