drm/i915: Don't do the WM0->WM1 copy w/a if WM1 is already enabled
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 31 Jan 2023 00:21:24 +0000 (02:21 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Feb 2023 18:11:45 +0000 (19:11 +0100)
commitd05b72328810897a28fe313735481789edfef7e4
tree9a2c25525aa5eebca442f4b1f6ffaa12b79a306d
parent16da5f6d38ac35a2b598df5acf45b03c2eb1211a
drm/i915: Don't do the WM0->WM1 copy w/a if WM1 is already enabled

[ Upstream commit 90d5e8301ac24550be80d193aa5582cab56c29fc ]

Due to a workaround we have to make sure the WM1 watermarks block/lines
values are sensible even when WM1 is disabled. To that end we copy those
values from WM0.

However since we now keep each wm level enabled on a per-plane basis
it doesn't seem necessary to do that copy when we already have an
enabled WM1 on the current plane. That is, we might be in a situation
where another plane can only do WM0 (and thus needs the copy) but
the current plane's WM1 is still perfectly valid (ie. fits into the
current DDB allocation).

Skipping the copy could avoid reprogramming the plane's registers
needlessly in some cases.

Fixes: a301cb0fca2d ("drm/i915: Keep plane watermarks enabled more aggressively")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230131002127.29305-1-ville.syrjala@linux.intel.com
Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
(cherry picked from commit c580c2d27ac8754cc6f01da1d715b7272f5f9cbb)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/i915/display/skl_watermark.c