diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2010-11-22 17:56:26 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-11-22 18:23:23 -0500 |
commit | 0ef0c1f7349e782f6c79cb7e4bf8a4c3ce3371c6 (patch) | |
tree | da4bacbd97cd8e704619adaa08c6929c53dc2d07 /drivers/gpu/drm | |
parent | 4339c442c0736db42329b68602308e95bcc75a30 (diff) |
drm/radeon/kms: move r7xx/evergreen to its own vram_gtt setup function
MC_VM_FB_LOCATION is at a different offset between r6xx and r7xx/evergreen.
The location is needed for vram setup on fusion chips.
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/radeon/evergreen.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/r600.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon.h | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/rv770.c | 44 |
4 files changed, 46 insertions, 4 deletions
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c index 728358e6b798..e9b262fdaa2c 100644 --- a/drivers/gpu/drm/radeon/evergreen.c +++ b/drivers/gpu/drm/radeon/evergreen.c | |||
@@ -1945,7 +1945,7 @@ int evergreen_mc_init(struct radeon_device *rdev) | |||
1945 | rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE) * 1024 * 1024; | 1945 | rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE) * 1024 * 1024; |
1946 | rdev->mc.visible_vram_size = rdev->mc.aper_size; | 1946 | rdev->mc.visible_vram_size = rdev->mc.aper_size; |
1947 | rdev->mc.active_vram_size = rdev->mc.visible_vram_size; | 1947 | rdev->mc.active_vram_size = rdev->mc.visible_vram_size; |
1948 | r600_vram_gtt_location(rdev, &rdev->mc); | 1948 | r700_vram_gtt_location(rdev, &rdev->mc); |
1949 | radeon_update_bandwidth_info(rdev); | 1949 | radeon_update_bandwidth_info(rdev); |
1950 | 1950 | ||
1951 | return 0; | 1951 | return 0; |
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index a3552594ccc4..93b1c687328b 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c | |||
@@ -1161,7 +1161,7 @@ static void r600_mc_program(struct radeon_device *rdev) | |||
1161 | * Note: GTT start, end, size should be initialized before calling this | 1161 | * Note: GTT start, end, size should be initialized before calling this |
1162 | * function on AGP platform. | 1162 | * function on AGP platform. |
1163 | */ | 1163 | */ |
1164 | void r600_vram_gtt_location(struct radeon_device *rdev, struct radeon_mc *mc) | 1164 | static void r600_vram_gtt_location(struct radeon_device *rdev, struct radeon_mc *mc) |
1165 | { | 1165 | { |
1166 | u64 size_bf, size_af; | 1166 | u64 size_bf, size_af; |
1167 | 1167 | ||
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h index cfaf71323491..bf3a4fc82964 100644 --- a/drivers/gpu/drm/radeon/radeon.h +++ b/drivers/gpu/drm/radeon/radeon.h | |||
@@ -1433,7 +1433,6 @@ extern void rs690_line_buffer_adjust(struct radeon_device *rdev, | |||
1433 | struct drm_display_mode *mode2); | 1433 | struct drm_display_mode *mode2); |
1434 | 1434 | ||
1435 | /* r600, rv610, rv630, rv620, rv635, rv670, rs780, rs880 */ | 1435 | /* r600, rv610, rv630, rv620, rv635, rv670, rs780, rs880 */ |
1436 | extern void r600_vram_gtt_location(struct radeon_device *rdev, struct radeon_mc *mc); | ||
1437 | extern bool r600_card_posted(struct radeon_device *rdev); | 1436 | extern bool r600_card_posted(struct radeon_device *rdev); |
1438 | extern void r600_cp_stop(struct radeon_device *rdev); | 1437 | extern void r600_cp_stop(struct radeon_device *rdev); |
1439 | extern int r600_cp_start(struct radeon_device *rdev); | 1438 | extern int r600_cp_start(struct radeon_device *rdev); |
@@ -1479,6 +1478,7 @@ extern void r600_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mo | |||
1479 | extern int r600_hdmi_buffer_status_changed(struct drm_encoder *encoder); | 1478 | extern int r600_hdmi_buffer_status_changed(struct drm_encoder *encoder); |
1480 | extern void r600_hdmi_update_audio_settings(struct drm_encoder *encoder); | 1479 | extern void r600_hdmi_update_audio_settings(struct drm_encoder *encoder); |
1481 | 1480 | ||
1481 | extern void r700_vram_gtt_location(struct radeon_device *rdev, struct radeon_mc *mc); | ||
1482 | extern void r700_cp_stop(struct radeon_device *rdev); | 1482 | extern void r700_cp_stop(struct radeon_device *rdev); |
1483 | extern void r700_cp_fini(struct radeon_device *rdev); | 1483 | extern void r700_cp_fini(struct radeon_device *rdev); |
1484 | extern void evergreen_disable_interrupt_state(struct radeon_device *rdev); | 1484 | extern void evergreen_disable_interrupt_state(struct radeon_device *rdev); |
diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c index 24ebd0879c4b..c23349a46fd2 100644 --- a/drivers/gpu/drm/radeon/rv770.c +++ b/drivers/gpu/drm/radeon/rv770.c | |||
@@ -1001,6 +1001,48 @@ static void rv770_vram_scratch_fini(struct radeon_device *rdev) | |||
1001 | radeon_bo_unref(&rdev->vram_scratch.robj); | 1001 | radeon_bo_unref(&rdev->vram_scratch.robj); |
1002 | } | 1002 | } |
1003 | 1003 | ||
1004 | void r700_vram_gtt_location(struct radeon_device *rdev, struct radeon_mc *mc) | ||
1005 | { | ||
1006 | u64 size_bf, size_af; | ||
1007 | |||
1008 | if (mc->mc_vram_size > 0xE0000000) { | ||
1009 | /* leave room for at least 512M GTT */ | ||
1010 | dev_warn(rdev->dev, "limiting VRAM\n"); | ||
1011 | mc->real_vram_size = 0xE0000000; | ||
1012 | mc->mc_vram_size = 0xE0000000; | ||
1013 | } | ||
1014 | if (rdev->flags & RADEON_IS_AGP) { | ||
1015 | size_bf = mc->gtt_start; | ||
1016 | size_af = 0xFFFFFFFF - mc->gtt_end + 1; | ||
1017 | if (size_bf > size_af) { | ||
1018 | if (mc->mc_vram_size > size_bf) { | ||
1019 | dev_warn(rdev->dev, "limiting VRAM\n"); | ||
1020 | mc->real_vram_size = size_bf; | ||
1021 | mc->mc_vram_size = size_bf; | ||
1022 | } | ||
1023 | mc->vram_start = mc->gtt_start - mc->mc_vram_size; | ||
1024 | } else { | ||
1025 | if (mc->mc_vram_size > size_af) { | ||
1026 | dev_warn(rdev->dev, "limiting VRAM\n"); | ||
1027 | mc->real_vram_size = size_af; | ||
1028 | mc->mc_vram_size = size_af; | ||
1029 | } | ||
1030 | mc->vram_start = mc->gtt_end; | ||
1031 | } | ||
1032 | mc->vram_end = mc->vram_start + mc->mc_vram_size - 1; | ||
1033 | dev_info(rdev->dev, "VRAM: %lluM 0x%08llX - 0x%08llX (%lluM used)\n", | ||
1034 | mc->mc_vram_size >> 20, mc->vram_start, | ||
1035 | mc->vram_end, mc->real_vram_size >> 20); | ||
1036 | } else { | ||
1037 | u64 base = 0; | ||
1038 | if (rdev->flags & RADEON_IS_IGP) | ||
1039 | base = (RREG32(MC_VM_FB_LOCATION) & 0xFFFF) << 24; | ||
1040 | radeon_vram_location(rdev, &rdev->mc, base); | ||
1041 | rdev->mc.gtt_base_align = 0; | ||
1042 | radeon_gtt_location(rdev, mc); | ||
1043 | } | ||
1044 | } | ||
1045 | |||
1004 | int rv770_mc_init(struct radeon_device *rdev) | 1046 | int rv770_mc_init(struct radeon_device *rdev) |
1005 | { | 1047 | { |
1006 | u32 tmp; | 1048 | u32 tmp; |
@@ -1041,7 +1083,7 @@ int rv770_mc_init(struct radeon_device *rdev) | |||
1041 | rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE); | 1083 | rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE); |
1042 | rdev->mc.visible_vram_size = rdev->mc.aper_size; | 1084 | rdev->mc.visible_vram_size = rdev->mc.aper_size; |
1043 | rdev->mc.active_vram_size = rdev->mc.visible_vram_size; | 1085 | rdev->mc.active_vram_size = rdev->mc.visible_vram_size; |
1044 | r600_vram_gtt_location(rdev, &rdev->mc); | 1086 | r700_vram_gtt_location(rdev, &rdev->mc); |
1045 | radeon_update_bandwidth_info(rdev); | 1087 | radeon_update_bandwidth_info(rdev); |
1046 | 1088 | ||
1047 | return 0; | 1089 | return 0; |