diff options
author | Dave Stevenson <dave.stevenson@raspberrypi.com> | 2022-06-13 16:47:37 +0200 |
---|---|---|
committer | Maxime Ripard <maxime@cerno.tech> | 2022-06-28 14:55:19 +0200 |
commit | 7a70b0b97889a89f397913c971cadfc6db9b310a (patch) | |
tree | 73569278404742ddcecc2835b8c693f611fc5afe /drivers/gpu/drm/vc4 | |
parent | 3c2707632146b22e97b0fbf6778bab8add2eaa1d (diff) | |
download | linux-7a70b0b97889a89f397913c971cadfc6db9b310a.tar.gz linux-7a70b0b97889a89f397913c971cadfc6db9b310a.tar.bz2 linux-7a70b0b97889a89f397913c971cadfc6db9b310a.zip |
drm/vc4: dpi: Ensure a default format is selected
In a couple of error/incomplete configuration cases, the
DPI_FORMAT bits wouldn't get set.
Enforce our RGB888 default in all these cases.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://lore.kernel.org/r/20220613144800.326124-11-maxime@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Diffstat (limited to 'drivers/gpu/drm/vc4')
-rw-r--r-- | drivers/gpu/drm/vc4/vc4_dpi.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c b/drivers/gpu/drm/vc4/vc4_dpi.c index 695b759db9bc..44355b347ff2 100644 --- a/drivers/gpu/drm/vc4/vc4_dpi.c +++ b/drivers/gpu/drm/vc4/vc4_dpi.c @@ -148,10 +148,15 @@ static void vc4_dpi_encoder_enable(struct drm_encoder *encoder) } drm_connector_list_iter_end(&conn_iter); + /* Default to 24bit if no connector or format found. */ + dpi_c |= VC4_SET_FIELD(DPI_FORMAT_24BIT_888_RGB, DPI_FORMAT); + if (connector) { if (connector->display_info.num_bus_formats) { u32 bus_format = connector->display_info.bus_formats[0]; + dpi_c &= ~DPI_FORMAT_MASK; + switch (bus_format) { case MEDIA_BUS_FMT_RGB888_1X24: dpi_c |= VC4_SET_FIELD(DPI_FORMAT_24BIT_888_RGB, @@ -187,9 +192,6 @@ static void vc4_dpi_encoder_enable(struct drm_encoder *encoder) if (connector->display_info.bus_flags & DRM_BUS_FLAG_DE_LOW) dpi_c |= DPI_OUTPUT_ENABLE_INVERT; - } else { - /* Default to 24bit if no connector found. */ - dpi_c |= VC4_SET_FIELD(DPI_FORMAT_24BIT_888_RGB, DPI_FORMAT); } if (mode->flags & DRM_MODE_FLAG_CSYNC) { |