mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-02-27 12:55:59 -05:00
drm/i915/dsb: Introduce intel_dsb_poll()
Add a function for emitting a DSB poll instruction. We'll allow the caller to specify the poll parameters. v2: s/wait/wait_us/ (Ankit) Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250207223159.14132-6-ville.syrjala@linux.intel.com
This commit is contained in:
@@ -459,6 +459,25 @@ void intel_dsb_wait_scanline_out(struct intel_atomic_state *state,
|
||||
start, end);
|
||||
}
|
||||
|
||||
void intel_dsb_poll(struct intel_dsb *dsb,
|
||||
i915_reg_t reg, u32 mask, u32 val,
|
||||
int wait_us, int count)
|
||||
{
|
||||
struct intel_crtc *crtc = dsb->crtc;
|
||||
enum pipe pipe = crtc->pipe;
|
||||
|
||||
intel_dsb_reg_write(dsb, DSB_POLLMASK(pipe, dsb->id), mask);
|
||||
intel_dsb_reg_write(dsb, DSB_POLLFUNC(pipe, dsb->id),
|
||||
DSB_POLL_ENABLE |
|
||||
DSB_POLL_WAIT(wait_us) | DSB_POLL_COUNT(count));
|
||||
|
||||
intel_dsb_noop(dsb, 5);
|
||||
|
||||
intel_dsb_emit(dsb, val,
|
||||
(DSB_OPCODE_POLL << DSB_OPCODE_SHIFT) |
|
||||
i915_mmio_reg_offset(reg));
|
||||
}
|
||||
|
||||
static void intel_dsb_align_tail(struct intel_dsb *dsb)
|
||||
{
|
||||
u32 aligned_tail, tail;
|
||||
|
||||
@@ -54,6 +54,9 @@ void intel_dsb_wait_scanline_out(struct intel_atomic_state *state,
|
||||
int lower, int upper);
|
||||
void intel_dsb_vblank_evade(struct intel_atomic_state *state,
|
||||
struct intel_dsb *dsb);
|
||||
void intel_dsb_poll(struct intel_dsb *dsb,
|
||||
i915_reg_t reg, u32 mask, u32 val,
|
||||
int wait_us, int count);
|
||||
void intel_dsb_chain(struct intel_atomic_state *state,
|
||||
struct intel_dsb *dsb,
|
||||
struct intel_dsb *chained_dsb,
|
||||
|
||||
Reference in New Issue
Block a user