intel: Add has_partial_mmap_offset to intel_device_info

Commit 3fc79582a1db ("drm/i915: Increase I915_PARAM_MMAP_GTT_VERSION version to indicate support for partial mmaps")
increased the I915_PARAM_MMAP_GTT_VERSION version, with that we can
detect what kernel version has the partial mmap fix or not and limit
the usage of this workaround.
This time o mmap will be used in memory pool, so here adding this
propertly to enable or not the feature.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33558>
This commit is contained in:
José Roberto de Souza 2025-03-07 08:02:19 -08:00 committed by Marge Bot
parent 374ef9228b
commit e0a9ec34e7
3 changed files with 5 additions and 1 deletions

View file

@ -605,8 +605,10 @@ bool intel_device_info_i915_get_info_from_fd(int fd, struct intel_device_info *d
if (devinfo->ver > 12 || intel_device_info_is_mtl_or_arl(devinfo))
devinfo->has_set_pat_uapi = true;
if (getparam(fd, I915_PARAM_MMAP_GTT_VERSION, &val))
if (getparam(fd, I915_PARAM_MMAP_GTT_VERSION, &val)) {
devinfo->has_mmap_offset = val >= 4;
devinfo->has_partial_mmap_offset = val >= 5;
}
if (getparam(fd, I915_PARAM_HAS_USERPTR_PROBE, &val))
devinfo->has_userptr_probe = val;
if (getparam(fd, I915_PARAM_HAS_CONTEXT_ISOLATION, &val))

View file

@ -301,6 +301,7 @@ Struct("intel_device_info",
Member("bool", "has_lsc", compiler_field=True),
Member("bool", "has_mesh_shading"),
Member("bool", "has_mmap_offset"),
Member("bool", "has_partial_mmap_offset"),
Member("bool", "has_userptr_probe"),
Member("bool", "has_context_isolation"),
Member("bool", "has_set_pat_uapi"),

View file

@ -356,6 +356,7 @@ intel_device_info_xe_get_info_from_fd(int fd, struct intel_device_info *devinfo)
devinfo->has_context_isolation = true;
devinfo->has_mmap_offset = true;
devinfo->has_partial_mmap_offset = true;
devinfo->has_caching_uapi = false;
devinfo->has_set_pat_uapi = true;