From 12dc4971735a8703c298d35eb21e3d1a2e053217 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sun, 14 Feb 2010 17:43:32 +0100 Subject: 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. --- src/gallium/drivers/r300/r300_texture.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/gallium/drivers/r300/r300_texture.c') diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index 2fa656067f..fe2ba60b9c 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. */ -- cgit v1.2.3