diff mbox

[2/2] nouveau/bl: Do not register interface if Apple GMUX detected

Message ID 1460732242-4161-2-git-send-email-pierre.morrow@free.fr (mailing list archive)
State New, archived
Headers show

Commit Message

Pierre Moreau April 15, 2016, 2:57 p.m. UTC
The Apple GMUX is the one managing the backlight, so there is no need for
Nouveau to register its own backlight interface.

Signed-off-by: Pierre Moreau <pierre.morrow@free.fr>
---
 drm/nouveau/nouveau_backlight.c | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox

Patch

diff --git a/drm/nouveau/nouveau_backlight.c b/drm/nouveau/nouveau_backlight.c
index 914e2cb..37a1577 100644
--- a/drm/nouveau/nouveau_backlight.c
+++ b/drm/nouveau/nouveau_backlight.c
@@ -30,6 +30,7 @@ 
  * Register locations derived from NVClock by Roderick Colenbrander
  */
 
+#include <linux/apple-gmux.h>
 #include <linux/backlight.h>
 
 #include "nouveau_drm.h"
@@ -239,6 +240,12 @@  nouveau_backlight_init(struct drm_device *dev)
 	struct nvif_device *device = &drm->device;
 	struct drm_connector *connector;
 
+	if (apple_gmux_present()) {
+		NV_INFO(drm, "Apple GMUX detected: not registering Nouveau"
+		    " backlight interface");
+		return 0;
+	}
+
 	list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
 		if (connector->connector_type != DRM_MODE_CONNECTOR_LVDS &&
 		    connector->connector_type != DRM_MODE_CONNECTOR_eDP)