[kernel] r19506 - in dists/sid/linux/debian: . config/kernelarch-x86 patches patches/debian

Ben Hutchings benh at alioth.debian.org
Sat Nov 17 07:03:40 UTC 2012


Author: benh
Date: Sat Nov 17 07:03:39 2012
New Revision: 19506

Log:
radeon: Re-enable KMS by default on x86; add a load-time check for firmware

KMS is still generally broken on !x86 and particularly PowerPC
(#628972), so I have no idea why it was enabled by default for all
architectures.

The load-time check is a gross hack, but I cannot see any more
reliable solution that doesn't involve major changes to both DRM and
radeon.

Added:
   dists/sid/linux/debian/patches/debian/radeon-no-modeset-without-firmware.patch
Modified:
   dists/sid/linux/debian/changelog
   dists/sid/linux/debian/config/kernelarch-x86/config
   dists/sid/linux/debian/patches/series

Modified: dists/sid/linux/debian/changelog
==============================================================================
--- dists/sid/linux/debian/changelog	Sat Nov 17 05:27:38 2012	(r19505)
+++ dists/sid/linux/debian/changelog	Sat Nov 17 07:03:39 2012	(r19506)
@@ -43,8 +43,9 @@
   * [x86] asus-laptop: Do not call HWRS on init (Closes: #692436)
   * [x86] drm/i915: Only kick out vesafb if we takeover the fbcon with KMS
     (Closes: #686284)
-  * radeon: Disable DRM_RADEON_KMS, as this does not work on most chips
-    without firmware (Closes: #607194)
+  * [!x86] radeon: Disable DRM_RADEON_KMS, as this is still not expected to
+    work
+  * radeon: Disable KMS earlier if firmware is not installed (Closes: #607194)
 
   [ Ian Campbell ]
   * [xen] add support for microcode updating. (Closes: #693053)

Modified: dists/sid/linux/debian/config/kernelarch-x86/config
==============================================================================
--- dists/sid/linux/debian/config/kernelarch-x86/config	Sat Nov 17 05:27:38 2012	(r19505)
+++ dists/sid/linux/debian/config/kernelarch-x86/config	Sat Nov 17 07:03:39 2012	(r19506)
@@ -424,6 +424,11 @@
 CONFIG_DRM_I2C_SIL164=m
 
 ##
+## file: drivers/gpu/drm/radeon/Kconfig
+##
+CONFIG_DRM_RADEON_KMS=y
+
+##
 ## file: drivers/gpu/stub/Kconfig
 ##
 # CONFIG_STUB_POULSBO is not set

Added: dists/sid/linux/debian/patches/debian/radeon-no-modeset-without-firmware.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux/debian/patches/debian/radeon-no-modeset-without-firmware.patch	Sat Nov 17 07:03:39 2012	(r19506)
@@ -0,0 +1,83 @@
+From: Ben Hutchings <ben at decadent.org.uk>
+Subject: radeon: No MODESET without firmware
+Date: Sat, 17 Nov 2012 05:28:53 +0000
+Bug-Debian: http://bugs.debian.org/607194
+Bug-Debian: http://bugs.debian.org/607471
+Bug-Debian: http://bugs.debian.org/610851
+Bug-Debian: http://bugs.debian.org/627497
+Bug-Debian: http://bugs.debian.org/632212
+Bug-Debian: http://bugs.debian.org/637943
+Bug-Debian: http://bugs.debian.org/649448
+
+radeon requires firmware/microcode for the GPU all chips, but for
+newer chips (apparently R600 'Evergreen' onward) it also expects
+firmware for the memory controller and other sub-blocks.
+
+radeon attempts to gracefully fall back and disable some features if
+the firmware is not available, but becomes unstable - the framebuffer
+and/or system memory may be corrupted, or the display may stay black.
+This does not seem to happen if KMS is disabled.
+
+Unfortunately, it is not possible to properly disable KMS once the
+missing firmware is discovered.  Each driver registers with the DRM
+core as having certain capabilities such as DRIVER_MODESET (KMS) and
+the DRM does not allow for individual devices to have different
+capabilities!
+
+Therefore, perform a basic check for the existence of
+/lib/firmware/radeon when the driver is loaded, and disable KMS
+if it is missing.  I apologise for this gross hack, but I cannot
+see any more reliable solution that doesn't involve major changes
+to both DRM and radeon.
+
+---
+--- a/drivers/gpu/drm/radeon/radeon_drv.c
++++ b/drivers/gpu/drm/radeon/radeon_drv.c
+@@ -37,6 +37,8 @@
+ #include "drm_pciids.h"
+ #include <linux/console.h>
+ #include <linux/module.h>
++#include <linux/namei.h>
++#include <linux/path.h>
+ 
+ 
+ /*
+@@ -378,6 +380,24 @@ static struct pci_driver radeon_kms_pci_
+ 	.resume = radeon_pci_resume,
+ };
+ 
++/* Test that /lib/firmware/radeon is a directory (or symlink to a
++ * directory).  We could try to match the udev search path, but let's
++ * assume people take the easy route and install
++ * firmware-linux-nonfree.
++ */
++static bool __init radeon_firmware_installed(void)
++{
++	struct path path;
++
++	if (kern_path("/lib/firmware/radeon", LOOKUP_DIRECTORY | LOOKUP_FOLLOW,
++		      &path) == 0) {
++		path_put(&path);
++		return true;
++	}
++
++	return false;
++}
++
+ static int __init radeon_init(void)
+ {
+ 	driver = &driver_old;
+@@ -402,6 +422,13 @@ static int __init radeon_init(void)
+ 		radeon_modeset = 0;
+ #endif
+ 	}
++	/* We have to commit to KMS before we've seen any devices, so
++	 * make a basic check to reduce the risk of failure later.
++	 */
++	if (radeon_modeset == 1 && !radeon_firmware_installed()) {
++		DRM_INFO("radeon kernel modesetting disabled; it requires firmware-linux-nonfree.\n");
++		radeon_modeset = 0;
++	}
+ 	if (radeon_modeset == 1) {
+ 		DRM_INFO("radeon kernel modesetting enabled.\n");
+ 		driver = &kms_driver;

Modified: dists/sid/linux/debian/patches/series
==============================================================================
--- dists/sid/linux/debian/patches/series	Sat Nov 17 05:27:38 2012	(r19505)
+++ dists/sid/linux/debian/patches/series	Sat Nov 17 07:03:39 2012	(r19506)
@@ -408,3 +408,4 @@
 bugfix/x86/drm-i915-Only-kick-out-vesafb-if-we-takeover-the-fbc.patch
 
 features/all/xen/microcode.patch
+debian/radeon-no-modeset-without-firmware.patch



More information about the Kernel-svn-changes mailing list