light weight drm fbdev panning
Subsystems (2)
PATCH 1/1 light weight drm fbdev panning
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.
drivers/gpu/drm/drm_fb_helper.c +8 -2
@@ -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;
Dave Airlie
maintainerQuoted 3 lines · James Simmons
This patch uses the much lighter
mode_set_baseinstead of calling a full mode set. Tested on a i915 netbook. Patch should be against drm-core-next.
The kms code should always fallback if appropriate, I've definitely seen some modesets I thought were triggered by the pan_display codepath, so I'd expect if we add this, we might some base sets at the wrong time. Unless we can prove we only get pan_displays when expected.
Dave.
Quoted 44 lines
Signed-By James Simmons <[email protected]>drivers/gpu/drm/drm_fb_helper.c +8
-2@@ -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;_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 9 lines
Quoted 3 lines
This patch uses the much lighter
mode_set_baseinstead of calling a full mode set. Tested on a i915 netbook. Patch should be against drm-core-next.The kms code should always fallback if appropriate, I've definitely seen some modesets I thought were triggered by the
pan_displaycodepath, so I'd expect if we add this, we might some base sets at the wrong time. Unless we can prove we only getpan_displayswhen expected.
fb_pan_display is called from two places. One is from a userland application. The second is the framebuffer console layer when in VT mode. Currently in order for the console layer to actually using panning the sruct fb_info flag field must be set with FBINFO_HWACCEL_XPAN and/or FBINFO_HWACCEL_YPAN. Currently no KMS driver set this field. I actually did to try it. Currently fbcon uses the flag in struct fb_info to determine the most optimized path to scroll/draw etc. If pan_display fails the fbcon code adapts to that change.
Quoted 31 lines
Quoted 31 lines
Signed-By James Simmons <[email protected]>drivers/gpu/drm/drm_fb_helper.c +6
-1@@ -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;
Quoted 13 lines
Quoted 7 lines
drivers/gpu/drm/drm_fb_helper.c +2
-1if (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;Quoted 5 lines
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel