svn commit: r267057 - stable/9/sys/dev/drm2/radeon
Marius Strobl
marius at FreeBSD.org
Wed Jun 4 15:04:37 UTC 2014
Author: marius
Date: Wed Jun 4 15:04:36 2014
New Revision: 267057
URL: http://svnweb.freebsd.org/changeset/base/267057
Log:
MFC: r266792
Fix DMA handling in radeon_dummy_page_init():
- Based on actual usage and on what Linux does, dummy_page.addr should
contain the physical bus address of the dummy page rather than its
virtual one. As a side-effect, correcting this bug fixes compilation
with PAE support enabled by getting rid of an inappropriate cast.
- Also based on actual usage of dummy_page.addr, theoretically Radeon
devices could do a maximum of 44-bit DMA. In reality, though, it is
more likely that they only support 32-bit DMA, at least that is what
radeon_gart_table_ram_alloc() sets up for, too. However, passing ~0
to drm_pci_alloc() as maxaddr parameter translates to 64-bit DMA on
amd64/64-bit machines. Thus, use BUS_SPACE_MAXSIZE_32BIT instead,
which the existing 32-bit DMA limits within the drm2 code spelled as
0xFFFFFFFF should also be changed to.
Reviewed by: dumbbell
Approved by: re (gjb)
Sponsored by: Bally Wulff Games & Entertainment GmbH
Modified:
stable/9/sys/dev/drm2/radeon/radeon_device.c
Directory Properties:
stable/9/sys/ (props changed)
stable/9/sys/dev/ (props changed)
Modified: stable/9/sys/dev/drm2/radeon/radeon_device.c
==============================================================================
--- stable/9/sys/dev/drm2/radeon/radeon_device.c Wed Jun 4 14:58:51 2014 (r267056)
+++ stable/9/sys/dev/drm2/radeon/radeon_device.c Wed Jun 4 15:04:36 2014 (r267057)
@@ -548,10 +548,10 @@ int radeon_dummy_page_init(struct radeon
if (rdev->dummy_page.dmah)
return 0;
rdev->dummy_page.dmah = drm_pci_alloc(rdev->ddev,
- PAGE_SIZE, PAGE_SIZE, ~0);
+ PAGE_SIZE, PAGE_SIZE, BUS_SPACE_MAXSIZE_32BIT);
if (rdev->dummy_page.dmah == NULL)
return -ENOMEM;
- rdev->dummy_page.addr = (dma_addr_t)rdev->dummy_page.dmah->vaddr;
+ rdev->dummy_page.addr = rdev->dummy_page.dmah->busaddr;
return 0;
}
More information about the svn-src-stable-9
mailing list