[PATCH 10/14] Fold radeon_glamor_flush into radeon_cs_flush_indirect

Michel Dänzer michel at daenzer.net
Wed Mar 11 23:10:52 PDT 2015


From: Michel Dänzer <michel.daenzer at amd.com>

Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
 src/radeon_glamor.c |  9 ---------
 src/radeon_glamor.h |  4 ----
 src/radeon_kms.c    | 18 +++++++++++-------
 3 files changed, 11 insertions(+), 20 deletions(-)

diff --git a/src/radeon_glamor.c b/src/radeon_glamor.c
index 950f891..f0996fe 100644
--- a/src/radeon_glamor.c
+++ b/src/radeon_glamor.c
@@ -363,15 +363,6 @@ radeon_glamor_init(ScreenPtr screen)
 	return TRUE;
 }
 
-void
-radeon_glamor_flush(ScrnInfoPtr pScrn)
-{
-	RADEONInfoPtr info = RADEONPTR(pScrn);
-
-	if (info->use_glamor)
-		glamor_block_handler(pScrn->pScreen);
-}
-
 XF86VideoAdaptorPtr radeon_glamor_xv_init(ScreenPtr pScreen, int num_adapt)
 {
 	return glamor_xv_init(pScreen, num_adapt);
diff --git a/src/radeon_glamor.h b/src/radeon_glamor.h
index 548ea98..c402a10 100644
--- a/src/radeon_glamor.h
+++ b/src/radeon_glamor.h
@@ -40,8 +40,6 @@ Bool radeon_glamor_init(ScreenPtr screen);
 Bool radeon_glamor_create_screen_resources(ScreenPtr screen);
 void radeon_glamor_free_screen(int scrnIndex, int flags);
 
-void radeon_glamor_flush(ScrnInfoPtr pScrn);
-
 Bool radeon_glamor_create_textured_pixmap(PixmapPtr pixmap);
 void radeon_glamor_exchange_buffers(PixmapPtr src, PixmapPtr dst);
 
@@ -56,8 +54,6 @@ static inline Bool radeon_glamor_init(ScreenPtr screen) { return FALSE; }
 static inline Bool radeon_glamor_create_screen_resources(ScreenPtr screen) { return FALSE; }
 static inline void radeon_glamor_free_screen(int scrnIndex, int flags) { }
 
-static inline void radeon_glamor_flush(ScrnInfoPtr pScrn) { }
-
 static inline Bool radeon_glamor_create_textured_pixmap(PixmapPtr pixmap) { return TRUE; }
 
 static inline void radeon_glamor_exchange_buffers(PixmapPtr src, PixmapPtr dst) {}
diff --git a/src/radeon_kms.c b/src/radeon_kms.c
index 23c0694..d25d7f5 100644
--- a/src/radeon_kms.c
+++ b/src/radeon_kms.c
@@ -84,12 +84,21 @@ const OptionInfoRec *RADEONOptionsWeak(void) { return RADEONOptions_KMS; }
 void radeon_cs_flush_indirect(ScrnInfoPtr pScrn)
 {
     RADEONInfoPtr  info = RADEONPTR(pScrn);
-    struct radeon_accel_state *accel_state = info->accel_state;
+    struct radeon_accel_state *accel_state;
     int ret;
 
+#ifdef USE_GLAMOR
+    if (info->use_glamor) {
+	glamor_block_handler(pScrn->pScreen);
+	return;
+    }
+#endif
+
     if (!info->cs->cdw)
 	return;
 
+    accel_state = info->accel_state;
+
     /* release the current VBO so we don't block on mapping it later */
     if (info->accel_state->vbo.vb_offset && info->accel_state->vbo.vb_bo) {
         radeon_vbo_put(pScrn, &info->accel_state->vbo);
@@ -307,9 +316,6 @@ static void RADEONBlockHandler_KMS(BLOCKHANDLER_ARGS_DECL)
     (*pScreen->BlockHandler) (BLOCKHANDLER_ARGS);
     pScreen->BlockHandler = RADEONBlockHandler_KMS;
 
-    if (info->use_glamor)
-	radeon_glamor_flush(pScrn);
-
     radeon_cs_flush_indirect(pScrn);
 #ifdef RADEON_PIXMAP_SHARING
     radeon_dirty_update(pScreen);
@@ -322,10 +328,8 @@ radeon_flush_callback(CallbackListPtr *list,
 {
     ScrnInfoPtr pScrn = user_data;
 
-    if (pScrn->vtSema) {
+    if (pScrn->vtSema)
         radeon_cs_flush_indirect(pScrn);
-	radeon_glamor_flush(pScrn);
-    }
 }
 
 static Bool RADEONIsFastFBWorking(ScrnInfoPtr pScrn)
-- 
2.1.4



More information about the xorg-driver-ati mailing list