summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2011-08-04 03:19:33 +0200
committerMarek Olšák <[email protected]>2011-08-16 09:15:11 +0200
commit7ee65800c36a5ee3f6b8ec4ae2d4f15f91d4661b (patch)
treeade9c742a5395f995f5f89c0ff9e3a6201bcfa4b /src/gallium/winsys
parentecfcf25387284f01131eeaf9ec3f72bc481f3cfe (diff)
r600g: get tiling flags using radeon_winsys
Also remove some unused fence-related leftovers. Reviewed-by: Alex Deucher <[email protected]>
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r--src/gallium/winsys/r600/drm/r600_bo.c18
-rw-r--r--src/gallium/winsys/r600/drm/r600_priv.h18
-rw-r--r--src/gallium/winsys/r600/drm/radeon_bo.c17
3 files changed, 9 insertions, 44 deletions
diff --git a/src/gallium/winsys/r600/drm/r600_bo.c b/src/gallium/winsys/r600/drm/r600_bo.c
index 9e2c08ab56f..0b2a9aabac3 100644
--- a/src/gallium/winsys/r600/drm/r600_bo.c
+++ b/src/gallium/winsys/r600/drm/r600_bo.c
@@ -79,7 +79,6 @@ struct r600_bo *r600_bo_handle(struct radeon *radeon, struct winsys_handle *whan
{
struct r600_bo *bo = calloc(1, sizeof(struct r600_bo));
struct radeon_bo *rbo;
- unsigned tiling_flags;
rbo = bo->bo = radeon_bo(radeon, whandle->handle, 0, 0, 0, 0);
if (rbo == NULL) {
@@ -93,16 +92,17 @@ struct r600_bo *r600_bo_handle(struct radeon *radeon, struct winsys_handle *whan
if (stride)
*stride = whandle->stride;
- radeon_bo_get_tiling_flags(radeon, rbo, &tiling_flags);
if (array_mode) {
- if (tiling_flags) {
- if (tiling_flags & RADEON_TILING_MACRO)
- *array_mode = V_0280A0_ARRAY_2D_TILED_THIN1;
- else if (tiling_flags & RADEON_TILING_MICRO)
- *array_mode = V_0280A0_ARRAY_1D_TILED_THIN1;
- } else {
+ enum radeon_bo_layout micro, macro;
+
+ radeon->ws->buffer_get_tiling(rbo->buf, &micro, &macro);
+
+ if (macro == RADEON_LAYOUT_TILED)
+ *array_mode = V_0280A0_ARRAY_2D_TILED_THIN1;
+ else if (micro == RADEON_LAYOUT_TILED)
+ *array_mode = V_0280A0_ARRAY_1D_TILED_THIN1;
+ else
*array_mode = 0;
- }
}
return bo;
}
diff --git a/src/gallium/winsys/r600/drm/r600_priv.h b/src/gallium/winsys/r600/drm/r600_priv.h
index 0efb02aadae..952f91df89a 100644
--- a/src/gallium/winsys/r600/drm/r600_priv.h
+++ b/src/gallium/winsys/r600/drm/r600_priv.h
@@ -94,16 +94,11 @@ void radeon_bo_reference(struct radeon *radeon, struct radeon_bo **dst,
struct radeon_bo *src);
int radeon_bo_wait(struct radeon *radeon, struct radeon_bo *bo);
int radeon_bo_busy(struct radeon *radeon, struct radeon_bo *bo, uint32_t *domain);
-int radeon_bo_fencelist(struct radeon *radeon, struct radeon_bo **bolist, uint32_t num_bo);
-int radeon_bo_get_tiling_flags(struct radeon *radeon,
- struct radeon_bo *bo,
- uint32_t *tiling_flags);
int radeon_bo_fixed_map(struct radeon *radeon, struct radeon_bo *bo);
/*
* r600_hw_context.c
*/
-int r600_context_init_fence(struct r600_context *ctx);
void r600_context_bo_flush(struct r600_context *ctx, unsigned flush_flags,
unsigned flush_mask, struct r600_bo *rbo);
struct r600_bo *r600_context_reg_bo(struct r600_context *ctx, unsigned offset);
@@ -161,17 +156,4 @@ static inline void radeon_bo_unmap(struct radeon *radeon, struct radeon_bo *bo)
assert(bo->map_count >= 0);
}
-/*
- * fence
- */
-static inline boolean fence_is_after(unsigned fence, unsigned ofence)
-{
- /* handle wrap around */
- if (fence < 0x80000000 && ofence > 0x80000000)
- return TRUE;
- if (fence > ofence)
- return TRUE;
- return FALSE;
-}
-
#endif
diff --git a/src/gallium/winsys/r600/drm/radeon_bo.c b/src/gallium/winsys/r600/drm/radeon_bo.c
index 9d351480d59..f2f53a14a58 100644
--- a/src/gallium/winsys/r600/drm/radeon_bo.c
+++ b/src/gallium/winsys/r600/drm/radeon_bo.c
@@ -148,20 +148,3 @@ int radeon_bo_busy(struct radeon *radeon, struct radeon_bo *bo, uint32_t *domain
*domain = args.domain;
return ret;
}
-
-int radeon_bo_get_tiling_flags(struct radeon *radeon,
- struct radeon_bo *bo,
- uint32_t *tiling_flags)
-{
- struct drm_radeon_gem_get_tiling args = {};
- int ret;
-
- args.handle = bo->handle;
- ret = drmCommandWriteRead(radeon->info.fd, DRM_RADEON_GEM_GET_TILING,
- &args, sizeof(args));
- if (ret)
- return ret;
-
- *tiling_flags = args.tiling_flags;
- return ret;
-}