Commit 7fea3c23 authored by Dave Stevenson's avatar Dave Stevenson Committed by Maxime Ripard

drm/vc4: dpi: Add support for composite syncs to vc4_dpi

The hardware can combine H&V syncs onto the output enable line
as composite syncs, so add the relevant configuration to do that.
Signed-off-by: default avatarDave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://lore.kernel.org/r/20220613144800.326124-9-maxime@cerno.techSigned-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
parent c6dac003
...@@ -131,7 +131,7 @@ static void vc4_dpi_encoder_enable(struct drm_encoder *encoder) ...@@ -131,7 +131,7 @@ static void vc4_dpi_encoder_enable(struct drm_encoder *encoder)
struct vc4_dpi *dpi = vc4_encoder->dpi; struct vc4_dpi *dpi = vc4_encoder->dpi;
struct drm_connector_list_iter conn_iter; struct drm_connector_list_iter conn_iter;
struct drm_connector *connector = NULL, *connector_scan; struct drm_connector *connector = NULL, *connector_scan;
u32 dpi_c = DPI_ENABLE | DPI_OUTPUT_ENABLE_MODE; u32 dpi_c = DPI_ENABLE;
int ret; int ret;
/* Look up the connector attached to DPI so we can get the /* Look up the connector attached to DPI so we can get the
...@@ -182,15 +182,22 @@ static void vc4_dpi_encoder_enable(struct drm_encoder *encoder) ...@@ -182,15 +182,22 @@ static void vc4_dpi_encoder_enable(struct drm_encoder *encoder)
dpi_c |= VC4_SET_FIELD(DPI_FORMAT_24BIT_888_RGB, DPI_FORMAT); dpi_c |= VC4_SET_FIELD(DPI_FORMAT_24BIT_888_RGB, DPI_FORMAT);
} }
if (mode->flags & DRM_MODE_FLAG_NHSYNC) if (mode->flags & DRM_MODE_FLAG_CSYNC) {
dpi_c |= DPI_HSYNC_INVERT; if (mode->flags & DRM_MODE_FLAG_NCSYNC)
else if (!(mode->flags & DRM_MODE_FLAG_PHSYNC)) dpi_c |= DPI_OUTPUT_ENABLE_INVERT;
dpi_c |= DPI_HSYNC_DISABLE; } else {
dpi_c |= DPI_OUTPUT_ENABLE_MODE;
if (mode->flags & DRM_MODE_FLAG_NHSYNC)
dpi_c |= DPI_HSYNC_INVERT;
else if (!(mode->flags & DRM_MODE_FLAG_PHSYNC))
dpi_c |= DPI_HSYNC_DISABLE;
if (mode->flags & DRM_MODE_FLAG_NVSYNC) if (mode->flags & DRM_MODE_FLAG_NVSYNC)
dpi_c |= DPI_VSYNC_INVERT; dpi_c |= DPI_VSYNC_INVERT;
else if (!(mode->flags & DRM_MODE_FLAG_PVSYNC)) else if (!(mode->flags & DRM_MODE_FLAG_PVSYNC))
dpi_c |= DPI_VSYNC_DISABLE; dpi_c |= DPI_VSYNC_DISABLE;
}
DPI_WRITE(DPI_C, dpi_c); DPI_WRITE(DPI_C, dpi_c);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment