A bit of r300 cleanup.
authorCorbin Simpson <MostAwesomeDude@gmail.com>
Sat, 10 Jan 2009 05:50:56 +0000 (21:50 -0800)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Mon, 2 Feb 2009 07:30:21 +0000 (23:30 -0800)
src/gallium/drivers/r300/r300_context.c
src/gallium/drivers/r300/r300_context.h
src/gallium/drivers/r300/r300_surface.h
src/gallium/winsys/drm/amd/amd_context.c

index 68751dae17f2fe8f3746c4a71522101527bd3b83..4050faa74a2ff9a528ab7d18e64f7cfcef614d88 100644 (file)
@@ -41,12 +41,7 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen,
 
     r300->winsys = amd_winsys;
     r300->context.winsys = winsys;
-    if (screen) {
-        r300->context.screen = screen;
-    } else {
-        /* XXX second arg should be pciid, find a way to get it from winsys */
-        r300->context.screen = r300_create_screen(winsys, 0x0);
-    }
+    r300->context.screen = screen;
 
     r300->context.destroy = r300_destroy_context;
 
index ae2dab13ffc050f3dbee419804b74daeb31f04dc..8393198200654478984972adad93e11f17b77339 100644 (file)
@@ -23,9 +23,9 @@
 #ifndef R300_CONTEXT_H
 #define R300_CONTEXT_H
 
+#include "draw/draw_context.h"
 #include "pipe/p_context.h"
-
-#include "r300_surface.h"
+#include "util/u_memory.h"
 
 struct r300_context {
     /* Parent class */
@@ -47,4 +47,11 @@ static struct r300_context* r300_context(struct pipe_context* context) {
     return (struct r300_context*)context;
 }
 
+/* Context initialization. */
+void r300_init_surface_functions(struct r300_context* r300);
+
+struct pipe_context* r300_create_context(struct pipe_screen* screen,
+                                         struct pipe_winsys* winsys,
+                                         struct amd_winsys* amd_winsys);
+
 #endif /* R300_CONTEXT_H */
\ No newline at end of file
index 29858eb5417de76fd50dba7100f49b01132b9426..0b2fd0b32bf415bcd18bc28dc17d52cadd26eca1 100644 (file)
@@ -31,6 +31,4 @@
 #include "r300_blit.h"
 #include "r300_context.h"
 
-void r300_init_surface_functions(struct r300_context* r300);
-
 #endif /* R300_SURFACE_H */
index faca7d0c4b3090d3720cc22d55546c15f272efb1..5127cdf261a034ff5a9d4545d9f0e435e8d1585c 100644 (file)
@@ -243,8 +243,10 @@ GLboolean amd_context_create(const __GLcontextModes *visual,
     }
 
     if (GL_TRUE) {
-        /* XXX "NULL" is a struct pipe_screen* just in case we ever need it... */
-        pipe = r300_create_context(NULL, amd_context->pipe_winsys,
+        amd_context->pipe_screen = r300_create_screen(amd_context->pipe_winsys,
+                                                      0x0);
+        pipe = r300_create_context(amd_context->pipe_screen,
+                                   amd_context->pipe_winsys,
                                    (struct amd_pipe_winsys*)amd_context->pipe_winsys);
     } else {
         pipe = amd_create_softpipe(amd_context);