ac: enable both RBs on Kaveri
authorMarek Olšák <marek.olsak@amd.com>
Tue, 1 May 2018 16:48:05 +0000 (12:48 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 10 May 2018 22:26:32 +0000 (18:26 -0400)
This can result in 2x increase in performance on non-harvested Kaveris.

v2: don't do it on radeon

Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/amd/common/ac_gpu_info.c

index 031fd183b6f07a55a239991c1221baa453e86dfb..8147fb0bbc38fff54084c77e852a93b0b133cba3 100644 (file)
@@ -316,7 +316,12 @@ bool ac_query_gpu_info(int fd, amdgpu_device_handle dev,
        /* TODO: Enable this once the kernel handles it efficiently. */
        info->has_local_buffers = info->drm_minor >= 20 &&
                                  !info->has_dedicated_vram;
+
        info->num_render_backends = amdinfo->rb_pipes;
+       /* The value returned by the kernel driver was wrong. */
+       if (info->family == CHIP_KAVERI)
+               info->num_render_backends = 2;
+
        info->clock_crystal_freq = amdinfo->gpu_counter_freq;
        if (!info->clock_crystal_freq) {
                fprintf(stderr, "amdgpu: clock crystal frequency is 0, timestamps will be wrong\n");
@@ -627,8 +632,7 @@ ac_get_raster_config(struct radeon_info *info,
                raster_config_1 = 0x00000000;
                break;
        case CHIP_KAVERI:
-               /* KV should be 0x00000002, but that causes problems with radeon */
-               raster_config = 0x00000000; /* 0x00000002 */
+               raster_config = 0x00000002;
                raster_config_1 = 0x00000000;
                break;
        case CHIP_KABINI:
@@ -644,6 +648,13 @@ ac_get_raster_config(struct radeon_info *info,
                raster_config_1 = 0x00000000;
                break;
        }
+
+       /* drm/radeon on Kaveri is buggy, so disable 1 RB to work around it.
+        * This decreases performance by up to 50% when the RB is the bottleneck.
+        */
+       if (info->family == CHIP_KAVERI && info->drm_major == 2)
+               raster_config = 0x00000000;
+
        *raster_config_p = raster_config;
        *raster_config_1_p = raster_config_1;
 }