We require this flag AMDGPU_GEM_CREATE_GFX12_DCC or any other
kernel level GFX12 DCC flag to differentiate the DCC buffers and other
pinned display buffers(which has TTM_PL_FLAG_CONTIGUOUS enabled).
If we use the TTM_PL_FLAG_CONTIGUOUS flag for DCC buffers, we may over
allocate for all the pinned display buffers unnecessarily that leads to
memory allocation failure.
Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 
46142cc1b9272d664e0258e105b537735bfeeccc)
 
                /* Allocate blocks in desired range */
                vres->flags |= DRM_BUDDY_RANGE_ALLOCATION;
 
-       if (adev->gmc.gmc_funcs->get_dcc_alignment)
+       if (bo->flags & AMDGPU_GEM_CREATE_GFX12_DCC &&
+           adev->gmc.gmc_funcs->get_dcc_alignment)
                adjust_dcc_size = amdgpu_gmc_get_dcc_alignment(adev);
 
        remaining_size = (u64)vres->base.size;