Skip to content
Snippets Groups Projects
Commit d9ff9ea9 authored by Jordan Justen's avatar Jordan Justen Committed by Marge Bot
Browse files

intel/dev: Read hwconfig from i915


Signed-off-by: default avatarJordan Justen <jordan.l.justen@intel.com>
Reviewed-by: default avatarCaio Oliveira <caio.oliveira@intel.com>
Part-of: <!14511>
parent 463cb115
No related branches found
No related tags found
No related merge requests found
......@@ -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))
......
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment