diff options
author | Marek Olšák <[email protected]> | 2010-02-14 17:43:32 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2010-03-21 21:54:07 +0100 |
commit | 12dc4971735a8703c298d35eb21e3d1a2e053217 (patch) | |
tree | c0690678151b372d52eef2169bf43f36d2beca89 /src/gallium/winsys | |
parent | 33d2349119ada410dbfbaa667fc7aef8b60d1a6f (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/winsys')
4 files changed, 13 insertions, 2 deletions
diff --git a/src/gallium/winsys/drm/radeon/core/radeon_drm.c b/src/gallium/winsys/drm/radeon/core/radeon_drm.c index d70173e805d..7aa9c5425d6 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_drm.c +++ b/src/gallium/winsys/drm/radeon/core/radeon_drm.c @@ -93,6 +93,10 @@ static void do_ioctls(int fd, struct radeon_libdrm_winsys* winsys) exit(1); } + // Supported since 2.1.0. + winsys->squaretiling = version->version_major > 2 || + version->version_minor >= 1; + info.request = RADEON_INFO_DEVICE_ID; retval = drmCommandWriteRead(fd, DRM_RADEON_INFO, &info, sizeof(info)); if (retval) { diff --git a/src/gallium/winsys/drm/radeon/core/radeon_drm_buffer.c b/src/gallium/winsys/drm/radeon/core/radeon_drm_buffer.c index 0a86acc2284..e36bad7ea8c 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_drm_buffer.c +++ b/src/gallium/winsys/drm/radeon/core/radeon_drm_buffer.c @@ -314,9 +314,11 @@ void radeon_drm_bufmgr_set_tiling(struct pb_buffer *_buf, struct radeon_drm_buffer *buf = get_drm_buffer(_buf); uint32_t flags = 0, old_flags, old_pitch; if (microtiled == R300_BUFFER_TILED) - flags |= RADEON_BO_FLAGS_MICRO_TILE; + flags |= RADEON_BO_FLAGS_MICRO_TILE; + else if (microtiled == R300_BUFFER_SQUARETILED) + flags |= RADEON_BO_FLAGS_MICRO_TILE_SQUARE; if (macrotiled == R300_BUFFER_TILED) - flags |= RADEON_BO_FLAGS_MACRO_TILE; + flags |= RADEON_BO_FLAGS_MACRO_TILE; radeon_bo_get_tiling(buf->bo, &old_flags, &old_pitch); diff --git a/src/gallium/winsys/drm/radeon/core/radeon_r300.c b/src/gallium/winsys/drm/radeon/core/radeon_r300.c index 0c0fee1586c..38fcf889c8b 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_r300.c +++ b/src/gallium/winsys/drm/radeon/core/radeon_r300.c @@ -253,6 +253,8 @@ static uint32_t radeon_get_value(struct r300_winsys_screen *rws, return ws->gb_pipes; case R300_VID_Z_PIPES: return ws->z_pipes; + case R300_VID_SQUARE_TILING_SUPPORT: + return ws->squaretiling; } return 0; } diff --git a/src/gallium/winsys/drm/radeon/core/radeon_winsys.h b/src/gallium/winsys/drm/radeon/core/radeon_winsys.h index ad7b976abd2..4260dbaad72 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_winsys.h +++ b/src/gallium/winsys/drm/radeon/core/radeon_winsys.h @@ -57,6 +57,9 @@ struct radeon_libdrm_winsys { /* VRAM size. */ uint32_t vram_size; + /* Square tiling support. */ + boolean squaretiling; + /* DRM FD */ int fd; |