forked from pool/xorg-x11-server
Accepting request 243884 from home:tiwai:branches:X11:XOrg
- Fix corrupted graphics with 24bpp on cirrus KMS (bnc#890599) two patches added: U_render-Don-t-generate-invalid-pixman-format-when-using-a-24bpp-framebuffer-with-a-32bit-depth-visual.patch U_fb-Correctly-implement-CopyArea-when-using-a-window-with-depth-32-and-24bpp.patch OBS-URL: https://build.opensuse.org/request/show/243884 OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/xorg-x11-server?expand=0&rev=530
This commit is contained in:
parent
4fe2418668
commit
64dea9ecde
@ -0,0 +1,44 @@
|
||||
From patchwork Fri Jun 6 11:52:13 2014
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
Subject: fb: Correctly implement CopyArea when using a window with depth 32
|
||||
and 24bpp.
|
||||
From: Robert Ancell <robert.ancell@canonical.com>
|
||||
X-Patchwork-Id: 27263
|
||||
Message-Id: <1402055533-9866-1-git-send-email-robert.ancell@canonical.com>
|
||||
To: xorg-devel@lists.x.org
|
||||
Cc: Robert Ancell <robert.ancell@canonical.com>
|
||||
Date: Fri, 6 Jun 2014 23:52:13 +1200
|
||||
|
||||
When using the fb backend at 24bpp it allows a visual with 32 bit depth.
|
||||
When using CopyArea from a 32bpp pixmap to a window with a 32 bit depth it would
|
||||
read the ARGB as RGB.
|
||||
|
||||
Fix is to correctly ignore the alpha channel in the pixmap when copying.
|
||||
|
||||
---
|
||||
fb/fbcopy.c | 10 +++++++++-
|
||||
fb/fbcopy.c | 10 +++++++++-
|
||||
1 file changed, 9 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/fb/fbcopy.c
|
||||
+++ b/fb/fbcopy.c
|
||||
@@ -242,8 +242,16 @@ fbCopyArea(DrawablePtr pSrcDrawable,
|
||||
int xIn, int yIn, int widthSrc, int heightSrc, int xOut, int yOut)
|
||||
{
|
||||
miCopyProc copy;
|
||||
+ int src_bpp, dst_bpp;
|
||||
|
||||
- if (pSrcDrawable->bitsPerPixel != pDstDrawable->bitsPerPixel)
|
||||
+ src_bpp = pSrcDrawable->bitsPerPixel;
|
||||
+ if (src_bpp < pSrcDrawable->depth)
|
||||
+ src_bpp = BitsPerPixel (pSrcDrawable->depth);
|
||||
+ dst_bpp = pDstDrawable->bitsPerPixel;
|
||||
+ if (dst_bpp < pDstDrawable->depth)
|
||||
+ dst_bpp = BitsPerPixel (pDstDrawable->depth);
|
||||
+
|
||||
+ if (src_bpp != dst_bpp)
|
||||
copy = fb24_32CopyMtoN;
|
||||
else
|
||||
copy = fbCopyNtoN;
|
@ -0,0 +1,43 @@
|
||||
From patchwork Fri Jun 6 04:36:59 2014
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
Subject: render: Don't generate invalid pixman format when using a 24bpp
|
||||
framebuffer with a 32bit depth visual.
|
||||
From: Robert Ancell <robert.ancell@canonical.com>
|
||||
X-Patchwork-Id: 27240
|
||||
Message-Id: <1402029419-6400-1-git-send-email-robert.ancell@canonical.com>
|
||||
To: xorg-devel@lists.x.org
|
||||
Cc: Robert Ancell <robert.ancell@canonical.com>
|
||||
Date: Fri, 6 Jun 2014 16:36:59 +1200
|
||||
|
||||
When using the fb backend at 24bpp it allows a visual with 32 bit depth.
|
||||
This would cause RENDER to try and create an invalid pixman buffer and hit the
|
||||
following assertion when trying to render to it:
|
||||
|
||||
---
|
||||
render/picture.c | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/render/picture.c
|
||||
+++ b/render/picture.c
|
||||
@@ -762,6 +762,7 @@ CreatePicture(Picture pid,
|
||||
{
|
||||
PicturePtr pPicture;
|
||||
PictureScreenPtr ps = GetPictureScreen(pDrawable->pScreen);
|
||||
+ int bpp;
|
||||
|
||||
pPicture = dixAllocateScreenObjectWithPrivates(pDrawable->pScreen,
|
||||
PictureRec, PRIVATE_PICTURE);
|
||||
@@ -773,7 +774,10 @@ CreatePicture(Picture pid,
|
||||
pPicture->id = pid;
|
||||
pPicture->pDrawable = pDrawable;
|
||||
pPicture->pFormat = pFormat;
|
||||
- pPicture->format = pFormat->format | (pDrawable->bitsPerPixel << 24);
|
||||
+ bpp = pDrawable->bitsPerPixel;
|
||||
+ if (bpp < pFormat->depth)
|
||||
+ bpp = BitsPerPixel (pFormat->depth);
|
||||
+ pPicture->format = pFormat->format | (bpp << 24);
|
||||
|
||||
/* security creation/labeling check */
|
||||
*error = XaceHook(XACE_RESOURCE_ACCESS, client, pid, PictureType, pPicture,
|
@ -1,3 +1,11 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Aug 7 14:50:55 CEST 2014 - tiwai@suse.de
|
||||
|
||||
- Fix corrupted graphics with 24bpp on cirrus KMS (bnc#890599)
|
||||
two patches added:
|
||||
U_render-Don-t-generate-invalid-pixman-format-when-using-a-24bpp-framebuffer-with-a-32bit-depth-visual.patch
|
||||
U_fb-Correctly-implement-CopyArea-when-using-a-window-with-depth-32-and-24bpp.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Aug 5 06:19:04 UTC 2014 - eich@suse.com
|
||||
|
||||
|
@ -152,6 +152,8 @@ Patch110: u_connection-avoid-crash-when-CloseWellKnownConnections-gets-cal
|
||||
Patch111: u_CloseConsole-Don-t-report-FatalError-when-shutting-down.patch
|
||||
Patch112: u_render-Cast-color-masks-to-unsigned-long-before-shifting-them.patch
|
||||
Patch130: U_BellProc-Send-bell-event-on-core-protocol-bell-when-requested.patch
|
||||
Patch131: U_render-Don-t-generate-invalid-pixman-format-when-using-a-24bpp-framebuffer-with-a-32bit-depth-visual.patch
|
||||
Patch132: U_fb-Correctly-implement-CopyArea-when-using-a-window-with-depth-32-and-24bpp.patch
|
||||
|
||||
Patch1000: n_xserver-optimus-autoconfig-hack.patch
|
||||
|
||||
@ -231,6 +233,8 @@ cp %{SOURCE90} .
|
||||
%patch111 -p1
|
||||
%patch112 -p1
|
||||
%patch130 -p1
|
||||
%patch131 -p1
|
||||
%patch132 -p1
|
||||
%patch1000 -p1
|
||||
|
||||
### disabled for now
|
||||
|
Loading…
Reference in New Issue
Block a user