summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2013-09-22 22:12:18 +0200
committerMarek Olšák <[email protected]>2013-09-29 15:18:09 +0200
commit1bb77f81db0ed3d1b3dd14c055ff7a9679399bb1 (patch)
tree56e5d485d32449bf2065116f85883cf212731440 /src/gallium/drivers/radeonsi
parent09fc5d6e262aeb1b21faf6d952c204588602ef97 (diff)
r600g,radeonsi: consolidate tiling_info initialization
and the util_format_s3tc_init calls too.
Diffstat (limited to 'src/gallium/drivers/radeonsi')
-rw-r--r--src/gallium/drivers/radeonsi/r600.h6
-rw-r--r--src/gallium/drivers/radeonsi/r600_texture.c5
-rw-r--r--src/gallium/drivers/radeonsi/radeonsi_pipe.c72
-rw-r--r--src/gallium/drivers/radeonsi/radeonsi_pipe.h2
-rw-r--r--src/gallium/drivers/radeonsi/si_state.c2
5 files changed, 7 insertions, 80 deletions
diff --git a/src/gallium/drivers/radeonsi/r600.h b/src/gallium/drivers/radeonsi/r600.h
index 4b4316971d1..0f5d653d4a0 100644
--- a/src/gallium/drivers/radeonsi/r600.h
+++ b/src/gallium/drivers/radeonsi/r600.h
@@ -37,12 +37,6 @@
struct winsys_handle;
-struct r600_tiling_info {
- unsigned num_channels;
- unsigned num_banks;
- unsigned group_bytes;
-};
-
/* R600/R700 STATES */
struct r600_query {
union {
diff --git a/src/gallium/drivers/radeonsi/r600_texture.c b/src/gallium/drivers/radeonsi/r600_texture.c
index 53452c892c2..fd6afb9edd7 100644
--- a/src/gallium/drivers/radeonsi/r600_texture.c
+++ b/src/gallium/drivers/radeonsi/r600_texture.c
@@ -27,7 +27,6 @@
#include <errno.h>
#include "pipe/p_screen.h"
#include "util/u_format.h"
-#include "util/u_format_s3tc.h"
#include "util/u_math.h"
#include "util/u_inlines.h"
#include "util/u_memory.h"
@@ -352,8 +351,8 @@ static void si_texture_get_cmask_info(struct r600_screen *rscreen,
struct r600_texture *rtex,
struct r600_cmask_info *out)
{
- unsigned pipe_interleave_bytes = rscreen->tiling_info.group_bytes;
- unsigned num_pipes = rscreen->tiling_info.num_channels;
+ unsigned pipe_interleave_bytes = rscreen->b.tiling_info.group_bytes;
+ unsigned num_pipes = rscreen->b.tiling_info.num_channels;
unsigned cl_width, cl_height;
switch (num_pipes) {
diff --git a/src/gallium/drivers/radeonsi/radeonsi_pipe.c b/src/gallium/drivers/radeonsi/radeonsi_pipe.c
index 8ed5d26a0e9..81cc22277c0 100644
--- a/src/gallium/drivers/radeonsi/radeonsi_pipe.c
+++ b/src/gallium/drivers/radeonsi/radeonsi_pipe.c
@@ -31,7 +31,6 @@
#include "util/u_blitter.h"
#include "util/u_double_list.h"
#include "util/u_format.h"
-#include "util/u_format_s3tc.h"
#include "util/u_transfer.h"
#include "util/u_surface.h"
#include "util/u_pack_color.h"
@@ -751,65 +750,6 @@ static boolean r600_fence_finish(struct pipe_screen *pscreen,
return rscreen->fences.data[rfence->index] != 0;
}
-static int evergreen_interpret_tiling(struct r600_screen *rscreen, uint32_t tiling_config)
-{
- switch (tiling_config & 0xf) {
- case 0:
- rscreen->tiling_info.num_channels = 1;
- break;
- case 1:
- rscreen->tiling_info.num_channels = 2;
- break;
- case 2:
- rscreen->tiling_info.num_channels = 4;
- break;
- case 3:
- rscreen->tiling_info.num_channels = 8;
- break;
- default:
- return -EINVAL;
- }
-
- switch ((tiling_config & 0xf0) >> 4) {
- case 0:
- rscreen->tiling_info.num_banks = 4;
- break;
- case 1:
- rscreen->tiling_info.num_banks = 8;
- break;
- case 2:
- rscreen->tiling_info.num_banks = 16;
- break;
- default:
- return -EINVAL;
- }
-
- switch ((tiling_config & 0xf00) >> 8) {
- case 0:
- rscreen->tiling_info.group_bytes = 256;
- break;
- case 1:
- rscreen->tiling_info.group_bytes = 512;
- break;
- default:
- return -EINVAL;
- }
- return 0;
-}
-
-static int r600_init_tiling(struct r600_screen *rscreen)
-{
- uint32_t tiling_config = rscreen->b.info.r600_tiling_config;
-
- /* set default group bytes, overridden by tiling info ioctl */
- rscreen->tiling_info.group_bytes = 512;
-
- if (!tiling_config)
- return 0;
-
- return evergreen_interpret_tiling(rscreen, tiling_config);
-}
-
static uint64_t r600_get_timestamp(struct pipe_screen *screen)
{
struct r600_screen *rscreen = (struct r600_screen*)screen;
@@ -848,20 +788,16 @@ struct pipe_screen *radeonsi_screen_create(struct radeon_winsys *ws)
}
r600_init_screen_resource_functions(&rscreen->b.b);
- r600_common_screen_init(&rscreen->b, ws);
+ if (!r600_common_screen_init(&rscreen->b, ws)) {
+ FREE(rscreen);
+ return NULL;
+ }
if (debug_get_bool_option("RADEON_PRINT_TEXDEPTH", FALSE))
rscreen->b.debug_flags |= DBG_TEX_DEPTH;
if (debug_get_bool_option("RADEON_DUMP_SHADERS", FALSE))
rscreen->b.debug_flags |= DBG_FS | DBG_VS | DBG_GS | DBG_PS | DBG_CS;
- if (r600_init_tiling(rscreen)) {
- FREE(rscreen);
- return NULL;
- }
-
- util_format_s3tc_init();
-
rscreen->fences.bo = NULL;
rscreen->fences.data = NULL;
rscreen->fences.next_index = 0;
diff --git a/src/gallium/drivers/radeonsi/radeonsi_pipe.h b/src/gallium/drivers/radeonsi/radeonsi_pipe.h
index 60988710942..3e7332d3ea8 100644
--- a/src/gallium/drivers/radeonsi/radeonsi_pipe.h
+++ b/src/gallium/drivers/radeonsi/radeonsi_pipe.h
@@ -66,8 +66,6 @@ struct r600_pipe_fences {
struct r600_screen {
struct r600_common_screen b;
- struct r600_tiling_info tiling_info;
- struct util_slab_mempool pool_buffers;
struct r600_pipe_fences fences;
#if R600_TRACE_CS
struct r600_resource *trace_bo;
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
index 5f60045f77d..1d5f4b7afa3 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -1762,7 +1762,7 @@ static void si_db(struct r600_context *rctx, struct si_pm4_state *pm4,
macro_aspect = cik_macro_tile_aspect(macro_aspect);
bankw = cik_bank_wh(bankw);
bankh = cik_bank_wh(bankh);
- nbanks = cik_num_banks(rscreen->tiling_info.num_banks);
+ nbanks = cik_num_banks(rscreen->b.tiling_info.num_banks);
pipe_config = cik_db_pipe_config(rscreen->b.info.r600_num_tile_pipes,
rscreen->b.info.r600_num_backends);