mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
drm/vc4: Add option to call from crtc to encoder on vblank
DSI0 is misbehaving and needs to action things on vblank to work around it. Add a new hook to call across during vblank. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
This commit is contained in:
committed by
Dom Cobley
parent
810b31ee8a
commit
d96ff61392
@@ -811,11 +811,14 @@ static void vc4_disable_vblank(struct drm_crtc *crtc)
|
||||
{
|
||||
struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);
|
||||
struct drm_device *dev = crtc->dev;
|
||||
struct drm_encoder *encoder = vc4_get_crtc_encoder(crtc, crtc->state);
|
||||
struct vc4_encoder *vc4_encoder = to_vc4_encoder(encoder);
|
||||
int idx;
|
||||
|
||||
if (!drm_dev_enter(dev, &idx))
|
||||
return;
|
||||
|
||||
if (!vc4_encoder || vc4_encoder->type != VC4_ENCODER_TYPE_DSI0)
|
||||
CRTC_WRITE(PV_INTEN, 0);
|
||||
|
||||
drm_dev_exit(idx);
|
||||
@@ -861,7 +864,14 @@ static void vc4_crtc_handle_page_flip(struct vc4_crtc *vc4_crtc)
|
||||
|
||||
void vc4_crtc_handle_vblank(struct vc4_crtc *crtc)
|
||||
{
|
||||
struct drm_encoder *encoder = vc4_get_crtc_encoder(&crtc->base, crtc->base.state);
|
||||
struct vc4_encoder *vc4_encoder = to_vc4_encoder(encoder);
|
||||
|
||||
crtc->t_vblank = ktime_get();
|
||||
|
||||
if (vc4_encoder && vc4_encoder->vblank)
|
||||
vc4_encoder->vblank(encoder);
|
||||
|
||||
drm_crtc_handle_vblank(&crtc->base);
|
||||
vc4_crtc_handle_page_flip(crtc);
|
||||
}
|
||||
|
||||
@@ -491,6 +491,7 @@ struct vc4_encoder {
|
||||
|
||||
void (*post_crtc_disable)(struct drm_encoder *encoder, struct drm_atomic_state *state);
|
||||
void (*post_crtc_powerdown)(struct drm_encoder *encoder, struct drm_atomic_state *state);
|
||||
void (*vblank)(struct drm_encoder *encoder);
|
||||
};
|
||||
|
||||
#define to_vc4_encoder(_encoder) \
|
||||
|
||||
Reference in New Issue
Block a user