Skip to contentSkip to conversation

New: RADEON KMS: radeon_crtc_cursor_move is off by one pixel

Bug 41158 [email protected] 1 participant 3 messages Sep 23, 2011 – Oct 5, 2011

lore
Share & tools
lore
#0 lore raw

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

Summary: RADEON KMS: radeon_crtc_cursor_move is off by one
pixel
Product: DRI
Version: XOrg CVS
Platform: Other
OS/Version: All
Status: NEW
Severity: normal
Priority: medium
Component: DRM/Radeon
AssignedTo: [email protected]
ReportedBy: [email protected]

Created an attachment (id=51555)
--> (https://bugs.freedesktop.org/attachment.cgi?id=51555)
test cursor theme, unzip into ~/.icons and configure your desktop environment to use it

When the mouse cursor is partially off the top or left edge of the screen, the cursor image is drawn one pixel further to the top or left than the actual position.

This manifests itself in two ways:

1) When the cursor transitions from entirely on the screen to partially offscreen, the image jumps two pixels instead of moving by only one pixel. (Due to the transition from a correctly positioned image to an off-by-one image.)

2) It is possible to move the cursor's hotspot off the screen. (Appearance only, of course, as far as X is concerned the hotspot is still in the uppermost or leftmost row of pixels.)

This seems obvious when you map out what the function actually does to calculate the xorigin and yorigin values, but some doubt was raised based on the wording of the register descriptions in the manuals. (Instead of speaking of offsets or coordinates, the term "length" is used, and it wasn't clear whether this length included the actual hotspot pixel.)

So I tested it empirically by constructing a rather hideous looking cursor theme. It is a 31x31 mouse cursor image with the hotspot on the exact center pixel.

The cursor has a one pixel red border. Immediately inside the red border is one pixel of yellow. You will not be able to position the cursor on the screen such that the outer red border is off the top or left but the inner yellow border is still visible.

There is a one pixel wide yellow cross in the center of the cursor image, with the center pixel of the cross being the cursor's hotspot. Surrounding the yellow cross is a one pixel red border. When you move the cursor to the upper left pixel, the yellow cross vanishes entirely, which shouldn't be possible because you can't move the mouse cursor's hotspot off of the screen.

Neither of these things happen when you use SWcursor.

Testing was done on a RS880. I assume Evergreen is broken in the same way, but I'm not sure about pre-Avivo chips.

Signature · 3 lines
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#1 lore raw

[Bug 41158] RADEON KMS: radeon_crtc_cursor_move is off by one pixel

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

--- Comment #1 from Michel Dänzer <[email protected]> 2011-09-29 10:24:24 PDT --- Indeed, looks like you're right even for pre-AVIVO (tested on RV350).

Can you submit a patch to fix this to the dri-devel list?

Signature · 7 lines
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw

[Bug 41158] RADEON KMS: radeon_crtc_cursor_move is off by one pixel

In reply to [email protected]

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

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

What |Removed |Added
----------------------------------------------------------------------------

             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #2 from Michel Dänzer <[email protected]> 2011-10-05 02:38:36 PDT --- Your fix has landed in Linus' tree as commit b356fe0afe9aa2cfdc7be0bae22ea1c93afc2451, thanks!

Signature · 7 lines
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel