diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2024-06-24 21:10:26 +0200 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2024-08-29 13:54:03 +0200 |
commit | 8d5ac8efb6d94efda53f604fd9c072b4754a3d85 (patch) | |
tree | 6de1a279fcf1d94fc66252c763c38d406cfe683f | |
parent | drm/i915/dsb: Account for VRR properly in DSB scanline stuff (diff) | |
download | linux-8d5ac8efb6d94efda53f604fd9c072b4754a3d85.tar.xz linux-8d5ac8efb6d94efda53f604fd9c072b4754a3d85.zip |
drm/i915/dsb: Precompute DSB_CHICKEN
Adjust the code that determines the correct DSB_CHICKEN value
to be usable for use within DSB commands themselves. Ie.
precompute it based on our knowledge of what the hardware state
(VRR vs. not mainly) will be at the time of the commit.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240624191032.27333-9-ville.syrjala@linux.intel.com
Reviewed-by: Animesh Manna <animesh.manna@intel.com>
-rw-r--r-- | drivers/gpu/drm/i915/display/intel_dsb.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_dsb.c b/drivers/gpu/drm/i915/display/intel_dsb.c index 2c7c21c69ad6..779ba7eb8042 100644 --- a/drivers/gpu/drm/i915/display/intel_dsb.c +++ b/drivers/gpu/drm/i915/display/intel_dsb.c @@ -43,6 +43,7 @@ struct intel_dsb { */ unsigned int ins_start_offset; + u32 chicken; int hw_dewake_scanline; }; @@ -149,9 +150,10 @@ static int dsb_scanline_to_hw(struct intel_atomic_state *state, return (scanline + vtotal - intel_crtc_scanline_offset(crtc_state)) % vtotal; } -static u32 dsb_chicken(struct intel_crtc *crtc) +static u32 dsb_chicken(struct intel_atomic_state *state, + struct intel_crtc *crtc) { - if (crtc->mode_flags & I915_MODE_FLAG_VRR) + if (pre_commit_is_vrr_active(state, crtc)) return DSB_SKIP_WAITS_EN | DSB_CTRL_WAIT_SAFE_WINDOW | DSB_CTRL_NO_WAIT_VBLANK | @@ -447,7 +449,7 @@ static void _intel_dsb_commit(struct intel_dsb *dsb, u32 ctrl, ctrl | DSB_ENABLE); intel_de_write_fw(display, DSB_CHICKEN(pipe, dsb->id), - dsb_chicken(crtc)); + dsb->chicken); intel_de_write_fw(display, DSB_INTERRUPT(pipe, dsb->id), dsb_error_int_status(display) | DSB_PROG_INT_STATUS | @@ -578,6 +580,7 @@ struct intel_dsb *intel_dsb_prepare(struct intel_atomic_state *state, dsb->free_pos = 0; dsb->ins_start_offset = 0; + dsb->chicken = dsb_chicken(state, crtc); dsb->hw_dewake_scanline = dsb_scanline_to_hw(state, crtc, dsb_dewake_scanline(state, crtc)); |