]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/i915/dsb: Pass DSB engine ID to intel_dsb_prepare()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 31 May 2024 11:41:00 +0000 (14:41 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 5 Jun 2024 09:45:34 +0000 (12:45 +0300)
Allow the caller of intel_dsb_prepare() to determine which DSB
engine (out of the three possible per pipe) to use. This will
let us utilize multiple DSB engines during the same commit.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240531114101.19994-4-ville.syrjala@linux.intel.com
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@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 9173caba3f0f56b3eaeed169aa38780933a5d7ed..98553e8a51490863791e3c5e6a2ace71939e9245 100644 (file)
@@ -1914,7 +1914,7 @@ void intel_color_prepare_commit(struct intel_crtc_state *crtc_state)
        if (!crtc_state->pre_csc_lut && !crtc_state->post_csc_lut)
                return;
 
-       crtc_state->dsb = intel_dsb_prepare(crtc_state, 1024);
+       crtc_state->dsb = intel_dsb_prepare(crtc_state, INTEL_DSB_0, 1024);
        if (!crtc_state->dsb)
                return;
 
index 75ac780d66bf06f02cd576d536643e6692e2a39c..5180b972204619e368e9b65e1f6e37a2b3a3e824 100644 (file)
@@ -435,6 +435,7 @@ void intel_dsb_wait(struct intel_dsb *dsb)
 /**
  * intel_dsb_prepare() - Allocate, pin and map the DSB command buffer.
  * @crtc_state: the CRTC state
+ * @dsb_id: the DSB engine to use
  * @max_cmds: number of commands we need to fit into command buffer
  *
  * This function prepare the command buffer which is used to store dsb
@@ -444,6 +445,7 @@ void intel_dsb_wait(struct intel_dsb *dsb)
  * DSB context, NULL on failure
  */
 struct intel_dsb *intel_dsb_prepare(const struct intel_crtc_state *crtc_state,
+                                   enum intel_dsb_id dsb_id,
                                    unsigned int max_cmds)
 {
        struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
@@ -473,7 +475,7 @@ struct intel_dsb *intel_dsb_prepare(const struct intel_crtc_state *crtc_state,
 
        intel_runtime_pm_put(&i915->runtime_pm, wakeref);
 
-       dsb->id = INTEL_DSB_0;
+       dsb->id = dsb_id;
        dsb->crtc = crtc;
        dsb->size = size / 4; /* in dwords */
        dsb->free_pos = 0;
@@ -488,7 +490,7 @@ out_put_rpm:
 out:
        drm_info_once(&i915->drm,
                      "[CRTC:%d:%s] DSB %d queue setup failed, will fallback to MMIO for display HW programming\n",
-                     crtc->base.base.id, crtc->base.name, INTEL_DSB_0);
+                     crtc->base.base.id, crtc->base.name, dsb_id);
 
        return NULL;
 }
index 5d7561ea65fa7400ccc54f9daa744a2fc50b0a62..36fdb130af6e11fa58269d3a46b55e9d681270a3 100644 (file)
@@ -23,6 +23,7 @@ enum intel_dsb_id {
 };
 
 struct intel_dsb *intel_dsb_prepare(const struct intel_crtc_state *crtc_state,
+                                   enum intel_dsb_id dsb_id,
                                    unsigned int max_cmds);
 void intel_dsb_finish(struct intel_dsb *dsb);
 void intel_dsb_cleanup(struct intel_dsb *dsb);