• Arunpravin Paneer Selvam's avatar
    drm/amdgpu: Add address alignment support to DCC buffers · aa94b623
    Arunpravin Paneer Selvam authored
    Add address alignment support to the DCC VRAM buffers.
    
    v2:
      - adjust size based on the max_texture_channel_caches values
        only for GFX12 DCC buffers.
      - used AMDGPU_GEM_CREATE_GFX12_DCC flag to apply change only
        for DCC buffers.
      - roundup non power of two DCC buffer adjusted size to nearest
        power of two number as the buddy allocator does not support non
        power of two alignments. This applies only to the contiguous
        DCC buffers.
    
    v3:(Alex)
      - rewrite the max texture channel caches comparison code in an
        algorithmic way to determine the alignment size.
    
    v4:(Alex)
      - Move the logic from amdgpu_vram_mgr_dcc_alignment() to gmc_v12_0.c
        and add a new gmc func callback for dcc alignment. If the callback
        is non-NULL, call it to get the alignment, otherwise, use the default.
    
    v5:(Alex)
      - Set the Alignment to a default value if the callback doesn't exist.
      - Add the callback to amdgpu_gmc_funcs.
    
    v6:
      - Fix checkpatch warning reported by Intel CI.
    
    v7:(Christian)
      - remove the AMDGPU_GEM_CREATE_GFX12_DCC flag and keep a flag that
        checks the BO pinning and for a specific hw generation.
    
    v8:(Christian)
      - move this check into gmc_v12_0_get_dcc_alignment.
    
    v9:
      - Fix 32bit build errors
    Signed-off-by: default avatarArunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
    Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
    Acked-by: default avatarChristian König <christian.koenig@amd.com>
    Reviewed-by: default avatarFrank Min <Frank.Min@amd.com>
    Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
    aa94b623
amdgpu_vram_mgr.c 25.8 KB