radeon-gallium: Unbreak RADEON_SOFTPIPE.
authorCorbin Simpson <MostAwesomeDude@gmail.com>
Tue, 10 Mar 2009 08:52:02 +0000 (01:52 -0700)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Tue, 10 Mar 2009 08:52:02 +0000 (01:52 -0700)
And there was much rejoicing.

src/gallium/winsys/drm/radeon/core/radeon_buffer.c
src/gallium/winsys/drm/radeon/core/radeon_buffer.h
src/gallium/winsys/drm/radeon/core/radeon_drm.c
src/gallium/winsys/drm/radeon/core/radeon_r300.c

index f75e3881cb1be6386f268b628bc519f40599586f..483cbc13dc7ed35a8a8105c1b1cd49bdc8ec83cc 100644 (file)
@@ -154,28 +154,32 @@ static void radeon_flush_frontbuffer(struct pipe_winsys *pipe_winsys,
     /* TODO: call dri2CopyRegion */
 }
 
-struct pipe_winsys *radeon_pipe_winsys()
+struct pipe_winsys* radeon_pipe_winsys(int fd)
 {
-    struct pipe_winsys *radeon_ws;
+    struct radeon_winsys* radeon_ws;
+    struct radeon_bo_manager* bom;
 
-    radeon_ws = CALLOC_STRUCT(pipe_winsys);
+    radeon_ws = CALLOC_STRUCT(radeon_winsys);
     if (radeon_ws == NULL) {
         return NULL;
     }
 
-    radeon_ws->flush_frontbuffer = radeon_flush_frontbuffer;
+    bom = radeon_bo_manager_gem_ctor(fd);
+    radeon_ws->bom = bom;
 
-    radeon_ws->buffer_create = radeon_buffer_create;
-    radeon_ws->buffer_destroy = radeon_buffer_del;
-    radeon_ws->user_buffer_create = radeon_buffer_user_create;
-    radeon_ws->buffer_map = radeon_buffer_map;
-    radeon_ws->buffer_unmap = radeon_buffer_unmap;
+    radeon_ws->base.flush_frontbuffer = radeon_flush_frontbuffer;
 
-    radeon_ws->fence_reference = radeon_fence_reference;
-    radeon_ws->fence_signalled = radeon_fence_signalled;
-    radeon_ws->fence_finish = radeon_fence_finish;
+    radeon_ws->base.buffer_create = radeon_buffer_create;
+    radeon_ws->base.buffer_destroy = radeon_buffer_del;
+    radeon_ws->base.user_buffer_create = radeon_buffer_user_create;
+    radeon_ws->base.buffer_map = radeon_buffer_map;
+    radeon_ws->base.buffer_unmap = radeon_buffer_unmap;
 
-    radeon_ws->get_name = radeon_get_name;
+    radeon_ws->base.fence_reference = radeon_fence_reference;
+    radeon_ws->base.fence_signalled = radeon_fence_signalled;
+    radeon_ws->base.fence_finish = radeon_fence_finish;
+
+    radeon_ws->base.get_name = radeon_get_name;
 
     return radeon_ws;
 }
index e9d9e7c6b44f92f2eb7c6163fbab21565a6d24a6..dc56ab90cff6fccdd316e6ef715e283ac905aa2d 100644 (file)
@@ -53,11 +53,12 @@ struct radeon_winsys {
     /* Parent class. */
     struct pipe_winsys base;
 
-    /* Radeon BO manager. This corresponds to void* radeon_winsys in r300_winsys. */
+    /* Radeon BO manager.
+     * This corresponds to void* radeon_winsys in r300_winsys. */
     struct radeon_bo_manager* bom;
 };
 
-struct pipe_winsys *radeon_pipe_winsys();
+struct pipe_winsys *radeon_pipe_winsys(int fb);
 struct pipe_surface *radeon_surface_from_handle(struct radeon_context *radeon_context,
                                              uint32_t handle,
                                              enum pipe_format format,
index c712482a3774ef722ef9f536b524e14dec051066..9387932a53bb786266e73c6356fbf66a762db8ae 100644 (file)
@@ -33,7 +33,7 @@
 /* Create a pipe_screen. */
 struct pipe_screen* radeon_create_screen(int drmFB, int pciID)
 {
-    struct pipe_winsys* winsys = radeon_pipe_winsys();
+    struct pipe_winsys* winsys = radeon_pipe_winsys(drmFB);
 
     if (getenv("RADEON_SOFTPIPE")) {
         return softpipe_create_screen(winsys);
index e9b96b1ee93d856be476fc1af9e855e181300f4b..9a42db51bdf4cdbf1b70d0ba5d419df944c6666e 100644 (file)
@@ -81,10 +81,8 @@ struct r300_winsys* radeon_create_r300_winsys(int fd, struct pipe_winsys* old_wi
 
     do_ioctls(winsys, fd);
 
-    struct radeon_bo_manager* bom = radeon_bo_manager_gem_ctor(fd);
     struct radeon_cs_manager* csm = radeon_cs_manager_gem_ctor(fd);
 
-    winsys->radeon_winsys = bom;
     winsys->cs = radeon_cs_create(csm, 1024 * 64 / 4);
 
     winsys->check_cs = radeon_r300_check_cs;