summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerome Glisse <jglisse@redhat.com>2013-10-30 13:01:02 -0400
committerJerome Glisse <jglisse@redhat.com>2013-10-31 10:35:52 -0400
commit0c921edf0162fed616cea9d02e168b719243bcd2 (patch)
treef0703f648e1a262c637b123c7583332ecb284766
parentf1dc677e79cd7a88d7379a934ebc7d87a3b18805 (diff)
radeon/glamor: with new pixmap for dri2 drawable no need to create new texture
When creating a new pixmap/bo for dri2 drawable there is no need to create a new texture, instead the texture associated with the new pixmap should be use otherwise there is a missmatch between the bo backing the texture for the drawable and the bo used by dri2 client. Signed-off-by: Jerome Glisse <jglisse@redhat.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--configure.ac2
-rw-r--r--src/radeon_dri2.c17
2 files changed, 7 insertions, 12 deletions
diff --git a/configure.ac b/configure.ac
index 0fe09910..835b7b9f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -107,7 +107,7 @@ AC_ARG_ENABLE(glamor,
AC_MSG_RESULT([$GLAMOR])
AM_CONDITIONAL(GLAMOR, test x$GLAMOR != xno)
if test "x$GLAMOR" != "xno"; then
- PKG_CHECK_MODULES(LIBGLAMOR, [glamor >= 0.5.1])
+ PKG_CHECK_MODULES(LIBGLAMOR, [glamor >= 0.5.0])
PKG_CHECK_MODULES(LIBGLAMOR_EGL, [glamor-egl])
AC_DEFINE(USE_GLAMOR, 1, [Enable glamor acceleration])
fi
diff --git a/src/radeon_dri2.c b/src/radeon_dri2.c
index a211960c..79d8f397 100644
--- a/src/radeon_dri2.c
+++ b/src/radeon_dri2.c
@@ -66,6 +66,10 @@
#define FALLBACK_SWAP_DELAY 16
+#ifdef USE_GLAMOR
+#include <glamor.h>
+#endif
+
typedef DRI2BufferPtr BufferPtr;
struct dri2_buffer_priv {
@@ -89,7 +93,6 @@ static PixmapPtr fixup_glamor(DrawablePtr drawable, PixmapPtr pixmap)
PixmapPtr old = get_drawable_pixmap(drawable);
#ifdef USE_GLAMOR
ScreenPtr screen = drawable->pScreen;
- ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
struct radeon_pixmap *priv = radeon_get_pixmap_private(pixmap);
GCPtr gc;
@@ -118,21 +121,13 @@ static PixmapPtr fixup_glamor(DrawablePtr drawable, PixmapPtr pixmap)
}
radeon_set_pixmap_private(pixmap, NULL);
- screen->DestroyPixmap(pixmap);
/* And redirect the pixmap to the new bo (for 3D). */
+ glamor_egl_exchange_buffers(old, pixmap);
radeon_set_pixmap_private(old, priv);
+ screen->DestroyPixmap(pixmap);
old->refcnt++;
- /* This creating should not fail, as we already created its
- * successfully. But if it happens, we put a warning indicator
- * here, and the old pixmap will still be a glamor pixmap, and
- * latter the pixmap_flink will get a 0 name, then the X server
- * will pass a BadAlloc to the client.*/
- if (!radeon_glamor_create_textured_pixmap(old))
- xf86DrvMsg(scrn->scrnIndex, X_WARNING,
- "Failed to get DRI drawable for glamor pixmap.\n");
-
screen->ModifyPixmapHeader(old,
old->drawable.width,
old->drawable.height,