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.
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;
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. */
R300_VID_PCI_ID,
R300_VID_GB_PIPES,
R300_VID_Z_PIPES,
+ R300_VID_SQUARE_TILING_SUPPORT
};
struct r300_winsys_screen {
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) {
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);
return ws->gb_pipes;
case R300_VID_Z_PIPES:
return ws->z_pipes;
+ case R300_VID_SQUARE_TILING_SUPPORT:
+ return ws->squaretiling;
}
return 0;
}
/* VRAM size. */
uint32_t vram_size;
+ /* Square tiling support. */
+ boolean squaretiling;
+
/* DRM FD */
int fd;