Skip to content

Commit

Permalink
vc4/hdmi: Update MAI_THR for D0
Browse files Browse the repository at this point in the history
2712D0 has increased the fifo sizes of MAI_THR blocks,
resulting in adjusted bit offsets. Handle that.

Signed-off-by: Dom Cobley <[email protected]>
  • Loading branch information
popcornmix authored and pelwell committed Jan 15, 2024
1 parent 800de6c commit 05598d0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/gpu/drm/vc4/vc4_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -2597,7 +2597,13 @@ static int vc4_hdmi_audio_prepare(struct device *dev, void *data,
VC4_HDMI_AUDIO_PACKET_CEA_MASK);

/* Set the MAI threshold */
if (vc4->gen >= VC4_GEN_5)
if (vc4->gen >= VC4_GEN_5 && vc4->step_d0)
HDMI_WRITE(HDMI_MAI_THR,
VC4_SET_FIELD(0x10, VC4_D0_HD_MAI_THR_PANICHIGH) |
VC4_SET_FIELD(0x10, VC4_D0_HD_MAI_THR_PANICLOW) |
VC4_SET_FIELD(0x1c, VC4_D0_HD_MAI_THR_DREQHIGH) |
VC4_SET_FIELD(0x1c, VC4_D0_HD_MAI_THR_DREQLOW));
else if (vc4->gen >= VC4_GEN_5)
HDMI_WRITE(HDMI_MAI_THR,
VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_PANICHIGH) |
VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_PANICLOW) |
Expand Down
9 changes: 9 additions & 0 deletions drivers/gpu/drm/vc4/vc4_regs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1039,6 +1039,15 @@ enum {
# define VC4_HD_MAI_THR_DREQLOW_MASK VC4_MASK(5, 0)
# define VC4_HD_MAI_THR_DREQLOW_SHIFT 0

# define VC4_D0_HD_MAI_THR_PANICHIGH_MASK VC4_MASK(29, 23)
# define VC4_D0_HD_MAI_THR_PANICHIGH_SHIFT 23
# define VC4_D0_HD_MAI_THR_PANICLOW_MASK VC4_MASK(21, 15)
# define VC4_D0_HD_MAI_THR_PANICLOW_SHIFT 15
# define VC4_D0_HD_MAI_THR_DREQHIGH_MASK VC4_MASK(13, 7)
# define VC4_D0_HD_MAI_THR_DREQHIGH_SHIFT 7
# define VC4_D0_HD_MAI_THR_DREQLOW_MASK VC4_MASK(6, 0)
# define VC4_D0_HD_MAI_THR_DREQLOW_SHIFT 0

/* Divider from HDMI HSM clock to MAI serial clock. Sampling period
* converges to N / (M + 1) cycles.
*/
Expand Down

0 comments on commit 05598d0

Please sign in to comment.