nv-control-events.c 27.8 KB
Newer Older
Aaron Plattner's avatar
Aaron Plattner committed
1
/*
2
 * Copyright (c) 2004-2008 NVIDIA, Corporation
Aaron Plattner's avatar
Aaron Plattner committed
3
 *
4 5 6 7 8 9
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
Aaron Plattner's avatar
Aaron Plattner committed
10
 *
11 12 13
 * The above copyright notice and this permission notice (including the next
 * paragraph) shall be included in all copies or substantial portions of the
 * Software.
Aaron Plattner's avatar
Aaron Plattner committed
14
 *
15 16 17 18 19 20 21
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
Aaron Plattner's avatar
Aaron Plattner committed
22 23 24 25 26 27 28 29
 */

/*
 * nv-control-events.c - trivial sample NV-CONTROL client that
 * demonstrates how to handle NV-CONTROL events.
 */

#include <stdio.h>
Aaron Plattner's avatar
Aaron Plattner committed
30 31 32
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
Aaron Plattner's avatar
Aaron Plattner committed
33
#include <unistd.h>
Aaron Plattner's avatar
Aaron Plattner committed
34

Aaron Plattner's avatar
Aaron Plattner committed
35 36 37 38 39 40

#include <X11/Xlib.h>

#include "NVCtrl.h"
#include "NVCtrlLib.h"

Aaron Plattner's avatar
Aaron Plattner committed
41 42 43 44
#define EVENT_TYPE_START TARGET_ATTRIBUTE_CHANGED_EVENT
#define EVENT_TYPE_END TARGET_BINARY_ATTRIBUTE_CHANGED_EVENT


Aaron Plattner's avatar
Aaron Plattner committed
45
static const char *attr2str(int n);
Aaron Plattner's avatar
Aaron Plattner committed
46
static const char *target2str(int n);
Aaron Plattner's avatar
Aaron Plattner committed
47 48 49 50 51
static const char *targetTypeAndId2Str(int targetType, int targetId);

struct target_info {
    int type;
    int count;
Aaron Plattner's avatar
Aaron Plattner committed
52
    unsigned int *pIds; // If Non-NULL, is list of target ids.
Aaron Plattner's avatar
Aaron Plattner committed
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
};

static void print_usage(char **argv)
{
    printf("Usage:\n");
    printf("%s [-d <dpy>] [-a] [-c] [-b] [-s]\n", argv[0]);
    printf("\n");
    printf("-d <dpy>: X server display to connect to\n");
    printf("-a: Listen for attribute availability events\n");
    printf("-c: Listen for attribute changed events\n");
    printf("-b: Listen for binary attribute changed events\n");
    printf("-s: Listen for string attribute changed events\n");
    printf("\n");
    printf("By default (i.e., if none of -a, -c, -b, or -s are requested),\n"
           "all event types are enabled.\n");
}
Aaron Plattner's avatar
Aaron Plattner committed
69

