drm/radeon: expose render backend mask to the userspace
authorMarek Olšák <marek.olsak@amd.com>
Sun, 22 Dec 2013 01:18:01 +0000 (02:18 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 23 Dec 2013 15:03:43 +0000 (10:03 -0500)
This will allow userspace to correctly program the PA_SC_RASTER_CONFIG
register, so it can be considered a fix.

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
drivers/gpu/drm/radeon/cik.c
drivers/gpu/drm/radeon/radeon.h
drivers/gpu/drm/radeon/radeon_kms.c
drivers/gpu/drm/radeon/si.c
include/uapi/drm/radeon_drm.h

index 138a776469431b3a9c48337b95baa6196ff386b1..e950fabd7f5e474ab3e60371f669e31805077785 100644 (file)
@@ -3114,6 +3114,8 @@ static void cik_setup_rb(struct radeon_device *rdev,
                mask <<= 1;
        }
 
+       rdev->config.cik.backend_enable_mask = enabled_rbs;
+
        for (i = 0; i < se_num; i++) {
                cik_select_se_sh(rdev, i, 0xffffffff);
                data = 0;
index b1f990d0eaa101d1bce56fabfc4b286ff01de7e9..45e1f447bc794c677a8e83830fd318585c2d7f7e 100644 (file)
@@ -1940,7 +1940,7 @@ struct si_asic {
        unsigned sc_earlyz_tile_fifo_size;
 
        unsigned num_tile_pipes;
-       unsigned num_backends_per_se;
+       unsigned backend_enable_mask;
        unsigned backend_disable_mask_per_asic;
        unsigned backend_map;
        unsigned num_texture_channel_caches;
@@ -1970,7 +1970,7 @@ struct cik_asic {
        unsigned sc_earlyz_tile_fifo_size;
 
        unsigned num_tile_pipes;
-       unsigned num_backends_per_se;
+       unsigned backend_enable_mask;
        unsigned backend_disable_mask_per_asic;
        unsigned backend_map;
        unsigned num_texture_channel_caches;
index 55d0b474bd371ae83f1cea0ec08d30504b371816..21d593c0ecaf4e7e0ec85ab9b7bf53fafd0f2a87 100644 (file)
@@ -461,6 +461,15 @@ int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
        case RADEON_INFO_SI_CP_DMA_COMPUTE:
                *value = 1;
                break;
+       case RADEON_INFO_SI_BACKEND_ENABLED_MASK:
+               if (rdev->family >= CHIP_BONAIRE) {
+                       *value = rdev->config.cik.backend_enable_mask;
+               } else if (rdev->family >= CHIP_TAHITI) {
+                       *value = rdev->config.si.backend_enable_mask;
+               } else {
+                       DRM_DEBUG_KMS("BACKEND_ENABLED_MASK is si+ only!\n");
+               }
+               break;
        default:
                DRM_DEBUG_KMS("Invalid request %d\n", info->request);
                return -EINVAL;
index 3eed9a1e44eaac64f9b5f504f0b89924cf0329d5..85e1edfaa3bed0814e262378ae0a7558834936d3 100644 (file)
@@ -2855,6 +2855,8 @@ static void si_setup_rb(struct radeon_device *rdev,
                mask <<= 1;
        }
 
+       rdev->config.si.backend_enable_mask = enabled_rbs;
+
        for (i = 0; i < se_num; i++) {
                si_select_se_sh(rdev, i, 0xffffffff);
                data = 0;
index 2f3f7ea8c77b8a653b0972302ead53319f13e5fc..fe421e8a431bcf91dd1d5e845b5d06ce81bbe23d 100644 (file)
@@ -983,6 +983,8 @@ struct drm_radeon_cs {
 #define RADEON_INFO_SI_CP_DMA_COMPUTE  0x17
 /* CIK macrotile mode array */
 #define RADEON_INFO_CIK_MACROTILE_MODE_ARRAY   0x18
+/* query the number of render backends */
+#define RADEON_INFO_SI_BACKEND_ENABLED_MASK    0x19
 
 
 struct drm_radeon_info {