diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2010-06-04 13:10:12 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-08-01 20:00:05 -0400 |
commit | e7aeeba6a8fb86ac52bcffa0b72942f784f2b37f (patch) | |
tree | 889d8196e31ec490beba8b801236d7734e8d36bb /drivers/gpu | |
parent | 40e2a5c15d09e02a71711735564151c789f95032 (diff) |
drm/radeon/kms/r6xx+: add query for tile config (v2)
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>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/radeon/evergreen.c | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/r600.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon.h | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_drv.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_kms.c | 12 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/rv770.c | 3 |
6 files changed, 21 insertions, 3 deletions
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c index 1b7da39cc587..957d5067ad9c 100644 --- a/drivers/gpu/drm/radeon/evergreen.c +++ b/drivers/gpu/drm/radeon/evergreen.c | |||
@@ -1132,6 +1132,7 @@ static void evergreen_gpu_init(struct radeon_device *rdev) | |||
1132 | rdev->config.evergreen.max_backends) & | 1132 | rdev->config.evergreen.max_backends) & |
1133 | EVERGREEN_MAX_BACKENDS_MASK)); | 1133 | EVERGREEN_MAX_BACKENDS_MASK)); |
1134 | 1134 | ||
1135 | rdev->config.evergreen.tile_config = gb_addr_config; | ||
1135 | WREG32(GB_BACKEND_MAP, gb_backend_map); | 1136 | WREG32(GB_BACKEND_MAP, gb_backend_map); |
1136 | WREG32(GB_ADDR_CONFIG, gb_addr_config); | 1137 | WREG32(GB_ADDR_CONFIG, gb_addr_config); |
1137 | WREG32(DMIF_ADDR_CONFIG, gb_addr_config); | 1138 | WREG32(DMIF_ADDR_CONFIG, gb_addr_config); |
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index 15fe6c214034..aa36ef69ba61 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c | |||
@@ -1623,7 +1623,7 @@ void r600_gpu_init(struct radeon_device *rdev) | |||
1623 | r600_count_pipe_bits((cc_rb_backend_disable & | 1623 | r600_count_pipe_bits((cc_rb_backend_disable & |
1624 | R6XX_MAX_BACKENDS_MASK) >> 16)), | 1624 | R6XX_MAX_BACKENDS_MASK) >> 16)), |
1625 | (cc_rb_backend_disable >> 16)); | 1625 | (cc_rb_backend_disable >> 16)); |
1626 | 1626 | rdev->config.r600.tile_config = tiling_config; | |
1627 | tiling_config |= BACKEND_MAP(backend_map); | 1627 | tiling_config |= BACKEND_MAP(backend_map); |
1628 | WREG32(GB_TILING_CONFIG, tiling_config); | 1628 | WREG32(GB_TILING_CONFIG, tiling_config); |
1629 | WREG32(DCP_TILING_CONFIG, tiling_config & 0xffff); | 1629 | WREG32(DCP_TILING_CONFIG, tiling_config & 0xffff); |
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h index d4d776d2f1e0..be8420e65f01 100644 --- a/drivers/gpu/drm/radeon/radeon.h +++ b/drivers/gpu/drm/radeon/radeon.h | |||
@@ -914,6 +914,7 @@ struct r600_asic { | |||
914 | unsigned tiling_nbanks; | 914 | unsigned tiling_nbanks; |
915 | unsigned tiling_npipes; | 915 | unsigned tiling_npipes; |
916 | unsigned tiling_group_size; | 916 | unsigned tiling_group_size; |
917 | unsigned tile_config; | ||
917 | struct r100_gpu_lockup lockup; | 918 | struct r100_gpu_lockup lockup; |
918 | }; | 919 | }; |
919 | 920 | ||
@@ -938,6 +939,7 @@ struct rv770_asic { | |||
938 | unsigned tiling_nbanks; | 939 | unsigned tiling_nbanks; |
939 | unsigned tiling_npipes; | 940 | unsigned tiling_npipes; |
940 | unsigned tiling_group_size; | 941 | unsigned tiling_group_size; |
942 | unsigned tile_config; | ||
941 | struct r100_gpu_lockup lockup; | 943 | struct r100_gpu_lockup lockup; |
942 | }; | 944 | }; |
943 | 945 | ||
@@ -963,6 +965,7 @@ struct evergreen_asic { | |||
963 | unsigned tiling_nbanks; | 965 | unsigned tiling_nbanks; |
964 | unsigned tiling_npipes; | 966 | unsigned tiling_npipes; |
965 | unsigned tiling_group_size; | 967 | unsigned tiling_group_size; |
968 | unsigned tile_config; | ||
966 | }; | 969 | }; |
967 | 970 | ||
968 | union radeon_asic_config { | 971 | union radeon_asic_config { |
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c index ed0ceb3fc40a..6f8a2e572878 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.c +++ b/drivers/gpu/drm/radeon/radeon_drv.c | |||
@@ -46,9 +46,10 @@ | |||
46 | * - 2.3.0 - add MSPOS + 3D texture + r500 VAP regs | 46 | * - 2.3.0 - add MSPOS + 3D texture + r500 VAP regs |
47 | * - 2.4.0 - add crtc id query | 47 | * - 2.4.0 - add crtc id query |
48 | * - 2.5.0 - add get accel 2 to work around ddx breakage for evergreen | 48 | * - 2.5.0 - add get accel 2 to work around ddx breakage for evergreen |
49 | * - 2.6.0 - add tiling config query (r6xx+) | ||
49 | */ | 50 | */ |
50 | #define KMS_DRIVER_MAJOR 2 | 51 | #define KMS_DRIVER_MAJOR 2 |
51 | #define KMS_DRIVER_MINOR 5 | 52 | #define KMS_DRIVER_MINOR 6 |
52 | #define KMS_DRIVER_PATCHLEVEL 0 | 53 | #define KMS_DRIVER_PATCHLEVEL 0 |
53 | int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags); | 54 | int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags); |
54 | int radeon_driver_unload_kms(struct drm_device *dev); | 55 | int radeon_driver_unload_kms(struct drm_device *dev); |
diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c index 70fda6361cd0..9012e6fbadb6 100644 --- a/drivers/gpu/drm/radeon/radeon_kms.c +++ b/drivers/gpu/drm/radeon/radeon_kms.c | |||
@@ -147,6 +147,18 @@ int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp) | |||
147 | case RADEON_INFO_ACCEL_WORKING2: | 147 | case RADEON_INFO_ACCEL_WORKING2: |
148 | value = rdev->accel_working; | 148 | value = rdev->accel_working; |
149 | break; | 149 | break; |
150 | case RADEON_INFO_TILING_CONFIG: | ||
151 | if (rdev->family >= CHIP_CEDAR) | ||
152 | value = rdev->config.evergreen.tile_config; | ||
153 | else if (rdev->family >= CHIP_RV770) | ||
154 | value = rdev->config.rv770.tile_config; | ||
155 | else if (rdev->family >= CHIP_R600) | ||
156 | value = rdev->config.r600.tile_config; | ||
157 | else { | ||
158 | DRM_DEBUG("tiling config is r6xx+ only!\n"); | ||
159 | return -EINVAL; | ||
160 | } | ||
161 | break; | ||
150 | default: | 162 | default: |
151 | DRM_DEBUG("Invalid request %d\n", info->request); | 163 | DRM_DEBUG("Invalid request %d\n", info->request); |
152 | return -EINVAL; | 164 | return -EINVAL; |
diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c index 836c15ab84d1..236fe6681922 100644 --- a/drivers/gpu/drm/radeon/rv770.c +++ b/drivers/gpu/drm/radeon/rv770.c | |||
@@ -674,8 +674,9 @@ static void rv770_gpu_init(struct radeon_device *rdev) | |||
674 | r600_count_pipe_bits((cc_rb_backend_disable & | 674 | r600_count_pipe_bits((cc_rb_backend_disable & |
675 | R7XX_MAX_BACKENDS_MASK) >> 16)), | 675 | R7XX_MAX_BACKENDS_MASK) >> 16)), |
676 | (cc_rb_backend_disable >> 16)); | 676 | (cc_rb_backend_disable >> 16)); |
677 | gb_tiling_config |= BACKEND_MAP(backend_map); | ||
678 | 677 | ||
678 | rdev->config.rv770.tile_config = gb_tiling_config; | ||
679 | gb_tiling_config |= BACKEND_MAP(backend_map); | ||
679 | 680 | ||
680 | WREG32(GB_TILING_CONFIG, gb_tiling_config); | 681 | WREG32(GB_TILING_CONFIG, gb_tiling_config); |
681 | WREG32(DCP_TILING_CONFIG, (gb_tiling_config & 0xffff)); | 682 | WREG32(DCP_TILING_CONFIG, (gb_tiling_config & 0xffff)); |