aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2012-07-20 00:53:28 -0400
committerDave Airlie <airlied@redhat.com>2012-07-20 00:53:28 -0400
commite6b0b6a82f9c93fe3dd060ae54719456474a74a3 (patch)
tree89528134f61971718b1fa363b54bc3c7cebf1392 /drivers/gpu/drm/radeon
parent83bc5fd29afff5898cadf87fb29eb9260eecc63e (diff)
parent84a1caf1453c3d44050bd22db958af4a7f99315c (diff)
Merge tag 'v3.5-rc7' into drm-next
Merge Linus tree into drm to fixup conflicts in radeon code for further testing before upstream merge. Signed-off-by: Dave Airlie <airlied@redhat.com> Conflicts: drivers/gpu/drm/i915/i915_dma.c drivers/gpu/drm/i915/intel_display.c drivers/gpu/drm/radeon/radeon_gart.c
Diffstat (limited to 'drivers/gpu/drm/radeon')
-rw-r--r--drivers/gpu/drm/radeon/radeon_gart.c13
-rw-r--r--drivers/gpu/drm/radeon/radeon_gem.c10
-rw-r--r--drivers/gpu/drm/radeon/si.c4
3 files changed, 19 insertions, 8 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_gart.c b/drivers/gpu/drm/radeon/radeon_gart.c
index 9727ea117223..b3720054614d 100644
--- a/drivers/gpu/drm/radeon/radeon_gart.c
+++ b/drivers/gpu/drm/radeon/radeon_gart.c
@@ -438,8 +438,9 @@ int radeon_vm_manager_init(struct radeon_device *rdev)
438 438
439 if (!rdev->vm_manager.enabled) { 439 if (!rdev->vm_manager.enabled) {
440 /* mark first vm as always in use, it's the system one */ 440 /* mark first vm as always in use, it's the system one */
441 /* allocate enough for 2 full VM pts */
441 r = radeon_sa_bo_manager_init(rdev, &rdev->vm_manager.sa_manager, 442 r = radeon_sa_bo_manager_init(rdev, &rdev->vm_manager.sa_manager,
442 rdev->vm_manager.max_pfn * 8, 443 rdev->vm_manager.max_pfn * 8 * 2,
443 RADEON_GEM_DOMAIN_VRAM); 444 RADEON_GEM_DOMAIN_VRAM);
444 if (r) { 445 if (r) {
445 dev_err(rdev->dev, "failed to allocate vm bo (%dKB)\n", 446 dev_err(rdev->dev, "failed to allocate vm bo (%dKB)\n",
@@ -915,7 +916,15 @@ int radeon_vm_init(struct radeon_device *rdev, struct radeon_vm *vm)
915 mutex_init(&vm->mutex); 916 mutex_init(&vm->mutex);
916 INIT_LIST_HEAD(&vm->list); 917 INIT_LIST_HEAD(&vm->list);
917 INIT_LIST_HEAD(&vm->va); 918 INIT_LIST_HEAD(&vm->va);
918 vm->last_pfn = 0; 919 /* SI requires equal sized PTs for all VMs, so always set
920 * last_pfn to max_pfn. cayman allows variable sized
921 * pts so we can grow then as needed. Once we switch
922 * to two level pts we can unify this again.
923 */
924 if (rdev->family >= CHIP_TAHITI)
925 vm->last_pfn = rdev->vm_manager.max_pfn;
926 else
927 vm->last_pfn = 0;
919 /* map the ib pool buffer at 0 in virtual address space, set 928 /* map the ib pool buffer at 0 in virtual address space, set
920 * read only 929 * read only
921 */ 930 */
diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c
index b0be9c4f4c91..84d045245739 100644
--- a/drivers/gpu/drm/radeon/radeon_gem.c
+++ b/drivers/gpu/drm/radeon/radeon_gem.c
@@ -298,6 +298,7 @@ int radeon_gem_mmap_ioctl(struct drm_device *dev, void *data,
298int radeon_gem_busy_ioctl(struct drm_device *dev, void *data, 298int radeon_gem_busy_ioctl(struct drm_device *dev, void *data,
299 struct drm_file *filp) 299 struct drm_file *filp)
300{ 300{
301 struct radeon_device *rdev = dev->dev_private;
301 struct drm_radeon_gem_busy *args = data; 302 struct drm_radeon_gem_busy *args = data;
302 struct drm_gem_object *gobj; 303 struct drm_gem_object *gobj;
303 struct radeon_bo *robj; 304 struct radeon_bo *robj;
@@ -323,13 +324,14 @@ int radeon_gem_busy_ioctl(struct drm_device *dev, void *data,
323 break; 324 break;
324 } 325 }
325 drm_gem_object_unreference_unlocked(gobj); 326 drm_gem_object_unreference_unlocked(gobj);
326 r = radeon_gem_handle_lockup(robj->rdev, r); 327 r = radeon_gem_handle_lockup(rdev, r);
327 return r; 328 return r;
328} 329}
329 330
330int radeon_gem_wait_idle_ioctl(struct drm_device *dev, void *data, 331int radeon_gem_wait_idle_ioctl(struct drm_device *dev, void *data,
331 struct drm_file *filp) 332 struct drm_file *filp)
332{ 333{
334 struct radeon_device *rdev = dev->dev_private;
333 struct drm_radeon_gem_wait_idle *args = data; 335 struct drm_radeon_gem_wait_idle *args = data;
334 struct drm_gem_object *gobj; 336 struct drm_gem_object *gobj;
335 struct radeon_bo *robj; 337 struct radeon_bo *robj;
@@ -342,10 +344,10 @@ int radeon_gem_wait_idle_ioctl(struct drm_device *dev, void *data,
342 robj = gem_to_radeon_bo(gobj); 344 robj = gem_to_radeon_bo(gobj);
343 r = radeon_bo_wait(robj, NULL, false); 345 r = radeon_bo_wait(robj, NULL, false);
344 /* callback hw specific functions if any */ 346 /* callback hw specific functions if any */
345 if (robj->rdev->asic->ioctl_wait_idle) 347 if (rdev->asic->ioctl_wait_idle)
346 robj->rdev->asic->ioctl_wait_idle(robj->rdev, robj); 348 robj->rdev->asic->ioctl_wait_idle(rdev, robj);
347 drm_gem_object_unreference_unlocked(gobj); 349 drm_gem_object_unreference_unlocked(gobj);
348 r = radeon_gem_handle_lockup(robj->rdev, r); 350 r = radeon_gem_handle_lockup(rdev, r);
349 return r; 351 return r;
350} 352}
351 353
diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c
index 7c3e330c7b59..c053f8193771 100644
--- a/drivers/gpu/drm/radeon/si.c
+++ b/drivers/gpu/drm/radeon/si.c
@@ -2398,12 +2398,12 @@ int si_pcie_gart_enable(struct radeon_device *rdev)
2398 WREG32(0x15DC, 0); 2398 WREG32(0x15DC, 0);
2399 2399
2400 /* empty context1-15 */ 2400 /* empty context1-15 */
2401 /* FIXME start with 1G, once using 2 level pt switch to full 2401 /* FIXME start with 4G, once using 2 level pt switch to full
2402 * vm size space 2402 * vm size space
2403 */ 2403 */
2404 /* set vm size, must be a multiple of 4 */ 2404 /* set vm size, must be a multiple of 4 */
2405 WREG32(VM_CONTEXT1_PAGE_TABLE_START_ADDR, 0); 2405 WREG32(VM_CONTEXT1_PAGE_TABLE_START_ADDR, 0);
2406 WREG32(VM_CONTEXT1_PAGE_TABLE_END_ADDR, (1 << 30) / RADEON_GPU_PAGE_SIZE); 2406 WREG32(VM_CONTEXT1_PAGE_TABLE_END_ADDR, rdev->vm_manager.max_pfn);
2407 for (i = 1; i < 16; i++) { 2407 for (i = 1; i < 16; i++) {
2408 if (i < 8) 2408 if (i < 8)
2409 WREG32(VM_CONTEXT0_PAGE_TABLE_BASE_ADDR + (i << 2), 2409 WREG32(VM_CONTEXT0_PAGE_TABLE_BASE_ADDR + (i << 2),