From patchwork Sun Jun 23 08:51:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13708532 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 ABAA2C27C4F for ; Sun, 23 Jun 2024 08:51:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 141E610E1C0; Sun, 23 Jun 2024 08:51:36 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=weissschuh.net header.i=@weissschuh.net header.b="EPVuytmQ"; dkim-atps=neutral Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by gabe.freedesktop.org (Postfix) with ESMTPS id B1AB710E1DE; Sun, 23 Jun 2024 08:51:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1719132689; bh=zB2lHe/cxmaq3sEJTX39vzQps5Xljraxg3sewiB+Xv4=; h=From:Subject:Date:To:Cc:From; b=EPVuytmQawb4QbbtMpIwLUtd1BUdP0idrchVzD9gAehNsFqyCWCq8p6jeuAIf5LtI Oszh/kVYFO031J5jQHlU7hRtfepvzrlfcyYKeAjIHSmyH5XmMEaP13KcN6EFyA7g3/ BeKkxckBNBpat78/zwLluNhRRrzCP9bRB2OsX34g= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Subject: [PATCH v2 0/3] drm: backlight quirk infrastructure and lower minimum for Framework AMD 13 Date: Sun, 23 Jun 2024 10:51:26 +0200 Message-Id: <20240623-amdgpu-min-backlight-quirk-v2-0-cecf7f49da9b@weissschuh.net> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAA7id2YC/43NQQ6CMBCF4auQrh3TVkBg5T0MiwIDnSAFO4Aaw t2tnMDl/xbf2wSjJ2RRRJvwuBLT6ELoUyRqa1yHQE1ooaWOZaokmKHppgUGclCZun9QZ2d4LuR 7yGKp2ybD6yU1IgCTx5beB34vQ1viefSf42tVv/UvdlWggp3kWZ6YpNLm9kJi5tou9uxwFuW+7 184PZHbyQAAAA== To: Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= , David Airlie , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Harry Wentland , Leo Li , Rodrigo Siqueira , Mario Limonciello , Matt Hartley , Kieran Levin , Hans de Goede Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Dustin Howett , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1719132688; l=2496; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=zB2lHe/cxmaq3sEJTX39vzQps5Xljraxg3sewiB+Xv4=; b=0x05OrASCwGcIIhqmTXoV+ChUICWHrXM8Z9UIIYNcCruuieBg6vTjCBfs6mo2eNPXUpI5W4k5 Oemc98k/a8gCFqs5lAvZneIj1AHRCPlDTahSWgqSjSbzKCuwz0HJqaY X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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. Add a generic quirk infrastructure for backlight configuration to override the settings provided by the firmware. Also add amdgpu as a user of that infrastructure and a quirk for the Framework 13 matte panel. Most likely this will also work for the glossy panel, but I can't test that. One solution would be a fixed firmware version, but given that the problem exists since the release of the hardware, it has been known for a month that the hardware can go lower and there was no acknowledgment from Framework in any way, I'd like to explore this alternative way forward. Notes: * Should the quirk infrastructure be part of drm_edid.c? * The current allocation of struct drm_edid in amdgpu is bad. But it is done the same way in other parts of amdgpu. I do have patches migrating amdgpu to proper usage of struct drm_edid [0] Mario: I intentionally left out the consideration of the firmware version. The quirk will stay correct even if the firmware starts reporting correct values. If there are strong opinions it would be easy to add, though. Based on amdgpu/drm-next. [0] https://lore.kernel.org/lkml/20240616-amdgpu-edid-bios-v1-1-2874f212b365@weissschuh.net/ --- Changes in v2: - Introduce proper drm backlight quirk infrastructure - Quirk by EDID and DMI instead of only DMI - Limit quirk to only single Framework 13 matte panel - Link to v1: https://lore.kernel.org/r/20240610-amdgpu-min-backlight-quirk-v1-1-8459895a5b2a@weissschuh.net --- Thomas Weißschuh (3): drm: Add panel backlight quirks drm: panel-backlight-quirks: Add Framework 13 matte panel drm/amd/display: Add support backlight quirks Documentation/gpu/drm-kms-helpers.rst | 3 + drivers/gpu/drm/Kconfig | 4 ++ drivers/gpu/drm/Makefile | 1 + drivers/gpu/drm/amd/amdgpu/Kconfig | 1 + drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 28 +++++++++ drivers/gpu/drm/drm_panel_backlight_quirks.c | 76 +++++++++++++++++++++++ include/drm/drm_utils.h | 11 ++++ 7 files changed, 124 insertions(+) --- base-commit: 1ecef5589320fd56af599b624d59c355d162ac7b change-id: 20240610-amdgpu-min-backlight-quirk-8402fd8e736a Best regards,