intel: Add intel_gem_count_engines
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12692>
This commit is contained in:
@@ -55,3 +55,16 @@ intel_gem_supports_syncobj_wait(int fd)
|
||||
*/
|
||||
return ret == -1 && errno == ETIME;
|
||||
}
|
||||
|
||||
int
|
||||
intel_gem_count_engines(const struct drm_i915_query_engine_info *info,
|
||||
enum drm_i915_gem_engine_class engine_class)
|
||||
{
|
||||
assert(info != NULL);
|
||||
int count = 0;
|
||||
for (int i = 0; i < info->num_engines; i++) {
|
||||
if (info->engines[i].engine.engine_class == engine_class)
|
||||
count++;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
@@ -146,4 +146,7 @@ intel_i915_query_alloc(int fd, uint64_t query_id)
|
||||
|
||||
bool intel_gem_supports_syncobj_wait(int fd);
|
||||
|
||||
int intel_gem_count_engines(const struct drm_i915_query_engine_info *info,
|
||||
enum drm_i915_gem_engine_class engine_class);
|
||||
|
||||
#endif /* INTEL_GEM_H */
|
||||
|
@@ -697,7 +697,8 @@ anv_physical_device_init_queue_families(struct anv_physical_device *pdevice)
|
||||
|
||||
if (pdevice->engine_info) {
|
||||
int gc_count =
|
||||
anv_gem_count_engines(pdevice->engine_info, I915_ENGINE_CLASS_RENDER);
|
||||
intel_gem_count_engines(pdevice->engine_info,
|
||||
I915_ENGINE_CLASS_RENDER);
|
||||
int g_count = 0;
|
||||
int c_count = 0;
|
||||
|
||||
|
@@ -360,7 +360,7 @@ anv_gem_create_context_engines(struct anv_device *device,
|
||||
|
||||
int i915_engine_counts[] = {
|
||||
[I915_ENGINE_CLASS_RENDER] =
|
||||
anv_gem_count_engines(info, I915_ENGINE_CLASS_RENDER),
|
||||
intel_gem_count_engines(info, I915_ENGINE_CLASS_RENDER),
|
||||
};
|
||||
|
||||
/* For each queue, we look for the next instance that matches the class we
|
||||
@@ -526,15 +526,3 @@ anv_gem_get_engine_info(int fd)
|
||||
{
|
||||
return intel_i915_query_alloc(fd, DRM_I915_QUERY_ENGINE_INFO);
|
||||
}
|
||||
|
||||
int
|
||||
anv_gem_count_engines(const struct drm_i915_query_engine_info *info,
|
||||
uint16_t engine_class)
|
||||
{
|
||||
int count = 0;
|
||||
for (int i = 0; i < info->num_engines; i++) {
|
||||
if (info->engines[i].engine.engine_class == engine_class)
|
||||
count++;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
@@ -208,13 +208,6 @@ anv_gem_get_engine_info(int fd)
|
||||
unreachable("Unused");
|
||||
}
|
||||
|
||||
int
|
||||
anv_gem_count_engines(const struct drm_i915_query_engine_info *info,
|
||||
uint16_t engine_class)
|
||||
{
|
||||
unreachable("Unused");
|
||||
}
|
||||
|
||||
int
|
||||
anv_gem_reg_read(int fd, uint32_t offset, uint64_t *result)
|
||||
{
|
||||
|
@@ -1388,8 +1388,6 @@ int anv_gem_set_domain(struct anv_device *device, uint32_t gem_handle,
|
||||
int anv_i915_query(int fd, uint64_t query_id, void *buffer,
|
||||
int32_t *buffer_len);
|
||||
struct drm_i915_query_engine_info *anv_gem_get_engine_info(int fd);
|
||||
int anv_gem_count_engines(const struct drm_i915_query_engine_info *info,
|
||||
uint16_t engine_class);
|
||||
|
||||
uint64_t anv_vma_alloc(struct anv_device *device,
|
||||
uint64_t size, uint64_t align,
|
||||
|
Reference in New Issue
Block a user