Skip to content
This repository was archived by the owner on Sep 4, 2024. It is now read-only.

Commit 0fd5043

Browse files
zehortigoza1ace
authored andcommitted
intel: Fix support of kernel versions without DRM_I915_QUERY_ENGINE_INFO
As Matt Turner pointed out, the commit here fixed breaks in Iris and ANV in kernel versions without support for DRM_I915_QUERY_ENGINE_INFO. As compute engines are only present in gfx12 and newer, and support for DRM_I915_QUERY_ENGINE_INFO was added before any gfx12 platform, we can check for gfx version before trying to get engine info. For ANV, this is done by checking if engine_info is not NULL, like in other places in the ANV source code. Fixes: a364f23 ("intel: Make gen12 URB space reservation dependent on compute engine presence") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9099 Signed-off-by: José Roberto de Souza <[email protected]> Tested-by: Matt Turner <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Marcin Ślusarz <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23257> (cherry picked from commit 42f707e)
1 parent a64cb5c commit 0fd5043

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

.pick_status.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@
229229
"description": "intel: Fix support of kernel versions without DRM_I915_QUERY_ENGINE_INFO",
230230
"nominated": true,
231231
"nomination_type": 1,
232-
"resolution": 0,
232+
"resolution": 1,
233233
"main_sha": null,
234234
"because_sha": "a364f23a6cfa28e1843ef1e64dce56b4cef5a71e"
235235
},

src/gallium/drivers/iris/iris_bufmgr.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2240,9 +2240,8 @@ iris_bufmgr_create(struct intel_device_info *devinfo, int fd, bool bo_reuse)
22402240

22412241
struct intel_query_engine_info *engine_info;
22422242
engine_info = intel_engine_get_info(bufmgr->fd, bufmgr->devinfo.kmd_type);
2243-
if (!engine_info)
2244-
goto error_engine_info;
2245-
bufmgr->devinfo.has_compute_engine = intel_engines_count(engine_info,
2243+
bufmgr->devinfo.has_compute_engine = engine_info &&
2244+
intel_engines_count(engine_info,
22462245
INTEL_ENGINE_CLASS_COMPUTE);
22472246
free(engine_info);
22482247

@@ -2338,7 +2337,6 @@ iris_bufmgr_create(struct intel_device_info *devinfo, int fd, bool bo_reuse)
23382337
}
23392338
iris_bufmgr_destroy_global_vm(bufmgr);
23402339
error_init_vm:
2341-
error_engine_info:
23422340
close(bufmgr->fd);
23432341
error_dup:
23442342
free(bufmgr);

src/intel/vulkan/anv_device.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,8 @@ anv_physical_device_try_create(struct vk_instance *vk_instance,
995995
device->master_fd = master_fd;
996996

997997
device->engine_info = intel_engine_get_info(fd, device->info.kmd_type);
998-
device->info.has_compute_engine = intel_engines_count(device->engine_info,
998+
device->info.has_compute_engine = device->engine_info &&
999+
intel_engines_count(device->engine_info,
9991000
INTEL_ENGINE_CLASS_COMPUTE);
10001001
anv_physical_device_init_queue_families(device);
10011002

0 commit comments

Comments
 (0)