Skip to content

Commit b07eb15

Browse files
committed
drm/i915/vlv_dsi: Add DMI quirk for wrong panel modeline in BIOS on Asus TF103C (v3)
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. Original: "1280x800": 60 67700 1280 1312 1328 1376 800 808 812 820 0x8 0xa Fixed: "1280x800": 60 67700 1280 1312 1328 1376 800 808 812 816 0x8 0xa 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 quirk mechanism to vlv_dsi for doing various fixups, and uses this to correct the modeline. v2: - s/mode_fixup/dmi_quirk/ to make the new DMI quirk mechanism more generic - Add a comment with the old and new modelines to the patch and commit msg v3: - Add Closes tag to gitlab issue with drm.debug=0xe, VBT info Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/9381 Reviewed-by: Javier Martinez Canillas <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Acked-by: Jani Nikula <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 5888368 commit b07eb15

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

drivers/gpu/drm/i915/display/vlv_dsi.c

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
* Author: Jani Nikula <[email protected]>
2424
*/
2525

26+
#include <linux/dmi.h>
2627
#include <linux/slab.h>
2728

2829
#include <drm/drm_atomic_helper.h>
@@ -1744,6 +1745,40 @@ static void vlv_dphy_param_init(struct intel_dsi *intel_dsi)
17441745
intel_dsi_log_params(intel_dsi);
17451746
}
17461747

1748+
typedef void (*vlv_dsi_dmi_quirk_func)(struct intel_dsi *intel_dsi);
1749+
1750+
/*
1751+
* Vtotal is wrong on the Asus TF103C leading to the last line of the display
1752+
* being shown as the first line. The factory installed Android has a hardcoded
1753+
* modeline, causing it to not suffer from this BIOS bug.
1754+
*
1755+
* Original mode: "1280x800": 60 67700 1280 1312 1328 1376 800 808 812 820 0x8 0xa
1756+
* Fixed mode: "1280x800": 60 67700 1280 1312 1328 1376 800 808 812 816 0x8 0xa
1757+
*
1758+
* https://gitlab.freedesktop.org/drm/intel/-/issues/9381
1759+
*/
1760+
static void vlv_dsi_asus_tf103c_mode_fixup(struct intel_dsi *intel_dsi)
1761+
{
1762+
/* Cast away the const as we want to fixup the mode */
1763+
struct drm_display_mode *fixed_mode = (struct drm_display_mode *)
1764+
intel_panel_preferred_fixed_mode(intel_dsi->attached_connector);
1765+
1766+
if (fixed_mode->vtotal == 820)
1767+
fixed_mode->vtotal -= 4;
1768+
}
1769+
1770+
static const struct dmi_system_id vlv_dsi_dmi_quirk_table[] = {
1771+
{
1772+
/* Asus Transformer Pad TF103C */
1773+
.matches = {
1774+
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
1775+
DMI_MATCH(DMI_PRODUCT_NAME, "TF103C"),
1776+
},
1777+
.driver_data = (void *)vlv_dsi_asus_tf103c_mode_fixup,
1778+
},
1779+
{ }
1780+
};
1781+
17471782
void vlv_dsi_init(struct drm_i915_private *dev_priv)
17481783
{
17491784
struct intel_dsi *intel_dsi;
@@ -1752,6 +1787,7 @@ void vlv_dsi_init(struct drm_i915_private *dev_priv)
17521787
struct intel_connector *intel_connector;
17531788
struct drm_connector *connector;
17541789
struct drm_display_mode *current_mode;
1790+
const struct dmi_system_id *dmi_id;
17551791
enum port port;
17561792
enum pipe pipe;
17571793

@@ -1883,6 +1919,14 @@ void vlv_dsi_init(struct drm_i915_private *dev_priv)
18831919
goto err_cleanup_connector;
18841920
}
18851921

1922+
dmi_id = dmi_first_match(vlv_dsi_dmi_quirk_table);
1923+
if (dmi_id) {
1924+
vlv_dsi_dmi_quirk_func quirk_func =
1925+
(vlv_dsi_dmi_quirk_func)dmi_id->driver_data;
1926+
1927+
quirk_func(intel_dsi);
1928+
}
1929+
18861930
intel_panel_init(intel_connector, NULL);
18871931

18881932
intel_backlight_setup(intel_connector, INVALID_PIPE);

0 commit comments

Comments
 (0)