Skip to content

Commit 5053121

Browse files
committed
drm/i915/dsb: Add support for non-posted DSB registers writes
Writing specific transcoder registers (and as it turns out, the legacy LUT as well) via DSB needs a magic sequence to emit non-posted register writes. Add a helper for this. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230606191504.18099-11-ville.syrjala@linux.intel.com Reviewed-by: Uma Shankar <uma.shankar@intel.com>
1 parent e39845d commit 5053121

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,26 @@ void intel_dsb_noop(struct intel_dsb *dsb, int count)
261261
DSB_OPCODE_NOOP << DSB_OPCODE_SHIFT);
262262
}
263263

264+
void intel_dsb_nonpost_start(struct intel_dsb *dsb)
265+
{
266+
struct intel_crtc *crtc = dsb->crtc;
267+
enum pipe pipe = crtc->pipe;
268+
269+
intel_dsb_reg_write_masked(dsb, DSB_CTRL(pipe, dsb->id),
270+
DSB_NON_POSTED, DSB_NON_POSTED);
271+
intel_dsb_noop(dsb, 4);
272+
}
273+
274+
void intel_dsb_nonpost_end(struct intel_dsb *dsb)
275+
{
276+
struct intel_crtc *crtc = dsb->crtc;
277+
enum pipe pipe = crtc->pipe;
278+
279+
intel_dsb_reg_write_masked(dsb, DSB_CTRL(pipe, dsb->id),
280+
DSB_NON_POSTED, 0);
281+
intel_dsb_noop(dsb, 4);
282+
}
283+
264284
static void intel_dsb_align_tail(struct intel_dsb *dsb)
265285
{
266286
u32 aligned_tail, tail;

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ void intel_dsb_reg_write(struct intel_dsb *dsb,
2222
void intel_dsb_reg_write_masked(struct intel_dsb *dsb,
2323
i915_reg_t reg, u32 mask, u32 val);
2424
void intel_dsb_noop(struct intel_dsb *dsb, int count);
25+
void intel_dsb_nonpost_start(struct intel_dsb *dsb);
26+
void intel_dsb_nonpost_end(struct intel_dsb *dsb);
27+
2528
void intel_dsb_commit(struct intel_dsb *dsb,
2629
bool wait_for_vblank);
2730
void intel_dsb_wait(struct intel_dsb *dsb);

0 commit comments

Comments
 (0)