drm/i915/dsb: Allow vblank synchronized DSB execution
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 18 Jan 2023 16:30:33 +0000 (18:30 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 20 Feb 2023 20:54:51 +0000 (22:54 +0200)
Allow the caller to ask for the DSB commands to execute
during vblank.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230118163040.29808-7-ville.syrjala@linux.intel.com
Reviewed-by: Animesh Manna <animesh.manna@intel.com>
drivers/gpu/drm/i915/display/intel_color.c
drivers/gpu/drm/i915/display/intel_dsb.c
drivers/gpu/drm/i915/display/intel_dsb.h

index 2e7fbb2fe1e2a1d33dd351bf60e860643806b632..55ac476972c2dde013ae767416345bb02a366ed1 100644 (file)
@@ -1258,7 +1258,7 @@ static void icl_load_luts(const struct intel_crtc_state *crtc_state)
 
        if (crtc_state->dsb) {
                intel_dsb_finish(crtc_state->dsb);
-               intel_dsb_commit(crtc_state->dsb);
+               intel_dsb_commit(crtc_state->dsb, false);
                intel_dsb_wait(crtc_state->dsb);
        }
 }
index 9e25b1345927620e5da614b074c74d01c26c44e3..9fa75c72f7ad892f4f5cba954aaa9f3a100ada81 100644 (file)
@@ -221,10 +221,11 @@ void intel_dsb_finish(struct intel_dsb *dsb)
 /**
  * intel_dsb_commit() - Trigger workload execution of DSB.
  * @dsb: DSB context
+ * @wait_for_vblank: wait for vblank before executing
  *
  * This function is used to do actual write to hardware using DSB.
  */
-void intel_dsb_commit(struct intel_dsb *dsb)
+void intel_dsb_commit(struct intel_dsb *dsb, bool wait_for_vblank)
 {
        struct intel_crtc *crtc = dsb->crtc;
        struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
@@ -242,6 +243,7 @@ void intel_dsb_commit(struct intel_dsb *dsb)
        }
 
        intel_de_write(dev_priv, DSB_CTRL(pipe, dsb->id),
+                      (wait_for_vblank ? DSB_WAIT_FOR_VBLANK : 0) |
                       DSB_ENABLE);
        intel_de_write(dev_priv, DSB_HEAD(pipe, dsb->id),
                       i915_ggtt_offset(dsb->vma));
index 6b22499e8a5d84e3c11c8a3f1dbb41a03f16b1f8..b8148b47022dcde6c988dc0ae08b94c94666b940 100644 (file)
@@ -19,7 +19,8 @@ void intel_dsb_finish(struct intel_dsb *dsb);
 void intel_dsb_cleanup(struct intel_dsb *dsb);
 void intel_dsb_reg_write(struct intel_dsb *dsb,
                         i915_reg_t reg, u32 val);
-void intel_dsb_commit(struct intel_dsb *dsb);
+void intel_dsb_commit(struct intel_dsb *dsb,
+                     bool wait_for_vblank);
 void intel_dsb_wait(struct intel_dsb *dsb);
 
 #endif