• Ramalingam C's avatar
    drm/i915/gem: Add extra pages in ttm_tt for ccs data · 76a6d563
    Ramalingam C authored
    On Xe-HP and later devices, dedicated compression control state (CCS)
    stored in local memory is used for each surface, to support the
    3D and media compression formats.
    
    The memory required for the CCS of the entire local memory is 1/256 of
    the local memory size. So before the kernel boot, the required memory
    is reserved for the CCS data and a secure register will be programmed
    with the CCS base address
    
    So when an object is allocated in local memory, dont need to explicitly
    allocate the space for ccs data. But when the obj is evicted into the
    smem, to hold the compression related data along with the obj extra space
    is needed in smem. i.e obj_size + (obj_size/256).
    
    Hence when a smem pages are allocated for an obj with lmem placement
    possibility we create with the extra pages required for the ccs data for
    the obj size.
    
    v2:
      Used imperative wording [Thomas]
    v3:
      Inflate the pages only when obj's placement is lmem only
    v4:
      GEM_BUG_ON if the ttm->num_pages > obj page size [Thomas]
    Signed-off-by: default avatarRamalingam C <ramalingam.c@intel.com>
    cc: Christian Koenig <christian.koenig@amd.com>
    cc: Hellstrom Thomas <thomas.hellstrom@intel.com>
    Reviewed-by: default avatarThomas Hellstrom <thomas.hellstrom@linux.intel.com>
    Reviewed-by: default avatarNirmoy Das <nirmoy.das@intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20220405150840.29351-9-ramalingam.c@intel.com
    76a6d563
i915_gem_ttm.c 34.2 KB