Received: by 2002:ab2:715a:0:b0:1fd:c064:50c with SMTP id l26csp54108lqm; Mon, 10 Jun 2024 12:26:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWgVE0+Bdi1nEp+tIiAulHONngviOWkIl+tNbppa3f2PACpbrec/3WoM5g8/7YSUY5PstCStmuNA/dzZ4YJ8WbnCuYMIcPHU3SiEb6IeA== X-Google-Smtp-Source: AGHT+IHPYdwLGfydPNB5mpvEo41NYrNiv2ilmDhuccSWdlT1GhcrtE7/51EuAi1nSfOJdF6tbvHC X-Received: by 2002:a17:906:2f92:b0:a6e:7e1f:2eae with SMTP id a640c23a62f3a-a6e7e1f2f31mr601395066b.74.1718047587247; Mon, 10 Jun 2024 12:26:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718047587; cv=pass; d=google.com; s=arc-20160816; b=bp3WqzQwJbS/toV4ppS6DL7tiEB+3tZ2ZEaee5xaoyhA0G5FqDzXeIIi4VfT5X6R6h l5j0F66wSYEA1CnO/aUlHhdmSahqqR7w592HgxZpEWmvA3xs177EG/+VEAUj5mNZ1U2i Ob1T8nQ5o8piy38lO2EmzmEoj9LPAOByG/xKSaeiyyOQv/aWqt4St0jNmbcHJOKXMm9Z 0w6Cy9ff3+E48+Xww0Yg6WFxQajNEvwMaA6NBTvMExqFo+xy5QNWRGjZyvyOs+km/Mwa NJcdiOCX22IqgyEDV9rDE4J2aFAIySdU5l8CYmim5UljNy0zhrMGqzdWjup2fCy6TZ3C k6dg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:message-id:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:subject:date :from:dkim-signature; bh=nBMiI2EXlxp7lygc6gLNoJiJfhxjsq3/2C+aReJxmW8=; fh=eYtxlZuGLjOFQ2JmEU7cJBicrOVxx3XuOn/hl/Yl9a0=; b=Jeot9zsEht0K76luGKmPugQmpOfHVAVLcRSXEWrMgoq2QnfUACq0vMKK37pRVrGPlb sIJfvVJQ4VwRlJL11CjaeDT5PhuiZ1fc2BT48OGysg2578ca91J3n4dow1JM6jon+e5z Apmj405kMV1w01MT74yuwoI63sTU2b8GkTP3Dl/ntR3A9TYiL72xs4ISoVLHC3wcIpw5 WCu8Cgh64KGQETktol6mqlRluuc7BuqQiO+NiP0alHByNeU8suNt5yNQqmRpCJVHqiWx RUUV/QZntxHwMbBcb3q3lN9PwzB+mH68VOnYDWgr3nJl6MkjYsdY3MugpMPrWieji+aC 9lKQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=a7F0WWpI; arc=pass (i=1 spf=pass spfdomain=weissschuh.net dkim=pass dkdomain=weissschuh.net dmarc=pass fromdomain=weissschuh.net); spf=pass (google.com: domain of linux-kernel+bounces-208794-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208794-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=weissschuh.net Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6f229c4d09si98939866b.528.2024.06.10.12.26.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 12:26:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-208794-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=a7F0WWpI; arc=pass (i=1 spf=pass spfdomain=weissschuh.net dkim=pass dkdomain=weissschuh.net dmarc=pass fromdomain=weissschuh.net); spf=pass (google.com: domain of linux-kernel+bounces-208794-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208794-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=weissschuh.net Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id D34B01F2210F for ; Mon, 10 Jun 2024 19:26:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5854C14D2A4; Mon, 10 Jun 2024 19:26:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="a7F0WWpI" Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8E73F14A85 for ; Mon, 10 Jun 2024 19:26:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718047578; cv=none; b=I9LioxneXAHPEL5tls9IjF/FebQsOcnUvx2hZrtqDWZhlaXvs/s5stXrrCNROZmJbcKo1UPwhYmvsn2NpN5b4dG0aCPHZMybHHfEmHTNI25YcuAcqMh4sW8RjzTvpw4ELeL5xM1JVcG9ByL9CtHcuJMylZ9sx5+IkAVIsqTdrcM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718047578; c=relaxed/simple; bh=KGqwvxPvj4Ln5e71vhrELndG938ZlgrVOL2zaKHDysg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=u9k7M8g48eGRdlNM/zp2w5NQM90TgvqD+CbsXVs+Mw1O14HDKajxfOoC3zEAoYzb0ZjD/PYSUJByeLGEeznXMhLdMJOXIn3gZkMojTGu1imJm2L2Ton4Nk7QTRhRObyfXmproqcBzOCl/XzcA8SKPaHALYf8CqsewG/TI5Gbqyk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=a7F0WWpI; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1718047572; bh=KGqwvxPvj4Ln5e71vhrELndG938ZlgrVOL2zaKHDysg=; h=From:Date:Subject:To:Cc:From; b=a7F0WWpIlIaEF6JyG9PmhiMPtgr6m6Y0G+KaihSOcE6+BI02rBH98WPEPl/2l4xtu cn7Ry8pSna7maKwxniPX0GKQVrTWWvheDbR4+WFR6CCrKK/GfJXngF7SfgkrT07cgB cfggcKC3BdXCRNPh/Kbu/N0+R8R39rftxlIv3upU= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Mon, 10 Jun 2024 21:26:05 +0200 Subject: [PATCH] drm/amd: force min_input_signal to 0 on Framework AMD 13/16 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20240610-amdgpu-min-backlight-quirk-v1-1-8459895a5b2a@weissschuh.net> X-B4-Tracking: v=1; b=H4sIAExTZ2YC/x3MQQ5AMBAAwK/Inm1SJYiviEPpqg2KVkUi/q5xn Ms84MkxeWiSBxxd7HmzEVmawDApawhZR4MUshBlJlCt2uwBV7bYq2Fe2EwnHoHdjHUh5KhrqvJ SQQx2RyPff9527/sBX6wgCWwAAAA= To: Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= , David Airlie , Daniel Vetter Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Mario Limonciello , Dustin Howett , Matt Hartley , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1718047572; l=2819; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=KGqwvxPvj4Ln5e71vhrELndG938ZlgrVOL2zaKHDysg=; b=e62/svmTkpaY4tCy8VOBGB8kgLMr+GHdEXl9B/PEWz4pFnp+efPRzJ/FWEP1pFikUMicWtLbn u5O+aUJQF5cAJ+29mD8/WwhFiDEJf1U7f7l8zEfBztWhbS9zTsQIeyZ X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= The value of "min_input_signal" returned from ATIF on a Framework AMD 13 is "12". This leads to a fairly bright minimum display backlight. Introduce a quirk to override "min_input_signal" to "0" which leads to a much lower minimum brightness, which is still readable even in daylight. Tested on a Framework AMD 13 BIOS 3.05 and Framework AMD 16. Link: https://community.frame.work/t/25711/9 Link: https://community.frame.work/t/47036 Signed-off-by: Thomas Weißschuh --- drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 35 ++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c index 7099ff9cf8c5..b481889f7491 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -130,6 +131,35 @@ static struct amdgpu_acpi_priv { struct amdgpu_atcs atcs; } amdgpu_acpi_priv; +struct amdgpu_acpi_quirks { + bool ignore_min_input_signal; +}; + +static const struct dmi_system_id amdgpu_acpi_quirk_table[] = { + { + /* the Framework Laptop 13 (AMD Ryzen) and 16 (AMD Ryzen) */ + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Framework"), + DMI_MATCH(DMI_PRODUCT_NAME, "AMD Ryzen"), + DMI_MATCH(DMI_PRODUCT_FAMILY, "Laptop"), + }, + .driver_data = &(struct amdgpu_acpi_quirks) { + .ignore_min_input_signal = true, + }, + }, + {} +}; + +static const struct amdgpu_acpi_quirks *amdgpu_acpi_get_quirks(void) +{ + const struct dmi_system_id *dmi_id; + + dmi_id = dmi_first_match(amdgpu_acpi_quirk_table); + if (!dmi_id) + return NULL; + return dmi_id->driver_data; +} + /* Call the ATIF method */ /** @@ -1388,6 +1418,7 @@ bool amdgpu_acpi_should_gpu_reset(struct amdgpu_device *adev) */ void amdgpu_acpi_detect(void) { + const struct amdgpu_acpi_quirks *quirks = amdgpu_acpi_get_quirks(); struct amdgpu_atif *atif = &amdgpu_acpi_priv.atif; struct amdgpu_atcs *atcs = &amdgpu_acpi_priv.atcs; struct pci_dev *pdev = NULL; @@ -1429,6 +1460,10 @@ void amdgpu_acpi_detect(void) ret); atif->backlight_caps.caps_valid = false; } + if (quirks && quirks->ignore_min_input_signal) { + DRM_INFO("amdgpu_acpi quirk: min_input_signal=0\n"); + atif->backlight_caps.min_input_signal = 0; + } } else { atif->backlight_caps.caps_valid = false; } --- base-commit: 83a7eefedc9b56fe7bfeff13b6c7356688ffa670 change-id: 20240610-amdgpu-min-backlight-quirk-8402fd8e736a Best regards, -- Thomas Weißschuh