]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
drm/radeon/kms/r6xx+: add query for tile config (v2)
authorAlex Deucher <alexdeucher@gmail.com>
Fri, 4 Jun 2010 17:10:12 +0000 (13:10 -0400)
committerDave Airlie <airlied@redhat.com>
Mon, 2 Aug 2010 00:00:05 +0000 (10:00 +1000)
Userspace needs this information to access tiled
buffers via the CPU.

v2: rebased on evergreen accel changes

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/radeon/evergreen.c
drivers/gpu/drm/radeon/r600.c
drivers/gpu/drm/radeon/radeon.h
drivers/gpu/drm/radeon/radeon_drv.c
drivers/gpu/drm/radeon/radeon_kms.c
drivers/gpu/drm/radeon/rv770.c
include/drm/radeon_drm.h

index 1b7da39cc5877be0b729559541e2ab1b89cd08c3..957d5067ad9cc1495984f909d724fbf64c8d8856 100644 (file)
@@ -1132,6 +1132,7 @@ static void evergreen_gpu_init(struct radeon_device *rdev)
                                                                 rdev->config.evergreen.max_backends) &
                                                                EVERGREEN_MAX_BACKENDS_MASK));
 
+       rdev->config.evergreen.tile_config = gb_addr_config;
        WREG32(GB_BACKEND_MAP, gb_backend_map);
        WREG32(GB_ADDR_CONFIG, gb_addr_config);
        WREG32(DMIF_ADDR_CONFIG, gb_addr_config);
index 15fe6c2140343d520219c9c49c237c1f57965cd9..aa36ef69ba6171ad7dbf07eaa06e7710b9e4eaf9 100644 (file)
@@ -1623,7 +1623,7 @@ void r600_gpu_init(struct radeon_device *rdev)
                                                         r600_count_pipe_bits((cc_rb_backend_disable &
                                                                               R6XX_MAX_BACKENDS_MASK) >> 16)),
                                                        (cc_rb_backend_disable >> 16));
-
+       rdev->config.r600.tile_config = tiling_config;
        tiling_config |= BACKEND_MAP(backend_map);
        WREG32(GB_TILING_CONFIG, tiling_config);
        WREG32(DCP_TILING_CONFIG, tiling_config & 0xffff);
index d4d776d2f1e0a42bad7320d4ad61b870c4db63c8..be8420e65f01b8b15a30249d514ff3b42b31401c 100644 (file)
@@ -914,6 +914,7 @@ struct r600_asic {
        unsigned                tiling_nbanks;
        unsigned                tiling_npipes;
        unsigned                tiling_group_size;
+       unsigned                tile_config;
        struct r100_gpu_lockup  lockup;
 };
 
@@ -938,6 +939,7 @@ struct rv770_asic {
        unsigned                tiling_nbanks;
        unsigned                tiling_npipes;
        unsigned                tiling_group_size;
+       unsigned                tile_config;
        struct r100_gpu_lockup  lockup;
 };
 
@@ -963,6 +965,7 @@ struct evergreen_asic {
        unsigned tiling_nbanks;
        unsigned tiling_npipes;
        unsigned tiling_group_size;
+       unsigned tile_config;
 };
 
 union radeon_asic_config {
index ed0ceb3fc40a22cbc6747cbcf1f1aa8c85cb44cb..6f8a2e5728781acab115c2d014e4763b569354a2 100644 (file)
  * - 2.3.0 - add MSPOS + 3D texture + r500 VAP regs
  * - 2.4.0 - add crtc id query
  * - 2.5.0 - add get accel 2 to work around ddx breakage for evergreen
+ * - 2.6.0 - add tiling config query (r6xx+)
  */
 #define KMS_DRIVER_MAJOR       2
-#define KMS_DRIVER_MINOR       5
+#define KMS_DRIVER_MINOR       6
 #define KMS_DRIVER_PATCHLEVEL  0
 int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags);
 int radeon_driver_unload_kms(struct drm_device *dev);
index 70fda6361cd0a7b19f41c8394280e11d08e1dd38..9012e6fbadb6051fdfdb8fb32da307df765baf26 100644 (file)
@@ -147,6 +147,18 @@ int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
        case RADEON_INFO_ACCEL_WORKING2:
                value = rdev->accel_working;
                break;
+       case RADEON_INFO_TILING_CONFIG:
+               if (rdev->family >= CHIP_CEDAR)
+                       value = rdev->config.evergreen.tile_config;
+               else if (rdev->family >= CHIP_RV770)
+                       value = rdev->config.rv770.tile_config;
+               else if (rdev->family >= CHIP_R600)
+                       value = rdev->config.r600.tile_config;
+               else {
+                       DRM_DEBUG("tiling config is r6xx+ only!\n");
+                       return -EINVAL;
+               }
+               break;
        default:
                DRM_DEBUG("Invalid request %d\n", info->request);
                return -EINVAL;
index 836c15ab84d1741eb13eec77b4819983c071c59f..236fe66819222e0b7234cc6e9f8a2b9940dd0d59 100644 (file)
@@ -674,8 +674,9 @@ static void rv770_gpu_init(struct radeon_device *rdev)
                                                                 r600_count_pipe_bits((cc_rb_backend_disable &
                                                                                       R7XX_MAX_BACKENDS_MASK) >> 16)),
                                                                (cc_rb_backend_disable >> 16));
-       gb_tiling_config |= BACKEND_MAP(backend_map);
 
+       rdev->config.rv770.tile_config = gb_tiling_config;
+       gb_tiling_config |= BACKEND_MAP(backend_map);
 
        WREG32(GB_TILING_CONFIG, gb_tiling_config);
        WREG32(DCP_TILING_CONFIG, (gb_tiling_config & 0xffff));
index 5347063e9d5a52b6896c135af389f6fcf8425ff3..ac5f0403d53722ea5cbf2118a486f76d371ee054 100644 (file)
@@ -904,6 +904,7 @@ struct drm_radeon_cs {
 #define RADEON_INFO_ACCEL_WORKING      0x03
 #define RADEON_INFO_CRTC_FROM_ID       0x04
 #define RADEON_INFO_ACCEL_WORKING2     0x05
+#define RADEON_INFO_TILING_CONFIG      0x06
 
 struct drm_radeon_info {
        uint32_t                request;