diff mbox series

drm/i915/vlv_dsi: Add DMI quirk for wrong panel modeline in BIOS on Asus TF103C

Message ID 20211220161343.21975-1-hdegoede@redhat.com (mailing list archive)
State New, archived
Headers show
Series drm/i915/vlv_dsi: Add DMI quirk for wrong panel modeline in BIOS on Asus TF103C | expand

Commit Message

Hans de Goede Dec. 20, 2021, 4:13 p.m. UTC
Vtotal is wrong in the BIOS supplied modeline for the DSI panel on
the Asus TF103C leading to the last line of the display being shown
as the first line.

The factory installed Android has a hardcoded modeline in its kernel,
causing it to not suffer from this BIOS bug;

and the Android boot-splash which uses the EFI FB which does have this bug
has the last line all black causing the bug to not be visible.

This commit introduces a generic DMI based mechanism for doing modeline
fixups, in case we need similar fixups on other models in the future.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/gpu/drm/i915/display/vlv_dsi.c | 33 ++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

Comments

Hans de Goede Dec. 21, 2021, 10:25 a.m. UTC | #1
Hi,

On 12/20/21 20:58, Patchwork wrote:
> *Patch Details*
> *Series:*	drm/i915/vlv_dsi: Add DMI quirk for wrong panel modeline in BIOS on Asus TF103C
> *URL:*	https://patchwork.freedesktop.org/series/98239/ <https://patchwork.freedesktop.org/series/98239/>
> *State:*	failure
> *Details:*	https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21879/index.html <https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21879/index.html>
> 
> 
>   CI Bug Log - changes from CI_DRM_11016_full -> Patchwork_21879_full
> 
> 
>     Summary
> 
> *FAILURE*
> 
> Serious unknown changes coming with Patchwork_21879_full absolutely need to be
> verified manually.
> 
> If you think the reported changes have nothing to do with the changes
> introduced in Patchwork_21879_full, please notify your bug team to allow them
> to document this new failure mode, which will reduce false positives in CI.
> 
> 
>     Participating hosts (18 -> 18)
> 
> No changes in participating hosts
> 
> 
>     Possible new issues
> 
> Here are the unknown changes that may have been introduced in Patchwork_21879_full:
> 
> 
>       IGT changes
> 
> 
>         Possible regressions
> 
>   *
> 
>     igt@i915_suspend@fence-restore-tiled2untiled:
> 
>       o shard-skl: PASS <https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11016/shard-skl1/igt@i915_suspend@fence-restore-tiled2untiled.html> -> INCOMPLETE <https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21879/shard-skl6/igt@i915_suspend@fence-restore-tiled2untiled.html>
>   *
> 
>     igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
> 
>       o shard-apl: NOTRUN -> INCOMPLETE <https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21879/shard-apl3/igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a.html>

Since this patch does not do anything unless it runs on the system where the DMI
match matches, these are both false positives.

Regards,

Hans
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/vlv_dsi.c b/drivers/gpu/drm/i915/display/vlv_dsi.c
index fc0dd0c4079e..98d64b6e132e 100644
--- a/drivers/gpu/drm/i915/display/vlv_dsi.c
+++ b/drivers/gpu/drm/i915/display/vlv_dsi.c
@@ -23,6 +23,7 @@ 
  * Author: Jani Nikula <jani.nikula@intel.com>
  */
 
+#include <linux/dmi.h>
 #include <linux/slab.h>
 
 #include <drm/drm_atomic_helper.h>
@@ -1828,6 +1829,30 @@  static void vlv_dphy_param_init(struct intel_dsi *intel_dsi)
 	intel_dsi_log_params(intel_dsi);
 }
 
+typedef void (*vlv_dsi_mode_fixup_func)(struct drm_display_mode *fixed_mode);
+
+/*
+ * Vtotal is wrong on the Asus TF103C leading to the last line of the display
+ * being shown as the first line. The factory installed Android has a hardcoded
+ * modeline, causing it to not suffer from this BIOS bug.
+ */
+static void vlv_dsi_asus_tf103c_mode_fixup(struct drm_display_mode *fixed_mode)
+{
+	fixed_mode->vtotal = 816;
+	fixed_mode->crtc_vtotal = 816;
+}
+
+static const struct dmi_system_id dmi_mode_fixup_table[] = {
+	{
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "TF103C"),
+		},
+		.driver_data = (void *)vlv_dsi_asus_tf103c_mode_fixup,
+	},
+	{ }
+};
+
 void vlv_dsi_init(struct drm_i915_private *dev_priv)
 {
 	struct drm_device *dev = &dev_priv->drm;
@@ -1837,6 +1862,8 @@  void vlv_dsi_init(struct drm_i915_private *dev_priv)
 	struct intel_connector *intel_connector;
 	struct drm_connector *connector;
 	struct drm_display_mode *current_mode, *fixed_mode;
+	const struct dmi_system_id *dmi_id;
+	vlv_dsi_mode_fixup_func mode_fixup;
 	enum port port;
 	enum pipe pipe;
 
@@ -1965,6 +1992,12 @@  void vlv_dsi_init(struct drm_i915_private *dev_priv)
 		goto err_cleanup_connector;
 	}
 
+	dmi_id = dmi_first_match(dmi_mode_fixup_table);
+	if (dmi_id) {
+		mode_fixup = (vlv_dsi_mode_fixup_func)dmi_id->driver_data;
+		mode_fixup(fixed_mode);
+	}
+
 	intel_panel_init(&intel_connector->panel, fixed_mode, NULL);
 	intel_backlight_setup(intel_connector, INVALID_PIPE);