From fdfde00cd8e1465a214062e38b715787919de6e5 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Tue, 10 Mar 2009 01:52:02 -0700 Subject: [PATCH] radeon-gallium: Unbreak RADEON_SOFTPIPE. And there was much rejoicing. --- .../winsys/drm/radeon/core/radeon_buffer.c | 30 +++++++++++-------- .../winsys/drm/radeon/core/radeon_buffer.h | 5 ++-- .../winsys/drm/radeon/core/radeon_drm.c | 2 +- .../winsys/drm/radeon/core/radeon_r300.c | 2 -- 4 files changed, 21 insertions(+), 18 deletions(-) diff --git a/src/gallium/winsys/drm/radeon/core/radeon_buffer.c b/src/gallium/winsys/drm/radeon/core/radeon_buffer.c index f75e3881cb1..483cbc13dc7 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_buffer.c +++ b/src/gallium/winsys/drm/radeon/core/radeon_buffer.c @@ -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; } diff --git a/src/gallium/winsys/drm/radeon/core/radeon_buffer.h b/src/gallium/winsys/drm/radeon/core/radeon_buffer.h index e9d9e7c6b44..dc56ab90cff 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_buffer.h +++ b/src/gallium/winsys/drm/radeon/core/radeon_buffer.h @@ -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, diff --git a/src/gallium/winsys/drm/radeon/core/radeon_drm.c b/src/gallium/winsys/drm/radeon/core/radeon_drm.c index c712482a377..9387932a53b 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_drm.c +++ b/src/gallium/winsys/drm/radeon/core/radeon_drm.c @@ -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); diff --git a/src/gallium/winsys/drm/radeon/core/radeon_r300.c b/src/gallium/winsys/drm/radeon/core/radeon_r300.c index e9b96b1ee93..9a42db51bdf 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_r300.c +++ b/src/gallium/winsys/drm/radeon/core/radeon_r300.c @@ -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; -- 2.30.2