diff mbox series

[v5,13/17] drm/panel: khadas-ts050: update timings to achieve 60Hz refresh rate

Message ID 20230512-amlogic-v6-4-upstream-dsi-ccf-vim3-v5-13-56eb7a4d5b8e@linaro.org
State Handled Elsewhere
Headers show
Series drm/meson: add support for MIPI DSI Display | expand

Commit Message

Neil Armstrong May 30, 2023, 7:38 a.m. UTC
This updates the panel timings to achieve a clean 60Hz refresh rate.

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
 drivers/gpu/drm/panel/panel-khadas-ts050.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

Comments

Nicolas Belin May 31, 2023, 9:23 a.m. UTC | #1
Le mar. 30 mai 2023 à 09:38, Neil Armstrong
<neil.armstrong@linaro.org> a écrit :
>
> This updates the panel timings to achieve a clean 60Hz refresh rate.
>
> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
> ---
>  drivers/gpu/drm/panel/panel-khadas-ts050.c | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/panel/panel-khadas-ts050.c b/drivers/gpu/drm/panel/panel-khadas-ts050.c
> index 1ab1ebe30882..b942a0162274 100644
> --- a/drivers/gpu/drm/panel/panel-khadas-ts050.c
> +++ b/drivers/gpu/drm/panel/panel-khadas-ts050.c
> @@ -568,7 +568,7 @@ static const struct khadas_ts050_panel_cmd init_code[] = {
>         {0xfb, 0x01},
>         /* Select CMD1 */
>         {0xff, 0x00},
> -       {0xd3, 0x05}, /* RGBMIPICTRL: VSYNC back porch = 5 */
> +       {0xd3, 0x22}, /* RGBMIPICTRL: VSYNC back porch = 34 */
>         {0xd4, 0x04}, /* RGBMIPICTRL: VSYNC front porch = 4 */
>  };
>
> @@ -717,15 +717,15 @@ static int khadas_ts050_panel_disable(struct drm_panel *panel)
>  }
>
>  static const struct drm_display_mode default_mode = {
> -       .clock = 120000,
> -       .hdisplay = 1088,
> -       .hsync_start = 1088 + 104,
> -       .hsync_end = 1088 + 104 + 4,
> -       .htotal = 1088 + 104 + 4 + 127,
> +       .clock = 160000,
> +       .hdisplay = 1080,
> +       .hsync_start = 1080 + 117,
> +       .hsync_end = 1080 + 117 + 5,
> +       .htotal = 1080 + 117 + 5 + 160,
>         .vdisplay = 1920,
>         .vsync_start = 1920 + 4,
> -       .vsync_end = 1920 + 4 + 2,
> -       .vtotal = 1920 + 4 + 2 + 3,
> +       .vsync_end = 1920 + 4 + 3,
> +       .vtotal = 1920 + 4 + 3 + 31,
>         .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
>  };
>
>
> --
> 2.34.1
>
Reviewed-by: Nicolas Belin <nbelin@baylibre.com>
Tested-by: Nicolas Belin <nbelin@baylibre.com> # on Khadas VIM3 + TS050 Panel

Thanks,
Nicolas
diff mbox series

Patch

diff --git a/drivers/gpu/drm/panel/panel-khadas-ts050.c b/drivers/gpu/drm/panel/panel-khadas-ts050.c
index 1ab1ebe30882..b942a0162274 100644
--- a/drivers/gpu/drm/panel/panel-khadas-ts050.c
+++ b/drivers/gpu/drm/panel/panel-khadas-ts050.c
@@ -568,7 +568,7 @@  static const struct khadas_ts050_panel_cmd init_code[] = {
 	{0xfb, 0x01},
 	/* Select CMD1 */
 	{0xff, 0x00},
-	{0xd3, 0x05}, /* RGBMIPICTRL: VSYNC back porch = 5 */
+	{0xd3, 0x22}, /* RGBMIPICTRL: VSYNC back porch = 34 */
 	{0xd4, 0x04}, /* RGBMIPICTRL: VSYNC front porch = 4 */
 };
 
@@ -717,15 +717,15 @@  static int khadas_ts050_panel_disable(struct drm_panel *panel)
 }
 
 static const struct drm_display_mode default_mode = {
-	.clock = 120000,
-	.hdisplay = 1088,
-	.hsync_start = 1088 + 104,
-	.hsync_end = 1088 + 104 + 4,
-	.htotal = 1088 + 104 + 4 + 127,
+	.clock = 160000,
+	.hdisplay = 1080,
+	.hsync_start = 1080 + 117,
+	.hsync_end = 1080 + 117 + 5,
+	.htotal = 1080 + 117 + 5 + 160,
 	.vdisplay = 1920,
 	.vsync_start = 1920 + 4,
-	.vsync_end = 1920 + 4 + 2,
-	.vtotal = 1920 + 4 + 2 + 3,
+	.vsync_end = 1920 + 4 + 3,
+	.vtotal = 1920 + 4 + 3 + 31,
 	.flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
 };