diff options
author | Jerome Glisse <jglisse@redhat.com> | 2011-11-03 11:16:49 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-11-04 06:39:51 -0400 |
commit | c9a1be96277b3b2d2e8aff2ba69d7817ea8e46c9 (patch) | |
tree | 7f27b6d926b44184f8ef089527be81d981c08b9f /drivers/gpu/drm/radeon/r100.c | |
parent | 0e2c978ef2248156f36db7fcda8c7b67998ec58a (diff) |
drm/radeon/kms: consolidate GART code, fix segfault after GPU lockup V2
After GPU lockup VRAM gart table is unpinned and thus its pointer
becomes unvalid. This patch move the unpin code to a common helper
function and set pointer to NULL so that page update code can check
if it should update GPU page table or not. That way bo still bound
to GART can be unbound (pci_unmap_page for all there page) properly
while there is no need to update the GPU page table.
V2 move the test for null gart out of the loop, small optimization
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/r100.c')
-rw-r--r-- | drivers/gpu/drm/radeon/r100.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c index 4191eaf47381..6d7766260419 100644 --- a/drivers/gpu/drm/radeon/r100.c +++ b/drivers/gpu/drm/radeon/r100.c | |||
@@ -577,7 +577,7 @@ int r100_pci_gart_init(struct radeon_device *rdev) | |||
577 | { | 577 | { |
578 | int r; | 578 | int r; |
579 | 579 | ||
580 | if (rdev->gart.table.ram.ptr) { | 580 | if (rdev->gart.ptr) { |
581 | WARN(1, "R100 PCI GART already initialized\n"); | 581 | WARN(1, "R100 PCI GART already initialized\n"); |
582 | return 0; | 582 | return 0; |
583 | } | 583 | } |
@@ -636,10 +636,12 @@ void r100_pci_gart_disable(struct radeon_device *rdev) | |||
636 | 636 | ||
637 | int r100_pci_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr) | 637 | int r100_pci_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr) |
638 | { | 638 | { |
639 | u32 *gtt = rdev->gart.ptr; | ||
640 | |||
639 | if (i < 0 || i > rdev->gart.num_gpu_pages) { | 641 | if (i < 0 || i > rdev->gart.num_gpu_pages) { |
640 | return -EINVAL; | 642 | return -EINVAL; |
641 | } | 643 | } |
642 | rdev->gart.table.ram.ptr[i] = cpu_to_le32(lower_32_bits(addr)); | 644 | gtt[i] = cpu_to_le32(lower_32_bits(addr)); |
643 | return 0; | 645 | return 0; |
644 | } | 646 | } |
645 | 647 | ||