radeong: fix build issue with libdrm < 2.4.19
authorMarek Olšák <maraeo@gmail.com>
Tue, 23 Mar 2010 12:33:16 +0000 (13:33 +0100)
committerMarek Olšák <maraeo@gmail.com>
Tue, 23 Mar 2010 12:34:31 +0000 (13:34 +0100)
src/gallium/winsys/drm/radeon/core/radeon_drm.c
src/gallium/winsys/drm/radeon/core/radeon_drm_buffer.c

index 7aa9c5425d656cf6e6d9816f78ae45402822100c..3dfcc5aef07de2f2fdde35ca6d3b47c981147f4b 100644 (file)
@@ -93,9 +93,12 @@ static void do_ioctls(int fd, struct radeon_libdrm_winsys* winsys)
         exit(1);
     }
 
+/* XXX Remove this ifdef when libdrm version 2.4.19 becomes mandatory. */
+#ifdef RADEON_BO_FLAGS_MICRO_TILE_SQUARE
     // Supported since 2.1.0.
     winsys->squaretiling = version->version_major > 2 ||
                            version->version_minor >= 1;
+#endif
 
     info.request = RADEON_INFO_DEVICE_ID;
     retval = drmCommandWriteRead(fd, DRM_RADEON_INFO, &info, sizeof(info));
index ec45abf46766292ff5373fb92c438504f69d88e9..66f613224579be1a5572f3a36ee79aed19ee861c 100644 (file)
@@ -315,8 +315,11 @@ void radeon_drm_bufmgr_set_tiling(struct pb_buffer *_buf,
     uint32_t flags = 0, old_flags, old_pitch;
     if (microtiled == R300_BUFFER_TILED)
         flags |= RADEON_BO_FLAGS_MICRO_TILE;
+/* XXX Remove this ifdef when libdrm version 2.4.19 becomes mandatory. */
+#ifdef RADEON_BO_FLAGS_MICRO_TILE_SQUARE
     else if (microtiled == R300_BUFFER_SQUARETILED)
         flags |= RADEON_BO_FLAGS_MICRO_TILE_SQUARE;
+#endif
     if (macrotiled == R300_BUFFER_TILED)
         flags |= RADEON_BO_FLAGS_MACRO_TILE;