Hello Hans,

On 2/21/22 23:06, Hans de Goede wrote:
> 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 <hdego...@redhat.com>
> ---
>  drivers/gpu/drm/i915/display/vlv_dsi.c | 36 ++++++++++++++++++++++++++
>  1 file changed, 36 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/display/vlv_dsi.c 
> b/drivers/gpu/drm/i915/display/vlv_dsi.c
> index 06ef822c27bd..66f5cf32bb66 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.nik...@intel.com>
>   */
>  
> +#include <linux/dmi.h>
>  #include <linux/slab.h>
>  
>  #include <drm/drm_atomic_helper.h>
> @@ -1831,6 +1832,33 @@ 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_connector *connector,
> +                                     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_connector *connector,
> +                                        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[] = {
> +     {
> +             /* Asus Transformer Pad TF103C */
> +             .matches = {
> +                     DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
> +                     DMI_MATCH(DMI_PRODUCT_NAME, "TF103C"),
> +             },
> +             .driver_data = (void *)vlv_dsi_asus_tf103c_mode_fixup,
> +     },
> +     { }
> +};
> +

There's nothing driver specific in this mechanism so I wonder if would
be better to add it as a DRM helper, for others drivers to use it too.

Maybe in drivers/gpu/drm/drm_modeset_helper.c or a drm_modeset_quirks.c
like we have for drivers/gpu/drm/drm_panel_orientation_quirks.c ?

The patch looks good to me, regardless where you decide to add it.

Reviewed-by: Javier Martinez Canillas <javi...@redhat.com>

Best regards,
-- 
Javier Martinez Canillas
Linux Engineering
Red Hat

Reply via email to