* [PATCH 1/3] drm/i915/backlight: Honor panel backlight quirk for minimum brightness
[not found] <20261127163752.54806-1-pmenzel@molgen.mpg.de>
@ 2026-11-27 16:37 ` Paul Menzel
2026-11-27 16:37 ` [PATCH 2/3] drm: panel-backlight-quirks: Add Dell XPS 13 9310 FHD+ panel Paul Menzel
1 sibling, 0 replies; 2+ messages in thread
From: Paul Menzel @ 2026-11-27 16:37 UTC (permalink / raw)
To: Jani Nikula, Rodrigo Vivi, Joonas Lahtinen, Tvrtko Ursulin,
David Airlie, Simona Vetter, Matthew Brost,
Thomas Hellström
Cc: Paul Menzel, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
Antheas Kapenekakis, Thomas Weißschuh, intel-gfx, intel-xe,
dri-devel, linux-kernel
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@molgen.mpg.de>
---
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH 2/3] drm: panel-backlight-quirks: Add Dell XPS 13 9310 FHD+ panel
[not found] <20261127163752.54806-1-pmenzel@molgen.mpg.de>
2026-11-27 16:37 ` [PATCH 1/3] drm/i915/backlight: Honor panel backlight quirk for minimum brightness Paul Menzel
@ 2026-11-27 16:37 ` Paul Menzel
1 sibling, 0 replies; 2+ messages in thread
From: Paul Menzel @ 2026-11-27 16:37 UTC (permalink / raw)
To: Jani Nikula, Rodrigo Vivi, Joonas Lahtinen, Tvrtko Ursulin,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Simona Vetter
Cc: Paul Menzel, Matthew Brost, Thomas Hellström,
Antheas Kapenekakis, Thomas Weißschuh, intel-gfx, intel-xe,
dri-devel, linux-kernel
The VBT of the Dell XPS 13 9310 (BIOS 3.17.0, BDB 240, panel_type 2)
sets the backlight minimum level to 15/255, so i915 maps brightness 1
to a PWM duty cycle of 5.9 %. With GNOME, which does not go below 1 %
of max_brightness, the lowest slider position gives 6.8 %, which is
still too bright in a dark room:
$ cat /sys/class/backlight/intel_backlight/{max_brightness,brightness}
96000
960
$ sudo intel_reg read 0xC8258 # BXT_BLC_PWM_DUTY(0)
(0x000c8258): 0x00001997
6551 = 5647 + 960 * (96000 - 5647) / 96000, with 5647 = 15/255 * 96000
Writing the duty cycle register directly shows that the panel, a Sharp
LQ134N1 (EDID SHP 0x14f9), is well readable at 1 % (960/96000).
Add a quirk setting the minimum to 0/255 for this system and panel, so
that brightness maps linearly onto the PWM duty cycle, and GNOME’s
lowest position becomes 1 %. Other XPS 13 9310 panels (UHD+, OLED) were
not tested, so match the panel ID as well.
Tested on the Dell XPS 13 9310 (BIOS 3.17.0) with v7.4-rc1 and v7.4-rc4
based kernels: GNOME lowest position gives PWM duty 960/96000 (1 %),
was 6551 (6.8 %).
Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
---
Notes:
Prepared with Claude Code (claude-opus-5-5).
drivers/gpu/drm/drm_panel_backlight_quirks.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/gpu/drm/drm_panel_backlight_quirks.c b/drivers/gpu/drm/drm_panel_backlight_quirks.c
index dcb91e12bac6b..85c2ef791d116 100644
--- a/drivers/gpu/drm/drm_panel_backlight_quirks.c
+++ b/drivers/gpu/drm/drm_panel_backlight_quirks.c
@@ -53,6 +53,15 @@ static const struct drm_get_panel_backlight_quirk drm_panel_min_backlight_quirks
.ident.name = "NE135A1M-NY1",
.quirk = { .min_brightness = 1, },
},
+ /* Dell XPS 13 9310 FHD+ panel, VBT minimum 15/255 is too bright */
+ {
+ .dmi_match.field = DMI_SYS_VENDOR,
+ .dmi_match.value = "Dell Inc.",
+ .dmi_match_other.field = DMI_PRODUCT_NAME,
+ .dmi_match_other.value = "XPS 13 9310",
+ .ident.panel_id = drm_edid_encode_panel_id('S', 'H', 'P', 0x14f9),
+ .quirk = { .min_brightness = 1, },
+ },
/* Steam Deck models */
{
.dmi_match.field = DMI_SYS_VENDOR,
--
2.54.0
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-27 16:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20261127163752.54806-1-pmenzel@molgen.mpg.de>
2026-11-27 16:37 ` [PATCH 1/3] drm/i915/backlight: Honor panel backlight quirk for minimum brightness Paul Menzel
2026-11-27 16:37 ` [PATCH 2/3] drm: panel-backlight-quirks: Add Dell XPS 13 9310 FHD+ panel Paul Menzel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®