Skip to content

Commit b7b5191

Browse files
6by9popcornmix
authored andcommitted
drm/vc4: Support the VEC in FKMS
Extends the DPI/DSI support to also report the VEC output which supports interlacing too. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
1 parent c67f7fb commit b7b5191

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

‎drivers/gpu/drm/vc4/vc4_firmware_kms.c‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ struct set_timings {
128128
#define TIMINGS_FLAGS_H_SYNC_NEG 0
129129
#define TIMINGS_FLAGS_V_SYNC_POS BIT(1)
130130
#define TIMINGS_FLAGS_V_SYNC_NEG 0
131+
#define TIMINGS_FLAGS_INTERLACE BIT(2)
131132

132133
#define TIMINGS_FLAGS_ASPECT_MASK GENMASK(7, 4)
133134
#define TIMINGS_FLAGS_ASPECT_NONE (0 << 4)
@@ -1043,6 +1044,12 @@ static int vc4_fkms_lcd_connector_get_modes(struct drm_connector *connector)
10431044
fw_mode.flags |= DRM_MODE_FLAG_PVSYNC;
10441045
else
10451046
fw_mode.flags |= DRM_MODE_FLAG_NVSYNC;
1047+
if (mb.timings.flags & TIMINGS_FLAGS_V_SYNC_POS)
1048+
fw_mode.flags |= DRM_MODE_FLAG_PVSYNC;
1049+
else
1050+
fw_mode.flags |= DRM_MODE_FLAG_NVSYNC;
1051+
if (mb.timings.flags & TIMINGS_FLAGS_INTERLACE)
1052+
fw_mode.flags |= DRM_MODE_FLAG_INTERLACE;
10461053

10471054
mode = drm_mode_duplicate(connector->dev,
10481055
&fw_mode);
@@ -1127,17 +1134,24 @@ vc4_fkms_connector_init(struct drm_device *dev, struct drm_encoder *encoder,
11271134
DRM_MODE_CONNECTOR_DSI);
11281135
drm_connector_helper_add(connector,
11291136
&vc4_fkms_lcd_conn_helper_funcs);
1137+
connector->interlace_allowed = 0;
1138+
} else if (fkms_connector->display_type == DRM_MODE_ENCODER_TVDAC) {
1139+
drm_connector_init(dev, connector, &vc4_fkms_connector_funcs,
1140+
DRM_MODE_CONNECTOR_Composite);
1141+
drm_connector_helper_add(connector,
1142+
&vc4_fkms_lcd_conn_helper_funcs);
1143+
connector->interlace_allowed = 1;
11301144
} else {
11311145
drm_connector_init(dev, connector, &vc4_fkms_connector_funcs,
11321146
DRM_MODE_CONNECTOR_HDMIA);
11331147
drm_connector_helper_add(connector,
11341148
&vc4_fkms_connector_helper_funcs);
1149+
connector->interlace_allowed = 0;
11351150
}
11361151

11371152
connector->polled = (DRM_CONNECTOR_POLL_CONNECT |
11381153
DRM_CONNECTOR_POLL_DISCONNECT);
11391154

1140-
connector->interlace_allowed = 0;
11411155
connector->doublescan_allowed = 0;
11421156

11431157
drm_connector_attach_encoder(connector, encoder);

0 commit comments

Comments
 (0)