Skip to content

Commit

Permalink
drm/vc4: Set TV margins on the composite connector state
Browse files Browse the repository at this point in the history
The Raspberry Pi bootloader can pass a set of margin values to the
kernel cmdline as part of the video= option. These should result in
black borders on the output to compensate for TVs where the visible area
on the screen is smaller than the full extents of the video image.

With the VC4 driver this currently works on an HDMI connector, but not
on a composite video connector.

The TV margins from the kernel cmdline are available in the
drm_cmdline_mode structure of the composite video connector. Apply them
to the connector state in the connector reset function. This is how it
is implemented for the VC4 HDMI connector.

Signed-off-by: Michael Büchler <[email protected]>
  • Loading branch information
sly547 authored and pelwell committed Nov 24, 2023
1 parent 7c185b1 commit bc76ab2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/gpu/drm/vc4/vc4_vec.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,9 @@ static void vc4_vec_connector_reset(struct drm_connector *connector)
/* preserve TV standard */
if (connector->state)
connector->state->tv.mode = vc4_vec_get_default_mode(connector);

/* apply TV margins from the cmdline_mode */
drm_atomic_helper_connector_tv_reset(connector);
}

static int vc4_vec_connector_atomic_check(struct drm_connector *conn,
Expand Down Expand Up @@ -483,6 +486,8 @@ static int vc4_vec_connector_init(struct drm_device *dev, struct vc4_vec *vec)

drm_connector_helper_add(connector, &vc4_vec_connector_helper_funcs);

drm_connector_attach_tv_margin_properties(connector);

drm_object_attach_property(&connector->base,
dev->mode_config.tv_mode_property,
vc4_vec_get_default_mode(connector));
Expand Down

0 comments on commit bc76ab2

Please sign in to comment.