Revert "drm/amd/display: ignore modifiers when checking for format support"
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Mon, 20 Jun 2022 00:37:20 +0000 (02:37 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 23 Jun 2022 21:24:10 +0000 (17:24 -0400)
commit366e817e83e4d795fe3f6e7379bfe79d49cac89b
tree74a542461b2fa1d3f7e353a9c15eac0522a97911
parent7fc494f9cf8ec7497d4aab26a3b19deceab0fe31
Revert "drm/amd/display: ignore modifiers when checking for format support"

This reverts commit 5089c4a8ebea3c3ad9eedf038dad7098ebc06131.

This breaks validation and enumeration of display capable modifiers.

The early return true means the rest of the validation code never gets
executed, and we need that to enumerate the right modifiers to userspace
for the format.

The modifiers that are in the initial list generated for a plane are the
superset for all formats and we need the proper checks in this function
to filter some of them out for formats with which they're invalid to be
used.

Furthermore, the safety contract here is that we validate the incoming
modifiers to ensure the kernel can handle them and the display hardware
can handle them. This includes e.g. rejecting multi-plane images with DCC.

Note that the legacy swizzle mechanism allows encoding more swizzles, and
at fb creation time we convert them to modifiers and reject those with
no corresponding modifiers. If we are seeing rejections I'm happy to
help define modifiers that correspond to those, or if absolutely needed
implement a fallback path to allow for less strict validation of the
legacy path.

However, I'd like to revert this patch, since any of these is going to
be a significant rework of the patch, and I'd rather not the regression
gets into a release or forgotten in the meantime.

Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c