aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon.h
diff options
context:
space:
mode:
authorJerome Glisse <jglisse@redhat.com>2010-02-17 16:54:29 -0500
committerDave Airlie <airlied@redhat.com>2010-02-17 23:49:35 -0500
commitd594e46ace22afa1621254f6f669e65430048153 (patch)
treebefd5b54ce1b8284acc4ee450d085a7d2c7b01fd /drivers/gpu/drm/radeon/radeon.h
parent44ca7478d46aaad488d916f7262253e000ee60f9 (diff)
drm/radeon/kms: simplify memory controller setup V2
Get rid of _location and use _start/_end also simplify the computation of vram_start|end & gtt_start|end. For R1XX-R2XX we place VRAM at the same address of PCI aperture, those GPU shouldn't have much memory and seems to behave better when setup that way. For R3XX and newer we place VRAM at 0. For R6XX-R7XX AGP we place VRAM before or after AGP aperture this might limit to limit the VRAM size but it's very unlikely. For IGP we don't change the VRAM placement. Tested on (compiz,quake3,suspend/resume): PCI/PCIE:RV280,R420,RV515,RV570,RV610,RV710 AGP:RV100,RV280,R420,RV350,RV620(RPB*),RV730 IGP:RS480(RPB*),RS690,RS780(RPB*),RS880 RPB: resume previously broken V2 correct commit message to reflect more accurately the bug and move VRAM placement to 0 for most of the GPU to avoid limiting VRAM. Signed-off-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon.h')
-rw-r--r--drivers/gpu/drm/radeon/radeon.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index 350ae71953e9..0ca83ca91111 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -282,6 +282,7 @@ union radeon_gart_table {
282}; 282};
283 283
284#define RADEON_GPU_PAGE_SIZE 4096 284#define RADEON_GPU_PAGE_SIZE 4096
285#define RADEON_GPU_PAGE_MASK (RADEON_GPU_PAGE_SIZE - 1)
285 286
286struct radeon_gart { 287struct radeon_gart {
287 dma_addr_t table_addr; 288 dma_addr_t table_addr;
@@ -316,21 +317,19 @@ struct radeon_mc {
316 /* for some chips with <= 32MB we need to lie 317 /* for some chips with <= 32MB we need to lie
317 * about vram size near mc fb location */ 318 * about vram size near mc fb location */
318 u64 mc_vram_size; 319 u64 mc_vram_size;
319 u64 gtt_location; 320 u64 visible_vram_size;
320 u64 gtt_size; 321 u64 gtt_size;
321 u64 gtt_start; 322 u64 gtt_start;
322 u64 gtt_end; 323 u64 gtt_end;
323 u64 vram_location;
324 u64 vram_start; 324 u64 vram_start;
325 u64 vram_end; 325 u64 vram_end;
326 unsigned vram_width; 326 unsigned vram_width;
327 u64 real_vram_size; 327 u64 real_vram_size;
328 int vram_mtrr; 328 int vram_mtrr;
329 bool vram_is_ddr; 329 bool vram_is_ddr;
330 bool igp_sideport_enabled; 330 bool igp_sideport_enabled;
331}; 331};
332 332
333int radeon_mc_setup(struct radeon_device *rdev);
334bool radeon_combios_sideport_present(struct radeon_device *rdev); 333bool radeon_combios_sideport_present(struct radeon_device *rdev);
335bool radeon_atombios_sideport_present(struct radeon_device *rdev); 334bool radeon_atombios_sideport_present(struct radeon_device *rdev);
336 335
@@ -1165,6 +1164,8 @@ extern void radeon_legacy_set_clock_gating(struct radeon_device *rdev, int enabl
1165extern void radeon_atom_set_clock_gating(struct radeon_device *rdev, int enable); 1164extern void radeon_atom_set_clock_gating(struct radeon_device *rdev, int enable);
1166extern void radeon_ttm_placement_from_domain(struct radeon_bo *rbo, u32 domain); 1165extern void radeon_ttm_placement_from_domain(struct radeon_bo *rbo, u32 domain);
1167extern bool radeon_ttm_bo_is_radeon_bo(struct ttm_buffer_object *bo); 1166extern bool radeon_ttm_bo_is_radeon_bo(struct ttm_buffer_object *bo);
1167extern void radeon_vram_location(struct radeon_device *rdev, struct radeon_mc *mc, u64 base);
1168extern void radeon_gtt_location(struct radeon_device *rdev, struct radeon_mc *mc);
1168 1169
1169/* r100,rv100,rs100,rv200,rs200,r200,rv250,rs300,rv280 */ 1170/* r100,rv100,rs100,rv200,rs200,r200,rv250,rs300,rv280 */
1170struct r100_mc_save { 1171struct r100_mc_save {
@@ -1219,7 +1220,7 @@ extern void r200_set_safe_registers(struct radeon_device *rdev);
1219/* r300,r350,rv350,rv370,rv380 */ 1220/* r300,r350,rv350,rv370,rv380 */
1220extern void r300_set_reg_safe(struct radeon_device *rdev); 1221extern void r300_set_reg_safe(struct radeon_device *rdev);
1221extern void r300_mc_program(struct radeon_device *rdev); 1222extern void r300_mc_program(struct radeon_device *rdev);
1222extern void r300_vram_info(struct radeon_device *rdev); 1223extern void r300_mc_init(struct radeon_device *rdev);
1223extern void r300_clock_startup(struct radeon_device *rdev); 1224extern void r300_clock_startup(struct radeon_device *rdev);
1224extern int r300_mc_wait_for_idle(struct radeon_device *rdev); 1225extern int r300_mc_wait_for_idle(struct radeon_device *rdev);
1225extern int rv370_pcie_gart_init(struct radeon_device *rdev); 1226extern int rv370_pcie_gart_init(struct radeon_device *rdev);
@@ -1228,7 +1229,6 @@ extern int rv370_pcie_gart_enable(struct radeon_device *rdev);
1228extern void rv370_pcie_gart_disable(struct radeon_device *rdev); 1229extern void rv370_pcie_gart_disable(struct radeon_device *rdev);
1229 1230
1230/* r420,r423,rv410 */ 1231/* r420,r423,rv410 */
1231extern int r420_mc_init(struct radeon_device *rdev);
1232extern u32 r420_mc_rreg(struct radeon_device *rdev, u32 reg); 1232extern u32 r420_mc_rreg(struct radeon_device *rdev, u32 reg);
1233extern void r420_mc_wreg(struct radeon_device *rdev, u32 reg, u32 v); 1233extern void r420_mc_wreg(struct radeon_device *rdev, u32 reg, u32 v);
1234extern int r420_debugfs_pipes_info_init(struct radeon_device *rdev); 1234extern int r420_debugfs_pipes_info_init(struct radeon_device *rdev);
@@ -1270,6 +1270,7 @@ extern void rs690_line_buffer_adjust(struct radeon_device *rdev,
1270 struct drm_display_mode *mode2); 1270 struct drm_display_mode *mode2);
1271 1271
1272/* r600, rv610, rv630, rv620, rv635, rv670, rs780, rs880 */ 1272/* r600, rv610, rv630, rv620, rv635, rv670, rs780, rs880 */
1273extern void r600_vram_gtt_location(struct radeon_device *rdev, struct radeon_mc *mc);
1273extern bool r600_card_posted(struct radeon_device *rdev); 1274extern bool r600_card_posted(struct radeon_device *rdev);
1274extern void r600_cp_stop(struct radeon_device *rdev); 1275extern void r600_cp_stop(struct radeon_device *rdev);
1275extern void r600_ring_init(struct radeon_device *rdev, unsigned ring_size); 1276extern void r600_ring_init(struct radeon_device *rdev, unsigned ring_size);