mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-01-06 20:10:14 +01:00
fb: Fix invalid bpp for 24bit depth window
We have a hack in fb layer for a 24bpp screen to use 32bpp images, and
fbCreateWindow() replaces its drawable.bitsPerPixel field
appropriately. But, the problem is that it always replaces when 32bpp
is passed. If the depth is 32, this results in bpp < depth, which is
actually invalid.
Meanwhile, fbCreatePixmap() has a more check and it creates with 24bpp
only when the passed depth <= 24 for avoiding such a problem.
This oneliner patch just adds the similar check in fbCreateWindow().
This (hopefully) fixes the long-standing broken graphics mess of
cirrus KMS with 24bpp.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit fe5018e056)
Signed-off-by: Julien Cristau <jcristau@debian.org>
This commit is contained in:
parent
0e0951ce3e
commit
f7ca20cacf
1 changed files with 1 additions and 1 deletions
|
|
@ -33,7 +33,7 @@ fbCreateWindow(WindowPtr pWin)
|
|||
{
|
||||
dixSetPrivate(&pWin->devPrivates, fbGetWinPrivateKey(pWin),
|
||||
fbGetScreenPixmap(pWin->drawable.pScreen));
|
||||
if (pWin->drawable.bitsPerPixel == 32)
|
||||
if (pWin->drawable.bitsPerPixel == 32 && pWin->drawable.depth <= 24)
|
||||
pWin->drawable.bitsPerPixel =
|
||||
fbGetScreenPrivate(pWin->drawable.pScreen)->win32bpp;
|
||||
return TRUE;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue