summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2010-02-14 17:43:32 +0100
committerMarek Olšák <maraeo@gmail.com>2010-03-21 21:54:07 +0100
commit12dc4971735a8703c298d35eb21e3d1a2e053217 (patch)
treec0690678151b372d52eef2169bf43f36d2beca89 /src/gallium/drivers
parent33d2349119ada410dbfbaa667fc7aef8b60d1a6f (diff)
r300g: add and enable square microtiling
It requires DRM 2.1.0 (e.g. kernel 2.6.34) and is disabled on older ones. Finally, the texture tiling implementation is now complete. Uff.
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/r300/r300_texture.c11
-rw-r--r--src/gallium/drivers/r300/r300_winsys.h1
2 files changed, 7 insertions, 5 deletions
diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c
index 2fa656067fa..fe2ba60b9c9 100644
--- a/src/gallium/drivers/r300/r300_texture.c
+++ b/src/gallium/drivers/r300/r300_texture.c
@@ -715,6 +715,7 @@ static void r300_setup_flags(struct r300_texture* tex)
static void r300_setup_tiling(struct pipe_screen *screen,
struct r300_texture *tex)
{
+ struct r300_winsys_screen *rws = (struct r300_winsys_screen *)screen->winsys;
enum pipe_format format = tex->tex.format;
boolean rv350_mode = r300_screen(screen)->caps->family >= CHIP_FAMILY_RV350;
@@ -734,12 +735,12 @@ static void r300_setup_tiling(struct pipe_screen *screen,
tex->microtile = R300_BUFFER_TILED;
break;
- /* XXX Square-tiling doesn't work with kernel older than 2.6.34,
- * XXX need to check the DRM version */
- /*case 2:
+ case 2:
case 8:
- tex->microtile = R300_BUFFER_SQUARETILED;
- break;*/
+ if (rws->get_value(rws, R300_VID_SQUARE_TILING_SUPPORT)) {
+ tex->microtile = R300_BUFFER_SQUARETILED;
+ }
+ break;
}
/* Set macrotiling. */
diff --git a/src/gallium/drivers/r300/r300_winsys.h b/src/gallium/drivers/r300/r300_winsys.h
index 93f9dd7cfac..acfa5dbeb9c 100644
--- a/src/gallium/drivers/r300/r300_winsys.h
+++ b/src/gallium/drivers/r300/r300_winsys.h
@@ -49,6 +49,7 @@ enum r300_value_id {
R300_VID_PCI_ID,
R300_VID_GB_PIPES,
R300_VID_Z_PIPES,
+ R300_VID_SQUARE_TILING_SUPPORT
};
struct r300_winsys_screen {