intel/perf: create a vtable for low-level driver functions

Performance metrics collections requires several actions (eg bo_map())
that have different implementations for Iris and i965.  The perf
subsystem needs a vtable for each of these actions, so it can invoke
the corresponding implementation for each driver.

The first call to be added to the table is bo_alloc.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Mark Janes
2019-07-02 14:21:57 -07:00
parent ea66484e86
commit 439d5a3eff
2 changed files with 19 additions and 4 deletions
+4
View File
@@ -188,6 +188,10 @@ struct gen_perf_config {
/* Location of the device's sysfs entry. */
char sysfs_dev_dir[256];
struct {
void *(*bo_alloc)(void *bufmgr, const char *name, uint64_t size);
} vtbl;
};
static inline size_t