[PATCH 1/3] drm/i915/backlight: Honor panel backlight quirk for minimum brightness

From: Paul Menzel

Date: Fri Nov 27 2026 - 11:39:48 EST


The DRM panel backlight quirk table (drm_panel_backlight_quirks.c)
overrides the minimum PWM brightness per system and panel, but only
amdgpu consults it. i915 always takes the minimum from the VBT, so a
firmware minimum that is too high cannot be corrected without patching
the driver.

Look up the quirk with the panel’s EDID in get_backlight_min_vbt(), and
if it sets min_brightness, use it instead of the VBT value. Like the
VBT field, the quirk value is on the [0..255] scale, stored plus one so
that 0 means unset; amdgpu reads it the same way. The lookup covers all
PWM backends, as they all get their minimum from get_backlight_min_vbt().

Select DRM_PANEL_BACKLIGHT_QUIRKS for i915 and xe, which builds the
i915 display code as well.

Tested on hardware with GNOME 51 at its lowest brightness
(sysfs 960/96000):

- Dell XPS 13 9310, BIOS 3.17.0 (Sharp LQ134N1, SHP 0x14f9): v7.4-rc1 and
v7.4-rc4 based kernels; PWM duty 6551 -> 960 (6.8 % -> 1 %).
- Dell XPS 9315, BIOS 1.26.0 (Sharp LQ134N1, SHP 0x1548): v7.4-rc4 + this
series, Debian 7.3.5 config; duty 6551 -> 960.

[CONNECTOR:676:eDP-1] Applying panel backlight quirk, min brightness 0/255 (VBT 15/255)".

Signed-off-by: Paul Menzel <pmenzel@xxxxxxxxxxxxx>
---

Notes:

Prepared with Claude Code (claude-opus-5-5).

drivers/gpu/drm/i915/Kconfig | 1 +
drivers/gpu/drm/i915/display/intel_backlight.c | 15 +++++++++++++++
drivers/gpu/drm/xe/Kconfig | 1 +
3 files changed, 17 insertions(+)

diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
index 71426b9c91f00..c2075a4a48b8b 100644
--- a/drivers/gpu/drm/i915/Kconfig
+++ b/drivers/gpu/drm/i915/Kconfig
@@ -18,6 +18,7 @@ config DRM_I915
select DRM_DISPLAY_HELPER
select DRM_KMS_HELPER
select DRM_PANEL
+ select DRM_PANEL_BACKLIGHT_QUIRKS
select DRM_MIPI_DSI
select FB_IOMEM_HELPERS if DRM_FBDEV_EMULATION
select RELAY
diff --git a/drivers/gpu/drm/i915/display/intel_backlight.c b/drivers/gpu/drm/i915/display/intel_backlight.c
index b128896cb1c2d..b0c0e7f3d6e24 100644
--- a/drivers/gpu/drm/i915/display/intel_backlight.c
+++ b/drivers/gpu/drm/i915/display/intel_backlight.c
@@ -10,6 +10,7 @@
#include <acpi/video.h>

#include <drm/drm_file.h>
+#include <drm/drm_panel_quirks.h>
#include <drm/drm_print.h>
#include <drm/intel/pci_config.h>

@@ -1207,10 +1208,24 @@ static u32 get_backlight_min_vbt(struct intel_connector *connector)
{
struct intel_display *display = to_intel_display(connector);
struct intel_panel *panel = &connector->panel;
+ const struct drm_panel_backlight_quirk *quirk;
int min;

drm_WARN_ON(display->drm, panel->backlight.pwm_level_max == 0);

+ /* Quirk min_brightness is the minimum in [0..255] plus one, 0 = unset. */
+ quirk = drm_get_panel_backlight_quirk(IS_ERR(panel->fixed_edid) ?
+ NULL : panel->fixed_edid);
+ if (!IS_ERR_OR_NULL(quirk) && quirk->min_brightness) {
+ min = quirk->min_brightness - 1;
+ drm_info(display->drm,
+ "[CONNECTOR:%d:%s] Applying panel backlight quirk, min brightness %d/255 (VBT %d/255)\n",
+ connector->base.base.id, connector->base.name,
+ min, connector->panel.vbt.backlight.min_brightness);
+
+ return scale(min, 0, 255, 0, panel->backlight.pwm_level_max);
+ }
+
/*
* XXX: If the vbt value is 255, it makes min equal to max, which leads
* to problems. There are such machines out there. Either our
diff --git a/drivers/gpu/drm/xe/Kconfig b/drivers/gpu/drm/xe/Kconfig
index 049d2f25d0e60..dab996c7d205d 100644
--- a/drivers/gpu/drm/xe/Kconfig
+++ b/drivers/gpu/drm/xe/Kconfig
@@ -16,6 +16,7 @@ config DRM_XE
select DRM_KMS_HELPER
select DRM_KUNIT_TEST_HELPERS if DRM_XE_KUNIT_TEST != n
select DRM_PANEL
+ select DRM_PANEL_BACKLIGHT_QUIRKS
select DRM_SUBALLOC_HELPER
select DRM_DISPLAY_DP_HELPER
select DRM_DISPLAY_DSC_HELPER
--
2.54.0