summaryrefslogtreecommitdiffstats
path: root/sys/dev/drm/drm_sysctl.c
diff options
context:
space:
mode:
authorrnoland <rnoland@FreeBSD.org>2010-04-22 18:21:25 +0000
committerrnoland <rnoland@FreeBSD.org>2010-04-22 18:21:25 +0000
commitb733ebaa1ccc608f662359519c4712cf384b1360 (patch)
tree4cbae1e0936ed160e9fca32b44038b3450bb6072 /sys/dev/drm/drm_sysctl.c
parentc0d6a78ddcc9bdcf4f9ee2858efab1abf0db5bdf (diff)
downloadFreeBSD-src-b733ebaa1ccc608f662359519c4712cf384b1360.zip
FreeBSD-src-b733ebaa1ccc608f662359519c4712cf384b1360.tar.gz
Rework how drm maps are handled.
* On 32 bit platforms we steal the upper 4 bits of the map handle to store a unique map id. * On 64 bit platforms we steal the upper 24 bits. Resolves issues where the offsets that are handed to mmap may overlap the VRAM on some cards. Tested on: radeon, intel, mga, and via. This will break nouveau. I will spin new patches shortly.
Diffstat (limited to 'sys/dev/drm/drm_sysctl.c')
-rw-r--r--sys/dev/drm/drm_sysctl.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/dev/drm/drm_sysctl.c b/sys/dev/drm/drm_sysctl.c
index cc33283..4d9b0e8 100644
--- a/sys/dev/drm/drm_sysctl.c
+++ b/sys/dev/drm/drm_sysctl.c
@@ -188,7 +188,7 @@ static int drm_vm_info DRM_SYSCTL_HANDLER_ARGS
DRM_UNLOCK();
DRM_SYSCTL_PRINT("\nslot offset size "
- "type flags address mtrr\n");
+ "type flags address handle mtrr\n");
for (i = 0; i < mapcount; i++) {
map = &tempmaps[i];
@@ -204,9 +204,11 @@ static int drm_vm_info DRM_SYSCTL_HANDLER_ARGS
yesno = "yes";
DRM_SYSCTL_PRINT(
- "%4d 0x%016lx 0x%08lx %4.4s 0x%02x 0x%016lx %s\n", i,
- map->offset, map->size, type, map->flags,
- (unsigned long)map->handle, yesno);
+ "%4d 0x%016lx 0x%08lx %4.4s 0x%02x 0x%016lx %6d %s\n",
+ i, map->offset, map->size, type, map->flags,
+ (unsigned long)map->virtual,
+ (unsigned int)((unsigned long)map->handle >>
+ DRM_MAP_HANDLE_SHIFT), yesno);
}
SYSCTL_OUT(req, "", 1);
OpenPOWER on IntegriCloud