On Fri, 2013-08-02 at 14:41 +0200, Michel Dänzer wrote: > On Son, 2013-07-21 at 18:56 +0100, Ben Hutchings wrote: > > > > Michael, what are we supposed to do about radeon? I thought KMS still > > didn't work on PowerMac laptops. > > It does work in principle. The major missing part is suspend/resume, > which would require porting some code from radeonfb. That sounds like 'doesn't work' to me. Also, bug #628972 doesn't involve suspend/resume, though it was reported against 2.6.39 and that bug may have been fixed upstream by 3.4. > > Can we make the default depend on the machine type? > > I guess we could... I'm attaching an attempt to do that. Currently I can't find any bug reports specifically covering this, though. There needs to be a report explaining the problem, and confirmation that the change (enable KMS + apply this patch) works across a range of systems. Ben. -- Ben Hutchings This sentence contradicts itself - no actually it doesn't.
From: Ben Hutchings <ben@decadent.org.uk>
Date: Fri, 02 Aug 2013 15:34:45 +0200
Subject: radeon: Blacklist Apple PowerPC laptops for KMS
Forwarded: not-needed
The radeon X driver now requires KMS, but the DRM driver does
not correctly suspend/resume on Apple PowerPC systems when KMS is
enabled.
We should enable KMS at build time but abort initialisation on Apple
PowerPC laptops (where suspend/resume is likely to be required
functionality) unless the user explicitly sets the modeset parameter.
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -39,6 +39,7 @@
#include <linux/module.h>
#include <linux/namei.h>
#include <linux/path.h>
+#include <linux/of.h>
/*
@@ -428,6 +429,29 @@ static struct pci_driver radeon_kms_pci_
.resume = radeon_pci_resume,
};
+#ifdef CONFIG_DRM_RADEON_KMS
+static bool __init radeon_modeset_blacklisted(void)
+{
+ /* Blacklist Apple PowerPC laptops, as suspend/resume is broken */
+#ifdef CONFIG_PPC
+ struct device_node *dt;
+ const char *model;
+
+ dt = of_find_node_by_name(NULL, "device-tree");
+ model = dt ? of_get_property(dt, "model", NULL) : NULL;
+ if (model &&
+ (strcmp(model, "AAPL,3400/2400") == 0 ||
+ strcmp(model, "AAPL,3500") == 0 ||
+ strncmp(model, "AAPL,PowerBook", 14) == 0 ||
+ strncmp(model, "PowerBook", 9) == 0)) {
+ DRM_ERROR("radeon disabled by default as it cannot support suspend/resume on this system\n");
+ return true;
+ }
+#endif
+ return false;
+}
+#endif
+
static int __init radeon_init(void)
{
driver = &driver_old;
@@ -445,6 +469,10 @@ static int __init radeon_init(void)
/* if enabled by default */
if (radeon_modeset == -1) {
#ifdef CONFIG_DRM_RADEON_KMS
+ if (radeon_modeset_blacklisted()) {
+ DRM_INFO("set module parameter radeon.modeset to choose kernel or user modesetting\n");
+ return -ENODEV;
+ }
DRM_INFO("radeon defaulting to kernel modesetting.\n");
radeon_modeset = 1;
#else
Attachment:
signature.asc
Description: This is a digitally signed message part