diff mbox

[REBASED,2/2] Do not register interface if Apple GMUX detected

Message ID 20161113195707.4113-2-dev@pmoreau.org (mailing list archive)
State New, archived
Headers show

Commit Message

Pierre Moreau Nov. 13, 2016, 7:57 p.m. UTC
From: Pierre Moreau <pierre.morrow@free.fr>

The Apple GMUX is the one managing the backlight, so there is no need for
Nouveau to register its own backlight interface.

v2: Do not split information message on two lines as it prevents from grepping
    it, as pointed out by Lukas Wunner

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

Comments

Lukas Wunner Nov. 14, 2016, 10:19 a.m. UTC | #1
On Sun, Nov 13, 2016 at 08:57:07PM +0100, Pierre Moreau wrote:
> From: Pierre Moreau <pierre.morrow@free.fr>
> 
> The Apple GMUX is the one managing the backlight, so there is no need for
> Nouveau to register its own backlight interface.
> 
> v2: Do not split information message on two lines as it prevents from grepping
>     it, as pointed out by Lukas Wunner
> 
> Signed-off-by: Pierre Moreau <pierre.morrow@free.fr>

Reviewed-by: Lukas Wunner <lukas@wunner.de>

Thanks,

Lukas

> ---
>  drivers/gpu/drm/nouveau/nouveau_backlight.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/gpu/drm/nouveau/nouveau_backlight.c b/drivers/gpu/drm/nouveau/nouveau_backlight.c
> index 0e69612..3c91c24 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_backlight.c
> +++ b/drivers/gpu/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 <linux/idr.h>
>  
> @@ -258,6 +259,11 @@ 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;
> +	}
> +
>  	INIT_LIST_HEAD(&drm->bl_connectors);
>  
>  	list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
> -- 
> 2.10.2
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox

Patch

diff --git a/drivers/gpu/drm/nouveau/nouveau_backlight.c b/drivers/gpu/drm/nouveau/nouveau_backlight.c
index 0e69612..3c91c24 100644
--- a/drivers/gpu/drm/nouveau/nouveau_backlight.c
+++ b/drivers/gpu/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 <linux/idr.h>
 
@@ -258,6 +259,11 @@  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;
+	}
+
 	INIT_LIST_HEAD(&drm->bl_connectors);
 
 	list_for_each_entry(connector, &dev->mode_config.connector_list, head) {