mach64: fix cursor when character width is not a multiple of 8 pixels
authorMikulas Patocka <mpatocka@redhat.com>
Thu, 23 Jan 2014 19:41:59 +0000 (14:41 -0500)
committerJiri Slaby <jslaby@suse.cz>
Thu, 15 May 2014 07:55:58 +0000 (09:55 +0200)
commitcff94c1492a2da35f8b2ab9b06c772a66277b027
treef06bc9a5a669a664e219046ecb9ba3b4becd7b7a
parent7aee7576532436a37bfad1a0ee973ccb40ebb023
mach64: fix cursor when character width is not a multiple of 8 pixels

commit 43751a1b8ee2e70ce392bf31ef3133da324e68b3 upstream.

This patch fixes the hardware cursor on mach64 when font width is not a
multiple of 8 pixels.

If you load such a font, the cursor is expanded to the next 8-byte
boundary and a part of the next character after the cursor is not
visible.
For example, when you load a font with 12-pixel width, the cursor width
is 16 pixels and when the cursor is displayed, 4 pixels of the next
character are not visible.

The reason is this: atyfb_cursor is called with proper parameters to
load an image that is 12-pixel wide. However, the number is aligned on
the next 8-pixel boundary on the line
"unsigned int width = (cursor->image.width + 7) >> 3;" and the whole
function acts as it is was loading a 16-pixel image.

This patch fixes it so that the value written to the framebuffer is
padded with 0xaaaa (the transparent pattern) when the image size it not
a multiple of 8 pixels. The transparent pattern causes that the cursor
will not interfere with the next character.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/video/aty/mach64_cursor.c