From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH 02/25] drm/fb_helper: Create a wrapper for unlink_framebuffer Date: Mon, 13 Jul 2015 09:30:01 +0200 Message-ID: <20150713073001.GL3736@phenom.ffwll.local> References: <1436769501-4105-1-git-send-email-architt@codeaurora.org> <1436769501-4105-3-git-send-email-architt@codeaurora.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mail-wi0-f177.google.com ([209.85.212.177]:33350 "EHLO mail-wi0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751256AbbGMH1R (ORCPT ); Mon, 13 Jul 2015 03:27:17 -0400 Received: by widic2 with SMTP id ic2so4208130wid.0 for ; Mon, 13 Jul 2015 00:27:15 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1436769501-4105-3-git-send-email-architt@codeaurora.org> Sender: linux-arm-msm-owner@vger.kernel.org List-Id: linux-arm-msm@vger.kernel.org To: Archit Taneja Cc: dri-devel@lists.freedesktop.org, daniel@ffwll.ch, linux-arm-msm@vger.kernel.org, airlied@linux.ie On Mon, Jul 13, 2015 at 12:07:58PM +0530, Archit Taneja wrote: > Some drm drivers call unlink_framebuffer. Create a drm_fb_helper function > that wraps around these calls. > > This is part of an effort to prevent drm drivers from calling fbdev > functions directly, in order to make fbdev emulation a top level drm > option. > > Signed-off-by: Archit Taneja > --- > drivers/gpu/drm/drm_fb_helper.c | 7 +++++++ > include/drm/drm_fb_helper.h | 2 ++ > 2 files changed, 9 insertions(+) > > diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c > index 78859ad..742377d 100644 > --- a/drivers/gpu/drm/drm_fb_helper.c > +++ b/drivers/gpu/drm/drm_fb_helper.c > @@ -737,6 +737,13 @@ void drm_fb_helper_fini(struct drm_fb_helper *fb_helper) > } > EXPORT_SYMBOL(drm_fb_helper_fini); > > +void drm_fb_helper_unlink_fbi(struct drm_fb_helper *fb_helper) > +{ > + if (fb_helper->fbdev) In anticipation of adding a runtime knob for fbdev emulation, shouldn't we be checking for if (fb_helper && fb_helper->fbdev) here? Applies to all the other patches too. Other big missing thing is (simple) kerneldoc for all these new functions. -Daniel > + unlink_framebuffer(fb_helper->fbdev); > +} > +EXPORT_SYMBOL(drm_fb_helper_unlink_fbi); > + > static int setcolreg(struct drm_crtc *crtc, u16 red, u16 green, > u16 blue, u16 regno, struct fb_info *info) > { > diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h > index 2ee4ec5..4c90837 100644 > --- a/include/drm/drm_fb_helper.h > +++ b/include/drm/drm_fb_helper.h > @@ -145,6 +145,8 @@ void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helpe > void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch, > uint32_t depth); > > +void drm_fb_helper_unlink_fbi(struct drm_fb_helper *fb_helper); > + > int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info); > > int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper); > -- > The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, > hosted by The Linux Foundation > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch