freedreno/perfcntrs: Re-indent
Signed-off-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10293>
This commit is contained in:
parent
d26a224ca9
commit
6050976232
|
@ -320,8 +320,8 @@ static const struct fd_perfcntr_countable rb_countables[] = {
|
|||
};
|
||||
|
||||
static const struct fd_perfcntr_counter rbbm_counters[] = {
|
||||
//RESERVED: for kernel
|
||||
// COUNTER(RBBM_PERFCTR_RBBM_SEL_0, RBBM_PERFCTR_RBBM_0_LO, RBBM_PERFCTR_RBBM_0_HI),
|
||||
//RESERVED: for kernel
|
||||
// COUNTER(RBBM_PERFCTR_RBBM_SEL_0, RBBM_PERFCTR_RBBM_0_LO, RBBM_PERFCTR_RBBM_0_HI),
|
||||
COUNTER(RBBM_PERFCTR_RBBM_SEL_1, RBBM_PERFCTR_RBBM_1_LO, RBBM_PERFCTR_RBBM_1_HI),
|
||||
COUNTER(RBBM_PERFCTR_RBBM_SEL_2, RBBM_PERFCTR_RBBM_2_LO, RBBM_PERFCTR_RBBM_2_HI),
|
||||
COUNTER(RBBM_PERFCTR_RBBM_SEL_3, RBBM_PERFCTR_RBBM_3_LO, RBBM_PERFCTR_RBBM_3_HI),
|
||||
|
@ -345,8 +345,8 @@ static const struct fd_perfcntr_countable rbbm_countables[] = {
|
|||
};
|
||||
|
||||
static const struct fd_perfcntr_counter sp_counters[] = {
|
||||
//RESERVED: for kernel
|
||||
// COUNTER(SP_PERFCTR_SP_SEL_0, RBBM_PERFCTR_SP_0_LO, RBBM_PERFCTR_SP_0_HI),
|
||||
//RESERVED: for kernel
|
||||
// COUNTER(SP_PERFCTR_SP_SEL_0, RBBM_PERFCTR_SP_0_LO, RBBM_PERFCTR_SP_0_HI),
|
||||
COUNTER(SP_PERFCTR_SP_SEL_1, RBBM_PERFCTR_SP_1_LO, RBBM_PERFCTR_SP_1_HI),
|
||||
COUNTER(SP_PERFCTR_SP_SEL_2, RBBM_PERFCTR_SP_2_LO, RBBM_PERFCTR_SP_2_HI),
|
||||
COUNTER(SP_PERFCTR_SP_SEL_3, RBBM_PERFCTR_SP_3_LO, RBBM_PERFCTR_SP_3_HI),
|
||||
|
@ -732,7 +732,7 @@ const struct fd_perfcntr_group a5xx_perfcntr_groups[] = {
|
|||
GROUP("VFD", vfd_counters, vfd_countables),
|
||||
GROUP("VPC", vpc_counters, vpc_countables),
|
||||
GROUP("VSC", vsc_counters, vsc_countables),
|
||||
// GROUP("VBIF", vbif_counters, vbif_countables),
|
||||
// GROUP("VBIF", vbif_counters, vbif_countables),
|
||||
};
|
||||
|
||||
const unsigned a5xx_num_perfcntr_groups = ARRAY_SIZE(a5xx_perfcntr_groups);
|
||||
|
|
|
@ -245,9 +245,9 @@ static const struct fd_perfcntr_counter hlsq_counters[] = {
|
|||
COUNTER(HLSQ_PERFCTR_HLSQ_SEL(3), RBBM_PERFCTR_HLSQ(3), RBBM_PERFCTR_HLSQ(3)+1),
|
||||
COUNTER(HLSQ_PERFCTR_HLSQ_SEL(4), RBBM_PERFCTR_HLSQ(4), RBBM_PERFCTR_HLSQ(4)+1),
|
||||
COUNTER(HLSQ_PERFCTR_HLSQ_SEL(5), RBBM_PERFCTR_HLSQ(5), RBBM_PERFCTR_HLSQ(5)+1),
|
||||
// TODO did we loose some HLSQ counters or are they just missing from xml
|
||||
// COUNTER(HLSQ_PERFCTR_HLSQ_SEL(6), RBBM_PERFCTR_HLSQ(6), RBBM_PERFCTR_HLSQ(6)+1),
|
||||
// COUNTER(HLSQ_PERFCTR_HLSQ_SEL(7), RBBM_PERFCTR_HLSQ(7), RBBM_PERFCTR_HLSQ(7)+1),
|
||||
// TODO did we loose some HLSQ counters or are they just missing from xml
|
||||
// COUNTER(HLSQ_PERFCTR_HLSQ_SEL(6), RBBM_PERFCTR_HLSQ(6), RBBM_PERFCTR_HLSQ(6)+1),
|
||||
// COUNTER(HLSQ_PERFCTR_HLSQ_SEL(7), RBBM_PERFCTR_HLSQ(7), RBBM_PERFCTR_HLSQ(7)+1),
|
||||
};
|
||||
|
||||
static const struct fd_perfcntr_countable hlsq_countables[] = {
|
||||
|
@ -393,8 +393,8 @@ static const struct fd_perfcntr_countable rb_countables[] = {
|
|||
};
|
||||
|
||||
UNUSED static const struct fd_perfcntr_counter rbbm_counters[] = {
|
||||
//RESERVED: for kernel
|
||||
// COUNTER(RBBM_PERFCTR_RBBM_SEL(0), RBBM_PERFCTR_RBBM(0), RBBM_PERFCTR_RBBM(0)+1),
|
||||
//RESERVED: for kernel
|
||||
// COUNTER(RBBM_PERFCTR_RBBM_SEL(0), RBBM_PERFCTR_RBBM(0), RBBM_PERFCTR_RBBM(0)+1),
|
||||
COUNTER(RBBM_PERFCTR_RBBM_SEL(1), RBBM_PERFCTR_RBBM(1), RBBM_PERFCTR_RBBM(1)+1),
|
||||
COUNTER(RBBM_PERFCTR_RBBM_SEL(2), RBBM_PERFCTR_RBBM(2), RBBM_PERFCTR_RBBM(2)+1),
|
||||
COUNTER(RBBM_PERFCTR_RBBM_SEL(3), RBBM_PERFCTR_RBBM(3), RBBM_PERFCTR_RBBM(3)+1),
|
||||
|
@ -418,8 +418,8 @@ UNUSED static const struct fd_perfcntr_countable rbbm_countables[] = {
|
|||
};
|
||||
|
||||
static const struct fd_perfcntr_counter sp_counters[] = {
|
||||
//RESERVED: for kernel
|
||||
// COUNTER(SP_PERFCTR_SP_SEL(0), RBBM_PERFCTR_SP(0), RBBM_PERFCTR_SP(0)+1),
|
||||
//RESERVED: for kernel
|
||||
// COUNTER(SP_PERFCTR_SP_SEL(0), RBBM_PERFCTR_SP(0), RBBM_PERFCTR_SP(0)+1),
|
||||
COUNTER(SP_PERFCTR_SP_SEL(1), RBBM_PERFCTR_SP(1), RBBM_PERFCTR_SP(1)+1),
|
||||
COUNTER(SP_PERFCTR_SP_SEL(2), RBBM_PERFCTR_SP(2), RBBM_PERFCTR_SP(2)+1),
|
||||
COUNTER(SP_PERFCTR_SP_SEL(3), RBBM_PERFCTR_SP(3), RBBM_PERFCTR_SP(3)+1),
|
||||
|
@ -765,14 +765,14 @@ const struct fd_perfcntr_group a6xx_perfcntr_groups[] = {
|
|||
GROUP("HLSQ", hlsq_counters, hlsq_countables),
|
||||
GROUP("PC", pc_counters, pc_countables),
|
||||
GROUP("RB", rb_counters, rb_countables),
|
||||
// GROUP("RBBM", rbbm_counters, rbbm_countables),
|
||||
// GROUP("RBBM", rbbm_counters, rbbm_countables),
|
||||
GROUP("SP", sp_counters, sp_countables),
|
||||
GROUP("TP", tp_counters, tp_countables),
|
||||
GROUP("UCHE", uche_counters, uche_countables),
|
||||
GROUP("VFD", vfd_counters, vfd_countables),
|
||||
GROUP("VPC", vpc_counters, vpc_countables),
|
||||
GROUP("VSC", vsc_counters, vsc_countables),
|
||||
// GROUP("VBIF", vbif_counters, vbif_countables),
|
||||
// GROUP("VBIF", vbif_counters, vbif_countables),
|
||||
};
|
||||
|
||||
const unsigned a6xx_num_perfcntr_groups = ARRAY_SIZE(a6xx_perfcntr_groups);
|
||||
|
|
|
@ -23,16 +23,16 @@
|
|||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <curses.h>
|
||||
#include <err.h>
|
||||
#include <inttypes.h>
|
||||
#include <libconfig.h>
|
||||
#include <locale.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
#include <time.h>
|
||||
#include <curses.h>
|
||||
#include <libconfig.h>
|
||||
#include <inttypes.h>
|
||||
#include <xf86drm.h>
|
||||
|
||||
#include "drm/freedreno_drmif.h"
|
||||
|
@ -136,11 +136,9 @@ find_device(void)
|
|||
|
||||
#define CHIP_FMT "d%d%d.%d"
|
||||
#define CHIP_ARGS(chipid) \
|
||||
((chipid) >> 24) & 0xff, \
|
||||
((chipid) >> 16) & 0xff, \
|
||||
((chipid) >> 8) & 0xff, \
|
||||
((chipid) >> 24) & 0xff, ((chipid) >> 16) & 0xff, ((chipid) >> 8) & 0xff, \
|
||||
((chipid) >> 0) & 0xff
|
||||
printf("device: a%"CHIP_FMT"\n", CHIP_ARGS(dev.chipid));
|
||||
printf("device: a%" CHIP_FMT "\n", CHIP_ARGS(dev.chipid));
|
||||
|
||||
/* try MAX_FREQ first as that will work regardless of old dt
|
||||
* dt bindings vs upstream bindings:
|
||||
|
@ -196,8 +194,8 @@ select_counter(struct counter_group *group, int ctr, int n)
|
|||
|
||||
if (!dev.submit) {
|
||||
dev.submit = fd_submit_new(dev.pipe);
|
||||
dev.ring = fd_submit_new_ringbuffer(dev.submit, 0x1000,
|
||||
FD_RINGBUFFER_PRIMARY | FD_RINGBUFFER_GROWABLE);
|
||||
dev.ring = fd_submit_new_ringbuffer(
|
||||
dev.submit, 0x1000, FD_RINGBUFFER_PRIMARY | FD_RINGBUFFER_GROWABLE);
|
||||
}
|
||||
|
||||
/* bashing select register directly while gpu is active will end
|
||||
|
@ -321,9 +319,8 @@ redraw_footer(WINDOW *win)
|
|||
char *footer;
|
||||
int n;
|
||||
|
||||
n = asprintf(&footer, " fdperf: a%"CHIP_FMT" (%.2fMHz..%.2fMHz)",
|
||||
CHIP_ARGS(dev.chipid),
|
||||
((float)dev.min_freq) / 1000000.0,
|
||||
n = asprintf(&footer, " fdperf: a%" CHIP_FMT " (%.2fMHz..%.2fMHz)",
|
||||
CHIP_ARGS(dev.chipid), ((float)dev.min_freq) / 1000000.0,
|
||||
((float)dev.max_freq) / 1000000.0);
|
||||
|
||||
wmove(win, h - 1, 0);
|
||||
|
@ -402,15 +399,15 @@ static void
|
|||
redraw_counter_value_raw(WINDOW *win, float val)
|
||||
{
|
||||
char *str;
|
||||
(void) asprintf(&str, "%'.2f", val);
|
||||
(void)asprintf(&str, "%'.2f", val);
|
||||
waddstr(win, str);
|
||||
whline(win, ' ', w - getcurx(win));
|
||||
free(str);
|
||||
}
|
||||
|
||||
static void
|
||||
redraw_counter(WINDOW *win, int row, struct counter_group *group,
|
||||
int ctr, bool selected)
|
||||
redraw_counter(WINDOW *win, int row, struct counter_group *group, int ctr,
|
||||
bool selected)
|
||||
{
|
||||
redraw_counter_label(win, row, group->label[ctr], selected);
|
||||
|
||||
|
@ -428,8 +425,7 @@ redraw_counter(WINDOW *win, int row, struct counter_group *group,
|
|||
* shader as a306 we might need to scale the result..
|
||||
*/
|
||||
if (strstr(group->label[ctr], "CYCLE") ||
|
||||
strstr(group->label[ctr], "BUSY") ||
|
||||
strstr(group->label[ctr], "IDLE"))
|
||||
strstr(group->label[ctr], "BUSY") || strstr(group->label[ctr], "IDLE"))
|
||||
redraw_counter_value_cycles(win, group->current[ctr]);
|
||||
else
|
||||
redraw_counter_value_raw(win, group->current[ctr]);
|
||||
|
@ -512,7 +508,6 @@ current_counter(int *ctr)
|
|||
n++;
|
||||
}
|
||||
|
||||
|
||||
for (; j < group->group->num_counters; j++) {
|
||||
if (n == current_cntr) {
|
||||
if (ctr)
|
||||
|
@ -535,7 +530,7 @@ counter_dialog(void)
|
|||
int cnt = 0, current = 0, scroll;
|
||||
|
||||
/* figure out dialog size: */
|
||||
int dh = h/2;
|
||||
int dh = h / 2;
|
||||
int dw = ctr_width + 2;
|
||||
|
||||
group = current_counter(&cnt);
|
||||
|
@ -554,7 +549,7 @@ counter_dialog(void)
|
|||
/* scrolling offset, if dialog is too small for all the choices: */
|
||||
scroll = 0;
|
||||
|
||||
dialog = newwin(dh, dw, (h-dh)/2, (w-dw)/2);
|
||||
dialog = newwin(dh, dw, (h - dh) / 2, (w - dw) / 2);
|
||||
box(dialog, 0, 0);
|
||||
wrefresh(dialog);
|
||||
keypad(dialog, TRUE);
|
||||
|
@ -571,9 +566,9 @@ counter_dialog(void)
|
|||
|
||||
for (int i = 0; i < max; i++) {
|
||||
int n = scroll + i;
|
||||
wmove(dialog, i+1, 1);
|
||||
wmove(dialog, i + 1, 1);
|
||||
if (n == current) {
|
||||
assert (n < group->group->num_countables);
|
||||
assert(n < group->group->num_countables);
|
||||
selector = group->group->countables[n].selector;
|
||||
wattron(dialog, COLOR_PAIR(COLOR_INVERSE));
|
||||
}
|
||||
|
@ -584,7 +579,7 @@ counter_dialog(void)
|
|||
wattroff(dialog, COLOR_PAIR(COLOR_INVERSE));
|
||||
}
|
||||
|
||||
assert (selector >= 0);
|
||||
assert(selector >= 0);
|
||||
|
||||
switch (wgetch(dialog)) {
|
||||
case KEY_UP:
|
||||
|
@ -611,7 +606,7 @@ counter_dialog(void)
|
|||
}
|
||||
|
||||
out:
|
||||
wborder(dialog, ' ', ' ', ' ',' ',' ',' ',' ',' ');
|
||||
wborder(dialog, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ');
|
||||
delwin(dialog);
|
||||
}
|
||||
|
||||
|
@ -735,14 +730,17 @@ setup_counter_groups(const struct fd_perfcntr_group *groups)
|
|||
for (unsigned j = 0; j < group->group->num_counters; j++) {
|
||||
group->counter[j].counter = &group->group->counters[j];
|
||||
|
||||
group->counter[j].val_hi = dev.io + (group->counter[j].counter->counter_reg_hi * 4);
|
||||
group->counter[j].val_lo = dev.io + (group->counter[j].counter->counter_reg_lo * 4);
|
||||
group->counter[j].val_hi =
|
||||
dev.io + (group->counter[j].counter->counter_reg_hi * 4);
|
||||
group->counter[j].val_lo =
|
||||
dev.io + (group->counter[j].counter->counter_reg_lo * 4);
|
||||
|
||||
group->counter[j].select_val = j;
|
||||
}
|
||||
|
||||
for (unsigned j = 0; j < group->group->num_countables; j++) {
|
||||
ctr_width = MAX2(ctr_width, strlen(group->group->countables[j].name) + 1);
|
||||
ctr_width =
|
||||
MAX2(ctr_width, strlen(group->group->countables[j].name) + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -771,8 +769,7 @@ config_save(void)
|
|||
for (; j < group->group->num_counters; j++) {
|
||||
char name[] = "counter0000";
|
||||
sprintf(name, "counter%d", j);
|
||||
config_setting_t *s =
|
||||
config_setting_lookup(sect, name);
|
||||
config_setting_t *s = config_setting_lookup(sect, name);
|
||||
config_setting_set_int(s, group->counter[j].select_val);
|
||||
}
|
||||
}
|
||||
|
@ -788,14 +785,14 @@ config_restore(void)
|
|||
config_init(&cfg);
|
||||
|
||||
/* Read the file. If there is an error, report it and exit. */
|
||||
if(!config_read_file(&cfg, "fdperf.cfg")) {
|
||||
if (!config_read_file(&cfg, "fdperf.cfg")) {
|
||||
warn("could not restore settings");
|
||||
}
|
||||
|
||||
config_setting_t *root = config_root_setting(&cfg);
|
||||
|
||||
/* per device settings: */
|
||||
(void) asprintf(&str, "a%dxx", dev.chipid >> 24);
|
||||
(void)asprintf(&str, "a%dxx", dev.chipid >> 24);
|
||||
setting = config_setting_get_member(root, str);
|
||||
if (!setting)
|
||||
setting = config_setting_add(root, str, CONFIG_TYPE_GROUP);
|
||||
|
@ -813,8 +810,8 @@ config_restore(void)
|
|||
config_setting_get_member(setting, group->group->name);
|
||||
|
||||
if (!sect) {
|
||||
sect = config_setting_add(setting, group->group->name,
|
||||
CONFIG_TYPE_GROUP);
|
||||
sect =
|
||||
config_setting_add(setting, group->group->name, CONFIG_TYPE_GROUP);
|
||||
}
|
||||
|
||||
for (; j < group->group->num_counters; j++) {
|
||||
|
|
|
@ -22,18 +22,18 @@
|
|||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <arpa/inet.h>
|
||||
#include <fcntl.h>
|
||||
#include <ftw.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/mman.h>
|
||||
#include <unistd.h>
|
||||
#include <inttypes.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "util/macros.h"
|
||||
#include "util/os_file.h"
|
||||
|
@ -49,7 +49,6 @@ static struct {
|
|||
uint32_t max_freq;
|
||||
} dev;
|
||||
|
||||
|
||||
/*
|
||||
* code to find stuff in /proc/device-tree:
|
||||
*
|
||||
|
@ -65,7 +64,7 @@ readdt(const char *node)
|
|||
void *buf;
|
||||
size_t sz;
|
||||
|
||||
(void) asprintf(&path, "%s/%s", dev.dtnode, node);
|
||||
(void)asprintf(&path, "%s/%s", dev.dtnode, node);
|
||||
buf = os_read_file(path, &sz);
|
||||
free(path);
|
||||
|
||||
|
@ -73,7 +72,8 @@ readdt(const char *node)
|
|||
}
|
||||
|
||||
static int
|
||||
find_freqs_fn(const char *fpath, const struct stat *sb, int typeflag, struct FTW *ftwbuf)
|
||||
find_freqs_fn(const char *fpath, const struct stat *sb, int typeflag,
|
||||
struct FTW *ftwbuf)
|
||||
{
|
||||
const char *fname = fpath + ftwbuf->base;
|
||||
size_t sz;
|
||||
|
@ -97,14 +97,14 @@ find_freqs(void)
|
|||
dev.min_freq = ~0;
|
||||
dev.max_freq = 0;
|
||||
|
||||
(void) asprintf(&path, "%s/%s", dev.dtnode, "qcom,gpu-pwrlevels");
|
||||
(void)asprintf(&path, "%s/%s", dev.dtnode, "qcom,gpu-pwrlevels");
|
||||
|
||||
nftw(path, find_freqs_fn, 64, 0);
|
||||
|
||||
free(path);
|
||||
}
|
||||
|
||||
static const char * compatibles[] = {
|
||||
static const char *compatibles[] = {
|
||||
"qcom,adreno-3xx",
|
||||
"qcom,kgsl-3d0",
|
||||
"amd,imageon",
|
||||
|
@ -118,7 +118,8 @@ static const char * compatibles[] = {
|
|||
*
|
||||
* would result in "qcom,adreno-630.2\0qcom,adreno\0"
|
||||
*/
|
||||
static bool match_compatible(char *compatstrs, int sz)
|
||||
static bool
|
||||
match_compatible(char *compatstrs, int sz)
|
||||
{
|
||||
while (sz > 0) {
|
||||
char *compatible = compatstrs;
|
||||
|
@ -136,7 +137,8 @@ static bool match_compatible(char *compatstrs, int sz)
|
|||
}
|
||||
|
||||
static int
|
||||
find_device_fn(const char *fpath, const struct stat *sb, int typeflag, struct FTW *ftwbuf)
|
||||
find_device_fn(const char *fpath, const struct stat *sb, int typeflag,
|
||||
struct FTW *ftwbuf)
|
||||
{
|
||||
const char *fname = fpath + ftwbuf->base;
|
||||
size_t sz;
|
||||
|
@ -164,8 +166,8 @@ find_device_fn(const char *fpath, const struct stat *sb, int typeflag, struct FT
|
|||
dev.size_cells = ntohl(*val);
|
||||
free(val);
|
||||
|
||||
printf("#address-cells=%d, #size-cells=%d\n",
|
||||
dev.address_cells, dev.size_cells);
|
||||
printf("#address-cells=%d, #size-cells=%d\n", dev.address_cells,
|
||||
dev.size_cells);
|
||||
}
|
||||
free(str);
|
||||
}
|
||||
|
@ -195,7 +197,7 @@ find_device(void)
|
|||
b = buf = readdt("reg");
|
||||
|
||||
if (dev.address_cells == 2) {
|
||||
uint32_t u[2] = { ntohl(buf[0]), ntohl(buf[1]) };
|
||||
uint32_t u[2] = {ntohl(buf[0]), ntohl(buf[1])};
|
||||
dev.base = (((uint64_t)u[0]) << 32) | u[1];
|
||||
buf += 2;
|
||||
} else {
|
||||
|
@ -204,7 +206,7 @@ find_device(void)
|
|||
}
|
||||
|
||||
if (dev.size_cells == 2) {
|
||||
uint32_t u[2] = { ntohl(buf[0]), ntohl(buf[1]) };
|
||||
uint32_t u[2] = {ntohl(buf[0]), ntohl(buf[1])};
|
||||
dev.size = (((uint64_t)u[0]) << 32) | u[1];
|
||||
buf += 2;
|
||||
} else {
|
||||
|
@ -214,7 +216,7 @@ find_device(void)
|
|||
|
||||
free(b);
|
||||
|
||||
printf("i/o region at %08"PRIx64" (size: %x)\n", dev.base, dev.size);
|
||||
printf("i/o region at %08" PRIx64 " (size: %x)\n", dev.base, dev.size);
|
||||
|
||||
find_freqs();
|
||||
|
||||
|
@ -245,7 +247,8 @@ fd_dt_find_io(void)
|
|||
if (fd < 0)
|
||||
return NULL;
|
||||
|
||||
void *io = mmap(0, dev.size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, dev.base);
|
||||
void *io =
|
||||
mmap(0, dev.size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, dev.base);
|
||||
close(fd);
|
||||
if (io == MAP_FAILED)
|
||||
return NULL;
|
||||
|
|
|
@ -39,7 +39,7 @@ extern "C" {
|
|||
*/
|
||||
|
||||
bool fd_dt_find_freqs(uint32_t *min_freq, uint32_t *max_freq);
|
||||
void * fd_dt_find_io(void);
|
||||
void *fd_dt_find_io(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* end of extern "C" */
|
||||
|
|
|
@ -52,7 +52,6 @@ struct fd_perfcntr_counter {
|
|||
unsigned clear;
|
||||
};
|
||||
|
||||
|
||||
enum fd_perfcntr_type {
|
||||
FD_PERFCNTR_TYPE_UINT64,
|
||||
FD_PERFCNTR_TYPE_UINT,
|
||||
|
@ -76,7 +75,6 @@ enum fd_perfcntr_result_type {
|
|||
FD_PERFCNTR_RESULT_TYPE_CUMULATIVE,
|
||||
};
|
||||
|
||||
|
||||
/* Describes a single countable: */
|
||||
struct fd_perfcntr_countable {
|
||||
const char *name;
|
||||
|
@ -100,33 +98,26 @@ struct fd_perfcntr_group {
|
|||
const struct fd_perfcntr_group *fd_perfcntrs(unsigned gpu_id, unsigned *count);
|
||||
|
||||
#define COUNTER(_sel, _lo, _hi) { \
|
||||
.select_reg = REG(_sel), \
|
||||
.counter_reg_lo = REG(_lo), \
|
||||
.select_reg = REG(_sel), .counter_reg_lo = REG(_lo), \
|
||||
.counter_reg_hi = REG(_hi), \
|
||||
}
|
||||
}
|
||||
|
||||
#define COUNTER2(_sel, _lo, _hi, _en, _clr) { \
|
||||
.select_reg = REG(_sel), \
|
||||
.counter_reg_lo = REG(_lo), \
|
||||
.counter_reg_hi = REG(_hi), \
|
||||
.enable = REG(_en), \
|
||||
.clear = REG(_clr), \
|
||||
}
|
||||
.select_reg = REG(_sel), .counter_reg_lo = REG(_lo), \
|
||||
.counter_reg_hi = REG(_hi), .enable = REG(_en), .clear = REG(_clr), \
|
||||
}
|
||||
|
||||
#define COUNTABLE(_selector, _query_type, _result_type) { \
|
||||
.name = #_selector, \
|
||||
.selector = _selector, \
|
||||
.query_type = FD_PERFCNTR_TYPE_ ## _query_type, \
|
||||
.result_type = FD_PERFCNTR_RESULT_TYPE_ ## _result_type, \
|
||||
}
|
||||
.name = #_selector, .selector = _selector, \
|
||||
.query_type = FD_PERFCNTR_TYPE_##_query_type, \
|
||||
.result_type = FD_PERFCNTR_RESULT_TYPE_##_result_type, \
|
||||
}
|
||||
|
||||
#define GROUP(_name, _counters, _countables) { \
|
||||
.name = _name, \
|
||||
.num_counters = ARRAY_SIZE(_counters), \
|
||||
.counters = _counters, \
|
||||
.num_countables = ARRAY_SIZE(_countables), \
|
||||
.name = _name, .num_counters = ARRAY_SIZE(_counters), \
|
||||
.counters = _counters, .num_countables = ARRAY_SIZE(_countables), \
|
||||
.countables = _countables, \
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* end of extern "C" */
|
||||
|
|
Loading…
Reference in New Issue