Skip to contentSkip to conversation

drm/i915/backlight: Use panel backlight quirks for the minimum brightness

PATCH In review Paul Menzel 1 participant 3 messages Nov 27

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

cover drm/i915/backlight: Use panel backlight quirks for the minimum brightness

Dear Linux folks,

On the Dell XPS 13 9310 and the Dell XPS 9315, the VBT entry of the Sharp panel in use sets the backlight minimum to 15/255 (the other 15 entries say 6/255). With GNOME at its lowest brightness (1 % of max_brightness), the PWM duty cycle is therefore 6.8 %, which is too bright for the lowest level.

amdgpu already takes such corrections from the DRM panel backlight quirk table. Patch 1 makes i915 (and so xe) consult it in get_backlight_min_vbt(), patches 2 and 3 add the two systems, matched by DMI and panel ID. With the series, the lowest GNOME position gives 1 %.

The series is based on v7.4-rc4 and applies cleanly to drm-tip (2026-11-27). Patches 2 and 3 only touch the shared quirk table; for Intel systems they take effect with patch 1.

Even 1 % is brighter than wanted on the XPS 9315 (0.25 % was judged best by eye), but going lower is up to the desktop: GNOME/mutter never sets less than 1 % of max_brightness.

The patches and messages were prepared with Claude Code (claude-opus-5-5) and tested on both laptops; I reviewed them. Test details are in the notes below the --- of each patch.

Kind regards,

Paul

Paul Menzel (3):
drm/i915/backlight: Honor panel backlight quirk for minimum brightness
drm: panel-backlight-quirks: Add Dell XPS 13 9310 FHD+ panel
drm: panel-backlight-quirks: Add Dell XPS 9315 FHD+ panel

 drivers/gpu/drm/drm_panel_backlight_quirks.c   | 18 ++++++++++++++++++
 drivers/gpu/drm/i915/Kconfig                   |  1 +
 drivers/gpu/drm/i915/display/intel_backlight.c | 15 +++++++++++++++
 drivers/gpu/drm/xe/Kconfig                     |  1 +
 4 files changed, 35 insertions(+)

base-commit: b6a9fa34ce4187cb69d3c588a4bbffc31ce5db8f

Signature · 1 line
2.54.0
#1 lore raw

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

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)".

---

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(+)
drivers/gpu/drm/i915/Kconfig +1 -0
index 71426b9c91f00..c2075a4a48b8b 100644
@@ -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
drivers/gpu/drm/i915/display/intel_backlight.c +15 -0
index b128896cb1c2d..b0c0e7f3d6e24 100644
@@ -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
drivers/gpu/drm/xe/Kconfig +1 -0
index 049d2f25d0e60..dab996c7d205d 100644
@@ -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
Signature · 1 line
2.54.0
#2 lore raw

PATCH 2/3 drm: panel-backlight-quirks: Add Dell XPS 13 9310 FHD+ panel

In reply to Paul Menzel

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 %).

---

Notes:

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

 drivers/gpu/drm/drm_panel_backlight_quirks.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/gpu/drm/drm_panel_backlight_quirks.c +9 -0
index dcb91e12bac6b..85c2ef791d116 100644
@@ -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,
Signature · 1 line
2.54.0