aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/radeon/evergreen.c1
-rw-r--r--drivers/gpu/drm/radeon/r100.c5
-rw-r--r--drivers/gpu/drm/radeon/r600.c1
-rw-r--r--drivers/gpu/drm/radeon/radeon_object.c3
-rw-r--r--drivers/gpu/drm/radeon/rs600.c5
-rw-r--r--drivers/gpu/drm/radeon/rs690.c1
-rw-r--r--drivers/gpu/drm/radeon/rv770.c1
7 files changed, 13 insertions, 4 deletions
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c
index 3f973d411d61..bd2e7aa85c1d 100644
--- a/drivers/gpu/drm/radeon/evergreen.c
+++ b/drivers/gpu/drm/radeon/evergreen.c
@@ -474,6 +474,7 @@ int evergreen_mc_init(struct radeon_device *rdev)
474 /* size in MB on evergreen */ 474 /* size in MB on evergreen */
475 rdev->mc.mc_vram_size = RREG32(CONFIG_MEMSIZE) * 1024 * 1024; 475 rdev->mc.mc_vram_size = RREG32(CONFIG_MEMSIZE) * 1024 * 1024;
476 rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE) * 1024 * 1024; 476 rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE) * 1024 * 1024;
477 rdev->mc.visible_vram_size = rdev->mc.aper_size;
477 /* FIXME remove this once we support unmappable VRAM */ 478 /* FIXME remove this once we support unmappable VRAM */
478 if (rdev->mc.mc_vram_size > rdev->mc.aper_size) { 479 if (rdev->mc.mc_vram_size > rdev->mc.aper_size) {
479 rdev->mc.mc_vram_size = rdev->mc.aper_size; 480 rdev->mc.mc_vram_size = rdev->mc.aper_size;
diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c
index 1fdd793343b9..91eb762eb3f9 100644
--- a/drivers/gpu/drm/radeon/r100.c
+++ b/drivers/gpu/drm/radeon/r100.c
@@ -1958,9 +1958,12 @@ void r100_vram_init_sizes(struct radeon_device *rdev)
1958 u64 config_aper_size; 1958 u64 config_aper_size;
1959 1959
1960 /* work out accessible VRAM */ 1960 /* work out accessible VRAM */
1961 rdev->mc.visible_vram_size = r100_get_accessible_vram(rdev);
1962 rdev->mc.aper_base = drm_get_resource_start(rdev->ddev, 0); 1961 rdev->mc.aper_base = drm_get_resource_start(rdev->ddev, 0);
1963 rdev->mc.aper_size = drm_get_resource_len(rdev->ddev, 0); 1962 rdev->mc.aper_size = drm_get_resource_len(rdev->ddev, 0);
1963 rdev->mc.visible_vram_size = r100_get_accessible_vram(rdev);
1964 /* FIXME we don't use the second aperture yet when we could use it */
1965 if (rdev->mc.visible_vram_size > rdev->mc.aper_size)
1966 rdev->mc.visible_vram_size = rdev->mc.aper_size;
1964 config_aper_size = RREG32(RADEON_CONFIG_APER_SIZE); 1967 config_aper_size = RREG32(RADEON_CONFIG_APER_SIZE);
1965 if (rdev->flags & RADEON_IS_IGP) { 1968 if (rdev->flags & RADEON_IS_IGP) {
1966 uint32_t tom; 1969 uint32_t tom;
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index b3c7e0f87b91..f9a83358aa5a 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -712,6 +712,7 @@ int r600_mc_init(struct radeon_device *rdev)
712 /* Setup GPU memory space */ 712 /* Setup GPU memory space */
713 rdev->mc.mc_vram_size = RREG32(CONFIG_MEMSIZE); 713 rdev->mc.mc_vram_size = RREG32(CONFIG_MEMSIZE);
714 rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE); 714 rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE);
715 rdev->mc.visible_vram_size = rdev->mc.aper_size;
715 /* FIXME remove this once we support unmappable VRAM */ 716 /* FIXME remove this once we support unmappable VRAM */
716 if (rdev->mc.mc_vram_size > rdev->mc.aper_size) { 717 if (rdev->mc.mc_vram_size > rdev->mc.aper_size) {
717 rdev->mc.mc_vram_size = rdev->mc.aper_size; 718 rdev->mc.mc_vram_size = rdev->mc.aper_size;
diff --git a/drivers/gpu/drm/radeon/radeon_object.c b/drivers/gpu/drm/radeon/radeon_object.c
index f1da370928eb..fc9d00ac6b15 100644
--- a/drivers/gpu/drm/radeon/radeon_object.c
+++ b/drivers/gpu/drm/radeon/radeon_object.c
@@ -178,7 +178,6 @@ int radeon_bo_pin(struct radeon_bo *bo, u32 domain, u64 *gpu_addr)
178{ 178{
179 int r, i; 179 int r, i;
180 180
181 radeon_ttm_placement_from_domain(bo, domain);
182 if (bo->pin_count) { 181 if (bo->pin_count) {
183 bo->pin_count++; 182 bo->pin_count++;
184 if (gpu_addr) 183 if (gpu_addr)
@@ -186,6 +185,8 @@ int radeon_bo_pin(struct radeon_bo *bo, u32 domain, u64 *gpu_addr)
186 return 0; 185 return 0;
187 } 186 }
188 radeon_ttm_placement_from_domain(bo, domain); 187 radeon_ttm_placement_from_domain(bo, domain);
188 /* force to pin into visible video ram */
189 bo->placement.lpfn = bo->rdev->mc.visible_vram_size >> PAGE_SHIFT;
189 for (i = 0; i < bo->placement.num_placement; i++) 190 for (i = 0; i < bo->placement.num_placement; i++)
190 bo->placements[i] |= TTM_PL_FLAG_NO_EVICT; 191 bo->placements[i] |= TTM_PL_FLAG_NO_EVICT;
191 r = ttm_bo_validate(&bo->tbo, &bo->placement, false, false); 192 r = ttm_bo_validate(&bo->tbo, &bo->placement, false, false);
diff --git a/drivers/gpu/drm/radeon/rs600.c b/drivers/gpu/drm/radeon/rs600.c
index d5aeb2a31d59..47f046b78c6b 100644
--- a/drivers/gpu/drm/radeon/rs600.c
+++ b/drivers/gpu/drm/radeon/rs600.c
@@ -462,12 +462,13 @@ void rs600_mc_init(struct radeon_device *rdev)
462{ 462{
463 u64 base; 463 u64 base;
464 464
465 rdev->mc.aper_base = drm_get_resource_start(rdev->ddev, 0);
466 rdev->mc.aper_size = drm_get_resource_len(rdev->ddev, 0);
465 rdev->mc.vram_is_ddr = true; 467 rdev->mc.vram_is_ddr = true;
466 rdev->mc.vram_width = 128; 468 rdev->mc.vram_width = 128;
467 rdev->mc.real_vram_size = RREG32(RADEON_CONFIG_MEMSIZE); 469 rdev->mc.real_vram_size = RREG32(RADEON_CONFIG_MEMSIZE);
468 rdev->mc.mc_vram_size = rdev->mc.real_vram_size; 470 rdev->mc.mc_vram_size = rdev->mc.real_vram_size;
469 rdev->mc.aper_base = drm_get_resource_start(rdev->ddev, 0); 471 rdev->mc.visible_vram_size = rdev->mc.aper_size;
470 rdev->mc.aper_size = drm_get_resource_len(rdev->ddev, 0);
471 rdev->mc.igp_sideport_enabled = radeon_atombios_sideport_present(rdev); 472 rdev->mc.igp_sideport_enabled = radeon_atombios_sideport_present(rdev);
472 base = RREG32_MC(R_000004_MC_FB_LOCATION); 473 base = RREG32_MC(R_000004_MC_FB_LOCATION);
473 base = G_000004_MC_FB_START(base) << 16; 474 base = G_000004_MC_FB_START(base) << 16;
diff --git a/drivers/gpu/drm/radeon/rs690.c b/drivers/gpu/drm/radeon/rs690.c
index 8d37501da7df..83b9174f76f2 100644
--- a/drivers/gpu/drm/radeon/rs690.c
+++ b/drivers/gpu/drm/radeon/rs690.c
@@ -141,6 +141,7 @@ void rs690_mc_init(struct radeon_device *rdev)
141 rdev->mc.mc_vram_size = rdev->mc.real_vram_size; 141 rdev->mc.mc_vram_size = rdev->mc.real_vram_size;
142 rdev->mc.aper_base = drm_get_resource_start(rdev->ddev, 0); 142 rdev->mc.aper_base = drm_get_resource_start(rdev->ddev, 0);
143 rdev->mc.aper_size = drm_get_resource_len(rdev->ddev, 0); 143 rdev->mc.aper_size = drm_get_resource_len(rdev->ddev, 0);
144 rdev->mc.visible_vram_size = rdev->mc.aper_size;
144 base = RREG32_MC(R_000100_MCCFG_FB_LOCATION); 145 base = RREG32_MC(R_000100_MCCFG_FB_LOCATION);
145 base = G_000100_MC_FB_START(base) << 16; 146 base = G_000100_MC_FB_START(base) << 16;
146 rs690_pm_info(rdev); 147 rs690_pm_info(rdev);
diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c
index 88356b0a1f63..37887dee12af 100644
--- a/drivers/gpu/drm/radeon/rv770.c
+++ b/drivers/gpu/drm/radeon/rv770.c
@@ -901,6 +901,7 @@ int rv770_mc_init(struct radeon_device *rdev)
901 /* Setup GPU memory space */ 901 /* Setup GPU memory space */
902 rdev->mc.mc_vram_size = RREG32(CONFIG_MEMSIZE); 902 rdev->mc.mc_vram_size = RREG32(CONFIG_MEMSIZE);
903 rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE); 903 rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE);
904 rdev->mc.visible_vram_size = rdev->mc.aper_size;
904 /* FIXME remove this once we support unmappable VRAM */ 905 /* FIXME remove this once we support unmappable VRAM */
905 if (rdev->mc.mc_vram_size > rdev->mc.aper_size) { 906 if (rdev->mc.mc_vram_size > rdev->mc.aper_size) {
906 rdev->mc.mc_vram_size = rdev->mc.aper_size; 907 rdev->mc.mc_vram_size = rdev->mc.aper_size;