Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions drivers/gpu/drm/vc4/vc4_crtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,20 @@ static bool vc4_crtc_get_scanout_position(struct drm_crtc *crtc,
*hpos = 0;

if (mode->flags & DRM_MODE_FLAG_INTERLACE) {
bool field;

*vpos /= 2;

/* Use hpos to correct for field offset in interlaced mode. */
if (vc4_hvs_get_fifo_frame_count(hvs, channel) % 2)
if (vc4->gen >= VC4_GEN_6_C)
field = val & SCALER6_DISPX_STATUS_OFIELD;
else
field = val & SCALER_DISPSTATX_FIELD;

/*
* Use hpos to correct for field offset in interlaced mode.
* The offset applies when the field bit is clear.
*/
if (!field)
*hpos += mode->crtc_htotal / 2;
}

Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/vc4/vc4_regs.h
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,7 @@
# define SCALER_DISPSTATX_MODE_EOF 3
# define SCALER_DISPSTATX_FULL BIT(29)
# define SCALER_DISPSTATX_EMPTY BIT(28)
# define SCALER_DISPSTATX_FIELD BIT(27)
# define SCALER_DISPSTATX_LINE_MASK VC4_MASK(11, 0)
# define SCALER_DISPSTATX_LINE_SHIFT 0

Expand Down
Loading