anv: Fix I915_PARAM_HAS_CONTEXT_FREQ_HINT check

When I915_PARAM_HAS_CONTEXT_FREQ_HINT is not supported the
intel_ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp) will return -1 and that
will cause i915_gem_get_param() to return false.

val will be different than 1 when not using GuC submission, so we are
forcing val check to ensure this holds good in platforms that doesn't
support GuC submission.

Fixes: d52dd5a9 ("anv/drirc: add option to provide low latency hint")

Signed-off-by: Sushma Venkatesh Reddy <sushma.venkatesh.reddy@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30234>
This commit is contained in:
Sushma Venkatesh Reddy
2024-07-17 13:24:53 -07:00
committed by Marge Bot
parent 35cb0c350e
commit 7ca77370d2

View File

@@ -67,7 +67,7 @@ anv_i915_create_engine(struct anv_device *device,
flags |= INTEL_GEM_CREATE_CONTEXT_EXT_PROTECTED_FLAG;
if (device->physical->instance->force_guc_low_latency &&
i915_gem_get_param(device->fd, I915_PARAM_HAS_CONTEXT_FREQ_HINT, &val) && val) {
i915_gem_get_param(device->fd, I915_PARAM_HAS_CONTEXT_FREQ_HINT, &val) && (val == 1)) {
flags |= INTEL_GEM_CREATE_CONTEXT_EXT_LOW_LATENCY_FLAG;
}