mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 04:40:09 +01:00
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:
parent
463cb1153f
commit
d9ff9ea9c3
3 changed files with 21 additions and 4 deletions
|
|
@ -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,
|
||||
×tamp_frequency))
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue