Skip to content

Commit 2cac4ed

Browse files
committed
drm/i915/vlv_dsi: Add DMI quirk for wrong I2C bus and panel size on Lenovo Yoga Tablet 2 series (v3)
On the Lenovo Yoga Tablet 2 830 / 1050 there are 2 problems: 1. The I2C MIPI sequence elements reference bus 3. ACPI has I2C1 - I2C7 which under Linux become bus 0 - 6. And the MIPI sequence reference to bus 3 is indented for I2C3 which is bus 2 under Linux. This leads to errors like these: [ 178.244049] i2c_designware 80860F41:03: controller timed out [ 178.245703] i915 0000:00:02.0: [drm] *ERROR* Failed to xfer payload of size (1) to reg (169) There are 3 timeouts when the panel is on, delaying waking up the screen on a key press by 3 seconds. Note mipi_exec_i2c() cannot just subtract 1 from the bus given in the I2C MIPI sequence element. Since on other devices the I2C bus-numbers used in the MIPI sequences do actually start at 0. 2. width_/height_mm contain a bogus 192mm x 120mm size. This is especially a problem on the 8" 830 version which uses a 10:16 portrait screen where as the bogus size is 16:10. Add a DMI quirk to override the I2C bus and the panel size with the correct values. Note both the 10" 1050 models as well as the 8" 830 models use the same mainboard and thus the same DMI strings. The 10" 1050 uses a 1920x1200 landscape screen, where as the 8" 830 uses a 1200x1920 portrait screen, so the quirk handling uses the display resolution to detect the model. v2: - Also override i2c_bus_num to fix mipi_exec_i2c() timeouts v3: - Add Closes tag to gitlab issue with drm.debug=0xe, VBT info Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/9379 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 b07eb15 commit 2cac4ed

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

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

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1767,6 +1767,44 @@ static void vlv_dsi_asus_tf103c_mode_fixup(struct intel_dsi *intel_dsi)
17671767
fixed_mode->vtotal -= 4;
17681768
}
17691769

1770+
/*
1771+
* On the Lenovo Yoga Tablet 2 830 / 1050 there are 2 problems:
1772+
* 1. The I2C MIPI sequence elements reference bus 3. ACPI has I2C1 - I2C7
1773+
* which under Linux become bus 0 - 6. And the MIPI sequence reference
1774+
* to bus 3 is indented for I2C3 which is bus 2 under Linux.
1775+
*
1776+
* Note mipi_exec_i2c() cannot just subtract 1 from the bus
1777+
* given in the I2C MIPI sequence element. Since on other
1778+
* devices the I2C bus-numbers used in the MIPI sequences do
1779+
* actually start at 0.
1780+
*
1781+
* 2. width_/height_mm contain a bogus 192mm x 120mm size. This is
1782+
* especially a problem on the 8" 830 version which uses a 10:16
1783+
* portrait screen where as the bogus size is 16:10.
1784+
*
1785+
* https://gitlab.freedesktop.org/drm/intel/-/issues/9379
1786+
*/
1787+
static void vlv_dsi_lenovo_yoga_tab2_size_fixup(struct intel_dsi *intel_dsi)
1788+
{
1789+
const struct drm_display_mode *fixed_mode =
1790+
intel_panel_preferred_fixed_mode(intel_dsi->attached_connector);
1791+
struct drm_display_info *info = &intel_dsi->attached_connector->base.display_info;
1792+
1793+
intel_dsi->i2c_bus_num = 2;
1794+
1795+
/*
1796+
* The 10" 1050 uses a 1920x1200 landscape screen, where as the 8" 830
1797+
* uses a 1200x1920 portrait screen.
1798+
*/
1799+
if (fixed_mode->hdisplay == 1920) {
1800+
info->width_mm = 216;
1801+
info->height_mm = 135;
1802+
} else {
1803+
info->width_mm = 107;
1804+
info->height_mm = 171;
1805+
}
1806+
}
1807+
17701808
static const struct dmi_system_id vlv_dsi_dmi_quirk_table[] = {
17711809
{
17721810
/* Asus Transformer Pad TF103C */
@@ -1776,6 +1814,20 @@ static const struct dmi_system_id vlv_dsi_dmi_quirk_table[] = {
17761814
},
17771815
.driver_data = (void *)vlv_dsi_asus_tf103c_mode_fixup,
17781816
},
1817+
{
1818+
/*
1819+
* Lenovo Yoga Tablet 2 830F/L or 1050F/L (The 8" and 10"
1820+
* Lenovo Yoga Tablet 2 use the same mainboard)
1821+
*/
1822+
.matches = {
1823+
DMI_MATCH(DMI_SYS_VENDOR, "Intel Corp."),
1824+
DMI_MATCH(DMI_PRODUCT_NAME, "VALLEYVIEW C0 PLATFORM"),
1825+
DMI_MATCH(DMI_BOARD_NAME, "BYT-T FFD8"),
1826+
/* Partial match on beginning of BIOS version */
1827+
DMI_MATCH(DMI_BIOS_VERSION, "BLADE_21"),
1828+
},
1829+
.driver_data = (void *)vlv_dsi_lenovo_yoga_tab2_size_fixup,
1830+
},
17791831
{ }
17801832
};
17811833

0 commit comments

Comments
 (0)