]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
drm/amdgpu/gfx8: use cached raster config values in csb setup
authorAlex Deucher <alexander.deucher@amd.com>
Mon, 10 Oct 2016 15:17:58 +0000 (11:17 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 25 Oct 2016 18:38:32 +0000 (14:38 -0400)
Simplify the code and properly set the csb for harvest values.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c

index e0664415b18eed2c14aadb39bdcb8db7152d0e97..8dc8f576d2c7baffc35699c920dcf26e985d7f12 100644 (file)
@@ -1140,34 +1140,8 @@ static void gfx_v8_0_get_csb_buffer(struct amdgpu_device *adev,
        buffer[count++] = cpu_to_le32(PACKET3(PACKET3_SET_CONTEXT_REG, 2));
        buffer[count++] = cpu_to_le32(mmPA_SC_RASTER_CONFIG -
                        PACKET3_SET_CONTEXT_REG_START);
-       switch (adev->asic_type) {
-       case CHIP_TONGA:
-       case CHIP_POLARIS10:
-               buffer[count++] = cpu_to_le32(0x16000012);
-               buffer[count++] = cpu_to_le32(0x0000002A);
-               break;
-       case CHIP_POLARIS11:
-               buffer[count++] = cpu_to_le32(0x16000012);
-               buffer[count++] = cpu_to_le32(0x00000000);
-               break;
-       case CHIP_FIJI:
-               buffer[count++] = cpu_to_le32(0x3a00161a);
-               buffer[count++] = cpu_to_le32(0x0000002e);
-               break;
-       case CHIP_TOPAZ:
-       case CHIP_CARRIZO:
-               buffer[count++] = cpu_to_le32(0x00000002);
-               buffer[count++] = cpu_to_le32(0x00000000);
-               break;
-       case CHIP_STONEY:
-               buffer[count++] = cpu_to_le32(0x00000000);
-               buffer[count++] = cpu_to_le32(0x00000000);
-               break;
-       default:
-               buffer[count++] = cpu_to_le32(0x00000000);
-               buffer[count++] = cpu_to_le32(0x00000000);
-               break;
-       }
+       buffer[count++] = cpu_to_le32(adev->gfx.config.rb_config[0][0].raster_config);
+       buffer[count++] = cpu_to_le32(adev->gfx.config.rb_config[0][0].raster_config_1);
 
        buffer[count++] = cpu_to_le32(PACKET3(PACKET3_PREAMBLE_CNTL, 0));
        buffer[count++] = cpu_to_le32(PACKET3_PREAMBLE_END_CLEAR_STATE);