[PATCH 09/14] Move #include "radeon_glamor.h" from radeon.h to where it's needed

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


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

Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
 src/drmmode_display.c |  1 +
 src/radeon.h          | 36 ++++++++++++++++++++++++++++++++++--
 src/radeon_accel.c    |  1 +
 src/radeon_dri2.c     |  4 +---
 src/radeon_glamor.c   |  3 +--
 src/radeon_glamor.h   | 31 +++----------------------------
 src/radeon_kms.c      |  1 +
 src/radeon_video.c    |  1 +
 8 files changed, 43 insertions(+), 35 deletions(-)

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index e90a33f..d4c0d4d 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -36,6 +36,7 @@
 #include "micmap.h"
 #include "xf86cmap.h"
 #include "radeon.h"
+#include "radeon_glamor.h"
 #include "radeon_reg.h"
 
 #include "drmmode_display.h"
diff --git a/src/radeon.h b/src/radeon.h
index 88a0bd5..e503cbb 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -51,8 +51,6 @@
 
 #include "exa.h"
 
-#include "radeon_glamor.h"
-
 				/* Exa and Cursor Support */
 #include "xf86Cursor.h"
 
@@ -242,6 +240,40 @@ typedef enum {
 #define CURSOR_WIDTH_CIK	128
 #define CURSOR_HEIGHT_CIK	128
 
+
+#ifdef USE_GLAMOR
+
+struct radeon_pixmap {
+	struct radeon_surface surface;
+	struct radeon_bo *bo;
+
+	uint32_t tiling_flags;
+	int stride;
+};
+
+#if HAS_DEVPRIVATEKEYREC
+extern DevPrivateKeyRec glamor_pixmap_index;
+#else
+extern int glamor_pixmap_index;
+#endif
+
+static inline struct radeon_pixmap *radeon_get_pixmap_private(PixmapPtr pixmap)
+{
+#if HAS_DEVPRIVATEKEYREC
+	return dixGetPrivate(&pixmap->devPrivates, &glamor_pixmap_index);
+#else
+	return dixLookupPrivate(&pixmap->devPrivates, &glamor_pixmap_index);
+#endif
+}
+
+static inline void radeon_set_pixmap_private(PixmapPtr pixmap, struct radeon_pixmap *priv)
+{
+	dixSetPrivate(&pixmap->devPrivates, &glamor_pixmap_index, priv);
+}
+
+#endif /* USE_GLAMOR */
+
+
 struct radeon_exa_pixmap_priv {
     struct radeon_bo *bo;
     uint32_t tiling_flags;
diff --git a/src/radeon_accel.c b/src/radeon_accel.c
index 8eff5c5..1def2a3 100644
--- a/src/radeon_accel.c
+++ b/src/radeon_accel.c
@@ -78,6 +78,7 @@
 #include <assert.h>
 				/* Driver data structures */
 #include "radeon.h"
+#include "radeon_glamor.h"
 #include "radeon_reg.h"
 #include "r600_reg.h"
 #include "radeon_probe.h"
diff --git a/src/radeon_dri2.c b/src/radeon_dri2.c
index ee04be8..6adf93f 100644
--- a/src/radeon_dri2.c
+++ b/src/radeon_dri2.c
@@ -53,9 +53,7 @@
 
 #define FALLBACK_SWAP_DELAY 16
 
-#ifdef USE_GLAMOR
-#include <glamor.h>
-#endif
+#include "radeon_glamor.h"
 
 typedef DRI2BufferPtr BufferPtr;
 
diff --git a/src/radeon_glamor.c b/src/radeon_glamor.c
index 210ddcf..950f891 100644
--- a/src/radeon_glamor.c
+++ b/src/radeon_glamor.c
@@ -29,11 +29,10 @@
 #endif
 
 #include <xf86.h>
-#define GLAMOR_FOR_XORG  1
-#include <glamor.h>
 
 #include "radeon.h"
 #include "radeon_bo_helper.h"
+#include "radeon_glamor.h"
 
 #if HAS_DEVPRIVATEKEYREC
 DevPrivateKeyRec glamor_pixmap_index;
diff --git a/src/radeon_glamor.h b/src/radeon_glamor.h
index 36addd7..548ea98 100644
--- a/src/radeon_glamor.h
+++ b/src/radeon_glamor.h
@@ -30,6 +30,9 @@
 #include "xf86xv.h"
 #ifdef USE_GLAMOR
 
+#define GLAMOR_FOR_XORG  1
+#include <glamor.h>
+
 #include "radeon_surface.h"
 
 Bool radeon_glamor_pre_init(ScrnInfoPtr scrn);
@@ -46,34 +49,6 @@ Bool radeon_glamor_pixmap_is_offscreen(PixmapPtr pixmap);
 
 XF86VideoAdaptorPtr radeon_glamor_xv_init(ScreenPtr pScreen, int num_adapt);
 
-struct radeon_pixmap {
-	struct radeon_surface surface;
-	struct radeon_bo *bo;
-
-	uint32_t tiling_flags;
-	int stride;
-};
-
-#if HAS_DEVPRIVATEKEYREC
-extern DevPrivateKeyRec glamor_pixmap_index;
-#else
-extern int glamor_pixmap_index;
-#endif
-
-static inline struct radeon_pixmap *radeon_get_pixmap_private(PixmapPtr pixmap)
-{
-#if HAS_DEVPRIVATEKEYREC
-	return dixGetPrivate(&pixmap->devPrivates, &glamor_pixmap_index);
-#else
-	return dixLookupPrivate(&pixmap->devPrivates, &glamor_pixmap_index);
-#endif
-}
-
-static inline void radeon_set_pixmap_private(PixmapPtr pixmap, struct radeon_pixmap *priv)
-{
-	dixSetPrivate(&pixmap->devPrivates, &glamor_pixmap_index, priv);
-}
-
 #else
 
 static inline Bool radeon_glamor_pre_init(ScrnInfoPtr scrn) { return FALSE; }
diff --git a/src/radeon_kms.c b/src/radeon_kms.c
index ced3594..23c0694 100644
--- a/src/radeon_kms.c
+++ b/src/radeon_kms.c
@@ -33,6 +33,7 @@
 /* Driver data structures */
 #include "radeon.h"
 #include "radeon_drm_queue.h"
+#include "radeon_glamor.h"
 #include "radeon_reg.h"
 #include "radeon_probe.h"
 #include "micmap.h"
diff --git a/src/radeon_video.c b/src/radeon_video.c
index cbfd554..f66ba55 100644
--- a/src/radeon_video.c
+++ b/src/radeon_video.c
@@ -9,6 +9,7 @@
 #include <math.h>
 
 #include "radeon.h"
+#include "radeon_glamor.h"
 #include "radeon_reg.h"
 #include "radeon_probe.h"
 #include "radeon_video.h"
-- 
2.1.4



More information about the xorg-driver-ati mailing list