SHA256
1
0
forked from pool/Mesa

- updated to latest available version of

* u_mesa-8.0-llvmpipe-shmget.patch
  * u_mesa-8.0.1-fix-16bpp.patch
  and applying it now in the opposite order.

OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/Mesa?expand=0&rev=325
This commit is contained in:
Stefan Dirsch 2013-09-16 13:16:25 +00:00 committed by Git OBS Bridge
parent ef687dd16a
commit 394bdb02b1
4 changed files with 140 additions and 18 deletions

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Mon Sep 16 12:44:53 UTC 2013 - sndirsch@suse.com
- updated to latest available version of
* u_mesa-8.0-llvmpipe-shmget.patch
* u_mesa-8.0.1-fix-16bpp.patch
and applying it now in the opposite order.
-------------------------------------------------------------------
Fri Sep 13 12:53:33 UTC 2013 - duwe@suse.com

View File

@ -528,8 +528,8 @@ poor video quality, choppy videos and artefacts all over.
# remove some docs
rm -rf docs/README.{VMS,WIN32,OS2}
#%patch11 -p1
%patch13 -p1
%patch15 -p1
%patch13 -p1
%if %egl_gallium
%patch16 -p1
%endif

View File

@ -1,3 +1,43 @@
From c617fb498b2315efdccd799b8efb7a18a758fb36 Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Thu, 22 Mar 2012 09:29:19 +0000
Subject: [PATCHv4] glx: Use ShmGetImage if possible.
v2: Adam Jackson <ajax@redhat.com>
Fix image pitch bug.
v3: Adam Jackson <ajax@redhat.com>
Rediff for 8.1
v4: Stefan Brüns <stefan.bruens@rwth-aachen.de>
The patch handles failing XShmAttach with a special error handler, but in case
of an error it called XShmDetach unconditionally and unprotected. As there is
no XSync it failed later on the first call to a function causing a XSync.
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=917687
Bugzilla: https://bugzilla.novell.com/show_bug.cgi?id=807205
---
NOTE:
v3 has not been applied on Fedora for a while (since 9.0):
http://pkgs.fedoraproject.org/cgit/mesa.git/commit/?h=f18&id=9058f5a
# this fastpath is:
# - broken with swrast classic
# - broken on 24bpp
# - not a huge win anyway
# - ABI-broken wrt upstream
# - eventually obsoleted by vgem
#
# dear ajax: fix this one way or the other
#patch9 -p1 -b .shmget
#patch12 -p1 -b .16bpp
v4 solves an issue on openSUSE:12.2.
---
src/gallium/state_trackers/dri/sw/drisw.c | 11 ---
src/glx/drisw_glx.c | 114 +++++++++++++++++++++++++++++-
2 files changed, 113 insertions(+), 12 deletions(-)
diff --git a/src/gallium/state_trackers/dri/sw/drisw.c b/src/gallium/state_trackers/dri/sw/drisw.c
index 41f66d5..28beb80 100644
--- a/src/gallium/state_trackers/dri/sw/drisw.c
@ -8,13 +48,13 @@ index 41f66d5..28beb80 100644
int x, y, w, h;
- int ximage_stride, line;
- int cpp = util_format_get_blocksize(res->format);
get_drawable_info(dPriv, &x, &y, &w, &h);
@@ -265,15 +263,6 @@ drisw_update_tex_buffer(struct dri_drawable *drawable,
/* Copy the Drawable content to the mapped texture buffer */
get_image(dPriv, x, y, w, h, map);
- /* The pipe transfer has a pitch rounded up to the nearest 64 pixels.
- get_image() has a pitch rounded up to 4 bytes. */
- ximage_stride = ((w * cpp) + 3) & -4;
@ -26,14 +66,14 @@ index 41f66d5..28beb80 100644
-
pipe_transfer_unmap(pipe, transfer);
}
diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c
index 832e964..feac747 100644
index 0583cd1..5643f15 100644
--- a/src/glx/drisw_glx.c
+++ b/src/glx/drisw_glx.c
@@ -24,6 +24,9 @@
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
#include <X11/Xlib.h>
+#include <sys/ipc.h>
+#include <sys/shm.h>
@ -44,8 +84,8 @@ index 832e964..feac747 100644
@@ -206,6 +209,96 @@ swrastPutImage(__DRIdrawable * draw, int op,
ximage->data = NULL;
}
+static int shm_error;
+static int shm_error = 0;
+
+static int
+shm_handler(Display *d, XErrorEvent *e)
@ -79,7 +119,7 @@ index 832e964..feac747 100644
+ XShmSegmentInfo seg = { 0, -1, (void *)-1, 0 };
+ int (*old_handler)(Display *, XErrorEvent *);
+
+ if (!XShmQueryExtension(dpy))
+ if (shm_error || !XShmQueryExtension(dpy))
+ goto out;
+
+ /* image setup */
@ -126,8 +166,8 @@ index 832e964..feac747 100644
+out:
+ ximage->obdata = NULL;
+ ximage->data = NULL;
+ shm_error = 0;
+ XShmDetach(dpy, &seg);
+ if (shm_error == 0)
+ XShmDetach(dpy, &seg);
+ if (seg.shmaddr != (void *)-1)
+ shmdt(seg.shmaddr);
+ if (seg.shmid > -1)
@ -138,15 +178,15 @@ index 832e964..feac747 100644
static void
swrastGetImage(__DRIdrawable * read,
int x, int y, int w, int h,
@@ -220,11 +313,17 @@ swrastGetImage(__DRIdrawable * read,
@@ -220,13 +313,32 @@ swrastGetImage(__DRIdrawable * read,
readable = pread->xDrawable;
ximage = prp->ximage;
- ximage->data = data;
ximage->width = w;
ximage->height = h;
ximage->bytes_per_line = bytes_per_line(w * ximage->bits_per_pixel, 32);
+ /* XXX check dimensions, if any caller ever sub-images */
+ if (swrastShmGetImage(read, data, prp))
+ return;
@ -155,5 +195,23 @@ index 832e964..feac747 100644
+ ximage->data = data;
+
XGetSubImage(dpy, readable, x, y, w, h, ~0L, ZPixmap, ximage, 0, 0);
+ do {
+ int dst_width = align(ximage->width * ximage->bits_per_pixel / 8, 256);
+ int line;
+
+ if (dst_width != ximage->bytes_per_line) {
+ for (line = ximage->height-1; line; line--) {
+ memmove(&data[dst_width * line],
+ &data[ximage->bytes_per_line * line],
+ dst_width);
+ }
+ }
+ } while (0);
+
ximage->data = NULL;
}
--
1.8.1.4

View File

@ -1,9 +1,61 @@
From 60fe1551667dba2cb9afa085fdff0cbc351a3e73 Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Mon, 2 Apr 2012 16:27:19 +0000
Subject: [PATCH 2/2] glx: Fix 16bpp in llvmpipe.
v2: Richard Hughes <richard@hughsie.com>
Rebuild with new git snapshot
- Remove upstreamed patches
v3: Johannes Obermayr <johannesobermayr@gmx.de>
Revert changes made in v2.
---
v2 has not been applied on Fedora for a while (since 9.0):
http://pkgs.fedoraproject.org/cgit/mesa.git/commit/?h=f18&id=9058f5a
# this fastpath is:
# - broken with swrast classic
# - broken on 24bpp
# - not a huge win anyway
# - ABI-broken wrt upstream
# - eventually obsoleted by vgem
#
# dear ajax: fix this one way or the other
#patch9 -p1 -b .shmget
#patch12 -p1 -b .16bpp
This "broken on 24bpp" could be because v2 removed changes which depend on
XShmGetImage patch. I assume Richard didn't notice this dependency and thought
changes were upstreamed:
http://pkgs.fedoraproject.org/cgit/mesa.git/commit/?id=43e76b8
So revert v2 and apply XShmGetImage patch before.
---
src/glx/drisw_glx.c | 4 +++-
src/mesa/state_tracker/st_manager.c | 3 +++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c
index 08fa1d9..f94fa4b 100644
--- a/src/glx/drisw_glx.c
+++ b/src/glx/drisw_glx.c
@@ -277,7 +277,9 @@ swrastShmGetImage(__DRIdrawable *read, char *data, struct drisw_drawable *prp)
do {
int i;
char *src = ximage->data;
- int dst_width = align(ximage->width * ximage->bits_per_pixel / 8, 256);
+ int bytes_per_pixel = ((ximage->bits_per_pixel + 7) / 8);
+ int dst_width = align(ximage->width * bytes_per_pixel,
+ 64 * bytes_per_pixel);
for (i = 0; i < ximage->height; i++) {
memcpy(data, src, ximage->bytes_per_line);
diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c
index 9c2b4d2..660ab16 100644
index 9c2b4d2..c6a3189 100644
--- a/src/mesa/state_tracker/st_manager.c
+++ b/src/mesa/state_tracker/st_manager.c
@@ -512,6 +512,9 @@ st_context_teximage(struct st_context_iface *stctxi,
if (util_format_has_alpha(tex->format))
internalFormat = GL_RGBA;
+ else if (util_format_get_component_bits(pipe_format,
@ -11,3 +63,7 @@ index 9c2b4d2..660ab16 100644
+ internalFormat = GL_RGB5;
else
internalFormat = GL_RGB;
--
1.8.1.4