NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/56812: DRM upgrade from last december causes Xorg startup failure



>Number:         56812
>Category:       kern
>Synopsis:       DRM upgrade from last december causes Xorg startup failure
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue May 03 15:35:00 +0000 2022
>Originator:     Onno van der Linden
>Release:        NetBSD 9.99.96
>Organization:
>Environment:
System: NetBSD sheep 9.99.96 NetBSD 9.99.96 (SHEEPDRM) #10: Tue May 3 16:42:02 CEST 2022 onno@sheep:/usr/obj/sys/arch/i386/compile/SHEEPDRM i386
Architecture: i386
Machine: i386
>Description:
Ever since the upgrade to linux-drm-v5-6-rc3 around 2021-12-19
trying to run X on this machine with a radeon HD5450 video card
fails for the modesetting driver with "failed to create screen resources"
and returns to shell from which startx was run.
Running X with the radeon driver makes the console inaccessible and
shows 'Failed to map cursor buffer memory' in the Xorg log.
>How-To-Repeat:
Try to run X on this machine with the DRM linx-drm-v5-6-rc3 sources
>Fix:
Traced the mmap failure back to an offset sanity check in 
radeon_mmap_object. With the diff below everything seems to run fine.
No idea if this fix is correct. nouveau/nouveau_ttm.c has the same
check but instead of an EINVAL return it calls drm_legacy_mmap_object().

--- /usr/src/sys/external/bsd/drm2/dist/drm/radeon/radeon_ttm.c.orig	2022-05-03 16:33:56.871235729 +0200
+++ /usr/src/sys/external/bsd/drm2/dist/drm/radeon/radeon_ttm.c	2022-05-03 16:44:59.380652149 +0200
@@ -65,12 +65,6 @@
 #include <drm/bus_dma_hacks.h>
 #endif
 
-#ifdef _LP64
-#define DRM_FILE_PAGE_OFFSET (0x100000000ULL >> PAGE_SHIFT)
-#else
-#define DRM_FILE_PAGE_OFFSET (0xa0000000UL >> PAGE_SHIFT)
-#endif
-
 static int radeon_ttm_debugfs_init(struct radeon_device *rdev);
 static void radeon_ttm_debugfs_fini(struct radeon_device *rdev);
 
@@ -1108,7 +1102,7 @@
 	if (__predict_false(rdev == NULL))	/* XXX How?? */
 		return -EINVAL;
 
-	if (__predict_false((offset >> PAGE_SHIFT) < DRM_FILE_PAGE_OFFSET))
+	if (__predict_false((offset >> PAGE_SHIFT) < DRM_FILE_PAGE_OFFSET_START))
 		return -EINVAL;
 
 	return ttm_bo_mmap_object(&rdev->mman.bdev, offset, size, prot,



Home | Main Index | Thread Index | Old Index