drm/i915/display/psr: Use drm damage helpers to calculate plane damaged area
authorJosé Roberto de Souza <jose.souza@intel.com>
Tue, 14 Sep 2021 21:25:06 +0000 (14:25 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Mar 2023 12:31:25 +0000 (13:31 +0100)
commit8c80b12e697f14e8cae04182f6594f0f33c21d52
tree2f51577c8082fd04c5fdb3b8caf8a720d2c3409b
parenteea001d88ffda3b874c1c7b8fc75be5085946bf9
drm/i915/display/psr: Use drm damage helpers to calculate plane damaged area

[ Upstream commit af7ea1e22afc7ce7773b2e4562df4370c8c711ea ]

drm_atomic_helper_damage_iter_init() + drm_atomic_for_each_plane_damage()
returns the full plane area in case no damaged area was set by
userspace or it was discarted by driver.

This is important to fix the rendering of userspace applications that
does frontbuffer rendering and notify driver about dirty areas but do
not set any dirty clips.

With this we don't need to worry about to check and mark the whole
area as damaged in page flips.

Another important change here is the move of
drm_atomic_add_affected_planes() call, it needs to called late
otherwise the area of all the planes would be added to pipe_clip and
not saving power.

Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
Reviewed-by: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210914212507.177511-4-jose.souza@intel.com
Stable-dep-of: 71c602103c74 ("drm/i915/psr: Use calculated io and fast wake lines")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/i915/display/intel_psr.c