]> git.baikalelectronics.ru Git - kernel.git/commit
fbdev: fix fillrect for 24bpp modes
authorMichal Januszewski <spock@gentoo.org>
Wed, 6 May 2009 23:02:56 +0000 (16:02 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 6 May 2009 23:36:10 +0000 (16:36 -0700)
commit78e675e4474e03a6a2c764a0d995d95de065a0d6
treeb3acaf5ac74fc954c518d11616007eab3bc877fd
parent1db9b77d81d15e691ed639ad276e9106454b58f8
fbdev: fix fillrect for 24bpp modes

The software fillrect routines do not work properly when the number of
pixels per machine word is not an integer.  To see that, run the following
command on a fbdev console with a 24bpp video mode, using a
non-accelerated driver such as (u)vesafb:

  reset ; echo -e '\e[41mtest\e[K'

The expected result is 'test' displayed on a line with red background.
Instead of that, 'test' has a red background, but the rest of the line
(rendered using fillrect()) contains a distored colorful pattern.

This patch fixes the problem by correctly computing rotation shifts.  It
has been tested in a 24bpp mode on 32- and 64-bit little-endian machines.

Signed-off-by: Michal Januszewski <spock@gentoo.org>
Acked-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/video/cfbfillrect.c
drivers/video/fb_draw.h
drivers/video/sysfillrect.c