From: James Simmons Subject: Re: [PATCH] light weight drm fbdev panning Date: Wed, 4 Aug 2010 17:53:42 +0100 (BST) Message-ID: References: Mime-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="1985284609-429153766-1280940823=:31488" Return-path: Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by gabe.freedesktop.org (Postfix) with ESMTP id A84B09E8D3 for ; Wed, 4 Aug 2010 09:53:45 -0700 (PDT) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Dave Airlie Cc: Dave Airlie , DRI development list List-Id: dri-devel@lists.freedesktop.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --1985284609-429153766-1280940823=:31488 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable > > This patch uses the much lighter mode_set_base instead of calling a f= ull > > mode set. Tested on a i915 netbook. Patch should be against drm-core-= next. >=20 > 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=20 application. The second is the framebuffer console layer when in VT mode.= =20 Currently in order for the console layer to actually using panning the=20 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=20 did to try it. Currently fbcon uses the flag in struct fb_info to=20 determine the most optimized path to scroll/draw etc. If pan_display fail= s=20 the fbcon code adapts to that change. > > Signed-By: James Simmons > > > > 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_scr= eeninfo *var, > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0struct fb_= info *info) > > =A0{ > > =A0 =A0 =A0 =A0struct drm_fb_helper *fb_helper =3D info->par; > > + =A0 =A0 =A0 struct drm_crtc_helper_funcs *crtc_funcs; > > =A0 =A0 =A0 =A0struct drm_device *dev =3D fb_helper->dev; > > =A0 =A0 =A0 =A0struct drm_mode_set *modeset; > > =A0 =A0 =A0 =A0struct drm_crtc *crtc; > > - =A0 =A0 =A0 int ret =3D 0; > > + =A0 =A0 =A0 int ret =3D -ENXIO; > > =A0 =A0 =A0 =A0int i; > > > > =A0 =A0 =A0 =A0mutex_lock(&dev->mode_config.mutex); > > =A0 =A0 =A0 =A0for (i =3D 0; i < fb_helper->crtc_count; i++) { > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0crtc =3D fb_helper->crtc_info[i].mode_= set.crtc; > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 crtc_funcs =3D crtc->helper_private; > > + > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (!crtc_funcs->mode_set_base) > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 continue; > > > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0modeset =3D &fb_helper->crtc_info[i].m= ode_set; > > > > @@ -746,7 +751,8 @@ int drm_fb_helper_pan_display(struct fb_var_scree= ninfo *var, > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0modeset->y =3D var->yoffset; > > > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (modeset->num_connectors) { > > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ret =3D crtc->funcs->se= t_config(modeset); > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ret =3D crtc_funcs->mod= e_set_base(crtc, modeset->x, > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 modeset->y, crtc->fb); > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (!ret) { > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0info->= var.xoffset =3D var->xoffset; > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0info->= var.yoffset =3D var->yoffset; > > _______________________________________________ > > dri-devel mailing list > > dri-devel@lists.freedesktop.org > > http://lists.freedesktop.org/mailman/listinfo/dri-devel > > >=20 --1985284609-429153766-1280940823=:31488 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel --1985284609-429153766-1280940823=:31488--