On Mon, Mar 07, 2022 at 06:56:07PM +0200, Ville Syrjala wrote:
From: Ville Syrjälä ville.syrjala@linux.intel.com
commit 4e6f55120c7eccf6f9323bb681632e23cbcb3f3c upstream.
On TGL/RKL the BIOS likes to use some kind of bogus DBUF layout that doesn't match what the spec recommends. With a single active pipe that is not going to be a problem, but with multiple pipes active skl_commit_modeset_enables() goes into an infinite loop since it can't figure out any order in which it can commit the pipes without causing DBUF overlaps between the planes.
We'd need some kind of extra DBUF defrag stage in between to make the transition possible. But that is clearly way too complex a solution, so in the name of simplicity let's just sanitize the DBUF state by simply turning off all planes when we detect a pipe encroaching on its neighbours' DBUF slices. We only have to disable the primary planes as all other planes should have already been disabled (if they somehow were enabled) by earlier sanitization steps.
And for good measure let's also sanitize in case the DBUF allocations of the pipes already seem to overlap each other.
Cc: stable@vger.kernel.org # v5.14+ Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/4762 Signed-off-by: Ville Syrjälä ville.syrjala@linux.intel.com Link: https://patchwork.freedesktop.org/patch/msgid/20220204141818.1900-3-ville.sy... Reviewed-by: Stanislav Lisovskiy stanislav.lisovskiy@intel.com (cherry picked from commit 15512021eb3975a8c2366e3883337e252bb0eee5) Signed-off-by: Tvrtko Ursulin tvrtko.ursulin@intel.com (cherry picked from commit 4e6f55120c7eccf6f9323bb681632e23cbcb3f3c)
The chain of additional cherry-picks needed to get intel_plane_disable_noatomic() destaticed looked pretty hairy, so I just fixed it up manually.
Now queued up, thanks.
greg k-h