From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH 04/25] drm/fb_helper: Create wrappers for blit, copyarea and fillrect funcs Date: Mon, 13 Jul 2015 09:40:44 +0200 Message-ID: <20150713074044.GP3736@phenom.ffwll.local> References: <1436769501-4105-1-git-send-email-architt@codeaurora.org> <1436769501-4105-5-git-send-email-architt@codeaurora.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mail-wg0-f50.google.com ([74.125.82.50]:36269 "EHLO mail-wg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751207AbbGMHh7 (ORCPT ); Mon, 13 Jul 2015 03:37:59 -0400 Received: by wgxm20 with SMTP id m20so105731333wgx.3 for ; Mon, 13 Jul 2015 00:37:58 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1436769501-4105-5-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:08:00PM +0530, Archit Taneja wrote: > drm drivers that emulate fbdev populate their fb_fillrect, fb_copyarea > and fb_imageblit fb_ops with the help of cfb_* or sys_* fbdev core > helper functions. > > Create drm_fb_helper functions that wrap 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/Kconfig | 6 ++++++ > drivers/gpu/drm/drm_fb_helper.c | 48 +++++++++++++++++++++++++++++++++++++++++ > include/drm/drm_fb_helper.h | 14 ++++++++++++ > 3 files changed, 68 insertions(+) > > diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig > index b284cdc..e373f8a 100644 > --- a/drivers/gpu/drm/Kconfig > +++ b/drivers/gpu/drm/Kconfig > @@ -38,6 +38,12 @@ config DRM_KMS_FB_HELPER > select FRAMEBUFFER_CONSOLE if !EXPERT > select FRAMEBUFFER_CONSOLE_DETECT_PRIMARY if FRAMEBUFFER_CONSOLE > select FB_SYS_FOPS > + select FB_SYS_FILLRECT > + select FB_SYS_COPYAREA > + select FB_SYS_IMAGEBLIT > + select FB_CFB_FILLRECT > + select FB_CFB_COPYAREA > + select FB_CFB_IMAGEBLIT > help > FBDEV helpers for KMS drivers. > > diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c > index 795547e..55b5212 100644 > --- a/drivers/gpu/drm/drm_fb_helper.c > +++ b/drivers/gpu/drm/drm_fb_helper.c > @@ -764,6 +764,54 @@ ssize_t drm_fb_helper_sys_write(struct fb_info *info, const char __user *buf, > } > EXPORT_SYMBOL(drm_fb_helper_sys_write); > > +void drm_fb_helper_sys_fillrect(struct fb_info *info, > + const struct fb_fillrect *rect) More alignment noise from checkpatch - continuations should align with the opening (. Since we follow this pretty consistently in drm worth keeping up imo. -Daniel > +{ > + if (info) > + sys_fillrect(info, rect); > +} > +EXPORT_SYMBOL(drm_fb_helper_sys_fillrect); > + > +void drm_fb_helper_sys_copyarea(struct fb_info *info, > + const struct fb_copyarea *area) > +{ > + if (info) > + sys_copyarea(info, area); > +} > +EXPORT_SYMBOL(drm_fb_helper_sys_copyarea); > + > +void drm_fb_helper_sys_imageblit(struct fb_info *info, > + const struct fb_image *image) > +{ > + if (info) > + sys_imageblit(info, image); > +} > +EXPORT_SYMBOL(drm_fb_helper_sys_imageblit); > + > +void drm_fb_helper_cfb_fillrect(struct fb_info *info, > + const struct fb_fillrect *rect) > +{ > + if (info) > + cfb_fillrect(info, rect); > +} > +EXPORT_SYMBOL(drm_fb_helper_cfb_fillrect); > + > +void drm_fb_helper_cfb_copyarea(struct fb_info *info, > + const struct fb_copyarea *area) > +{ > + if (info) > + cfb_copyarea(info, area); > +} > +EXPORT_SYMBOL(drm_fb_helper_cfb_copyarea); > + > +void drm_fb_helper_cfb_imageblit(struct fb_info *info, > + const struct fb_image *image) > +{ > + if (info) > + cfb_imageblit(info, image); > +} > +EXPORT_SYMBOL(drm_fb_helper_cfb_imageblit); > + > 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 f74e59e..aa45837 100644 > --- a/include/drm/drm_fb_helper.h > +++ b/include/drm/drm_fb_helper.h > @@ -152,6 +152,20 @@ ssize_t drm_fb_helper_sys_read(struct fb_info *info, char __user *buf, > ssize_t drm_fb_helper_sys_write(struct fb_info *info, const char __user *buf, > size_t count, loff_t *ppos); > > +void drm_fb_helper_sys_fillrect(struct fb_info *info, > + const struct fb_fillrect *rect); > +void drm_fb_helper_sys_copyarea(struct fb_info *info, > + const struct fb_copyarea *area); > +void drm_fb_helper_sys_imageblit(struct fb_info *info, > + const struct fb_image *image); > + > +void drm_fb_helper_cfb_fillrect(struct fb_info *info, > + const struct fb_fillrect *rect); > +void drm_fb_helper_cfb_copyarea(struct fb_info *info, > + const struct fb_copyarea *area); > +void drm_fb_helper_cfb_imageblit(struct fb_info *info, > + const struct fb_image *image); > + > 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