Aaron Plattner's avatar
Aaron Plattner committed
70
int main(int argc, char **argv)
Aaron Plattner's avatar
Aaron Plattner committed
71 72 73
{
    Display *dpy;
    Bool ret;
Aaron Plattner's avatar
Aaron Plattner committed
74
    int event_base, error_base;
Aaron Plattner's avatar
Aaron Plattner committed
75 76 77 78 79
    int i, j, k;
    int sources = 0;
    struct target_info info[] = {
        { .type = NV_CTRL_TARGET_TYPE_X_SCREEN },
        { .type = NV_CTRL_TARGET_TYPE_GPU },
Aaron Plattner's avatar
Aaron Plattner committed
80
        { .type = NV_CTRL_TARGET_TYPE_DISPLAY },
Aaron Plattner's avatar
Aaron Plattner committed
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144
        { .type = NV_CTRL_TARGET_TYPE_FRAMELOCK },
        { .type = NV_CTRL_TARGET_TYPE_VCSC },
        { .type = NV_CTRL_TARGET_TYPE_GVI },
        { .type = NV_CTRL_TARGET_TYPE_COOLER },
        { .type = NV_CTRL_TARGET_TYPE_THERMAL_SENSOR },
        { .type = NV_CTRL_TARGET_TYPE_3D_VISION_PRO_TRANSCEIVER },
    };
    static const int num_target_types = sizeof(info) / sizeof(*info);

    int c;
    char *dpy_name = NULL;
    Bool anythingEnabled;

#define EVENT_TYPE_ENTRY(_x) [_x] = { False, #_x }

    struct {
        Bool enabled;
        char *description;
    } eventTypes[] = {
        EVENT_TYPE_ENTRY(TARGET_ATTRIBUTE_CHANGED_EVENT),
        EVENT_TYPE_ENTRY(TARGET_ATTRIBUTE_AVAILABILITY_CHANGED_EVENT),
        EVENT_TYPE_ENTRY(TARGET_STRING_ATTRIBUTE_CHANGED_EVENT),
        EVENT_TYPE_ENTRY(TARGET_BINARY_ATTRIBUTE_CHANGED_EVENT),
    };

    while ((c = getopt(argc, argv, "d:acbsh")) >= 0) {
        switch (c) {
        case 'd':
            dpy_name = optarg;
            break;
        case 'a':
            eventTypes[TARGET_ATTRIBUTE_AVAILABILITY_CHANGED_EVENT].enabled = True;
            break;
        case 'c':
            eventTypes[TARGET_ATTRIBUTE_CHANGED_EVENT].enabled = True;
            break;
        case 'b':
            eventTypes[TARGET_BINARY_ATTRIBUTE_CHANGED_EVENT].enabled = True;
            break;
        case 's':
            eventTypes[TARGET_STRING_ATTRIBUTE_CHANGED_EVENT].enabled = True;
            break;
        case '?':
            fprintf(stderr, "%s: Unknown argument '%c'\n", argv[0], optopt);
            /* fallthrough */
        case 'h':
            print_usage(argv);
            return 1;
        }
    }

    anythingEnabled = False;
    for (i = EVENT_TYPE_START; i <= EVENT_TYPE_END; i++) {
        if (eventTypes[i].enabled) {
            anythingEnabled = True;
            break;
        }
    }

    if (!anythingEnabled) {
        for (i = EVENT_TYPE_START; i <= EVENT_TYPE_END; i++) {
            eventTypes[i].enabled = True;
        }
    }
Aaron Plattner's avatar
Aaron Plattner committed
145 146 147 148 149

    /*
     * Open a display connection, and make sure the NV-CONTROL X
     * extension is present on the screen we want to use.
     */
Aaron Plattner's avatar
Aaron Plattner committed
150 151

    dpy = XOpenDisplay(dpy_name);
Aaron Plattner's avatar
Aaron Plattner committed
152
    if (!dpy) {
Aaron Plattner's avatar
Aaron Plattner committed
153
        fprintf(stderr, "Cannot open display '%s'.\n", XDisplayName(dpy_name));
Aaron Plattner's avatar
Aaron Plattner committed
154 155 156 157 158 159 160 161 162 163
        return 1;
    }
    
    /*
     * check if the NV-CONTROL X extension is present on this X server
     */
    
    ret = XNVCTRLQueryExtension(dpy, &event_base, &error_base);
    if (ret != True) {
        fprintf(stderr, "The NV-CONTROL X extension does not exist on '%s'.\n",
Aaron Plattner's avatar
Aaron Plattner committed
164
                XDisplayName(dpy_name));
Aaron Plattner's avatar
Aaron Plattner committed
165 166 167
        return 1;
    }

Aaron Plattner's avatar
Aaron Plattner committed
168 169
    /* Query target counts */
    for (i = 0; i < num_target_types; i++) {
Aaron Plattner's avatar
Aaron Plattner committed
170

Aaron Plattner's avatar
Aaron Plattner committed
171
        struct target_info *tinfo = &info[i];
Aaron Plattner's avatar
Aaron Plattner committed
172

Aaron Plattner's avatar
Aaron Plattner committed
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192

        if (tinfo->type == NV_CTRL_TARGET_TYPE_DISPLAY) {
            ret = XNVCTRLQueryTargetBinaryData(dpy, NV_CTRL_TARGET_TYPE_X_SCREEN,
                                               0, 0,
                                               NV_CTRL_BINARY_DATA_DISPLAY_TARGETS,
                                               (unsigned char **)&(tinfo->pIds),
                                               &(tinfo->count));
            if (ret != True) {
                fprintf(stderr, "Failed to query %s target count on '%s'.\n",
                        target2str(tinfo->type), XDisplayName(dpy_name));
                return 1;
            }
            tinfo->count = tinfo->pIds[0];
        } else {
            ret = XNVCTRLQueryTargetCount(dpy, tinfo->type, &tinfo->count);
            if (ret != True) {
                fprintf(stderr, "Failed to query %s target count on '%s'.\n",
                        target2str(tinfo->type), XDisplayName(dpy_name));
                return 1;
            }
Aaron Plattner's avatar
Aaron Plattner committed
193 194 195
        }
    }

Aaron Plattner's avatar
Aaron Plattner committed
196
    printf("Registering to receive events...\n");
Aaron Plattner's avatar
Aaron Plattner committed
197 198
    fflush(stdout);

Aaron Plattner's avatar
Aaron Plattner committed
199
    /* Register to receive events on all targets */
Aaron Plattner's avatar
Aaron Plattner committed
200

Aaron Plattner's avatar
Aaron Plattner committed
201 202
    for (i = 0; i < num_target_types; i++) {
        struct target_info *tinfo = &info[i];
Aaron Plattner's avatar
Aaron Plattner committed
203

Aaron Plattner's avatar
Aaron Plattner committed
204
        for (j = 0; j < tinfo->count; j++) {
Aaron Plattner's avatar
Aaron Plattner committed
205 206 207 208 209 210 211
            int target_id;

            if (tinfo->pIds) {
                target_id = tinfo->pIds[1+j];
            } else {
                target_id = j;
            }
Aaron Plattner's avatar
Aaron Plattner committed
212

Aaron Plattner's avatar
Aaron Plattner committed
213 214 215 216
            for (k = EVENT_TYPE_START; k <= EVENT_TYPE_END; k++) {
                if (!eventTypes[k].enabled) {
                    continue;
                }
Aaron Plattner's avatar
Aaron Plattner committed
217

Aaron Plattner's avatar
Aaron Plattner committed
218 219 220 221 222 223 224
                if ((k == TARGET_ATTRIBUTE_CHANGED_EVENT) &&
                    (tinfo->type == NV_CTRL_TARGET_TYPE_X_SCREEN)) {

                    /*
                     * Only register to receive events if this screen is
                     * controlled by the NVIDIA driver.
                     */
Aaron Plattner's avatar
Aaron Plattner committed
225
                    if (!XNVCTRLIsNvScreen(dpy, target_id)) {
Aaron Plattner's avatar
Aaron Plattner committed
226 227 228 229 230 231 232 233 234 235 236 237
                        printf("- The NV-CONTROL X not available on X screen "
                               "%d of '%s'.\n", i, XDisplayName(dpy_name));
                        continue;
                    }

                    /*
                     * - Register to receive ATTRIBUTE_CHANGE_EVENT events.
                     *   These events are specific to attributes set on X
                     *   Screens.
                     */


Aaron Plattner's avatar
Aaron Plattner committed
238
                    ret = XNVCtrlSelectNotify(dpy, target_id, ATTRIBUTE_CHANGED_EVENT,
Aaron Plattner's avatar
Aaron Plattner committed
239 240 241 242 243 244 245 246
                                              True);
                    if (ret != True) {
                        printf("- Unable to register to receive NV-CONTROL"
                               "events on '%s'.\n", XDisplayName(dpy_name));
                        continue;
                    }

                    printf("+ Listening on X screen %d for "
Aaron Plattner's avatar
Aaron Plattner committed
247
                           "ATTRIBUTE_CHANGED_EVENTs.\n", target_id);
Aaron Plattner's avatar
Aaron Plattner committed
248 249
                    sources++;
                }
Aaron Plattner's avatar
Aaron Plattner committed
250

Aaron Plattner's avatar
Aaron Plattner committed
251 252 253 254 255 256 257 258 259 260
                /*
                 * - Register to receive TARGET_ATTRIBUTE_CHANGED_EVENT events.
                 *   These events are specific to attributes set on various
                 *   devices and structures controlled by the NVIDIA driver.
                 *   Some possible targets include X Screens, GPUs, and Frame
                 *   Lock boards.
                 */

                ret = XNVCtrlSelectTargetNotify(dpy,
                                                tinfo->type, /* target type */
Aaron Plattner's avatar
Aaron Plattner committed
261
                                                target_id,   /* target ID */
Aaron Plattner's avatar
Aaron Plattner committed
262 263 264 265
                                                k,           /* eventType */
                                                True);
                if (ret != True) {
                    printf("- Unable to register on %s %d for %ss.\n",
Aaron Plattner's avatar
Aaron Plattner committed
266
                           target2str(tinfo->type), target_id,
Aaron Plattner's avatar
Aaron Plattner committed
267 268 269
                           eventTypes[k].description);
                    continue;
                }
Aaron Plattner's avatar
Aaron Plattner committed
270

Aaron Plattner's avatar
Aaron Plattner committed
271
                printf("+ Listening on %s %d for %ss.\n",
Aaron Plattner's avatar
Aaron Plattner committed
272
                       target2str(tinfo->type), target_id, eventTypes[k].description);
Aaron Plattner's avatar
Aaron Plattner committed
273

Aaron Plattner's avatar
Aaron Plattner committed
274 275
                sources++;
            }
Aaron Plattner's avatar
Aaron Plattner committed
276 277 278
        }
    }

Aaron Plattner's avatar
Aaron Plattner committed
279 280 281 282 283 284 285 286 287
    /* 
     * Report the number of sources (things that we have registered to
     * listen for NV-CONTROL X Events on.)
     */

    printf("\n");
    printf("Listening on %d sources for NV-CONTROL X Events...\n", sources);
    

Aaron Plattner's avatar
Aaron Plattner committed
288 289 290 291 292
    /*
     * Loop forever, processing events
     */

    while (True) {
Aaron Plattner's avatar
Aaron Plattner committed
293 294
        XEvent event;
        const char *target_str;
Aaron Plattner's avatar
Aaron Plattner committed
295 296 297 298 299

        /* block for the next event */

        XNextEvent(dpy, &event);

Aaron Plattner's avatar
Aaron Plattner committed
300 301
        /* Handle ATTRIBUTE_CHANGED_EVENTS */
        if (event.type == (event_base + ATTRIBUTE_CHANGED_EVENT)) {
Aaron Plattner's avatar
Aaron Plattner committed
302

Aaron Plattner's avatar
Aaron Plattner committed
303
            /* cast the X event as an XNVCtrlAttributeChangedEvent */
Aaron Plattner's avatar
Aaron Plattner committed
304 305 306 307 308
            XNVCtrlAttributeChangedEvent *nvevent =
                (XNVCtrlAttributeChangedEvent *) &event;

            target_str = targetTypeAndId2Str(NV_CTRL_TARGET_TYPE_X_SCREEN,
                                             nvevent->screen);
Aaron Plattner's avatar
Aaron Plattner committed
309

Aaron Plattner's avatar
Aaron Plattner committed
310 311
            /* print out the event information */
            printf("ATTRIBUTE_CHANGED_EVENTS:                    Target: %15s  "
Aaron Plattner's avatar
Aaron Plattner committed
312 313 314 315
                   "Display Mask: 0x%08x   "
                   "Attribute: (%3d) %-32s   Value: %d (0x%08x)\n",
                   target_str,
                   nvevent->display_mask,
Aaron Plattner's avatar
Aaron Plattner committed
316 317
                   nvevent->attribute,
                   attr2str(nvevent->attribute),
Aaron Plattner's avatar
Aaron Plattner committed
318 319 320
                   nvevent->value,
                   nvevent->value
                   );
Aaron Plattner's avatar
Aaron Plattner committed
321

Aaron Plattner's avatar
Aaron Plattner committed
322 323 324
        /* Handle TARGET_ATTRIBUTE_CHANGED_EVENTS */
        } else if (event.type ==
                   (event_base + TARGET_ATTRIBUTE_CHANGED_EVENT)) {
Aaron Plattner's avatar
Aaron Plattner committed
325

Aaron Plattner's avatar
Aaron Plattner committed
326
            /* cast the X event as an XNVCtrlAttributeChangedEventTarget */
Aaron Plattner's avatar
Aaron Plattner committed
327 328
            XNVCtrlAttributeChangedEventTarget *nveventtarget =
                (XNVCtrlAttributeChangedEventTarget *) &event;
Aaron Plattner's avatar
Aaron Plattner committed
329

Aaron Plattner's avatar
Aaron Plattner committed
330 331 332 333 334
            target_str = targetTypeAndId2Str(nveventtarget->target_type,
                                             nveventtarget->target_id);

            /* print out the event information */
            printf("TARGET_ATTRIBUTE_CHANGED_EVENT:              Target: %15s  "
Aaron Plattner's avatar
Aaron Plattner committed
335 336 337 338
                   "Display Mask: 0x%08x   "
                   "Attribute: (%3d) %-32s   Value: %d (0x%08x)\n",
                   target_str,
                   nveventtarget->display_mask,
Aaron Plattner's avatar
Aaron Plattner committed
339 340
                   nveventtarget->attribute,
                   attr2str(nveventtarget->attribute),
Aaron Plattner's avatar
Aaron Plattner committed
341 342 343
                   nveventtarget->value,
                   nveventtarget->value
                   );
Aaron Plattner's avatar
Aaron Plattner committed
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403

        /* Handle TARGET_ATTRIBUTE_AVAILABILITY_CHANGED_EVENTS */
        } else if (event.type ==
                   (event_base + TARGET_ATTRIBUTE_AVAILABILITY_CHANGED_EVENT)) {

            /* cast the X event as an XNVCtrlAttributeChangedEventTargetAvailability */
            XNVCtrlAttributeChangedEventTargetAvailability *nveventavail =
                (XNVCtrlAttributeChangedEventTargetAvailability *) &event;

            target_str = targetTypeAndId2Str(nveventavail->target_type,
                                             nveventavail->target_id);

            /* print out the event information */
            printf("TARGET_ATTRIBUTE_AVAILABILITY_CHANGED_EVENT: Target: %15s  "
                   "Display Mask: 0x%08x   "
                   "Attribute: (%3d) %-32s   Available: %s\n",
                   target_str,
                   nveventavail->display_mask,
                   nveventavail->attribute,
                   attr2str(nveventavail->attribute),
                   nveventavail->availability ? "Yes" : "No"
                   );
        } else if (event.type ==
                   (event_base + TARGET_STRING_ATTRIBUTE_CHANGED_EVENT)) {

            XNVCtrlStringAttributeChangedEventTarget *nveventstring =
                (XNVCtrlStringAttributeChangedEventTarget*) &event;

            target_str = targetTypeAndId2Str(nveventstring->target_type,
                                             nveventstring->target_id);

            /* print out the event information */
            printf("TARGET_STRING_ATTRIBUTE_CHANGED_EVENT:       Target: %15s  "
                   "Display Mask: 0x%08x   "
                   "Attribute: %3d\n",
                   target_str,
                   nveventstring->display_mask,
                   nveventstring->attribute
                   );

        } else if (event.type ==
                   (event_base + TARGET_BINARY_ATTRIBUTE_CHANGED_EVENT)) {

            XNVCtrlBinaryAttributeChangedEventTarget *nveventbinary =
                (XNVCtrlBinaryAttributeChangedEventTarget *) &event;

            target_str = targetTypeAndId2Str(nveventbinary->target_type,
                                             nveventbinary->target_id);

            /* print out the event information */
            printf("TARGET_BINARY_ATTRIBUTE_CHANGED_EVENT:       Target: %15s  "
                   "Display Mask: 0x%08x   "
                   "Attribute: %3d\n",
                   target_str,
                   nveventbinary->display_mask,
                   nveventbinary->attribute
                   );

        } else {
            printf("ERROR: unrecognized event type %d\n", event.type);
Aaron Plattner's avatar
Aaron Plattner committed
404
        }
Aaron Plattner's avatar
Aaron Plattner committed
405
    }
Aaron Plattner's avatar
Aaron Plattner committed
406

Aaron Plattner's avatar
Aaron Plattner committed
407 408 409 410 411
    return 0;
}



