Skip to content

Commit 7e151f5

Browse files
committed
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 <[email protected]> Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent ed9434c commit 7e151f5

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

drivers/gpu/drm/i915/display/intel_dsb.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,14 +241,19 @@ static bool is_dsb_busy(struct intel_display *display, enum pipe pipe,
241241
return intel_de_read_fw(display, DSB_CTRL(pipe, dsb_id)) & DSB_STATUS_BUSY;
242242
}
243243

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)
245250
{
246251
return intel_dsb_buffer_ggtt_offset(&dsb->dsb_buf);
247252
}
248253

249254
static unsigned int intel_dsb_tail(struct intel_dsb *dsb)
250255
{
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);
252257
}
253258

254259
static void intel_dsb_ins_align(struct intel_dsb *dsb)

drivers/gpu/drm/i915/display/intel_dsb.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ enum intel_dsb_id {
2626
I915_MAX_DSBS,
2727
};
2828

29+
unsigned int intel_dsb_size(struct intel_dsb *dsb);
30+
unsigned int intel_dsb_head(struct intel_dsb *dsb);
2931
struct intel_dsb *intel_dsb_prepare(struct intel_atomic_state *state,
3032
struct intel_crtc *crtc,
3133
enum intel_dsb_id dsb_id,

0 commit comments

Comments
 (0)