xf86-video-ati: Branch 'master' - 2 commits

Michel Dänzer daenzer at kemper.freedesktop.org
Wed Mar 18 02:42:56 PDT 2015


 src/radeon_dri3.c    |   15 +++++++++++++--
 src/radeon_glamor.h  |    1 +
 src/radeon_present.c |   28 ++++++++++++++++++++++++++++
 3 files changed, 42 insertions(+), 2 deletions(-)

New commits:
commit 9fc7964a7fbc0a6a45e05e1ae4f5a96f1a02144c
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Wed Mar 18 18:29:27 2015 +0900

    dri3: Use screen->CreatePixmap instead of fbCreatePixmap directly
    
    Fixes crash with EXA reported by "marvin24" on IRC.

diff --git a/src/radeon_dri3.c b/src/radeon_dri3.c
index 6fc14fc..3a7322e 100644
--- a/src/radeon_dri3.c
+++ b/src/radeon_dri3.c
@@ -118,11 +118,12 @@ static PixmapPtr radeon_dri3_pixmap_from_fd(ScreenPtr screen,
 		return NULL;
 	}
 
-	pixmap = fbCreatePixmap(screen, 0, 0, depth, 0);
+	pixmap = screen->CreatePixmap(screen, 0, 0, depth, 0);
 	if (!pixmap)
 		return NULL;
 
-	if (!screen->ModifyPixmapHeader(pixmap, width, height, 0, 0, stride, NULL))
+	if (!screen->ModifyPixmapHeader(pixmap, width, height, 0, bpp, stride,
+					NULL))
 		goto free_pixmap;
 
 	if (screen->SetSharedPixmapBacking(pixmap, (void*)(intptr_t)fd))
commit aa55e2a3a68a512e00f9cbd492440fac6e50fba7
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Wed Mar 18 12:56:07 2015 +0900

    glamor: Avoid generating GEM flink names for BOs shared via DRI3

diff --git a/src/radeon_dri3.c b/src/radeon_dri3.c
index ea0f28b..6fc14fc 100644
--- a/src/radeon_dri3.c
+++ b/src/radeon_dri3.c
@@ -96,6 +96,16 @@ static PixmapPtr radeon_dri3_pixmap_from_fd(ScreenPtr screen,
 {
 	PixmapPtr pixmap;
 
+#ifdef USE_GLAMOR
+	/* Avoid generating a GEM flink name if possible */
+	if (RADEONPTR(xf86ScreenToScrn(screen))->use_glamor) {
+		pixmap = glamor_pixmap_from_fd(screen, fd, width, height,
+					       stride, depth, bpp);
+		if (pixmap)
+			return pixmap;
+	}
+#endif
+
 	if (depth < 8)
 		return NULL;
 
diff --git a/src/radeon_glamor.h b/src/radeon_glamor.h
index f450f0e..7cef1a9 100644
--- a/src/radeon_glamor.h
+++ b/src/radeon_glamor.h
@@ -37,6 +37,7 @@
 
 #ifndef GLAMOR_NO_DRI3
 #define glamor_fd_from_pixmap glamor_dri3_fd_from_pixmap
+#define glamor_pixmap_from_fd glamor_egl_dri3_pixmap_from_fd
 #endif
 
 Bool radeon_glamor_pre_init(ScrnInfoPtr scrn);
diff --git a/src/radeon_present.c b/src/radeon_present.c
index 0aa96cf..d383e33 100644
--- a/src/radeon_present.c
+++ b/src/radeon_present.c
@@ -42,6 +42,8 @@
 #include <time.h>
 #include <errno.h>
 
+#include "radeon_bo_helper.h"
+#include "radeon_glamor.h"
 #include "radeon_video.h"
 
 #include "present.h"
@@ -292,6 +294,32 @@ radeon_present_flip(RRCrtcPtr crtc, uint64_t event_id, uint64_t target_msc,
 	return FALSE;
 
     bo = radeon_get_pixmap_bo(pixmap);
+#ifdef USE_GLAMOR
+    if (!bo && RADEONPTR(scrn)->use_glamor) {
+	CARD16 stride;
+	CARD32 size;
+	int fd;
+
+	fd = glamor_fd_from_pixmap(screen, pixmap, &stride, &size);
+
+	if (fd >= 0) {
+	    struct radeon_surface surface;
+
+	    if (radeon_set_shared_pixmap_backing(pixmap,
+						 (void*)(intptr_t)fd,
+						 &surface)) {
+		struct radeon_pixmap *priv = radeon_get_pixmap_private(pixmap);
+
+		priv->stride = stride;
+		priv->surface = surface;
+
+		bo = priv->bo;
+	    }
+
+	    close(fd);
+	}
+    }
+#endif
     if (!bo)
 	return FALSE;
 


More information about the xorg-commit mailing list