From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jesse Barnes Subject: [PATCH] drm/fb: don't call driver set_config if display isn't panned Date: Tue, 15 Nov 2011 10:27:35 -0800 Message-ID: <20111115102735.7f21fb4d@jbarnes-desktop> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1945650978==" Return-path: Received: from oproxy4-pub.bluehost.com (oproxy4-pub.bluehost.com [69.89.21.11]) by gabe.freedesktop.org (Postfix) with SMTP id 47B9B9E947 for ; Tue, 15 Nov 2011 10:26:53 -0800 (PST) Received: from c-67-161-37-189.hsd1.ca.comcast.net ([67.161.37.189] helo=jbarnes-desktop) by box514.bluehost.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.76) (envelope-from ) id 1RQNie-0000i6-IA for dri-devel@lists.freedesktop.org; Tue, 15 Nov 2011 11:26:52 -0700 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: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============1945650978== Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/EYhnUpT.WcatEj+nArKnjMa"; protocol="application/pgp-signature" --Sig_/EYhnUpT.WcatEj+nArKnjMa Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable This is just a minor optimization to the fb panning code. In debugging some other issues, I noticed a lot of no-op calls to the set_config routine with all the same parameters and tracked down the source to the fb helper pan routine. So add an additional check for actual panning relative to the current crtc config to avoid unnecessary set_config calls. Signed-off-by: Jesse Barnes diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helpe= r.c index f7c6854..4dd81f3 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -739,7 +739,8 @@ int drm_fb_helper_pan_display(struct fb_var_screeninfo = *var, modeset->x =3D var->xoffset; modeset->y =3D var->yoffset; =20 - if (modeset->num_connectors) { + if (((modeset->x !=3D crtc->x) || (modeset->y !=3D crtc->y)) && + modeset->num_connectors) { ret =3D crtc->funcs->set_config(modeset); if (!ret) { info->var.xoffset =3D var->xoffset; --Sig_/EYhnUpT.WcatEj+nArKnjMa Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iQIcBAEBAgAGBQJOwq8XAAoJEIEoDkX4Qk9ht2QP/0Byxzdyyb6fqV6MJqXxYu6y 6Bgai05pL7AK8amwxx8FKKJ69kzKD97awLgarZIZOCJZsZ3abQamAkha8MFXGsHO STp20EBjHDLwIqW6QZLgOeaKIw7BwIO/p2EaMzpFZAoYVsZ9EdxQHijX4S0dkLIY qpj6oazEU9+sBnYhq8tEuqJVLK92fgY2vWdQ0EikSPpU/H9qe/XISXll8dNazK2C aP8qBXH3auM0vum23KNTiUX1jXTuZPNPJakcWvmz440YGcRaY9s67E4at//8DEZR nCvEz3uE3VfCpqku2JWkauUN947ac0kSehLvabUqAqycl6cbn7YwV39aIAvHi8dD 6gIzZdoaPc24XcfT6ksnt+IO9WfrFXyR7dL56YYPnflqEqq84btaCQ5UwfXKd1ZX B7rhe9uqvj3z8HONEeKmpBKroxAOPvN6KFpEabXGBrq/UhiL8JFWnKynfZKx1KMp 0kFHKxiwrQM1vzQIrePl8XCi39QpyEcPS5cftQsOffN2v4If872qebsNvr8iEISa sukLhNwg/0XEsYwy2JJHWgWVENjVhwYcaeBEycDEbirPp5Qabvdak7bhFEW5gGBG tUbBJ729BhzpTzIseYA/ONzat7eI264DO5EliJ0T+C9fpr49+f8C5THisXPopdsx AtH0SKOLF93546oR+ANc =cM+5 -----END PGP SIGNATURE----- --Sig_/EYhnUpT.WcatEj+nArKnjMa-- --===============1945650978== 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 --===============1945650978==--