> Subject: [PATCH v2 05/10] drm/i915/cmtg: program set context latency of > cmtg
* CMTG > > Program context latency for delayed vblank timings to create window2. > Bspec link > Signed-off-by: Animesh Manna <[email protected]> > --- > drivers/gpu/drm/i915/display/intel_cmtg.c | 4 ++++ > drivers/gpu/drm/i915/display/intel_cmtg_regs.h | 2 ++ > 2 files changed, 6 insertions(+) > > diff --git a/drivers/gpu/drm/i915/display/intel_cmtg.c > b/drivers/gpu/drm/i915/display/intel_cmtg.c > index 26adf70cdd00..cb1376f4c13f 100644 > --- a/drivers/gpu/drm/i915/display/intel_cmtg.c > +++ b/drivers/gpu/drm/i915/display/intel_cmtg.c > @@ -236,10 +236,14 @@ static void intel_cmtg_set_timings(const struct > intel_crtc_state *crtc_state) > > void intel_cmtg_enable(const struct intel_crtc_state *crtc_state) { > + struct intel_display *display = to_intel_display(crtc_state); > enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; > > if (cpu_transcoder != TRANSCODER_A && cpu_transcoder != > TRANSCODER_B) > return; > > intel_cmtg_set_timings(crtc_state); > + > + intel_de_write(display, > TRANS_SET_CTX_LATENCY_CMTG(cpu_transcoder), > + intel_de_read(display, > TRANS_SET_CONTEXT_LATENCY(display, > +cpu_transcoder))); So at least three things need to change here: - We are actively trying to move away from doing inline intel_de_reads like this with arguments passed to function. - We also try not to read from HW and write back to HW . We need to write our derived S/w value to HW. Readback needs to only be for verification purpose. We only use H/w read when we are sort of out of options on a viable solution to derive the value at that place. >From what I can see since you are using the exact values that is coded in >TRANS_CONTEXT_LATENCY your work can be done by crtc_state->set_context_latency - This belongs in intel_cmtg_set_timings (which I said before needs to be called from intel_set_transcoder_timings ( Also I think you should rename function to intel_cmtg_set_transcoder_timings)) > } > diff --git a/drivers/gpu/drm/i915/display/intel_cmtg_regs.h > b/drivers/gpu/drm/i915/display/intel_cmtg_regs.h > index eab90415d0da..3cfd8eedb321 100644 > --- a/drivers/gpu/drm/i915/display/intel_cmtg_regs.h > +++ b/drivers/gpu/drm/i915/display/intel_cmtg_regs.h > @@ -32,4 +32,6 @@ > #define TRANS_VRR_VMIN_CMTG(id) _MMIO(0x6F434 + (id) * > 0x100) > #define TRANS_VRR_FLIPLINE_CMTG(id) _MMIO(0x6F438 + (id) * > 0x100) > > +#define TRANS_SET_CTX_LATENCY_CMTG(id) _MMIO(0x6F07C + (id) * > 0x100) > + Usually we call this index instead of id Regards, Suraj Kandpal > #endif /* __INTEL_CMTG_REGS_H__ */ > -- > 2.29.0
