Skip to contentSkip to conversation

drm/radeon: Try harder to avoid HW cursor ending on a multiple of 128 columns.

PATCH Applied Michel Dänzer 3 participants 4 messages Jul 17, 2012 – Jul 20, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 drm/radeon: Try harder to avoid HW cursor ending on a multiple of 128 columns.

From: Michel Dänzer <[email protected]>

This could previously fail if either of the enabled displays was using a horizontal resolution that is a multiple of 128, and only the leftmost column of the cursor was (supposed to be) visible at the right edge of that display.

The solution is to move the cursor one pixel to the left in that case.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=33183

---
 drivers/gpu/drm/radeon/radeon_cursor.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/radeon/radeon_cursor.c +7 -1
index 42acc64..711e95a 100644
@@ -262,8 +262,14 @@ int radeon_crtc_cursor_move(struct drm_crtc *crtc,
 				if (!(cursor_end & 0x7f))
 					w--;
 			}
-			if (w <= 0)
+			if (w <= 0) {
 				w = 1;
+				cursor_end = x - xorigin + w;
+				if (!(cursor_end & 0x7f)) {
+					x--;
+					WARN_ON_ONCE(x < 0);
+				}
+			}
 		}
 	}
 
Signature · 6 lines
1.7.10

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

Ignore the 1/2, there's no second patch.

Signature · 2 lines
Earthling Michel Dänzer           |                   http://www.amd.com
Libre software enthusiast         |          Debian, X and DRI developer
Reviewed-by on v1 1/2
#2 lore raw
In reply to Michel Dänzer
Quoted 6 lines · Michel Dänzer

From: Michel Dänzer <[email protected]>

This could previously fail if either of the enabled displays was using a horizontal resolution that is a multiple of 128, and only the leftmost column of the cursor was (supposed to be) visible at the right edge of that display.

Quoted 6 lines

The solution is to move the cursor one pixel to the left in that case.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=33183

Quoted 31 lines
---
 drivers/gpu/drm/radeon/radeon_cursor.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/radeon/radeon_cursor.c +7 -2
index 42acc64..711e95a 100644
@@ -262,8 +262,14 @@ int radeon_crtc_cursor_move(struct drm_crtc *crtc,
                                if (!(cursor_end & 0x7f))
                                        w--;
                        }
-                       if (w <= 0)
+                       if (w <= 0) {
                                w = 1;
+                               cursor_end = x - xorigin + w;
+                               if (!(cursor_end & 0x7f)) {
+                                       x--;
+                                       WARN_ON_ONCE(x < 0);
+                               }
+                       }
                }
        }
 
--

1.7.10

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

maintainer Applied
#3 lore raw
Quoted 7 lines · Alex Deucher
Quoted 6 lines · Michel Dänzer

From: Michel Dänzer <[email protected]>

This could previously fail if either of the enabled displays was using a horizontal resolution that is a multiple of 128, and only the leftmost column of the cursor was (supposed to be) visible at the right edge of that display.

Quoted 9 lines
Quoted 6 lines

The solution is to move the cursor one pixel to the left in that case.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=33183

Applied to -next,

Thanks,
Dave.