]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/i915/dsb: Provide intel_dsb_head() and intel_dsb_size()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 12 Jun 2025 14:50:14 +0000 (17:50 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 17 Jun 2025 16:12:08 +0000 (19:12 +0300)
The upcoming flip queue implementation will need to know the
DSB buffer head and size. Expose those outside intel_dsb.c.

Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250612145018.8735-3-ville.syrjala@linux.intel.com
drivers/gpu/drm/i915/display/intel_dsb.c
drivers/gpu/drm/i915/display/intel_dsb.h

index 96baef5d5b1adfe4114d09152bb35e449c40640e..50d8c4900644a9642a4f6850ec01a5cfc5a1c8ab 100644 (file)
@@ -241,14 +241,19 @@ static bool is_dsb_busy(struct intel_display *display, enum pipe pipe,
        return intel_de_read_fw(display, DSB_CTRL(pipe, dsb_id)) & DSB_STATUS_BUSY;
 }
 
-static unsigned int intel_dsb_head(struct intel_dsb *dsb)
+unsigned int intel_dsb_size(struct intel_dsb *dsb)
+{
+       return dsb->free_pos * 4;
+}
+
+unsigned int intel_dsb_head(struct intel_dsb *dsb)
 {
        return intel_dsb_buffer_ggtt_offset(&dsb->dsb_buf);
 }
 
 static unsigned int intel_dsb_tail(struct intel_dsb *dsb)
 {
-       return intel_dsb_buffer_ggtt_offset(&dsb->dsb_buf) + dsb->free_pos * 4;
+       return intel_dsb_buffer_ggtt_offset(&dsb->dsb_buf) + intel_dsb_size(dsb);
 }
 
 static void intel_dsb_ins_align(struct intel_dsb *dsb)
index 6900acd603b8660e99205755e19261f334336526..ab64897498666e92d8b9490847ab38c05f91b5c7 100644 (file)
@@ -26,6 +26,8 @@ enum intel_dsb_id {
        I915_MAX_DSBS,
 };
 
+unsigned int intel_dsb_size(struct intel_dsb *dsb);
+unsigned int intel_dsb_head(struct intel_dsb *dsb);
 struct intel_dsb *intel_dsb_prepare(struct intel_atomic_state *state,
                                    struct intel_crtc *crtc,
                                    enum intel_dsb_id dsb_id,