Skip to content

Commit

Permalink
drm/vc4: dpi: Ensure a default format is selected
Browse files Browse the repository at this point in the history
In a couple of error/incomplete configuration cases, the
DPI_FORMAT bits wouldn't get set.

Adopt a default of RGB666 in all these cases.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
  • Loading branch information
6by9 authored and popcornmix committed Mar 21, 2022
1 parent 588f2be commit 9d9dc23
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions drivers/gpu/drm/vc4/vc4_dpi.c
Expand Up @@ -173,6 +173,10 @@ static void vc4_dpi_encoder_enable(struct drm_encoder *encoder)
dpi_c |= VC4_SET_FIELD(DPI_ORDER_BGR,
DPI_ORDER);
break;
default:
DRM_ERROR("Unknown media bus format %d\n",
bus_format);
fallthrough;
case MEDIA_BUS_FMT_RGB666_1X18:
dpi_c |= VC4_SET_FIELD(DPI_FORMAT_18BIT_666_RGB_1,
DPI_FORMAT);
Expand All @@ -187,11 +191,12 @@ static void vc4_dpi_encoder_enable(struct drm_encoder *encoder)
dpi_c |= VC4_SET_FIELD(DPI_FORMAT_16BIT_565_RGB_3,
DPI_FORMAT);
break;
default:
DRM_ERROR("Unknown media bus format %d\n",
bus_format);
break;
}
} else {
/* Default to 18bit if no connector found. */
dpi_c |= VC4_SET_FIELD(DPI_FORMAT_18BIT_666_RGB_1,
DPI_FORMAT);

}

if (connector->display_info.bus_flags &
Expand Down

0 comments on commit 9d9dc23

Please sign in to comment.