drm/vc4: hvs: Fix frame count register readout
authorMaxime Ripard <maxime@cerno.tech>
Thu, 17 Feb 2022 09:55:26 +0000 (10:55 +0100)
committerDom Cobley <popcornmix@gmail.com>
Mon, 21 Mar 2022 16:04:45 +0000 (16:04 +0000)
commit7e36e4f8a53d7bd4770a04478ae7a2d507643a1b
tree4a52f6bed5cc62b0088b4880e270afb9b9803d9c
parent1626186c018f3e8cb83c354a9f0b3f283855ec25
drm/vc4: hvs: Fix frame count register readout

In order to get the field currently being output, the driver has been
using the display FIFO frame count in the HVS, reading a 6-bit field at
the offset 12 in the DISPSTATx register.

While that field is indeed at that location for the FIFO 1 and 2, the
one for the FIFO0 is actually in the DISPSTAT1 register, at the offset
18.

Fixes: e538092cb15c ("drm/vc4: Enable precise vblank timestamping for interlaced modes.")
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
drivers/gpu/drm/vc4/vc4_crtc.c
drivers/gpu/drm/vc4/vc4_drv.h
drivers/gpu/drm/vc4/vc4_hvs.c
drivers/gpu/drm/vc4/vc4_regs.h