]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/amd/display: Fix handling of plane refcount
authorJoshua Aberback <joshua.aberback@amd.com>
Mon, 28 Oct 2024 21:12:22 +0000 (17:12 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 20 Nov 2024 14:39:36 +0000 (09:39 -0500)
commit27227a234c1487cb7a684615f0749c455218833a
tree8feb233fa6e26b406a05f3aa47e7ac35eea5ea6b
parentc33a93201ca07119de90e8c952fbdf65920ab55d
drm/amd/display: Fix handling of plane refcount

[Why]
The mechanism to backup and restore plane states doesn't maintain
refcount, which can cause issues if the refcount of the plane changes
in between backup and restore operations, such as memory leaks if the
refcount was supposed to go down, or double frees / invalid memory
accesses if the refcount was supposed to go up.

[How]
Cache and re-apply current refcount when restoring plane states.

Cc: stable@vger.kernel.org
Reviewed-by: Josip Pavic <josip.pavic@amd.com>
Signed-off-by: Joshua Aberback <joshua.aberback@amd.com>
Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc.c