mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 18:09:56 +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
Phil Elwell
parent
ec198c390e
commit
63c0bcc4b7
@@ -827,12 +827,15 @@ static void vc4_disable_vblank(struct drm_crtc *crtc)
|
|||||||
{
|
{
|
||||||
struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);
|
struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);
|
||||||
struct drm_device *dev = crtc->dev;
|
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;
|
int idx;
|
||||||
|
|
||||||
if (!drm_dev_enter(dev, &idx))
|
if (!drm_dev_enter(dev, &idx))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
CRTC_WRITE(PV_INTEN, 0);
|
if (vc4_encoder->type != VC4_ENCODER_TYPE_DSI0)
|
||||||
|
CRTC_WRITE(PV_INTEN, 0);
|
||||||
|
|
||||||
drm_dev_exit(idx);
|
drm_dev_exit(idx);
|
||||||
}
|
}
|
||||||
@@ -877,7 +880,14 @@ static void vc4_crtc_handle_page_flip(struct vc4_crtc *vc4_crtc)
|
|||||||
|
|
||||||
void vc4_crtc_handle_vblank(struct vc4_crtc *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();
|
crtc->t_vblank = ktime_get();
|
||||||
|
|
||||||
|
if (vc4_encoder && vc4_encoder->vblank)
|
||||||
|
vc4_encoder->vblank(encoder);
|
||||||
|
|
||||||
drm_crtc_handle_vblank(&crtc->base);
|
drm_crtc_handle_vblank(&crtc->base);
|
||||||
vc4_crtc_handle_page_flip(crtc);
|
vc4_crtc_handle_page_flip(crtc);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -503,6 +503,7 @@ struct vc4_encoder {
|
|||||||
|
|
||||||
void (*post_crtc_disable)(struct drm_encoder *encoder, struct drm_atomic_state *state);
|
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 (*post_crtc_powerdown)(struct drm_encoder *encoder, struct drm_atomic_state *state);
|
||||||
|
void (*vblank)(struct drm_encoder *encoder);
|
||||||
};
|
};
|
||||||
|
|
||||||
#define to_vc4_encoder(_encoder) \
|
#define to_vc4_encoder(_encoder) \
|
||||||
|
|||||||
Reference in New Issue
Block a user