[Mesa-dev] [PATCH 2/4] nouveau: extract nouveau_context functions into a new file

Karol Herbst kherbst at redhat.com
Tue Nov 20 19:21:56 UTC 2018


Signed-off-by: Karol Herbst <kherbst at redhat.com>
---
 src/gallium/drivers/nouveau/Makefile.sources  |  1 +
 src/gallium/drivers/nouveau/meson.build       |  1 +
 src/gallium/drivers/nouveau/nouveau_context.c | 19 +++++++++++++++++++
 src/gallium/drivers/nouveau/nouveau_screen.c  | 18 ------------------
 4 files changed, 21 insertions(+), 18 deletions(-)
 create mode 100644 src/gallium/drivers/nouveau/nouveau_context.c

diff --git a/src/gallium/drivers/nouveau/Makefile.sources b/src/gallium/drivers/nouveau/Makefile.sources
index 65f08c7d8d8..2a0e100c663 100644
--- a/src/gallium/drivers/nouveau/Makefile.sources
+++ b/src/gallium/drivers/nouveau/Makefile.sources
@@ -1,6 +1,7 @@
 C_SOURCES := \
 	nouveau_buffer.c \
 	nouveau_buffer.h \
+	nouveau_context.c \
 	nouveau_context.h \
 	nouveau_debug.h \
 	nouveau_fence.c \
diff --git a/src/gallium/drivers/nouveau/meson.build b/src/gallium/drivers/nouveau/meson.build
index 242ee0e0001..e16abc7be24 100644
--- a/src/gallium/drivers/nouveau/meson.build
+++ b/src/gallium/drivers/nouveau/meson.build
@@ -21,6 +21,7 @@
 files_libnouveau = files(
   'nouveau_buffer.c',
   'nouveau_buffer.h',
+  'nouveau_context.c',
   'nouveau_context.h',
   'nouveau_debug.h',
   'nouveau_fence.c',
diff --git a/src/gallium/drivers/nouveau/nouveau_context.c b/src/gallium/drivers/nouveau/nouveau_context.c
new file mode 100644
index 00000000000..96fe8d5df9b
--- /dev/null
+++ b/src/gallium/drivers/nouveau/nouveau_context.c
@@ -0,0 +1,19 @@
+#include "nouveau_context.h"
+
+static void
+nouveau_set_debug_callback(struct pipe_context *pipe,
+                           const struct pipe_debug_callback *cb)
+{
+   struct nouveau_context *context = nouveau_context(pipe);
+
+   if (cb)
+      context->debug = *cb;
+   else
+      memset(&context->debug, 0, sizeof(context->debug));
+}
+
+void
+nouveau_context_init(struct nouveau_context *context)
+{
+   context->pipe.set_debug_callback = nouveau_set_debug_callback;
+}
diff --git a/src/gallium/drivers/nouveau/nouveau_screen.c b/src/gallium/drivers/nouveau/nouveau_screen.c
index e9fe04bddf7..07cdb370c13 100644
--- a/src/gallium/drivers/nouveau/nouveau_screen.c
+++ b/src/gallium/drivers/nouveau/nouveau_screen.c
@@ -285,21 +285,3 @@ nouveau_screen_fini(struct nouveau_screen *screen)
 
    disk_cache_destroy(screen->disk_shader_cache);
 }
-
-static void
-nouveau_set_debug_callback(struct pipe_context *pipe,
-                           const struct pipe_debug_callback *cb)
-{
-   struct nouveau_context *context = nouveau_context(pipe);
-
-   if (cb)
-      context->debug = *cb;
-   else
-      memset(&context->debug, 0, sizeof(context->debug));
-}
-
-void
-nouveau_context_init(struct nouveau_context *context)
-{
-   context->pipe.set_debug_callback = nouveau_set_debug_callback;
-}
-- 
2.19.1



More information about the mesa-dev mailing list