Aaron Plattner's avatar
Aaron Plattner committed
412 413 414 415 416
/*
 * target2str() - translate a target type into a string
 */
static const char *target2str(int n)
{
Aaron Plattner's avatar
Aaron Plattner committed
417 418
    static char unknown[24];

Aaron Plattner's avatar
Aaron Plattner committed
419
    switch (n) {
Aaron Plattner's avatar
Aaron Plattner committed
420 421 422 423
    case NV_CTRL_TARGET_TYPE_X_SCREEN:
        return "X Screen";
    case NV_CTRL_TARGET_TYPE_GPU:
        return "GPU";
Aaron Plattner's avatar
Aaron Plattner committed
424 425
    case NV_CTRL_TARGET_TYPE_DISPLAY:
        return "Display";
Aaron Plattner's avatar
Aaron Plattner committed
426 427 428 429 430 431 432 433 434 435
    case NV_CTRL_TARGET_TYPE_FRAMELOCK:
        return "Frame Lock";
    case NV_CTRL_TARGET_TYPE_VCSC:
        return "VCS";
    case NV_CTRL_TARGET_TYPE_GVI:
        return "GVI";
    case NV_CTRL_TARGET_TYPE_COOLER:
        return "Cooler";
    case NV_CTRL_TARGET_TYPE_THERMAL_SENSOR:
        return "Thermal Sensor";
Aaron Plattner's avatar
Aaron Plattner committed
436 437
    case NV_CTRL_TARGET_TYPE_3D_VISION_PRO_TRANSCEIVER:
        return "3D Vision Pro Transceiver";
Aaron Plattner's avatar
Aaron Plattner committed
438
    default:
Aaron Plattner's avatar
Aaron Plattner committed
439 440
        snprintf(unknown, 24, "Unknown (%d)", n);
        return unknown;
Aaron Plattner's avatar
Aaron Plattner committed
441 442 443
    }
}

