linux/drivers/gpu/drm/amd/display/dc/calcs
Mario Kleiner 050cd3d616 drm/amd/display: Add support for SURFACE_PIXEL_FORMAT_GRPH_ABGR16161616.
Add the necessary format definition, bandwidth and pixel size mappings,
prescaler setup, and pixelformat selection, following the logic
already present for SURFACE_PIXEL_FORMAT_GRPH_ARGB16161616.

The new SURFACE_PIXEL_FORMAT_GRPH_ABGR16161616 is implemented as the
old SURFACE_PIXEL_FORMAT_GRPH_ARGB16161616 format, but with swapped
red <-> green color channel, by use of the hardware xbar.

Please note that on the DCN 1/2/3 display engines, the pixelformat
in hubp and dpp setup for the old SURFACE_PIXEL_FORMAT_GRPH_ARGB16161616
and the new SURFACE_PIXEL_FORMAT_GRPH_ABGR16161616 was changed from
format id 22 to id 26. See amd/include/navi10_enum.h for the meaning
of the id's.

For format 22, the display engine read the framebuffer in 16 bpc format,
but truncated to the 12 bpc actually supported by later pipeline stages.
However, the engine took the 12 LSB of each color component for
truncation, which is incompatible with rendering at least under Vulkan,
where content is 16 bit wide, and a 12 MSB alignment would be appropriate,
if any. Format 20 for ARGB16161616_12MSB does work, but even better, we
can choose format 26 for ARGB16161616_UNORM, keeping all 16 bits around
until later stages of the display pipeline.

This allows to directly consume what the rendering hw produces under
Vulkan for swapchain format VK_FORMAT_R16G16B16A16_UNORM, as tested
with a patched version of the current AMD open-source amdvlk driver
which maps swapchain format VK_FORMAT_R16G16B16A16_UNORM onto
DRM_FORMAT_XBGR16161616.

The old id 22 would cause colorful pixeltrash to be displayed instead.

Tested under DCN-1.0 and DCE-11.2.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2021-05-27 15:00:47 -04:00
..
bw_fixed.c amdgpu/dc: allow inlining constant int to fixed a lot better. 2017-09-29 13:03:35 -04:00
calcs_logger.h drm/amd/display: Convert remaining loggers off dc_logger 2018-07-13 14:48:42 -05:00
custom_float.c drm/amd/display: get rid of 32.32 unsigned fixed point 2018-05-18 16:08:21 -05:00
dce_calcs.c drm/amd/display: Add support for SURFACE_PIXEL_FORMAT_GRPH_ABGR16161616. 2021-05-27 15:00:47 -04:00
dcn_calc_auto.c drm/amd/display: Fix incorrect dcn1 bandwidth calculations 2020-07-01 01:59:20 -04:00
dcn_calc_auto.h drm/amd/display: make clk mgr soc specific 2019-05-31 10:39:29 -05:00
dcn_calc_math.c drm/amd/display: add some math functions for dcn_calc_math 2019-06-11 12:49:21 -05:00
dcn_calcs.c drm/amd/display: Add support for SURFACE_PIXEL_FORMAT_GRPH_ABGR16161616. 2021-05-27 15:00:47 -04:00
Makefile drm/amdgpu/display: drop DCN support for aarch64 2021-01-05 11:35:53 -05:00