aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2011-04-18 02:39:50 +0200
committerMarek Olšák <[email protected]>2011-04-18 02:52:32 +0200
commitd35aeff4bb0b03450b2c3c08bd7f84db5bf43283 (patch)
tree7572cae9f9022991404b3a9d74882858062fe095 /src/gallium/winsys/radeon/drm/radeon_drm_bo.c
parentf79717d27aaf471b9cd6eed0d74cbf37ec697361 (diff)
r300g/winsys: rename r300->radeon and do a little cleanup
Renaming a few files, types, and functions. Also make the winsys independent of r300g.
Diffstat (limited to 'src/gallium/winsys/radeon/drm/radeon_drm_bo.c')
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_drm_bo.c76
1 files changed, 38 insertions, 38 deletions
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
index 2b8ebf975e4..b6f12727e81 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
@@ -87,7 +87,7 @@ static struct radeon_bo *get_radeon_bo(struct pb_buffer *_buf)
return bo;
}
-static void radeon_bo_wait(struct r300_winsys_bo *_buf)
+static void radeon_bo_wait(struct pb_buffer *_buf)
{
struct radeon_bo *bo = get_radeon_bo(pb_buffer(_buf));
struct drm_radeon_gem_wait_idle args = {};
@@ -103,7 +103,7 @@ static void radeon_bo_wait(struct r300_winsys_bo *_buf)
bo->busy_for_write = FALSE;
}
-static boolean radeon_bo_is_busy(struct r300_winsys_bo *_buf)
+static boolean radeon_bo_is_busy(struct pb_buffer *_buf)
{
struct radeon_bo *bo = get_radeon_bo(pb_buffer(_buf));
struct drm_radeon_gem_busy args = {};
@@ -173,11 +173,11 @@ static void *radeon_bo_map_internal(struct pb_buffer *_buf,
/* DONTBLOCK doesn't make sense with UNSYNCHRONIZED. */
if (flags & PB_USAGE_DONTBLOCK) {
if (radeon_bo_is_referenced_by_cs(cs, bo)) {
- cs->flush_cs(cs->flush_data, R300_FLUSH_ASYNC);
+ cs->flush_cs(cs->flush_data, RADEON_FLUSH_ASYNC);
return NULL;
}
- if (radeon_bo_is_busy((struct r300_winsys_bo*)bo)) {
+ if (radeon_bo_is_busy((struct pb_buffer*)bo)) {
return NULL;
}
} else {
@@ -191,12 +191,12 @@ static void *radeon_bo_map_internal(struct pb_buffer *_buf,
* Only check whether the buffer is being used for write. */
if (radeon_bo_is_referenced_by_cs_for_write(cs, bo)) {
cs->flush_cs(cs->flush_data, 0);
- radeon_bo_wait((struct r300_winsys_bo*)bo);
+ radeon_bo_wait((struct pb_buffer*)bo);
} else if (bo->busy_for_write) {
/* Update the busy_for_write field (done by radeon_bo_is_busy)
* and wait if needed. */
- if (radeon_bo_is_busy((struct r300_winsys_bo*)bo)) {
- radeon_bo_wait((struct r300_winsys_bo*)bo);
+ if (radeon_bo_is_busy((struct pb_buffer*)bo)) {
+ radeon_bo_wait((struct pb_buffer*)bo);
}
}
} else {
@@ -209,7 +209,7 @@ static void *radeon_bo_map_internal(struct pb_buffer *_buf,
radeon_drm_cs_sync_flush(cs);
}
- radeon_bo_wait((struct r300_winsys_bo*)bo);
+ radeon_bo_wait((struct pb_buffer*)bo);
}
}
}
@@ -345,7 +345,7 @@ static boolean radeon_bomgr_is_buffer_busy(struct pb_manager *_mgr,
return TRUE;
}
- if (radeon_bo_is_busy((struct r300_winsys_bo*)bo)) {
+ if (radeon_bo_is_busy((struct pb_buffer*)bo)) {
return TRUE;
}
@@ -391,8 +391,8 @@ struct pb_manager *radeon_bomgr_create(struct radeon_drm_winsys *rws)
return &mgr->base;
}
-static void *radeon_bo_map(struct r300_winsys_bo *buf,
- struct r300_winsys_cs *cs,
+static void *radeon_bo_map(struct pb_buffer *buf,
+ struct radeon_winsys_cs *cs,
enum pipe_transfer_usage usage)
{
struct pb_buffer *_buf = pb_buffer(buf);
@@ -400,9 +400,9 @@ static void *radeon_bo_map(struct r300_winsys_bo *buf,
return pb_map(_buf, get_pb_usage_from_transfer_flags(usage), cs);
}
-static void radeon_bo_get_tiling(struct r300_winsys_bo *_buf,
- enum r300_buffer_tiling *microtiled,
- enum r300_buffer_tiling *macrotiled)
+static void radeon_bo_get_tiling(struct pb_buffer *_buf,
+ enum radeon_bo_layout *microtiled,
+ enum radeon_bo_layout *macrotiled)
{
struct radeon_bo *bo = get_radeon_bo(pb_buffer(_buf));
struct drm_radeon_gem_set_tiling args = {};
@@ -414,19 +414,19 @@ static void radeon_bo_get_tiling(struct r300_winsys_bo *_buf,
&args,
sizeof(args));
- *microtiled = R300_BUFFER_LINEAR;
- *macrotiled = R300_BUFFER_LINEAR;
+ *microtiled = RADEON_LAYOUT_LINEAR;
+ *macrotiled = RADEON_LAYOUT_LINEAR;
if (args.tiling_flags & RADEON_BO_FLAGS_MICRO_TILE)
- *microtiled = R300_BUFFER_TILED;
+ *microtiled = RADEON_LAYOUT_TILED;
if (args.tiling_flags & RADEON_BO_FLAGS_MACRO_TILE)
- *macrotiled = R300_BUFFER_TILED;
+ *macrotiled = RADEON_LAYOUT_TILED;
}
-static void radeon_bo_set_tiling(struct r300_winsys_bo *_buf,
- struct r300_winsys_cs *rcs,
- enum r300_buffer_tiling microtiled,
- enum r300_buffer_tiling macrotiled,
+static void radeon_bo_set_tiling(struct pb_buffer *_buf,
+ struct radeon_winsys_cs *rcs,
+ enum radeon_bo_layout microtiled,
+ enum radeon_bo_layout macrotiled,
uint32_t pitch)
{
struct radeon_bo *bo = get_radeon_bo(pb_buffer(_buf));
@@ -443,12 +443,12 @@ static void radeon_bo_set_tiling(struct r300_winsys_bo *_buf,
sched_yield();
}
- if (microtiled == R300_BUFFER_TILED)
+ if (microtiled == RADEON_LAYOUT_TILED)
args.tiling_flags |= RADEON_BO_FLAGS_MICRO_TILE;
- else if (microtiled == R300_BUFFER_SQUARETILED)
+ else if (microtiled == RADEON_LAYOUT_SQUARETILED)
args.tiling_flags |= RADEON_BO_FLAGS_MICRO_TILE_SQUARE;
- if (macrotiled == R300_BUFFER_TILED)
+ if (macrotiled == RADEON_LAYOUT_TILED)
args.tiling_flags |= RADEON_BO_FLAGS_MACRO_TILE;
args.handle = bo->handle;
@@ -460,35 +460,35 @@ static void radeon_bo_set_tiling(struct r300_winsys_bo *_buf,
sizeof(args));
}
-static struct r300_winsys_cs_handle *radeon_drm_get_cs_handle(
- struct r300_winsys_bo *_buf)
+static struct radeon_winsys_cs_handle *radeon_drm_get_cs_handle(
+ struct pb_buffer *_buf)
{
/* return radeon_bo. */
- return (struct r300_winsys_cs_handle*)
+ return (struct radeon_winsys_cs_handle*)
get_radeon_bo(pb_buffer(_buf));
}
static unsigned get_pb_usage_from_create_flags(unsigned bind, unsigned usage,
- enum r300_buffer_domain domain)
+ enum radeon_bo_domain domain)
{
unsigned res = 0;
- if (domain & R300_DOMAIN_GTT)
+ if (domain & RADEON_DOMAIN_GTT)
res |= RADEON_PB_USAGE_DOMAIN_GTT;
- if (domain & R300_DOMAIN_VRAM)
+ if (domain & RADEON_DOMAIN_VRAM)
res |= RADEON_PB_USAGE_DOMAIN_VRAM;
return res;
}
-static struct r300_winsys_bo *
-radeon_winsys_bo_create(struct r300_winsys_screen *rws,
+static struct pb_buffer *
+radeon_winsys_bo_create(struct radeon_winsys *rws,
unsigned size,
unsigned alignment,
unsigned bind,
unsigned usage,
- enum r300_buffer_domain domain)
+ enum radeon_bo_domain domain)
{
struct radeon_drm_winsys *ws = radeon_drm_winsys(rws);
struct pb_desc desc;
@@ -509,10 +509,10 @@ radeon_winsys_bo_create(struct r300_winsys_screen *rws,
if (!buffer)
return NULL;
- return (struct r300_winsys_bo*)buffer;
+ return (struct pb_buffer*)buffer;
}
-static struct r300_winsys_bo *radeon_winsys_bo_from_handle(struct r300_winsys_screen *rws,
+static struct pb_buffer *radeon_winsys_bo_from_handle(struct radeon_winsys *rws,
struct winsys_handle *whandle,
unsigned *stride,
unsigned *size)
@@ -575,14 +575,14 @@ done:
if (size)
*size = bo->base.base.size;
- return (struct r300_winsys_bo*)bo;
+ return (struct pb_buffer*)bo;
fail:
pipe_mutex_unlock(mgr->bo_handles_mutex);
return NULL;
}
-static boolean radeon_winsys_bo_get_handle(struct r300_winsys_bo *buffer,
+static boolean radeon_winsys_bo_get_handle(struct pb_buffer *buffer,
unsigned stride,
struct winsys_handle *whandle)
{