summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Plattner <aplattner@nvidia.com>2011-12-27 17:43:18 -0800
committerAaron Plattner <aplattner@nvidia.com>2011-12-27 17:43:18 -0800
commitceb7637cc0b8f32c76abca6568f5d628bf9b19f5 (patch)
tree9c200f077a3f69b9421195ad54893df3029e0b70
parent56256feee7eaa8720527f827387b67b2389eb469 (diff)
295.09295.09
-rw-r--r--src/gtk+-2.x/ctk3dvisionpro.c26
-rw-r--r--src/gtk+-2.x/ctkdisplayconfig-utils.c265
-rw-r--r--src/gtk+-2.x/ctkdisplayconfig.c129
-rw-r--r--src/gtk+-2.x/ctkdisplaylayout.c19
-rw-r--r--src/gtk+-2.x/ctkditheringcontrols.c40
-rw-r--r--src/gtk+-2.x/ctkecc.c33
-rw-r--r--src/gtk+-2.x/ctkevent.c5
-rw-r--r--src/gtk+-2.x/ctkgpu.c138
-rw-r--r--src/gtk+-2.x/ctkgpu.h5
-rw-r--r--src/gtk+-2.x/ctkgvi.c14
-rw-r--r--src/gtk+-2.x/ctkpowermizer.c320
-rw-r--r--src/gtk+-2.x/ctkpowermizer.h5
-rw-r--r--src/gtk+-2.x/ctkutils.c49
-rw-r--r--src/gtk+-2.x/ctkutils.h8
-rw-r--r--src/gtk+-2.x/ctkwindow.c6
-rw-r--r--src/libXNVCtrl/NVCtrl.h33
-rw-r--r--src/parse.c18
-rw-r--r--version.mk2
18 files changed, 573 insertions, 542 deletions
diff --git a/src/gtk+-2.x/ctk3dvisionpro.c b/src/gtk+-2.x/ctk3dvisionpro.c
index b02f936..28d3989 100644
--- a/src/gtk+-2.x/ctk3dvisionpro.c
+++ b/src/gtk+-2.x/ctk3dvisionpro.c
@@ -527,12 +527,27 @@ static void callback_glasses_paired(GtkObject *object, gpointer arg1,
Bool ret;
CtkEventStruct *event_struct;
char temp[64]; //scratchpad memory used to construct labels.
+ int index;
Ctk3DVisionPro *ctk_3d_vision_pro = CTK_3D_VISION_PRO(user_data);
AddGlassesDlg *dlg = ctk_3d_vision_pro->add_glasses_dlg;
event_struct = (CtkEventStruct *) arg1;
glasses_id = event_struct->value;
+
+ /* It is possible for the user to accidentally try pairing a glass even if
+ * it is already paired leading to multiple entries. To avoid this, return if
+ * the glass entry is already present in the local table.
+ */
+
+ if (dlg) {
+ for (index = 0; index < dlg->new_glasses; index++) {
+ if (dlg->glasses_info[index]->glasses_id == glasses_id) {
+ return;
+ }
+ }
+ }
+
ret = XNVCTRLQueryTargetStringAttribute(NvCtrlGetDisplayPtr(ctk_3d_vision_pro->handle),
NV_CTRL_TARGET_TYPE_3D_VISION_PRO_TRANSCEIVER,
target_id, glasses_id,
@@ -573,6 +588,17 @@ static void callback_glasses_paired(GtkObject *object, gpointer arg1,
gtk_widget_show_all(GTK_WIDGET(dlg->table.data_table));
}
+ /* This is to avoid multiple entries of a glass's information
+ * being displayed by nvidia-settings. Return in case the glass
+ * entry is already present in the HTU table.
+ */
+
+ for (index = 0; index < HTU(0)->num_glasses; index++) {
+ if (HTU(0)->glasses_info[index]->glasses_id == glasses_id) {
+ return;
+ }
+ }
+
// Add glasses_info into HTU(0)->glasses_info list.
HTU(0)->glasses_info = realloc(HTU(0)->glasses_info,
(HTU(0)->num_glasses + 1) * sizeof(GlassesInfo *));
diff --git a/src/gtk+-2.x/ctkdisplayconfig-utils.c b/src/gtk+-2.x/ctkdisplayconfig-utils.c
index 397ca5e..c8b41b3 100644
--- a/src/gtk+-2.x/ctkdisplayconfig-utils.c
+++ b/src/gtk+-2.x/ctkdisplayconfig-utils.c
@@ -16,7 +16,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses>.
*/
-
+
#include <stdlib.h> /* malloc */
#include <string.h> /* strlen, strdup */
#include <unistd.h> /* lseek, close */
@@ -114,7 +114,7 @@ void apply_modeline_token(char *token, char *value, void *data)
void apply_metamode_token(char *token, char *value, void *data)
{
nvMetaModePtr metamode = (nvMetaModePtr) data;
-
+
if (!metamode || !token || !strlen(token)) {
return;
}
@@ -171,7 +171,7 @@ void apply_metamode_token(char *token, char *value, void *data)
void apply_monitor_token(char *token, char *value, void *data)
{
char **source = (char **)data;
-
+
if (!source || !token || !strlen(token)) {
return;
}
@@ -201,7 +201,7 @@ void apply_monitor_token(char *token, char *value, void *data)
void apply_screen_info_token(char *token, char *value, void *data)
{
ScreenInfo *screen_info = (ScreenInfo *)data;
-
+
if (!screen_info || !token || !strlen(token)) {
return;
}
@@ -299,7 +299,7 @@ static nvModeLinePtr modeline_parse(nvDisplayPtr display,
/* Parse modeline flags */
while ((str = parse_read_name(str, &tmp, 0)) && strlen(tmp)) {
-
+
if (!xconfigNameCompare(tmp, "+hsync")) {
modeline->data.flags |= XCONFIG_MODE_PHSYNC;
}
@@ -517,7 +517,7 @@ nvModePtr mode_parse(nvDisplayPtr display, const char *mode_str)
str = parse_read_integer_pair(str, 0,
&(mode->dim[X]), &(mode->dim[Y]));
}
-
+
/* Mode parse error - Ack! */
else {
str = NULL;
@@ -526,8 +526,8 @@ nvModePtr mode_parse(nvDisplayPtr display, const char *mode_str)
/* Catch errors */
if (!str) goto fail;
}
-
-
+
+
/* These are the same for now */
mode->pan[X] = mode->dim[X];
mode->pan[Y] = mode->dim[Y];
@@ -549,7 +549,7 @@ nvModePtr mode_parse(nvDisplayPtr display, const char *mode_str)
if (mode) {
free(mode);
}
-
+
return NULL;
} /* mode_parse() */
@@ -568,7 +568,7 @@ static gchar *mode_get_str(nvModePtr mode, int be_generic)
gchar *mode_str;
gchar *tmp;
-
+
/* Make sure the mode has everything it needs to be displayed */
if (!mode || !mode->display || !mode->display->gpu || !mode->metamode) {
return NULL;
@@ -641,7 +641,7 @@ static gchar *mode_get_str(nvModePtr mode, int be_generic)
/*
* XXX Later, we'll want to allow the user to select how
* the metamodes are generated:
- *
+ *
* Programability:
* make mode->dim relative to screen->dim
*
@@ -745,7 +745,7 @@ int display_find_closest_mode_matching_modeline(nvDisplayPtr display,
nvModePtr mode;
int mode_idx;
int match_idx = -1;
-
+
mode_idx = 0;
for (mode = display->modes; mode; mode = mode->next) {
if (mode->modeline->data.vdisplay == modeline->data.vdisplay &&
@@ -816,7 +816,7 @@ Bool modelines_match(nvModeLinePtr modeline1,
modeline1->data.vscan == modeline2->data.vscan &&
modeline1->data.flags == modeline2->data.flags &&
modeline1->data.hskew == modeline2->data.hskew &&
- !g_ascii_strcasecmp(modeline1->data.identifier,
+ !g_ascii_strcasecmp(modeline1->data.identifier,
modeline2->data.identifier)) {
return TRUE;
} else {
@@ -857,7 +857,7 @@ Bool display_has_modeline(nvDisplayPtr display,
static void display_remove_modelines(nvDisplayPtr display)
{
nvModeLinePtr modeline;
-
+
if (display) {
while (display->modelines) {
modeline = display->modelines;
@@ -985,7 +985,7 @@ static gchar *display_get_mode_str(nvDisplayPtr display, int mode_idx,
mode = mode->next;
mode_idx--;
}
-
+
if (mode) {
return mode_get_str(mode, be_generic);
}
@@ -1082,7 +1082,7 @@ void renumber_xscreens(nvLayoutPtr layout)
lowest->scrnum = scrnum;
}
- /* Assign next screen number */
+ /* Assign next screen number */
scrnum++;
} while (lowest);
@@ -1294,7 +1294,7 @@ static void screen_remove_metamodes(nvScreenPtr screen)
/** screen_add_metamode() ********************************************
*
- * Parses a metamode string and adds the appropreate modes to the
+ * Parses a metamode string and adds the appropriate modes to the
* screen's display devices (at the end of the list)
*
**/
@@ -1302,12 +1302,11 @@ static Bool screen_add_metamode(nvScreenPtr screen, const char *metamode_str,
gchar **err_str)
{
char *mode_str_itr;
- char *str = NULL;
- const char *tmp;
- char *tokens;
- char *metamode_copy;
- nvMetaModePtr metamode;
- int str_offset = 0;
+ const char *tokens_end;
+ const char *metamode_modes;
+ char *metamode_copy = NULL;
+ nvMetaModePtr metamode = NULL;
+ int mode_count = 0;
if (!screen || !screen->gpu || !metamode_str) goto fail;
@@ -1317,44 +1316,36 @@ static Bool screen_add_metamode(nvScreenPtr screen, const char *metamode_str,
if (!metamode) goto fail;
- /* Read the MetaMode ID */
- tmp = strstr(metamode_str, "::");
- if (tmp) {
+ /* Read the MetaMode ID (along with any metamode tokens) */
+ tokens_end = strstr(metamode_str, "::");
+ if (tokens_end) {
+ char *tokens = strdup(metamode_str);
- tokens = strdup(metamode_str);
if (!tokens) goto fail;
- tokens[ tmp-metamode_str ] = '\0';
- tmp += 2;
- parse_token_value_pairs(tokens, apply_metamode_token,
- (void *)metamode);
+ tokens[tokens_end-metamode_str] = '\0';
+ parse_token_value_pairs(tokens, apply_metamode_token, (void *)metamode);
+
free(tokens);
- str_offset = tmp - metamode_str;
+ metamode_modes = tokens_end + 2;
} else {
/* No tokens? Try the old "ID: METAMODE_STR" syntax */
- const char *read_offset;
- read_offset = parse_read_integer(metamode_str, &(metamode->id));
+ metamode_modes = parse_read_integer(metamode_str, &(metamode->id));
metamode->source = METAMODE_SOURCE_NVCONTROL;
- if (*read_offset == ':') {
- read_offset++;
- str_offset = read_offset - metamode_str;
+ if (*metamode_modes == ':') {
+ metamode_modes++;
+
}
}
- /* Copy the string so we can split it up */
- metamode_copy = strdup(metamode_str + str_offset);
+ /* Process each mode in the metamode string */
+ metamode_copy = strdup(metamode_modes);
if (!metamode_copy) goto fail;
- /* Add the metamode at the end of the screen's metamode list */
- xconfigAddListItem((GenericListPtr *)(&screen->metamodes),
- (GenericListPtr)metamode);
-
-
- /* Split up the metamode into separate modes */
for (mode_str_itr = strtok(metamode_copy, ",");
mode_str_itr;
mode_str_itr = strtok(NULL, ",")) {
-
+
nvModePtr mode;
unsigned int device_mask;
nvDisplayPtr display;
@@ -1364,79 +1355,83 @@ static Bool screen_add_metamode(nvScreenPtr screen, const char *metamode_str,
/* Parse the display device bitmask from the name */
mode_str = parse_read_display_name(mode_str_itr, &device_mask);
if (!mode_str) {
- *err_str = g_strdup_printf("Failed to read a display device name "
- "on screen %d (on GPU-%d)\nwhile "
- "parsing metamode:\n\n'%s'",
- screen->scrnum,
- NvCtrlGetTargetId(screen->gpu->handle),
- orig_mode_str);
- nv_error_msg(*err_str);
- goto fail;
+ nv_warning_msg("Failed to read a display device name on screen %d "
+ "(on GPU-%d)\nwhile parsing metamode:\n\n'%s'",
+ screen->scrnum,
+ NvCtrlGetTargetId(screen->gpu->handle),
+ orig_mode_str);
+ continue;
}
-
/* Match device bitmask to an existing display */
display = gpu_get_display(screen->gpu, device_mask);
if (!display) {
- *err_str = g_strdup_printf("Failed to find display device 0x%08x "
- "on screen %d (on GPU-%d)\nwhile "
- "parsing metamode:\n\n'%s'",
- device_mask,
- screen->scrnum,
- NvCtrlGetTargetId(screen->gpu->handle),
- orig_mode_str);
- nv_error_msg(*err_str);
- goto fail;
+ nv_warning_msg("Failed to find display device 0x%08x on screen %d "
+ "(on GPU-%d)\nwhile parsing metamode:\n\n'%s'",
+ device_mask,
+ screen->scrnum,
+ NvCtrlGetTargetId(screen->gpu->handle),
+ orig_mode_str);
+ continue;
}
-
/* Parse the mode */
mode = mode_parse(display, mode_str);
if (!mode) {
- *err_str = g_strdup_printf("Failed to parse mode '%s'\non "
- "screen %d (on GPU-%d)\nfrom "
- "metamode:\n\n'%s'",
- mode_str, screen->scrnum,
- NvCtrlGetTargetId(screen->gpu->handle),
- orig_mode_str);
- nv_error_msg(*err_str);
- goto fail;
+ nv_warning_msg("Failed to parse mode '%s'\non screen %d (on GPU-%d)"
+ "\nfrom metamode:\n\n'%s'",
+ mode_str, screen->scrnum,
+ NvCtrlGetTargetId(screen->gpu->handle),
+ orig_mode_str);
+ continue;
}
-
/* Make the mode part of the metamode */
mode->metamode = metamode;
-
/* Make the display part of the screen */
screen_link_display(screen, display);
-
/* Set the panning offset */
mode->pan[X] = mode->dim[X];
mode->pan[Y] = mode->dim[Y];
-
/* Add the mode at the end of the display's mode list */
xconfigAddListItem((GenericListPtr *)(&display->modes),
(GenericListPtr)mode);
display->num_modes++;
-
- } /* Done parsing a single metamode */
+ mode_count++;
+ }
- free(str);
- return TRUE;
+ free(metamode_copy);
+ metamode_copy = NULL;
+ /* Make sure something was added */
+ if (mode_count == 0) {
+ nv_warning_msg("Failed to find any display on screen %d (on GPU-%d)\n"
+ "while parsing metamode:\n\n'%s'",
+ screen->scrnum,
+ NvCtrlGetTargetId(screen->gpu->handle),
+ metamode_str);
+ goto fail;
+ }
+
+ /* Add the metamode to the end of the screen's metamode list */
+ xconfigAddListItem((GenericListPtr *)(&screen->metamodes),
+ (GenericListPtr)metamode);
+
+ return TRUE;
- /* Failure case */
fail:
-
- /* XXX We should probably track which modes were added and remove
- * them at this point. For now, just assume the caller will
- * remove all the modes and bail.
- */
- free(str);
+ /* Cleanup */
+ if (metamode) {
+ free(metamode);
+ }
+ if (metamode_copy) {
+ free(metamode_copy);
+ }
+
return FALSE;
} /* screen_add_metamode() */
@@ -1550,7 +1545,7 @@ void screen_assign_dummy_metamode_positions(nvScreenPtr screen)
/** screen_add_metamodes() *******************************************
*
- * Adds all the appropreate modes on all display devices of this
+ * Adds all the appropriate modes on all display devices of this
* screen by parsing all the metamode strings.
*
**/
@@ -1602,8 +1597,9 @@ static Bool screen_add_metamodes(nvScreenPtr screen, gchar **err_str)
/* Parse each mode in the metamode strings */
- str = metamode_strs;
- while (str && strlen(str)) {
+ for (str = metamode_strs;
+ (str && strlen(str));
+ str += strlen(str) +1) {
/* Add the individual metamodes to the screen,
* This populates the display device's mode list.
@@ -1613,9 +1609,9 @@ static Bool screen_add_metamodes(nvScreenPtr screen, gchar **err_str)
"GPU-%d).",
str, screen->scrnum,
NvCtrlGetTargetId(screen->gpu->handle));
- goto fail;
+ continue;
}
-
+
/* Keep track of the current metamode */
if (!strcmp(str, cur_metamode_str)) {
screen->cur_metamode_idx = screen->num_metamodes;
@@ -1626,12 +1622,18 @@ static Bool screen_add_metamodes(nvScreenPtr screen, gchar **err_str)
/* Make sure each display device gets a mode */
screen_check_metamodes(screen);
-
- /* Go to the next metamode */
- str += strlen(str) +1;
}
XFree(metamode_strs);
+ metamode_strs = NULL;
+ if (!screen->metamodes) {
+ *err_str = g_strdup_printf("Failed to add any metamode to screen %d "
+ "(on GPU-%d).",
+ screen->scrnum,
+ NvCtrlGetTargetId(screen->gpu->handle));
+ nv_error_msg(*err_str);
+ goto fail;
+ }
/* Assign the top left position of dummy modes */
screen_assign_dummy_metamode_positions(screen);
@@ -1713,7 +1715,7 @@ nvDisplayPtr gpu_get_display(nvGpuPtr gpu, unsigned int device_mask)
for (display = gpu->displays; display; display = display->next_on_gpu) {
if (display->device_mask == device_mask) return display;
}
-
+
return NULL;
} /* gpu_get_display() */
@@ -1839,7 +1841,7 @@ static Bool gpu_query_gvo_mode_info(nvGpuPtr gpu, int mode_id, int table_idx)
mode_id,
NV_CTRL_GVIO_VIDEO_FORMAT_REFRESH_RATE,
&(rate));
-
+
ret2 = NvCtrlGetStringDisplayAttribute(gpu->handle,
mode_id,
NV_CTRL_STRING_GVIO_VIDEO_FORMAT_NAME,
@@ -1924,7 +1926,7 @@ nvDisplayPtr gpu_add_display_from_server(nvGpuPtr gpu,
} else {
valid1 = valid.u.bits.ints;
}
-
+
ret = NvCtrlGetValidAttributeValues(gpu->handle,
NV_CTRL_GVIO_REQUESTED_VIDEO_FORMAT2,
&valid);
@@ -2272,12 +2274,12 @@ static Bool layout_add_gpu_from_server(nvLayoutPtr layout, unsigned int gpu_id,
Display *dpy;
nvGpuPtr gpu = NULL;
-
+
/* Create the GPU structure */
gpu = (nvGpuPtr)calloc(1, sizeof(nvGpu));
if (!gpu) goto fail;
-
+
/* Make an NV-CONTROL handle to talk to the GPU */
dpy = NvCtrlGetDisplayPtr(layout->handle);
gpu->layout = layout;
@@ -2617,11 +2619,12 @@ static int layout_add_screens_from_server(nvLayoutPtr layout, gchar **err_str)
for (i = 0; i < nscreens; i++) {
if (!layout_add_screen_from_server(layout, i, err_str)) {
nv_warning_msg("Failed to add X screen %d to layout.", i);
- goto fail;
+ g_free(*err_str);
+ *err_str = NULL;
}
}
- return nscreens;
+ return layout->num_screens;
fail:
@@ -2711,13 +2714,13 @@ nvLayoutPtr layout_load_from_server(NvCtrlAttributeHandle *handle,
}
if (!layout_add_screens_from_server(layout, err_str)) {
- nv_warning_msg("Failed to add Screens(s) to layout for display "
+ nv_warning_msg("Failed to add screens(s) to layout for display "
"configuration page.");
goto fail;
}
if (!layout_add_screenless_modes_to_displays(layout)) {
- nv_warning_msg("Failed to add Screenless modes to layout for "
+ nv_warning_msg("Failed to add screenless modes to layout for "
"display configuration page.");
goto fail;
}
@@ -2793,18 +2796,18 @@ static void update_banner(XConfigPtr config)
char *s = config->comment;
char *line, *eol, *tmp;
-
+
/* remove all lines that begin with the prefix */
-
+
while (s && (line = strstr(s, prefix))) {
-
+
eol = strchr(line, '\n'); /* find the end of the line */
-
+
if (eol) {
eol++;
if (*eol == '\0') eol = NULL;
}
-
+
if (line == s) { /* the line with the prefix is at the start */
if (eol) { /* there is more after the prefix line */
tmp = g_strdup(eol);
@@ -2821,14 +2824,14 @@ static void update_banner(XConfigPtr config)
s = tmp;
}
}
-
+
/* add our prefix lines at the start of the comment */
config->comment = g_strconcat(prefix, banner,
"# ", pNV_ID, "\n",
(s ? s : ""),
NULL);
if (s) g_free(s);
-
+
} /* update_banner() */
@@ -2881,7 +2884,7 @@ static int save_xconfig_file(SaveXConfDlg *dlg,
nv_info_msg("", "X configuration file '%s' already exists, "
"backing up file as '%s'", filename,
backup_filename);
-
+
/* Delete any existing backup file */
if (access(backup_filename, F_OK) == 0) {
@@ -2900,7 +2903,7 @@ static int save_xconfig_file(SaveXConfDlg *dlg,
g_strdup_printf("Unable to create new X config backup "
"file '%s'.",
backup_filename);
- goto done;
+ goto done;
}
}
@@ -2915,7 +2918,7 @@ static int save_xconfig_file(SaveXConfDlg *dlg,
fprintf(fp, "%s", buf);
ret = 1;
-
+
done:
/* Display any errors that might have occured */
if (err_msg) {
@@ -2927,7 +2930,7 @@ static int save_xconfig_file(SaveXConfDlg *dlg,
if (fp) fclose(fp);
g_free(backup_filename);
return ret;
-
+
} /* save_xconfig_file() */
@@ -3053,7 +3056,7 @@ static void update_xconfig_save_buffer(SaveXConfDlg *dlg)
/* Sanitize the X config file */
xconfigGenerateLoadDefaultOptions(&gop);
xconfigGetXServerInUse(&gop);
-
+
if (!xconfigSanitizeConfig(xconfCur, NULL, &gop)) {
err_msg = g_strdup_printf("Failed to sanitize existing X "
"config file '%s'!",
@@ -3061,7 +3064,7 @@ static void update_xconfig_save_buffer(SaveXConfDlg *dlg)
ctk_display_warning_msg
(ctk_get_parent_window(GTK_WIDGET(dlg->parent)),
err_msg);
-
+
xconfigFreeConfig(&xconfCur);
xconfCur = NULL;
} else {
@@ -3100,14 +3103,14 @@ static void update_xconfig_save_buffer(SaveXConfDlg *dlg)
g_signal_handlers_block_by_func
(G_OBJECT(dlg->btn_xconfig_merge),
G_CALLBACK(xconfig_update_buffer), (gpointer) dlg);
-
+
gtk_toggle_button_set_active
(GTK_TOGGLE_BUTTON(dlg->btn_xconfig_merge), merged);
-
+
g_signal_handlers_unblock_by_func
(G_OBJECT(dlg->btn_xconfig_merge),
G_CALLBACK(xconfig_update_buffer), (gpointer) dlg);
-
+
gtk_widget_set_sensitive(dlg->btn_xconfig_merge,
dlg->merge_toggleable && mergeable);
@@ -3261,10 +3264,10 @@ static void xconfig_file_clicked(GtkWidget *widget, gpointer user_data)
gtk_file_selection_set_filename
(GTK_FILE_SELECTION(dlg->dlg_xconfig_file), filename);
-
+
result = gtk_dialog_run(GTK_DIALOG(dlg->dlg_xconfig_file));
gtk_widget_hide(dlg->dlg_xconfig_file);
-
+
switch (result) {
case GTK_RESPONSE_ACCEPT:
case GTK_RESPONSE_OK:
@@ -3321,8 +3324,8 @@ void run_save_xconfig_dialog(SaveXConfDlg *dlg)
gtk_widget_show(dlg->dlg_xconfig_save);
result = gtk_dialog_run(GTK_DIALOG(dlg->dlg_xconfig_save));
gtk_widget_hide(dlg->dlg_xconfig_save);
-
-
+
+
/* Handle user's response */
switch (result)
{
@@ -3368,7 +3371,7 @@ void run_save_xconfig_dialog(SaveXConfDlg *dlg)
g_free(buf);
g_free(filename);
break;
-
+
case GTK_RESPONSE_REJECT:
default:
/* do nothing. */
@@ -3501,25 +3504,25 @@ SaveXConfDlg *create_save_xconfig_dialog(GtkWidget *parent,
hbox,
TRUE, TRUE, 0);
dlg->box_xconfig_save = hbox;
-
+
/* Pack the filename text entry and browse button */
hbox = gtk_hbox_new(FALSE, 0);
hbox2 = gtk_hbox_new(FALSE, 5);
-
+
gtk_box_pack_end(GTK_BOX(hbox2), dlg->btn_xconfig_file, FALSE, FALSE, 0);
gtk_box_pack_end(GTK_BOX(hbox2), dlg->txt_xconfig_file, TRUE, TRUE, 0);
gtk_box_pack_end(GTK_BOX(hbox), hbox2, TRUE, TRUE, 5);
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dlg->dlg_xconfig_save)->vbox),
hbox,
FALSE, FALSE, 5);
-
+
/* Pack the merge checkbox */
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dlg->dlg_xconfig_save)->vbox),
dlg->btn_xconfig_merge,
FALSE, FALSE, 5);
-
+
gtk_widget_show_all(GTK_DIALOG(dlg->dlg_xconfig_save)->vbox);
-
+
return dlg;
} /* create_save_xconfig_button() */
diff --git a/src/gtk+-2.x/ctkdisplayconfig.c b/src/gtk+-2.x/ctkdisplayconfig.c
index f8ebcc1..73b85cc 100644
--- a/src/gtk+-2.x/ctkdisplayconfig.c
+++ b/src/gtk+-2.x/ctkdisplayconfig.c
@@ -2162,7 +2162,9 @@ static void setup_display_config(CtkDisplayConfig *ctk_object)
*/
if (display->gpu->num_displays == 1 ||
!num_screens_on_gpu ||
- (num_screens_on_gpu == 1 && display->screen) ||
+ (num_screens_on_gpu == 1 &&
+ display->screen &&
+ display->screen->num_displays == 1) ||
(display->screen && display->screen->sli)) {
gtk_widget_set_sensitive(ctk_object->mnu_display_config_twinview,
FALSE);
@@ -3636,7 +3638,7 @@ static gint validation_fix_crowded_metamodes(CtkDisplayConfig *ctk_object,
/* Count the number of display devices that have a mode
* set for this metamode. NULL out the modes of extra
- * display devices once we've counted 2 display devices
+ * display devices once we've counted max supported display devices
* that have a (non NULL) mode set.
*/
num = 0;
@@ -3659,15 +3661,16 @@ static gint validation_fix_crowded_metamodes(CtkDisplayConfig *ctk_object,
}
/* Disable extra modes */
- if (num > 2) {
+ if (num > screen->gpu->max_displays) {
ctk_display_layout_set_mode_modeline
(CTK_DISPLAY_LAYOUT(ctk_object->obj_layout),
mode, NULL);
nv_info_msg(TAB, "Setting display device '%s' as Off "
"for MetaMode %d on Screen %d. (There are "
- "already two active display devices for this "
- "MetaMode.", display->name, i, screen->scrnum);
+ "already %d active display devices for this "
+ "MetaMode.", display->name, i, screen->scrnum,
+ screen->gpu->max_displays);
}
}
@@ -3896,11 +3899,12 @@ static gchar * validate_screen(nvScreenPtr screen)
}
- /* There can be at most two displays active in the metamode. */
- if (num_displays > 2) {
+ /* There can be at most max supported displays active in the metamode. */
+ if (num_displays > screen->gpu->max_displays) {
tmp = g_strdup_printf("%s MetaMode %d of Screen %d has more than "
- "two active display devices.\n\n",
- bullet, i+1, screen->scrnum);
+ "%d active display devices.\n\n",
+ bullet, i+1, screen->scrnum,
+ screen->gpu->max_displays);
tmp2 = g_strconcat((err_str ? err_str : ""), tmp, NULL);
g_free(err_str);
g_free(tmp);
@@ -7344,125 +7348,30 @@ static void probe_clicked(GtkWidget *widget, gpointer user_data)
{
CtkDisplayConfig *ctk_object = CTK_DISPLAY_CONFIG(user_data);
unsigned int probed_displays;
- unsigned int mask;
nvLayoutPtr layout = ctk_object->layout;
nvGpuPtr gpu;
- nvDisplayPtr display;
- nvDisplayPtr selected_display = ctk_display_layout_get_selected_display
- (CTK_DISPLAY_LAYOUT(ctk_object->obj_layout));
ReturnStatus ret;
- gchar *type;
- gchar *str;
/* Probe each GPU for display changes */
for (gpu = layout->gpus; gpu; gpu = gpu->next_in_layout) {
if (!gpu->handle) continue;
- g_signal_handlers_block_by_func
- (G_OBJECT(gpu->ctk_event),
- G_CALLBACK(display_config_attribute_changed),
- (gpointer) ctk_object);
-
- /* Do the probe */
ret = NvCtrlGetAttribute(gpu->handle, NV_CTRL_PROBE_DISPLAYS,
(int *)&probed_displays);
if (ret != NvCtrlSuccess) {
nv_error_msg("Failed to probe for display devices on GPU-%d '%s'.",
NvCtrlGetTargetId(gpu->handle), gpu->name);
-
- g_signal_handlers_unblock_by_func
- (G_OBJECT(gpu->ctk_event),
- G_CALLBACK(display_config_attribute_changed),
- (gpointer) ctk_object);
-
continue;
}
- /* Make sure other parts of nvidia-settings get updated */
+ /* Emit the probe event to ourself so changes are handled
+ * consistently.
+ */
ctk_event_emit(gpu->ctk_event, 0,
NV_CTRL_PROBE_DISPLAYS, probed_displays);
-
- /* Go through the probed displays */
- for (mask = 1; mask; mask <<= 1) {
-
- /* Ask users about removing old displays */
- if ((gpu->connected_displays & mask) &&
- !(probed_displays & mask)) {
-
- display = gpu_get_display(gpu, mask);
- if (!display) continue; /* XXX ack. */
-
- /* The selected display is being removed */
- if (display == selected_display) {
- selected_display = NULL;
- }
-
- /* Setup the remove display dialog */
- type = display_get_type_str(display->device_mask, 0);
- str = g_strdup_printf("The display device %s (%s) on GPU-%d "
- "(%s) has been\nunplugged. Would you "
- "like to remove this display from the "
- "layout?",
- display->name, type,
- NvCtrlGetTargetId(gpu->handle),
- gpu->name);
- g_free(type);
- gtk_label_set_text(GTK_LABEL(ctk_object->txt_display_disable),
- str);
- g_free(str);
-
- gtk_button_set_label
- (GTK_BUTTON(ctk_object->btn_display_disable_off),
- "Remove");
-
- gtk_button_set_label
- (GTK_BUTTON(ctk_object->btn_display_disable_cancel),
- "Ignore");
-
- /* Ask the user if they want to remove the display */
- if (do_query_remove_display(ctk_object, display)) {
-
- /* Remove display from the GPU */
- gpu_remove_and_free_display(display);
-
- /* Let display layout widget know about change */
- ctk_display_layout_update_display_count
- (CTK_DISPLAY_LAYOUT(ctk_object->obj_layout), NULL);
-
- user_changed_attributes(ctk_object);
- }
-
- /* Add new displays as 'disabled' */
- } else if (!(gpu->connected_displays & mask) &&
- (probed_displays & mask)) {
- gchar *err_str = NULL;
- display = gpu_add_display_from_server(gpu, mask, &err_str);
- if (err_str) {
- nv_warning_msg(err_str);
- g_free(err_str);
- }
- gpu_add_screenless_modes_to_displays(gpu);
- ctk_display_layout_update_display_count
- (CTK_DISPLAY_LAYOUT(ctk_object->obj_layout),
- selected_display);
- }
- }
-
- g_signal_handlers_unblock_by_func
- (G_OBJECT(gpu->ctk_event),
- G_CALLBACK(display_config_attribute_changed),
- (gpointer) ctk_object);
}
-
- /* Sync the GUI */
- ctk_display_layout_redraw(CTK_DISPLAY_LAYOUT(ctk_object->obj_layout));
-
- setup_display_page(ctk_object);
-
- setup_screen_page(ctk_object);
-
} /* probe_clicked() */
@@ -7483,8 +7392,10 @@ static void reset_layout(CtkDisplayConfig *ctk_object)
/* Handle errors loading the new layout */
if (!layout || err_str) {
- nv_error_msg(err_str);
- g_free(err_str);
+ if (err_str) {
+ nv_error_msg(err_str);
+ g_free(err_str);
+ }
return;
}
diff --git a/src/gtk+-2.x/ctkdisplaylayout.c b/src/gtk+-2.x/ctkdisplaylayout.c
index 33e6759..8a451e2 100644
--- a/src/gtk+-2.x/ctkdisplaylayout.c
+++ b/src/gtk+-2.x/ctkdisplaylayout.c
@@ -4077,6 +4077,23 @@ void ctk_display_layout_set_display_panning(CtkDisplayLayout *ctk_object,
+/** select_topmost_item() **************************************
+ *
+ * Select top item from Z order list.
+ *
+ **/
+
+static void select_topmost_item(CtkDisplayLayout *ctk_object)
+{
+ if (ctk_object->Zorder[0].type == ZNODE_TYPE_DISPLAY) {
+ select_display(ctk_object, ctk_object->Zorder[0].u.display);
+ } else if (ctk_object->Zorder[0].type == ZNODE_TYPE_SCREEN) {
+ select_screen(ctk_object, ctk_object->Zorder[0].u.screen);
+ }
+} /* select_topmost_item() */
+
+
+
/** ctk_display_layout_select_display() ***********************
*
* Updates the currently selected display.
@@ -4109,6 +4126,8 @@ void ctk_display_layout_update_display_count(CtkDisplayLayout *ctk_object,
/* Select the previously selected display */
if (display) {
ctk_display_layout_select_display(ctk_object, display);
+ } else {
+ select_topmost_item(ctk_object);
}
} /* ctk_display_layout_update_display_count() */
diff --git a/src/gtk+-2.x/ctkditheringcontrols.c b/src/gtk+-2.x/ctkditheringcontrols.c
index af9cbb0..ef380c0 100644
--- a/src/gtk+-2.x/ctkditheringcontrols.c
+++ b/src/gtk+-2.x/ctkditheringcontrols.c
@@ -380,6 +380,19 @@ GtkWidget* ctk_dithering_controls_new(NvCtrlAttributeHandle *handle,
G_CALLBACK(dithering_update_received),
(gpointer) ctk_dithering_controls);
+ g_signal_connect(G_OBJECT(ctk_event),
+ CTK_EVENT_NAME(NV_CTRL_CURRENT_DITHERING),
+ G_CALLBACK(dithering_update_received),
+ (gpointer) ctk_dithering_controls);
+ g_signal_connect(G_OBJECT(ctk_event),
+ CTK_EVENT_NAME(NV_CTRL_CURRENT_DITHERING_MODE),
+ G_CALLBACK(dithering_update_received),
+ (gpointer) ctk_dithering_controls);
+ g_signal_connect(G_OBJECT(ctk_event),
+ CTK_EVENT_NAME(NV_CTRL_CURRENT_DITHERING_DEPTH),
+ G_CALLBACK(dithering_update_received),
+ (gpointer) ctk_dithering_controls);
+
return GTK_WIDGET(object);
} /* ctk_dithering_controls_new() */
@@ -435,6 +448,25 @@ static Bool update_dithering_info(gpointer user_data)
CTK_DITHERING_CONTROLS(user_data);
gint val, dithering_mode, dithering_depth;
+ /* requested dithering */
+ if (NvCtrlSuccess !=
+ NvCtrlGetDisplayAttribute(ctk_dithering_controls->handle,
+ ctk_dithering_controls->display_device_mask,
+ NV_CTRL_DITHERING, &val)) {
+ val = NV_CTRL_DITHERING_DISABLED;
+ }
+
+ if (val == NV_CTRL_DITHERING_ENABLED ||
+ val == NV_CTRL_DITHERING_AUTO) {
+ gtk_widget_set_sensitive(ctk_dithering_controls->dithering_mode_box, TRUE);
+ gtk_widget_set_sensitive(ctk_dithering_controls->dithering_depth_box, TRUE);
+ gtk_widget_show(ctk_dithering_controls->dithering_mode_box);
+ gtk_widget_show(ctk_dithering_controls->dithering_depth_box);
+ } else if (val == NV_CTRL_DITHERING_DISABLED) {
+ gtk_widget_set_sensitive(ctk_dithering_controls->dithering_mode_box, FALSE);
+ gtk_widget_set_sensitive(ctk_dithering_controls->dithering_depth_box, FALSE);
+ }
+
/* current dithering */
if (NvCtrlSuccess !=
NvCtrlGetDisplayAttribute(ctk_dithering_controls->handle,
@@ -446,15 +478,9 @@ static Bool update_dithering_info(gpointer user_data)
if (val == NV_CTRL_CURRENT_DITHERING_ENABLED) {
gtk_label_set_text(GTK_LABEL(ctk_dithering_controls->dithering_current_config),
"Enabled");
- gtk_widget_set_sensitive(ctk_dithering_controls->dithering_mode_box, TRUE);
- gtk_widget_set_sensitive(ctk_dithering_controls->dithering_depth_box, TRUE);
- gtk_widget_show(ctk_dithering_controls->dithering_mode_box);
- gtk_widget_show(ctk_dithering_controls->dithering_depth_box);
- } else if (val == NV_CTRL_CURRENT_DITHERING_DISABLED) {
+ } else {
gtk_label_set_text(GTK_LABEL(ctk_dithering_controls->dithering_current_config),
"Disabled");
- gtk_widget_set_sensitive(ctk_dithering_controls->dithering_mode_box, FALSE);
- gtk_widget_set_sensitive(ctk_dithering_controls->dithering_depth_box, FALSE);
}
/* dithering mode */
diff --git a/src/gtk+-2.x/ctkecc.c b/src/gtk+-2.x/ctkecc.c
index ebb4a6d..5fb1b31 100644
--- a/src/gtk+-2.x/ctkecc.c
+++ b/src/gtk+-2.x/ctkecc.c
@@ -66,6 +66,7 @@ static const char *__reset_default_config_button_help =
static void ecc_config_button_toggled(GtkWidget *, gpointer);
static void show_ecc_toggle_warning_dlg(CtkEcc *);
+static void ecc_set_config_status(CtkEcc *, gboolean);
static void ecc_configuration_update_received(GtkObject *, gpointer, gpointer);
static void post_ecc_configuration_update(CtkEcc *, gboolean);
@@ -200,6 +201,25 @@ static void post_ecc_configuration_update(CtkEcc *ctk_ecc, gboolean enabled)
/*
+ * ecc_set_config_status() - set ECC configuration button status
+ */
+
+static void ecc_set_config_status(CtkEcc *ctk_ecc, gboolean value)
+{
+ 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),
+ value);
+
+ g_signal_handlers_unblock_by_func(G_OBJECT(ctk_ecc->configuration_status),
+ G_CALLBACK(ecc_config_button_toggled),
+ (gpointer) ctk_ecc);
+}
+
+
+
+/*
* ecc_configuration_update_received() - this function is called when the
* NV_CTRL_GPU_ECC_CONFIGURATION atribute is changed by another
* NV-CONTROL client.
@@ -211,15 +231,9 @@ static void ecc_configuration_update_received(GtkObject *object,
CtkEventStruct *event_struct = (CtkEventStruct *) arg1;
CtkEcc *ctk_ecc = CTK_ECC(user_data);
- 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),
- event_struct->value);
+ /* set ECC configuration buttion status */
+ ecc_set_config_status(ctk_ecc, event_struct->value);
- g_signal_handlers_unblock_by_func(G_OBJECT(ctk_ecc->configuration_status),
- G_CALLBACK(ecc_config_button_toggled),
- (gpointer) ctk_ecc);
/* Update status bar message */
post_ecc_configuration_update(ctk_ecc, event_struct->value);
}
@@ -245,6 +259,9 @@ static void reset_default_config_button_clicked(GtkWidget *widget,
NV_CTRL_GPU_ECC_CONFIGURATION,
status);
+ /* update ECC configuration button status */
+ ecc_set_config_status(ctk_ecc, status);
+
/* show popup dialog*/
show_ecc_toggle_warning_dlg(ctk_ecc);
diff --git a/src/gtk+-2.x/ctkevent.c b/src/gtk+-2.x/ctkevent.c
index 89ad3fe..ca642ee 100644
--- a/src/gtk+-2.x/ctkevent.c
+++ b/src/gtk+-2.x/ctkevent.c
@@ -320,6 +320,9 @@ static void ctk_event_class_init(CtkEventClass *ctk_event_class)
MAKE_SIGNAL(NV_CTRL_GVO_ANC_PARITY_COMPUTATION);
MAKE_SIGNAL(NV_CTRL_3D_VISION_PRO_GLASSES_PAIR_EVENT);
MAKE_SIGNAL(NV_CTRL_3D_VISION_PRO_GLASSES_UNPAIR_EVENT);
+ MAKE_SIGNAL(NV_CTRL_GPU_PCIE_MAX_LINK_WIDTH);
+ MAKE_SIGNAL(NV_CTRL_GPU_PCIE_CURRENT_LINK_WIDTH);
+ MAKE_SIGNAL(NV_CTRL_GPU_PCIE_CURRENT_LINK_SPEED);
#undef MAKE_SIGNAL
/*
@@ -329,7 +332,7 @@ static void ctk_event_class_init(CtkEventClass *ctk_event_class)
* knows about.
*/
-#if NV_CTRL_LAST_ATTRIBUTE != NV_CTRL_3D_VISION_PRO_GLASSES_UNPAIR_EVENT
+#if NV_CTRL_LAST_ATTRIBUTE != NV_CTRL_GPU_PCIE_CURRENT_LINK_SPEED
#warning "There are attributes that do not emit signals!"
#endif
diff --git a/src/gtk+-2.x/ctkgpu.c b/src/gtk+-2.x/ctkgpu.c
index 598f250..001f491 100644
--- a/src/gtk+-2.x/ctkgpu.c
+++ b/src/gtk+-2.x/ctkgpu.c
@@ -36,7 +36,6 @@
static void probe_displays_received(GtkObject *object, gpointer arg1,
gpointer user_data);
#define ARRAY_ELEMENTS 16
-#define DEFAULT_UPDATE_PCIE_INFO_TIME_INTERVAL 1000
GType ctk_gpu_get_type(
void
@@ -117,6 +116,7 @@ static gchar *make_display_device_list(NvCtrlAttributeHandle *handle,
} /* make_display_device_list() */
+
void get_bus_type_str(NvCtrlAttributeHandle *handle,
gchar **bus)
{
@@ -137,12 +137,12 @@ void get_bus_type_str(NvCtrlAttributeHandle *handle,
bus_type_str = "Integrated";
}
- /* NV_CTRL_BUS_RATE */
+ /* NV_CTRL_GPU_PCIE_MAX_LINK_WIDTH */
bus_rate = NULL;
if (bus_type == NV_CTRL_BUS_TYPE_AGP ||
bus_type == NV_CTRL_BUS_TYPE_PCI_EXPRESS) {
- ret = NvCtrlGetAttribute(handle, NV_CTRL_BUS_RATE, &tmp);
+ ret = NvCtrlGetAttribute(handle, NV_CTRL_GPU_PCIE_MAX_LINK_WIDTH, &tmp);
if (ret == NvCtrlSuccess) {
if (bus_type == NV_CTRL_BUS_TYPE_PCI_EXPRESS) {
bus_rate = g_strdup_printf("x%u", tmp);
@@ -156,9 +156,7 @@ void get_bus_type_str(NvCtrlAttributeHandle *handle,
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);
+ pcie_gen = get_pcie_generation_string(handle);
}
/* concatenate all the available bus related information */
@@ -215,33 +213,6 @@ void get_bus_id_str(NvCtrlAttributeHandle *handle,
*pci_bus_id = bus_id;
}
-static gboolean update_pcie_info(gpointer user_data)
-{
- gchar *bus;
- gint link_speed;
- gchar *link_speed_str;
- ReturnStatus ret;
-
- CtkGpu *ctk_gpu = (CtkGpu *) user_data;
- get_bus_type_str(ctk_gpu->handle, &bus);
- gtk_label_set_text(GTK_LABEL(ctk_gpu->bus_label), bus);
-
- if (ctk_gpu->pcie_gen_queriable) {
- ret = NvCtrlGetAttribute(ctk_gpu->handle, NV_CTRL_GPU_PCIE_MAX_LINK_SPEED,
- &link_speed);
- if (ret != NvCtrlSuccess) {
- link_speed_str = g_strdup_printf("Unknown");
- }
- else {
- link_speed_str = g_strdup_printf("%d", link_speed);
- }
- gtk_label_set_text(GTK_LABEL(ctk_gpu->link_speed_label), link_speed_str);
- g_free(link_speed_str);
- }
- g_free(bus);
- return TRUE;
-}
-
GtkWidget* ctk_gpu_new(
@@ -261,7 +232,6 @@ GtkWidget* ctk_gpu_new(
GtkWidget *table;
char *product_name, *vbios_version, *video_ram, *irq;
- gchar *s;
gchar *pci_bus_id;
gchar pci_device_id[ARRAY_ELEMENTS];
gchar pci_vendor_id[ARRAY_ELEMENTS];
@@ -275,6 +245,10 @@ GtkWidget* ctk_gpu_new(
gchar *tmp_str;
gchar *gpu_cores;
gchar *memory_interface;
+ gchar *bus = NULL;
+ gchar *link_speed_str = NULL;
+ gchar *link_width_str = NULL;
+ gchar *pcie_gen_str = NULL;
unsigned int display_devices;
int xinerama_enabled;
@@ -451,11 +425,17 @@ GtkWidget* ctk_gpu_new(
banner = ctk_banner_image_new(BANNER_ARTWORK_GPU);
gtk_box_pack_start(GTK_BOX(ctk_gpu), banner, FALSE, FALSE, 0);
- /* NV_CTRL_GPU_PCIE_GENERATION */
-
- ret = NvCtrlGetAttribute(handle, NV_CTRL_GPU_PCIE_GENERATION, &tmp);
- if (ret == NvCtrlSuccess)
+ /* PCIe link information */
+ get_bus_type_str(handle, &bus);
+ pcie_gen_str = get_pcie_generation_string(handle);
+ if (pcie_gen_str) {
ctk_gpu->pcie_gen_queriable = TRUE;
+ link_speed_str =
+ get_pcie_link_speed_string(ctk_gpu->handle,
+ NV_CTRL_GPU_PCIE_MAX_LINK_SPEED);
+ link_width_str = get_pcie_link_width_string(ctk_gpu->handle,
+ NV_CTRL_GPU_PCIE_MAX_LINK_WIDTH);
+ }
/*
* GPU information: TOP->MIDDLE - LEFT->RIGHT
@@ -506,10 +486,9 @@ GtkWidget* ctk_gpu_new(
}
/* spacing */
row += 3;
- ctk_gpu->bus_label =
- add_table_row(table, row++,
- 0, 0.5, "Bus Type:",
- 0, 0.5, NULL);
+ add_table_row(table, row++,
+ 0, 0.5, "Bus Type:",
+ 0, 0.5, bus);
add_table_row(table, row++,
0, 0.5, "Bus ID:",
0, 0.5, pci_bus_id);
@@ -525,10 +504,18 @@ GtkWidget* ctk_gpu_new(
if (ctk_gpu->pcie_gen_queriable) {
/* spacing */
row += 3;
- ctk_gpu->link_speed_label =
- add_table_row(table, row++,
- 0, 0.5, "PCI-E Max Link Speed:",
- 0, 0.5, NULL);
+ add_table_row(table, row++,
+ 0, 0.5, "PCIe Generation:",
+ 0, 0.5, pcie_gen_str);
+ add_table_row(table, row++,
+ 0, 0.5, "Maximum PCIe Link Width:",
+ 0, 0.5, link_width_str);
+ add_table_row(table, row++,
+ 0, 0.5, "Maximum PCIe Link Speed:",
+ 0, 0.5, link_speed_str);
+ g_free(link_speed_str);
+ g_free(link_width_str);
+ g_free(pcie_gen_str);
row++;
}
@@ -553,23 +540,10 @@ GtkWidget* ctk_gpu_new(
g_free(irq);
g_free(screens);
g_free(displays);
+ g_free(bus);
gtk_widget_show_all(GTK_WIDGET(object));
- /* update PCI-E info */
- update_pcie_info((gpointer) ctk_gpu);
-
- /* Register a timer callback to update the PCI-E info */
- s = g_strdup_printf("Graphics Card (GPU %d)",
- NvCtrlGetTargetId(handle));
-
- ctk_config_add_timer(ctk_config,
- DEFAULT_UPDATE_PCIE_INFO_TIME_INTERVAL,
- s,
- (GSourceFunc) update_pcie_info,
- (gpointer) ctk_gpu);
- g_free(s);
-
/* Handle events */
g_signal_connect(G_OBJECT(ctk_event),
@@ -648,10 +622,27 @@ GtkTextBuffer *ctk_gpu_create_help(GtkTextTagTable *table,
ctk_help_heading(b, &i, "IRQ");
ctk_help_para(b, &i, "This is the interrupt request line assigned to "
"this GPU.");
-
+
if (ctk_gpu->pcie_gen_queriable) {
- ctk_help_heading(b, &i, "PCI-E Max Link Speed");
- ctk_help_para(b, &i, "This is the maximum PCI-E link speed.");
+ ctk_help_heading(b, &i, "PCIe Generation");
+ ctk_help_para(b, &i, "This is the PCIe generation that this GPU, in "
+ "this system, is compliant with.");
+
+ ctk_help_heading(b, &i, "Maximum PCIe Link Width");
+ ctk_help_para(b, &i, "This is the maximum width that the PCIe link "
+ "between the GPU and the system may be trained to. This "
+ "is expressed in number of lanes. The trained link "
+ "width may vary dynamically and possibly be narrower "
+ "based on the GPU's utilization and performance "
+ "settings.");
+
+ ctk_help_heading(b, &i, "Maximum PCIe Link Speed");
+ ctk_help_para(b, &i, "This is the maximum speed that the PCIe link "
+ "between the GPU and the system may be trained to. "
+ "This is expressed in gigatransfers per second "
+ "(GT/s). The link may be dynamically trained to a "
+ "slower speed, based on the GPU's utilization and "
+ "performance settings.");
}
ctk_help_heading(b, &i, "X Screens");
@@ -683,25 +674,4 @@ static void probe_displays_received(GtkObject *object, gpointer arg1,
g_free(str);
}
-void ctk_gpu_start_timer(GtkWidget *widget)
-{
- CtkGpu *ctk_gpu = CTK_GPU(widget);
-
- /* Start the GPU timer */
-
- ctk_config_start_timer(ctk_gpu->ctk_config,
- (GSourceFunc) update_pcie_info,
- (gpointer) ctk_gpu);
-}
-
-void ctk_gpu_stop_timer(GtkWidget *widget)
-{
- CtkGpu *ctk_gpu = CTK_GPU(widget);
-
- /* Stop the GPU timer */
-
- ctk_config_stop_timer(ctk_gpu->ctk_config,
- (GSourceFunc) update_pcie_info,
- (gpointer) ctk_gpu);
-}
diff --git a/src/gtk+-2.x/ctkgpu.h b/src/gtk+-2.x/ctkgpu.h
index db0b988..2a79339 100644
--- a/src/gtk+-2.x/ctkgpu.h
+++ b/src/gtk+-2.x/ctkgpu.h
@@ -58,8 +58,6 @@ struct _CtkGpu
NvCtrlAttributeHandle *handle;
CtkConfig *ctk_config;
- GtkWidget *bus_label;
- GtkWidget *link_speed_label;
GtkWidget *displays;
gint gpu_cores;
gint memory_interface;
@@ -85,9 +83,6 @@ void get_bus_id_str(NvCtrlAttributeHandle *handle,
GtkTextBuffer *ctk_gpu_create_help(GtkTextTagTable *,
CtkGpu *);
-void ctk_gpu_start_timer(GtkWidget *widget);
-void ctk_gpu_stop_timer(GtkWidget *widget);
-
G_END_DECLS
#endif /* __CTK_GPU_H__ */
diff --git a/src/gtk+-2.x/ctkgvi.c b/src/gtk+-2.x/ctkgvi.c
index 81e7561..49934ee 100644
--- a/src/gtk+-2.x/ctkgvi.c
+++ b/src/gtk+-2.x/ctkgvi.c
@@ -747,13 +747,21 @@ GtkTextBuffer *ctk_gvi_create_help(GtkTextTagTable *table,
ctk_help_para(b, &i, "This is the interrupt request line assigned to "
"this GVI device.");
+ ctk_help_heading(b, &i, "Bound GPU");
+ ctk_help_para(b, &i, "An OpenGL application can bind a GVI device to a "
+ "GPU using the GL_NV_video_capture OpenGL extension. The "
+ "Bound GPU field reports if an OpenGL application has "
+ "currently bound this GVI device to a GPU.");
+
ctk_help_heading(b, &i, "Input Information");
ctk_help_para(b, &i, "This section shows the detected video format(s) on "
"each jack of the GVI device. When condensed mode is "
"selected, the detected video format is shown for each "
- "jack (and channel). when detailed mode is selected, "
- "information pertaining to the single channel on a jack "
- "selected is given as such:");
+ "jack (and channel). When detailed mode is selected, "
+ "information pertaining to the selected jack is reported. "
+ "Note that the GVI device can only detect the following "
+ "information if the incoming signal has a non-zero SMPTE "
+ "352 payload identifier, which not all SDI devices provide.");
ctk_help_para(b, &i, "Video Format: The detected SMPTE video format.");
ctk_help_para(b, &i, "Component Sampling: The detected composition of the "
diff --git a/src/gtk+-2.x/ctkpowermizer.c b/src/gtk+-2.x/ctkpowermizer.c
index 03ea532..23c3bac 100644
--- a/src/gtk+-2.x/ctkpowermizer.c
+++ b/src/gtk+-2.x/ctkpowermizer.c
@@ -50,18 +50,15 @@ static const char *__power_source_help =
"The Power Source indicates whether the machine "
"is running on AC or Battery power.";
-static const char *__performance_level_help =
-"This indicates the current Performance Level of the GPU.";
+static const char *__current_pcie_link_width_help =
+"This is the current PCIe link width of the GPU, in number of lanes.";
-static const char *__performance_mode_short_help =
-"This indicates the current Performance Mode of the GPU.";
+static const char *__current_pcie_link_speed_help =
+"This is the current PCIe link speed of the GPU, "
+"in gigatransfers per second (GT/s).";
-static const char *__performance_mode_help =
-"This reports the current Performance Mode of the GPU. This indicates "
-"the driver's current power strategy. Possible Performance "
-"Mode values are \"Desktop\" (the GPU is being used for desktop-oriented "
-"purposes) and \"Maximum Performance\" (typically, an OpenGL, VDPAU, or "
-"CUDA application is running).";
+static const char *__performance_level_help =
+"This indicates the current Performance Level of the GPU.";
static const char *__gpu_clock_freq_help =
"This indicates the current Graphics Clock frequency.";
@@ -281,7 +278,7 @@ static void update_perf_mode_table(CtkPowermizer *ctk_powermizer,
static gboolean update_powermizer_info(gpointer user_data)
{
- gint power_source, perf_mode, adaptive_clock, perf_level;
+ gint power_source, adaptive_clock, perf_level;
gint clockret, gpu_clock, memory_clock, processor_clock;
CtkPowermizer *ctk_powermizer;
@@ -357,6 +354,20 @@ static gboolean update_powermizer_info(gpointer user_data)
gtk_label_set_text(GTK_LABEL(ctk_powermizer->power_source), s);
g_free(s);
+ if (ctk_powermizer->pcie_gen_queriable) {
+ /* NV_CTRL_GPU_PCIE_CURRENT_LINK_WIDTH */
+ s = get_pcie_link_width_string(handle,
+ NV_CTRL_GPU_PCIE_CURRENT_LINK_WIDTH);
+ gtk_label_set_text(GTK_LABEL(ctk_powermizer->link_width), s);
+ g_free(s);
+
+ /* NV_CTRL_GPU_PCIE_MAX_LINK_SPEED */
+ s = get_pcie_link_speed_string(handle,
+ NV_CTRL_GPU_PCIE_CURRENT_LINK_SPEED);
+ gtk_label_set_text(GTK_LABEL(ctk_powermizer->link_speed), s);
+ g_free(s);
+ }
+
ret = NvCtrlGetAttribute(handle, NV_CTRL_GPU_CURRENT_PERFORMANCE_LEVEL,
&perf_level);
if (ret != NvCtrlSuccess) {
@@ -367,25 +378,6 @@ static gboolean update_powermizer_info(gpointer user_data)
gtk_label_set_text(GTK_LABEL(ctk_powermizer->performance_level), s);
g_free(s);
- ret = NvCtrlGetAttribute(handle, NV_CTRL_GPU_CURRENT_PERFORMANCE_MODE,
- &perf_mode);
- if (ret != NvCtrlSuccess) {
- return FALSE;
- }
-
- if (perf_mode == NV_CTRL_GPU_CURRENT_PERFORMANCE_MODE_DESKTOP) {
- s = g_strdup_printf("Desktop");
- }
- else if (perf_mode == NV_CTRL_GPU_CURRENT_PERFORMANCE_MODE_MAXPERF) {
- s = g_strdup_printf("Maximum Performance");
- }
- else {
- s = g_strdup_printf("Default");
- }
-
- gtk_label_set_text(GTK_LABEL(ctk_powermizer->performance_mode), s);
- g_free(s);
-
/* update the perf table */
update_perf_mode_table(ctk_powermizer, perf_level);
@@ -401,10 +393,11 @@ GtkWidget* ctk_powermizer_new(NvCtrlAttributeHandle *handle,
CtkPowermizer *ctk_powermizer;
GtkWidget *hbox, *hbox2, *vbox, *vbox2, *hsep, *table;
GtkWidget *banner, *label, *menu, *menu_item;
- GtkWidget *eventbox;
ReturnStatus ret;
- gchar *s;
gint val;
+ gint row = 0;
+ gchar *s = NULL;
+ gint tmp;
gboolean processor_clock_available = FALSE;
/* make sure we have a handle */
@@ -424,13 +417,6 @@ GtkWidget* ctk_powermizer_new(NvCtrlAttributeHandle *handle,
return NULL;
}
- ret = NvCtrlGetAttribute(handle, NV_CTRL_GPU_CURRENT_PERFORMANCE_MODE,
- &val);
- if (ret != NvCtrlSuccess) {
- return NULL;
- }
-
-
ret = NvCtrlGetAttribute(handle, NV_CTRL_GPU_ADAPTIVE_CLOCK_STATE,
&val);
if (ret != NvCtrlSuccess) {
@@ -456,6 +442,14 @@ GtkWidget* ctk_powermizer_new(NvCtrlAttributeHandle *handle,
ctk_powermizer = CTK_POWERMIZER(object);
ctk_powermizer->attribute_handle = handle;
ctk_powermizer->ctk_config = ctk_config;
+ ctk_powermizer->pcie_gen_queriable = FALSE;
+
+ /* NV_CTRL_GPU_PCIE_GENERATION */
+
+ ret = NvCtrlGetAttribute(handle, NV_CTRL_GPU_PCIE_GENERATION, &tmp);
+ if (ret == NvCtrlSuccess) {
+ ctk_powermizer->pcie_gen_queriable = TRUE;
+ }
/* set container properties for the CtkPowermizer widget */
@@ -478,150 +472,131 @@ GtkWidget* ctk_powermizer_new(NvCtrlAttributeHandle *handle,
hsep = gtk_hseparator_new();
gtk_box_pack_start(GTK_BOX(hbox), hsep, TRUE, TRUE, 5);
- table = gtk_table_new(17, 2, FALSE);
+ table = gtk_table_new(21, 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);
+ gtk_container_set_border_width(GTK_CONTAINER(table), 10);
/* Adaptive Clocking State */
- hbox2 = gtk_hbox_new(FALSE, 0);
- gtk_table_attach(GTK_TABLE(table), hbox2, 0, 1, 0, 1,
- GTK_FILL, GTK_FILL | GTK_EXPAND, 5, 0);
-
- label = gtk_label_new("Adaptive Clocking:");
- 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, 0, 1,
- GTK_FILL, GTK_FILL | GTK_EXPAND, 5, 0);
-
- label = gtk_label_new(NULL);
- 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, __adaptive_clock_help);
- ctk_powermizer->adaptive_clock_status = label;
+ ctk_powermizer->adaptive_clock_status =
+ add_table_row_with_help_text(table, ctk_config,
+ __adaptive_clock_help,
+ row++, //row
+ 0, // column
+ 0.0f,
+ 0.5,
+ "Adaptive Clocking:",
+ 0.0,
+ 0.5,
+ NULL);
+
+ /* spacing */
+ row += 3;
/* Clock Frequencies */
- hbox2 = gtk_hbox_new(FALSE, 0);
- gtk_table_attach(GTK_TABLE(table), hbox2, 0, 1, 4, 5,
- GTK_FILL, GTK_FILL | GTK_EXPAND, 5, 0);
-
- label = gtk_label_new("Graphics Clock:");
- 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, 4, 5,
- GTK_FILL, GTK_FILL | GTK_EXPAND, 5, 0);
- label = gtk_label_new(NULL);
- gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
- gtk_container_add(GTK_CONTAINER(eventbox), label);
- ctk_config_set_tooltip(ctk_config, eventbox, __gpu_clock_freq_help);
- ctk_powermizer->gpu_clock = label;
-
- hbox2 = gtk_hbox_new(FALSE, 0);
- gtk_table_attach(GTK_TABLE(table), hbox2, 0, 1, 5, 6,
- GTK_FILL, GTK_FILL | GTK_EXPAND, 5, 0);
-
- label = gtk_label_new("Memory Clock:");
- 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, 5, 6,
- GTK_FILL, GTK_FILL | GTK_EXPAND, 5, 0);
-
- label = gtk_label_new(NULL);
- gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
- gtk_container_add(GTK_CONTAINER(eventbox), label);
- ctk_config_set_tooltip(ctk_config, eventbox, __memory_clock_freq_help);
- ctk_powermizer->memory_clock = label;
+ ctk_powermizer->gpu_clock =
+ add_table_row_with_help_text(table, ctk_config,
+ __gpu_clock_freq_help,
+ row++, //row
+ 0, // column
+ 0.0f,
+ 0.5,
+ "Graphics Clock:",
+ 0.0,
+ 0.5,
+ NULL);
+
+ ctk_powermizer->memory_clock =
+ add_table_row_with_help_text(table, ctk_config,
+ __memory_clock_freq_help,
+ row++, //row
+ 0, // column
+ 0.0f,
+ 0.5,
+ "Memory Clock:",
+ 0.0,
+ 0.5,
+ NULL);
/* Processor clock */
if (processor_clock_available) {
- hbox2 = gtk_hbox_new(FALSE, 0);
- gtk_table_attach(GTK_TABLE(table), hbox2, 0, 1, 6, 7,
- GTK_FILL, GTK_FILL | GTK_EXPAND, 5, 0);
-
- label = gtk_label_new("Processor Clock:");
- 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, 6, 7,
- GTK_FILL, GTK_FILL | GTK_EXPAND, 5, 0);
-
- label = gtk_label_new(NULL);
- gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
- gtk_container_add(GTK_CONTAINER(eventbox), label);
- ctk_config_set_tooltip(ctk_config, eventbox, __processor_clock_freq_help);
- ctk_powermizer->processor_clock = label;
+ ctk_powermizer->processor_clock =
+ add_table_row_with_help_text(table, ctk_config,
+ __processor_clock_freq_help,
+ row++, //row
+ 0, // column
+ 0.0f,
+ 0.5,
+ "Processor Clock:",
+ 0.0,
+ 0.5,
+ NULL);
}
- /* Power Source */
+ /* spacing */
+ row += 3;
- hbox2 = gtk_hbox_new(FALSE, 0);
- gtk_table_attach(GTK_TABLE(table), hbox2, 0, 1, 9, 10,
- GTK_FILL, GTK_FILL | GTK_EXPAND, 5, 0);
-
- label = gtk_label_new("Power Source:");
- 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, 9, 10,
- GTK_FILL, GTK_FILL | GTK_EXPAND, 5, 0);
-
- label = gtk_label_new(NULL);
- gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
- gtk_container_add(GTK_CONTAINER(eventbox), label);
- ctk_config_set_tooltip(ctk_config, eventbox, __power_source_help);
- ctk_powermizer->power_source = label;
+ /* Power Source */
+ ctk_powermizer->power_source =
+ add_table_row_with_help_text(table, ctk_config,
+ __power_source_help,
+ row++, //row
+ 0, // column
+ 0.0f,
+ 0.5,
+ "Power Source:",
+ 0.0,
+ 0.5,
+ NULL);
+ /* spacing */
+ row += 3;
+
+ /* Current PCIe Link Width */
+ if (ctk_powermizer->pcie_gen_queriable) {
+ ctk_powermizer->link_width =
+ add_table_row_with_help_text(table, ctk_config,
+ __current_pcie_link_width_help,
+ row++, //row
+ 0, // column
+ 0.0f,
+ 0.5,
+ "Current PCIe Link Width:",
+ 0.0,
+ 0.5,
+ NULL);
+
+ /* Current PCIe Link Speed */
+ ctk_powermizer->link_speed =
+ add_table_row_with_help_text(table, ctk_config,
+ __current_pcie_link_speed_help,
+ row++, //row
+ 0, // column
+ 0.0f,
+ 0.5,
+ "Current PCIe Link Speed:",
+ 0.0,
+ 0.5,
+ NULL);
+ /* spacing */
+ row += 3;
+ }
/* Performance Level */
-
- hbox2 = gtk_hbox_new(FALSE, 0);
- gtk_table_attach(GTK_TABLE(table), hbox2, 0, 1, 14, 15,
- GTK_FILL, GTK_FILL | GTK_EXPAND, 5, 0);
-
- label = gtk_label_new("Performance Level:");
- 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, 14, 15,
- GTK_FILL, GTK_FILL | GTK_EXPAND, 5, 0);
-
- label = gtk_label_new(NULL);
- gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
- gtk_container_add(GTK_CONTAINER(eventbox), label);
- ctk_config_set_tooltip(ctk_config, eventbox, __performance_level_help);
- ctk_powermizer->performance_level = label;
-
- /* Performance Mode */
-
- hbox2 = gtk_hbox_new(FALSE, 0);
- gtk_table_attach(GTK_TABLE(table), hbox2, 0, 1, 15, 16,
- GTK_FILL, GTK_FILL | GTK_EXPAND, 5, 0);
-
- label = gtk_label_new("Performance Mode:");
- 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, 15, 16,
- GTK_FILL, GTK_FILL | GTK_EXPAND, 5, 0);
-
- label = gtk_label_new(NULL);
- gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
- gtk_container_add(GTK_CONTAINER(eventbox), label);
- ctk_config_set_tooltip(ctk_config, eventbox,
- __performance_mode_short_help);
- ctk_powermizer->performance_mode = label;
+ ctk_powermizer->performance_level =
+ add_table_row_with_help_text(table, ctk_config,
+ __performance_level_help,
+ row++, //row
+ 0, // column
+ 0.0f,
+ 0.5,
+ "Performance Level:",
+ 0.0,
+ 0.5,
+ NULL);
+ gtk_table_resize(GTK_TABLE(table), row, 2);
/* Available Performance Level Title */
@@ -687,6 +662,7 @@ GtkWidget* ctk_powermizer_new(NvCtrlAttributeHandle *handle,
ctk_powermizer->powermizer_menu = gtk_option_menu_new();
gtk_option_menu_set_menu(GTK_OPTION_MENU(ctk_powermizer->powermizer_menu),
menu);
+ update_powermizer_menu_info(ctk_powermizer);
g_signal_connect(G_OBJECT(ctk_powermizer->powermizer_menu), "changed",
G_CALLBACK(powermizer_menu_changed),
@@ -723,7 +699,6 @@ GtkWidget* ctk_powermizer_new(NvCtrlAttributeHandle *handle,
update_powermizer_info(ctk_powermizer);
gtk_widget_show_all(GTK_WIDGET(ctk_powermizer));
- update_powermizer_menu_info(ctk_powermizer);
g_signal_connect(G_OBJECT(ctk_event),
CTK_EVENT_NAME(NV_CTRL_GPU_POWER_MIZER_MODE),
G_CALLBACK(update_powermizer_menu_event),
@@ -841,13 +816,16 @@ GtkTextBuffer *ctk_powermizer_create_help(GtkTextTagTable *table,
ctk_help_heading(b, &i, "Power Source");
ctk_help_para(b, &i, __power_source_help);
+ if (ctk_powermizer->pcie_gen_queriable) {
+ ctk_help_heading(b, &i, "Current PCIe link width");
+ ctk_help_para(b, &i, __current_pcie_link_width_help);
+ ctk_help_heading(b, &i, "Current PCIe link speed");
+ ctk_help_para(b, &i, __current_pcie_link_speed_help);
+ }
+
ctk_help_heading(b, &i, "Performance Level");
ctk_help_para(b, &i, __performance_level_help);
- ctk_help_heading(b, &i, "Performance Mode");
- ctk_help_para(b, &i, __performance_mode_help);
- ctk_help_finish(b);
-
ctk_help_heading(b, &i, "Performance Levels (Table)");
ctk_help_para(b, &i, __performance_levels_table_help);
diff --git a/src/gtk+-2.x/ctkpowermizer.h b/src/gtk+-2.x/ctkpowermizer.h
index aa012f7..09fd2ca 100644
--- a/src/gtk+-2.x/ctkpowermizer.h
+++ b/src/gtk+-2.x/ctkpowermizer.h
@@ -60,10 +60,13 @@ struct _CtkPowermizer
GtkWidget *processor_clock;
GtkWidget *power_source;
GtkWidget *performance_level;
- GtkWidget *performance_mode;
GtkWidget *performance_table_hbox;
GtkWidget *powermizer_menu;
GtkWidget *box_powermizer_menu;
+
+ GtkWidget *link_width;
+ GtkWidget *link_speed;
+ gboolean pcie_gen_queriable;
};
struct _CtkPowermizerClass
diff --git a/src/gtk+-2.x/ctkutils.c b/src/gtk+-2.x/ctkutils.c
index 6aa3375..eb428c1 100644
--- a/src/gtk+-2.x/ctkutils.c
+++ b/src/gtk+-2.x/ctkutils.c
@@ -24,6 +24,55 @@
+gchar *get_pcie_generation_string(NvCtrlAttributeHandle *handle)
+{
+ ReturnStatus ret;
+ gchar *s = NULL;
+ int tmp;
+
+ ret = NvCtrlGetAttribute(handle, NV_CTRL_GPU_PCIE_GENERATION, &tmp);
+ if (ret == NvCtrlSuccess) {
+ s = g_strdup_printf("Gen%u", tmp);
+ }
+ return s;
+}
+
+gchar *get_pcie_link_width_string(NvCtrlAttributeHandle *handle,
+ int attribute)
+{
+ ReturnStatus ret;
+ gint tmp;
+ gchar *s = NULL;
+
+ ret = NvCtrlGetAttribute(handle, attribute, &tmp);
+ if (ret != NvCtrlSuccess) {
+ s = g_strdup_printf("Unknown");
+ } else {
+ s = g_strdup_printf("x%d", tmp);
+ }
+
+ return s;
+}
+
+gchar *get_pcie_link_speed_string(NvCtrlAttributeHandle *handle,
+ int attribute)
+{
+ ReturnStatus ret;
+ gint tmp;
+ gchar *s = NULL;
+
+ ret = NvCtrlGetAttribute(handle, attribute, &tmp);
+ if (ret != NvCtrlSuccess) {
+ s = g_strdup_printf("Unknown");
+ } else {
+ s = g_strdup_printf("%.1f GT/s", tmp/1000.0);
+ }
+
+ return s;
+}
+
+
+
/*
* Used to check if current display enabled or disabled.
*/
diff --git a/src/gtk+-2.x/ctkutils.h b/src/gtk+-2.x/ctkutils.h
index cf1e3b0..446bcb8 100644
--- a/src/gtk+-2.x/ctkutils.h
+++ b/src/gtk+-2.x/ctkutils.h
@@ -27,6 +27,14 @@
G_BEGIN_DECLS
+gchar *get_pcie_generation_string(NvCtrlAttributeHandle *handle);
+
+gchar *get_pcie_link_width_string(NvCtrlAttributeHandle *handle,
+ gint attribute);
+
+gchar *get_pcie_link_speed_string(NvCtrlAttributeHandle *handle,
+ gint attribute);
+
gchar* create_gpu_name_string(NvCtrlAttributeHandle *gpu_handle);
diff --git a/src/gtk+-2.x/ctkwindow.c b/src/gtk+-2.x/ctkwindow.c
index bbed290..fcecaec 100644
--- a/src/gtk+-2.x/ctkwindow.c
+++ b/src/gtk+-2.x/ctkwindow.c
@@ -797,12 +797,6 @@ GtkWidget *ctk_window_new(ParsedAttribute *p, ConfigProperties *conf,
gtk_tree_store_set(ctk_window->tree_store, &iter,
CTK_WINDOW_CONFIG_FILE_ATTRIBUTES_FUNC_COLUMN,
NULL, -1);
- gtk_tree_store_set(ctk_window->tree_store, &iter,
- CTK_WINDOW_SELECT_WIDGET_FUNC_COLUMN,
- ctk_gpu_start_timer, -1);
- gtk_tree_store_set(ctk_window->tree_store, &iter,
- CTK_WINDOW_UNSELECT_WIDGET_FUNC_COLUMN,
- ctk_gpu_stop_timer, -1);
/* power savings */
diff --git a/src/libXNVCtrl/NVCtrl.h b/src/libXNVCtrl/NVCtrl.h
index f712ec4..95d7024 100644
--- a/src/libXNVCtrl/NVCtrl.h
+++ b/src/libXNVCtrl/NVCtrl.h
@@ -1615,7 +1615,7 @@
/*
* NV_CTRL_BUS_RATE - if the bus type of the specified device is AGP, then
* NV_CTRL_BUS_RATE returns the configured AGP transfer rate. If the bus type
- * is PCI Express, then this attribute returns the width of the physical link.
+ * is PCI Express, then this attribute returns the maximum link width.
* When this attribute is queried on an X screen target, the bus rate of the
* GPU driving the X screen is returned.
*/
@@ -1623,6 +1623,12 @@
#define NV_CTRL_BUS_RATE 224 /* R--GI */
/*
+ * NV_CTRL_GPU_PCIE_MAX_LINK_WIDTH - returns the maximum
+ * PCIe link width, in number of lanes.
+ */
+#define NV_CTRL_GPU_PCIE_MAX_LINK_WIDTH NV_CTRL_BUS_RATE
+
+/*
* NV_CTRL_SHOW_SLI_HUD - when TRUE, OpenGL will draw information about the
* current SLI mode.
* Renamed this attribute to NV_CTRL_SHOW_SLI_VISUAL_INDICATOR
@@ -2129,10 +2135,7 @@
/*
- * NV_CTRL_GPU_CURRENT_PERFORMANCE_MODE 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.
+ * NV_CTRL_GPU_CURRENT_PERFORMANCE_MODE is deprecated
*/
#define NV_CTRL_GPU_CURRENT_PERFORMANCE_MODE 263 /* R--G */
@@ -2835,11 +2838,12 @@
#define NV_CTRL_OVERSCAN_COMPENSATION 339 /* RWDG */
/*
- * NV_CTRL_GPU_PCIE_GENERATION - Reports the current PCI-E generation.
+ * NV_CTRL_GPU_PCIE_GENERATION - Reports the current PCIe 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_GPU_PCIE_GENERATION3 0x00000003
/*
* NV_CTRL_GVI_BOUND_GPU - Returns the NV_CTRL_TARGET_TYPE_GPU target_id of
@@ -3046,7 +3050,8 @@
#define NV_CTRL_GVIO_VIDEO_FORMAT_FLAGS_3G_1080P_NO_12BPC 0x00000020
/*
- * NV_CTRL_GPU_PCIE_MAX_LINK_SPEED - returns maximum PCI-E link speed.
+ * NV_CTRL_GPU_PCIE_MAX_LINK_SPEED - returns maximum PCIe link speed,
+ * in gigatransfers per second (GT/s).
*/
#define NV_CTRL_GPU_PCIE_MAX_LINK_SPEED 361 /* R--GI */
@@ -3225,7 +3230,19 @@
*/
#define NV_CTRL_3D_VISION_PRO_GLASSES_UNPAIR_EVENT 383 /* ---T */
-#define NV_CTRL_LAST_ATTRIBUTE NV_CTRL_3D_VISION_PRO_GLASSES_UNPAIR_EVENT
+/*
+ * NV_CTRL_GPU_PCIE_CURRENT_LINK_WIDTH - returns the current
+ * PCIe link width, in number of lanes.
+ */
+#define NV_CTRL_GPU_PCIE_CURRENT_LINK_WIDTH 384 /* R--GI */
+
+/*
+ * NV_CTRL_GPU_PCIE_CURRENT_LINK_SPEED - returns the current
+ * PCIe link speed, in megatransfers per second (GT/s).
+ */
+#define NV_CTRL_GPU_PCIE_CURRENT_LINK_SPEED 385 /* R--GI */
+
+#define NV_CTRL_LAST_ATTRIBUTE NV_CTRL_GPU_PCIE_CURRENT_LINK_SPEED
/**************************************************************************/
diff --git a/src/parse.c b/src/parse.c
index 0ba0194..ff1acad 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -116,6 +116,7 @@ AttributeTableEntry attributeTable[] = {
{ "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." },
{ "ForceGenericCpu", NV_CTRL_FORCE_GENERIC_CPU, N, "Inhibit the use of CPU-specific features such as MMX, SSE, or 3DNOW! for OpenGL clients; this option may result in performance loss, but may be useful in conjunction with software such as the Valgrind memory debugger. This setting only takes effect on OpenGL clients started after it is set." },
{ "GammaCorrectedAALines", NV_CTRL_OPENGL_AA_LINE_GAMMA, 0, "For OpenGL clients, allow gamma-corrected antialiased lines to consider variances in the color display capabilities of output devices when rendering smooth lines. Only available on recent Quadro GPUs. This setting only takes effect on OpenGL clients started after it is set." },
+ { "TextureClamping", NV_CTRL_TEXTURE_CLAMPING, 0, "Define the behavior of OpenGL texture clamping for unbordered textures. If enabled (1), the conformant behavior is used. If disabled (0), GL_CLAMP is remapped to GL_CLAMP_TO_EDGE to avoid seams in applications that rely on this behavior, which was the only option in some very old hardware." },
{ "AllowFlipping", NV_CTRL_FLIPPING_ALLOWED, 0, "Defines the swap behavior of OpenGL. When 1, OpenGL will swap by flipping when possible; When 0, OpenGL will always swap by blitting." },
{ "FSAAAppControlled", NV_CTRL_FSAA_APPLICATION_CONTROLLED, 0, "When Application Control for FSAA is enabled, then what the application requests is used, and the FSAA attribute is ignored. If this is disabled, then any application setting is overridden with the FSAA attribute." },
@@ -133,10 +134,13 @@ AttributeTableEntry attributeTable[] = {
{ "SliMosaicModeAvailable", NV_CTRL_SLI_MOSAIC_MODE_AVAILABLE, N, "Returns whether or not SLI Mosaic Mode is supported." },
/* GPU */
- { "BusType", NV_CTRL_BUS_TYPE, 0, "Returns the type of bus connecting the specified device to the computer. If the target is an X screen, then it uses the GPU driving the X screen as the device." },
- { "PCIEMaxLinkSpeed", NV_CTRL_GPU_PCIE_MAX_LINK_SPEED, 0, "Returns the maximum PCI-E link speed" },
- { "VideoRam", NV_CTRL_VIDEO_RAM, 0, "Returns the total amount of memory available to the specified GPU (or the GPU driving the specified X screen). Note: if the GPU supports TurboCache(TM), the value reported may exceed the amount of video memory installed on the GPU. The value reported for integrated GPUs may likewise exceed the amount of dedicated system memory set aside by the system BIOS for use by the integrated GPU." },
- { "Irq", NV_CTRL_IRQ, 0, "Returns the interrupt request line used by the specified device. If the target is an X screen, then it uses the GPU driving the X screen as the device." },
+ { "BusType", NV_CTRL_BUS_TYPE, N, "Returns the type of bus connecting the specified device to the computer. If the target is an X screen, then it uses the GPU driving the X screen as the device." },
+ { "PCIEMaxLinkSpeed", NV_CTRL_GPU_PCIE_MAX_LINK_SPEED, N, "Returns the maximum speed that the PCIe link between the GPU and the system may be trained to. This is expressed in gigatransfers per second (GT/s). The link may be dynamically trained to a slower speed, based on the GPU's utilization and performance settings." },
+ { "PCIEMaxLinkWidth", NV_CTRL_GPU_PCIE_MAX_LINK_WIDTH, N, "Returns the maximum width that the PCIe link between the GPU and the system may be trained to. This is expressed in number of lanes. The trained link width may vary dynamically and possibly be narrower based on the GPU's utilization and performance settings." },
+ { "PCIECurrentLinkSpeed", NV_CTRL_GPU_PCIE_CURRENT_LINK_SPEED, N, "Returns the current PCIe link speed, in gigatransfers per second (GT/s)." },
+ { "PCIECurrentLinkWidth", NV_CTRL_GPU_PCIE_CURRENT_LINK_WIDTH, N, "Returns the current PCIe link width of the GPU, in number of lanes." },
+ { "VideoRam", NV_CTRL_VIDEO_RAM, N, "Returns the total amount of memory available to the specified GPU (or the GPU driving the specified X screen). Note: if the GPU supports TurboCache(TM), the value reported may exceed the amount of video memory installed on the GPU. The value reported for integrated GPUs may likewise exceed the amount of dedicated system memory set aside by the system BIOS for use by the integrated GPU." },
+ { "Irq", NV_CTRL_IRQ, N, "Returns the interrupt request line used by the specified device. If the target is an X screen, then it uses the GPU driving the X screen as the device." },
{ "CUDACores", NV_CTRL_GPU_CORES, N, "Returns number of CUDA cores supported by the graphics pipeline." },
{ "GPUMemoryInterface", NV_CTRL_GPU_MEMORY_BUS_WIDTH, N, "Returns bus bandwidth of the GPU's memory interface." },
{ "GPUCoreTemp", NV_CTRL_GPU_CORE_TEMPERATURE, N, "Reports the current core temperature in Celsius of the GPU driving the X screen." },
@@ -149,13 +153,13 @@ AttributeTableEntry attributeTable[] = {
{ "GPUCurrentClockFreqs", NV_CTRL_GPU_CURRENT_CLOCK_FREQS, N|P, "Returns the current GPU and memory clocks of the graphics device driving the X screen." },
{ "GPUCurrentProcessorClockFreqs", NV_CTRL_GPU_CURRENT_PROCESSOR_CLOCK_FREQS, N, "Returns the current processor clock of the graphics device driving the X screen." },
{ "GPUCurrentClockFreqsString", NV_CTRL_STRING_GPU_CURRENT_CLOCK_FREQS, S|N, "Returns the current GPU, memory and Processor clocks of the graphics device driving the X screen." },
- { "BusRate", NV_CTRL_BUS_RATE, 0, "If the device is on an AGP bus, then BusRate returns the configured AGP rate. If the device is on a PCI Express bus, then this attribute returns the width of the physical link." },
+ { "BusRate", NV_CTRL_BUS_RATE, N, "If the device is on an AGP bus, then BusRate returns the configured AGP rate. If the device is on a PCI Express bus, then this attribute returns the width of the physical link." },
{ "PCIDomain", NV_CTRL_PCI_DOMAIN, N, "Returns the PCI domain number for the specified device." },
{ "PCIBus", NV_CTRL_PCI_BUS, N, "Returns the PCI bus number for the specified device." },
{ "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." },
+ { "PCIEGen", NV_CTRL_GPU_PCIE_GENERATION, N, "Returns the PCIe generation that this GPU, in this system, is compliant with." },
{ "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." },
@@ -369,7 +373,7 @@ AttributeTableEntry attributeTable[] = {
* about.
*/
-#if NV_CTRL_LAST_ATTRIBUTE != NV_CTRL_3D_VISION_PRO_GLASSES_UNPAIR_EVENT
+#if NV_CTRL_LAST_ATTRIBUTE != NV_CTRL_GPU_PCIE_CURRENT_LINK_SPEED
#warning "Have you forgotten to add a new integer attribute to attributeTable?"
#endif
diff --git a/version.mk b/version.mk
index 9ec78f9..9cf35b0 100644
--- a/version.mk
+++ b/version.mk
@@ -1 +1 @@
-NVIDIA_VERSION = 290.10
+NVIDIA_VERSION = 295.09