Aaron Plattner's avatar
Aaron Plattner committed
444 445 446 447 448 449 450 451 452
static const char *targetTypeAndId2Str(int targetType, int targetId)
{
    static char tmp[256];

    snprintf(tmp, sizeof(tmp), "%s-%-3d", target2str(targetType), targetId);

    return tmp;
}

Aaron Plattner's avatar
Aaron Plattner committed
453

Aaron Plattner's avatar
Aaron Plattner committed
454 455
// Used to convert the NV-CONTROL #defines to human readable text.
#define MAKE_ENTRY(ATTRIBUTE) { ATTRIBUTE, #ATTRIBUTE, NULL }
Aaron Plattner's avatar
Aaron Plattner committed
456

Aaron Plattner's avatar
Aaron Plattner committed
457 458 459 460 461
typedef struct {
    int num;
    char *str;
    char *name;
} AttrEntry;
Aaron Plattner's avatar
Aaron Plattner committed
462

Aaron Plattner's avatar
Aaron Plattner committed
463
static AttrEntry attr_table[];
Aaron Plattner's avatar
Aaron Plattner committed
464 465 466

static const char *attr2str(int n)
{
Aaron Plattner's avatar
Aaron Plattner committed
467 468 469 470 471 472 473 474 475 476 477 478 479 480 481
    AttrEntry *entry;

    entry = attr_table;
    while (entry->str) {
        if (entry->num == n) {
            if (!entry->name) {
                int len;
                entry->name = strdup(entry->str + 8);
                for (len = 0; len < strlen(entry->name); len++) {
                    entry->name[len] = tolower(entry->name[len]);
                }
            }
            return entry->name;
        }
        entry++;
Aaron Plattner's avatar
Aaron Plattner committed
482
    }
Aaron Plattner's avatar
Aaron Plattner committed
483 484 485 486 487 488 489 490 491 492 493

    return NULL;
}

