r600g: get tiling flags using radeon_winsys

Also remove some unused fence-related leftovers.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Marek Olšák 2011-08-04 03:19:33 +02:00
parent ecfcf25387
commit 7ee65800c3
3 changed files with 9 additions and 44 deletions

View file

@ -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;
}

View file

@ -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

View file

@ -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;
}