summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Plattner <aplattner@nvidia.com>2009-11-23 18:42:23 -0800
committerAaron Plattner <aplattner@nvidia.com>2009-11-23 18:42:23 -0800
commit25d9a353334be8c75255f61cff354c11163b0d08 (patch)
tree556f9ee6afb7d3f41032beafbe545e14e0423b22
parentd948d9b7bbdc46ada71bfc92931e6fd7601a6e8d (diff)
195.22195.22
-rw-r--r--doc/nvidia-settings.1.m46
-rw-r--r--src/XF86Config-parser/Generate.c238
-rw-r--r--src/XF86Config-parser/xf86Parser.h2
-rw-r--r--src/gtk+-2.x/Makefile.inc10
-rw-r--r--src/gtk+-2.x/ctkclocks.c2
-rw-r--r--src/gtk+-2.x/ctkcolorcorrection.c4
-rw-r--r--src/gtk+-2.x/ctkconfig.c8
-rw-r--r--src/gtk+-2.x/ctkdisplayconfig.c20
-rw-r--r--src/gtk+-2.x/ctkdisplaydevice-dfp.c4
-rw-r--r--src/gtk+-2.x/ctkecc.c658
-rw-r--r--src/gtk+-2.x/ctkecc.h91
-rw-r--r--src/gtk+-2.x/ctkevent.c4
-rw-r--r--src/gtk+-2.x/ctkframelock.c5
-rw-r--r--src/gtk+-2.x/ctkglx.c12
-rw-r--r--src/gtk+-2.x/ctkgpu.c56
-rw-r--r--src/gtk+-2.x/ctkgvi.c21
-rw-r--r--src/gtk+-2.x/ctkgvo-sync.c2
-rw-r--r--src/gtk+-2.x/ctkgvo.c10
-rw-r--r--src/gtk+-2.x/ctkgvo.h2
-rw-r--r--src/gtk+-2.x/ctkmultisample.c14
-rw-r--r--src/gtk+-2.x/ctkopengl.c4
-rw-r--r--src/gtk+-2.x/ctkpowermizer.c2
-rw-r--r--src/gtk+-2.x/ctkscreen.c4
-rw-r--r--src/gtk+-2.x/ctkslimm.c2
-rw-r--r--src/gtk+-2.x/ctkui.c4
-rw-r--r--src/gtk+-2.x/ctkwindow.c9
-rw-r--r--src/libXNVCtrl/NVCtrl.c176
-rw-r--r--src/libXNVCtrl/NVCtrl.h107
-rw-r--r--src/libXNVCtrl/NVCtrlLib.h28
-rw-r--r--src/libXNVCtrl/nv_control.h46
-rw-r--r--src/libXNVCtrlAttributes/NvCtrlAttributes.c40
-rw-r--r--src/libXNVCtrlAttributes/NvCtrlAttributes.h11
-rw-r--r--src/libXNVCtrlAttributes/NvCtrlAttributesNvControl.c28
-rw-r--r--src/libXNVCtrlAttributes/NvCtrlAttributesPrivate.h2
-rw-r--r--src/lscf.c4
-rw-r--r--src/parse.c28
36 files changed, 1413 insertions, 251 deletions
diff --git a/doc/nvidia-settings.1.m4 b/doc/nvidia-settings.1.m4
index 91c43fc..3e9eadf 100644
--- a/doc/nvidia-settings.1.m4
+++ b/doc/nvidia-settings.1.m4
@@ -199,6 +199,12 @@ Specify
.B \-q all
to query all attributes.
.TP
+.B \-t, \-\-terse
+When querying attribute values with the '--query' commandline option, only print the current value, rather than the more verbose description of the attribute, its valid values, and its current value.
+.TP
+.B \-d, \-\-display\-device\-string
+When printing attribute values in response to the '--query' option, if the attribute value is a display device mask, print the value as a list of display devices (e.g., "CRT-0, DFP-0"), rather than a hexidecimal bitmask (e.g., 0x00010001).
+.TP
.B \-g, \-\-glxinfo
Print GLX Information for the X display and exit.
.TP
diff --git a/src/XF86Config-parser/Generate.c b/src/XF86Config-parser/Generate.c
index b2e414a..89f4361 100644
--- a/src/XF86Config-parser/Generate.c
+++ b/src/XF86Config-parser/Generate.c
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the:
*
@@ -66,7 +66,7 @@ static void add_inputref(XConfigPtr config, XConfigLayoutPtr layout,
XConfigPtr xconfigGenerate(GenerateOptions *gop)
{
XConfigPtr config;
-
+
config = xconfigAlloc(sizeof(XConfigRec));
/* add files, fonts, and modules */
@@ -105,34 +105,34 @@ XConfigScreenPtr xconfigGenerateAddScreen(XConfigPtr config,
XConfigScreenPtr screen, s;
XConfigDevicePtr device;
XConfigMonitorPtr monitor;
-
+
monitor = xconfigAddMonitor(config, count);
device = add_device(config, bus, slot, boardname, count);
-
+
screen = xconfigAlloc(sizeof(XConfigScreenRec));
screen->identifier = xconfigAlloc(32);
snprintf(screen->identifier, 32, SCREEN_IDENTIFIER, count);
-
+
screen->device_name = xconfigStrdup(device->identifier);
screen->device = device;
screen->monitor_name = xconfigStrdup(monitor->identifier);
screen->monitor = monitor;
-
+
screen->defaultdepth = 24;
-
+
xconfigAddDisplay(&screen->displays, screen->defaultdepth);
/* append to the end of the screen list */
-
+
if (!config->screens) {
config->screens = screen;
} else {
for (s = config->screens; s->next; s = s->next);
s->next = screen;
}
-
+
return screen;
} /* xconfigGenerateAddScreen() */
@@ -149,16 +149,16 @@ XConfigScreenPtr xconfigGenerateAddScreen(XConfigPtr config,
void xconfigGenerateAssignScreenAdjacencies(XConfigLayoutPtr layout)
{
XConfigAdjacencyPtr adj, prev = NULL;
-
+
for (adj = layout->adjacencies; adj; adj = adj->next) {
-
+
if (prev) {
adj->where = CONF_ADJ_RIGHTOF;
adj->refscreen = xconfigStrdup(prev->screen_name);
} else {
adj->x = adj->y = -1;
}
-
+
/* make sure all the obsolete positioning is empty */
adj->top = NULL;
@@ -169,10 +169,10 @@ void xconfigGenerateAssignScreenAdjacencies(XConfigLayoutPtr layout)
adj->left_name = NULL;
adj->right = NULL;
adj->right_name = NULL;
-
+
prev = adj;
}
-
+
} /* xconfigGenerateAssignScreenAdjacencies() */
@@ -188,7 +188,7 @@ void xconfigGenerateAssignScreenAdjacencies(XConfigLayoutPtr layout)
static int is_file(const char *filename)
{
return (access(filename, F_OK) == 0);
-
+
} /* is_file() */
@@ -208,14 +208,14 @@ static char *find_libdir(GenerateOptions *gop)
struct stat stat_buf;
FILE *stream = NULL;
char *s, *libdir = NULL;
-
+
/*
* run the pkg-config command and read the output; if the output
* is a directory, then return that as the libdir
*/
-
+
stream = popen("pkg-config --variable=libdir xorg-server", "r");
-
+
if (stream) {
char buf[256];
@@ -223,23 +223,23 @@ static char *find_libdir(GenerateOptions *gop)
while (1) {
if (fgets(buf, 255, stream) == NULL) break;
-
+
if (buf[0] != '\0') {
/* truncate any newline */
-
+
s = strchr(buf, '\n');
if (s) *s = '\0';
if ((stat(buf, &stat_buf) == 0) &&
(S_ISDIR(stat_buf.st_mode))) {
-
+
libdir = xconfigStrdup(buf);
break;
}
}
}
-
+
pclose(stream);
if (libdir) return libdir;
@@ -248,7 +248,7 @@ static char *find_libdir(GenerateOptions *gop)
/* otherwise, just fallback to [X PROJECT ROOT]/lib */
return xconfigStrcat(gop->x_project_root, "/lib", NULL);
-
+
} /* find_libdir() */
@@ -264,12 +264,12 @@ static void add_font_path(GenerateOptions *gop, XConfigPtr config)
{
int i, ret;
char *path, *p, *orig, *fonts_dir, *libdir;
-
+
/*
* The below font path has been constructed from various examples
* and uses some suggests from the Font De-uglification HOWTO
*/
-
+
static const char *__font_paths[] = {
"LIBDIR/X11/fonts/local/",
"LIBDIR/X11/fonts/misc/:unscaled",
@@ -292,7 +292,7 @@ static void add_font_path(GenerateOptions *gop, XConfigPtr config)
"/usr/lib/openoffice/share/fonts/truetype",
NULL
};
-
+
/*
* if a font server is running, set the font path to that
*
@@ -312,7 +312,7 @@ static void add_font_path(GenerateOptions *gop, XConfigPtr config)
/* get the X server libdir */
libdir = find_libdir(gop);
-
+
for (i = 0; __font_paths[i]; i++) {
path = xconfigStrdup(__font_paths[i]);
@@ -323,7 +323,7 @@ static void add_font_path(GenerateOptions *gop, XConfigPtr config)
free(path);
path = p;
}
-
+
/* temporarily chop off any ":unscaled" appendage */
p = strchr(path, ':');
@@ -339,7 +339,7 @@ static void add_font_path(GenerateOptions *gop, XConfigPtr config)
continue;
}
free(fonts_dir);
-
+
/* add the ":unscaled" back */
if (p) *p = ':';
@@ -385,7 +385,7 @@ static void add_modules(GenerateOptions *gop, XConfigPtr config)
if (gop->autoloads_glx) return;
config->modules = xconfigAlloc(sizeof(XConfigModuleRec));
-
+
xconfigAddNewLoadDirective(&l, xconfigStrdup("dbe"),
XCONFIG_LOAD_MODULE, NULL, FALSE);
xconfigAddNewLoadDirective(&l, xconfigStrdup("extmod"),
@@ -405,9 +405,9 @@ static void add_modules(GenerateOptions *gop, XConfigPtr config)
#endif
xconfigAddNewLoadDirective(&l, xconfigStrdup("glx"),
XCONFIG_LOAD_MODULE, NULL, FALSE);
-
+
config->modules->loads = l;
-
+
} /* add_modules() */
@@ -425,12 +425,12 @@ XConfigMonitorPtr xconfigAddMonitor(XConfigPtr config, int count)
/* XXX need to query resman for the EDID */
monitor = xconfigAlloc(sizeof(XConfigMonitorRec));
-
+
monitor->identifier = xconfigAlloc(32);
snprintf(monitor->identifier, 32, MONITOR_IDENTIFIER, count);
monitor->vendor = xconfigStrdup("Unknown"); /* XXX */
monitor->modelname = xconfigStrdup("Unknown"); /* XXX */
-
+
/* XXX check EDID for freq ranges */
monitor->n_hsync = 1;
@@ -445,16 +445,16 @@ XConfigMonitorPtr xconfigAddMonitor(XConfigPtr config, int count)
xconfigAddNewOption(&monitor->options, "DPMS", NULL);
/* append to the end of the monitor list */
-
+
if (!config->monitors) {
config->monitors = monitor;
} else {
for (m = config->monitors; m->next; m = m->next);
m->next = monitor;
}
-
+
return monitor;
-
+
} /* xconfigAddMonitor() */
@@ -481,23 +481,23 @@ add_device(XConfigPtr config, int bus, int slot, char *boardname, int count)
}
if (boardname) device->board = xconfigStrdup(boardname);
-
+
device->chipid = -1;
device->chiprev = -1;
device->irq = -1;
device->screen = -1;
-
+
/* append to the end of the device list */
-
+
if (!config->devices) {
config->devices = device;
} else {
for (d = config->devices; d->next; d = d->next);
d->next = device;
}
-
+
return device;
-
+
} /* add_device() */
@@ -529,33 +529,33 @@ static void add_layout(GenerateOptions *gop, XConfigPtr config)
XConfigLayoutPtr layout;
XConfigAdjacencyPtr adj;
XConfigScreenPtr screen;
-
+
/* assume 1 X screen */
screen = xconfigGenerateAddScreen(config, -1, -1, NULL, 0);
-
+
/* create layout */
layout = xconfigAlloc(sizeof(XConfigLayoutRec));
-
+
layout->identifier = xconfigStrdup("Layout0");
-
+
adj = xconfigAlloc(sizeof(XConfigAdjacencyRec));
adj->scrnum = 0;
adj->screen = screen;
adj->screen_name = xconfigStrdup(screen->identifier);
-
+
layout->adjacencies = adj;
-
+
xconfigGenerateAssignScreenAdjacencies(layout);
-
+
add_inputref(config, layout, MOUSE_IDENTIFER, "CorePointer");
add_inputref(config, layout, KEYBOARD_IDENTIFER, "CoreKeyboard");
-
+
layout->next = config->layouts;
config->layouts = layout;
-
+
} /* add_layout() */
@@ -752,7 +752,7 @@ static const MouseEntry *find_closest_mouse_entry(const char *device,
{
int i;
int emulate3 = FALSE;
-
+
/*
* translate the emulate3 string into a boolean we can use below
* for comparison
@@ -768,20 +768,20 @@ static const MouseEntry *find_closest_mouse_entry(const char *device,
/*
* skip the "/dev/" part of the device filename
*/
-
+
if (device && (strncmp(device, "/dev/", 5) == 0)) {
device += 5; /* strlen("/dev/") */
}
-
+
for (i = 0; __mice[i].name; i++) {
if ((device) && (strcmp(device, __mice[i].device) != 0)) continue;
if ((proto) && (strcasecmp(proto, __mice[i].Xproto)) != 0) continue;
if ((emulate3_str) && (emulate3 != __mice[i].emulate3)) continue;
return &__mice[i];
}
-
+
return NULL;
-
+
} /* find_closest_mouse_entry() */
@@ -801,14 +801,14 @@ static char *find_config_entry(const char *filename, const char *keyword)
char *tmp, *start, *c, *end;
struct stat stat_buf;
size_t len;
-
+
if ((fd = open(filename, O_RDONLY)) == -1) goto done;
-
+
if (fstat(fd, &stat_buf) == -1) goto done;
-
+
if ((data = mmap(0, stat_buf.st_size, PROT_READ, MAP_SHARED,
fd, 0)) == (void *) -1) goto done;
-
+
/*
* create a sysmem copy of the buffer, so that we can explicitly
* NULL terminate it
@@ -820,9 +820,9 @@ static char *find_config_entry(const char *filename, const char *keyword)
memcpy(buf, data, stat_buf.st_size);
buf[stat_buf.st_size] = '\0';
-
+
/* search for the keyword */
-
+
start = buf;
while (TRUE) {
@@ -837,7 +837,7 @@ static char *find_config_entry(const char *filename, const char *keyword)
c = tmp;
while ((c >= start) && (*c != '\n') && (*c != '#')) c--;
-
+
if (*c == '#') {
/* keyword was commented out... search again */
start = tmp+1;
@@ -854,9 +854,9 @@ static char *find_config_entry(const char *filename, const char *keyword)
/* there must be something between the start and the end */
if (start == end) goto done;
-
+
/* take what is between as the value */
-
+
len = end - start;
value = xconfigAlloc(len + 1);
strncpy(value, start, len);
@@ -871,7 +871,7 @@ static char *find_config_entry(const char *filename, const char *keyword)
free(value);
value = tmp;
}
-
+
done:
if (buf) free(buf);
@@ -879,7 +879,7 @@ static char *find_config_entry(const char *filename, const char *keyword)
if (fd != -1) close(fd);
return value;
-
+
} /* find_config_entry() */
@@ -891,13 +891,13 @@ static char *find_config_entry(const char *filename, const char *keyword)
void xconfigGeneratePrintPossibleMice(void)
{
int i;
-
+
printf("%-25s%-35s\n\n", "Short Name", "Name");
-
+
for (i = 0; __mice[i].name; i++) {
printf("%-25s%-35s\n", __mice[i].shortname, __mice[i].name);
}
-
+
printf("\n");
} /* xconfigGeneratePrintPossibleMice() */
@@ -925,9 +925,9 @@ int xconfigAddMouse(GenerateOptions *gop, XConfigPtr config)
const MouseEntry *entry = NULL;
XConfigInputPtr input;
char *device_path, *comment = "default";
-
+
/* if the user specified on the commandline, use that */
-
+
if (gop->mouse) {
entry = find_mouse_entry(gop->mouse);
if (entry) {
@@ -937,19 +937,19 @@ int xconfigAddMouse(GenerateOptions *gop, XConfigPtr config)
gop->mouse);
}
}
-
+
/*
* if /etc/sysconfig/mouse exists, and contains valid data, use
* that
*/
-
+
if (!entry) {
char *protocol, *device, *emulate3;
-
+
device = find_config_entry("/etc/sysconfig/mouse", "DEVICE=");
protocol = find_config_entry("/etc/sysconfig/mouse", "XMOUSETYPE=");
emulate3 = find_config_entry("/etc/sysconfig/mouse", "XEMU3=");
-
+
if (device || protocol || emulate3) {
entry = find_closest_mouse_entry(device, protocol, emulate3);
if (entry) {
@@ -962,10 +962,10 @@ int xconfigAddMouse(GenerateOptions *gop, XConfigPtr config)
if (!entry) {
char *protocol, *device;
-
+
protocol = find_config_entry("/etc/conf.d/gpm", "MOUSE=");
device = find_config_entry("/etc/conf.d/gpm", "MOUSEDEV=");
-
+
if (protocol && device) {
MouseEntry *e = xconfigAlloc(sizeof(MouseEntry));
e->shortname = "custom";
@@ -978,7 +978,7 @@ int xconfigAddMouse(GenerateOptions *gop, XConfigPtr config)
comment = "data in \"/etc/conf.d/gpm\"";
}
}
-
+
/*
* XXX we could try to infer the settings from the commandline
* options gpm is using
@@ -987,9 +987,9 @@ int xconfigAddMouse(GenerateOptions *gop, XConfigPtr config)
if (!entry) {
/* XXX implement me */
}
-
+
/* at this point, we must have a mouse entry */
-
+
if (!entry) {
MouseEntry *e = xconfigAlloc(sizeof(MouseEntry));
e->Xproto = "auto";
@@ -1012,7 +1012,7 @@ int xconfigAddMouse(GenerateOptions *gop, XConfigPtr config)
/* add a new mouse input section */
input = xconfigAlloc(sizeof(XConfigInputRec));
-
+
input->comment = xconfigStrcat(" # generated from ",
comment, "\n", NULL);
input->identifier = xconfigStrdup("Mouse0");
@@ -1026,20 +1026,20 @@ int xconfigAddMouse(GenerateOptions *gop, XConfigPtr config)
xconfigAddNewOption(&input->options, "Emulate3Buttons",
(entry->emulate3 ? "yes" : "no"));
TEST_FREE(device_path);
-
-
+
+
/*
* This will make wheel mice work, and non-wheel mice should
* ignore ZAxisMapping
*/
xconfigAddNewOption(&input->options, "ZAxisMapping", "4 5");
-
+
input->next = config->inputs;
config->inputs = input;
-
+
return TRUE;
-
+
} /* xconfigAddMouse() */
@@ -1069,23 +1069,23 @@ typedef struct {
*
*
* keyboard_models.py - keyboard model list
- *
+ *
* Brent Fox <bfox@redhat.com>
* Mike Fulbright <msf@redhat.com>
* Jeremy Katz <katzj@redhat.com>
- *
+ *
* Copyright 2002 Red Hat, Inc.
- *
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
@@ -1093,7 +1093,7 @@ typedef struct {
*/
static const KeyboardEntry __keyboards[] = {
-
+
/* keytable name layout model variant options */
{ "be-latin1", "Belgian (be-latin1)", "be", "pc105", NULL, NULL },
@@ -1186,13 +1186,13 @@ static const KeyboardEntry *find_keyboard_entry(char *value)
void xconfigGeneratePrintPossibleKeyboards(void)
{
int i;
-
+
printf("%-25s%-35s\n\n", "Short Name", "Name");
for (i = 0; __keyboards[i].name; i++) {
printf("%-25s%-35s\n", __keyboards[i].keytable, __keyboards[i].name);
}
-
+
printf("\n");
} /* xconfigGeneratePrintPossibleKeyboards() */
@@ -1215,13 +1215,13 @@ int xconfigAddKeyboard(GenerateOptions *gop, XConfigPtr config)
{
char *value, *comment = "default";
const KeyboardEntry *entry = NULL;
-
+
XConfigInputPtr input;
-
+
/*
* if the user specified on the command line, use that
*/
-
+
if (gop->keyboard) {
entry = find_keyboard_entry(gop->keyboard);
if (entry) {
@@ -1231,7 +1231,7 @@ int xconfigAddKeyboard(GenerateOptions *gop, XConfigPtr config)
gop->keyboard);
}
}
-
+
/*
* if /etc/sysconfig/keyboard exists, and contains a valid
* KEYTABLE entry, use that
@@ -1249,9 +1249,9 @@ int xconfigAddKeyboard(GenerateOptions *gop, XConfigPtr config)
}
/* add a new keyboard input section */
-
+
input = xconfigAlloc(sizeof(XConfigInputRec));
-
+
input->comment = xconfigStrcat(" # generated from ",
comment, "\n", NULL);
input->identifier = xconfigStrdup("Keyboard0");
@@ -1263,7 +1263,7 @@ int xconfigAddKeyboard(GenerateOptions *gop, XConfigPtr config)
* otherwise, use "keyboard".
* On Solaris, use the default "keyboard"
*/
-
+
if (gop->keyboard_driver) {
input->driver = gop->keyboard_driver;
} else {
@@ -1277,7 +1277,7 @@ int xconfigAddKeyboard(GenerateOptions *gop, XConfigPtr config)
}
#endif
}
-
+
/*
* set additional keyboard options, based on the Keyboard table
* entry we found above
@@ -1295,12 +1295,12 @@ int xconfigAddKeyboard(GenerateOptions *gop, XConfigPtr config)
if (entry->options)
xconfigAddNewOption(&input->options, "XkbOptions", entry->options);
}
-
+
input->next = config->inputs;
config->inputs = input;
return TRUE;
-
+
} /* xconfigAddKeyboard() */
@@ -1318,18 +1318,18 @@ static char *xconfigGetDefaultProjectRoot(void)
char *paths[] = { "/usr/X11R6", "/usr/X11", NULL };
struct stat stat_buf;
int i;
-
+
for (i = 0; paths[i]; i++) {
-
+
if (stat(paths[i], &stat_buf) == -1) {
continue;
}
-
+
if (S_ISDIR(stat_buf.st_mode)) {
return paths[i];
}
}
-
+
/* default to "/usr/X11R6", I guess */
return paths[0];
@@ -1462,21 +1462,21 @@ void xconfigGetXServerInUse(GenerateOptions *gop)
int isXorg;
int dummy, len, found;
char *cmd, *ptr, *ret;
-
+
gop->supports_extension_section = FALSE;
gop->autoloads_glx = FALSE;
/* run `X -version` with a PATH that hopefully includes the X binary */
-
+
cmd = xconfigStrcat("PATH=", gop->x_project_root, ":",
EXTRA_PATH, ":$PATH ", XSERVER_BIN_NAME,
" -version 2>&1", NULL);
-
+
if ((stream = popen(cmd, "r"))) {
char buf[NV_LINE_LEN];
-
+
/* read in as much of the input as we can fit into the buffer */
-
+
ptr = buf;
do {
@@ -1484,18 +1484,18 @@ void xconfigGetXServerInUse(GenerateOptions *gop)
ret = fgets(ptr, len, stream);
ptr = strchr(ptr, '\0');
} while ((ret != NULL) && (len > 1));
-
+
/*
* process the `X -version` output to infer relevant
* information from this X server
*/
-
+
found = get_xserver_information(buf,
&isXorg,
&dummy, /* isModular */
&gop->autoloads_glx,
&gop->supports_extension_section);
-
+
if (found) {
if (isXorg) {
xserver = X_IS_XORG;
@@ -1521,7 +1521,7 @@ void xconfigGetXServerInUse(GenerateOptions *gop)
}
free(xorgpath);
}
-
+
gop->xserver=xserver;
} /* xconfigGetXServerInUse() */
diff --git a/src/XF86Config-parser/xf86Parser.h b/src/XF86Config-parser/xf86Parser.h
index 3369725..f207e31 100644
--- a/src/XF86Config-parser/xf86Parser.h
+++ b/src/XF86Config-parser/xf86Parser.h
@@ -79,7 +79,7 @@
#endif // defined(__linux__)
// Unix variations: SunOS
-#if !defined(NV_SUNOS) && defined(__sun__) || defined(__sun)
+#if !defined(NV_SUNOS) && (defined(__sun__) || defined(__sun))
# define NV_SUNOS
#endif // defined(__sun__)
diff --git a/src/gtk+-2.x/Makefile.inc b/src/gtk+-2.x/Makefile.inc
index 44f1ec6..ac33d9c 100644
--- a/src/gtk+-2.x/Makefile.inc
+++ b/src/gtk+-2.x/Makefile.inc
@@ -65,9 +65,10 @@ SRC += \
ctkdisplayconfig-utils.c \
ctkgvo-banner.c \
ctkgvo-sync.c \
- ctklicense.c \
ctkgvi.c \
- ctkpowersavings.c
+ ctklicense.c \
+ ctkpowersavings.c \
+ ctkecc.c
EXTRA_DIST += \
@@ -113,9 +114,10 @@ EXTRA_DIST += \
ctkpowersavings.h \
ctkgvo-banner.h \
ctkgvo-sync.h \
- ctklicense.h \
ctkgvi.h \
- ctkpowersavings.h
+ ctklicense.h \
+ ctkpowersavings.h \
+ ctkecc.h
dist_list::
@ echo $(SRC) $(EXTRA_DIST)
diff --git a/src/gtk+-2.x/ctkclocks.c b/src/gtk+-2.x/ctkclocks.c
index 55c9650..e09b413 100644
--- a/src/gtk+-2.x/ctkclocks.c
+++ b/src/gtk+-2.x/ctkclocks.c
@@ -602,7 +602,7 @@ GtkTextBuffer *ctk_clocks_create_help(GtkTextTagTable *table,
"WARNING: Overclocking has the potential of destroying your "
"graphics card, CPU, RAM and any other component. It may "
"also reduce the life expectancy of your components and "
- "void manufacturer warranties. DO THIS AT YOUR OWN RISK. "
+ "void manufacturer warranties. DO THIS AT YOUR OWN RISK."
);
ctk_help_heading(b, &i, "Enabeling Clock Frequencies");
ctk_help_para(b, &i, __enable_button_help);
diff --git a/src/gtk+-2.x/ctkcolorcorrection.c b/src/gtk+-2.x/ctkcolorcorrection.c
index 169582d..b375347 100644
--- a/src/gtk+-2.x/ctkcolorcorrection.c
+++ b/src/gtk+-2.x/ctkcolorcorrection.c
@@ -45,7 +45,7 @@
static const char *__active_color_help = "The Active Color Channel drop-down "
"menu allows you to select the color channel controlled by the Brightness, "
-"Contrast and Gamma sliders. You can adjust the red, green or blue channels "
+"Contrast and Gamma sliders. You can adjust the red, green or blue channels "
"individually or all three channels at once.";
static const char *__resest_button_help = "The Reset Hardware Defaults "
@@ -1024,7 +1024,7 @@ GtkTextBuffer *ctk_color_correction_create_help(GtkTextTagTable *table)
"or gamma values for the selected color channel(s). This "
"helps you to compensate "
"for variations in luminance between a source image and "
- "its output on a display device. This is useful when "
+ "its output on a display device. This is useful when "
"working with image processing applications to help "
"provide more accurate color reproduction of images (such "
"as photographs) when they are displayed on your "
diff --git a/src/gtk+-2.x/ctkconfig.c b/src/gtk+-2.x/ctkconfig.c
index 441e93e..f9d0542 100644
--- a/src/gtk+-2.x/ctkconfig.c
+++ b/src/gtk+-2.x/ctkconfig.c
@@ -69,12 +69,12 @@ static const char *__x_display_names_help =
static const char *__show_quit_dialog_help =
"When this option is enabled, nvidia-settings will ask if you "
-"really want to quit when the quit button is pressed. ";
+"really want to quit when the quit button is pressed.";
static const char *__save_current_config_help =
"When nvidia-settings exits, it saves the current X server "
"configuration to a configuration file (\"~/.nvidia-settings-rc\", "
-"by default). Use this button to save the current X server "
+"by default). Use this button to save the current X server "
"configuration immediately, optionally to a different file.";
static void ctk_config_class_init(CtkConfigClass *ctk_config_class);
@@ -515,8 +515,8 @@ GtkTextBuffer *ctk_config_create_help(GtkTextTagTable *table)
ctk_help_heading(b, &i, "Active Timers");
ctk_help_para(b, &i, "Some attributes are polled periodically "
- "to ensure the reported values are up-to-date. "
- " Each row in the 'Active Timers' table reflects "
+ "to ensure the reported values are up-to-date. "
+ "Each row in the 'Active Timers' table reflects "
"the configuration of one of these timers and "
"controls how frequently, if at all, a given "
"attribute is polled. The 'Description' field "
diff --git a/src/gtk+-2.x/ctkdisplayconfig.c b/src/gtk+-2.x/ctkdisplayconfig.c
index 8fd8bba..2fdb9f5 100644
--- a/src/gtk+-2.x/ctkdisplayconfig.c
+++ b/src/gtk+-2.x/ctkdisplayconfig.c
@@ -177,18 +177,18 @@ static const char * __dpy_refresh_mnu_help =
static const char * __dpy_position_type_help =
"The Position Type drop-down allows you to set how the selected display "
-"device is placed within the X screen. This is only available when "
+"device is placed within the X screen. This is only available when "
"multiple display devices are present.";
static const char * __dpy_position_relative_help =
"The Position Relative drop-down allows you to set which other display "
"device (within the X screen) the selected display device should be "
-"relative to. This is only available when multiple display "
+"relative to. This is only available when multiple display "
"devices are present.";
static const char * __dpy_position_offset_help =
"The Position Offset identifies the top left of the display device "
-"as an offset from the top left of the X screen position. This is only "
+"as an offset from the top left of the X screen position. This is only "
"available when multiple display devices are present.";
static const char * __dpy_panning_help =
@@ -204,7 +204,7 @@ static const char * __dpy_primary_help =
/* Screen tooltips */
static const char * __screen_virtual_size_help =
-"The Virtual Size allows setting the size of the resulting X screen. "
+"The Virtual Size allows setting the size of the resulting X screen. "
"The virtual size must be at least large enough to hold all the display "
"devices that are currently enabled for scanout.";
@@ -213,20 +213,20 @@ static const char * __screen_depth_help =
"screen; changing this option will require restarting your X server.";
static const char * __screen_position_type_help =
-"The Position Type drop-down appears when two or more display devices are active. "
+"The Position Type drop-down appears when two or more display devices are active. "
"This allows you to set how the selected screen "
"is placed within the X server layout; changing this option will require "
"restarting your X server.";
static const char * __screen_position_relative_help =
-"The Position Relative drop-down appears when two or more display devices are active. "
-"This allows you to set which other Screen "
+"The Position Relative drop-down appears when two or more display devices "
+"are active. This allows you to set which other Screen "
"the selected screen should be relative to; changing this option will "
"require restarting your X server.";
static const char * __screen_position_offset_help =
-"The Position Offset drop-down appears when two or more display devices are active. "
-"This identifies the top left of the selected Screen as "
+"The Position Offset drop-down appears when two or more display devices "
+"are active. This identifies the top left of the selected Screen as "
"an offset from the top left of the X server layout in absolute coordinates; "
"changing this option will require restarting your X server.";
@@ -3474,6 +3474,8 @@ static void setup_screen_page(CtkDisplayConfig *ctk_object)
/* Setup the screen number */
tmp = g_strdup_printf("%d", screen->scrnum);
+ g_object_set(gtk_widget_get_settings(ctk_object->txt_screen_num),
+ "gtk-label-select-on-focus", FALSE, NULL);
gtk_label_set_text(GTK_LABEL(ctk_object->txt_screen_num), tmp);
g_free(tmp);
diff --git a/src/gtk+-2.x/ctkdisplaydevice-dfp.c b/src/gtk+-2.x/ctkdisplaydevice-dfp.c
index ba20523..6cab80f 100644
--- a/src/gtk+-2.x/ctkdisplaydevice-dfp.c
+++ b/src/gtk+-2.x/ctkdisplaydevice-dfp.c
@@ -86,7 +86,7 @@ static const char *__scaling_help =
"A flat panel usually has a single 'native' resolution. If you are "
"using a resolution that is smaller than the flat panel's native "
"resolution, then Flat Panel Scaling can adjust how the image is "
-"displayed on the flat panel. This setting will only take effect when "
+"displayed on the flat panel. This setting will only take effect when "
"GPU scaling is active, which occurs when the frontend and backend "
"resolutions of the current mode are different.";
@@ -870,7 +870,7 @@ GtkTextBuffer *ctk_display_device_dfp_create_help(GtkTextTagTable *table,
ctk_help_term(b, &i, "Centered");
ctk_help_para(b, &i, "The image will only occupy the number of pixels "
- "needed and be centered on the flat panel. Setting this "
+ "needed and be centered on the flat panel. Setting this "
"will disable image sharpening for the display device.");
ctk_help_term(b, &i, "Aspect Ratio Scaled");
diff --git a/src/gtk+-2.x/ctkecc.c b/src/gtk+-2.x/ctkecc.c
new file mode 100644
index 0000000..01c5f46
--- /dev/null
+++ b/src/gtk+-2.x/ctkecc.c
@@ -0,0 +1,658 @@
+/*
+ * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix
+ * and Linux systems.
+ *
+ * Copyright (C) 2009 NVIDIA Corporation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of Version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2
+ * of the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the:
+ *
+ * Free Software Foundation, Inc.
+ * 59 Temple Place - Suite 330
+ * Boston, MA 02111-1307, USA
+ *
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include <inttypes.h>
+
+#include <gtk/gtk.h>
+#include <NvCtrlAttributes.h>
+
+#include "msg.h"
+
+#include "ctkutils.h"
+#include "ctkhelp.h"
+#include "ctkecc.h"
+#include "ctkgpu.h"
+#include "ctkbanner.h"
+
+#define DEFAULT_UPDATE_ECC_STATUS_INFO_TIME_INTERVAL 1000
+
+static const char *__ecc_settings_help =
+"This page allows you to change the Error Correction Code (ECC) "
+"setting for this GPU. You can also view memory details and the number "
+"of ECC events.";
+
+static const char *__ecc_status_help =
+"Returns the current hardware ECC setting "
+"for the targeted GPU.";
+
+static const char *__sbit_error_help =
+"Returns the number of single-bit ECC errors detected by "
+"the targeted GPU since the last POST.";
+
+static const char *__dbit_error_help =
+"Returns the number of double-bit ECC errors detected by "
+"the targeted GPU since the last POST.";
+
+static const char *__aggregate_sbit_error_help =
+"Returns the number of single-bit ECC errors detected by the "
+"targeted GPU since the last counter reset.";
+
+static const char *__aggregate_dbit_error_help =
+"Returns the number of double-bit ECC errors detected by the "
+"targeted GPU since the last counter reset.";
+
+static const char *__configuration_status_help =
+"Returns the current ECC configuration setting or specifies new "
+"settings. A new setting do not take effect until the next POST.";
+
+static const char *__clear_button_help =
+"This button is used to clear the ECC errors detected since last POST.";
+
+static const char *__clear_aggregate_button_help =
+"This button is used to reset aggregate ECC errors counter.";
+
+static const char *__reset_default_config_button_help =
+"The button is used to restore the GPU's default ECC configuration setting.";
+
+static void ecc_config_button_toggled(GtkWidget *, gpointer);
+
+GType ctk_ecc_get_type(void)
+{
+ static GType ctk_ecc_type = 0;
+
+ if (!ctk_ecc_type) {
+ static const GTypeInfo ctk_ecc_info = {
+ sizeof (CtkEccClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ NULL, /* constructor */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (CtkEcc),
+ 0, /* n_preallocs */
+ NULL, /* instance_init */
+ };
+
+ ctk_ecc_type =
+ g_type_register_static(GTK_TYPE_VBOX, "CtkEcc",
+ &ctk_ecc_info, 0);
+ }
+
+ return ctk_ecc_type;
+
+} /* ctk_ecc_get_type() */
+
+
+
+static void set_label_value(GtkWidget *widget, uint64_t val)
+{
+ gchar *s;
+
+ s = g_strdup_printf("%" PRIu64, val);
+ gtk_label_set_text(GTK_LABEL(widget), s);
+ g_free(s);
+}
+
+
+
+/*
+ * add_table_int_row() - helper function to add label-value pair to table.
+ */
+
+static GtkWidget *add_table_int_row(CtkConfig *ctk_config, GtkWidget *table,
+ const gchar *help, gchar *label1,
+ uint64_t val, gint row,
+ gboolean ecc_enabled)
+{
+ GtkWidget *hbox2, *label, *eventbox;
+
+ gtk_table_resize(GTK_TABLE(table), row+1, 2);
+ hbox2 = gtk_hbox_new(FALSE, 0);
+ gtk_table_attach(GTK_TABLE(table), hbox2, 0, 1, row, row+1,
+ GTK_FILL, GTK_FILL | GTK_EXPAND, 5, 0);
+
+ label = gtk_label_new(label1);
+ gtk_misc_set_alignment(GTK_MISC(label), 0.0f, 0.5f);
+ gtk_box_pack_start(GTK_BOX(hbox2), label, FALSE, FALSE, 0);
+ gtk_widget_set_sensitive(label, ecc_enabled);
+
+ eventbox = gtk_event_box_new();
+ gtk_table_attach(GTK_TABLE(table), eventbox, 1, 2, row, row+1,
+ GTK_FILL, GTK_FILL | GTK_EXPAND, 5, 0);
+
+ label = gtk_label_new(NULL);
+ set_label_value(label, val);
+ gtk_misc_set_alignment(GTK_MISC(label), 0.0f, 0.5f);
+ gtk_container_add(GTK_CONTAINER(eventbox), label);
+ ctk_config_set_tooltip(ctk_config, eventbox, help);
+ gtk_widget_set_sensitive(label, ecc_enabled);
+
+ return label;
+} /* add_table_int_row() */
+
+
+
+/*
+ * update_ecc_info() - update ECC status and configuration
+ */
+
+static gboolean update_ecc_info(gpointer user_data)
+{
+ CtkEcc *ctk_ecc = CTK_ECC(user_data);
+ int64_t val;
+ gint ecc_config;
+ ReturnStatus ret;
+
+ if ( ctk_ecc->ecc_enabled == FALSE ) {
+ goto end;
+ }
+
+ /* Query ECC Errors */
+
+ if ( ctk_ecc->sbit_error ) {
+ ret = NvCtrlGetAttribute64(ctk_ecc->handle,
+ NV_CTRL_GPU_ECC_SINGLE_BIT_ERRORS,
+ &val);
+ if ( ret != NvCtrlSuccess ) {
+ val = 0;
+ }
+ set_label_value(ctk_ecc->sbit_error, val);
+ }
+
+ if ( ctk_ecc->dbit_error ) {
+ ret = NvCtrlGetAttribute64(ctk_ecc->handle,
+ NV_CTRL_GPU_ECC_DOUBLE_BIT_ERRORS,
+ &val);
+ if ( ret != NvCtrlSuccess ) {
+ val = 0;
+ }
+ set_label_value(ctk_ecc->dbit_error, val);
+ }
+
+ if ( ctk_ecc->aggregate_sbit_error ) {
+ ret = NvCtrlGetAttribute64(ctk_ecc->handle,
+ NV_CTRL_GPU_ECC_AGGREGATE_SINGLE_BIT_ERRORS,
+ &val);
+ if ( ret != NvCtrlSuccess ) {
+ val = 0;
+ }
+ set_label_value(ctk_ecc->aggregate_sbit_error, val);
+ }
+
+ if ( ctk_ecc->aggregate_dbit_error ) {
+ ret = NvCtrlGetAttribute64(ctk_ecc->handle,
+ NV_CTRL_GPU_ECC_AGGREGATE_DOUBLE_BIT_ERRORS,
+ &val);
+ if ( ret != NvCtrlSuccess ) {
+ val = 0;
+ }
+ set_label_value(ctk_ecc->aggregate_dbit_error, val);
+ }
+end:
+ /* Query ECC configuration */
+
+ if ( ctk_ecc->configuration_status ) {
+ ret = NvCtrlGetAttribute(ctk_ecc->handle,
+ NV_CTRL_GPU_ECC_CONFIGURATION,
+ &ecc_config);
+ if (ret != NvCtrlSuccess ||
+ ecc_config != NV_CTRL_GPU_ECC_CONFIGURATION_ENABLED) {
+ ecc_config = 0;
+ } else {
+ ecc_config = 1;
+ }
+ g_signal_handlers_block_by_func(G_OBJECT(ctk_ecc->configuration_status),
+ G_CALLBACK(ecc_config_button_toggled),
+ (gpointer) ctk_ecc);
+ gtk_toggle_button_set_active(
+ GTK_TOGGLE_BUTTON(ctk_ecc->configuration_status),
+ ecc_config);
+ g_signal_handlers_unblock_by_func(G_OBJECT(ctk_ecc->configuration_status),
+ G_CALLBACK(ecc_config_button_toggled),
+ (gpointer) ctk_ecc);
+ }
+
+ return TRUE;
+} /* update_ecc_info() */
+
+
+
+/*
+ * reset_default_config_button_clicked() - callback function for reset default
+ * configuration button.
+ */
+
+static void reset_default_config_button_clicked(GtkWidget *widget,
+ gpointer user_data)
+{
+ gboolean status;
+ CtkEcc *ctk_ecc = CTK_ECC(user_data);
+
+ /* get default status and set it to ECC configuration */
+ NvCtrlGetAttribute(ctk_ecc->handle,
+ NV_CTRL_GPU_ECC_DEFAULT_CONFIGURATION,
+ &status);
+ NvCtrlSetAttribute(ctk_ecc->handle,
+ NV_CTRL_GPU_ECC_CONFIGURATION,
+ status);
+
+ ctk_config_statusbar_message(ctk_ecc->ctk_config,
+ "Set to default configuration.");
+} /* reset_default_config_button_clicked() */
+
+
+
+/*
+ * clear_ecc_errors_button_clicked() - callback function for clear ecc errors
+ * button
+ */
+
+static void clear_ecc_errors_button_clicked(GtkWidget *widget,
+ gpointer user_data)
+{
+ CtkEcc *ctk_ecc = CTK_ECC(user_data);
+
+ NvCtrlSetAttribute(ctk_ecc->handle,
+ NV_CTRL_GPU_ECC_RESET_ERROR_STATUS,
+ NV_CTRL_GPU_ECC_RESET_ERROR_STATUS_VOLATILE);
+
+ ctk_config_statusbar_message(ctk_ecc->ctk_config,
+ "ECC errors cleared.");
+} /* clear_ecc_errors_button_clicked() */
+
+
+
+/*
+ * clear_aggregate_ecc_errors_button_clicked() - callback function for
+ * clear aggregate ecc errors button.
+ */
+
+static void clear_aggregate_ecc_errors_button_clicked(GtkWidget *widget,
+ gpointer user_data)
+{
+ CtkEcc *ctk_ecc = CTK_ECC(user_data);
+
+ NvCtrlSetAttribute(ctk_ecc->handle,
+ NV_CTRL_GPU_ECC_RESET_ERROR_STATUS,
+ NV_CTRL_GPU_ECC_RESET_ERROR_STATUS_AGGREGATE);
+
+ ctk_config_statusbar_message(ctk_ecc->ctk_config,
+ "ECC aggregate errors cleared.");
+} /* clear_aggregate_ecc_errors_button_clicked() */
+
+
+
+/*
+ * ecc_config_button_toggled() - callback function for
+ * enable ECC checkbox.
+ */
+
+static void ecc_config_button_toggled(GtkWidget *widget,
+ gpointer user_data)
+{
+ gboolean enabled;
+ CtkEcc *ctk_ecc = CTK_ECC(user_data);
+ enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
+
+ NvCtrlSetAttribute(ctk_ecc->handle,
+ NV_CTRL_GPU_ECC_CONFIGURATION,
+ enabled);
+ ctk_config_statusbar_message(ctk_ecc->ctk_config,
+ "ECC %s.",
+ enabled ? "enabled" : "disabled");
+} /* ecc_config_button_toggled() */
+
+
+
+GtkWidget* ctk_ecc_new(NvCtrlAttributeHandle *handle,
+ CtkConfig *ctk_config,
+ CtkEvent *ctk_event)
+{
+ GObject *object;
+ CtkEcc *ctk_ecc;
+ GtkWidget *hbox, *hbox2, *vbox, *hsep, *hseparator, *table;
+ GtkWidget *banner, *label, *eventbox;
+ int64_t sbit_error, dbit_error, aggregate_sbit_error;
+ int64_t aggregate_dbit_error;
+ gint ecc_config_supported;
+ gint val, row = 0;
+ gboolean sbit_error_available, dbit_error_available;
+ gboolean aggregate_sbit_error_available, aggregate_dbit_error_available;
+ gboolean ecc_enabled;
+ ReturnStatus ret;
+ gchar *ecc_enabled_string;
+
+ /* make sure we have a handle */
+
+ g_return_val_if_fail(handle != NULL, NULL);
+
+ /*
+ * check if ECC support available.
+ */
+
+ ret = NvCtrlGetAttribute(handle,
+ NV_CTRL_GPU_ECC_SUPPORTED,
+ &val);
+ if (ret != NvCtrlSuccess || val != NV_CTRL_GPU_ECC_SUPPORTED_TRUE) {
+ return NULL;
+ }
+
+ /* create the CtkEcc object */
+
+ object = g_object_new(CTK_TYPE_ECC, NULL);
+
+ ctk_ecc = CTK_ECC(object);
+ ctk_ecc->handle = handle;
+ ctk_ecc->ctk_config = ctk_config;
+
+ sbit_error_available = TRUE;
+ dbit_error_available = TRUE;
+ aggregate_sbit_error_available = TRUE;
+ aggregate_dbit_error_available = TRUE;
+
+ sbit_error = dbit_error = 0;
+ aggregate_sbit_error = aggregate_dbit_error = 0;
+
+ /* Query ECC Status */
+
+ ret = NvCtrlGetAttribute(handle, NV_CTRL_GPU_ECC_STATUS,
+ &val);
+ if (ret != NvCtrlSuccess || val == NV_CTRL_GPU_ECC_STATUS_DISABLED) {
+ ecc_enabled = FALSE;
+ ecc_enabled_string = "Disabled";
+ } else {
+ ecc_enabled = TRUE;
+ ecc_enabled_string = "Enabled";
+ }
+ ctk_ecc->ecc_enabled = ecc_enabled;
+
+ /* Query ECC errors */
+
+ ret = NvCtrlGetAttribute64(handle, NV_CTRL_GPU_ECC_SINGLE_BIT_ERRORS,
+ &sbit_error);
+ if ( ret != NvCtrlSuccess ) {
+ sbit_error_available = FALSE;
+ }
+
+ ret = NvCtrlGetAttribute64(handle, NV_CTRL_GPU_ECC_DOUBLE_BIT_ERRORS,
+ &dbit_error);
+ if ( ret != NvCtrlSuccess ) {
+ dbit_error_available = FALSE;
+ }
+ ret = NvCtrlGetAttribute64(handle,
+ NV_CTRL_GPU_ECC_AGGREGATE_SINGLE_BIT_ERRORS,
+ &aggregate_sbit_error);
+ if ( ret != NvCtrlSuccess ) {
+ aggregate_sbit_error_available = FALSE;
+ }
+ ret = NvCtrlGetAttribute64(handle,
+ NV_CTRL_GPU_ECC_AGGREGATE_DOUBLE_BIT_ERRORS,
+ &aggregate_dbit_error);
+ if ( ret != NvCtrlSuccess ) {
+ aggregate_dbit_error_available = FALSE;
+ }
+
+ /* Query ECC configuration supported */
+
+ ret = NvCtrlGetAttribute(handle,
+ NV_CTRL_GPU_ECC_CONFIGURATION_SUPPORTED,
+ &ecc_config_supported);
+ if ( ret != NvCtrlSuccess ) {
+ ecc_config_supported = 0;
+ }
+
+ /* set container properties for the CtkEcc widget */
+
+ gtk_box_set_spacing(GTK_BOX(ctk_ecc), 5);
+
+ /* banner */
+
+ banner = ctk_banner_image_new(BANNER_ARTWORK_GPU);
+ gtk_box_pack_start(GTK_BOX(object), banner, FALSE, FALSE, 0);
+
+ vbox = gtk_vbox_new(FALSE, 5);
+ gtk_box_pack_start(GTK_BOX(object), vbox, TRUE, TRUE, 0);
+
+ hbox = gtk_hbox_new(FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
+
+ label = gtk_label_new("ECC Status");
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
+
+ hseparator = gtk_hseparator_new();
+ gtk_box_pack_start(GTK_BOX(hbox), hseparator, TRUE, TRUE, 5);
+
+ table = gtk_table_new(1, 2, FALSE);
+ gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0);
+ gtk_table_set_row_spacings(GTK_TABLE(table), 3);
+ gtk_table_set_col_spacings(GTK_TABLE(table), 15);
+ gtk_container_set_border_width(GTK_CONTAINER(table), 5);
+
+ /* ECC Status */
+ hbox2 = gtk_hbox_new(FALSE, 0);
+ gtk_table_attach(GTK_TABLE(table), hbox2, 0, 1, row, row+1,
+ GTK_FILL, GTK_FILL | GTK_EXPAND, 5, 0);
+
+ label = gtk_label_new("ECC:");
+ gtk_misc_set_alignment(GTK_MISC(label), 0.0f, 0.5f);
+ gtk_box_pack_start(GTK_BOX(hbox2), label, FALSE, FALSE, 0);
+
+ eventbox = gtk_event_box_new();
+ gtk_table_attach(GTK_TABLE(table), eventbox, 1, 2, row, row+1,
+ GTK_FILL, GTK_FILL | GTK_EXPAND, 5, 0);
+
+ label = gtk_label_new(ecc_enabled_string);
+ gtk_misc_set_alignment(GTK_MISC(label), 0.0f, 0.5f);
+ gtk_container_add(GTK_CONTAINER(eventbox), label);
+ ctk_config_set_tooltip(ctk_config, eventbox, __ecc_status_help);
+ ctk_ecc->status = label;
+
+ row += 3;
+
+ /* Add ECC Errors */
+
+ if ( sbit_error_available && dbit_error_available ) {
+ ctk_ecc->sbit_error =
+ add_table_int_row(ctk_config, table, __sbit_error_help,
+ "Single-bit ECC Errors:", sbit_error,
+ row, ecc_enabled);
+ row += 1;
+ ctk_ecc->dbit_error =
+ add_table_int_row(ctk_config, table, __dbit_error_help,
+ "Double-bit ECC Errors:", dbit_error,
+ row, ecc_enabled);
+ row += 3; // add vertical padding between rows
+ }
+
+ if ( aggregate_sbit_error_available && aggregate_dbit_error_available ) {
+ ctk_ecc->aggregate_sbit_error =
+ add_table_int_row(ctk_config, table, __aggregate_sbit_error_help,
+ "Aggregate Single-bit ECC Errors:",
+ aggregate_sbit_error,
+ row, ecc_enabled);
+ row += 1;
+ ctk_ecc->aggregate_dbit_error =
+ add_table_int_row(ctk_config, table, __aggregate_dbit_error_help,
+ "Aggregate Double-bit ECC Errors:",
+ aggregate_dbit_error, row, ecc_enabled);
+ }
+
+ /* ECC configuration settings */
+
+ hbox = gtk_hbox_new(FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
+
+ label = gtk_label_new("ECC Configuration");
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
+
+ hsep = gtk_hseparator_new();
+ gtk_box_pack_start(GTK_BOX(hbox), hsep, TRUE, TRUE, 5);
+
+ hbox2 = gtk_hbox_new(FALSE, 0);
+ ctk_ecc->configuration_status =
+ gtk_check_button_new_with_label("Enable ECC");
+ gtk_box_pack_start(GTK_BOX(hbox2),
+ ctk_ecc->configuration_status, FALSE, FALSE, 0);
+ gtk_container_set_border_width(GTK_CONTAINER(hbox2), 5);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox2, FALSE, FALSE, 0);
+ ctk_config_set_tooltip(ctk_config, ctk_ecc->configuration_status,
+ __configuration_status_help);
+ g_signal_connect(G_OBJECT(ctk_ecc->configuration_status), "clicked",
+ G_CALLBACK(ecc_config_button_toggled),
+ (gpointer) ctk_ecc);
+ gtk_widget_set_sensitive(ctk_ecc->configuration_status, ecc_config_supported);
+
+ hbox = gtk_hbox_new(FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(ctk_ecc), hbox, FALSE, FALSE, 0);
+
+ /* Add buttons */
+
+ if ( sbit_error_available && dbit_error_available ) {
+ ctk_ecc->clear_button = gtk_button_new_with_label("Clear ECC Errors");
+ gtk_box_pack_end(GTK_BOX(hbox), ctk_ecc->clear_button, FALSE, FALSE, 0);
+ ctk_config_set_tooltip(ctk_config, ctk_ecc->clear_button,
+ __clear_button_help);
+ gtk_widget_set_sensitive(ctk_ecc->clear_button, ecc_enabled);
+ g_signal_connect(G_OBJECT(ctk_ecc->clear_button), "clicked",
+ G_CALLBACK(clear_ecc_errors_button_clicked),
+ (gpointer) ctk_ecc);
+ }
+
+ if ( aggregate_sbit_error_available && aggregate_dbit_error_available ) {
+ ctk_ecc->clear_aggregate_button =
+ gtk_button_new_with_label("Clear Aggregate ECC Errors");
+ gtk_box_pack_end(GTK_BOX(hbox), ctk_ecc->clear_aggregate_button,
+ FALSE, FALSE, 0);
+ ctk_config_set_tooltip(ctk_config, ctk_ecc->clear_button,
+ __clear_aggregate_button_help);
+ gtk_widget_set_sensitive(ctk_ecc->clear_aggregate_button, ecc_enabled);
+ g_signal_connect(G_OBJECT(ctk_ecc->clear_aggregate_button),
+ "clicked",
+ G_CALLBACK(clear_aggregate_ecc_errors_button_clicked),
+ (gpointer) ctk_ecc);
+ }
+
+ ctk_ecc->reset_default_config_button =
+ gtk_button_new_with_label("Reset Default Configuration");
+ eventbox = gtk_event_box_new();
+ gtk_container_add(GTK_CONTAINER(eventbox),
+ ctk_ecc->reset_default_config_button);
+ gtk_box_pack_end(GTK_BOX(hbox), eventbox, FALSE, FALSE, 5);
+ ctk_config_set_tooltip(ctk_config, ctk_ecc->reset_default_config_button,
+ __reset_default_config_button_help);
+ gtk_widget_set_sensitive(ctk_ecc->reset_default_config_button,
+ ecc_config_supported && ecc_enabled);
+ g_signal_connect(G_OBJECT(ctk_ecc->reset_default_config_button),
+ "clicked",
+ G_CALLBACK(reset_default_config_button_clicked),
+ (gpointer) ctk_ecc);
+
+ /* Register a timer callback to update Ecc status info */
+
+ ctk_config_add_timer(ctk_ecc->ctk_config,
+ DEFAULT_UPDATE_ECC_STATUS_INFO_TIME_INTERVAL,
+ "ECC Settings",
+ (GSourceFunc) update_ecc_info,
+ (gpointer) ctk_ecc);
+
+ gtk_widget_show_all(GTK_WIDGET(ctk_ecc));
+
+ update_ecc_info(ctk_ecc);
+
+ return GTK_WIDGET(ctk_ecc);
+}
+
+GtkTextBuffer *ctk_ecc_create_help(GtkTextTagTable *table,
+ CtkEcc *ctk_ecc)
+{
+ GtkTextIter i;
+ GtkTextBuffer *b;
+
+ b = gtk_text_buffer_new(table);
+
+ gtk_text_buffer_get_iter_at_offset(b, &i, 0);
+
+ ctk_help_heading(b, &i, "ECC Settings Help");
+ ctk_help_para(b, &i, __ecc_settings_help);
+
+ ctk_help_heading(b, &i, "ECC");
+ ctk_help_para(b, &i, __ecc_status_help);
+
+ ctk_help_heading(b, &i, "Single-bit ECC Errors");
+ ctk_help_para(b, &i, __sbit_error_help);
+
+ ctk_help_heading(b, &i, "Double-bit ECC Errors");
+ ctk_help_para(b, &i, __dbit_error_help);
+
+ ctk_help_heading(b, &i, "Aggregate Single-bit ECC Errors");
+ ctk_help_para(b, &i, __aggregate_sbit_error_help);
+
+ ctk_help_heading(b, &i, "Aggregate Double-bit ECC Errors");
+ ctk_help_para(b, &i, __aggregate_dbit_error_help);
+
+ ctk_help_heading(b, &i, "ECC Configuration");
+ ctk_help_para(b, &i, __configuration_status_help);
+
+ ctk_help_heading(b, &i, "Enable ECC");
+ ctk_help_para(b, &i, __ecc_status_help);
+
+ ctk_help_heading(b, &i, "Reset Default Configuration");
+ ctk_help_para(b, &i, __reset_default_config_button_help);
+
+ ctk_help_heading(b, &i, "Clear Aggregate ECC Errors");
+ ctk_help_para(b, &i, __clear_aggregate_button_help);
+
+ ctk_help_heading(b, &i, "Clear ECC Errors");
+ ctk_help_para(b, &i, __clear_button_help);
+
+
+
+ ctk_help_finish(b);
+
+ return b;
+}
+
+void ctk_ecc_start_timer(GtkWidget *widget)
+{
+ CtkEcc *ctk_ecc = CTK_ECC(widget);
+
+ /* Start the ECC timer */
+
+ ctk_config_start_timer(ctk_ecc->ctk_config,
+ (GSourceFunc) update_ecc_info,
+ (gpointer) ctk_ecc);
+}
+
+void ctk_ecc_stop_timer(GtkWidget *widget)
+{
+ CtkEcc *ctk_ecc = CTK_ECC(widget);
+
+ /* Stop the ECC timer */
+
+ ctk_config_stop_timer(ctk_ecc->ctk_config,
+ (GSourceFunc) update_ecc_info,
+ (gpointer) ctk_ecc);
+}
diff --git a/src/gtk+-2.x/ctkecc.h b/src/gtk+-2.x/ctkecc.h
new file mode 100644
index 0000000..cd9086d
--- /dev/null
+++ b/src/gtk+-2.x/ctkecc.h
@@ -0,0 +1,91 @@
+/*
+ * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix
+ * and Linux systems.
+ *
+ * Copyright (C) 2009 NVIDIA Corporation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of Version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2
+ * of the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the:
+ *
+ * Free Software Foundation, Inc.
+ * 59 Temple Place - Suite 330
+ * Boston, MA 02111-1307, USA
+ *
+ */
+
+#ifndef __CTK_ECC_H__
+#define __CTK_ECC_H__
+
+#include "NvCtrlAttributes.h"
+#include "ctkevent.h"
+#include "ctkconfig.h"
+
+G_BEGIN_DECLS
+
+#define CTK_TYPE_ECC (ctk_ecc_get_type())
+
+#define CTK_ECC(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST ((obj), CTK_TYPE_ECC, CtkEcc))
+
+#define CTK_ECC_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST ((klass), CTK_TYPE_ECC, CtkEccClass))
+
+#define CTK_IS_ECC(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CTK_TYPE_ECC))
+
+#define CTK_IS_ECC_CLASS(class) \
+ (G_TYPE_CHECK_CLASS_TYPE ((klass), CTK_TYPE_ECC))
+
+#define CTK_ECC_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS ((obj), CTK_TYPE_ECC, CtkEccClass))
+
+
+typedef struct _CtkEcc CtkEcc;
+typedef struct _CtkEccClass CtkEccClass;
+
+struct _CtkEcc
+{
+ GtkVBox parent;
+
+ NvCtrlAttributeHandle *handle;
+ CtkConfig *ctk_config;
+
+ GtkWidget* status;
+ GtkWidget* sbit_error;
+ GtkWidget* dbit_error;
+ GtkWidget* aggregate_sbit_error;
+ GtkWidget* aggregate_dbit_error;
+ GtkWidget* ecc_config_supported;
+ GtkWidget* clear_button;
+ GtkWidget* clear_aggregate_button;
+ GtkWidget* reset_default_config_button;
+ GtkWidget* configuration_status;
+
+ gboolean ecc_enabled;
+
+};
+
+struct _CtkEccClass
+{
+ GtkVBoxClass parent_class;
+};
+
+GType ctk_ecc_get_type (void) G_GNUC_CONST;
+GtkWidget* ctk_ecc_new (NvCtrlAttributeHandle *, CtkConfig *, CtkEvent *);
+GtkTextBuffer* ctk_ecc_create_help (GtkTextTagTable *, CtkEcc *);
+
+void ctk_ecc_start_timer (GtkWidget *);
+void ctk_ecc_stop_timer (GtkWidget *);
+
+G_END_DECLS
+
+#endif /* __CTK_ECC_H__ */
diff --git a/src/gtk+-2.x/ctkevent.c b/src/gtk+-2.x/ctkevent.c
index 7690933..7f3c944 100644
--- a/src/gtk+-2.x/ctkevent.c
+++ b/src/gtk+-2.x/ctkevent.c
@@ -287,12 +287,14 @@ static void ctk_event_class_init(CtkEventClass *ctk_event_class)
MAKE_SIGNAL(NV_CTRL_THERMAL_COOLER_LEVEL_SET_DEFAULT);
MAKE_SIGNAL(NV_CTRL_THERMAL_COOLER_CONTROL_TYPE);
MAKE_SIGNAL(NV_CTRL_THERMAL_COOLER_TARGET);
+ MAKE_SIGNAL(NV_CTRL_GPU_ECC_CONFIGURATION);
MAKE_SIGNAL(NV_CTRL_GPU_POWER_MIZER_MODE);
MAKE_SIGNAL(NV_CTRL_GVI_SYNC_OUTPUT_FORMAT);
MAKE_SIGNAL(NV_CTRL_GVI_MAX_CHANNELS_PER_JACK);
MAKE_SIGNAL(NV_CTRL_GVI_MAX_STREAMS);
MAKE_SIGNAL(NV_CTRL_GVI_NUM_CAPTURE_SURFACES);
MAKE_SIGNAL(NV_CTRL_OVERSCAN_COMPENSATION);
+ MAKE_SIGNAL(NV_CTRL_GPU_PCIE_GENERATION);
#undef MAKE_SIGNAL
@@ -303,7 +305,7 @@ static void ctk_event_class_init(CtkEventClass *ctk_event_class)
* knows about.
*/
-#if NV_CTRL_LAST_ATTRIBUTE != NV_CTRL_OVERSCAN_COMPENSATION
+#if NV_CTRL_LAST_ATTRIBUTE != NV_CTRL_GPU_PCIE_GENERATION
#warning "There are attributes that do not emit signals!"
#endif
diff --git a/src/gtk+-2.x/ctkframelock.c b/src/gtk+-2.x/ctkframelock.c
index 6083946..204880e 100644
--- a/src/gtk+-2.x/ctkframelock.c
+++ b/src/gtk+-2.x/ctkframelock.c
@@ -1362,7 +1362,7 @@ static void update_framelock_controls(CtkFramelock *ctk_framelock)
/* G-Sync Buttons */
gtk_widget_set_sensitive(ctk_framelock->remove_devices_button,
- tree->nentries);
+ (tree->selected_entry==NULL)?FALSE:TRUE);
gtk_widget_set_sensitive(ctk_framelock->extra_info_button,
tree->nentries);
@@ -1618,6 +1618,9 @@ static void list_entry_clicked(GtkWidget *widget, GdkEventButton *event,
}
if (entry != entry->tree->selected_entry) {
list_entry_set_select(entry, True);
+
+ /* Update GUI state */
+ update_framelock_controls(entry->tree->ctk_framelock);
}
}
diff --git a/src/gtk+-2.x/ctkglx.c b/src/gtk+-2.x/ctkglx.c
index 4369564..8d38188 100644
--- a/src/gtk+-2.x/ctkglx.c
+++ b/src/gtk+-2.x/ctkglx.c
@@ -49,7 +49,7 @@ static const char * __fid_help =
static const char * __vid_help =
"vid (XVisual ID) - ID of the associated X Visual.";
static const char * __vt_help =
- "vt (XVisual Type) - Type of the associated X Visual. "
+ "vt (XVisual Type) - Type of the associated X Visual. "
"Possible X visual types are 'tc', 'dc', 'pc', 'sc', 'gs', 'sg' and '.' "
"which mean TrueColor, DirectColor, PseudoColor, StaticColor, GrayScale, "
"StaticGray and None, respectively.";
@@ -72,16 +72,16 @@ static const char * __st_help =
"st (Stereo buffer) - 'y' if the configuration has left and right color "
"buffers that are rendered to in stereo. '-' if this is not supported.";
static const char * __rs_help =
- "rs (Red size) - Number of bits per color used for red. "
+ "rs (Red size) - Number of bits per color used for red. "
"Undefined for configurations that use color indexing.";
static const char * __gs_help =
- "gs (Green size) - Number of bits per color used for green. "
+ "gs (Green size) - Number of bits per color used for green. "
"Undefined for configurations that use color indexing.";
static const char * __bs_help =
- "bs (Blue size) - Number of bits per color used for blue. "
+ "bs (Blue size) - Number of bits per color used for blue. "
"Undefined for configurations that use color indexing.";
static const char * __as_help =
- "as (Alpha size) - Number of bits per color used for alpha. "
+ "as (Alpha size) - Number of bits per color used for alpha. "
"Undefined for configurations that use color indexing.";
static const char * __aux_help =
"aux (Auxiliary buffers) - Number of available auxiliary color buffers.";
@@ -111,7 +111,7 @@ static const char * __cav_help =
"cav (Caveats) - Caveats for this configuration. A frame buffer "
"configuration may have the following caveats: 'NonC' if it supports "
"any non-conformant visual extension. 'Slow' if it has reduced "
- "preformance. '-' if it has no caveats.";
+ "preformance. '-' if it has no caveats.";
static const char * __pbw_help =
"pbw (Pbuffer width) - Width of pbuffer (in hexadecimal).";
static const char * __pbh_help =
diff --git a/src/gtk+-2.x/ctkgpu.c b/src/gtk+-2.x/ctkgpu.c
index b8790db..b94adfe 100644
--- a/src/gtk+-2.x/ctkgpu.c
+++ b/src/gtk+-2.x/ctkgpu.c
@@ -125,38 +125,62 @@ void get_bus_related_info(NvCtrlAttributeHandle *handle,
gchar **bus,
gchar **pci_bus_id)
{
- int tmp, ret;
+ int tmp, ret, bus_type;
int pci_domain, pci_bus, pci_device, pci_func;
- gchar *bus_type, *bus_rate, *bus_id;
+ gchar *bus_type_str, *bus_rate, *pcie_gen, *bus_id;
gchar *__pci_bus_id_unknown = "?@?:?:?";
/* NV_CTRL_BUS_TYPE */
- ret = NvCtrlGetAttribute(handle, NV_CTRL_BUS_TYPE, &tmp);
- bus_type = NULL;
+ bus_type = 0xffffffff;
+ bus_type_str = "Unknown";
+ ret = NvCtrlGetAttribute(handle, NV_CTRL_BUS_TYPE, &bus_type);
if (ret == NvCtrlSuccess) {
- if (tmp == NV_CTRL_BUS_TYPE_AGP) bus_type = "AGP";
- else if (tmp == NV_CTRL_BUS_TYPE_PCI) bus_type = "PCI";
- else if (tmp == NV_CTRL_BUS_TYPE_PCI_EXPRESS) bus_type = "PCI Express";
- else if (tmp == NV_CTRL_BUS_TYPE_INTEGRATED) bus_type = "Integrated";
+ if (bus_type == NV_CTRL_BUS_TYPE_AGP)
+ bus_type_str = "AGP";
+ else if (bus_type == NV_CTRL_BUS_TYPE_PCI)
+ bus_type_str = "PCI";
+ else if (bus_type == NV_CTRL_BUS_TYPE_PCI_EXPRESS)
+ bus_type_str = "PCI Express";
+ else if (bus_type == NV_CTRL_BUS_TYPE_INTEGRATED)
+ bus_type_str = "Integrated";
}
/* NV_CTRL_BUS_RATE */
bus_rate = NULL;
- if (tmp == NV_CTRL_BUS_TYPE_AGP ||
- tmp == NV_CTRL_BUS_TYPE_PCI_EXPRESS) {
+ if (bus_type == NV_CTRL_BUS_TYPE_AGP ||
+ bus_type == NV_CTRL_BUS_TYPE_PCI_EXPRESS) {
ret = NvCtrlGetAttribute(handle, NV_CTRL_BUS_RATE, &tmp);
if (ret == NvCtrlSuccess) {
- bus_rate = g_strdup_printf("%dX", tmp);
+ if (bus_type == NV_CTRL_BUS_TYPE_PCI_EXPRESS) {
+ bus_rate = g_strdup_printf("x%u", tmp);
+ } else {
+ bus_rate = g_strdup_printf("%uX", tmp);
+ }
}
}
- if (bus_rate) {
- *bus = g_strdup_printf("%s %s", bus_type, bus_rate);
+ /* NV_CTRL_GPU_PCIE_GENERATION */
+
+ pcie_gen = NULL;
+ if (bus_type == NV_CTRL_BUS_TYPE_PCI_EXPRESS) {
+ ret = NvCtrlGetAttribute(handle, NV_CTRL_GPU_PCIE_GENERATION, &tmp);
+ if (ret == NvCtrlSuccess)
+ pcie_gen = g_strdup_printf("Gen%u", tmp);
+ }
+
+ /* concatenate all the available bus related information */
+
+ if (bus_rate || pcie_gen) {
+ *bus = g_strdup_printf("%s %s%s%s", bus_type_str,
+ bus_rate ? bus_rate : "",
+ bus_rate ? " " : "",
+ pcie_gen ? pcie_gen : "");
g_free(bus_rate);
+ g_free(pcie_gen);
} else {
- *bus = g_strdup(bus_type);
+ *bus = g_strdup(bus_type_str);
}
/* NV_CTRL_PCI_DOMAIN & NV_CTRL_PCI_BUS &
@@ -495,8 +519,8 @@ GtkTextBuffer *ctk_gpu_create_help(GtkTextTagTable *table)
ctk_help_heading(b, &i, "Bus ID");
ctk_help_para(b, &i, "This is the GPU's PCI identification string, "
- "reported in the form 'bus:device:function'. It uniquely "
- "identifies the GPU's location in the host system. "
+ "reported in the form 'bus:device:function'. It uniquely "
+ "identifies the GPU's location in the host system. "
"This string can be used as-is with the 'BusID' X "
"configuration file option to unambiguously associate "
"Device sections with this GPU.");
diff --git a/src/gtk+-2.x/ctkgvi.c b/src/gtk+-2.x/ctkgvi.c
index bb5992a..f0e0a07 100644
--- a/src/gtk+-2.x/ctkgvi.c
+++ b/src/gtk+-2.x/ctkgvi.c
@@ -125,6 +125,7 @@ typedef struct {
int color_space;
int bpc;
int link_id;
+ unsigned int smpte352_id;
} ChannelInfo;
@@ -175,6 +176,14 @@ static void query_channel_info(CtkGvi *ctk_gvi, int jack, int channel, ChannelIn
if (ret != NvCtrlSuccess) {
channel_info->link_id = NV_CTRL_GVI_LINK_ID_UNKNOWN;
}
+
+ ret = NvCtrlGetDisplayAttribute(ctk_gvi->handle,
+ jack_channel,
+ NV_CTRL_GVI_DETECTED_CHANNEL_SMPTE352_IDENTIFIER,
+ &(channel_info->smpte352_id));
+ if (ret != NvCtrlSuccess) {
+ channel_info->smpte352_id = 0x0;
+ }
}
@@ -356,7 +365,7 @@ static void update_sdi_input_info_all(CtkGvi *ctk_gvi)
box = gtk_hbox_new(FALSE, 0);
gtk_box_pack_start(GTK_BOX(vbox), box, FALSE, FALSE, 0);
- table = gtk_table_new(5, 2, FALSE);
+ table = gtk_table_new(6, 2, FALSE);
gtk_table_set_row_spacings(GTK_TABLE(table), 5);
gtk_table_set_col_spacings(GTK_TABLE(table), 5);
@@ -429,6 +438,16 @@ static void update_sdi_input_info_all(CtkGvi *ctk_gvi)
gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
gtk_table_attach_defaults(GTK_TABLE(table), label, 1, 2, 4, 5);
g_free(label_str);
+
+ label = gtk_label_new("SMPTE 352 Payload Identifier:");
+ gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
+ gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 5, 6);
+
+ label_str = g_strdup_printf("0x%08x", channel_info.smpte352_id);
+ label = gtk_label_new(label_str);
+ gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
+ gtk_table_attach_defaults(GTK_TABLE(table), label, 1, 2, 5, 6);
+ g_free(label_str);
}
diff --git a/src/gtk+-2.x/ctkgvo-sync.c b/src/gtk+-2.x/ctkgvo-sync.c
index 5f34015..4ddd876 100644
--- a/src/gtk+-2.x/ctkgvo-sync.c
+++ b/src/gtk+-2.x/ctkgvo-sync.c
@@ -1519,7 +1519,7 @@ GtkTextBuffer* ctk_gvo_sync_create_help(GtkTextTagTable *table,
ctk_help_heading(b, &i, "Input Video Format Detect");
ctk_help_para(b, &i, __input_video_format_detect_help);
ctk_help_heading(b, &i, "Composite Termination");
- ctk_help_para(b, &i, "%s. This allows the composite signal to be daisy "
+ ctk_help_para(b, &i, "%s. This allows the composite signal to be daisy "
"chained from a server load.",
__composite_termination_help);
ctk_help_heading(b, &i, "Sync Mode");
diff --git a/src/gtk+-2.x/ctkgvo.c b/src/gtk+-2.x/ctkgvo.c
index 3709647..f8fdd0b 100644
--- a/src/gtk+-2.x/ctkgvo.c
+++ b/src/gtk+-2.x/ctkgvo.c
@@ -183,11 +183,15 @@ const GvioFormatName videoFormatNames[] = {
{ NV_CTRL_GVIO_VIDEO_FORMAT_2048P_25_00_SMPTE372, "2048 x 1080p 25.00 Hz (SMPTE372)" },
{ NV_CTRL_GVIO_VIDEO_FORMAT_2048P_29_97_SMPTE372, "2048 x 1080p 29.97 Hz (SMPTE372)" },
{ NV_CTRL_GVIO_VIDEO_FORMAT_2048P_30_00_SMPTE372, "2048 x 1080p 30.00 Hz (SMPTE372)" },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_1080P_50_00_3G_LEVEL_A_SMPTE274, "1920 x 1080p 50.00 Hz (SMPTE274) 3G LEVEL A" },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_1080P_59_94_3G_LEVEL_A_SMPTE274, "1920 x 1080p 59.94 Hz (SMPTE274) 3G LEVEL A" },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_1080P_60_00_3G_LEVEL_A_SMPTE274, "1920 x 1080p 60.00 Hz (SMPTE274) 3G LEVEL A" },
+
{ -1, NULL },
};
-static GvoFormatDetails videoFormatDetails[] = {
+static GvioFormatDetails videoFormatDetails[] = {
{ NV_CTRL_GVIO_VIDEO_FORMAT_487I_59_94_SMPTE259_NTSC, 0, 0, 0 },
{ NV_CTRL_GVIO_VIDEO_FORMAT_576I_50_00_SMPTE259_PAL, 0, 0, 0 },
{ NV_CTRL_GVIO_VIDEO_FORMAT_720P_23_98_SMPTE296, 0, 0, 0 },
@@ -226,6 +230,10 @@ static GvoFormatDetails videoFormatDetails[] = {
{ NV_CTRL_GVIO_VIDEO_FORMAT_2048P_25_00_SMPTE372, 0, 0, 0 },
{ NV_CTRL_GVIO_VIDEO_FORMAT_2048P_29_97_SMPTE372, 0, 0, 0 },
{ NV_CTRL_GVIO_VIDEO_FORMAT_2048P_30_00_SMPTE372, 0, 0, 0 },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_1080P_50_00_3G_LEVEL_A_SMPTE274, 0, 0, 0 },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_1080P_59_94_3G_LEVEL_A_SMPTE274, 0, 0, 0 },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_1080P_60_00_3G_LEVEL_A_SMPTE274, 0, 0, 0 },
+
{ -1, -1, -1, -1 },
};
diff --git a/src/gtk+-2.x/ctkgvo.h b/src/gtk+-2.x/ctkgvo.h
index f68ffcc..4117d09 100644
--- a/src/gtk+-2.x/ctkgvo.h
+++ b/src/gtk+-2.x/ctkgvo.h
@@ -121,7 +121,7 @@ typedef struct {
int rate;
int width;
int height;
-} GvoFormatDetails;
+} GvioFormatDetails;
diff --git a/src/gtk+-2.x/ctkmultisample.c b/src/gtk+-2.x/ctkmultisample.c
index f5c85c9..530518d 100644
--- a/src/gtk+-2.x/ctkmultisample.c
+++ b/src/gtk+-2.x/ctkmultisample.c
@@ -1308,7 +1308,7 @@ GtkTextBuffer *ctk_multisample_create_help(GtkTextTagTable *table,
if (ctk_multisample->active_attributes & __FSAA_NONE) {
ctk_help_term(b, &i, "Off");
ctk_help_para(b, &i, "Disables antialiasing in OpenGL "
- "applications. "
+ "applications. "
"Select this option if you require maximum "
"performance in your applications.");
}
@@ -1325,7 +1325,7 @@ GtkTextBuffer *ctk_multisample_create_help(GtkTextTagTable *table,
ctk_help_term(b, &i, "2x Quincunx");
ctk_help_para(b, &i, "This enables the patented Quincunx "
"Antialiasing technique available in the GeForce "
- "GPU family. "
+ "GPU family. "
"Quincunx Antialiasing offers the quality of the "
"slower, 4x antialiasing mode, but at nearly the "
"performance of the faster, 2x mode.");
@@ -1341,7 +1341,7 @@ GtkTextBuffer *ctk_multisample_create_help(GtkTextTagTable *table,
if (ctk_multisample->active_attributes & __FSAA_2x2) {
ctk_help_term(b, &i, "2 x 2 Supersampling");
ctk_help_para(b, &i, "This enables antialiasing using the 2x2 "
- "Supersampling mode. This mode offers higher image "
+ "Supersampling mode. This mode offers higher image "
"quality at the expense of some performance in "
"OpenGL applications.");
}
@@ -1349,7 +1349,7 @@ GtkTextBuffer *ctk_multisample_create_help(GtkTextTagTable *table,
if (ctk_multisample->active_attributes & __FSAA_4x) {
ctk_help_term(b, &i, "4x (4xMS)");
ctk_help_para(b, &i, "This enables antialiasing using the 4x (4xMS)"
- "Bilinear mode. This mode offers higher image "
+ "Bilinear mode. This mode offers higher image "
"quality at the expense of some performance in "
"OpenGL applications.");
}
@@ -1357,7 +1357,7 @@ GtkTextBuffer *ctk_multisample_create_help(GtkTextTagTable *table,
if (ctk_multisample->active_attributes & __FSAA_4x_9t) {
ctk_help_term(b, &i, "4x, 9-tap Gaussian");
ctk_help_para(b, &i, "This enables antialiasing using the 4x, "
- "9-tap (Gaussian) mode. This mode offers higher "
+ "9-tap (Gaussian) mode. This mode offers higher "
"image quality but at the expense of some "
"performance in OpenGL applications.");
}
@@ -1417,9 +1417,9 @@ GtkTextBuffer *ctk_multisample_create_help(GtkTextTagTable *table,
ctk_help_para(b, &i, "Anisotropic filtering is a technique used to "
"improve the quality of textures applied to the "
- "surfaces of 3D objects when drawn at a sharp angle. "
+ "surfaces of 3D objects when drawn at a sharp angle. "
"Use the Anisotropic filtering slider to set the degree "
- "of anisotropic filtering for improved image quality. "
+ "of anisotropic filtering for improved image quality. "
"Enabling this option improves image quality at the "
"expense of some performance.");
diff --git a/src/gtk+-2.x/ctkopengl.c b/src/gtk+-2.x/ctkopengl.c
index 00f8abb..a570d78 100644
--- a/src/gtk+-2.x/ctkopengl.c
+++ b/src/gtk+-2.x/ctkopengl.c
@@ -105,7 +105,7 @@ static const char *__aa_line_gamma_slider_help =
"This option allows Gamma-corrected "
"antialiased lines to consider variances in the color "
"display capabilities of output devices when rendering "
-"smooth lines. This option is applied to OpenGL applications "
+"smooth lines. This option is applied to OpenGL applications "
"that are started after this option is set.";
static const char *__image_settings_slider_help =
@@ -114,7 +114,7 @@ static const char *__image_settings_slider_help =
static const char *__force_stereo_help =
"Enabling this option causes OpenGL to force "
"stereo flipping even if a stereo drawable is "
-"not visible. This option is applied "
+"not visible. This option is applied "
"immediately.";
static const char *__xinerama_stereo_help =
diff --git a/src/gtk+-2.x/ctkpowermizer.c b/src/gtk+-2.x/ctkpowermizer.c
index cf5ef40..2ef0425 100644
--- a/src/gtk+-2.x/ctkpowermizer.c
+++ b/src/gtk+-2.x/ctkpowermizer.c
@@ -62,7 +62,7 @@ static const char *__performance_mode_short_help =
"This indicates the current Performance Mode of the GPU.";
static const char *__performance_mode_help =
-"This indicates the current Performance Mode of the GPU. "
+"This indicates the current Performance Mode of the GPU. "
"Performance Mode can be either \"Desktop\" or "
"\"Maximum Performance\".";
diff --git a/src/gtk+-2.x/ctkscreen.c b/src/gtk+-2.x/ctkscreen.c
index 8e84807..190fb2a 100644
--- a/src/gtk+-2.x/ctkscreen.c
+++ b/src/gtk+-2.x/ctkscreen.c
@@ -439,10 +439,10 @@ GtkTextBuffer *ctk_screen_create_help(GtkTextTagTable *table,
ctk_help_heading(b, &i, "Recovered GPU Errors");
ctk_help_para(b, &i, "The GPU can encounter errors, either due to bugs in "
"the NVIDIA driver, or due to corruption of the command "
- "stream as it is sent from the NVIDIA X driver to the GPU. "
+ "stream as it is sent from the NVIDIA X driver to the GPU. "
"When the GPU encounters one of these errors, it reports it "
"to the NVIDIA X driver and the NVIDIA X driver attempts to "
- "recover from the error. This reports how many errors the "
+ "recover from the error. This reports how many errors the "
"GPU received and the NVIDIA X driver successfully recovered "
"from.");
diff --git a/src/gtk+-2.x/ctkslimm.c b/src/gtk+-2.x/ctkslimm.c
index eae821c..9e4047a 100644
--- a/src/gtk+-2.x/ctkslimm.c
+++ b/src/gtk+-2.x/ctkslimm.c
@@ -1717,7 +1717,7 @@ GtkTextBuffer *ctk_slimm_create_help(GtkTextTagTable *table,
ctk_help_para(b, &i, "These two controls allow the user to specify the "
"Horizontal and Vertical Edge Overlap values. The displays "
"will overlap by the specified number of pixels when forming "
- "the grid configuration. For example, 4 flat panel displays "
+ "the grid configuration. For example, 4 flat panel displays "
"forming a 2 x 2 grid in SLI Mosaic Mode with a resolution of "
"1600x1200 and a Horizontal and Vertical Edge overlap of 50 "
"will generate the following MetaMode: \"1600x1200+0+0,"
diff --git a/src/gtk+-2.x/ctkui.c b/src/gtk+-2.x/ctkui.c
index 80aad4c..2f43d60 100644
--- a/src/gtk+-2.x/ctkui.c
+++ b/src/gtk+-2.x/ctkui.c
@@ -64,9 +64,9 @@ void ctk_main(ParsedAttribute *p, ConfigProperties *conf,
GTK_MESSAGE_WARNING,
GTK_BUTTONS_OK,
"You do not appear to be using the NVIDIA "
- "X driver. Please edit your X configuration "
+ "X driver. Please edit your X configuration "
"file (just run `nvidia-xconfig` "
- "as root), and restart the X server. ");
+ "as root), and restart the X server.");
gtk_dialog_run(GTK_DIALOG(dlg));
gtk_widget_destroy (dlg);
}
diff --git a/src/gtk+-2.x/ctkwindow.c b/src/gtk+-2.x/ctkwindow.c
index bfb6843..2d6f7ea 100644
--- a/src/gtk+-2.x/ctkwindow.c
+++ b/src/gtk+-2.x/ctkwindow.c
@@ -65,6 +65,7 @@
#include "ctkdisplayconfig.h"
#include "ctkserver.h"
+#include "ctkecc.h"
#include "ctkhelp.h"
#include "ctkevent.h"
@@ -839,7 +840,13 @@ GtkWidget *ctk_window_new(ParsedAttribute *p, ConfigProperties *conf,
add_page(child, help, ctk_window, &iter, NULL, "Clock Frequencies",
NULL, ctk_clocks_select, NULL);
}
-
+ /* ECC Information */
+ child = ctk_ecc_new(gpu_handle, ctk_config, ctk_event);
+ if (child) {
+ help = ctk_ecc_create_help(tag_table, CTK_ECC(child));
+ add_page(child, help, ctk_window, &iter, NULL, "ECC Settings",
+ NULL, ctk_ecc_start_timer, ctk_ecc_stop_timer);
+ }
/* display devices */
data = (UpdateDisplaysData *)calloc(1, sizeof(UpdateDisplaysData));
data->window = ctk_window;
diff --git a/src/libXNVCtrl/NVCtrl.c b/src/libXNVCtrl/NVCtrl.c
index d8bfe81..2372d97 100644
--- a/src/libXNVCtrl/NVCtrl.c
+++ b/src/libXNVCtrl/NVCtrl.c
@@ -347,8 +347,8 @@ Bool XNVCTRLQueryTargetAttribute (
SyncHandle ();
return False;
}
- if (value) *value = rep.value;
exists = rep.flags;
+ if (exists && value) *value = rep.value;
UnlockDisplay (dpy);
SyncHandle ();
return exists;
@@ -366,6 +366,46 @@ Bool XNVCTRLQueryAttribute (
}
+Bool XNVCTRLQueryTargetAttribute64 (
+ Display *dpy,
+ int target_type,
+ int target_id,
+ unsigned int display_mask,
+ unsigned int attribute,
+ int64_t *value
+){
+ XExtDisplayInfo *info = find_display(dpy);
+ xnvCtrlQueryAttribute64Reply rep;
+ xnvCtrlQueryAttributeReq *req;
+ Bool exists;
+
+ if (!XextHasExtension(info))
+ return False;
+
+ XNVCTRLCheckExtension(dpy, info, False);
+ XNVCTRLCheckTargetData(dpy, info, &target_type, &target_id);
+
+ LockDisplay(dpy);
+ GetReq(nvCtrlQueryAttribute, req);
+ req->reqType = info->codes->major_opcode;
+ req->nvReqType = X_nvCtrlQueryAttribute64;
+ req->target_type = target_type;
+ req->target_id = target_id;
+ req->display_mask = display_mask;
+ req->attribute = attribute;
+ if (!_XReply(dpy, (xReply *)&rep, 0, xTrue)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+ exists = rep.flags;
+ if (exists && value) *value = rep.value_64;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return exists;
+}
+
+
Bool XNVCTRLQueryTargetStringAttribute (
Display *dpy,
int target_type,
@@ -404,8 +444,11 @@ Bool XNVCTRLQueryTargetStringAttribute (
length = rep.length;
numbytes = rep.n;
slop = numbytes & 3;
- *ptr = (char *) Xmalloc(numbytes);
- if (! *ptr) {
+ exists = rep.flags;
+ if (exists) {
+ *ptr = (char *) Xmalloc(numbytes);
+ }
+ if (!exists || !*ptr) {
_XEatData(dpy, length);
UnlockDisplay (dpy);
SyncHandle ();
@@ -414,7 +457,6 @@ Bool XNVCTRLQueryTargetStringAttribute (
_XRead(dpy, (char *) *ptr, numbytes);
if (slop) _XEatData(dpy, 4-slop);
}
- exists = rep.flags;
UnlockDisplay (dpy);
SyncHandle ();
return exists;
@@ -491,26 +533,18 @@ Bool XNVCTRLSetStringAttribute (
}
-Bool XNVCTRLQueryValidTargetAttributeValues (
+static Bool XNVCTRLQueryValidTargetAttributeValues32 (
Display *dpy,
+ XExtDisplayInfo *info,
int target_type,
int target_id,
unsigned int display_mask,
unsigned int attribute,
NVCTRLAttributeValidValuesRec *values
){
- XExtDisplayInfo *info = find_display (dpy);
xnvCtrlQueryValidAttributeValuesReply rep;
xnvCtrlQueryValidAttributeValuesReq *req;
Bool exists;
-
- if (!values) return False;
-
- if(!XextHasExtension(info))
- return False;
-
- XNVCTRLCheckExtension (dpy, info, False);
- XNVCTRLCheckTargetData(dpy, info, &target_type, &target_id);
LockDisplay (dpy);
GetReq (nvCtrlQueryValidAttributeValues, req);
@@ -526,20 +560,110 @@ Bool XNVCTRLQueryValidTargetAttributeValues (
return False;
}
exists = rep.flags;
- values->type = rep.attr_type;
- if (rep.attr_type == ATTRIBUTE_TYPE_RANGE) {
- values->u.range.min = rep.min;
- values->u.range.max = rep.max;
- }
- if (rep.attr_type == ATTRIBUTE_TYPE_INT_BITS) {
- values->u.bits.ints = rep.bits;
+ if (exists) {
+ values->type = rep.attr_type;
+ if (rep.attr_type == ATTRIBUTE_TYPE_RANGE) {
+ values->u.range.min = rep.min;
+ values->u.range.max = rep.max;
+ }
+ if (rep.attr_type == ATTRIBUTE_TYPE_INT_BITS) {
+ values->u.bits.ints = rep.bits;
+ }
+ values->permissions = rep.perms;
}
- values->permissions = rep.perms;
UnlockDisplay (dpy);
SyncHandle ();
return exists;
}
+
+static Bool XNVCTRLQueryValidTargetAttributeValues64 (
+ Display *dpy,
+ XExtDisplayInfo *info,
+ int target_type,
+ int target_id,
+ unsigned int display_mask,
+ unsigned int attribute,
+ NVCTRLAttributeValidValuesRec *values
+){
+ xnvCtrlQueryValidAttributeValues64Reply rep;
+ xnvCtrlQueryValidAttributeValuesReq *req;
+ Bool exists;
+
+ LockDisplay(dpy);
+ GetReq(nvCtrlQueryValidAttributeValues, req);
+ req->reqType = info->codes->major_opcode;
+ req->nvReqType = X_nvCtrlQueryValidAttributeValues64;
+ req->target_type = target_type;
+ req->target_id = target_id;
+ req->display_mask = display_mask;
+ req->attribute = attribute;
+ if (!_XReply(dpy, (xReply *)&rep,
+ sz_xnvCtrlQueryValidAttributeValues64Reply_extra,
+ xTrue)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+ exists = rep.flags;
+ if (exists) {
+ values->type = rep.attr_type;
+ if (rep.attr_type == ATTRIBUTE_TYPE_RANGE) {
+ values->u.range.min = rep.min_64;
+ values->u.range.max = rep.max_64;
+ }
+ if (rep.attr_type == ATTRIBUTE_TYPE_INT_BITS) {
+ values->u.bits.ints = rep.bits_64;
+ }
+ values->permissions = rep.perms;
+ }
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return exists;
+}
+
+Bool XNVCTRLQueryValidTargetAttributeValues (
+ Display *dpy,
+ int target_type,
+ int target_id,
+ unsigned int display_mask,
+ unsigned int attribute,
+ NVCTRLAttributeValidValuesRec *values
+){
+ XExtDisplayInfo *info = find_display(dpy);
+ Bool exists;
+ int major, minor;
+
+ if (!values) return False;
+
+ if (!XextHasExtension(info))
+ return False;
+
+ XNVCTRLCheckExtension(dpy, info, False);
+ XNVCTRLCheckTargetData(dpy, info, &target_type, &target_id);
+
+ if (!XNVCTRLQueryVersion(dpy, &major, &minor))
+ return False;
+
+ if ((major > 1) || ((major == 1) && (minor >= 20))) {
+ exists = XNVCTRLQueryValidTargetAttributeValues64(dpy, info,
+ target_type,
+ target_id,
+ display_mask,
+ attribute,
+ values);
+ } else {
+ exists = XNVCTRLQueryValidTargetAttributeValues32(dpy, info,
+ target_type,
+ target_id,
+ display_mask,
+ attribute,
+ values);
+ }
+ return exists;
+}
+
+
Bool XNVCTRLQueryValidAttributeValues (
Display *dpy,
int screen,
@@ -733,8 +857,11 @@ Bool XNVCTRLQueryTargetBinaryData (
length = rep.length;
numbytes = rep.n;
slop = numbytes & 3;
- *ptr = (unsigned char *) Xmalloc(numbytes);
- if (! *ptr) {
+ exists = rep.flags;
+ if (exists) {
+ *ptr = (unsigned char *) Xmalloc(numbytes);
+ }
+ if (!exists || !*ptr) {
_XEatData(dpy, length);
UnlockDisplay (dpy);
SyncHandle ();
@@ -743,7 +870,6 @@ Bool XNVCTRLQueryTargetBinaryData (
_XRead(dpy, (char *) *ptr, numbytes);
if (slop) _XEatData(dpy, 4-slop);
}
- exists = rep.flags;
if (len) *len = numbytes;
UnlockDisplay (dpy);
SyncHandle ();
diff --git a/src/libXNVCtrl/NVCtrl.h b/src/libXNVCtrl/NVCtrl.h
index a74fb42..7a4eb80 100644
--- a/src/libXNVCtrl/NVCtrl.h
+++ b/src/libXNVCtrl/NVCtrl.h
@@ -24,6 +24,7 @@
#ifndef __NVCTRL_H
#define __NVCTRL_H
+#include <stdint.h>
/**************************************************************************/
@@ -82,14 +83,18 @@
* target type via XNVCTRLQueryTargetAttribute().
*
* X: When Xinerama is enabled, this attribute is kept consistent across
- * all Physical X Screens; Assignment of this attribute will be
+ * all Physical X Screens; assignment of this attribute will be
* broadcast by the NVIDIA X Driver to all X Screens.
*
* V: The attribute may be queried using an NV_CTRL_TARGET_TYPE_VCSC
* target type via XNVCTRLQueryTargetAttribute().
- *
+ *
* I: The attribute may be queried using an NV_CTRL_TARGET_TYPE_GVI target type
* via XNVCTRLQueryTargetAttribute().
+ *
+ * Q: The attribute is a 64-bit integer attribute; use the 64-bit versions
+ * of the appropriate query interfaces.
+ *
*
* C: The attribute may be queried using an NV_CTRL_TARGET_TYPE_COOLER target
* type via XNVCTRLQueryTargetAttribute().
@@ -1031,6 +1036,10 @@
#define NV_CTRL_GVIO_VIDEO_FORMAT_2048P_23_98_SMPTE372 36
#define NV_CTRL_GVIO_VIDEO_FORMAT_2048I_48_00_SMPTE372 37
#define NV_CTRL_GVIO_VIDEO_FORMAT_2048I_47_96_SMPTE372 38
+#define NV_CTRL_GVIO_VIDEO_FORMAT_1080P_50_00_3G_LEVEL_A_SMPTE274 39
+#define NV_CTRL_GVIO_VIDEO_FORMAT_1080P_59_94_3G_LEVEL_A_SMPTE274 40
+#define NV_CTRL_GVIO_VIDEO_FORMAT_1080P_60_00_3G_LEVEL_A_SMPTE274 41
+
/*
* The following are deprecated; NV_CTRL_GVIO_REQUESTED_VIDEO_FORMAT and the
@@ -2553,7 +2562,6 @@
* NV_CTRL_FRAMELOCK_SYNC_DELAY_RESOLUTION - Returns the number of nanoseconds
* that one unit of NV_CTRL_FRAMELOCK_SYNC_DELAY corresponds to.
*/
-
#define NV_CTRL_FRAMELOCK_SYNC_DELAY_RESOLUTION 318 /* R-- */
/*
@@ -2611,6 +2619,86 @@
NV_CTRL_THERMAL_COOLER_TARGET_POWER_SUPPLY)
/*
+ * NV_CTRL_GPU_ECC_SUPPORTED - Reports whether ECC is supported by the
+ * targeted GPU.
+ */
+#define NV_CTRL_GPU_ECC_SUPPORTED 324 /* R--G */
+#define NV_CTRL_GPU_ECC_SUPPORTED_FALSE 0
+#define NV_CTRL_GPU_ECC_SUPPORTED_TRUE 1
+
+/*
+ * NV_CTRL_GPU_ECC_STATUS - Returns the current hardware ECC setting
+ * for the targeted GPU.
+ */
+#define NV_CTRL_GPU_ECC_STATUS 325 /* R--G */
+#define NV_CTRL_GPU_ECC_STATUS_DISABLED 0
+#define NV_CTRL_GPU_ECC_STATUS_ENABLED 1
+
+/*
+ * NV_CTRL_GPU_ECC_CONFIGURATION - Reports whether ECC can be configured
+ * dynamically for the GPU in question.
+ */
+#define NV_CTRL_GPU_ECC_CONFIGURATION_SUPPORTED 326 /* R--G */
+#define NV_CTRL_GPU_ECC_CONFIGURATION_SUPPORTED_FALSE 0
+#define NV_CTRL_GPU_ECC_CONFIGURATION_SUPPORTED_TRUE 1
+
+/*
+ * NV_CTRL_GPU_ECC_CONFIGURATION_SETTING - Returns the current ECC
+ * configuration setting or specifies new settings. New settings do not
+ * take effect until the next POST.
+ */
+#define NV_CTRL_GPU_ECC_CONFIGURATION 327 /* RW-G */
+#define NV_CTRL_GPU_ECC_CONFIGURATION_DISABLED 0
+#define NV_CTRL_GPU_ECC_CONFIGURATION_ENABLED 1
+
+/*
+ * NV_CTRL_GPU_ECC_DEFAULT_CONFIGURATION_SETTING - Returns the default
+ * ECC configuration setting.
+ */
+#define NV_CTRL_GPU_ECC_DEFAULT_CONFIGURATION 328 /* R--G */
+#define NV_CTRL_GPU_ECC_DEFAULT_CONFIGURATION_DISABLED 0
+#define NV_CTRL_GPU_ECC_DEFAULT_CONFIGURATION_ENABLED 1
+
+/*
+ * NV_CTRL_GPU_ECC_SINGLE_BIT_ERRORS - Returns the number of single-bit
+ * ECC errors detected by the targeted GPU since the last POST.
+ * Note: this attribute is a 64-bit integer attribute.
+ */
+#define NV_CTRL_GPU_ECC_SINGLE_BIT_ERRORS 329 /* R--GQ */
+
+/*
+ * NV_CTRL_GPU_ECC_DOUBLE_BIT_ERRORS - Returns the number of double-bit
+ * ECC errors detected by the targeted GPU since the last POST.
+ * Note: this attribute is a 64-bit integer attribute.
+ */
+#define NV_CTRL_GPU_ECC_DOUBLE_BIT_ERRORS 330 /* R--GQ */
+
+/*
+ * NV_CTRL_GPU_ECC_AGGREGATE_SINGLE_BIT_ERRORS - Returns the number of
+ * single-bit ECC errors detected by the targeted GPU since the
+ * last counter reset.
+ * Note: this attribute is a 64-bit integer attribute.
+ */
+#define NV_CTRL_GPU_ECC_AGGREGATE_SINGLE_BIT_ERRORS 331 /* R--GQ */
+
+/*
+ * NV_CTRL_GPU_ECC_AGGREGATE_DOUBLE_BIT_ERRORS - Returns the number of
+ * double-bit ECC errors detected by the targeted GPU since the
+ * last counter reset.
+ * Note: this attribute is a 64-bit integer attribute.
+ */
+#define NV_CTRL_GPU_ECC_AGGREGATE_DOUBLE_BIT_ERRORS 332 /* R--GQ */
+
+/*
+ * NV_CTRL_GPU_ECC_RESET_ERROR_STATUS - Resets the volatile/aggregate
+ * single-bit and double-bit error counters. This attribute is a
+ * bitmask attribute.
+ */
+#define NV_CTRL_GPU_ECC_RESET_ERROR_STATUS 333 /* -W-G */
+#define NV_CTRL_GPU_ECC_RESET_ERROR_STATUS_VOLATILE 0x00000001
+#define NV_CTRL_GPU_ECC_RESET_ERROR_STATUS_AGGREGATE 0x00000002
+
+/*
* NV_CTRL_GPU_POWER_MIZER_MODE - Provides a hint to the driver
* as to how to manage the performance of the GPU.
*
@@ -2679,8 +2767,14 @@
*/
#define NV_CTRL_OVERSCAN_COMPENSATION 339 /* RWDG */
+/*
+ * NV_CTRL_GPU_PCIE_GENERATION - Reports the current PCI-E generation.
+ */
+#define NV_CTRL_GPU_PCIE_GENERATION 341 /* R--GI */
+#define NV_CTRL_GPU_PCIE_GENERATION1 0x00000001
+#define NV_CTRL_GPU_PCIE_GENERATION2 0x00000002
-#define NV_CTRL_LAST_ATTRIBUTE NV_CTRL_OVERSCAN_COMPENSATION
+#define NV_CTRL_LAST_ATTRIBUTE NV_CTRL_GPU_PCIE_GENERATION
/**************************************************************************/
@@ -3699,6 +3793,7 @@
#define ATTRIBUTE_TYPE_BOOL 3
#define ATTRIBUTE_TYPE_RANGE 4
#define ATTRIBUTE_TYPE_INT_BITS 5
+#define ATTRIBUTE_TYPE_64BIT_INTEGER 6
#define ATTRIBUTE_TYPE_READ 0x001
#define ATTRIBUTE_TYPE_WRITE 0x002
@@ -3715,8 +3810,8 @@ typedef struct _NVCTRLAttributeValidValues {
int type;
union {
struct {
- int min;
- int max;
+ int64_t min;
+ int64_t max;
} range;
struct {
unsigned int ints;
diff --git a/src/libXNVCtrl/NVCtrlLib.h b/src/libXNVCtrl/NVCtrlLib.h
index 93132d1..e70b1b8 100644
--- a/src/libXNVCtrl/NVCtrlLib.h
+++ b/src/libXNVCtrl/NVCtrlLib.h
@@ -238,6 +238,34 @@ Bool XNVCTRLQueryTargetAttribute (
/*
+ * XNVCTRLQueryTargetAttribute64 -
+ *
+ * Returns True if the attribute exists. Returns False otherwise.
+ * If XNVCTRLQueryTargetAttribute returns True, value will contain the
+ * value of the specified attribute.
+ *
+ * Not all attributes require the display_mask parameter; see
+ * NVCtrl.h for details.
+ *
+ * Note: this function behaves like XNVCTRLQueryTargetAttribute(),
+ * but supports 64-bit integer attributes.
+ *
+ * Possible errors:
+ * BadValue - The target doesn't exist.
+ * BadMatch - The NVIDIA driver does not control the target.
+ */
+
+Bool XNVCTRLQueryTargetAttribute64 (
+ Display *dpy,
+ int target_Type,
+ int target_id,
+ unsigned int display_mask,
+ unsigned int attribute,
+ int64_t *value
+);
+
+
+/*
* XNVCTRLQueryStringAttribute -
*
* Returns True if the attribute exists. Returns False otherwise.
diff --git a/src/libXNVCtrl/nv_control.h b/src/libXNVCtrl/nv_control.h
index baa0b94..ce8b376 100644
--- a/src/libXNVCtrl/nv_control.h
+++ b/src/libXNVCtrl/nv_control.h
@@ -43,7 +43,8 @@
* BadMatch, if an unknown TargetType is specified
* 1.19 Added TargetType support for SetAttributeAndGetStatus and
* SetStringAttribute requests
- * 1.20 Added COOLER TargetType.
+ * 1.20 Added COOLER TargetType
+ * 1.21 Added initial 64-bit integer attribute support (read-only)
*/
#ifndef __NVCONTROL_H
@@ -54,7 +55,7 @@
#define NV_CONTROL_NAME "NV-CONTROL"
#define NV_CONTROL_MAJOR 1
-#define NV_CONTROL_MINOR 20
+#define NV_CONTROL_MINOR 21
#define X_nvCtrlQueryExtension 0
#define X_nvCtrlIsNv 1
@@ -82,7 +83,9 @@
#define X_nvCtrlSelectTargetNotify 23
#define X_nvCtrlQueryTargetCount 24
#define X_nvCtrlStringOperation 25
-#define X_nvCtrlLastRequest (X_nvCtrlStringOperation + 1)
+#define X_nvCtrlQueryValidAttributeValues64 26
+#define X_nvCtrlQueryAttribute64 27
+#define X_nvCtrlLastRequest (X_nvCtrlQueryAttribute64 + 1)
/* Define 32 bit floats */
@@ -175,7 +178,7 @@ typedef struct {
CARD16 sequenceNumber B16;
CARD32 length B32;
CARD32 flags B32;
- INT32 value B32;
+ INT32 value B32;
CARD32 pad4 B32;
CARD32 pad5 B32;
CARD32 pad6 B32;
@@ -184,6 +187,19 @@ typedef struct {
#define sz_xnvCtrlQueryAttributeReply 32
typedef struct {
+ BYTE type;
+ BYTE pad0;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 flags B32;
+ CARD32 pad3 B32;
+ CARD64 value_64;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+} xnvCtrlQueryAttribute64Reply;
+#define sz_xnvCtrlQueryAttribute64Reply 32
+
+typedef struct {
CARD8 reqType;
CARD8 nvReqType;
CARD16 length B16;
@@ -290,14 +306,30 @@ typedef struct {
CARD16 sequenceNumber B16;
CARD32 length B32;
CARD32 flags B32;
- INT32 attr_type B32;
- INT32 min B32;
- INT32 max B32;
+ INT32 attr_type B32;
+ INT32 min B32;
+ INT32 max B32;
CARD32 bits B32;
CARD32 perms B32;
} xnvCtrlQueryValidAttributeValuesReply;
#define sz_xnvCtrlQueryValidAttributeValuesReply 32
+typedef struct {
+ BYTE type;
+ BYTE pad0;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 flags B32;
+ INT32 attr_type B32;
+ CARD64 min_64;
+ CARD64 max_64;
+ CARD64 bits_64;
+ CARD32 perms B32;
+ CARD32 pad1 B32;
+} xnvCtrlQueryValidAttributeValues64Reply;
+#define sz_xnvCtrlQueryValidAttributeValues64Reply 48
+#define sz_xnvCtrlQueryValidAttributeValues64Reply_extra ((48 - 32) >> 2)
+
/* Set GVO Color Conversion request (deprecated) */
typedef struct {
CARD8 reqType;
diff --git a/src/libXNVCtrlAttributes/NvCtrlAttributes.c b/src/libXNVCtrlAttributes/NvCtrlAttributes.c
index 0d5256e..4154807 100644
--- a/src/libXNVCtrlAttributes/NvCtrlAttributes.c
+++ b/src/libXNVCtrlAttributes/NvCtrlAttributes.c
@@ -486,6 +486,15 @@ ReturnStatus NvCtrlSetAttribute(NvCtrlAttributeHandle *handle,
} /* NvCtrlSetAttribute() */
+ReturnStatus NvCtrlGetAttribute64(NvCtrlAttributeHandle *handle,
+ int attr, int64_t *val)
+{
+ if (!handle) return NvCtrlBadArgument;
+ return NvCtrlGetDisplayAttribute64(handle, 0, attr, val);
+
+} /* NvCtrlGetAttribute64() */
+
+
ReturnStatus NvCtrlGetVoidAttribute(NvCtrlAttributeHandle *handle,
int attr, void **ptr)
{
@@ -524,10 +533,12 @@ ReturnStatus NvCtrlSetStringAttribute(NvCtrlAttributeHandle *handle,
ReturnStatus
-NvCtrlGetDisplayAttribute(NvCtrlAttributeHandle *handle,
- unsigned int display_mask, int attr, int *val)
+NvCtrlGetDisplayAttribute64(NvCtrlAttributeHandle *handle,
+ unsigned int display_mask, int attr, int64_t *val)
{
+ ReturnStatus status;
NvCtrlAttributePrivateHandle *h;
+ int value_32;
h = (NvCtrlAttributePrivateHandle *) handle;
@@ -559,19 +570,34 @@ NvCtrlGetDisplayAttribute(NvCtrlAttributeHandle *handle,
if ((attr >= NV_CTRL_ATTR_XV_BASE) &&
(attr <= NV_CTRL_ATTR_XV_LAST_ATTRIBUTE)) {
-
- return NvCtrlXvGetAttribute(h, attr, val);
+ status = NvCtrlXvGetAttribute(h, attr, &value_32);
+ *val = value_32;
+ return status;
}
if ((attr >= NV_CTRL_ATTR_XRANDR_BASE) &&
(attr <= NV_CTRL_ATTR_XRANDR_LAST_ATTRIBUTE)) {
-
- return NvCtrlXrandrGetAttribute(h, attr, val);
+ status = NvCtrlXrandrGetAttribute(h, attr, &value_32);
+ *val = value_32;
+ return status;
}
-
return NvCtrlNoAttribute;
+} /* NvCtrlGetDisplayAttribute64() */
+
+ReturnStatus
+NvCtrlGetDisplayAttribute(NvCtrlAttributeHandle *handle,
+ unsigned int display_mask, int attr, int *val)
+{
+ ReturnStatus status;
+ int64_t value_64;
+
+ status = NvCtrlGetDisplayAttribute64(handle, display_mask, attr, &value_64);
+ *val = value_64;
+
+ return status;
+
} /* NvCtrlGetDisplayAttribute() */
diff --git a/src/libXNVCtrlAttributes/NvCtrlAttributes.h b/src/libXNVCtrlAttributes/NvCtrlAttributes.h
index ab3b502..48a753d 100644
--- a/src/libXNVCtrlAttributes/NvCtrlAttributes.h
+++ b/src/libXNVCtrlAttributes/NvCtrlAttributes.h
@@ -370,7 +370,8 @@ ReturnStatus NvCtrlQueryTargetCount(NvCtrlAttributeHandle *handle,
* Modifications made via SetAttribute() are made immediatedly. The
* attr argument is the attribute to query/modify; valid attributes
* are those listed in NVCtrl.h and the NV_CTRL_ attributes #define'd
- * above.
+ * above. NvCtrlGetAttribute64() behaves like NvCtrlGetAttribute(),
+ * but supports 64-bit integer attributes.
*/
ReturnStatus NvCtrlGetAttribute (NvCtrlAttributeHandle *handle,
@@ -379,6 +380,10 @@ ReturnStatus NvCtrlGetAttribute (NvCtrlAttributeHandle *handle,
ReturnStatus NvCtrlSetAttribute (NvCtrlAttributeHandle *handle,
int attr, int val);
+ReturnStatus NvCtrlGetAttribute64 (NvCtrlAttributeHandle *handle,
+ int attr, int64_t *val);
+
+
/*
* NvCtrlGetVoidAttribute() - this function works like the
* Get and GetString only it returns a void pointer. The
@@ -432,6 +437,10 @@ NvCtrlSetDisplayAttribute (NvCtrlAttributeHandle *handle,
unsigned int display_mask, int attr, int val);
ReturnStatus
+NvCtrlGetDisplayAttribute64 (NvCtrlAttributeHandle *handle,
+ unsigned int display_mask, int attr, int64_t *val);
+
+ReturnStatus
NvCtrlSetDisplayAttributeWithReply (NvCtrlAttributeHandle *handle,
unsigned int display_mask,
int attr, int val);
diff --git a/src/libXNVCtrlAttributes/NvCtrlAttributesNvControl.c b/src/libXNVCtrlAttributes/NvCtrlAttributesNvControl.c
index 28891c2..596552f 100644
--- a/src/libXNVCtrlAttributes/NvCtrlAttributesNvControl.c
+++ b/src/libXNVCtrlAttributes/NvCtrlAttributesNvControl.c
@@ -150,11 +150,29 @@ ReturnStatus NvCtrlNvControlQueryTargetCount(NvCtrlAttributePrivateHandle *h,
ReturnStatus NvCtrlNvControlGetAttribute (NvCtrlAttributePrivateHandle *h,
unsigned int display_mask,
- int attr, int *val)
+ int attr, int64_t *val)
{
+ ReturnStatus status;
+ int value_32;
+ int major, minor;
+
+ major = h->nv->major_version;
+ minor = h->nv->minor_version;
+
if (attr <= NV_CTRL_LAST_ATTRIBUTE) {
- if (XNVCTRLQueryTargetAttribute (h->dpy, h->target_type, h->target_id,
- display_mask, attr, val)) {
+ if ((major > 1) || ((major == 1) && (minor >= 20))) {
+ status = XNVCTRLQueryTargetAttribute64(h->dpy, h->target_type,
+ h->target_id,
+ display_mask, attr,
+ val);
+ } else {
+ status = XNVCTRLQueryTargetAttribute(h->dpy, h->target_type,
+ h->target_id,
+ display_mask, attr,
+ &value_32);
+ *val = value_32;
+ }
+ if (status) {
return NvCtrlSuccess;
} else {
return NvCtrlAttributeNotAvailable;
@@ -168,10 +186,10 @@ ReturnStatus NvCtrlNvControlGetAttribute (NvCtrlAttributePrivateHandle *h,
switch (attr) {
case NV_CTRL_ATTR_NV_MAJOR_VERSION:
- *val = h->nv->major_version;
+ *val = major;
return NvCtrlSuccess;
case NV_CTRL_ATTR_NV_MINOR_VERSION:
- *val = h->nv->minor_version;
+ *val = minor;
return NvCtrlSuccess;
}
}
diff --git a/src/libXNVCtrlAttributes/NvCtrlAttributesPrivate.h b/src/libXNVCtrlAttributes/NvCtrlAttributesPrivate.h
index 8286d74..70b104f 100644
--- a/src/libXNVCtrlAttributes/NvCtrlAttributesPrivate.h
+++ b/src/libXNVCtrlAttributes/NvCtrlAttributesPrivate.h
@@ -252,7 +252,7 @@ NvCtrlNvControlQueryTargetCount(NvCtrlAttributePrivateHandle *, int, int *);
ReturnStatus
NvCtrlNvControlGetAttribute (NvCtrlAttributePrivateHandle *, unsigned int,
- int, int *);
+ int, int64_t *);
ReturnStatus
NvCtrlNvControlSetAttribute (NvCtrlAttributePrivateHandle *, unsigned int,
diff --git a/src/lscf.c b/src/lscf.c
index cf4e66b..569aed4 100644
--- a/src/lscf.c
+++ b/src/lscf.c
@@ -69,8 +69,8 @@ done:
scf_handle_destroy(scf_handle);
}
if (!status) {
- fmterr("Unable to set X server default depth through "
- "Solaris Service Management Facility");
+ fprintf(stderr, "Unable to set X server default depth through Solaris "
+ "Service Management Facility");
}
return status;
}
diff --git a/src/parse.c b/src/parse.c
index 4afd211..dc63d90 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -70,7 +70,7 @@ AttributeTableEntry attributeTable[] = {
/* name constant flags description */
/* Version information */
- { "OperatingSystem", NV_CTRL_OPERATING_SYSTEM, N, "The operating system on which the X server is running. (0-Linux, 1-FreeBSD, 2-SunOS.)" },
+ { "OperatingSystem", NV_CTRL_OPERATING_SYSTEM, N, "The operating system on which the X server is running. 0-Linux, 1-FreeBSD, 2-SunOS." },
{ "NvidiaDriverVersion", NV_CTRL_STRING_NVIDIA_DRIVER_VERSION, S|N, "The NVIDIA X driver version." },
{ "NvControlVersion", NV_CTRL_STRING_NV_CONTROL_VERSION, S|N, "The NV-CONTROL X driver extension version." },
{ "GLXServerVersion", NV_CTRL_STRING_GLX_SERVER_VERSION, S|N, "The GLX X server extension version." },
@@ -112,7 +112,7 @@ AttributeTableEntry attributeTable[] = {
{ "PixmapCacheRoundSizeKB", NV_CTRL_PIXMAP_CACHE_ROUNDING_SIZE_KB, N, "Controls the number of kilobytes to add to the pixmap cache when there is not enough room." },
/* OpenGL */
- { "SyncToVBlank", NV_CTRL_SYNC_TO_VBLANK, 0, "Enables sync to vertical blanking for OpenGL clients. This setting only takes effect on OpenGL clients started after it is set." },
+ { "SyncToVBlank", NV_CTRL_SYNC_TO_VBLANK, 0, "Enables sync to vertical blanking for OpenGL clients. This setting only takes effect on OpenGL clients started after it is set." },
{ "LogAniso", NV_CTRL_LOG_ANISO, 0, "Enables anisotropic filtering for OpenGL clients; on some NVIDIA hardware, this can only be enabled or disabled; on other hardware different levels of anisotropic filtering can be specified. This setting only takes effect on OpenGL clients started after it is set." },
{ "FSAA", NV_CTRL_FSAA_MODE, 0, "The full screen antialiasing setting for OpenGL clients. This setting only takes effect on OpenGL clients started after it is set." },
{ "TextureSharpen", NV_CTRL_TEXTURE_SHARPEN, 0, "Enables texture sharpening for OpenGL clients. This setting only takes effect on OpenGL clients started after it is set." },
@@ -150,6 +150,7 @@ AttributeTableEntry attributeTable[] = {
{ "PCIDevice", NV_CTRL_PCI_DEVICE, N, "Returns the PCI device number for the specified device." },
{ "PCIFunc", NV_CTRL_PCI_FUNCTION, N, "Returns the PCI function number for the specified device." },
{ "PCIID", NV_CTRL_PCI_ID, N|P, "Returns the PCI vendor and device ID of the specified device." },
+ { "PCIEGen", NV_CTRL_GPU_PCIE_GENERATION, N, "Returns the current PCI-E Bus Generation." },
{ "GPUErrors", NV_CTRL_NUM_GPU_ERRORS_RECOVERED, N, "Returns the number of GPU errors occurred." },
{ "GPUPowerSource", NV_CTRL_GPU_POWER_SOURCE, N, "Reports the type of power source of the GPU." },
{ "GPUCurrentPerfMode", NV_CTRL_GPU_CURRENT_PERFORMANCE_MODE, N, "Reports the current performance mode of the GPU driving the X screen. Running a 3D app, for example, will change this performance mode if Adaptive Clocking is enabled." },
@@ -157,6 +158,11 @@ AttributeTableEntry attributeTable[] = {
{ "GPUAdaptiveClockState", NV_CTRL_GPU_ADAPTIVE_CLOCK_STATE, N, "Reports if Adaptive Clocking is Enabled on the GPU driving the X screen." },
{ "GPUPerfModes", NV_CTRL_STRING_PERFORMANCE_MODES, S|N, "Returns a string with all the performance modes defined for this GPU along with their associated NV Clock and Memory Clock values." },
{ "GPUPowerMizerMode", NV_CTRL_GPU_POWER_MIZER_MODE, 0, "Allows setting different GPU powermizer modes." },
+ { "ECCSupported", NV_CTRL_GPU_ECC_SUPPORTED, N, "Reports whether the underlying GPU supports ECC. All of the other ECC attributes are only applicable if this attribute indicates that ECC is supported." },
+ { "ECCStatus", NV_CTRL_GPU_ECC_STATUS, N, "Reports whether ECC is enabled." },
+ { "ECCConfigurationSupported", NV_CTRL_GPU_ECC_CONFIGURATION_SUPPORTED, N, "Reports whether ECC whether the ECC configuration setting can be changed." },
+ { "ECCConfiguration", NV_CTRL_GPU_ECC_CONFIGURATION, N, "Returns the current ECC configuration setting." },
+ { "ECCDefaultConfiguration", NV_CTRL_GPU_ECC_DEFAULT_CONFIGURATION, N, "Returns the default ECC configuration setting." },
{ "GPUFanControlState", NV_CTRL_GPU_COOLER_MANUAL_CONTROL, N, "The current fan control state; the value of this attribute controls the availability of additional fan control attributes. Note that this attribute is unavailable unless fan control support has been enabled by setting the \"Coolbits\" X config option." },
{ "GPUCurrentFanSpeed", NV_CTRL_THERMAL_COOLER_LEVEL, N, "Returns the GPU fan's current speed." },
{ "GPUResetFanSpeed", NV_CTRL_THERMAL_COOLER_LEVEL_SET_DEFAULT, N, "Resets the GPU fan's speed to its default." },
@@ -178,14 +184,14 @@ AttributeTableEntry attributeTable[] = {
{ "FrameLockTestSignal", NV_CTRL_FRAMELOCK_TEST_SIGNAL, N|F|G, "To test the connections in the sync group, tell the master to enable a test signal, then query port[01] status and sync_ready on all slaves. When done, tell the master to disable the test signal. Test signal should only be manipulated while FrameLockEnable is enabled. The FrameLockTestSignal is also used to reset the Universal Frame Count (as returned by the glXQueryFrameCountNV() function in the GLX_NV_swap_group extension). Note: for best accuracy of the Universal Frame Count, it is recommended to toggle the FrameLockTestSignal on and off after enabling frame lock." },
{ "FrameLockEthDetected", NV_CTRL_FRAMELOCK_ETHERNET_DETECTED, N|F|G, "The frame lock boards are cabled together using regular cat5 cable, connecting to RJ45 ports on the backplane of the card. There is some concern that users may think these are Ethernet ports and connect them to a router/hub/etc. The hardware can detect this and will shut off to prevent damage (either to itself or to the router). FrameLockEthDetected may be called to find out if Ethernet is connected to one of the RJ45 ports. An appropriate error message should then be displayed." },
{ "FrameLockVideoMode", NV_CTRL_FRAMELOCK_VIDEO_MODE, N|F|G, "Get/set what video mode is used to interpret the house sync signal. This should only be set on the master." },
- { "FrameLockSyncRate", NV_CTRL_FRAMELOCK_SYNC_RATE, N|F|G, "Returns the refresh rate that the frame lock board is sending to the GPU, in mHz (Millihertz) (i.e. to get the refresh rate in Hz, divide the returned value by 1000.)" },
- { "FrameLockTiming", NV_CTRL_FRAMELOCK_TIMING, N|F|G, "This is 1 when the GPU is both receiving and locked to an input timing signal. Timing information may come from the following places: Another frame lock device that is set to master, the house sync signal, or the GPU's internal timing from a display device." },
+ { "FrameLockSyncRate", NV_CTRL_FRAMELOCK_SYNC_RATE, N|F|G, "Returns the refresh rate that the frame lock board is sending to the GPU, in mHz (Millihertz) (i.e., to get the refresh rate in Hz, divide the returned value by 1000)." },
+ { "FrameLockTiming", NV_CTRL_FRAMELOCK_TIMING, N|F|G, "This is 1 when the GPU is both receiving and locked to an input timing signal. Timing information may come from the following places: another frame lock device that is set to master, the house sync signal, or the GPU's internal timing from a display device." },
{ "FramelockUseHouseSync", NV_CTRL_USE_HOUSE_SYNC, N|F|G, "When 1, the server (master) frame lock device will propagate the incoming house sync signal as the outgoing frame lock sync signal. If the frame lock device cannot detect a frame lock sync signal, it will default to using the internal timings from the GPU connected to the primary connector." },
{ "FrameLockSlaves", NV_CTRL_FRAMELOCK_SLAVES, N|F|G|D, "Get/set whether the display device(s) given should listen or ignore the master's sync signal." },
{ "FrameLockMasterable", NV_CTRL_FRAMELOCK_MASTERABLE, N|F|G|D, "Returns whether the display device(s) can be set as the master of the frame lock group. Returns a bitmask indicating which of the given display devices can be set as a frame lock master." },
{ "FrameLockSlaveable", NV_CTRL_FRAMELOCK_SLAVEABLE, N|F|G|D, "Returns whether the display device(s) can be set as slave(s) of the frame lock group." },
{ "FrameLockFPGARevision", NV_CTRL_FRAMELOCK_FPGA_REVISION, N|F|G, "Returns the FPGA revision of the Frame Lock device." },
- { "FrameLockSyncRate4", NV_CTRL_FRAMELOCK_SYNC_RATE_4, N|F|G, "Returns the refresh rate that the frame lock board is sending to the GPU in 1/10000 Hz (i.e. to get the refresh rate in Hz, divide the returned value by 10000.)" },
+ { "FrameLockSyncRate4", NV_CTRL_FRAMELOCK_SYNC_RATE_4, N|F|G, "Returns the refresh rate that the frame lock board is sending to the GPU in 1/10000 Hz (i.e., to get the refresh rate in Hz, divide the returned value by 10000)." },
{ "FrameLockSyncDelayResolution", NV_CTRL_FRAMELOCK_SYNC_DELAY_RESOLUTION, N|F|G, "Returns the number of nanoseconds that one unit of FrameLockSyncDelay corresponds to." },
/* GVO */
@@ -213,7 +219,7 @@ AttributeTableEntry attributeTable[] = {
{ "GvoCapabilities", NV_CTRL_GVO_CAPABILITIES, I|N, "Returns a description of the GVO capabilities that differ between NVIDIA SDI products. This value is a bitmask where each bit indicates whether that capability is available." },
{ "GvoCompositeTermination", NV_CTRL_GVO_COMPOSITE_TERMINATION, I, "Enable or disable 75 ohm termination of the SDI composite input signal." },
{ "GvoFlipQueueSize", NV_CTRL_GVO_FLIP_QUEUE_SIZE, I, "Sets/Returns the GVO flip queue size. This value is used by the GLX_NV_video_out extension to determine the size of the internal flip queue when pbuffers are sent to the video device (via glXSendPbufferToVideoNV()). This attribute is applied to GLX when glXGetVideoDeviceNV() is called by the application." },
- { "GvoLockOwner", NV_CTRL_GVO_LOCK_OWNER, I|N, "Indicates that the GVO device is available or in use (by GLX, Clone Mode, TwinView etc.)" },
+ { "GvoLockOwner", NV_CTRL_GVO_LOCK_OWNER, I|N, "Indicates that the GVO device is available or in use (by GLX, Clone Mode, or TwinView)." },
{ "GvoOutputVideoLocked", NV_CTRL_GVO_OUTPUT_VIDEO_LOCKED, I|N, "Returns whether or not the GVO output video is locked to the GPU output signal." },
{ "GvoSyncLockStatus", NV_CTRL_GVO_SYNC_LOCK_STATUS, I|N, "Returns whether or not the GVO device is locked to the input reference signal." },
{ "GvoANCTimeCodeGeneration", NV_CTRL_GVO_ANC_TIME_CODE_GENERATION, I, "Controls whether the GVO device generates time codes in the ANC region of the SDI video output stream." },
@@ -254,19 +260,19 @@ AttributeTableEntry attributeTable[] = {
{ "RedGamma", GAMMA_VALUE|RED_CHANNEL, C|G, "Controls the gamma of the color red in the display." },
{ "GreenGamma", GAMMA_VALUE|GREEN_CHANNEL, C|G, "Controls the gamma of the color green in the display." },
{ "BlueGamma", GAMMA_VALUE|BLUE_CHANNEL, C|G, "Controls the gamma of the color blue in the display." },
- { "FlatpanelDithering", NV_CTRL_FLATPANEL_DITHERING, 0, "This is the current state of flat panel dithering. (This attribute has been deprecated.)" },
+ { "FlatpanelDithering", NV_CTRL_FLATPANEL_DITHERING, 0, "This is the current state of flat panel dithering. This attribute has been deprecated." },
{ "DigitalVibrance", NV_CTRL_DIGITAL_VIBRANCE, 0, "Sets the digital vibrance level of the display device." },
{ "ImageSharpening", NV_CTRL_IMAGE_SHARPENING, 0, "Adjusts the sharpness of the display's image quality by amplifying high frequency content." },
{ "ImageSharpeningDefault", NV_CTRL_IMAGE_SHARPENING_DEFAULT, 0, "Returns default value of image sharpening." },
- { "FrontendResolution", NV_CTRL_FRONTEND_RESOLUTION, N|P, "Returns the dimensions of the frontend (current) resolution as determined by the NVIDIA X Driver. This attribute is a packed integer; the width is packed in the upper 16 bits and the height is packed in the lower 16-bits." },
+ { "FrontendResolution", NV_CTRL_FRONTEND_RESOLUTION, N|P, "Returns the dimensions of the frontend (current) resolution as determined by the NVIDIA X Driver. This attribute is a packed integer; the width is packed in the upper 16 bits and the height is packed in the lower 16-bits." },
{ "BackendResolution", NV_CTRL_BACKEND_RESOLUTION, N|P, "Returns the dimensions of the backend resolution as determined by the NVIDIA X Driver. The backend resolution is the resolution (supported by the display device) the GPU is set to scale to. If this resolution matches the frontend resolution, GPU scaling will not be needed/used. This attribute is a packed integer; the width is packed in the upper 16-bits and the height is packed in the lower 16-bits." },
{ "FlatpanelNativeResolution", NV_CTRL_FLATPANEL_NATIVE_RESOLUTION, N|P, "Returns the dimensions of the native resolution of the flat panel as determined by the NVIDIA X Driver. The native resolution is the resolution at which a flat panel must display any image. All other resolutions must be scaled to this resolution through GPU scaling or the DFP's native scaling capabilities in order to be displayed. This attribute is only valid for flat panel (DFP) display devices. This attribute is a packed integer; the width is packed in the upper 16-bits and the height is packed in the lower 16-bits." },
{ "FlatpanelBestFitResolution", NV_CTRL_FLATPANEL_BEST_FIT_RESOLUTION, N|P, "Returns the dimensions of the resolution, selected by the X driver, from the DFP's EDID that most closely matches the frontend resolution of the current mode. The best fit resolution is selected on a per-mode basis. This attribute is only valid for flat panel (DFP) display devices. This attribute is a packed integer; the width is packed in the upper 16-bits and the height is packed in the lower 16-bits." },
{ "DFPScalingActive", NV_CTRL_DFP_SCALING_ACTIVE, N, "Returns the current state of DFP scaling. DFP scaling is mode-specific (meaning it may vary depending on which mode is currently set). DFP scaling is active if the GPU is set to scale to the best fit resolution (GPUScaling is set to use FlatpanelBestFitResolution) and the best fit and native resolutions are different." },
{ "GPUScaling", NV_CTRL_GPU_SCALING, P, "Controls what the GPU scales to and how. This attribute is a packed integer; the scaling target (native/best fit) is packed in the upper 16-bits and the scaling method is packed in the lower 16-bits." },
{ "GPUScalingActive", NV_CTRL_GPU_SCALING_ACTIVE, N, "Returns the current state of GPU scaling. GPU scaling is mode-specific (meaning it may vary depending on which mode is currently set). GPU scaling is active if the frontend timing (current resolution) is different than the target resolution. The target resolution is either the native resolution of the flat panel or the best fit resolution supported by the flat panel. What (and how) the GPU should scale to is controlled through the GPUScaling attribute." },
- { "RefreshRate", NV_CTRL_REFRESH_RATE, N|H, "Returns the refresh rate of the specified display device in cHz (Centihertz) (i.e. to get the refresh rate in Hz, divide the returned value by 100.)" },
- { "RefreshRate3", NV_CTRL_REFRESH_RATE_3, N|K, "Returns the refresh rate of the specified display device in mHz (Millihertz) (i.e. to get the refresh rate in Hz, divide the returned value by 1000.)" },
+ { "RefreshRate", NV_CTRL_REFRESH_RATE, N|H, "Returns the refresh rate of the specified display device in cHz (Centihertz) (to get the refresh rate in Hz, divide the returned value by 100)." },
+ { "RefreshRate3", NV_CTRL_REFRESH_RATE_3, N|K, "Returns the refresh rate of the specified display device in mHz (Millihertz) (to get the refresh rate in Hz, divide the returned value by 1000)." },
{ "OverscanCompensation", NV_CTRL_OVERSCAN_COMPENSATION, 0, "Adjust the amount of overscan compensation scaling, in pixels, to apply to the specified display device." },
/* TV */
@@ -316,7 +322,7 @@ AttributeTableEntry attributeTable[] = {
* about.
*/
-#if NV_CTRL_LAST_ATTRIBUTE != NV_CTRL_OVERSCAN_COMPENSATION
+#if NV_CTRL_LAST_ATTRIBUTE != NV_CTRL_GPU_PCIE_GENERATION
#warning "Have you forgotten to add a new integer attribute to attributeTable?"
#endif