intel: Add intel_kmd_type parameter to intel_engine_get_info()

This will be needed to execute proper function to fetch engines from
kernel mode driver.

Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20773>
This commit is contained in:
José Roberto de Souza 2022-08-22 12:56:27 -07:00
parent 2c42641994
commit 162695f0b8
5 changed files with 18 additions and 6 deletions

View file

@ -275,7 +275,8 @@ iris_create_engines_context(struct iris_context *ice, int priority)
const struct intel_device_info *devinfo = screen->devinfo;
int fd = iris_bufmgr_get_fd(screen->bufmgr);
struct intel_query_engine_info *engines_info = intel_engine_get_info(fd);
struct intel_query_engine_info *engines_info;
engines_info = intel_engine_get_info(fd, screen->devinfo->kmd_type);
if (!engines_info)
return -1;

View file

@ -23,13 +23,21 @@
#include <stdlib.h>
#include "util/macros.h"
#include "intel_engine.h"
#include "intel_engine_i915.h"
struct intel_query_engine_info *
intel_engine_get_info(int fd)
intel_engine_get_info(int fd, enum intel_kmd_type type)
{
return i915_engine_get_info(fd);
switch (type) {
case INTEL_KMD_TYPE_I915:
return i915_engine_get_info(fd);
default:
unreachable("Missing");
return NULL;
}
}
int

View file

@ -25,6 +25,8 @@
#include <stdint.h>
#include "intel/dev/intel_kmd.h"
enum intel_engine_class {
INTEL_ENGINE_CLASS_RENDER = 0,
INTEL_ENGINE_CLASS_COPY,
@ -44,7 +46,8 @@ struct intel_query_engine_info {
struct intel_engine_class_instance engines[];
};
struct intel_query_engine_info *intel_engine_get_info(int fd);
struct intel_query_engine_info *
intel_engine_get_info(int fd, enum intel_kmd_type type);
int intel_engines_count(const struct intel_query_engine_info *info,
enum intel_engine_class engine_class);
const char *intel_engines_class_to_string(enum intel_engine_class engine_class);

View file

@ -947,7 +947,7 @@ anv_physical_device_try_create(struct vk_instance *vk_instance,
}
device->master_fd = master_fd;
device->engine_info = intel_engine_get_info(fd);
device->engine_info = intel_engine_get_info(fd, device->info.kmd_type);
anv_physical_device_init_queue_families(device);
anv_physical_device_init_perf(device, fd);

View file

@ -899,7 +899,7 @@ anv_physical_device_try_create(struct vk_instance *vk_instance,
}
device->master_fd = master_fd;
device->engine_info = intel_engine_get_info(fd);
device->engine_info = intel_engine_get_info(fd, device->info.kmd_type);
anv_physical_device_init_queue_families(device);
device->local_fd = fd;