[PATCH umr 1/4] Remove 'risky' option --print command.
Tom St Denis
tom.stdenis at amd.com
Mon Jul 24 15:25:48 UTC 2017
Signed-off-by: Tom St Denis <tom.stdenis at amd.com>
---
demo/update/read_sensor.sh | 2 +-
doc/umr.1 | 6 ------
src/app/main.c | 8 +-------
src/app/scan.c | 1 -
src/app/set_bit.c | 1 -
src/app/set_reg.c | 1 -
src/lib/ip/gfx60.c | 15 ++-------------
src/lib/ip/gfx70.c | 15 ++-------------
src/lib/ip/gfx72.c | 15 ++-------------
src/lib/ip/gfx80.c | 15 ++-------------
src/lib/ip/gfx81.c | 15 ++-------------
src/lib/ip/gfx90.c | 13 -------------
src/lib/ip/gfx91.c | 13 -------------
src/lib/ip/mmhub10.c | 13 -------------
src/lib/ip/mmhub91.c | 13 -------------
src/lib/ip/mp100.c | 13 -------------
src/lib/ip/mp90.c | 13 -------------
src/lib/ip/oss10.c | 15 ++-------------
src/lib/ip/oss20.c | 15 ++-------------
src/lib/ip/oss30.c | 15 ++-------------
src/lib/ip/smu60.c | 15 ++-------------
src/lib/ip/smu700.c | 15 ++-------------
src/lib/ip/smu701.c | 15 ++-------------
src/lib/ip/smu710.c | 15 ++-------------
src/lib/ip/smu711.c | 15 ++-------------
src/lib/ip/smu712.c | 15 ++-------------
src/lib/ip/smu713.c | 15 ++-------------
src/lib/ip/smu80.c | 15 ++-------------
src/umr.h | 1 -
29 files changed, 34 insertions(+), 304 deletions(-)
diff --git a/demo/update/read_sensor.sh b/demo/update/read_sensor.sh
index 94267f45492f..406037b9c7ca 100755
--- a/demo/update/read_sensor.sh
+++ b/demo/update/read_sensor.sh
@@ -6,7 +6,7 @@
# In this case we're reading the NB voltage sensor from Carrizo
# capture value in hex
-NB_VID=`umr -O risky,risky,read_smc -u carrizo.update -r carrizo.smu80.ixSMUSVI_NB_CURRENTVID | cut -b1-4`
+NB_VID=`umr -O read_smc -u carrizo.update -r carrizo.smu80.ixSMUSVI_NB_CURRENTVID | cut -b1-4`
# convert to decimal
NB_VID_DEC=`printf "%d" ${NB_VID}`
diff --git a/doc/umr.1 b/doc/umr.1
index 601866a57a7e..dcab07d7953a 100644
--- a/doc/umr.1
+++ b/doc/umr.1
@@ -107,12 +107,6 @@ separated strings. Options should be specified before --update or --force comma
.B quiet
Disable various informative but not required (for functionality) outputs.
-.B risky
- enables scanning risky ip blocks (such as GFX). Specify twice for SMU
- blocks. This flag is necessary since some blocks are not stable to blindly
- --scan (or --print) without causing GPU hangs. The flag is intended to prevent
- accidental hangs.
-
.B read_smc
Enable scanning of SMC registers.
diff --git a/src/app/main.c b/src/app/main.c
index 4fc26510be32..d8278a93e1cc 100644
--- a/src/app/main.c
+++ b/src/app/main.c
@@ -83,9 +83,7 @@ static void parse_options(char *str)
*p = 0;
if (*str == ',')
++str;
- if (!strcmp(option, "risky")) {
- options.risky++;
- } else if (!strcmp(option, "named")) {
+ if (!strcmp(option, "named")) {
options.named = 1;
} else if (!strcmp(option, "many")) {
options.named = 1;
@@ -184,9 +182,6 @@ int main(int argc, char **argv)
printf("--pci requires domain:bus:slot.function\n");
return EXIT_FAILURE;
}
- } else if (!strcmp(argv[i], "--print") || !strcmp(argv[i], "-p")) {
- options.print = 1;
- options.need_scan = 1;
} else if (!strcmp(argv[i], "--config") || !strcmp(argv[i], "-c")) {
if (!asic)
asic = get_asic();
@@ -398,7 +393,6 @@ int main(int argc, char **argv)
"\n\t\tForce a specific PCI device using the domain:bus:slot.function format in hex."
"\n\t\tThis is useful when more than one GPU is available. If the amdgpu driver is"
"\n\t\tloaded the corresponding instance will be automatically detected.\n"
-"\n\t--print, -p\n\t\tEnable dumping of all device registers. (default: off)\n"
"\n\t--config, -c\n\t\tPrint out configuation data read from kernel driver.\n"
"\n\t--enumerate, -e\n\t\tEnumerate all AMDGPU devices detected.\n"
"\n\t--list-blocks, -lb\n\t\tList IP blocks discovered for this device.\n"
diff --git a/src/app/scan.c b/src/app/scan.c
index 29a3e46ba3f7..f83b925f00ae 100644
--- a/src/app/scan.c
+++ b/src/app/scan.c
@@ -45,7 +45,6 @@ int umr_scan_asic(struct umr_asic *asic, char *asicname, char *ipname, char *reg
r = asic->blocks[i]->grant(asic);
if (r) {
if (ipname[0]) {
- fprintf(stderr, "[ERROR]: Must specify at least one 'risky' option before scanning specific blocks.\n");
exit(EXIT_FAILURE);
}
continue;
diff --git a/src/app/set_bit.c b/src/app/set_bit.c
index 44cdf6ada0b5..c9941126f822 100644
--- a/src/app/set_bit.c
+++ b/src/app/set_bit.c
@@ -64,7 +64,6 @@ int umr_set_register_bit(struct umr_asic *asic, char *regpath, char *regvalue)
}
if (asic->blocks[i]->grant) {
if (asic->blocks[i]->grant(asic)) {
- fprintf(stderr, "[ERROR]: Must specify at least one 'risky' before writing to this block.\n");
return -1;
}
}
diff --git a/src/app/set_reg.c b/src/app/set_reg.c
index 9952843ea6f3..79eab1c3e391 100644
--- a/src/app/set_reg.c
+++ b/src/app/set_reg.c
@@ -61,7 +61,6 @@ int umr_set_register(struct umr_asic *asic, char *regpath, char *regvalue)
if (asic->blocks[i]->grant) {
if (asic->blocks[i]->grant(asic)) {
- fprintf(stderr, "[ERROR]: Must specify at least one 'risky' before writing to this block.\n");
return -1;
}
}
diff --git a/src/lib/ip/gfx60.c b/src/lib/ip/gfx60.c
index 73cf7878709d..d122bd4a9660 100644
--- a/src/lib/ip/gfx60.c
+++ b/src/lib/ip/gfx60.c
@@ -30,22 +30,12 @@ static const struct umr_reg gfx60_registers[] = {
#include "gfx60_regs.i"
};
-static int grant(struct umr_asic *asic)
-{
- (void)asic;
- return 0;
-}
-
-static int deny(struct umr_asic *asic)
-{
- (void)asic;
- return -1;
-}
-
struct umr_ip_block *umr_create_gfx60(struct umr_options *options)
{
struct umr_ip_block *ip;
+ (void)options;
+
ip = calloc(1, sizeof *ip);
if (!ip)
return NULL;
@@ -57,7 +47,6 @@ struct umr_ip_block *umr_create_gfx60(struct umr_options *options)
free(ip);
return NULL;
}
- ip->grant = (options->risky >= 1) ? grant : deny;
memcpy(ip->regs, gfx60_registers, sizeof(gfx60_registers));
return ip;
}
diff --git a/src/lib/ip/gfx70.c b/src/lib/ip/gfx70.c
index e9bfa4bca8f6..73e06f115285 100644
--- a/src/lib/ip/gfx70.c
+++ b/src/lib/ip/gfx70.c
@@ -29,22 +29,12 @@ static const struct umr_reg gfx70_registers[] = {
#include "gfx70_regs.i"
};
-static int grant(struct umr_asic *asic)
-{
- (void)asic;
- return 0;
-}
-
-static int deny(struct umr_asic *asic)
-{
- (void)asic;
- return -1;
-}
-
struct umr_ip_block *umr_create_gfx70(struct umr_options *options)
{
struct umr_ip_block *ip;
+ (void)options;
+
ip = calloc(1, sizeof *ip);
if (!ip)
return NULL;
@@ -56,7 +46,6 @@ struct umr_ip_block *umr_create_gfx70(struct umr_options *options)
free(ip);
return NULL;
}
- ip->grant = (options->risky >= 1) ? grant : deny;
memcpy(ip->regs, gfx70_registers, sizeof(gfx70_registers));
return ip;
}
diff --git a/src/lib/ip/gfx72.c b/src/lib/ip/gfx72.c
index cd04f8df3a70..61fa00df3f77 100644
--- a/src/lib/ip/gfx72.c
+++ b/src/lib/ip/gfx72.c
@@ -30,22 +30,12 @@ static const struct umr_reg gfx72_registers[] = {
#include "gfx72_regs.i"
};
-static int grant(struct umr_asic *asic)
-{
- (void)asic;
- return 0;
-}
-
-static int deny(struct umr_asic *asic)
-{
- (void)asic;
- return -1;
-}
-
struct umr_ip_block *umr_create_gfx72(struct umr_options *options)
{
struct umr_ip_block *ip;
+ (void)options;
+
ip = calloc(1, sizeof *ip);
if (!ip)
return NULL;
@@ -57,7 +47,6 @@ struct umr_ip_block *umr_create_gfx72(struct umr_options *options)
free(ip);
return NULL;
}
- ip->grant = (options->risky >= 1) ? grant : deny;
memcpy(ip->regs, gfx72_registers, sizeof(gfx72_registers));
return ip;
}
diff --git a/src/lib/ip/gfx80.c b/src/lib/ip/gfx80.c
index 211c92570b21..ecdf7d236346 100644
--- a/src/lib/ip/gfx80.c
+++ b/src/lib/ip/gfx80.c
@@ -30,22 +30,12 @@ static const struct umr_reg gfx80_registers[] = {
#include "gfx80_regs.i"
};
-static int grant(struct umr_asic *asic)
-{
- (void)asic;
- return 0;
-}
-
-static int deny(struct umr_asic *asic)
-{
- (void)asic;
- return -1;
-}
-
struct umr_ip_block *umr_create_gfx80(struct umr_options *options)
{
struct umr_ip_block *ip;
+ (void)options;
+
ip = calloc(1, sizeof *ip);
if (!ip)
return NULL;
@@ -57,7 +47,6 @@ struct umr_ip_block *umr_create_gfx80(struct umr_options *options)
free(ip);
return NULL;
}
- ip->grant = (options->risky >= 1) ? grant : deny;
memcpy(ip->regs, gfx80_registers, sizeof(gfx80_registers));
return ip;
}
diff --git a/src/lib/ip/gfx81.c b/src/lib/ip/gfx81.c
index ef19203df141..cd485cc4af7f 100644
--- a/src/lib/ip/gfx81.c
+++ b/src/lib/ip/gfx81.c
@@ -30,22 +30,12 @@ static const struct umr_reg gfx81_registers[] = {
#include "gfx81_regs.i"
};
-static int grant(struct umr_asic *asic)
-{
- (void)asic;
- return 0;
-}
-
-static int deny(struct umr_asic *asic)
-{
- (void)asic;
- return -1;
-}
-
struct umr_ip_block *umr_create_gfx81(struct umr_options *options)
{
struct umr_ip_block *ip;
+ (void)options;
+
ip = calloc(1, sizeof *ip);
if (!ip)
return NULL;
@@ -57,7 +47,6 @@ struct umr_ip_block *umr_create_gfx81(struct umr_options *options)
free(ip);
return NULL;
}
- ip->grant = (options->risky >= 1) ? grant : deny;
memcpy(ip->regs, gfx81_registers, sizeof(gfx81_registers));
return ip;
}
diff --git a/src/lib/ip/gfx90.c b/src/lib/ip/gfx90.c
index e4a049ecb843..a1059c6cdc7d 100644
--- a/src/lib/ip/gfx90.c
+++ b/src/lib/ip/gfx90.c
@@ -30,18 +30,6 @@ static const struct umr_reg_soc15 gfx90_registers[] = {
#include "gfx90_regs.i"
};
-static int grant(struct umr_asic *asic)
-{
- (void)asic;
- return 0;
-}
-
-static int deny(struct umr_asic *asic)
-{
- (void)asic;
- return -1;
-}
-
struct umr_ip_block *umr_create_gfx90(struct umr_ip_offsets_soc15 *soc15_offsets, struct umr_options *options)
{
struct umr_ip_block *ip;
@@ -57,7 +45,6 @@ struct umr_ip_block *umr_create_gfx90(struct umr_ip_offsets_soc15 *soc15_offsets
free(ip);
return NULL;
}
- ip->grant = (options->risky >= 1) ? grant : deny;
if (umr_transfer_soc15_to_reg(options, soc15_offsets, "GC", gfx90_registers, ip)) {
free(ip);
diff --git a/src/lib/ip/gfx91.c b/src/lib/ip/gfx91.c
index 14ca0fd3a634..a647a713eadc 100644
--- a/src/lib/ip/gfx91.c
+++ b/src/lib/ip/gfx91.c
@@ -30,18 +30,6 @@ static const struct umr_reg_soc15 gfx91_registers[] = {
#include "gfx91_regs.i"
};
-static int grant(struct umr_asic *asic)
-{
- (void)asic;
- return 0;
-}
-
-static int deny(struct umr_asic *asic)
-{
- (void)asic;
- return -1;
-}
-
struct umr_ip_block *umr_create_gfx91(struct umr_ip_offsets_soc15 *soc15_offsets, struct umr_options *options)
{
struct umr_ip_block *ip;
@@ -57,7 +45,6 @@ struct umr_ip_block *umr_create_gfx91(struct umr_ip_offsets_soc15 *soc15_offsets
free(ip);
return NULL;
}
- ip->grant = (options->risky >= 1) ? grant : deny;
if (umr_transfer_soc15_to_reg(options, soc15_offsets, "GC", gfx91_registers, ip)) {
free(ip);
diff --git a/src/lib/ip/mmhub10.c b/src/lib/ip/mmhub10.c
index 48589c7d0838..edb49a43a854 100644
--- a/src/lib/ip/mmhub10.c
+++ b/src/lib/ip/mmhub10.c
@@ -30,18 +30,6 @@ static const struct umr_reg_soc15 mmhub10_registers[] = {
#include "mmhub10_regs.i"
};
-static int grant(struct umr_asic *asic)
-{
- (void)asic;
- return 0;
-}
-
-static int deny(struct umr_asic *asic)
-{
- (void)asic;
- return -1;
-}
-
struct umr_ip_block *umr_create_mmhub10(struct umr_ip_offsets_soc15 *soc15_offsets, struct umr_options *options)
{
struct umr_ip_block *ip;
@@ -57,7 +45,6 @@ struct umr_ip_block *umr_create_mmhub10(struct umr_ip_offsets_soc15 *soc15_offse
free(ip);
return NULL;
}
- ip->grant = (options->risky >= 1) ? grant : deny;
if (umr_transfer_soc15_to_reg(options, soc15_offsets, "MMHUB", mmhub10_registers, ip)) {
free(ip);
diff --git a/src/lib/ip/mmhub91.c b/src/lib/ip/mmhub91.c
index 5274a4f84024..d3b6b17ce1f8 100644
--- a/src/lib/ip/mmhub91.c
+++ b/src/lib/ip/mmhub91.c
@@ -30,18 +30,6 @@ static const struct umr_reg_soc15 mmhub91_registers[] = {
#include "mmhub91_regs.i"
};
-static int grant(struct umr_asic *asic)
-{
- (void)asic;
- return 0;
-}
-
-static int deny(struct umr_asic *asic)
-{
- (void)asic;
- return -1;
-}
-
struct umr_ip_block *umr_create_mmhub91(struct umr_ip_offsets_soc15 *soc15_offsets, struct umr_options *options)
{
struct umr_ip_block *ip;
@@ -57,7 +45,6 @@ struct umr_ip_block *umr_create_mmhub91(struct umr_ip_offsets_soc15 *soc15_offse
free(ip);
return NULL;
}
- ip->grant = (options->risky >= 1) ? grant : deny;
if (umr_transfer_soc15_to_reg(options, soc15_offsets, "MMHUB", mmhub91_registers, ip)) {
free(ip);
diff --git a/src/lib/ip/mp100.c b/src/lib/ip/mp100.c
index 575511acc14f..f313ac7fbca1 100644
--- a/src/lib/ip/mp100.c
+++ b/src/lib/ip/mp100.c
@@ -30,18 +30,6 @@ static const struct umr_reg_soc15 mp100_registers[] = {
#include "mp100_regs.i"
};
-static int grant(struct umr_asic *asic)
-{
- (void)asic;
- return 0;
-}
-
-static int deny(struct umr_asic *asic)
-{
- (void)asic;
- return -1;
-}
-
struct umr_ip_block *umr_create_mp100(struct umr_ip_offsets_soc15 *soc15_offsets, struct umr_options *options)
{
struct umr_ip_block *ip;
@@ -57,7 +45,6 @@ struct umr_ip_block *umr_create_mp100(struct umr_ip_offsets_soc15 *soc15_offsets
free(ip);
return NULL;
}
- ip->grant = (options->risky >= 1) ? grant : deny;
if (umr_transfer_soc15_to_reg(options, soc15_offsets, "MP0", mp100_registers, ip)) { // this might be broken because there is MP1/2 as well
free(ip);
diff --git a/src/lib/ip/mp90.c b/src/lib/ip/mp90.c
index 787f296f16ec..29b37069b461 100644
--- a/src/lib/ip/mp90.c
+++ b/src/lib/ip/mp90.c
@@ -30,18 +30,6 @@ static const struct umr_reg_soc15 mp90_registers[] = {
#include "mp90_regs.i"
};
-static int grant(struct umr_asic *asic)
-{
- (void)asic;
- return 0;
-}
-
-static int deny(struct umr_asic *asic)
-{
- (void)asic;
- return -1;
-}
-
struct umr_ip_block *umr_create_mp90(struct umr_ip_offsets_soc15 *soc15_offsets, struct umr_options *options)
{
struct umr_ip_block *ip;
@@ -57,7 +45,6 @@ struct umr_ip_block *umr_create_mp90(struct umr_ip_offsets_soc15 *soc15_offsets,
free(ip);
return NULL;
}
- ip->grant = (options->risky >= 1) ? grant : deny;
if (umr_transfer_soc15_to_reg(options, soc15_offsets, "MP0", mp90_registers, ip)) { // this might be broken because there is MP1/2 as well
free(ip);
diff --git a/src/lib/ip/oss10.c b/src/lib/ip/oss10.c
index 7d820da64de2..6105620e04b1 100644
--- a/src/lib/ip/oss10.c
+++ b/src/lib/ip/oss10.c
@@ -30,22 +30,12 @@ static const struct umr_reg oss10_registers[] = {
#include "oss10_regs.i"
};
-static int grant(struct umr_asic *asic)
-{
- (void)asic;
- return 0;
-}
-
-static int deny(struct umr_asic *asic)
-{
- (void)asic;
- return -1;
-}
-
struct umr_ip_block *umr_create_oss10(struct umr_options *options)
{
struct umr_ip_block *ip;
+ (void)options;
+
ip = calloc(1, sizeof *ip);
if (!ip)
return NULL;
@@ -57,7 +47,6 @@ struct umr_ip_block *umr_create_oss10(struct umr_options *options)
free(ip);
return NULL;
}
- ip->grant = (options->risky >= 2) ? grant : deny;
memcpy(ip->regs, oss10_registers, sizeof(oss10_registers));
return ip;
}
diff --git a/src/lib/ip/oss20.c b/src/lib/ip/oss20.c
index 26da1cd1fbc4..c50f188f4622 100644
--- a/src/lib/ip/oss20.c
+++ b/src/lib/ip/oss20.c
@@ -30,22 +30,12 @@ static const struct umr_reg oss20_registers[] = {
#include "oss20_regs.i"
};
-static int grant(struct umr_asic *asic)
-{
- (void)asic;
- return 0;
-}
-
-static int deny(struct umr_asic *asic)
-{
- (void)asic;
- return -1;
-}
-
struct umr_ip_block *umr_create_oss20(struct umr_options *options)
{
struct umr_ip_block *ip;
+ (void)options;
+
ip = calloc(1, sizeof *ip);
if (!ip)
return NULL;
@@ -57,7 +47,6 @@ struct umr_ip_block *umr_create_oss20(struct umr_options *options)
free(ip);
return NULL;
}
- ip->grant = (options->risky >= 2) ? grant : deny;
memcpy(ip->regs, oss20_registers, sizeof(oss20_registers));
return ip;
}
diff --git a/src/lib/ip/oss30.c b/src/lib/ip/oss30.c
index a44421af7e43..9cd423f53a3f 100644
--- a/src/lib/ip/oss30.c
+++ b/src/lib/ip/oss30.c
@@ -30,22 +30,12 @@ static const struct umr_reg oss30_registers[] = {
#include "oss30_regs.i"
};
-static int grant(struct umr_asic *asic)
-{
- (void)asic;
- return 0;
-}
-
-static int deny(struct umr_asic *asic)
-{
- (void)asic;
- return -1;
-}
-
struct umr_ip_block *umr_create_oss30(struct umr_options *options)
{
struct umr_ip_block *ip;
+ (void)options;
+
ip = calloc(1, sizeof *ip);
if (!ip)
return NULL;
@@ -57,7 +47,6 @@ struct umr_ip_block *umr_create_oss30(struct umr_options *options)
free(ip);
return NULL;
}
- ip->grant = (options->risky >= 2) ? grant : deny;
memcpy(ip->regs, oss30_registers, sizeof(oss30_registers));
return ip;
}
diff --git a/src/lib/ip/smu60.c b/src/lib/ip/smu60.c
index 545d1bafd268..d55c9a8db379 100644
--- a/src/lib/ip/smu60.c
+++ b/src/lib/ip/smu60.c
@@ -30,22 +30,12 @@ static const struct umr_reg smu60_registers[] = {
#include "smu60_regs.i"
};
-static int grant(struct umr_asic *asic)
-{
- (void)asic;
- return 0;
-}
-
-static int deny(struct umr_asic *asic)
-{
- (void)asic;
- return -1;
-}
-
struct umr_ip_block *umr_create_smu60(struct umr_options *options)
{
struct umr_ip_block *ip;
+ (void)options;
+
ip = calloc(1, sizeof *ip);
if (!ip)
return NULL;
@@ -57,7 +47,6 @@ struct umr_ip_block *umr_create_smu60(struct umr_options *options)
free(ip);
return NULL;
}
- ip->grant = (options->risky >= 2) ? grant : deny;
memcpy(ip->regs, smu60_registers, sizeof(smu60_registers));
return ip;
}
diff --git a/src/lib/ip/smu700.c b/src/lib/ip/smu700.c
index 86d242609d17..9d06f7cf804e 100644
--- a/src/lib/ip/smu700.c
+++ b/src/lib/ip/smu700.c
@@ -30,22 +30,12 @@ static const struct umr_reg smu700_registers[] = {
#include "smu700_regs.i"
};
-static int grant(struct umr_asic *asic)
-{
- (void)asic;
- return 0;
-}
-
-static int deny(struct umr_asic *asic)
-{
- (void)asic;
- return -1;
-}
-
struct umr_ip_block *umr_create_smu700(struct umr_options *options)
{
struct umr_ip_block *ip;
+ (void)options;
+
ip = calloc(1, sizeof *ip);
if (!ip)
return NULL;
@@ -57,7 +47,6 @@ struct umr_ip_block *umr_create_smu700(struct umr_options *options)
free(ip);
return NULL;
}
- ip->grant = (options->risky >= 2) ? grant : deny;
memcpy(ip->regs, smu700_registers, sizeof(smu700_registers));
return ip;
}
diff --git a/src/lib/ip/smu701.c b/src/lib/ip/smu701.c
index 06c811e50eaf..c6eb5bbb06de 100644
--- a/src/lib/ip/smu701.c
+++ b/src/lib/ip/smu701.c
@@ -30,22 +30,12 @@ static const struct umr_reg smu701_registers[] = {
#include "smu701_regs.i"
};
-static int grant(struct umr_asic *asic)
-{
- (void)asic;
- return 0;
-}
-
-static int deny(struct umr_asic *asic)
-{
- (void)asic;
- return -1;
-}
-
struct umr_ip_block *umr_create_smu701(struct umr_options *options)
{
struct umr_ip_block *ip;
+ (void)options;
+
ip = calloc(1, sizeof *ip);
if (!ip)
return NULL;
@@ -57,7 +47,6 @@ struct umr_ip_block *umr_create_smu701(struct umr_options *options)
free(ip);
return NULL;
}
- ip->grant = (options->risky >= 2) ? grant : deny;
memcpy(ip->regs, smu701_registers, sizeof(smu701_registers));
return ip;
}
diff --git a/src/lib/ip/smu710.c b/src/lib/ip/smu710.c
index 6d68464e78d0..b34aa6fe9a20 100644
--- a/src/lib/ip/smu710.c
+++ b/src/lib/ip/smu710.c
@@ -30,22 +30,12 @@ static const struct umr_reg smu710_registers[] = {
#include "smu710_regs.i"
};
-static int grant(struct umr_asic *asic)
-{
- (void)asic;
- return 0;
-}
-
-static int deny(struct umr_asic *asic)
-{
- (void)asic;
- return -1;
-}
-
struct umr_ip_block *umr_create_smu710(struct umr_options *options)
{
struct umr_ip_block *ip;
+ (void)options;
+
ip = calloc(1, sizeof *ip);
if (!ip)
return NULL;
@@ -57,7 +47,6 @@ struct umr_ip_block *umr_create_smu710(struct umr_options *options)
free(ip);
return NULL;
}
- ip->grant = (options->risky >= 2) ? grant : deny;
memcpy(ip->regs, smu710_registers, sizeof(smu710_registers));
return ip;
}
diff --git a/src/lib/ip/smu711.c b/src/lib/ip/smu711.c
index 00a9f2bd0214..4594dacb5493 100644
--- a/src/lib/ip/smu711.c
+++ b/src/lib/ip/smu711.c
@@ -30,22 +30,12 @@ static const struct umr_reg smu711_registers[] = {
#include "smu711_regs.i"
};
-static int grant(struct umr_asic *asic)
-{
- (void)asic;
- return 0;
-}
-
-static int deny(struct umr_asic *asic)
-{
- (void)asic;
- return -1;
-}
-
struct umr_ip_block *umr_create_smu711(struct umr_options *options)
{
struct umr_ip_block *ip;
+ (void)options;
+
ip = calloc(1, sizeof *ip);
if (!ip)
return NULL;
@@ -57,7 +47,6 @@ struct umr_ip_block *umr_create_smu711(struct umr_options *options)
free(ip);
return NULL;
}
- ip->grant = (options->risky >= 2) ? grant : deny;
memcpy(ip->regs, smu711_registers, sizeof(smu711_registers));
return ip;
}
diff --git a/src/lib/ip/smu712.c b/src/lib/ip/smu712.c
index 45b1b1e71eaf..a57929b17d55 100644
--- a/src/lib/ip/smu712.c
+++ b/src/lib/ip/smu712.c
@@ -30,22 +30,12 @@ static const struct umr_reg smu712_registers[] = {
#include "smu712_regs.i"
};
-static int grant(struct umr_asic *asic)
-{
- (void)asic;
- return 0;
-}
-
-static int deny(struct umr_asic *asic)
-{
- (void)asic;
- return -1;
-}
-
struct umr_ip_block *umr_create_smu712(struct umr_options *options)
{
struct umr_ip_block *ip;
+ (void)options;
+
ip = calloc(1, sizeof *ip);
if (!ip)
return NULL;
@@ -57,7 +47,6 @@ struct umr_ip_block *umr_create_smu712(struct umr_options *options)
free(ip);
return NULL;
}
- ip->grant = (options->risky >= 2) ? grant : deny;
memcpy(ip->regs, smu712_registers, sizeof(smu712_registers));
return ip;
}
diff --git a/src/lib/ip/smu713.c b/src/lib/ip/smu713.c
index c1e0ff8f3547..376e796d5c92 100644
--- a/src/lib/ip/smu713.c
+++ b/src/lib/ip/smu713.c
@@ -30,22 +30,12 @@ static const struct umr_reg smu713_registers[] = {
#include "smu713_regs.i"
};
-static int grant(struct umr_asic *asic)
-{
- (void)asic;
- return 0;
-}
-
-static int deny(struct umr_asic *asic)
-{
- (void)asic;
- return -1;
-}
-
struct umr_ip_block *umr_create_smu713(struct umr_options *options)
{
struct umr_ip_block *ip;
+ (void)options;
+
ip = calloc(1, sizeof *ip);
if (!ip)
return NULL;
@@ -57,7 +47,6 @@ struct umr_ip_block *umr_create_smu713(struct umr_options *options)
free(ip);
return NULL;
}
- ip->grant = (options->risky >= 2) ? grant : deny;
memcpy(ip->regs, smu713_registers, sizeof(smu713_registers));
return ip;
}
diff --git a/src/lib/ip/smu80.c b/src/lib/ip/smu80.c
index d1cd966fecd5..da0abe888677 100644
--- a/src/lib/ip/smu80.c
+++ b/src/lib/ip/smu80.c
@@ -30,22 +30,12 @@ static const struct umr_reg smu80_registers[] = {
#include "smu80_regs.i"
};
-static int grant(struct umr_asic *asic)
-{
- (void)asic;
- return 0;
-}
-
-static int deny(struct umr_asic *asic)
-{
- (void)asic;
- return -1;
-}
-
struct umr_ip_block *umr_create_smu80(struct umr_options *options)
{
struct umr_ip_block *ip;
+ (void)options;
+
ip = calloc(1, sizeof *ip);
if (!ip)
return NULL;
@@ -57,7 +47,6 @@ struct umr_ip_block *umr_create_smu80(struct umr_options *options)
free(ip);
return NULL;
}
- ip->grant = (options->risky >= 2) ? grant : deny;
memcpy(ip->regs, smu80_registers, sizeof(smu80_registers));
return ip;
}
diff --git a/src/umr.h b/src/umr.h
index 51690400f583..a0e94a7e4db9 100644
--- a/src/umr.h
+++ b/src/umr.h
@@ -162,7 +162,6 @@ struct umr_options {
instance,
need_scan,
print,
- risky,
bitfields,
bitfields_full,
named,
--
2.12.0
More information about the amd-gfx
mailing list