Skip to contentSkip to conversation

drm/nouveau: move definition of nouveau_grctx to separate file

PATCH Superseded Marcin Slusarz 1 participant 1 message Dec 28, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/nouveau: move definition of nouveau_grctx to separate file

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

---
 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
drivers/gpu/drm/nouveau/nouveau_grctx.h +2 -19
index 86c2e37..359244c 100644
@@ -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
drivers/gpu/drm/nouveau/nouveau_grctx_def.h new file +21 -0
new file mode 100644
index 0000000..f9a4e12
@@ -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
drivers/gpu/drm/nouveau/nv40_graph.c +1 -1
index ba14a93..20bb65a 100644
@@ -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 {
drivers/gpu/drm/nouveau/nv50_graph.c +1 -1
index ac601f7..01e4f812 100644
@@ -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"
Signature · 1 line
1.7.8.rc3