Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp758975pxb; Tue, 5 Apr 2022 22:04:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJywHmzCROy39F5qQvz+6cUvnsrB+4QlZZ7dEq8t1jzUYjq2kxj/GQw8J/kVNq5AgZYB7TnT X-Received: by 2002:a05:6a00:849:b0:4fb:1112:c19f with SMTP id q9-20020a056a00084900b004fb1112c19fmr6999819pfk.74.1649221471115; Tue, 05 Apr 2022 22:04:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649221471; cv=none; d=google.com; s=arc-20160816; b=wHSxHKh5A7JgzW2MeYq35UMw3ee3KGR+11j5zNS1qsnzGoEV7zIUzYi5pbALayVPzc d+8RrxmY+1vrxLoBgjbIV1rbaosOBFRZLlLBmiMCaT3r3oVJwbD387aAbCqpdGTXnrTV Ih2wQfpj//qsTvCU9cg4TMWlFfZf48Wv/m+04kkLILa6ux+9q9oAz73egYRcAPCJoID+ rSdvB0vCYmVHfkKGy1R2riIBk3/Tv3xmERhoRbmQIGm7R4GrEXyPA0Mx6omX+1tqx7ey 2yKCrW7MFEkQnhyYklpX1gdC6rZmnwMJPNOqDDX3g/MF9p63+kSXSWXN4kIF5r9rxH9A UGEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=mw54xHsZK2cRghfsllljWuwScDh20X9OeX3WKe1xKIk=; b=uK+IFshkVZsP73O8/F08y0O9iic9JdnEJlQPci3CJGk+1gZuIWrUunE/jXULADH9hf I53PsaZUjo3FvE2/YifMI1CmlBx7hsYQ95qDN8WvCMjR+b6qEP3rFT4fHiAyyx9FZTKq a0zAyao7tPlnIPCh/edrvWxqV42WjhM2PURSa+PDneK6EZrlqDbFV796O9KAqBlX5Vgj Gro9jwHx6XkjgKnzbvdP4DCZj74MNYCgLL8eCENmy/pxsqssLFMxnJ3fW8SWGLvF123b bg2xtu/0gYimoLm7ARTU4KpESWAGpmqk4GeczcPX67U531QZ4ElgWEJ4oK7bwXL7psGQ oUFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cbE0lX7c; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id ms1-20020a17090b234100b001ca79f9c8besi3710784pjb.71.2022.04.05.22.04.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 22:04:31 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cbE0lX7c; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2B763170085; Tue, 5 Apr 2022 20:23:21 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236217AbiDEIBl (ORCPT + 99 others); Tue, 5 Apr 2022 04:01:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233204AbiDEHwN (ORCPT ); Tue, 5 Apr 2022 03:52:13 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE0221EACB; Tue, 5 Apr 2022 00:48:39 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 21816616C6; Tue, 5 Apr 2022 07:48:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 30C99C340EE; Tue, 5 Apr 2022 07:48:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649144918; bh=XQzzdibhL0otRHSkdbIMNyKyXU70t8rbk4JAHgEy2QE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cbE0lX7c0P5AOZb8J24GG1bhch7qUNXoI7rYBSt6dT52WJDXOOnF6hOOXP/dYGXHx 5sbFP2cMYkLEjT/iBHjpSDcdLATWfm//p/UBW55J2bny7iYEZfQN4CFF7/yiUW2jAh 1FuemzHjfq/e4ZPv129YSNFWQmMEbAzmzorE3v0s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lyude Paul , Karol Herbst Subject: [PATCH 5.17 0184/1126] drm/nouveau/backlight: Fix LVDS backlight detection on some laptops Date: Tue, 5 Apr 2022 09:15:31 +0200 Message-Id: <20220405070413.006940589@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070407.513532867@linuxfoundation.org> References: <20220405070407.513532867@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lyude Paul commit 6b0076540faffd47f5a899bf12f3528c4f0e726b upstream. It seems that some laptops will report having both an eDP and LVDS connector, even though only the LVDS connector is actually hooked up. This can lead to issues with backlight registration if the eDP connector ends up getting registered before the LVDS connector, as the backlight device will then be registered to the eDP connector instead of the LVDS connector. So, fix this by only registering the backlight on connectors that are reported as being connected. Signed-off-by: Lyude Paul Fixes: 6eca310e8924 ("drm/nouveau/kms/nv50-: Add basic DPCD backlight support for nouveau") Bugzilla: https://gitlab.freedesktop.org/drm/nouveau/-/issues/137 Cc: # v5.15+ Reviewed-by: Karol Herbst Link: https://patchwork.freedesktop.org/patch/msgid/20220204180504.328999-1-lyude@redhat.com Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/nouveau/nouveau_backlight.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/gpu/drm/nouveau/nouveau_backlight.c +++ b/drivers/gpu/drm/nouveau/nouveau_backlight.c @@ -294,7 +294,8 @@ nv50_backlight_init(struct nouveau_backl struct nouveau_drm *drm = nouveau_drm(nv_encoder->base.base.dev); struct nvif_object *device = &drm->client.device.object; - if (!nvif_rd32(device, NV50_PDISP_SOR_PWM_CTL(ffs(nv_encoder->dcb->or) - 1))) + if (!nvif_rd32(device, NV50_PDISP_SOR_PWM_CTL(ffs(nv_encoder->dcb->or) - 1)) || + nv_conn->base.status != connector_status_connected) return -ENODEV; if (nv_conn->type == DCB_CONNECTOR_eDP) {