From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 90086C433EF for ; Wed, 18 May 2022 17:05:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240706AbiERRF1 (ORCPT ); Wed, 18 May 2022 13:05:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240721AbiERRF0 (ORCPT ); Wed, 18 May 2022 13:05:26 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 95A6720CA7A for ; Wed, 18 May 2022 10:05:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652893524; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TRLEjcaMw89+h7bBWjlXiLnoDwDJpSdbFcWF9EAQdJc=; b=iNUmQIkRmsm1KR7VvjIoVxRedimexCmgzVhIvdB8YUrO6He+03T484L+OmP74ihaFE/sW0 MHBEWW8vjSK1Hz8wsbgqNgQFelOc0WYx/zpAhXciCmNtLdzqKB/PiIlXo7Ihl7bggipQvE n3rk2cNSqerD3uZOEdJ6+IloPyLwGfg= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-351-LFd56iDVPm-eB6XX8-ZyDw-1; Wed, 18 May 2022 13:05:22 -0400 X-MC-Unique: LFd56iDVPm-eB6XX8-ZyDw-1 Received: by mail-qk1-f198.google.com with SMTP id t13-20020a05620a034d00b006a325669708so960436qkm.19 for ; Wed, 18 May 2022 10:05:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:organization:user-agent:mime-version :content-transfer-encoding; bh=TRLEjcaMw89+h7bBWjlXiLnoDwDJpSdbFcWF9EAQdJc=; b=wfZIujsKwGVECNb3J6S6KOJzwRHa9Z/wSc0T6lJB1kW32W4a1X2XS4PtsTGawSddvZ WZygE+Ba9EyMz4kWnSMTtBRhw+hOzD9pf1Lj0QsGRhlXppmZIGCScLwmmcOg4Zt/IfmN PE1/uzpUAcsl6BWrjMwoJhsmSqbzjWS55fgbrqh+ytkRuveT4OHVsc/ZQOt/uD31Xb3K dwEQ43nitjpl0uJGzbZBDo+GyA8Bu24qckJWO/cMjft6AALIbSijof7BetLx+A4wdrne LVDqAUft/ih56J4KFLY0XtXtM/8lE6HweyEyu41dYhp6UsYo6aIewMqXjMdsUtHmp59Q +D+Q== X-Gm-Message-State: AOAM530LpM0WvLFQ/HLAvEBrKkrPQfLzDrFZJr39AGauFFh5p1Uohzo1 hM/wa8GLiLDnlHWYfk17/hLAeBos5qy1+KUhV1L7Nhmbs58rVKQ5LFloze3fNZ6r+Su0GQ6Bggb ccFVuHstes5NoaupE9rK3rg== X-Received: by 2002:a05:622a:13d2:b0:2f3:d2aa:7c5a with SMTP id p18-20020a05622a13d200b002f3d2aa7c5amr688784qtk.155.1652893521988; Wed, 18 May 2022 10:05:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWXT+ucokDAqDDNsvHx45rk/kOMhw7MyDKCGHWLD4jc69TnlXtDtdyumDrgdXUe4O3YCGvOQ== X-Received: by 2002:a05:622a:13d2:b0:2f3:d2aa:7c5a with SMTP id p18-20020a05622a13d200b002f3d2aa7c5amr688757qtk.155.1652893521745; Wed, 18 May 2022 10:05:21 -0700 (PDT) Received: from [192.168.8.138] (static-71-184-137-158.bstnma.ftas.verizon.net. [71.184.137.158]) by smtp.gmail.com with ESMTPSA id u24-20020a05622a199800b002f3ce9c0601sm1719763qtc.3.2022.05.18.10.05.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 10:05:21 -0700 (PDT) Message-ID: Subject: Re: [PATCH 05/14] drm/nouveau: Don't register backlight when another backlight should be used From: Lyude Paul To: Hans de Goede , Ben Skeggs , Karol Herbst , Daniel Dadap , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , Alex Deucher , Christian =?ISO-8859-1?Q?K=F6nig?= , "Pan, Xinhui" , Xinhui , "Rafael J . Wysocki" , Mika Westerberg , Mark Gross , Andy Shevchenko Cc: nouveau@lists.freedesktop.org, Daniel Vetter , David Airlie , intel-gfx , dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, Len Brown , linux-acpi@vger.kernel.org, platform-driver-x86@vger.kernel.org Date: Wed, 18 May 2022 13:05:19 -0400 In-Reply-To: <20220517152331.16217-6-hdegoede@redhat.com> References: <20220517152331.16217-1-hdegoede@redhat.com> <20220517152331.16217-6-hdegoede@redhat.com> Organization: Red Hat Inc. Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 (3.42.4-2.fc35) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Reviewed-by: Lyude Paul Also, ack on this being pushed to drm-misc, along with any other patches I r-b On Tue, 2022-05-17 at 17:23 +0200, Hans de Goede wrote: > Before this commit when we want userspace to use the acpi_video backlight > device we register both the GPU's native backlight device and acpi_video's > firmware acpi_video# backlight device. This relies on userspace preferring > firmware type backlight devices over native ones. > > Registering 2 backlight devices for a single display really is > undesirable, don't register the GPU's native backlight device when > another backlight device should be used. > > Signed-off-by: Hans de Goede > --- >  drivers/gpu/drm/nouveau/nouveau_backlight.c | 7 +++++++ >  1 file changed, 7 insertions(+) > > diff --git a/drivers/gpu/drm/nouveau/nouveau_backlight.c > b/drivers/gpu/drm/nouveau/nouveau_backlight.c > index daf9f87477ba..f56ff797c78c 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_backlight.c > +++ b/drivers/gpu/drm/nouveau/nouveau_backlight.c > @@ -34,6 +34,8 @@ >  #include >  #include >   > +#include > + >  #include "nouveau_drv.h" >  #include "nouveau_reg.h" >  #include "nouveau_encoder.h" > @@ -404,6 +406,11 @@ nouveau_backlight_init(struct drm_connector *connector) >                 goto fail_alloc; >         } >   > +       if (acpi_video_get_backlight_type(true) != acpi_backlight_native) { > +               NV_INFO(drm, "Skipping nv_backlight registration\n"); > +               goto fail_alloc; > +       } > + >         if (!nouveau_get_backlight_name(backlight_name, bl)) { >                 NV_ERROR(drm, "Failed to retrieve a unique name for the > backlight interface\n"); >                 goto fail_alloc; -- Cheers, Lyude Paul (she/her) Software Engineer at Red Hat From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0D765C433F5 for ; Wed, 18 May 2022 17:05:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7380D10E345; Wed, 18 May 2022 17:05:25 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id A7F2910E559 for ; Wed, 18 May 2022 17:05:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652893523; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TRLEjcaMw89+h7bBWjlXiLnoDwDJpSdbFcWF9EAQdJc=; b=K4CzPFBU+qjvMi7rHyuxfm34Xn1Z6ewryW8IB7qyZAG+dL2OfrRmWNno/fRXDVCeRFeSxR z3lX+tTtGNYNMzel5/zdb9EMCkeTTGAn+Gls43dMWMXsuVVriW4k+lsdhB6sDntSaN3Opy K6WtEaDvcsYGYVbfiy8a9HidaFL2bzs= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-340-wudKpBgsOHiVCDhmG6yIQw-1; Wed, 18 May 2022 13:05:22 -0400 X-MC-Unique: wudKpBgsOHiVCDhmG6yIQw-1 Received: by mail-qt1-f197.google.com with SMTP id a28-20020ac8435c000000b002f3bc1cbd08so2096493qtn.18 for ; Wed, 18 May 2022 10:05:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:organization:user-agent:mime-version :content-transfer-encoding; bh=TRLEjcaMw89+h7bBWjlXiLnoDwDJpSdbFcWF9EAQdJc=; b=IggWC8I+7BuV81pfiVryByEplA+q1K/RgwB/zavgwZxS7+KTbF1gz+rM59ngHHAGly KnIHGfhXU2W6JgRem8gmFphrYOBVRDxndzEc3dKf2jGyAZOdKVNCHWrRLTCW4in+WHqs vH4VQ+f/XG61L1Ds8P6Am6/oq9uXUxuJYgZEfRTm6xbGdyOFDUIgvYk2mgaLu34C52L0 Rqm60Bs+/h4vIxox9u8NZJO0XM2b9fcaAd9q9ku5TPVZt15cijHTKUpBkMxh6PHawDWp rqGMDUKI5DnbiGq4/kaSrzxBdlbL2i2ntDsTvnC2US8bf7Hs5VWqrjXwwqB9fiN9OgZX QDDQ== X-Gm-Message-State: AOAM531o2El+KNjKTZUY1a05umnOQRETscc43HJLFnSS7gU/mDgn6RLl FXbo3c24DdXlxoHGOBHRRo1/B0j2j3wcqsylFbakUamjvjb+jd1tWuZ3eE2n54x/O17iLCjhSSF ty71qxrGMKaMBFZD4gRn4DaJiBg== X-Received: by 2002:a05:622a:13d2:b0:2f3:d2aa:7c5a with SMTP id p18-20020a05622a13d200b002f3d2aa7c5amr688793qtk.155.1652893521993; Wed, 18 May 2022 10:05:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWXT+ucokDAqDDNsvHx45rk/kOMhw7MyDKCGHWLD4jc69TnlXtDtdyumDrgdXUe4O3YCGvOQ== X-Received: by 2002:a05:622a:13d2:b0:2f3:d2aa:7c5a with SMTP id p18-20020a05622a13d200b002f3d2aa7c5amr688757qtk.155.1652893521745; Wed, 18 May 2022 10:05:21 -0700 (PDT) Received: from [192.168.8.138] (static-71-184-137-158.bstnma.ftas.verizon.net. [71.184.137.158]) by smtp.gmail.com with ESMTPSA id u24-20020a05622a199800b002f3ce9c0601sm1719763qtc.3.2022.05.18.10.05.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 10:05:21 -0700 (PDT) Message-ID: From: Lyude Paul To: Hans de Goede , Ben Skeggs , Karol Herbst , Daniel Dadap , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , Alex Deucher , Christian =?ISO-8859-1?Q?K=F6nig?= , "Pan, Xinhui" , Xinhui , "Rafael J . Wysocki" , Mika Westerberg , Mark Gross , Andy Shevchenko Date: Wed, 18 May 2022 13:05:19 -0400 In-Reply-To: <20220517152331.16217-6-hdegoede@redhat.com> References: <20220517152331.16217-1-hdegoede@redhat.com> <20220517152331.16217-6-hdegoede@redhat.com> Organization: Red Hat Inc. User-Agent: Evolution 3.42.4 (3.42.4-2.fc35) MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lyude@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Subject: Re: [Nouveau] [PATCH 05/14] drm/nouveau: Don't register backlight when another backlight should be used X-BeenThere: nouveau@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Nouveau development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , nouveau@lists.freedesktop.org, intel-gfx , amd-gfx@lists.freedesktop.org, platform-driver-x86@vger.kernel.org, linux-acpi@vger.kernel.org, dri-devel@lists.freedesktop.org, Daniel Vetter , Len Brown Errors-To: nouveau-bounces@lists.freedesktop.org Sender: "Nouveau" Reviewed-by: Lyude Paul Also, ack on this being pushed to drm-misc, along with any other patches I r-b On Tue, 2022-05-17 at 17:23 +0200, Hans de Goede wrote: > Before this commit when we want userspace to use the acpi_video backlight > device we register both the GPU's native backlight device and acpi_video's > firmware acpi_video# backlight device. This relies on userspace preferring > firmware type backlight devices over native ones. > > Registering 2 backlight devices for a single display really is > undesirable, don't register the GPU's native backlight device when > another backlight device should be used. > > Signed-off-by: Hans de Goede > --- >  drivers/gpu/drm/nouveau/nouveau_backlight.c | 7 +++++++ >  1 file changed, 7 insertions(+) > > diff --git a/drivers/gpu/drm/nouveau/nouveau_backlight.c > b/drivers/gpu/drm/nouveau/nouveau_backlight.c > index daf9f87477ba..f56ff797c78c 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_backlight.c > +++ b/drivers/gpu/drm/nouveau/nouveau_backlight.c > @@ -34,6 +34,8 @@ >  #include >  #include >   > +#include > + >  #include "nouveau_drv.h" >  #include "nouveau_reg.h" >  #include "nouveau_encoder.h" > @@ -404,6 +406,11 @@ nouveau_backlight_init(struct drm_connector *connector) >                 goto fail_alloc; >         } >   > +       if (acpi_video_get_backlight_type(true) != acpi_backlight_native) { > +               NV_INFO(drm, "Skipping nv_backlight registration\n"); > +               goto fail_alloc; > +       } > + >         if (!nouveau_get_backlight_name(backlight_name, bl)) { >                 NV_ERROR(drm, "Failed to retrieve a unique name for the > backlight interface\n"); >                 goto fail_alloc; -- Cheers, Lyude Paul (she/her) Software Engineer at Red Hat From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C501CC4332F for ; Wed, 18 May 2022 17:05:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6435B10E79D; Wed, 18 May 2022 17:05:27 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id B770210E79D for ; Wed, 18 May 2022 17:05:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652893524; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TRLEjcaMw89+h7bBWjlXiLnoDwDJpSdbFcWF9EAQdJc=; b=iNUmQIkRmsm1KR7VvjIoVxRedimexCmgzVhIvdB8YUrO6He+03T484L+OmP74ihaFE/sW0 MHBEWW8vjSK1Hz8wsbgqNgQFelOc0WYx/zpAhXciCmNtLdzqKB/PiIlXo7Ihl7bggipQvE n3rk2cNSqerD3uZOEdJ6+IloPyLwGfg= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-595-C4suQbFCMJGkMb2-6vxzMA-1; Wed, 18 May 2022 13:05:22 -0400 X-MC-Unique: C4suQbFCMJGkMb2-6vxzMA-1 Received: by mail-qt1-f197.google.com with SMTP id d15-20020ac85d8f000000b002f3b3b7e0adso2090797qtx.20 for ; Wed, 18 May 2022 10:05:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:organization:user-agent:mime-version :content-transfer-encoding; bh=TRLEjcaMw89+h7bBWjlXiLnoDwDJpSdbFcWF9EAQdJc=; b=aHui5rOQltO3NidV7TVQNkdgJks2RylYPz3zUJC/FM35TvUNdsuezzCIozbYQ24PgT iFuRX1GdNNa11549Qh/VcivtcJfwPkaubAy4SPjoHDF4XFnbHabdd73NdKQph7w98vLS jsJ9tJi9HpAEV6biXcQP0Q9rixy9c+lsD7eD1w/saSBFWJEc14s16CfoILRlLP1vSYea JM7OpzVU3IxYHpfnNeM2z3I2lipf5OJ6D1wG69MrYgEShLcmpbwoNw4UkO6RvR/QUN6y GFfV2V/apskO2ZfISH1ft7wtsyABJk5/snJ7RrnmsPSzYuCszNxBZ0Svnd4/yO41mLnA yo6A== X-Gm-Message-State: AOAM532yAlrF0KneVIncNHOL9Xzj9RKTSVkFZpGb/AcTdsJg0loG0cQE ycQH/mJo1WxP7HIyThDROaeIvv6rOqYYeL+34ZuT49uxUtWiaLl8sQ0JVs5nx6qgfNPC7upUrHL da1K0VFAqEW7us6gysuFuQkwqp+z9 X-Received: by 2002:a05:622a:13d2:b0:2f3:d2aa:7c5a with SMTP id p18-20020a05622a13d200b002f3d2aa7c5amr688813qtk.155.1652893522074; Wed, 18 May 2022 10:05:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWXT+ucokDAqDDNsvHx45rk/kOMhw7MyDKCGHWLD4jc69TnlXtDtdyumDrgdXUe4O3YCGvOQ== X-Received: by 2002:a05:622a:13d2:b0:2f3:d2aa:7c5a with SMTP id p18-20020a05622a13d200b002f3d2aa7c5amr688757qtk.155.1652893521745; Wed, 18 May 2022 10:05:21 -0700 (PDT) Received: from [192.168.8.138] (static-71-184-137-158.bstnma.ftas.verizon.net. [71.184.137.158]) by smtp.gmail.com with ESMTPSA id u24-20020a05622a199800b002f3ce9c0601sm1719763qtc.3.2022.05.18.10.05.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 10:05:21 -0700 (PDT) Message-ID: Subject: Re: [PATCH 05/14] drm/nouveau: Don't register backlight when another backlight should be used From: Lyude Paul To: Hans de Goede , Ben Skeggs , Karol Herbst , Daniel Dadap , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , Alex Deucher , Christian =?ISO-8859-1?Q?K=F6nig?= , "Pan, Xinhui" , Xinhui , "Rafael J . Wysocki" , Mika Westerberg , Mark Gross , Andy Shevchenko Date: Wed, 18 May 2022 13:05:19 -0400 In-Reply-To: <20220517152331.16217-6-hdegoede@redhat.com> References: <20220517152331.16217-1-hdegoede@redhat.com> <20220517152331.16217-6-hdegoede@redhat.com> Organization: Red Hat Inc. User-Agent: Evolution 3.42.4 (3.42.4-2.fc35) MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lyude@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , nouveau@lists.freedesktop.org, intel-gfx , amd-gfx@lists.freedesktop.org, platform-driver-x86@vger.kernel.org, linux-acpi@vger.kernel.org, dri-devel@lists.freedesktop.org, Len Brown Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Reviewed-by: Lyude Paul Also, ack on this being pushed to drm-misc, along with any other patches I r-b On Tue, 2022-05-17 at 17:23 +0200, Hans de Goede wrote: > Before this commit when we want userspace to use the acpi_video backlight > device we register both the GPU's native backlight device and acpi_video's > firmware acpi_video# backlight device. This relies on userspace preferring > firmware type backlight devices over native ones. > > Registering 2 backlight devices for a single display really is > undesirable, don't register the GPU's native backlight device when > another backlight device should be used. > > Signed-off-by: Hans de Goede > --- >  drivers/gpu/drm/nouveau/nouveau_backlight.c | 7 +++++++ >  1 file changed, 7 insertions(+) > > diff --git a/drivers/gpu/drm/nouveau/nouveau_backlight.c > b/drivers/gpu/drm/nouveau/nouveau_backlight.c > index daf9f87477ba..f56ff797c78c 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_backlight.c > +++ b/drivers/gpu/drm/nouveau/nouveau_backlight.c > @@ -34,6 +34,8 @@ >  #include >  #include >   > +#include > + >  #include "nouveau_drv.h" >  #include "nouveau_reg.h" >  #include "nouveau_encoder.h" > @@ -404,6 +406,11 @@ nouveau_backlight_init(struct drm_connector *connector) >                 goto fail_alloc; >         } >   > +       if (acpi_video_get_backlight_type(true) != acpi_backlight_native) { > +               NV_INFO(drm, "Skipping nv_backlight registration\n"); > +               goto fail_alloc; > +       } > + >         if (!nouveau_get_backlight_name(backlight_name, bl)) { >                 NV_ERROR(drm, "Failed to retrieve a unique name for the > backlight interface\n"); >                 goto fail_alloc; -- Cheers, Lyude Paul (she/her) Software Engineer at Red Hat From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A1BE8C433EF for ; Wed, 18 May 2022 17:05:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 75DED10E559; Wed, 18 May 2022 17:05:25 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id A784310E345 for ; Wed, 18 May 2022 17:05:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652893523; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TRLEjcaMw89+h7bBWjlXiLnoDwDJpSdbFcWF9EAQdJc=; b=K4CzPFBU+qjvMi7rHyuxfm34Xn1Z6ewryW8IB7qyZAG+dL2OfrRmWNno/fRXDVCeRFeSxR z3lX+tTtGNYNMzel5/zdb9EMCkeTTGAn+Gls43dMWMXsuVVriW4k+lsdhB6sDntSaN3Opy K6WtEaDvcsYGYVbfiy8a9HidaFL2bzs= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-398-DYsRDohbPV-XyDhOzgUpTg-1; Wed, 18 May 2022 13:05:22 -0400 X-MC-Unique: DYsRDohbPV-XyDhOzgUpTg-1 Received: by mail-qt1-f200.google.com with SMTP id q13-20020a05622a04cd00b002f3c0e197afso2169762qtx.0 for ; Wed, 18 May 2022 10:05:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:organization:user-agent:mime-version :content-transfer-encoding; bh=TRLEjcaMw89+h7bBWjlXiLnoDwDJpSdbFcWF9EAQdJc=; b=WWxmi0KyUnWc/N/fmqohH9lYGZpPrtEqTxha0ZXu0ifA7lu5JvRwuJMWnQiWq5LRFu Ks2g8WGpdegcnzXBOokh6DHNam6/5fysGPz6dc7yWl/CnPrZ+LWW0UnAe+aGKOurU3Zo +BRNtk2QowVcuWgcjMuu5POj5ECg2vcp8/35opGOD4vzTxcudff/npa6drBpkjfn9iy3 UoogsB4kGpuPZ2DVc6Y/rKJDMZ1IcpCkxuER8DqE34eu47vjrqYm1DrzNi8ikp+L6TrY F1dKW+PpoX9sT5BhFmEr+y3sSC1gGBXgY0K2V4wQE74hmkOjlRW+YMDJ/OE+FXePeILg QuUw== X-Gm-Message-State: AOAM531xjQnfvPf/v6Zs3tcgwLnmBNQU1bL1yUnwZDn1uNOO8Djzfc+N LIh+niAuggw5oUUz5vmx37wTidLhB3lY7/rM+wQDtCbnyjFK2BfzHYh7PL1c7Xgzf+VqEyMoku2 lSeXMnvStLTEVhPV8lSc3c5QiAOsI X-Received: by 2002:a05:622a:13d2:b0:2f3:d2aa:7c5a with SMTP id p18-20020a05622a13d200b002f3d2aa7c5amr688803qtk.155.1652893522018; Wed, 18 May 2022 10:05:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWXT+ucokDAqDDNsvHx45rk/kOMhw7MyDKCGHWLD4jc69TnlXtDtdyumDrgdXUe4O3YCGvOQ== X-Received: by 2002:a05:622a:13d2:b0:2f3:d2aa:7c5a with SMTP id p18-20020a05622a13d200b002f3d2aa7c5amr688757qtk.155.1652893521745; Wed, 18 May 2022 10:05:21 -0700 (PDT) Received: from [192.168.8.138] (static-71-184-137-158.bstnma.ftas.verizon.net. [71.184.137.158]) by smtp.gmail.com with ESMTPSA id u24-20020a05622a199800b002f3ce9c0601sm1719763qtc.3.2022.05.18.10.05.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 10:05:21 -0700 (PDT) Message-ID: From: Lyude Paul To: Hans de Goede , Ben Skeggs , Karol Herbst , Daniel Dadap , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , Alex Deucher , Christian =?ISO-8859-1?Q?K=F6nig?= , "Pan, Xinhui" , Xinhui , "Rafael J . Wysocki" , Mika Westerberg , Mark Gross , Andy Shevchenko Date: Wed, 18 May 2022 13:05:19 -0400 In-Reply-To: <20220517152331.16217-6-hdegoede@redhat.com> References: <20220517152331.16217-1-hdegoede@redhat.com> <20220517152331.16217-6-hdegoede@redhat.com> Organization: Red Hat Inc. User-Agent: Evolution 3.42.4 (3.42.4-2.fc35) MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lyude@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Subject: Re: [Intel-gfx] [PATCH 05/14] drm/nouveau: Don't register backlight when another backlight should be used X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , nouveau@lists.freedesktop.org, intel-gfx , amd-gfx@lists.freedesktop.org, platform-driver-x86@vger.kernel.org, linux-acpi@vger.kernel.org, dri-devel@lists.freedesktop.org, Len Brown Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Reviewed-by: Lyude Paul Also, ack on this being pushed to drm-misc, along with any other patches I r-b On Tue, 2022-05-17 at 17:23 +0200, Hans de Goede wrote: > Before this commit when we want userspace to use the acpi_video backlight > device we register both the GPU's native backlight device and acpi_video's > firmware acpi_video# backlight device. This relies on userspace preferring > firmware type backlight devices over native ones. > > Registering 2 backlight devices for a single display really is > undesirable, don't register the GPU's native backlight device when > another backlight device should be used. > > Signed-off-by: Hans de Goede > --- >  drivers/gpu/drm/nouveau/nouveau_backlight.c | 7 +++++++ >  1 file changed, 7 insertions(+) > > diff --git a/drivers/gpu/drm/nouveau/nouveau_backlight.c > b/drivers/gpu/drm/nouveau/nouveau_backlight.c > index daf9f87477ba..f56ff797c78c 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_backlight.c > +++ b/drivers/gpu/drm/nouveau/nouveau_backlight.c > @@ -34,6 +34,8 @@ >  #include >  #include >   > +#include > + >  #include "nouveau_drv.h" >  #include "nouveau_reg.h" >  #include "nouveau_encoder.h" > @@ -404,6 +406,11 @@ nouveau_backlight_init(struct drm_connector *connector) >                 goto fail_alloc; >         } >   > +       if (acpi_video_get_backlight_type(true) != acpi_backlight_native) { > +               NV_INFO(drm, "Skipping nv_backlight registration\n"); > +               goto fail_alloc; > +       } > + >         if (!nouveau_get_backlight_name(backlight_name, bl)) { >                 NV_ERROR(drm, "Failed to retrieve a unique name for the > backlight interface\n"); >                 goto fail_alloc; -- Cheers, Lyude Paul (she/her) Software Engineer at Red Hat From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A1137C433F5 for ; Wed, 18 May 2022 17:05:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2DEB610E878; Wed, 18 May 2022 17:05:28 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id 76FF810E79D for ; Wed, 18 May 2022 17:05:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652893525; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TRLEjcaMw89+h7bBWjlXiLnoDwDJpSdbFcWF9EAQdJc=; b=NSlUEXmqll1zNGHkpZdxabs3t4gqiGDYCVJPYUdrLh7Z26ajpo1GxUFVtnAXLmnad7rOvA c3Rn+E3sMC5I0k6tK3srKt+zvQRHtLOX12R4gekqu7RJlrXT8D32mav49fE/Rel+1yUYKF qMDfk5bDsd2fKZkycPZZT3iSAYoj8nU= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-370-d8kAY8pfPYGIEXfx6Nra-A-1; Wed, 18 May 2022 13:05:22 -0400 X-MC-Unique: d8kAY8pfPYGIEXfx6Nra-A-1 Received: by mail-qt1-f200.google.com with SMTP id d4-20020a05622a15c400b002f3bd4b80f7so2139216qty.3 for ; Wed, 18 May 2022 10:05:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:organization:user-agent:mime-version :content-transfer-encoding; bh=TRLEjcaMw89+h7bBWjlXiLnoDwDJpSdbFcWF9EAQdJc=; b=BWBeiuQw2ldkWGy0mt40nMEAFjPdOo9paPoFHtxmh4+oifhnwE2WZhVj2iWpaMuwBo isUxHLQMkc8cIIBx8jc4/rt+d7OnErmeyZuCZvam1wnVlS62kbU9PpbUNvsiV8sR6N9p xyQh/5ldGsUboyRVM2UiKuUCzNDpczG8c6SnQZNld5tnWEJjHP8umtii5Sa/jtMgfBaZ rC9N30QVDiH51G9q1Z93t/jH7O2jcKxXx1mLevTTTe/qA5OoWpNuI71xywznOR8yPL/C eK3ruJLo5ssphpGzwnLHPgvTEPMLTB7/1GMHv0GWSN2g+F3oJZ/lkAx/SNjD3F+aFjea 4NPg== X-Gm-Message-State: AOAM533bNhFw2qs3fQpLaqsa7GHWgRXLfNwx82rO+dzrP3QWBn3eHb5A ZN0j8yuWRN90ZLVuQhNBDOS6hC2N2hHTdeGeAnF92rwPjWONICYrfewYzweO94BNAVR26sFSn/5 xCX2Hwz9hsuiFw2OIEeYKjO6KIg== X-Received: by 2002:a05:622a:13d2:b0:2f3:d2aa:7c5a with SMTP id p18-20020a05622a13d200b002f3d2aa7c5amr688815qtk.155.1652893522086; Wed, 18 May 2022 10:05:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWXT+ucokDAqDDNsvHx45rk/kOMhw7MyDKCGHWLD4jc69TnlXtDtdyumDrgdXUe4O3YCGvOQ== X-Received: by 2002:a05:622a:13d2:b0:2f3:d2aa:7c5a with SMTP id p18-20020a05622a13d200b002f3d2aa7c5amr688757qtk.155.1652893521745; Wed, 18 May 2022 10:05:21 -0700 (PDT) Received: from [192.168.8.138] (static-71-184-137-158.bstnma.ftas.verizon.net. [71.184.137.158]) by smtp.gmail.com with ESMTPSA id u24-20020a05622a199800b002f3ce9c0601sm1719763qtc.3.2022.05.18.10.05.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 10:05:21 -0700 (PDT) Message-ID: Subject: Re: [PATCH 05/14] drm/nouveau: Don't register backlight when another backlight should be used From: Lyude Paul To: Hans de Goede , Ben Skeggs , Karol Herbst , Daniel Dadap , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , Alex Deucher , Christian =?ISO-8859-1?Q?K=F6nig?= , "Pan, Xinhui" , Xinhui , "Rafael J . Wysocki" , Mika Westerberg , Mark Gross , Andy Shevchenko Date: Wed, 18 May 2022 13:05:19 -0400 In-Reply-To: <20220517152331.16217-6-hdegoede@redhat.com> References: <20220517152331.16217-1-hdegoede@redhat.com> <20220517152331.16217-6-hdegoede@redhat.com> Organization: Red Hat Inc. User-Agent: Evolution 3.42.4 (3.42.4-2.fc35) MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lyude@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , nouveau@lists.freedesktop.org, intel-gfx , amd-gfx@lists.freedesktop.org, platform-driver-x86@vger.kernel.org, linux-acpi@vger.kernel.org, dri-devel@lists.freedesktop.org, Daniel Vetter , Len Brown Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" Reviewed-by: Lyude Paul Also, ack on this being pushed to drm-misc, along with any other patches I r-b On Tue, 2022-05-17 at 17:23 +0200, Hans de Goede wrote: > Before this commit when we want userspace to use the acpi_video backlight > device we register both the GPU's native backlight device and acpi_video's > firmware acpi_video# backlight device. This relies on userspace preferring > firmware type backlight devices over native ones. > > Registering 2 backlight devices for a single display really is > undesirable, don't register the GPU's native backlight device when > another backlight device should be used. > > Signed-off-by: Hans de Goede > --- >  drivers/gpu/drm/nouveau/nouveau_backlight.c | 7 +++++++ >  1 file changed, 7 insertions(+) > > diff --git a/drivers/gpu/drm/nouveau/nouveau_backlight.c > b/drivers/gpu/drm/nouveau/nouveau_backlight.c > index daf9f87477ba..f56ff797c78c 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_backlight.c > +++ b/drivers/gpu/drm/nouveau/nouveau_backlight.c > @@ -34,6 +34,8 @@ >  #include >  #include >   > +#include > + >  #include "nouveau_drv.h" >  #include "nouveau_reg.h" >  #include "nouveau_encoder.h" > @@ -404,6 +406,11 @@ nouveau_backlight_init(struct drm_connector *connector) >                 goto fail_alloc; >         } >   > +       if (acpi_video_get_backlight_type(true) != acpi_backlight_native) { > +               NV_INFO(drm, "Skipping nv_backlight registration\n"); > +               goto fail_alloc; > +       } > + >         if (!nouveau_get_backlight_name(backlight_name, bl)) { >                 NV_ERROR(drm, "Failed to retrieve a unique name for the > backlight interface\n"); >                 goto fail_alloc; -- Cheers, Lyude Paul (she/her) Software Engineer at Red Hat