Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu: Add DCC flags for GFX9 amdgpu_bo

[Why]
Hardware support for Delta Color Compression (DCC) decompression is
available in DC for GFX9 but there's no way for userspace to enable
the feature.

Enabling the feature can provide improved GFX performance and
power savings in many situations.

[How]
Extend the GFX9 tiling flags to include DCC parameters. These are
logically grouped together with tiling flags even if they are
technically distinct.

This trivially maintains backwards compatibility with existing
users of amdgpu_gem_metadata. No new IOCTls or data structures are
needed to support DCC.

This patch helps expose DCC attributes to both libdrm and amdgpu_dm.

Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Nicholas Kazlauskas and committed by
Alex Deucher
ce331f8f 95022795

+6
+6
include/uapi/drm/amdgpu_drm.h
··· 326 326 /* GFX9 and later: */ 327 327 #define AMDGPU_TILING_SWIZZLE_MODE_SHIFT 0 328 328 #define AMDGPU_TILING_SWIZZLE_MODE_MASK 0x1f 329 + #define AMDGPU_TILING_DCC_OFFSET_256B_SHIFT 5 330 + #define AMDGPU_TILING_DCC_OFFSET_256B_MASK 0xFFFFFF 331 + #define AMDGPU_TILING_DCC_PITCH_MAX_SHIFT 29 332 + #define AMDGPU_TILING_DCC_PITCH_MAX_MASK 0x3FFF 333 + #define AMDGPU_TILING_DCC_INDEPENDENT_64B_SHIFT 43 334 + #define AMDGPU_TILING_DCC_INDEPENDENT_64B_MASK 0x1 329 335 330 336 /* Set/Get helpers for tiling flags. */ 331 337 #define AMDGPU_TILING_SET(field, value) \