Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/i915/dsb: Provide intel_dsb_head() and intel_dsb_size()

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

+9 -2
+7 -2
drivers/gpu/drm/i915/display/intel_dsb.c
··· 241 241 return intel_de_read_fw(display, DSB_CTRL(pipe, dsb_id)) & DSB_STATUS_BUSY; 242 242 } 243 243 244 - static unsigned int intel_dsb_head(struct intel_dsb *dsb) 244 + unsigned int intel_dsb_size(struct intel_dsb *dsb) 245 + { 246 + return dsb->free_pos * 4; 247 + } 248 + 249 + unsigned int intel_dsb_head(struct intel_dsb *dsb) 245 250 { 246 251 return intel_dsb_buffer_ggtt_offset(&dsb->dsb_buf); 247 252 } 248 253 249 254 static unsigned int intel_dsb_tail(struct intel_dsb *dsb) 250 255 { 251 - return intel_dsb_buffer_ggtt_offset(&dsb->dsb_buf) + dsb->free_pos * 4; 256 + return intel_dsb_buffer_ggtt_offset(&dsb->dsb_buf) + intel_dsb_size(dsb); 252 257 } 253 258 254 259 static void intel_dsb_ins_align(struct intel_dsb *dsb)
+2
drivers/gpu/drm/i915/display/intel_dsb.h
··· 26 26 I915_MAX_DSBS, 27 27 }; 28 28 29 + unsigned int intel_dsb_size(struct intel_dsb *dsb); 30 + unsigned int intel_dsb_head(struct intel_dsb *dsb); 29 31 struct intel_dsb *intel_dsb_prepare(struct intel_atomic_state *state, 30 32 struct intel_crtc *crtc, 31 33 enum intel_dsb_id dsb_id,