summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2013-01-20 16:52:17 +0100
committerMarek Olšák <maraeo@gmail.com>2013-01-21 17:00:51 +0100
commit7bfbf5b28791b9cb192201e6cf251da35da49080 (patch)
tree90536d0f67466070b0c7a399c864bdbeb289fbff /src
parentb7cb6552981e7a655782092c1d66e46ce1ab155e (diff)
downloadexternal_mesa3d-7bfbf5b28791b9cb192201e6cf251da35da49080.zip
external_mesa3d-7bfbf5b28791b9cb192201e6cf251da35da49080.tar.gz
external_mesa3d-7bfbf5b28791b9cb192201e6cf251da35da49080.tar.bz2
r300g: allow resolutions up to 1280x1024 with AA optimizations on 1-pipe cards
because single-pipe cards have bigger CMASK RAM
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/r300/r300_chipset.h1
-rw-r--r--src/gallium/drivers/r300/r300_texture_desc.c8
2 files changed, 6 insertions, 3 deletions
diff --git a/src/gallium/drivers/r300/r300_chipset.h b/src/gallium/drivers/r300/r300_chipset.h
index 996491e..f8b5d4e 100644
--- a/src/gallium/drivers/r300/r300_chipset.h
+++ b/src/gallium/drivers/r300/r300_chipset.h
@@ -30,7 +30,6 @@
#define RV530_HIZ_LIMIT 15360
/* rv3xx have only one pipe */
-#define PIPE_CMASK_SIZE 4096
#define PIPE_ZMASK_SIZE 4096
#define RV3xx_ZMASK_SIZE 5120
diff --git a/src/gallium/drivers/r300/r300_texture_desc.c b/src/gallium/drivers/r300/r300_texture_desc.c
index 889b8e8..c5636ca 100644
--- a/src/gallium/drivers/r300/r300_texture_desc.c
+++ b/src/gallium/drivers/r300/r300_texture_desc.c
@@ -414,7 +414,7 @@ static void r300_setup_cmask_properties(struct r300_screen *screen,
{
static unsigned cmask_align_x[4] = {16, 32, 48, 32};
static unsigned cmask_align_y[4] = {16, 16, 16, 32};
- unsigned pipes, stride, cmask_num_dw;
+ unsigned pipes, stride, cmask_num_dw, cmask_max_size;
/* We need an AA colorbuffer, no mipmaps. */
if (tex->b.b.nr_samples <= 1 ||
@@ -436,6 +436,10 @@ static void r300_setup_cmask_properties(struct r300_screen *screen,
/* CMASK is part of raster pipes. The number of Z pipes doesn't matter. */
pipes = screen->info.r300_num_gb_pipes;
+ /* The single-pipe cards have 5120 dwords of CMASK RAM,
+ * the other cards have 4096 dwords of CMASK RAM per pipe. */
+ cmask_max_size = pipes == 1 ? 5120 : pipes * 4096;
+
stride = r300_stride_to_width(tex->b.b.format,
tex->tex.stride_in_bytes[0]);
stride = align(stride, 16);
@@ -446,7 +450,7 @@ static void r300_setup_cmask_properties(struct r300_screen *screen,
cmask_align_y[pipes-1]);
/* Check the CMASK size against the CMASK memory limit. */
- if (cmask_num_dw <= PIPE_CMASK_SIZE * pipes) {
+ if (cmask_num_dw <= cmask_max_size) {
tex->tex.cmask_dwords = cmask_num_dw;
tex->tex.cmask_stride_in_pixels =
util_align_npot(stride, cmask_align_x[pipes-1]);