Skip to content

Commit

Permalink
freedreno/afuc: Extract full gpu-id
Browse files Browse the repository at this point in the history
Sync from mesa commit 9a4ca194e8f918e3f90fed737c9686e1e4ca58af

Some of the a6xx gens will require some control reg initialization, and
go into an infinite loop if they don't see the values they expect, so
we'll need to extract the compute gpu-id.

Signed-off-by: Rob Clark <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10944>
  • Loading branch information
robclark committed Jul 5, 2021
1 parent 2196d1d commit 044e3cd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .lastsync
Original file line number Diff line number Diff line change
@@ -1 +1 @@
c2f8c98d56f8bfa12ce34be2b38ebc093be91d75
9a4ca194e8f918e3f90fed737c9686e1e4ca58af
22 changes: 15 additions & 7 deletions afuc/disasm.c
Original file line number Diff line number Diff line change
Expand Up @@ -813,14 +813,15 @@ main(int argc, char **argv)
uint32_t *buf;
char *file;
bool colors = false;
uint32_t gpu_id = 0;
size_t sz;
int c, ret;

/* Argument parsing: */
while ((c = getopt(argc, argv, "g:vce")) != -1) {
switch (c) {
case 'g':
gpuver = atoi(optarg);
gpu_id = atoi(optarg);
break;
case 'v':
verbose = true;
Expand All @@ -845,14 +846,21 @@ main(int argc, char **argv)
file = argv[optind];

/* if gpu version not specified, infer from filename: */
if (!gpuver) {
if (strstr(file, "a5")) {
gpuver = 5;
} else if (strstr(file, "a6")) {
gpuver = 6;
}
if (!gpu_id) {
char *str = strstr(file, "a5");
if (!str)
str = strstr(file, "a6");
if (str)
gpu_id = atoi(str + 1);
}

if (gpu_id < 500) {
printf("invalid gpu_id: %d\n", gpu_id);
return -1;
}

gpuver = gpu_id / 100;

/* a6xx is *mostly* a superset of a5xx, but some opcodes shuffle
* around, and behavior of special regs is a bit different. Right
* now we only bother to support the a6xx variant.
Expand Down

0 comments on commit 044e3cd

Please sign in to comment.