// Attribute -> String table, generated using:
//
// grep 'define.*\/\*' NVCtrl.h | sed 's/.*define \([^ ]*\).*/    MAKE_ENTRY(\1),/' > DATA | head DATA
//
static AttrEntry attr_table[] = {
    MAKE_ENTRY(NV_CTRL_FLATPANEL_SCALING),
    MAKE_ENTRY(NV_CTRL_FLATPANEL_DITHERING),
Aaron Plattner's avatar
Aaron Plattner committed
494
    MAKE_ENTRY(NV_CTRL_DITHERING),
Aaron Plattner's avatar
Aaron Plattner committed
495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550
    MAKE_ENTRY(NV_CTRL_DIGITAL_VIBRANCE),
    MAKE_ENTRY(NV_CTRL_BUS_TYPE),
    MAKE_ENTRY(NV_CTRL_VIDEO_RAM),
    MAKE_ENTRY(NV_CTRL_IRQ),
    MAKE_ENTRY(NV_CTRL_OPERATING_SYSTEM),
    MAKE_ENTRY(NV_CTRL_SYNC_TO_VBLANK),
    MAKE_ENTRY(NV_CTRL_LOG_ANISO),
    MAKE_ENTRY(NV_CTRL_FSAA_MODE),
    MAKE_ENTRY(NV_CTRL_UBB),
    MAKE_ENTRY(NV_CTRL_OVERLAY),
    MAKE_ENTRY(NV_CTRL_STEREO),
    MAKE_ENTRY(NV_CTRL_EMULATE),
    MAKE_ENTRY(NV_CTRL_TWINVIEW),
    MAKE_ENTRY(NV_CTRL_CONNECTED_DISPLAYS),
    MAKE_ENTRY(NV_CTRL_ENABLED_DISPLAYS),
    MAKE_ENTRY(NV_CTRL_FRAMELOCK),
    MAKE_ENTRY(NV_CTRL_FRAMELOCK_MASTER),
    MAKE_ENTRY(NV_CTRL_FRAMELOCK_POLARITY),
    MAKE_ENTRY(NV_CTRL_FRAMELOCK_SYNC_DELAY),
    MAKE_ENTRY(NV_CTRL_FRAMELOCK_SYNC_INTERVAL),
    MAKE_ENTRY(NV_CTRL_FRAMELOCK_PORT0_STATUS),
    MAKE_ENTRY(NV_CTRL_FRAMELOCK_PORT1_STATUS),
    MAKE_ENTRY(NV_CTRL_FRAMELOCK_HOUSE_STATUS),
    MAKE_ENTRY(NV_CTRL_FRAMELOCK_SYNC),
    MAKE_ENTRY(NV_CTRL_FRAMELOCK_SYNC_READY),
    MAKE_ENTRY(NV_CTRL_FRAMELOCK_STEREO_SYNC),
    MAKE_ENTRY(NV_CTRL_FRAMELOCK_TEST_SIGNAL),
    MAKE_ENTRY(NV_CTRL_FRAMELOCK_ETHERNET_DETECTED),
    MAKE_ENTRY(NV_CTRL_FRAMELOCK_VIDEO_MODE),
    MAKE_ENTRY(NV_CTRL_FRAMELOCK_SYNC_RATE),
    MAKE_ENTRY(NV_CTRL_FORCE_GENERIC_CPU),
    MAKE_ENTRY(NV_CTRL_OPENGL_AA_LINE_GAMMA),
    MAKE_ENTRY(NV_CTRL_FRAMELOCK_TIMING),
    MAKE_ENTRY(NV_CTRL_FLIPPING_ALLOWED),
    MAKE_ENTRY(NV_CTRL_ARCHITECTURE),
    MAKE_ENTRY(NV_CTRL_TEXTURE_CLAMPING),
    MAKE_ENTRY(NV_CTRL_FSAA_APPLICATION_CONTROLLED),
    MAKE_ENTRY(NV_CTRL_LOG_ANISO_APPLICATION_CONTROLLED),
    MAKE_ENTRY(NV_CTRL_IMAGE_SHARPENING),
    MAKE_ENTRY(NV_CTRL_TV_OVERSCAN),
    MAKE_ENTRY(NV_CTRL_TV_FLICKER_FILTER),
    MAKE_ENTRY(NV_CTRL_TV_BRIGHTNESS),
    MAKE_ENTRY(NV_CTRL_TV_HUE),
    MAKE_ENTRY(NV_CTRL_TV_CONTRAST),
    MAKE_ENTRY(NV_CTRL_TV_SATURATION),
    MAKE_ENTRY(NV_CTRL_TV_RESET_SETTINGS),
    MAKE_ENTRY(NV_CTRL_GPU_CORE_TEMPERATURE),
    MAKE_ENTRY(NV_CTRL_GPU_CORE_THRESHOLD),
    MAKE_ENTRY(NV_CTRL_GPU_DEFAULT_CORE_THRESHOLD),
    MAKE_ENTRY(NV_CTRL_GPU_MAX_CORE_THRESHOLD),
    MAKE_ENTRY(NV_CTRL_AMBIENT_TEMPERATURE),
    MAKE_ENTRY(NV_CTRL_PBUFFER_SCANOUT_SUPPORTED),
    MAKE_ENTRY(NV_CTRL_PBUFFER_SCANOUT_XID),
    MAKE_ENTRY(NV_CTRL_GVO_SUPPORTED),
    MAKE_ENTRY(NV_CTRL_GVO_SYNC_MODE),
    MAKE_ENTRY(NV_CTRL_GVO_SYNC_SOURCE),
Aaron Plattner's avatar
Aaron Plattner committed
551 552
    MAKE_ENTRY(NV_CTRL_GVIO_REQUESTED_VIDEO_FORMAT),
    MAKE_ENTRY(NV_CTRL_GVIO_DETECTED_VIDEO_FORMAT),
Aaron Plattner's avatar
Aaron Plattner committed
553 554 555 556 557 558 559 560 561 562
    MAKE_ENTRY(NV_CTRL_GVO_DATA_FORMAT),
    MAKE_ENTRY(NV_CTRL_GVO_COMPOSITE_SYNC_INPUT_DETECTED),
    MAKE_ENTRY(NV_CTRL_GVO_COMPOSITE_SYNC_INPUT_DETECT_MODE),
    MAKE_ENTRY(NV_CTRL_GVO_SDI_SYNC_INPUT_DETECTED),
    MAKE_ENTRY(NV_CTRL_GVO_VIDEO_OUTPUTS),
    MAKE_ENTRY(NV_CTRL_GVO_FIRMWARE_VERSION),
    MAKE_ENTRY(NV_CTRL_GVO_SYNC_DELAY_PIXELS),
    MAKE_ENTRY(NV_CTRL_GVO_SYNC_DELAY_LINES),
    MAKE_ENTRY(NV_CTRL_GVO_INPUT_VIDEO_FORMAT_REACQUIRE),
    MAKE_ENTRY(NV_CTRL_GVO_GLX_LOCKED),
Aaron Plattner's avatar
Aaron Plattner committed
563 564 565
    MAKE_ENTRY(NV_CTRL_GVIO_VIDEO_FORMAT_WIDTH),
    MAKE_ENTRY(NV_CTRL_GVIO_VIDEO_FORMAT_HEIGHT),
    MAKE_ENTRY(NV_CTRL_GVIO_VIDEO_FORMAT_REFRESH_RATE),
Aaron Plattner's avatar
Aaron Plattner committed
566 567 568 569 570 571 572 573 574 575 576
    MAKE_ENTRY(NV_CTRL_GPU_CURRENT_CLOCK_FREQS),
    MAKE_ENTRY(NV_CTRL_FLATPANEL_CHIP_LOCATION),
    MAKE_ENTRY(NV_CTRL_FLATPANEL_LINK),
    MAKE_ENTRY(NV_CTRL_FLATPANEL_SIGNAL),
    MAKE_ENTRY(NV_CTRL_USE_HOUSE_SYNC),
    MAKE_ENTRY(NV_CTRL_EDID_AVAILABLE),
    MAKE_ENTRY(NV_CTRL_FORCE_STEREO),
    MAKE_ENTRY(NV_CTRL_IMAGE_SETTINGS),
    MAKE_ENTRY(NV_CTRL_XINERAMA),
    MAKE_ENTRY(NV_CTRL_XINERAMA_STEREO),
    MAKE_ENTRY(NV_CTRL_BUS_RATE),
Aaron Plattner's avatar
Aaron Plattner committed
577
    MAKE_ENTRY(NV_CTRL_SHOW_SLI_VISUAL_INDICATOR),
Aaron Plattner's avatar
Aaron Plattner committed
578
    MAKE_ENTRY(NV_CTRL_XV_SYNC_TO_DISPLAY),
Aaron Plattner's avatar
Aaron Plattner committed
579
    MAKE_ENTRY(NV_CTRL_GVIO_REQUESTED_VIDEO_FORMAT2),
Aaron Plattner's avatar
Aaron Plattner committed
580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625
    MAKE_ENTRY(NV_CTRL_GVO_OVERRIDE_HW_CSC),
    MAKE_ENTRY(NV_CTRL_GVO_CAPABILITIES),
    MAKE_ENTRY(NV_CTRL_GVO_COMPOSITE_TERMINATION),
    MAKE_ENTRY(NV_CTRL_ASSOCIATED_DISPLAY_DEVICES),
    MAKE_ENTRY(NV_CTRL_FRAMELOCK_SLAVES),
    MAKE_ENTRY(NV_CTRL_FRAMELOCK_MASTERABLE),
    MAKE_ENTRY(NV_CTRL_PROBE_DISPLAYS),
    MAKE_ENTRY(NV_CTRL_REFRESH_RATE),
    MAKE_ENTRY(NV_CTRL_GVO_FLIP_QUEUE_SIZE),
    MAKE_ENTRY(NV_CTRL_CURRENT_SCANLINE),
    MAKE_ENTRY(NV_CTRL_INITIAL_PIXMAP_PLACEMENT),
    MAKE_ENTRY(NV_CTRL_PCI_BUS),
    MAKE_ENTRY(NV_CTRL_PCI_DEVICE),
    MAKE_ENTRY(NV_CTRL_PCI_FUNCTION),
    MAKE_ENTRY(NV_CTRL_FRAMELOCK_FPGA_REVISION),
    MAKE_ENTRY(NV_CTRL_MAX_SCREEN_WIDTH),
    MAKE_ENTRY(NV_CTRL_MAX_SCREEN_HEIGHT),
    MAKE_ENTRY(NV_CTRL_MAX_DISPLAYS),
    MAKE_ENTRY(NV_CTRL_DYNAMIC_TWINVIEW),
    MAKE_ENTRY(NV_CTRL_MULTIGPU_DISPLAY_OWNER),
    MAKE_ENTRY(NV_CTRL_FSAA_APPLICATION_ENHANCED),
    MAKE_ENTRY(NV_CTRL_FRAMELOCK_SYNC_RATE_4),
    MAKE_ENTRY(NV_CTRL_GVO_LOCK_OWNER),
    MAKE_ENTRY(NV_CTRL_HWOVERLAY),
    MAKE_ENTRY(NV_CTRL_NUM_GPU_ERRORS_RECOVERED),
    MAKE_ENTRY(NV_CTRL_REFRESH_RATE_3),
    MAKE_ENTRY(NV_CTRL_GPU_POWER_SOURCE),
    MAKE_ENTRY(NV_CTRL_GPU_CURRENT_PERFORMANCE_MODE),
    MAKE_ENTRY(NV_CTRL_GLYPH_CACHE),
    MAKE_ENTRY(NV_CTRL_GPU_CURRENT_PERFORMANCE_LEVEL),
    MAKE_ENTRY(NV_CTRL_GPU_ADAPTIVE_CLOCK_STATE),
    MAKE_ENTRY(NV_CTRL_GVO_OUTPUT_VIDEO_LOCKED),
    MAKE_ENTRY(NV_CTRL_GVO_SYNC_LOCK_STATUS),
    MAKE_ENTRY(NV_CTRL_GVO_ANC_TIME_CODE_GENERATION),
    MAKE_ENTRY(NV_CTRL_GVO_COMPOSITE),
    MAKE_ENTRY(NV_CTRL_GVO_COMPOSITE_ALPHA_KEY),
    MAKE_ENTRY(NV_CTRL_GVO_COMPOSITE_LUMA_KEY_RANGE),
    MAKE_ENTRY(NV_CTRL_GVO_COMPOSITE_CR_KEY_RANGE),
    MAKE_ENTRY(NV_CTRL_GVO_COMPOSITE_CB_KEY_RANGE),
    MAKE_ENTRY(NV_CTRL_GVO_COMPOSITE_NUM_KEY_RANGES),
    MAKE_ENTRY(NV_CTRL_SWITCH_TO_DISPLAYS),
    MAKE_ENTRY(NV_CTRL_NOTEBOOK_DISPLAY_CHANGE_LID_EVENT),
    MAKE_ENTRY(NV_CTRL_NOTEBOOK_INTERNAL_LCD),
    MAKE_ENTRY(NV_CTRL_DEPTH_30_ALLOWED),
    MAKE_ENTRY(NV_CTRL_MODE_SET_EVENT),
    MAKE_ENTRY(NV_CTRL_OPENGL_AA_LINE_GAMMA_VALUE),
Aaron Plattner's avatar
Aaron Plattner committed
626
    MAKE_ENTRY(NV_CTRL_VCSC_HIGH_PERF_MODE),
Aaron Plattner's avatar
Aaron Plattner committed
627 628
    MAKE_ENTRY(NV_CTRL_DISPLAYPORT_LINK_RATE),
    MAKE_ENTRY(NV_CTRL_STEREO_EYES_EXCHANGE),
Aaron Plattner's avatar
Aaron Plattner committed
629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678
    MAKE_ENTRY(NV_CTRL_NO_SCANOUT),
    MAKE_ENTRY(NV_CTRL_GVO_CSC_CHANGED_EVENT),
    MAKE_ENTRY(NV_CTRL_FRAMELOCK_SLAVEABLE ),
    MAKE_ENTRY(NV_CTRL_GVO_SYNC_TO_DISPLAY),
    MAKE_ENTRY(NV_CTRL_X_SERVER_UNIQUE_ID),
    MAKE_ENTRY(NV_CTRL_PIXMAP_CACHE),
    MAKE_ENTRY(NV_CTRL_PIXMAP_CACHE_ROUNDING_SIZE_KB),
    MAKE_ENTRY(NV_CTRL_IS_GVO_DISPLAY),
    MAKE_ENTRY(NV_CTRL_PCI_ID),
    MAKE_ENTRY(NV_CTRL_GVO_FULL_RANGE_COLOR),
    MAKE_ENTRY(NV_CTRL_SLI_MOSAIC_MODE_AVAILABLE),
    MAKE_ENTRY(NV_CTRL_GVO_ENABLE_RGB_DATA),
    MAKE_ENTRY(NV_CTRL_IMAGE_SHARPENING_DEFAULT),
    MAKE_ENTRY(NV_CTRL_PCI_DOMAIN),
    MAKE_ENTRY(NV_CTRL_GVI_NUM_JACKS),
    MAKE_ENTRY(NV_CTRL_GVI_MAX_LINKS_PER_STREAM),
    MAKE_ENTRY(NV_CTRL_GVI_DETECTED_CHANNEL_BITS_PER_COMPONENT),
    MAKE_ENTRY(NV_CTRL_GVI_REQUESTED_STREAM_BITS_PER_COMPONENT),
    MAKE_ENTRY(NV_CTRL_GVI_DETECTED_CHANNEL_COMPONENT_SAMPLING),
    MAKE_ENTRY(NV_CTRL_GVI_REQUESTED_STREAM_COMPONENT_SAMPLING),
    MAKE_ENTRY(NV_CTRL_GVI_REQUESTED_STREAM_CHROMA_EXPAND),
    MAKE_ENTRY(NV_CTRL_GVI_DETECTED_CHANNEL_COLOR_SPACE),
    MAKE_ENTRY(NV_CTRL_GVI_DETECTED_CHANNEL_LINK_ID),
    MAKE_ENTRY(NV_CTRL_GVI_DETECTED_CHANNEL_SMPTE352_IDENTIFIER),
    MAKE_ENTRY(NV_CTRL_GVI_GLOBAL_IDENTIFIER),
    MAKE_ENTRY(NV_CTRL_FRAMELOCK_SYNC_DELAY_RESOLUTION),
    MAKE_ENTRY(NV_CTRL_GPU_COOLER_MANUAL_CONTROL),
    MAKE_ENTRY(NV_CTRL_THERMAL_COOLER_LEVEL),
    MAKE_ENTRY(NV_CTRL_THERMAL_COOLER_LEVEL_SET_DEFAULT),
    MAKE_ENTRY(NV_CTRL_THERMAL_COOLER_CONTROL_TYPE),
    MAKE_ENTRY(NV_CTRL_THERMAL_COOLER_TARGET),
    MAKE_ENTRY(NV_CTRL_GPU_ECC_SUPPORTED),
    MAKE_ENTRY(NV_CTRL_GPU_ECC_STATUS),
    MAKE_ENTRY(NV_CTRL_GPU_ECC_CONFIGURATION_SUPPORTED),
    MAKE_ENTRY(NV_CTRL_GPU_ECC_CONFIGURATION),
    MAKE_ENTRY(NV_CTRL_GPU_ECC_DEFAULT_CONFIGURATION),
    MAKE_ENTRY(NV_CTRL_GPU_ECC_SINGLE_BIT_ERRORS),
    MAKE_ENTRY(NV_CTRL_GPU_ECC_DOUBLE_BIT_ERRORS),
    MAKE_ENTRY(NV_CTRL_GPU_ECC_AGGREGATE_SINGLE_BIT_ERRORS),
    MAKE_ENTRY(NV_CTRL_GPU_ECC_AGGREGATE_DOUBLE_BIT_ERRORS),
    MAKE_ENTRY(NV_CTRL_GPU_ECC_RESET_ERROR_STATUS),
    MAKE_ENTRY(NV_CTRL_GPU_POWER_MIZER_MODE),
    MAKE_ENTRY(NV_CTRL_GVI_SYNC_OUTPUT_FORMAT),
    MAKE_ENTRY(NV_CTRL_GVI_MAX_CHANNELS_PER_JACK),
    MAKE_ENTRY(NV_CTRL_GVI_MAX_STREAMS ),
    MAKE_ENTRY(NV_CTRL_GVI_NUM_CAPTURE_SURFACES),
    MAKE_ENTRY(NV_CTRL_OVERSCAN_COMPENSATION),
    MAKE_ENTRY(NV_CTRL_GPU_PCIE_GENERATION),
    MAKE_ENTRY(NV_CTRL_GVI_BOUND_GPU),
    MAKE_ENTRY(NV_CTRL_GVIO_REQUESTED_VIDEO_FORMAT3),
Aaron Plattner's avatar
Aaron Plattner committed
679
    MAKE_ENTRY(NV_CTRL_ACCELERATE_TRAPEZOIDS),
Aaron Plattner's avatar
Aaron Plattner committed
680 681 682 683 684
    MAKE_ENTRY(NV_CTRL_GPU_CORES),
    MAKE_ENTRY(NV_CTRL_GPU_MEMORY_BUS_WIDTH),
    MAKE_ENTRY(NV_CTRL_GVI_TEST_MODE),
    MAKE_ENTRY(NV_CTRL_COLOR_SPACE),
    MAKE_ENTRY(NV_CTRL_COLOR_RANGE),
Aaron Plattner's avatar
Aaron Plattner committed
685
    MAKE_ENTRY(NV_CTRL_SHOW_GSYNC_VISUAL_INDICATOR),
Aaron Plattner's avatar
Aaron Plattner committed
686 687
    MAKE_ENTRY(NV_CTRL_GPU_SCALING_DEFAULT_TARGET),
    MAKE_ENTRY(NV_CTRL_GPU_SCALING_DEFAULT_METHOD),
Aaron Plattner's avatar
Aaron Plattner committed
688 689 690
    MAKE_ENTRY(NV_CTRL_DITHERING_MODE),
    MAKE_ENTRY(NV_CTRL_CURRENT_DITHERING),
    MAKE_ENTRY(NV_CTRL_CURRENT_DITHERING_MODE),
Aaron Plattner's avatar
Aaron Plattner committed
691 692 693
    MAKE_ENTRY(NV_CTRL_THERMAL_SENSOR_READING),
    MAKE_ENTRY(NV_CTRL_THERMAL_SENSOR_PROVIDER),
    MAKE_ENTRY(NV_CTRL_THERMAL_SENSOR_TARGET),
Aaron Plattner's avatar
Aaron Plattner committed
694 695 696 697
    MAKE_ENTRY(NV_CTRL_SHOW_MULTIGPU_VISUAL_INDICATOR),
    MAKE_ENTRY(NV_CTRL_GPU_CURRENT_PROCESSOR_CLOCK_FREQS),
    MAKE_ENTRY(NV_CTRL_GVIO_VIDEO_FORMAT_FLAGS),
    MAKE_ENTRY(NV_CTRL_GPU_PCIE_MAX_LINK_SPEED),
Aaron Plattner's avatar
Aaron Plattner committed
698 699 700 701
    MAKE_ENTRY(NV_CTRL_3D_VISION_PRO_RESET_TRANSCEIVER_TO_FACTORY_SETTINGS),
    MAKE_ENTRY(NV_CTRL_3D_VISION_PRO_TRANSCEIVER_CHANNEL),
    MAKE_ENTRY(NV_CTRL_3D_VISION_PRO_TRANSCEIVER_MODE),
    MAKE_ENTRY(NV_CTRL_SYNCHRONOUS_PALETTE_UPDATES),
Aaron Plattner's avatar
Aaron Plattner committed
702 703
    MAKE_ENTRY(NV_CTRL_DITHERING_DEPTH),
    MAKE_ENTRY(NV_CTRL_CURRENT_DITHERING_DEPTH),
Aaron Plattner's avatar
Aaron Plattner committed
704 705 706 707 708 709 710 711 712 713 714
    MAKE_ENTRY(NV_CTRL_3D_VISION_PRO_TRANSCEIVER_CHANNEL_FREQUENCY),
    MAKE_ENTRY(NV_CTRL_3D_VISION_PRO_TRANSCEIVER_CHANNEL_QUALITY),
    MAKE_ENTRY(NV_CTRL_3D_VISION_PRO_TRANSCEIVER_CHANNEL_COUNT),
    MAKE_ENTRY(NV_CTRL_3D_VISION_PRO_PAIR_GLASSES),
    MAKE_ENTRY(NV_CTRL_3D_VISION_PRO_UNPAIR_GLASSES),
    MAKE_ENTRY(NV_CTRL_3D_VISION_PRO_DISCOVER_GLASSES),
    MAKE_ENTRY(NV_CTRL_3D_VISION_PRO_IDENTIFY_GLASSES),
    MAKE_ENTRY(NV_CTRL_3D_VISION_PRO_GLASSES_SYNC_CYCLE),
    MAKE_ENTRY(NV_CTRL_3D_VISION_PRO_GLASSES_MISSED_SYNC_CYCLES),
    MAKE_ENTRY(NV_CTRL_3D_VISION_PRO_GLASSES_BATTERY_LEVEL),
    MAKE_ENTRY(NV_CTRL_3D_VISION_PRO_GLASSES_BATTERY_LEVEL),
Aaron Plattner's avatar
Aaron Plattner committed
715
    MAKE_ENTRY(NV_CTRL_GVO_ANC_PARITY_COMPUTATION),
Aaron Plattner's avatar
Aaron Plattner committed
716 717
    MAKE_ENTRY(NV_CTRL_3D_VISION_PRO_GLASSES_PAIR_EVENT),
    MAKE_ENTRY(NV_CTRL_3D_VISION_PRO_GLASSES_UNPAIR_EVENT),
Aaron Plattner's avatar
Aaron Plattner committed
718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735
    MAKE_ENTRY(NV_CTRL_GPU_PCIE_CURRENT_LINK_WIDTH),
    MAKE_ENTRY(NV_CTRL_GPU_PCIE_CURRENT_LINK_SPEED),
    MAKE_ENTRY(NV_CTRL_GVO_AUDIO_BLANKING),
    MAKE_ENTRY(NV_CTRL_CURRENT_METAMODE_ID),
    MAKE_ENTRY(NV_CTRL_DISPLAY_ENABLED),
    MAKE_ENTRY(NV_CTRL_FRAMELOCK_INCOMING_HOUSE_SYNC_RATE),
    MAKE_ENTRY(NV_CTRL_FXAA),
    MAKE_ENTRY(NV_CTRL_DISPLAY_RANDR_OUTPUT_ID),
    MAKE_ENTRY(NV_CTRL_FRAMELOCK_DISPLAY_CONFIG),
    MAKE_ENTRY(NV_CTRL_TOTAL_DEDICATED_GPU_MEMORY),
    MAKE_ENTRY(NV_CTRL_USED_DEDICATED_GPU_MEMORY),
    MAKE_ENTRY(NV_CTRL_GPU_DOUBLE_PRECISION_BOOST_IMMEDIATE),
    MAKE_ENTRY(NV_CTRL_GPU_DOUBLE_PRECISION_BOOST_REBOOT),
    MAKE_ENTRY(NV_CTRL_DPY_HDMI_3D),
    MAKE_ENTRY(NV_CTRL_BASE_MOSAIC),
    MAKE_ENTRY(NV_CTRL_MULTIGPU_MASTER_POSSIBLE),
    MAKE_ENTRY(NV_CTRL_GPU_POWER_MIZER_DEFAULT_MODE),
    MAKE_ENTRY(NV_CTRL_XV_SYNC_TO_DISPLAY_ID),
Aaron Plattner's avatar
Aaron Plattner committed
736
    MAKE_ENTRY(NV_CTRL_CURRENT_XV_SYNC_TO_DISPLAY_ID),
Aaron Plattner's avatar
Aaron Plattner committed
737
    MAKE_ENTRY(NV_CTRL_PALETTE_UPDATE_EVENT),
Aaron Plattner's avatar
Aaron Plattner committed
738
    MAKE_ENTRY(NV_CTRL_GSYNC_ALLOWED),
Aaron Plattner's avatar
Aaron Plattner committed
739 740
    { -1, NULL, NULL }
};