summaryrefslogtreecommitdiff
path: root/src/query-assign.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/query-assign.c')
-rw-r--r--src/query-assign.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/query-assign.c b/src/query-assign.c
index ef4fadf..ec5d389 100644
--- a/src/query-assign.c
+++ b/src/query-assign.c
@@ -601,7 +601,7 @@ static int resolve_attribute_targets(ParsedAttribute *p, CtrlSystem *system,
const char *whence)
{
CtrlAttributePerms perms;
- CtrlTarget *ctrl_target;
+ CtrlTarget *ctrl_target = NULL;
ReturnStatus status;
int ret = NV_PARSER_STATUS_SUCCESS;
int i;
@@ -614,7 +614,13 @@ static int resolve_attribute_targets(ParsedAttribute *p, CtrlSystem *system,
return NV_PARSER_STATUS_BAD_ARGUMENT;
}
- ctrl_target = NvCtrlGetDefaultTarget(system);
+ if (system->has_nvml) {
+ ctrl_target = NvCtrlGetDefaultTargetByType(system, GPU_TARGET);
+ }
+ if (!ctrl_target) {
+ ctrl_target = NvCtrlGetDefaultTarget(system);
+ }
+
if (ctrl_target == NULL) {
return NV_PARSER_STATUS_TARGET_SPEC_NO_TARGETS;
}
@@ -1441,7 +1447,8 @@ static int query_all(const Options *op, const char *display_name,
goto exit_bit_loop;
}
- if (status != NvCtrlSuccess) {
+ if (status != NvCtrlSuccess &&
+ status != NvCtrlMissingExtension) {
nv_error_msg("Error while querying valid values for "
"attribute '%s' on %s (%s).",
a->name, t->name,
@@ -1749,7 +1756,11 @@ static int query_all_targets(const char *display_name, const int target_type,
/* build the standard X server name */
- str = nv_standardize_screen_name(XDisplayName(system->display), -2);
+ if (system->has_nv_control) {
+ str = nv_standardize_screen_name(XDisplayName(system->display), -2);
+ } else {
+ str = strdup(system->display);
+ }
/* warn if we don't have any of the target type */
@@ -2134,7 +2145,7 @@ int nv_process_parsed_attribute(const Options *op,
/* if we don't have a Display connection, abort now */
- if (system == NULL || system->dpy == NULL) {
+ if (system == NULL) {
nv_error_msg("Unable to %s attribute %s specified %s (no Display "
"connection).", assign ? "assign" : "query",
a->name, whence);