[Nouveau] [PATCH resend] drm/nouveau: move definition of nouveau_grctx to separate file

Marcin Slusarz marcin.slusarz at gmail.com
Sun Apr 15 05:36:10 PDT 2012


Avoids conditional definition of grctx build functions, which is hard
for IDE's to handle properly.

Signed-off-by: Marcin Slusarz <marcin.slusarz at gmail.com>
---
 drivers/gpu/drm/nouveau/nouveau_grctx.h     |   21 ++-------------------
 drivers/gpu/drm/nouveau/nouveau_grctx_def.h |   21 +++++++++++++++++++++
 drivers/gpu/drm/nouveau/nv40_graph.c        |    2 +-
 drivers/gpu/drm/nouveau/nv50_graph.c        |    2 +-
 4 files changed, 25 insertions(+), 21 deletions(-)
 create mode 100644 drivers/gpu/drm/nouveau/nouveau_grctx_def.h

diff --git a/drivers/gpu/drm/nouveau/nouveau_grctx.h b/drivers/gpu/drm/nouveau/nouveau_grctx.h
index 86c2e37..359244c 100644
--- a/drivers/gpu/drm/nouveau/nouveau_grctx.h
+++ b/drivers/gpu/drm/nouveau/nouveau_grctx.h
@@ -1,24 +1,8 @@
 #ifndef __NOUVEAU_GRCTX_H__
 #define __NOUVEAU_GRCTX_H__
 
-struct nouveau_grctx {
-	struct drm_device *dev;
-
-	enum {
-		NOUVEAU_GRCTX_PROG,
-		NOUVEAU_GRCTX_VALS
-	} mode;
-	void *data;
-
-	uint32_t ctxprog_max;
-	uint32_t ctxprog_len;
-	uint32_t ctxprog_reg;
-	int      ctxprog_label[32];
-	uint32_t ctxvals_pos;
-	uint32_t ctxvals_base;
-};
-
-#ifdef CP_CTX
+#include "nouveau_grctx_def.h"
+
 static inline void
 cp_out(struct nouveau_grctx *ctx, uint32_t inst)
 {
@@ -128,6 +112,5 @@ gr_def(struct nouveau_grctx *ctx, uint32_t reg, uint32_t val)
 
 	nv_wo32(ctx->data, reg * 4, val);
 }
-#endif
 
 #endif
diff --git a/drivers/gpu/drm/nouveau/nouveau_grctx_def.h b/drivers/gpu/drm/nouveau/nouveau_grctx_def.h
new file mode 100644
index 0000000..f9a4e12
--- /dev/null
+++ b/drivers/gpu/drm/nouveau/nouveau_grctx_def.h
@@ -0,0 +1,21 @@
+#ifndef __NOUVEAU_GRCTX_DEF_H__
+#define __NOUVEAU_GRCTX_DEF_H__
+
+struct nouveau_grctx {
+	struct drm_device *dev;
+
+	enum {
+		NOUVEAU_GRCTX_PROG,
+		NOUVEAU_GRCTX_VALS
+	} mode;
+	void *data;
+
+	uint32_t ctxprog_max;
+	uint32_t ctxprog_len;
+	uint32_t ctxprog_reg;
+	int      ctxprog_label[32];
+	uint32_t ctxvals_pos;
+	uint32_t ctxvals_base;
+};
+
+#endif
diff --git a/drivers/gpu/drm/nouveau/nv40_graph.c b/drivers/gpu/drm/nouveau/nv40_graph.c
index ba14a93..20bb65a 100644
--- a/drivers/gpu/drm/nouveau/nv40_graph.c
+++ b/drivers/gpu/drm/nouveau/nv40_graph.c
@@ -27,7 +27,7 @@
 #include "drmP.h"
 #include "drm.h"
 #include "nouveau_drv.h"
-#include "nouveau_grctx.h"
+#include "nouveau_grctx_def.h"
 #include "nouveau_ramht.h"
 
 struct nv40_graph_engine {
diff --git a/drivers/gpu/drm/nouveau/nv50_graph.c b/drivers/gpu/drm/nouveau/nv50_graph.c
index 33d5711..f5c1fe7 100644
--- a/drivers/gpu/drm/nouveau/nv50_graph.c
+++ b/drivers/gpu/drm/nouveau/nv50_graph.c
@@ -28,7 +28,7 @@
 #include "drm.h"
 #include "nouveau_drv.h"
 #include "nouveau_ramht.h"
-#include "nouveau_grctx.h"
+#include "nouveau_grctx_def.h"
 #include "nouveau_dma.h"
 #include "nouveau_vm.h"
 #include "nv50_evo.h"
-- 
1.7.8.5



More information about the Nouveau mailing list