aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h
diff options
context:
space:
mode:
authorSean Paul <seanpaul@chromium.org>2018-11-16 13:42:32 -0500
committerRob Clark <robdclark@gmail.com>2018-12-11 13:10:15 -0500
commita796ba2cb3dde3d155401e91e8341879de1248ec (patch)
tree87a1ee04d305227f9969737bd403af46e396be95 /drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h
parentdrm/msm: dpu: Don't bother checking ->enabled in dpu_crtc_vblank (diff)
downloadlinux-dev-a796ba2cb3dde3d155401e91e8341879de1248ec.tar.xz
linux-dev-a796ba2cb3dde3d155401e91e8341879de1248ec.zip
drm/msm: dpu: Separate crtc assignment from vblank enable
Instead of assigning/clearing the crtc on vblank enable/disable, we can just assign and clear the crtc on modeset. That allows us to just toggle the encoder's vblank interrupts on vblank_enable. So why is this important? Previously the driver was using the legacy pointers to assign/clear the crtc. Legacy pointers are cleared _after_ disabling the hardware, so the legacy pointer was valid during vblank_disable, but that's not something we should rely on. Instead of relying on the core ordering the legacy pointer assignments just so, we'll assign the crtc in dpu_crtc enable/disable. This is the only place that mapping can change, so we're covered there. We're also taking advantage of drm_crtc_vblank_on/off. By using this, we ensure that vblank_enable/disable can never be called while the crtc is off (which means the assigned crtc will always be valid). As such, we don't need to use modeset locks or the crtc_lock in the vblank_enable/disable routine to be sure state is consistent. ...I think. Changes in v2: - Changed crtc check in toggle_vblank to != (Jeykumar) Cc: Jeykumar Sankaran <jsanka@codeaurora.org> Reviewed-by: Jeykumar Sankaran <jsanka@codeaurora.org> Signed-off-by: Sean Paul <seanpaul@chromium.org> [dpu_crtc.c change needed to be manually applied b/c of the dpu_crtc_reset change] Signed-off-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to '')
-rw-r--r--drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h
index 9790bd1a31e0..3f5dafe00580 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h
@@ -63,6 +63,16 @@ void dpu_encoder_assign_crtc(struct drm_encoder *encoder,
struct drm_crtc *crtc);
/**
+ * dpu_encoder_toggle_vblank_for_crtc - Toggles vblank interrupts on or off if
+ * the encoder is assigned to the given crtc
+ * @encoder: encoder pointer
+ * @crtc: crtc pointer
+ * @enable: true if vblank should be enabled
+ */
+void dpu_encoder_toggle_vblank_for_crtc(struct drm_encoder *encoder,
+ struct drm_crtc *crtc, bool enable);
+
+/**
* dpu_encoder_register_frame_event_callback - provide callback to encoder that
* will be called after the request is complete, or other events.
* @encoder: encoder pointer