summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Plattner <aplattner@nvidia.com>2012-07-30 14:42:46 -0700
committerAaron Plattner <aplattner@nvidia.com>2012-07-30 14:42:46 -0700
commitbd38db76c50dd0f038070b4d1e086fc75682d3e6 (patch)
treef7b5c85f01918b8377b625f28504197f93971e2b
parentbcf86318652976de8afadabc4d02d7976b24f6b5 (diff)
304.30304.30
-rw-r--r--doc/version.mk2
-rw-r--r--samples/version.mk2
-rw-r--r--src/gtk+-2.x/ctkdisplaydevice.c544
-rw-r--r--src/gtk+-2.x/ctkdisplaydevice.h18
-rw-r--r--src/gtk+-2.x/ctkdisplaylayout.c18
-rw-r--r--src/gtk+-2.x/ctkevent.c3
-rw-r--r--src/gtk+-2.x/ctkgpu.c1
-rw-r--r--src/gtk+-2.x/ctkgpu.h1
-rw-r--r--src/gtk+-2.x/ctkmultisample.c97
-rw-r--r--src/gtk+-2.x/ctkmultisample.h1
-rw-r--r--src/gtk+-2.x/ctkwindow.c16
-rw-r--r--src/libXNVCtrl/NVCtrl.h11
-rw-r--r--src/parse.c3
-rw-r--r--src/version.mk2
-rw-r--r--version.mk2
15 files changed, 470 insertions, 251 deletions
diff --git a/doc/version.mk b/doc/version.mk
index 11c1292..ef64379 100644
--- a/doc/version.mk
+++ b/doc/version.mk
@@ -1 +1 @@
-NVIDIA_VERSION = 304.22
+NVIDIA_VERSION = 304.30
diff --git a/samples/version.mk b/samples/version.mk
index 11c1292..ef64379 100644
--- a/samples/version.mk
+++ b/samples/version.mk
@@ -1 +1 @@
-NVIDIA_VERSION = 304.22
+NVIDIA_VERSION = 304.30
diff --git a/src/gtk+-2.x/ctkdisplaydevice.c b/src/gtk+-2.x/ctkdisplaydevice.c
index 2919514..fab08ef 100644
--- a/src/gtk+-2.x/ctkdisplaydevice.c
+++ b/src/gtk+-2.x/ctkdisplaydevice.c
@@ -20,6 +20,10 @@
#include <gtk/gtk.h>
#include <NvCtrlAttributes.h>
#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "common-utils.h"
#include "ctkbanner.h"
@@ -32,7 +36,6 @@
#include "ctkconfig.h"
#include "ctkhelp.h"
#include "ctkutils.h"
-#include <stdio.h>
static void ctk_display_device_class_init(CtkDisplayDeviceClass *);
static void ctk_display_device_finalize(GObject *);
@@ -43,14 +46,23 @@ static void update_device_info(CtkDisplayDevice *ctk_object);
static void display_device_setup(CtkDisplayDevice *ctk_object);
+static void enabled_displays_received(GtkObject *object, gpointer arg1,
+ gpointer user_data);
+
static void callback_link_changed(GtkObject *object, gpointer arg1,
gpointer user_data);
-static void enabled_displays_received(GtkObject *object, gpointer arg1,
- gpointer user_data);
+static void callback_refresh_rate_changed(GtkObject *object, gpointer arg1,
+ gpointer user_data);
-static void info_update_received(GtkObject *object, gpointer arg1,
- gpointer user_data);
+static void update_chip_info(InfoEntry *entry);
+static void update_signal_info(InfoEntry *entry);
+static void update_link_info(InfoEntry *entry);
+static void update_native_resolution(InfoEntry *entry);
+static void update_refresh_rate(InfoEntry *entry);
+
+static void register_link_events(InfoEntry *entry);
+static void register_refresh_rate_events(InfoEntry *entry);
#define FRAME_PADDING 5
@@ -82,6 +94,49 @@ static const char * __refresh_rate_help =
"The refresh rate displays the rate at which the screen is currently "
"refreshing the image.";
+typedef void (*InfoEntryFunc)(InfoEntry *entry);
+
+typedef struct {
+ const char *str;
+ const gchar **tooltip;
+ InfoEntryFunc update_func;
+ InfoEntryFunc register_events_func;
+
+} InfoEntryData;
+
+static InfoEntryData __info_entry_data[] = {
+ {
+ "Chip Location",
+ &__info_chip_location_help,
+ update_chip_info,
+ NULL,
+ },
+ {
+ "Signal",
+ &__info_signal_help,
+ update_signal_info,
+ NULL,
+ },
+ {
+ "Connection link",
+ &__info_link_help,
+ update_link_info,
+ register_link_events,
+ },
+ {
+ "Native Resolution",
+ &__native_res_help,
+ update_native_resolution,
+ NULL,
+ },
+ {
+ "Refresh Rate",
+ &__refresh_rate_help,
+ update_refresh_rate,
+ register_refresh_rate_events,
+ },
+};
+
GType ctk_display_device_get_type(void)
{
static GType ctk_object_type = 0;
@@ -139,6 +194,7 @@ static void ctk_display_device_finalize(
GtkWidget* ctk_display_device_new(NvCtrlAttributeHandle *handle,
CtkConfig *ctk_config,
CtkEvent *ctk_event,
+ CtkEvent *ctk_event_gpu,
char *name,
char *typeBaseName)
{
@@ -155,6 +211,7 @@ GtkWidget* ctk_display_device_new(NvCtrlAttributeHandle *handle,
GtkWidget *hseparator;
GtkWidget *button;
gchar *str;
+ int i;
object = g_object_new(CTK_TYPE_DISPLAY_DEVICE, NULL);
if (!object) return NULL;
@@ -225,103 +282,49 @@ GtkWidget* ctk_display_device_new(NvCtrlAttributeHandle *handle,
* widgets don't expand to fill all of the space within the
* frame
*/
-
+
tmpbox = gtk_vbox_new(FALSE, FRAME_PADDING);
gtk_container_set_border_width(GTK_CONTAINER(tmpbox), FRAME_PADDING);
gtk_container_add(GTK_CONTAINER(hbox), tmpbox);
- /* Make the txt widgets that will get updated */
- ctk_object->txt_chip_location = gtk_label_new("");
- ctk_object->txt_link = gtk_label_new("");
- ctk_object->txt_signal = gtk_label_new("");
- ctk_object->txt_native_resolution = gtk_label_new("");
- ctk_object->txt_refresh_rate = gtk_label_new("");
+ /* Create and add the information widgets */
- /* Add information widget lines */
- {
- typedef struct {
- GtkWidget *label;
- GtkWidget *txt;
- const gchar *tooltip;
- } TextLineInfo;
-
- TextLineInfo lines[] = {
- {
- gtk_label_new("Chip location:"),
- ctk_object->txt_chip_location,
- __info_chip_location_help
- },
- {
- gtk_label_new("Connection link:"),
- ctk_object->txt_link,
- __info_link_help
- },
- {
- gtk_label_new("Signal:"),
- ctk_object->txt_signal,
- __info_signal_help
- },
- {
- gtk_label_new("Native Resolution:"),
- ctk_object->txt_native_resolution,
- __native_res_help,
- },
- {
- gtk_label_new("Refresh Rate:"),
- ctk_object->txt_refresh_rate,
- __refresh_rate_help,
- },
- { NULL, NULL, NULL }
- };
- int i;
+ ctk_object->num_info_entries = ARRAY_LEN(__info_entry_data);
+ ctk_object->info_entries = calloc(ctk_object->num_info_entries,
+ sizeof(InfoEntry));
+ if (!ctk_object->info_entries) {
+ ctk_object->num_info_entries = 0;
+ }
- GtkRequisition req;
- int max_width;
+ for (i = 0; i < ctk_object->num_info_entries; i++) {
+ InfoEntryData *entryData = __info_entry_data+i;
+ InfoEntry *entry = ctk_object->info_entries+i;
+ gchar *str;
- /* Compute max width of lables and setup text alignments */
- max_width = 0;
- for (i = 0; lines[i].label; i++) {
- gtk_misc_set_alignment(GTK_MISC(lines[i].label), 0.0f, 0.5f);
- gtk_misc_set_alignment(GTK_MISC(lines[i].txt), 0.0f, 0.5f);
+ entry->ctk_object = ctk_object;
+ str = g_strconcat(entryData->str, ":", NULL);
+ entry->label = gtk_label_new(str);
+ g_free(str);
- gtk_widget_size_request(lines[i].label, &req);
- if (max_width < req.width) {
- max_width = req.width;
- }
- }
+ entry->txt = gtk_label_new("");
- /* Pack labels */
- for (i = 0; lines[i].label; i++) {
- GtkWidget *tmphbox;
+ gtk_misc_set_alignment(GTK_MISC(entry->label), 0.0f, 0.5f);
+ gtk_misc_set_alignment(GTK_MISC(entry->txt), 0.0f, 0.5f);
- /* Add separators */
- if (i == 3 || i == 5 || i == 7) {
- GtkWidget *separator = gtk_hseparator_new();
- gtk_box_pack_start(GTK_BOX(tmpbox), separator,
- FALSE, FALSE, 0);
- }
+ ctk_config_set_tooltip(ctk_config,
+ entry->label,
+ *(entryData->tooltip));
+ ctk_config_set_tooltip(ctk_config,
+ entry->txt,
+ *(entryData->tooltip));
- /* Set the label's width */
- gtk_widget_set_size_request(lines[i].label, max_width, -1);
-
- /* add the widgets for this line */
- tmphbox = gtk_hbox_new(FALSE, FRAME_PADDING);
- gtk_box_pack_start(GTK_BOX(tmphbox), lines[i].label,
- FALSE, TRUE, FRAME_PADDING);
- gtk_box_pack_start(GTK_BOX(tmphbox), lines[i].txt,
- FALSE, TRUE, FRAME_PADDING);
-
- /* Include tooltips */
- if (lines[i].tooltip) {
- ctk_config_set_tooltip(ctk_config,
- lines[i].label,
- lines[i].tooltip);
- ctk_config_set_tooltip(ctk_config,
- lines[i].txt,
- lines[i].tooltip);
- }
- gtk_box_pack_start(GTK_BOX(tmpbox), tmphbox, FALSE, FALSE, 0);
- }
+ entry->hbox = gtk_hbox_new(FALSE, FRAME_PADDING);
+ gtk_box_pack_start(GTK_BOX(entry->hbox), entry->label,
+ FALSE, TRUE, FRAME_PADDING);
+ gtk_box_pack_start(GTK_BOX(entry->hbox), entry->txt,
+ FALSE, TRUE, FRAME_PADDING);
+
+ gtk_box_pack_start(GTK_BOX(tmpbox), entry->hbox, FALSE, FALSE, 0);
}
/* pack the EDID button */
@@ -397,27 +400,19 @@ GtkWidget* ctk_display_device_new(NvCtrlAttributeHandle *handle,
"clicked", G_CALLBACK(reset_button_clicked),
(gpointer) ctk_object);
- if (ctk_object->txt_link) {
- g_signal_connect(G_OBJECT(ctk_event),
- CTK_EVENT_NAME(NV_CTRL_FLATPANEL_LINK),
- G_CALLBACK(callback_link_changed),
- (gpointer) ctk_object);
-
- g_signal_connect(G_OBJECT(ctk_event),
- CTK_EVENT_NAME(NV_CTRL_DISPLAYPORT_LINK_RATE),
- G_CALLBACK(callback_link_changed),
- (gpointer) ctk_object);
- }
-
- g_signal_connect(G_OBJECT(ctk_event),
+ g_signal_connect(G_OBJECT(ctk_event_gpu),
CTK_EVENT_NAME(NV_CTRL_ENABLED_DISPLAYS),
G_CALLBACK(enabled_displays_received),
(gpointer) ctk_object);
- g_signal_connect(G_OBJECT(ctk_event),
- CTK_EVENT_NAME(NV_CTRL_REFRESH_RATE),
- G_CALLBACK(info_update_received),
- (gpointer) ctk_object);
+ for (i = 0; i < ctk_object->num_info_entries; i++) {
+ InfoEntryData *entryData = __info_entry_data+i;
+ InfoEntry *entry = ctk_object->info_entries+i;
+
+ if (entryData->register_events_func) {
+ entryData->register_events_func(entry);
+ }
+ }
return GTK_WIDGET(object);
@@ -463,6 +458,7 @@ GtkTextBuffer *ctk_display_device_create_help(GtkTextTagTable *table,
GtkTextIter i;
GtkTextBuffer *b;
GtkTooltipsData *td;
+ int j;
b = gtk_text_buffer_new(table);
@@ -473,20 +469,12 @@ GtkTextBuffer *ctk_display_device_create_help(GtkTextTagTable *table,
ctk_help_heading(b, &i, "Device Information");
ctk_help_para(b, &i, __info_help);
- ctk_help_term(b, &i, "Chip Location");
- ctk_help_para(b, &i, __info_chip_location_help);
+ for (j = 0; j < ARRAY_LEN(__info_entry_data); j++) {
+ InfoEntryData *entryData = __info_entry_data+j;
- ctk_help_term(b, &i, "Link");
- ctk_help_para(b, &i, __info_link_help);
-
- ctk_help_term(b, &i, "Signal");
- ctk_help_para(b, &i, __info_signal_help);
-
- ctk_help_term(b, &i, "Native Resolution");
- ctk_help_para(b, &i, __native_res_help);
-
- ctk_help_term(b, &i, "Refresh Rate");
- ctk_help_para(b, &i, __refresh_rate_help);
+ ctk_help_term(b, &i, entryData->str);
+ ctk_help_para(b, &i, *entryData->tooltip);
+ }
add_acquire_edid_help(b, &i);
@@ -509,132 +497,215 @@ GtkTextBuffer *ctk_display_device_create_help(GtkTextTagTable *table,
} /* ctk_display_device_create_help() */
-static void update_link(CtkDisplayDevice *ctk_object)
+
+
+
+static void update_chip_info(InfoEntry *entry)
{
+ CtkDisplayDevice *ctk_object = entry->ctk_object;
ReturnStatus ret;
- gint val, signal_type = ctk_object->signal_type;
- const char *link = "Unknown";
- char tmp[32];
-
- ret = NvCtrlGetAttribute(ctk_object->handle, NV_CTRL_FLATPANEL_LINK, &val);
- if (ret == NvCtrlSuccess) {
- if (signal_type == NV_CTRL_FLATPANEL_SIGNAL_DISPLAYPORT) {
- int lanes;
+ gint val;
+ const gchar *str;
- lanes = val + 1;
+ ret = NvCtrlGetAttribute(ctk_object->handle,
+ NV_CTRL_FLATPANEL_CHIP_LOCATION, &val);
+ if (ret != NvCtrlSuccess) {
+ gtk_widget_hide(entry->hbox);
+ return;
+ }
- ret = NvCtrlGetAttribute(ctk_object->handle,
- NV_CTRL_DISPLAYPORT_LINK_RATE, &val);
- if ((ret == NvCtrlSuccess) &&
- (val == NV_CTRL_DISPLAYPORT_LINK_RATE_DISABLED)) {
- link = "Disabled";
- } else {
- if (ret != NvCtrlSuccess) {
- val = 0;
- }
-
- if (val > 0) {
- snprintf(tmp, 32, "%d lane%s @ %.2f Gbps", lanes, lanes == 1 ? "" : "s",
- val * 0.27);
- } else {
- snprintf(tmp, 32, "%d lane%s @ unknown bandwidth", lanes,
- lanes == 1 ? "" : "s");
- }
- link = tmp;
- }
- } else {
- // LVDS or TMDS
- switch(val) {
- case NV_CTRL_FLATPANEL_LINK_SINGLE:
- link = "Single";
- break;
- case NV_CTRL_FLATPANEL_LINK_DUAL:
- link = "Dual";
- break;
- }
- }
+ switch (val) {
+ case NV_CTRL_FLATPANEL_CHIP_LOCATION_INTERNAL:
+ str = "Internal";
+ break;
+ case NV_CTRL_FLATPANEL_CHIP_LOCATION_EXTERNAL:
+ str = "External";
+ break;
+ default:
+ str = "Unknown";
+ break;
}
- gtk_label_set_text(GTK_LABEL(ctk_object->txt_link), link);
+ gtk_label_set_text(GTK_LABEL(entry->txt), str);
+ gtk_widget_show(entry->hbox);
}
-/*
- * update_device_info() - (Re)Queries the static display device information.
- */
-static void update_device_info(CtkDisplayDevice *ctk_object)
+static void update_signal_info(InfoEntry *entry)
{
+ CtkDisplayDevice *ctk_object = entry->ctk_object;
ReturnStatus ret;
gint val;
- gchar *str;
+ const char *str;
- /* Chip location */
+ ret = NvCtrlGetAttribute(ctk_object->handle, NV_CTRL_FLATPANEL_SIGNAL,
+ &val);
+ if (ret != NvCtrlSuccess) {
+ gtk_widget_hide(entry->hbox);
+ return;
+ }
- str = "Unknown";
- ret = NvCtrlGetAttribute(ctk_object->handle,
- NV_CTRL_FLATPANEL_CHIP_LOCATION, &val);
- if (ret == NvCtrlSuccess) {
- switch (val) {
- case NV_CTRL_FLATPANEL_CHIP_LOCATION_INTERNAL:
- str = "Internal";
- break;
- case NV_CTRL_FLATPANEL_CHIP_LOCATION_EXTERNAL:
- str = "External";
- break;
- }
+ switch (val) {
+ case NV_CTRL_FLATPANEL_SIGNAL_LVDS:
+ str = "LVDS";
+ break;
+ case NV_CTRL_FLATPANEL_SIGNAL_TMDS:
+ str = "TMDS";
+ break;
+ case NV_CTRL_FLATPANEL_SIGNAL_DISPLAYPORT:
+ str = "DisplayPort";
+ break;
+ default:
+ str = "Unknown";
+ break;
}
- gtk_label_set_text(GTK_LABEL(ctk_object->txt_chip_location), str);
- /* Signal */
+ gtk_label_set_text(GTK_LABEL(entry->txt), str);
+ gtk_widget_show(entry->hbox);
- str = "Unknown";
- ret = NvCtrlGetAttribute(ctk_object->handle, NV_CTRL_FLATPANEL_SIGNAL,
- &val);
- if (ret == NvCtrlSuccess) {
- switch (val) {
- case NV_CTRL_FLATPANEL_SIGNAL_LVDS:
- str = "LVDS";
+ ctk_object->signal_type = val;
+}
+
+
+/* NOTE: Link information is dependent on signal type, and this function
+ * assumes the signal type is querried first.
+ */
+static void update_link_info(InfoEntry *entry)
+{
+ CtkDisplayDevice *ctk_object = entry->ctk_object;
+ ReturnStatus ret;
+ gint val;
+ const char *link;
+ char tmp[32];
+
+ ret = NvCtrlGetAttribute(ctk_object->handle, NV_CTRL_FLATPANEL_LINK, &val);
+ if (ret != NvCtrlSuccess) {
+ gtk_widget_hide(entry->hbox);
+ return;
+ }
+
+ if (ctk_object->signal_type == NV_CTRL_FLATPANEL_SIGNAL_DISPLAYPORT) {
+ int lanes;
+
+ lanes = val + 1;
+
+ ret = NvCtrlGetAttribute(ctk_object->handle,
+ NV_CTRL_DISPLAYPORT_LINK_RATE, &val);
+ if ((ret == NvCtrlSuccess) &&
+ (val == NV_CTRL_DISPLAYPORT_LINK_RATE_DISABLED)) {
+ link = "Disabled";
+ } else {
+ if (ret != NvCtrlSuccess) {
+ val = 0;
+ }
+
+ if (val > 0) {
+ snprintf(tmp, 32, "%d lane%s @ %.2f Gbps", lanes, lanes == 1 ? "" : "s",
+ val * 0.27);
+ } else {
+ snprintf(tmp, 32, "%d lane%s @ unknown bandwidth", lanes,
+ lanes == 1 ? "" : "s");
+ }
+ link = tmp;
+ }
+ } else {
+ // LVDS or TMDS
+ switch(val) {
+ case NV_CTRL_FLATPANEL_LINK_SINGLE:
+ link = "Single";
break;
- case NV_CTRL_FLATPANEL_SIGNAL_TMDS:
- str = "TMDS";
+ case NV_CTRL_FLATPANEL_LINK_DUAL:
+ link = "Dual";
break;
- case NV_CTRL_FLATPANEL_SIGNAL_DISPLAYPORT:
- str = "DisplayPort";
+ default:
+ link = "Unknown";
break;
}
}
- gtk_label_set_text(GTK_LABEL(ctk_object->txt_signal), str);
- ctk_object->signal_type = val;
- /* Link */
+ gtk_label_set_text(GTK_LABEL(entry->txt), link);
+ gtk_widget_show(entry->hbox);
+}
- update_link(ctk_object);
- /* Native Resolution */
+
+static void update_native_resolution(InfoEntry *entry)
+{
+ CtkDisplayDevice *ctk_object = entry->ctk_object;
+ ReturnStatus ret;
+ gint val;
+ char *str;
ret = NvCtrlGetAttribute(ctk_object->handle,
NV_CTRL_FLATPANEL_NATIVE_RESOLUTION, &val);
- if (ret == NvCtrlSuccess) {
- str = g_strdup_printf("%dx%d", (val >> 16), (val & 0xFFFF));
- gtk_label_set_text(GTK_LABEL(ctk_object->txt_native_resolution),
- str);
- g_free(str);
- } else {
- gtk_label_set_text(GTK_LABEL(ctk_object->txt_native_resolution),
- "Unknown");
+ if (ret != NvCtrlSuccess) {
+ gtk_widget_hide(entry->hbox);
+ return;
}
- /* Refresh Rate */
+ str = g_strdup_printf("%dx%d", (val >> 16), (val & 0xFFFF));
+ gtk_label_set_text(GTK_LABEL(entry->txt), str);
+ g_free(str);
+
+ gtk_widget_show(entry->hbox);
+}
+
+
+
+static void update_refresh_rate(InfoEntry *entry)
+{
+ CtkDisplayDevice *ctk_object = entry->ctk_object;
+ ReturnStatus ret;
+ gint val;
+ char *str;
+ float fvalue;
ret = NvCtrlGetAttribute(ctk_object->handle, NV_CTRL_REFRESH_RATE, &val);
- if (ret == NvCtrlSuccess) {
- float fvalue = ((float)(val)) / 100.0f;
- str = g_strdup_printf("%.2f Hz", fvalue);
- gtk_label_set_text(GTK_LABEL(ctk_object->txt_refresh_rate), str);
- g_free(str);
- } else {
- gtk_label_set_text(GTK_LABEL(ctk_object->txt_refresh_rate), "Unknown");
+ if (ret != NvCtrlSuccess) {
+ gtk_widget_hide(entry->hbox);
+ return;
+ }
+
+ fvalue = ((float)(val)) / 100.0f;
+ str = g_strdup_printf("%.2f Hz", fvalue);
+
+ gtk_label_set_text(GTK_LABEL(entry->txt), str);
+ g_free(str);
+
+ gtk_widget_show(entry->hbox);
+}
+
+
+
+/*
+ * update_device_info() - (Re)Queries the static display device information.
+ */
+static void update_device_info(CtkDisplayDevice *ctk_object)
+{
+ int i;
+ int max_width;
+ GtkRequisition req;
+
+
+ max_width = 0;
+ for (i = 0; i < ctk_object->num_info_entries; i++) {
+ InfoEntryData *entryData = __info_entry_data+i;
+ InfoEntry *entry = ctk_object->info_entries+i;
+
+ entryData->update_func(entry);
+
+ if (GTK_WIDGET_VISIBLE(entry->hbox)) {
+ gtk_widget_size_request(entry->label, &req);
+ if (max_width < req.width) {
+ max_width = req.width;
+ }
+ }
+ }
+
+ for (i = 0; i < ctk_object->num_info_entries; i++) {
+ InfoEntry *entry = ctk_object->info_entries+i;
+ gtk_widget_set_size_request(entry->label, max_width, -1);
}
} /* update_device_info() */
@@ -674,12 +745,29 @@ static void display_device_setup(CtkDisplayDevice *ctk_object)
-static void callback_link_changed(GtkObject *object, gpointer arg1,
- gpointer user_data)
+static void register_link_events(InfoEntry *entry)
{
- CtkDisplayDevice *ctk_object = CTK_DISPLAY_DEVICE(user_data);
+ CtkDisplayDevice *ctk_object = entry->ctk_object;
+
+ g_signal_connect(G_OBJECT(ctk_object->ctk_event),
+ CTK_EVENT_NAME(NV_CTRL_FLATPANEL_LINK),
+ G_CALLBACK(callback_link_changed),
+ (gpointer) entry);
+
+ g_signal_connect(G_OBJECT(ctk_object->ctk_event),
+ CTK_EVENT_NAME(NV_CTRL_DISPLAYPORT_LINK_RATE),
+ G_CALLBACK(callback_link_changed),
+ (gpointer) entry);
+}
- update_link(ctk_object);
+static void register_refresh_rate_events(InfoEntry *entry)
+{
+ CtkDisplayDevice *ctk_object = entry->ctk_object;
+
+ g_signal_connect(G_OBJECT(ctk_object->ctk_event),
+ CTK_EVENT_NAME(NV_CTRL_REFRESH_RATE),
+ G_CALLBACK(callback_refresh_rate_changed),
+ (gpointer) entry);
}
@@ -701,13 +789,19 @@ static void enabled_displays_received(GtkObject *object, gpointer arg1,
} /* enabled_displays_received() */
-/*
- * Update UI when display information changed.
- */
-static void info_update_received(GtkObject *object, gpointer arg1,
- gpointer user_data)
+static void callback_link_changed(GtkObject *object, gpointer arg1,
+ gpointer user_data)
{
- CtkDisplayDevice *ctk_object = CTK_DISPLAY_DEVICE(user_data);
+ InfoEntry *entry = (InfoEntry *)user_data;
- update_device_info(ctk_object);
+ update_link_info(entry);
+}
+
+
+static void callback_refresh_rate_changed(GtkObject *object, gpointer arg1,
+ gpointer user_data)
+{
+ InfoEntry *entry = (InfoEntry *)user_data;
+
+ update_refresh_rate(entry);
}
diff --git a/src/gtk+-2.x/ctkdisplaydevice.h b/src/gtk+-2.x/ctkdisplaydevice.h
index ed69aa0..ab5b90a 100644
--- a/src/gtk+-2.x/ctkdisplaydevice.h
+++ b/src/gtk+-2.x/ctkdisplaydevice.h
@@ -49,6 +49,15 @@ G_BEGIN_DECLS
typedef struct _CtkDisplayDevice CtkDisplayDevice;
typedef struct _CtkDisplayDeviceClass CtkDisplayDeviceClass;
+typedef struct InfoEntryRec {
+ GtkWidget *hbox;
+ GtkWidget *label;
+ GtkWidget *txt;
+
+ struct _CtkDisplayDevice *ctk_object;
+
+} InfoEntry;
+
struct _CtkDisplayDevice
{
GtkVBox parent;
@@ -62,11 +71,8 @@ struct _CtkDisplayDevice
GtkWidget *dithering_controls;
GtkWidget *color_controls;
- GtkWidget *txt_chip_location;
- GtkWidget *txt_link;
- GtkWidget *txt_signal;
- GtkWidget *txt_native_resolution;
- GtkWidget *txt_refresh_rate;
+ InfoEntry *info_entries;
+ int num_info_entries;
gboolean display_enabled;
unsigned int active_attributes;
@@ -83,7 +89,7 @@ struct _CtkDisplayDeviceClass
GType ctk_display_device_get_type (void) G_GNUC_CONST;
GtkWidget* ctk_display_device_new (NvCtrlAttributeHandle *,
CtkConfig *, CtkEvent *,
- char *, char *);
+ CtkEvent *, char *, char *);
GtkTextBuffer *ctk_display_device_create_help(GtkTextTagTable *,
CtkDisplayDevice *);
diff --git a/src/gtk+-2.x/ctkdisplaylayout.c b/src/gtk+-2.x/ctkdisplaylayout.c
index 83f0579..f2a18ec 100644
--- a/src/gtk+-2.x/ctkdisplaylayout.c
+++ b/src/gtk+-2.x/ctkdisplaylayout.c
@@ -205,6 +205,7 @@ static void zorder_layout(CtkDisplayLayout *ctk_object)
}
ctk_object->Zcount = 0;
ctk_object->selected_display = NULL;
+ ctk_object->selected_screen = NULL;
/* Count the number of Z-orderable elements in the layout */
@@ -2253,13 +2254,14 @@ static void select_screen(CtkDisplayLayout *ctk_object, nvScreenPtr screen)
int screen_at;
ZNode *tmpzo;
- if (!screen) return;
+ if (!screen) {
+ goto done;
+ }
/* Move the screen and its displays to the top */
move_to = 0 + screen->num_displays;
-
tmpzo = get_screen_zorder_move_data(ctk_object, screen, move_to,
&screen_at);
if (!tmpzo) {
@@ -2276,7 +2278,7 @@ static void select_screen(CtkDisplayLayout *ctk_object, nvScreenPtr screen)
(1 + screen->num_displays)*sizeof(ZNode));
free(tmpzo);
-
+
done:
ctk_object->selected_screen = screen;
@@ -2295,13 +2297,13 @@ static void select_display(CtkDisplayLayout *ctk_object, nvDisplayPtr display)
int i;
if (!display) {
- return;
+ select_screen(ctk_object, NULL);
+ goto done;
}
/* Move the screen and its displays to the top of the Z order */
select_screen(ctk_object, display->screen);
-
/* Move the display to the top of the Z order */
for (i = 0; i < ctk_object->Zcount; i++) {
@@ -2322,6 +2324,7 @@ static void select_display(CtkDisplayLayout *ctk_object, nvDisplayPtr display)
}
}
+ done:
ctk_object->selected_display = display;
} /* select_display() */
@@ -3298,11 +3301,6 @@ void ctk_display_layout_update(CtkDisplayLayout *ctk_object)
sync_scaling(ctk_object);
ctk_object->modify_info.modify_dirty = 1;
- /* Make sure the selected display/screen is up to date */
- if (ctk_object->selected_display) {
- ctk_object->selected_screen = ctk_object->selected_display->screen;
- }
-
queue_layout_redraw(ctk_object);
} /* ctk_display_layout_update() */
diff --git a/src/gtk+-2.x/ctkevent.c b/src/gtk+-2.x/ctkevent.c
index 172f784..e6aaa0c 100644
--- a/src/gtk+-2.x/ctkevent.c
+++ b/src/gtk+-2.x/ctkevent.c
@@ -328,6 +328,7 @@ static void ctk_event_class_init(CtkEventClass *ctk_event_class)
MAKE_SIGNAL(NV_CTRL_CURRENT_METAMODE_ID);
MAKE_SIGNAL(NV_CTRL_DISPLAY_ENABLED);
MAKE_SIGNAL(NV_CTRL_FRAMELOCK_INCOMING_HOUSE_SYNC_RATE);
+ MAKE_SIGNAL(NV_CTRL_FXAA);
#undef MAKE_SIGNAL
/*
@@ -337,7 +338,7 @@ static void ctk_event_class_init(CtkEventClass *ctk_event_class)
* knows about.
*/
-#if NV_CTRL_LAST_ATTRIBUTE != NV_CTRL_FRAMELOCK_INCOMING_HOUSE_SYNC_RATE
+#if NV_CTRL_LAST_ATTRIBUTE != NV_CTRL_FXAA
#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 fa22fb1..929b1c4 100644
--- a/src/gtk+-2.x/ctkgpu.c
+++ b/src/gtk+-2.x/ctkgpu.c
@@ -361,6 +361,7 @@ GtkWidget* ctk_gpu_new(
ctk_gpu->gpu_cores = (gpu_cores != NULL) ? 1 : 0;
ctk_gpu->memory_interface = (memory_interface != NULL) ? 1 : 0;
ctk_gpu->ctk_config = ctk_config;
+ ctk_gpu->ctk_event = ctk_event;
ctk_gpu->pcie_gen_queriable = FALSE;
/* set container properties of the object */
diff --git a/src/gtk+-2.x/ctkgpu.h b/src/gtk+-2.x/ctkgpu.h
index 2a79339..5bee1da 100644
--- a/src/gtk+-2.x/ctkgpu.h
+++ b/src/gtk+-2.x/ctkgpu.h
@@ -57,6 +57,7 @@ struct _CtkGpu
NvCtrlAttributeHandle *handle;
CtkConfig *ctk_config;
+ CtkEvent *ctk_event;
GtkWidget *displays;
gint gpu_cores;
diff --git a/src/gtk+-2.x/ctkmultisample.c b/src/gtk+-2.x/ctkmultisample.c
index c58862c..69c5597 100644
--- a/src/gtk+-2.x/ctkmultisample.c
+++ b/src/gtk+-2.x/ctkmultisample.c
@@ -62,6 +62,15 @@ static void fsaa_value_changed(GtkRange *range, gpointer user_data);
static void fsaa_update_received(GtkObject *object,
gpointer arg1, gpointer user_data);
+static void fxaa_checkbox_toggled(GtkWidget *widget,
+ gpointer user_data);
+
+static void fxaa_update_received(GtkObject *object,
+ gpointer arg1, gpointer user_data);
+
+static void post_fxaa_toggled(CtkMultisample *ctk_multisample,
+ gboolean enable);
+
static void
post_log_aniso_app_override_toggled(CtkMultisample *ctk_multisample,
gboolean override);
@@ -120,6 +129,10 @@ static const char *__aniso_slider_help =
"The Anisotropic Filtering slider controls the "
"level of automatic anisotropic texture filtering.";
+static const char *__fxaa_enable_help =
+"Enable Fast Approximate Anti-Aliasing. This option is applied to "
+"OpenGL applications that are started after this option is set.";
+
static const char *__texture_sharpening_help =
"To improve image quality, select this option "
"to sharpen textures when running OpenGL applications "
@@ -352,6 +365,27 @@ GtkWidget *ctk_multisample_new(NvCtrlAttributeHandle *handle,
for (i = 0; i < ctk_multisample->fsaa_translation_table_size; i++)
ctk_multisample->active_attributes |=
(1 << (__FSAA+ctk_multisample->fsaa_translation_table[i]));
+
+ /* FXAA Option button */
+
+ check_button = gtk_check_button_new_with_label("Enable FXAA");
+
+ ret = NvCtrlGetAttribute(handle, NV_CTRL_FXAA, &val);
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_button),val);
+
+ g_signal_connect(G_OBJECT(check_button), "toggled",
+ G_CALLBACK(fxaa_checkbox_toggled),
+ (gpointer) ctk_multisample);
+
+ g_signal_connect(G_OBJECT(ctk_event),
+ CTK_EVENT_NAME(NV_CTRL_FXAA),
+ G_CALLBACK(fxaa_update_received),
+ (gpointer) ctk_multisample);
+
+ ctk_config_set_tooltip(ctk_config, check_button,
+ __fxaa_enable_help);
+ gtk_box_pack_start(GTK_BOX(vbox), check_button, FALSE, FALSE, 0);
+ ctk_multisample->fxaa_enable_check_button = check_button;
}
}
@@ -943,6 +977,69 @@ static void fsaa_value_changed(GtkRange *range, gpointer user_data)
} /* fsaa_value_changed() */
+/*
+ * fxaa_checkbox_toggled - callback for a change to
+ * the FXAA settings in the control panel
+ */
+static void fxaa_checkbox_toggled(GtkWidget *widget,
+ gpointer user_data)
+{
+ CtkMultisample *ctk_multisample = CTK_MULTISAMPLE(user_data);
+ gboolean enabled;
+
+ enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
+
+ NvCtrlSetAttribute(ctk_multisample->handle, NV_CTRL_FXAA, enabled);
+
+ post_fxaa_toggled(ctk_multisample, enabled);
+
+} /* fxaa_checkbox_toggled */
+
+
+/*
+ * fxaa_update_received() - callback function for when the
+ * NV_CTRL_FXAA attribute is changed by another NV-CONTROL
+ * client.
+ */
+
+static void fxaa_update_received(GtkObject *object,
+ gpointer arg1, gpointer user_data)
+{
+ CtkEventStruct *event_struct = (CtkEventStruct *) arg1;
+ CtkMultisample *ctk_multisample = CTK_MULTISAMPLE(user_data);
+ gboolean fxaa_value = event_struct->value;
+ GtkWidget *check_button = ctk_multisample->fxaa_enable_check_button;
+
+ g_signal_handlers_block_by_func(G_OBJECT(check_button),
+ G_CALLBACK(fxaa_checkbox_toggled),
+ (gpointer) ctk_multisample);
+
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_button), fxaa_value);
+
+ g_signal_handlers_unblock_by_func(G_OBJECT(check_button),
+ G_CALLBACK(fxaa_checkbox_toggled),
+ (gpointer) ctk_multisample);
+
+ post_fxaa_toggled(ctk_multisample, fxaa_value);
+
+} /* fxaa_update_received() */
+
+/*
+ * post_fxaa_toggled() - helper function for fxaa_button_toggled()
+ * and fxaa_update_received(); this does whatever work is necessary
+ * after the app control check button has been toggled.
+ */
+
+static void
+post_fxaa_toggled(CtkMultisample *ctk_multisample, gboolean enable)
+{
+ ctk_config_statusbar_message(ctk_multisample->ctk_config,
+ "FXAA "
+ "%s.", enable ? "enabled" : "disabled");
+
+} /* post_fxaa_toggled() */
+
+
/*
* fsaa_update_received() - callback function for when the
diff --git a/src/gtk+-2.x/ctkmultisample.h b/src/gtk+-2.x/ctkmultisample.h
index 37d5f42..a72621b 100644
--- a/src/gtk+-2.x/ctkmultisample.h
+++ b/src/gtk+-2.x/ctkmultisample.h
@@ -57,6 +57,7 @@ struct _CtkMultisample
GtkWidget *fsaa_app_override_check_button;
GtkWidget *fsaa_menu;
GtkWidget *fsaa_scale;
+ GtkWidget *fxaa_enable_check_button;
GtkWidget *log_aniso_app_override_check_button;
GtkWidget *log_aniso_scale;
GtkWidget *texture_sharpening_button;
diff --git a/src/gtk+-2.x/ctkwindow.c b/src/gtk+-2.x/ctkwindow.c
index 52d14ba..0919bf1 100644
--- a/src/gtk+-2.x/ctkwindow.c
+++ b/src/gtk+-2.x/ctkwindow.c
@@ -119,6 +119,7 @@ static void save_settings_and_exit(CtkWindow *);
static void add_display_devices(CtkWindow *ctk_window, GtkTreeIter *iter,
NvCtrlAttributeHandle *handle,
+ CtkEvent *ctk_event,
GtkTextTagTable *tag_table,
UpdateDisplaysData *data);
@@ -858,7 +859,8 @@ GtkWidget *ctk_window_new(ParsedAttribute *p, ConfigProperties *conf,
G_CALLBACK(update_display_devices),
(gpointer) data);
- add_display_devices(ctk_window, &iter, gpu_handle, tag_table, data);
+ add_display_devices(ctk_window, &iter, gpu_handle, ctk_event, tag_table,
+ data);
}
/* add the per-vcs (e.g. Quadro Plex) entries into the tree model */
@@ -1349,6 +1351,7 @@ void add_special_config_file_attributes(CtkWindow *ctk_window)
static void add_display_devices(CtkWindow *ctk_window, GtkTreeIter *iter,
NvCtrlAttributeHandle *gpu_handle,
+ CtkEvent *ctk_event_gpu,
GtkTextTagTable *tag_table,
UpdateDisplaysData *data)
{
@@ -1439,6 +1442,7 @@ static void add_display_devices(CtkWindow *ctk_window, GtkTreeIter *iter,
(strcmp(typeBaseName, "CRT") == 0)) {
widget = ctk_display_device_new(display_handle,
ctk_window->ctk_config, ctk_event,
+ ctk_event_gpu,
title, typeBaseName);
help = ctk_display_device_create_help(tag_table,
CTK_DISPLAY_DEVICE(widget));
@@ -1482,6 +1486,7 @@ static void update_display_devices(GtkObject *object, gpointer arg1,
gboolean parent_expanded;
GtkTreeSelection *tree_selection =
gtk_tree_view_get_selection(ctk_window->treeview);
+ GtkWidget *widget;
/* Keep track if the parent row is expanded */
@@ -1496,7 +1501,6 @@ static void update_display_devices(GtkObject *object, gpointer arg1,
while (data->num_displays) {
GtkTreeIter *iter = &(data->display_iters[data->num_displays -1]);
- GtkWidget *widget;
/* Select the parent (GPU) iter if we're removing the selected page */
if (gtk_tree_selection_iter_is_selected(tree_selection, iter)) {
@@ -1516,7 +1520,13 @@ static void update_display_devices(GtkObject *object, gpointer arg1,
}
/* Add back all the connected display devices */
- add_display_devices(ctk_window, &parent_iter, gpu_handle, tag_table, data);
+
+ gtk_tree_model_get(GTK_TREE_MODEL(ctk_window->tree_store), &parent_iter,
+ CTK_WINDOW_WIDGET_COLUMN, &widget, -1);
+
+ add_display_devices(ctk_window, &parent_iter, gpu_handle,
+ CTK_GPU(widget)->ctk_event,
+ tag_table, data);
/* Expand the GPU entry if it used to be */
if (parent_expanded) {
diff --git a/src/libXNVCtrl/NVCtrl.h b/src/libXNVCtrl/NVCtrl.h
index 4f60cd0..2b05050 100644
--- a/src/libXNVCtrl/NVCtrl.h
+++ b/src/libXNVCtrl/NVCtrl.h
@@ -3195,8 +3195,17 @@
*/
#define NV_CTRL_FRAMELOCK_INCOMING_HOUSE_SYNC_RATE 389 /* R--F */
+/*
+ * NV_CTRL_FXAA - enables FXAA. A pixel shader based anti-
+ * aliasing method.
+ */
+#define NV_CTRL_FXAA 390 /* RW-X */
+#define NV_CTRL_FXAA_DISABLE 0
+#define NV_CTRL_FXAA_ENABLE 1
+
+
-#define NV_CTRL_LAST_ATTRIBUTE NV_CTRL_FRAMELOCK_INCOMING_HOUSE_SYNC_RATE
+#define NV_CTRL_LAST_ATTRIBUTE NV_CTRL_FXAA
/**************************************************************************/
diff --git a/src/parse.c b/src/parse.c
index e758a8a..045b00c 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -119,6 +119,7 @@ AttributeTableEntry attributeTable[] = {
{ "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." },
+ { "FXAA", NV_CTRL_FXAA, 0, "Enables or disables the use of FXAA, Fast Approximate Anti-Aliasing" },
{ "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." },
@@ -366,7 +367,7 @@ AttributeTableEntry attributeTable[] = {
* about.
*/
-#if NV_CTRL_LAST_ATTRIBUTE != NV_CTRL_FRAMELOCK_INCOMING_HOUSE_SYNC_RATE
+#if NV_CTRL_LAST_ATTRIBUTE != NV_CTRL_FXAA
#warning "Have you forgotten to add a new integer attribute to attributeTable?"
#endif
diff --git a/src/version.mk b/src/version.mk
index 11c1292..ef64379 100644
--- a/src/version.mk
+++ b/src/version.mk
@@ -1 +1 @@
-NVIDIA_VERSION = 304.22
+NVIDIA_VERSION = 304.30
diff --git a/version.mk b/version.mk
index 11c1292..ef64379 100644
--- a/version.mk
+++ b/version.mk
@@ -1 +1 @@
-NVIDIA_VERSION = 304.22
+NVIDIA_VERSION = 304.30