[PATCH] light weight drm fbdev panning

James Simmons jsimmons at infradead.org
Mon Aug 2 15:01:05 PDT 2010


This patch uses the much lighter mode_set_base instead of calling a full 
mode set. Tested on a i915 netbook. Patch should be against drm-core-next.
 
Signed-By: James Simmons <jsimmons at infradead.org>

diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index 7196620..99889e3 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -730,15 +730,20 @@ int drm_fb_helper_pan_display(struct fb_var_screeninfo *var,
 			      struct fb_info *info)
 {
 	struct drm_fb_helper *fb_helper = info->par;
+	struct drm_crtc_helper_funcs *crtc_funcs;
 	struct drm_device *dev = fb_helper->dev;
 	struct drm_mode_set *modeset;
 	struct drm_crtc *crtc;
-	int ret = 0;
+	int ret = -ENXIO;
 	int i;
 
 	mutex_lock(&dev->mode_config.mutex);
 	for (i = 0; i < fb_helper->crtc_count; i++) {
 		crtc = fb_helper->crtc_info[i].mode_set.crtc;
+		crtc_funcs = crtc->helper_private;
+
+		if (!crtc_funcs->mode_set_base)
+			continue;
 
 		modeset = &fb_helper->crtc_info[i].mode_set;
 
@@ -746,7 +751,8 @@ int drm_fb_helper_pan_display(struct fb_var_screeninfo *var,
 		modeset->y = var->yoffset;
 
 		if (modeset->num_connectors) {
-			ret = crtc->funcs->set_config(modeset);
+			ret = crtc_funcs->mode_set_base(crtc, modeset->x,
+							modeset->y, crtc->fb);
 			if (!ret) {
 				info->var.xoffset = var->xoffset;
 				info->var.yoffset = var->yoffset;


More information about the dri-devel mailing list