[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20231110191340.4157610-1-ballway@chromium.org>
Date: Fri, 10 Nov 2023 19:13:37 +0000
From: Allen Ballway <ballway@...omium.org>
To: dmitry.torokhov@...il.com
Cc: ballway@...omium.org, dri-devel@...ts.freedesktop.org,
intel-gfx@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: [PATCH v2] drm/i915/quirk: Add quirk for devices with incorrect PWM frequency
Cyernet T10C has a bad default PWM frequency causing the display to
strobe when the brightness is less than 100%. Create a new quirk to use
the value from the BIOS rather than the default register value.
Signed-off-by: Allen Ballway <ballway@...omium.org>
---
V1 -> V2: Fix style issues.
.../gpu/drm/i915/display/intel_backlight.c | 6 +++--
drivers/gpu/drm/i915/display/intel_quirks.c | 26 +++++++++++++++++++
drivers/gpu/drm/i915/display/intel_quirks.h | 1 +
3 files changed, 31 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_backlight.c b/drivers/gpu/drm/i915/display/intel_backlight.c
index 2e8f17c045222..b4171952343eb 100644
--- a/drivers/gpu/drm/i915/display/intel_backlight.c
+++ b/drivers/gpu/drm/i915/display/intel_backlight.c
@@ -1385,8 +1385,10 @@ static int vlv_setup_backlight(struct intel_connector *connector, enum pipe pipe
ctl2 = intel_de_read(i915, VLV_BLC_PWM_CTL2(pipe));
panel->backlight.active_low_pwm = ctl2 & BLM_POLARITY_I965;
- ctl = intel_de_read(i915, VLV_BLC_PWM_CTL(pipe));
- panel->backlight.pwm_level_max = ctl >> 16;
+ if (!intel_has_quirk(i915, QUIRK_IGNORE_DEFAULT_PWM_FREQUENCY)) {
+ ctl = intel_de_read(i915, VLV_BLC_PWM_CTL(pipe));
+ panel->backlight.pwm_level_max = ctl >> 16;
+ }
if (!panel->backlight.pwm_level_max)
panel->backlight.pwm_level_max = get_backlight_max_vbt(connector);
diff --git a/drivers/gpu/drm/i915/display/intel_quirks.c b/drivers/gpu/drm/i915/display/intel_quirks.c
index a280448df771a..ff6cb499428ce 100644
--- a/drivers/gpu/drm/i915/display/intel_quirks.c
+++ b/drivers/gpu/drm/i915/display/intel_quirks.c
@@ -65,6 +65,12 @@ static void quirk_no_pps_backlight_power_hook(struct drm_i915_private *i915)
drm_info(&i915->drm, "Applying no pps backlight power quirk\n");
}
+static void quirk_ignore_default_pwm_frequency(struct drm_i915_private *i915)
+{
+ intel_set_quirk(i915, QUIRK_IGNORE_DEFAULT_PWM_FREQUENCY);
+ drm_info(&i915->drm, "Applying ignore default pwm frequency quirk");
+}
+
struct intel_quirk {
int device;
int subsystem_vendor;
@@ -90,6 +96,12 @@ static int intel_dmi_no_pps_backlight(const struct dmi_system_id *id)
return 1;
}
+static int intel_dmi_ignore_default_pwm_frequency(const struct dmi_system_id *id)
+{
+ DRM_INFO("Default PWM frequency is incorrect and is overridden on %s\n", id->ident);
+ return 1;
+}
+
static const struct intel_dmi_quirk intel_dmi_quirks[] = {
{
.dmi_id_list = &(const struct dmi_system_id[]) {
@@ -136,6 +148,20 @@ static const struct intel_dmi_quirk intel_dmi_quirks[] = {
},
.hook = quirk_no_pps_backlight_power_hook,
},
+ {
+ .dmi_id_list = &(const struct dmi_system_id[]) {
+ {
+ .callback = intel_dmi_ignore_default_pwm_frequency,
+ .ident = "Cybernet T10C Tablet",
+ .matches = {DMI_EXACT_MATCH(DMI_BOARD_VENDOR,
+ "Cybernet Manufacturing Inc."),
+ DMI_EXACT_MATCH(DMI_BOARD_NAME, "T10C Tablet"),
+ },
+ },
+ { }
+ },
+ .hook = quirk_ignore_default_pwm_frequency,
+ },
};
static struct intel_quirk intel_quirks[] = {
diff --git a/drivers/gpu/drm/i915/display/intel_quirks.h b/drivers/gpu/drm/i915/display/intel_quirks.h
index 10a4d163149fd..ca34dacf0c242 100644
--- a/drivers/gpu/drm/i915/display/intel_quirks.h
+++ b/drivers/gpu/drm/i915/display/intel_quirks.h
@@ -17,6 +17,7 @@ enum intel_quirk_id {
QUIRK_INVERT_BRIGHTNESS,
QUIRK_LVDS_SSC_DISABLE,
QUIRK_NO_PPS_BACKLIGHT_POWER_HOOK,
+ QUIRK_IGNORE_DEFAULT_PWM_FREQUENCY,
};
void intel_init_quirks(struct drm_i915_private *i915);
--
2.42.0.869.gea05f2083d-goog
Powered by blists - more mailing lists