intel/dev: Read hwconfig from i915

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14511>
This commit is contained in:
Jordan Justen 2021-10-30 13:41:38 -07:00 committed by Marge Bot
parent 463cb1153f
commit d9ff9ea9c3
3 changed files with 21 additions and 4 deletions

View file

@ -31,6 +31,7 @@
#include <xf86drm.h>
#include "intel_device_info.h"
#include "intel_hwconfig.h"
#include "intel/common/intel_gem.h"
#include "util/bitscan.h"
#include "util/debug.h"
@ -1878,6 +1879,8 @@ intel_get_device_info_from_fd(int fd, struct intel_device_info *devinfo)
return true;
}
intel_get_and_process_hwconfig_table(fd, devinfo);
int timestamp_frequency;
if (getparam(fd, I915_PARAM_CS_TIMESTAMP_FREQUENCY,
&timestamp_frequency))

View file

@ -24,6 +24,7 @@
#include <stdio.h>
#include <stdlib.h>
#include "drm-uapi/i915_drm.h"
#include "intel_device_info.h"
#include "intel_hwconfig.h"
#include "intel_hwconfig_types.h"
@ -271,7 +272,7 @@ apply_hwconfig_item(struct intel_device_info *devinfo,
}
}
void
static void
intel_apply_hwconfig_table(struct intel_device_info *devinfo,
const struct hwconfig *hwconfig,
int32_t hwconfig_len)
@ -286,6 +287,20 @@ intel_apply_hwconfig_table(struct intel_device_info *devinfo,
}
}
void
intel_get_and_process_hwconfig_table(int fd,
struct intel_device_info *devinfo)
{
struct hwconfig *hwconfig;
int32_t hwconfig_len = 0;
hwconfig = intel_i915_query_alloc(fd, DRM_I915_QUERY_HWCONFIG_BLOB,
&hwconfig_len);
if (hwconfig) {
intel_apply_hwconfig_table(devinfo, hwconfig, hwconfig_len);
free(hwconfig);
}
}
static void
print_hwconfig_item(struct intel_device_info *devinfo,
const struct hwconfig *item)

View file

@ -36,9 +36,8 @@ struct hwconfig;
struct intel_device_info;
void
intel_apply_hwconfig_table(struct intel_device_info *devinfo,
const struct hwconfig *hwconfig,
int32_t hwconfig_len);
intel_get_and_process_hwconfig_table(int fd,
struct intel_device_info *devinfo);
void
intel_print_hwconfig_table(const struct hwconfig *hwconfig,
int32_t hwconfig_len);