[PATCH] drm/fb: don't call driver set_config if display isn't panned

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <jbarnes@xxxxxxxxxxxxxxxx>

diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.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 = var->xoffset;
 		modeset->y = var->yoffset;
 
-		if (modeset->num_connectors) {
+		if (((modeset->x != crtc->x) || (modeset->y != crtc->y)) &&
+		    modeset->num_connectors) {
 			ret = crtc->funcs->set_config(modeset);
 			if (!ret) {
 				info->var.xoffset = var->xoffset;

Attachment: signature.asc
Description: PGP signature

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel

[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux