From: Ville Syrjälä <[email protected]>

We don't have a codepath that does the color LUT update via
MMIO while writing the double buffered registers via DSB/flip queue.
So if we fail to allocate the DSB buffer for the LUT update we have
to fall back to a full MMIO based update. Make it so.

If we hit this with the current code then the entire LUT update
is simply skipped. After the fix the entire update, including
the LUT, will happen.

This would have even oopsed intel_wait_for_vblank_workers()
had we not explicitly checked for !use_dsb in
intel_crtc_needs_vblank_work(). Now that we handle the error
correctly early on we can drop the confusing !use_dsb
check from intel_crtc_needs_vblank_work().

Signed-off-by: Ville Syrjälä <[email protected]>
---
 drivers/gpu/drm/i915/display/intel_color.c | 5 ++++-
 drivers/gpu/drm/i915/display/intel_crtc.c  | 3 +--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_color.c 
b/drivers/gpu/drm/i915/display/intel_color.c
index e7950655434b..f2e6b82968d2 100644
--- a/drivers/gpu/drm/i915/display/intel_color.c
+++ b/drivers/gpu/drm/i915/display/intel_color.c
@@ -2019,8 +2019,11 @@ void intel_color_prepare_commit(struct 
intel_atomic_state *state,
        else
                crtc_state->dsb_color = intel_dsb_prepare(state, crtc, 
INTEL_DSB_1, 1024);
 
-       if (!intel_color_uses_dsb(crtc_state))
+       if (!intel_color_uses_dsb(crtc_state)) {
+               crtc_state->use_flipq = false;
+               crtc_state->use_dsb = false;
                return;
+       }
 
        display->funcs.color->load_luts(crtc_state);
 
diff --git a/drivers/gpu/drm/i915/display/intel_crtc.c 
b/drivers/gpu/drm/i915/display/intel_crtc.c
index 778ebc5095c3..3fbf25b2e88a 100644
--- a/drivers/gpu/drm/i915/display/intel_crtc.c
+++ b/drivers/gpu/drm/i915/display/intel_crtc.c
@@ -449,8 +449,7 @@ static bool intel_crtc_needs_vblank_work(const struct 
intel_crtc_state *crtc_sta
                !intel_crtc_needs_modeset(crtc_state) &&
                (intel_crtc_needs_color_update(crtc_state) &&
                 !HAS_DOUBLE_BUFFERED_LUT(display)) &&
-               !intel_color_uses_dsb(crtc_state) &&
-               !crtc_state->use_dsb;
+               !intel_color_uses_dsb(crtc_state);
 }
 
 static void intel_crtc_vblank_work(struct kthread_work *base)
-- 
2.51.2

Reply via email to