[PATCH] light weight drm fbdev panning

James Simmons jsimmons at infradead.org
Wed Aug 4 09:53:42 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.
> 
> 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.

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.

> > 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;
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/dri-devel
> >
> 


More information about the dri-devel mailing list