Skip to content

Commit

Permalink
drm/ingenic: Properly compute timings when using a 3x8-bit panel
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
  • Loading branch information
pcercuei committed Oct 20, 2020
1 parent ac837a9 commit b1fb952
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion drivers/gpu/drm/ingenic/ingenic-drm-drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,7 @@ static int ingenic_drm_encoder_atomic_check(struct drm_encoder *encoder,
struct drm_connector_state *conn_state)
{
struct drm_display_info *info = &conn_state->connector->display_info;
struct drm_display_mode *mode = &crtc_state->adjusted_mode;

if (info->num_bus_formats != 1)
return -EINVAL;
Expand All @@ -686,10 +687,16 @@ static int ingenic_drm_encoder_atomic_check(struct drm_encoder *encoder,
return 0;

switch (*info->bus_formats) {
case MEDIA_BUS_FMT_RGB888_3X8:
mode->crtc_clock = mode->clock * 3;
mode->crtc_hsync_start = mode->hsync_start * 3;
mode->crtc_hsync_end = mode->hsync_end * 3;
mode->crtc_hdisplay = mode->hdisplay;
mode->crtc_htotal = mode->htotal * 3;
return 0;
case MEDIA_BUS_FMT_RGB565_1X16:
case MEDIA_BUS_FMT_RGB666_1X18:
case MEDIA_BUS_FMT_RGB888_1X24:
case MEDIA_BUS_FMT_RGB888_3X8:
return 0;
default:
return -EINVAL;
Expand Down

0 comments on commit b1fb952

Please sign in to comment.