diff options
author | Marek Olšák <[email protected]> | 2011-08-04 03:01:44 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2011-08-16 09:15:11 +0200 |
commit | 1b542aca6e998e544a90ccff310f74b2811b8db0 (patch) | |
tree | 6e90cd0f855feec715f606abeeee3f9f071bb51c /src/gallium/winsys/r600 | |
parent | 03b25ad8ffd72f1f88b6c80a2ebfe3cf6e8a6390 (diff) |
r600g: move more DRM queries into winsys/radeon
Reviewed-by: Alex Deucher <[email protected]>
Diffstat (limited to 'src/gallium/winsys/r600')
-rw-r--r-- | src/gallium/winsys/r600/drm/r600_drm.c | 45 | ||||
-rw-r--r-- | src/gallium/winsys/r600/drm/r600_hw_context.c | 2 | ||||
-rw-r--r-- | src/gallium/winsys/r600/drm/r600_priv.h | 3 |
3 files changed, 3 insertions, 47 deletions
diff --git a/src/gallium/winsys/r600/drm/r600_drm.c b/src/gallium/winsys/r600/drm/r600_drm.c index 270a07a3a89..a1b0ba1fb0f 100644 --- a/src/gallium/winsys/r600/drm/r600_drm.c +++ b/src/gallium/winsys/r600/drm/r600_drm.c @@ -68,12 +68,12 @@ unsigned r600_get_num_backends(struct radeon *radeon) unsigned r600_get_num_tile_pipes(struct radeon *radeon) { - return radeon->num_tile_pipes; + return radeon->info.r600_num_tile_pipes; } unsigned r600_get_backend_map(struct radeon *radeon) { - return radeon->backend_map; + return radeon->info.r600_backend_map; } unsigned r600_get_minor_version(struct radeon *radeon) @@ -185,42 +185,6 @@ static int radeon_drm_get_tiling(struct radeon *radeon) } } -static int radeon_get_num_tile_pipes(struct radeon *radeon) -{ - struct drm_radeon_info info = {}; - uint32_t num_tile_pipes = 0; - int r; - - info.request = RADEON_INFO_NUM_TILE_PIPES; - info.value = (uintptr_t)&num_tile_pipes; - r = drmCommandWriteRead(radeon->info.fd, DRM_RADEON_INFO, &info, - sizeof(struct drm_radeon_info)); - if (r) - return r; - - radeon->num_tile_pipes = num_tile_pipes; - return 0; -} - -static int radeon_get_backend_map(struct radeon *radeon) -{ - struct drm_radeon_info info = {}; - uint32_t backend_map = 0; - int r; - - info.request = RADEON_INFO_BACKEND_MAP; - info.value = (uintptr_t)&backend_map; - r = drmCommandWriteRead(radeon->info.fd, DRM_RADEON_INFO, &info, - sizeof(struct drm_radeon_info)); - if (r) - return r; - - radeon->backend_map = backend_map; - radeon->backend_map_valid = TRUE; - - return 0; -} - struct radeon *radeon_create(struct radeon_winsys *ws) { struct radeon *radeon = CALLOC_STRUCT(radeon); @@ -287,11 +251,6 @@ struct radeon *radeon_create(struct radeon_winsys *ws) if (radeon_drm_get_tiling(radeon)) return NULL; - if (radeon->info.drm_minor >= 11) { - radeon_get_num_tile_pipes(radeon); - radeon_get_backend_map(radeon); - } - /* XXX disable ioctl thread offloading until the porting is done. */ setenv("RADEON_THREAD", "0", 0); diff --git a/src/gallium/winsys/r600/drm/r600_hw_context.c b/src/gallium/winsys/r600/drm/r600_hw_context.c index 59450b5ba83..c72e8548de8 100644 --- a/src/gallium/winsys/r600/drm/r600_hw_context.c +++ b/src/gallium/winsys/r600/drm/r600_hw_context.c @@ -41,7 +41,7 @@ void r600_get_backend_mask(struct r600_context *ctx) unsigned i, mask = 0; /* if backend_map query is supported by the kernel */ - if (ctx->radeon->backend_map_valid) { + if (ctx->radeon->info.r600_backend_map_valid) { unsigned num_tile_pipes = r600_get_num_tile_pipes(ctx->radeon); unsigned backend_map = r600_get_backend_map(ctx->radeon); unsigned item_width, item_mask; diff --git a/src/gallium/winsys/r600/drm/r600_priv.h b/src/gallium/winsys/r600/drm/r600_priv.h index 54b66cc9e35..036468e3a31 100644 --- a/src/gallium/winsys/r600/drm/r600_priv.h +++ b/src/gallium/winsys/r600/drm/r600_priv.h @@ -41,9 +41,6 @@ struct radeon { unsigned family; enum chip_class chip_class; struct r600_tiling_info tiling_info; - unsigned num_tile_pipes; - unsigned backend_map; - boolean backend_map_valid; }; /* these flags are used in register flags and added into block flags */ |