From 7ca77370d29f0e2f5e29ae2268fd0a73d57c4038 Mon Sep 17 00:00:00 2001 From: Sushma Venkatesh Reddy Date: Wed, 17 Jul 2024 13:24:53 -0700 Subject: [PATCH] anv: Fix I915_PARAM_HAS_CONTEXT_FREQ_HINT check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: José Roberto de Souza Part-of: --- src/intel/vulkan/i915/anv_queue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/intel/vulkan/i915/anv_queue.c b/src/intel/vulkan/i915/anv_queue.c index d1406c744f3..f67f88e8d36 100644 --- a/src/intel/vulkan/i915/anv_queue.c +++ b/src/intel/vulkan/i915/anv_queue.c @@ -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; }