summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Plattner <aplattner@nvidia.com>2008-02-12 21:29:00 -0800
committerAaron Plattner <aplattner@nvidia.com>2008-02-12 21:29:00 -0800
commitf513358f729cc7c91a0a441ed8e8cf247bfb9a7d (patch)
tree42bf7728fb2b949e3a5fd0dd1bcb00cf651d6dd3
parented6a95f84006ba62cdec15b8aa22a5ab2d46f2e4 (diff)
100.14.19100.14.19
-rw-r--r--src/XF86Config-parser/Generate.c11
-rw-r--r--src/gtk+-2.x/Makefile.inc6
-rw-r--r--src/gtk+-2.x/ctkclocks.c5
-rw-r--r--src/gtk+-2.x/ctkdisplayconfig-utils.c2
-rw-r--r--src/gtk+-2.x/ctkdisplayconfig.c7
-rw-r--r--src/gtk+-2.x/ctkevent.c4
-rw-r--r--src/gtk+-2.x/ctkframelock.c67
-rw-r--r--src/gtk+-2.x/ctkpowersavings.c234
-rw-r--r--src/gtk+-2.x/ctkpowersavings.h78
-rw-r--r--src/gtk+-2.x/ctkwindow.c10
-rw-r--r--src/gtk+-2.x/ctkxvideo.c56
-rw-r--r--src/gtk+-2.x/ctkxvideo.h2
-rw-r--r--src/libXNVCtrl/NVCtrl.h56
-rw-r--r--src/libXNVCtrl/libXNVCtrl.abin17180 -> 143448 bytes
-rw-r--r--src/libXNVCtrlAttributes/NvCtrlAttributes.h9
-rw-r--r--src/libXNVCtrlAttributes/NvCtrlAttributesPrivate.h2
-rw-r--r--src/libXNVCtrlAttributes/NvCtrlAttributesXv.c24
-rw-r--r--src/parse.c10
-rw-r--r--src/parse.h25
-rw-r--r--src/query-assign.c2
20 files changed, 547 insertions, 63 deletions
diff --git a/src/XF86Config-parser/Generate.c b/src/XF86Config-parser/Generate.c
index 3d2da41..008730a 100644
--- a/src/XF86Config-parser/Generate.c
+++ b/src/XF86Config-parser/Generate.c
@@ -515,17 +515,10 @@ add_device(XConfigPtr config, int bus, int slot, char *boardname, int count)
XConfigDisplayPtr xconfigAddDisplay(XConfigDisplayPtr head, const int depth)
{
XConfigDisplayPtr display;
- XConfigModePtr mode = NULL;
-
- mode = xconfigAddMode(mode, "640x480");
- mode = xconfigAddMode(mode, "800x600");
- mode = xconfigAddMode(mode, "1024x768");
- mode = xconfigAddMode(mode, "1280x1024");
- mode = xconfigAddMode(mode, "1600x1200");
-
+
display = xconfigAlloc(sizeof(XConfigDisplayRec));
display->depth = depth;
- display->modes = mode;
+ display->modes = NULL;
display->frameX0 = -1;
display->frameY0 = -1;
display->black.red = -1;
diff --git a/src/gtk+-2.x/Makefile.inc b/src/gtk+-2.x/Makefile.inc
index 1d882bd..2ff777b 100644
--- a/src/gtk+-2.x/Makefile.inc
+++ b/src/gtk+-2.x/Makefile.inc
@@ -61,7 +61,8 @@ SRC += \
ctkgpu.c \
ctkbanner.c \
ctkvcsc.c \
- ctkdisplayconfig-utils.c
+ ctkdisplayconfig-utils.c \
+ ctkpowersavings.c
EXTRA_DIST += \
@@ -102,7 +103,8 @@ EXTRA_DIST += \
ctkgpu.h \
ctkbanner.h \
ctkvcsc.h \
- ctkdisplayconfig-utils.h
+ ctkdisplayconfig-utils.h \
+ ctkpowersavings.h
dist_list::
@ echo $(SRC) $(EXTRA_DIST)
diff --git a/src/gtk+-2.x/ctkclocks.c b/src/gtk+-2.x/ctkclocks.c
index 8a93a9b..5bcf6fb 100644
--- a/src/gtk+-2.x/ctkclocks.c
+++ b/src/gtk+-2.x/ctkclocks.c
@@ -292,6 +292,7 @@ GtkWidget* ctk_clocks_new(NvCtrlAttributeHandle *handle,
int value;
int clocks_2D;
NVCTRLAttributeValidValuesRec ranges_2D;
+ NVCTRLAttributeValidValuesRec range_detection;
int clocks_3D;
NVCTRLAttributeValidValuesRec ranges_3D;
@@ -318,9 +319,9 @@ GtkWidget* ctk_clocks_new(NvCtrlAttributeHandle *handle,
/* Check if overclocking is busy */
if ( overclocking_enabled ) {
- ret = NvCtrlGetAttribute(handle,
+ ret = NvCtrlGetValidAttributeValues(handle,
NV_CTRL_GPU_OPTIMAL_CLOCK_FREQS_DETECTION,
- &value);
+ &range_detection);
if ( ret == NvCtrlSuccess ) {
ret = NvCtrlGetAttribute(handle,
NV_CTRL_GPU_OPTIMAL_CLOCK_FREQS_DETECTION_STATE,
diff --git a/src/gtk+-2.x/ctkdisplayconfig-utils.c b/src/gtk+-2.x/ctkdisplayconfig-utils.c
index d22ef5d..eed1149 100644
--- a/src/gtk+-2.x/ctkdisplayconfig-utils.c
+++ b/src/gtk+-2.x/ctkdisplayconfig-utils.c
@@ -1747,7 +1747,7 @@ static int gpu_add_screen_from_server(nvGpuPtr gpu, int screen_id,
*err_str = g_strdup_printf("Dynamic TwinView is disabled on "
"screen %d.",
screen_id);
- nv_error_msg(*err_str);
+ nv_warning_msg(*err_str);
goto fail;
}
diff --git a/src/gtk+-2.x/ctkdisplayconfig.c b/src/gtk+-2.x/ctkdisplayconfig.c
index 90fb6dc..d1a5d9f 100644
--- a/src/gtk+-2.x/ctkdisplayconfig.c
+++ b/src/gtk+-2.x/ctkdisplayconfig.c
@@ -900,10 +900,11 @@ GtkWidget* ctk_display_config_new(NvCtrlAttributeHandle *handle,
gchar *str;
if (!err_str) {
- str = g_strdup("Failed to load X Server Display Configuration.");
+ str = g_strdup("Unable to load X Server Display "
+ "Configuration page.");
} else {
- str = g_strdup_printf("Error while loading X Server Display "
- "Configuration:\n\n%s", err_str);
+ str = g_strdup_printf("Unable to load X Server Display "
+ "Configuration page:\n\n%s", err_str);
g_free(err_str);
}
diff --git a/src/gtk+-2.x/ctkevent.c b/src/gtk+-2.x/ctkevent.c
index 7759125..dd1fc79 100644
--- a/src/gtk+-2.x/ctkevent.c
+++ b/src/gtk+-2.x/ctkevent.c
@@ -242,6 +242,8 @@ static void ctk_event_class_init(CtkEventClass *ctk_event_class)
MAKE_SIGNAL(NV_CTRL_FSAA_APPLICATION_ENHANCED);
MAKE_SIGNAL(NV_CTRL_FRAMELOCK_SYNC_RATE_4);
MAKE_SIGNAL(NV_CTRL_GVO_LOCK_OWNER);
+ MAKE_SIGNAL(NV_CTRL_REFRESH_RATE_3);
+ MAKE_SIGNAL(NV_CTRL_ONDEMAND_VBLANK_INTERRUPTS);
#undef MAKE_SIGNAL
@@ -252,7 +254,7 @@ static void ctk_event_class_init(CtkEventClass *ctk_event_class)
* knows about.
*/
-#if NV_CTRL_LAST_ATTRIBUTE != NV_CTRL_GVO_LOCK_OWNER
+#if NV_CTRL_LAST_ATTRIBUTE != NV_CTRL_ONDEMAND_VBLANK_INTERRUPTS
#warning "There are attributes that do not emit signals!"
#endif
diff --git a/src/gtk+-2.x/ctkframelock.c b/src/gtk+-2.x/ctkframelock.c
index bffde0e..80feef4 100644
--- a/src/gtk+-2.x/ctkframelock.c
+++ b/src/gtk+-2.x/ctkframelock.c
@@ -82,7 +82,7 @@ enum
* that entry.
*/
-#define NUM_GPU_SIGNALS 5
+#define NUM_GPU_SIGNALS 6
const char *__GPUSignals[NUM_GPU_SIGNALS] =
{
@@ -90,7 +90,8 @@ const char *__GPUSignals[NUM_GPU_SIGNALS] =
CTK_EVENT_NAME(NV_CTRL_FRAMELOCK_SLAVES),
CTK_EVENT_NAME(NV_CTRL_FRAMELOCK_SYNC),
CTK_EVENT_NAME(NV_CTRL_FRAMELOCK_TEST_SIGNAL),
- CTK_EVENT_NAME(NV_CTRL_REFRESH_RATE)
+ CTK_EVENT_NAME(NV_CTRL_REFRESH_RATE),
+ CTK_EVENT_NAME(NV_CTRL_REFRESH_RATE_3)
};
/*
@@ -183,6 +184,7 @@ struct _nvDisplayDataRec {
GtkWidget *rate_label;
GtkWidget *rate_text;
guint rate;
+ guint rate_precision;
GtkWidget *stereo_label;
GtkWidget *stereo_hbox; /* LED */
@@ -3407,10 +3409,18 @@ void list_entry_update_gpu_status(CtkFramelock *ctk_framelock,
has_client = data->clients_mask;
has_server = data->server_mask;
- /* Check Timing Sync */
- if (!framelock_enabled ||
- (!has_server && !has_client) ||
- (has_server && (use_house_sync || !house))) {
+ /* Update the Timing LED:
+ *
+ * We should disable the GPU Timing LED (which reports the sync status
+ * between the GPU and the G-Sync device) when we don't care if the
+ * GPU is in sync with the G-Sync device. This occurs when Frame Lock
+ * is disabled, or when there are no devices selected for the GPU, or
+ * in cases where the GPU is driving the sync signal to the G-Sync device.
+ */
+ if (!framelock_enabled || // Frame Lock is disabled.
+ (!has_server && !has_client) || // No devices selected on GPU.
+ (has_server && !use_house_sync) || // GPU always drives sync.
+ (has_server && !house)) { // No house so GPU drives sync.
gtk_widget_set_sensitive(data->timing_label, FALSE);
update_image(data->timing_hbox, ctk_framelock->led_grey);
} else {
@@ -3481,7 +3491,7 @@ void list_entry_update_display_status(CtkFramelock *ctk_framelock,
/** list_entry_update_status() ***************************************
*
* Updates the (GUI) state of a list entry, its children and siblings
- * by queryin ghte X Server.
+ * by querying the X Server.
*
*/
void list_entry_update_status(CtkFramelock *ctk_framelock,
@@ -3928,6 +3938,7 @@ static void gpu_state_received(GtkObject *object,
case NV_CTRL_REFRESH_RATE:
+ case NV_CTRL_REFRESH_RATE_3:
/* Update the display device's refresh rate */
display_entry = get_display_on_gpu(gpu_entry, event->display_mask);
if (display_entry && display_entry->data) {
@@ -3938,8 +3949,18 @@ static void gpu_state_received(GtkObject *object,
(nvDisplayDataPtr)(display_entry->data);
display_data->rate = event->value;
- fvalue = ((float)(display_data->rate)) / 100.0f;
- snprintf(str, 32, "%.2f Hz", fvalue);
+ if (event->attribute == NV_CTRL_REFRESH_RATE_3 &&
+ display_data->rate_precision == 3) {
+ fvalue = ((float)(display_data->rate)) / 1000.0f;
+ snprintf(str, 32, "%.3f Hz", fvalue);
+ } else if (display_data->rate_precision == 2 ){
+ fvalue = ((float)(display_data->rate)) / 100.0f;
+ snprintf(str, 32, "%.2f Hz", fvalue);
+ } else {
+ // wrong signal (got 2 but support 3 or got 3 but
+ // don't support it);
+ break;
+ }
gtk_label_set_text(GTK_LABEL(display_data->rate_text), str);
}
@@ -4694,7 +4715,7 @@ static unsigned int add_display_devices(CtkFramelock *ctk_framelock,
unsigned int master_mask;
unsigned int slaves_mask;
gfloat fvalue; /* To print the refresh rate */
- gchar str[32];
+ gchar rr_str[32];
nvListEntryPtr server_entry = NULL;
nvDisplayDataPtr server_data = NULL;
@@ -4788,10 +4809,24 @@ static unsigned int add_display_devices(CtkFramelock *ctk_framelock,
goto fail;
}
- ret = NvCtrlGetDisplayAttribute(gpu_data->handle,
- display_mask,
- NV_CTRL_REFRESH_RATE,
- (int *)&(display_data->rate));
+ // If we can't get either percision, then fail
+ if (NvCtrlSuccess !=
+ (ret = NvCtrlGetDisplayAttribute(gpu_data->handle,
+ display_mask,
+ NV_CTRL_REFRESH_RATE_3,
+ (int *)&(display_data->rate)))) {
+ ret = NvCtrlGetDisplayAttribute(gpu_data->handle,
+ display_mask,
+ NV_CTRL_REFRESH_RATE,
+ (int *)&(display_data->rate));
+ fvalue = ((float)(display_data->rate)) / 100.0f;
+ snprintf(rr_str, 32, "%.2f Hz", fvalue);
+ display_data->rate_precision = 2;
+ } else {
+ fvalue = ((float)(display_data->rate)) / 1000.0f;
+ snprintf(rr_str, 32, "%.3f Hz", fvalue);
+ display_data->rate_precision = 3;
+ }
if (ret != NvCtrlSuccess) {
goto fail;
}
@@ -4811,9 +4846,7 @@ static unsigned int add_display_devices(CtkFramelock *ctk_framelock,
__client_checkbox_help);
display_data->rate_label = gtk_label_new("Refresh:");
- fvalue = ((float)(display_data->rate)) / 100.0f;
- snprintf(str, 32, "%.2f Hz", fvalue);
- display_data->rate_text = gtk_label_new(str);
+ display_data->rate_text = gtk_label_new(rr_str);
display_data->stereo_label = gtk_label_new("Stereo");
display_data->stereo_hbox = gtk_hbox_new(FALSE, 0);
diff --git a/src/gtk+-2.x/ctkpowersavings.c b/src/gtk+-2.x/ctkpowersavings.c
new file mode 100644
index 0000000..0687dc4
--- /dev/null
+++ b/src/gtk+-2.x/ctkpowersavings.c
@@ -0,0 +1,234 @@
+/*
+ * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix
+ * and Linux systems.
+ *
+ * Copyright (C) 2004 NVIDIA Corporation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of Version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2
+ * of the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the:
+ *
+ * Free Software Foundation, Inc.
+ * 59 Temple Place - Suite 330
+ * Boston, MA 02111-1307, USA
+ *
+ */
+
+#include <gtk/gtk.h>
+#include <NvCtrlAttributes.h>
+
+#include "ctkimage.h"
+
+#include "ctkpowersavings.h"
+
+#include "ctkconfig.h"
+#include "ctkhelp.h"
+
+static void vblank_control_button_toggled (GtkWidget *, gpointer);
+static void post_vblank_control_button_toggled (CtkPowerSavings *, gboolean);
+static void value_changed (GtkObject *, gpointer, gpointer);
+
+static const char *__vblank_control_help =
+"When enabled, VBlank interrupts will be generated by the GPU "
+"only if they are required by the driver. Normally, VBlank "
+"interrupts are generated on every vertical refresh of every "
+"display device connected to the GPU. Enabling on-demand VBlank "
+"interrupt control can help conserve power.";
+
+
+GType ctk_power_savings_get_type(void)
+{
+ static GType ctk_power_savings_type = 0;
+
+ if (!ctk_power_savings_type) {
+ static const GTypeInfo ctk_power_savings_info = {
+ sizeof (CtkPowerSavingsClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ NULL, /* class_init, */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (CtkPowerSavings),
+ 0, /* n_preallocs */
+ NULL, /* instance_init */
+ };
+
+ ctk_power_savings_type = g_type_register_static (GTK_TYPE_VBOX,
+ "CtkPowerSavings", &ctk_power_savings_info, 0);
+ }
+
+ return ctk_power_savings_type;
+}
+
+GtkWidget* ctk_power_savings_new(NvCtrlAttributeHandle *handle,
+ CtkConfig *ctk_config, CtkEvent *ctk_event)
+{
+ GObject *object;
+ CtkPowerSavings *ctk_power_savings;
+ GtkWidget *label;
+ GtkWidget *banner;
+ GtkWidget *hseparator;
+ GtkWidget *hbox;
+ GtkWidget *vbox;
+ GtkWidget *check_button;
+
+ gint ondemand_vblank_control;
+
+ /* query power savings settings */
+
+ if (NvCtrlGetAttribute(handle, NV_CTRL_ONDEMAND_VBLANK_INTERRUPTS,
+ &ondemand_vblank_control)
+ != NvCtrlSuccess) {
+ return NULL;
+ }
+
+ object = g_object_new(CTK_TYPE_POWER_SAVINGS, NULL);
+
+ ctk_power_savings = CTK_POWER_SAVINGS(object);
+ ctk_power_savings->handle = handle;
+ ctk_power_savings->ctk_config = ctk_config;
+
+ gtk_box_set_spacing(GTK_BOX(object), 10);
+
+ banner = ctk_banner_image_new(BANNER_ARTWORK_GPU);
+ gtk_box_pack_start(GTK_BOX(object), banner, FALSE, FALSE, 0);
+
+
+ /* 'Interrupts' section */
+
+ hbox = gtk_hbox_new(FALSE, 5);
+ gtk_box_pack_start(GTK_BOX(object), hbox, FALSE, FALSE, 0);
+
+ label = gtk_label_new("Interrupts");
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
+
+ hseparator = gtk_hseparator_new();
+ gtk_box_pack_start(GTK_BOX(hbox), hseparator, TRUE, TRUE, 0);
+
+
+ vbox = gtk_vbox_new(FALSE, 2);
+ gtk_box_pack_start(GTK_BOX(object), vbox, FALSE, FALSE, 0);
+
+
+ /* 'On-Demand VBlank interrupts' toggle */
+
+ label = gtk_label_new("On-Demand VBlank Interrupts");
+
+ check_button = gtk_check_button_new();
+ gtk_container_add(GTK_CONTAINER(check_button), label);
+
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_button),
+ ondemand_vblank_control);
+
+ gtk_box_pack_start(GTK_BOX(vbox), check_button, FALSE, FALSE, 0);
+
+ g_signal_connect(G_OBJECT(check_button), "toggled",
+ G_CALLBACK(vblank_control_button_toggled),
+ (gpointer)ctk_power_savings);
+
+ g_signal_connect(G_OBJECT(ctk_event),
+ CTK_EVENT_NAME(NV_CTRL_ONDEMAND_VBLANK_INTERRUPTS),
+ G_CALLBACK(value_changed), (gpointer)ctk_power_savings);
+
+ ctk_config_set_tooltip(ctk_config, check_button,
+ __vblank_control_help);
+
+ ctk_power_savings->vblank_control_button = check_button;
+
+
+ gtk_widget_show_all(GTK_WIDGET(object));
+
+ return GTK_WIDGET(object);
+}
+
+/*
+ * Prints a status bar message.
+ */
+static void post_vblank_control_button_toggled(CtkPowerSavings *ctk_power_savings,
+ gboolean enabled)
+{
+ ctk_config_statusbar_message(ctk_power_savings->ctk_config,
+ "On-Demand VBlank Interrupts %s.",
+ enabled ? "enabled" : "disabled");
+}
+
+static void vblank_control_button_toggled(
+ GtkWidget *widget,
+ gpointer user_data
+)
+{
+ CtkPowerSavings *ctk_power_savings;
+ gboolean enabled;
+
+ ctk_power_savings = CTK_POWER_SAVINGS(user_data);
+
+ enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
+
+ NvCtrlSetAttribute(ctk_power_savings->handle,
+ NV_CTRL_ONDEMAND_VBLANK_INTERRUPTS, enabled);
+
+ post_vblank_control_button_toggled(ctk_power_savings, enabled);
+}
+
+/*
+ * value_changed() - callback function for changed NV-CONTROL
+ * attribute settings.
+ */
+static void value_changed(GtkObject *object, gpointer arg1, gpointer user_data)
+{
+ CtkEventStruct *event_struct;
+ CtkPowerSavings *ctk_power_savings;
+ gboolean enabled;
+ GtkToggleButton *button;
+ GCallback func;
+
+ event_struct = (CtkEventStruct *)arg1;
+ ctk_power_savings = CTK_POWER_SAVINGS(user_data);
+
+ switch (event_struct->attribute) {
+ case NV_CTRL_ONDEMAND_VBLANK_INTERRUPTS:
+ button = GTK_TOGGLE_BUTTON(ctk_power_savings->vblank_control_button);
+ func = G_CALLBACK(vblank_control_button_toggled);
+ post_vblank_control_button_toggled(ctk_power_savings, event_struct->value);
+ break;
+ default:
+ return;
+ }
+
+ enabled = gtk_toggle_button_get_active(button);
+
+ if (enabled != event_struct->value) {
+ g_signal_handlers_block_by_func(button, func, ctk_power_savings);
+ gtk_toggle_button_set_active(button, event_struct->value);
+ g_signal_handlers_unblock_by_func(button, func, ctk_power_savings);
+ }
+
+}
+
+GtkTextBuffer *ctk_power_savings_create_help(GtkTextTagTable *table,
+ CtkPowerSavings *ctk_power_savings)
+{
+ GtkTextIter i;
+ GtkTextBuffer *b;
+
+ b = gtk_text_buffer_new(table);
+
+ gtk_text_buffer_get_iter_at_offset(b, &i, 0);
+
+ ctk_help_title(b, &i, "Power Savings Help");
+
+ ctk_help_heading(b, &i, "On-Demand VBlank Interrupts");
+ ctk_help_para(b, &i, __vblank_control_help);
+
+ ctk_help_finish(b);
+
+ return b;
+}
diff --git a/src/gtk+-2.x/ctkpowersavings.h b/src/gtk+-2.x/ctkpowersavings.h
new file mode 100644
index 0000000..700285f
--- /dev/null
+++ b/src/gtk+-2.x/ctkpowersavings.h
@@ -0,0 +1,78 @@
+/*
+ * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix
+ * and Linux systems.
+ *
+ * Copyright (C) 2004 NVIDIA Corporation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of Version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2
+ * of the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the:
+ *
+ * Free Software Foundation, Inc.
+ * 59 Temple Place - Suite 330
+ * Boston, MA 02111-1307, USA
+ *
+ */
+
+#ifndef __CTK_POWER_SAVINGS_H__
+#define __CTK_POWER_SAVINGS_H__
+
+#include "ctkevent.h"
+#include "ctkconfig.h"
+
+G_BEGIN_DECLS
+
+#define CTK_TYPE_POWER_SAVINGS (ctk_power_savings_get_type())
+
+#define CTK_POWER_SAVINGS(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST ((obj), CTK_TYPE_POWER_SAVINGS, CtkPowerSavings))
+
+#define CTK_POWER_SAVINGS_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST ((klass), CTK_TYPE_POWER_SAVINGS, CtkPowerSavingsClass))
+
+#define CTK_IS_POWER_SAVINGS(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CTK_TYPE_POWER_SAVINGS))
+
+#define CTK_IS_POWER_SAVINGS_CLASS(class) \
+ (G_TYPE_CHECK_CLASS_TYPE ((klass), CTK_TYPE_POWER_SAVINGS))
+
+#define CTK_POWER_SAVINGS_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS ((obj), CTK_TYPE_POWER_SAVINGS, CtkPowerSavingsClass))
+
+
+typedef struct _CtkPowerSavings CtkPowerSavings;
+typedef struct _CtkPowerSavingsClass CtkPowerSavingsClass;
+
+struct _CtkPowerSavings
+{
+ GtkVBox parent;
+
+ NvCtrlAttributeHandle *handle;
+ CtkConfig *ctk_config;
+
+ GtkWidget *vblank_control_button;
+};
+
+struct _CtkPowerSavingsClass
+{
+ GtkVBoxClass parent_class;
+};
+
+GType ctk_power_savings_get_type (void) G_GNUC_CONST;
+GtkWidget* ctk_power_savings_new (NvCtrlAttributeHandle *,
+ CtkConfig *, CtkEvent *);
+
+GtkTextBuffer *ctk_power_savings_create_help(GtkTextTagTable *, CtkPowerSavings *);
+
+G_END_DECLS
+
+#endif /* __CTK_POWER_SAVINGS_H__ */
+
diff --git a/src/gtk+-2.x/ctkwindow.c b/src/gtk+-2.x/ctkwindow.c
index b1cf971..12ba447 100644
--- a/src/gtk+-2.x/ctkwindow.c
+++ b/src/gtk+-2.x/ctkwindow.c
@@ -53,6 +53,7 @@
#include "ctkthermal.h"
#include "ctkclocks.h"
#include "ctkvcsc.h"
+#include "ctkpowersavings.h"
#include "ctkdisplaydevice-crt.h"
#include "ctkdisplaydevice-tv.h"
@@ -777,6 +778,15 @@ GtkWidget *ctk_window_new(NvCtrlAttributeHandle **screen_handles,
CTK_WINDOW_CONFIG_FILE_ATTRIBUTES_FUNC_COLUMN,
NULL, -1);
+ /* power savings */
+
+ child = ctk_power_savings_new(gpu_handle, ctk_config, ctk_event);
+ if (child) {
+ help = ctk_power_savings_create_help(tag_table, CTK_POWER_SAVINGS(child));
+ add_page(child, help, ctk_window, &iter, NULL,
+ "Power Savings Settings", NULL, NULL, NULL);
+ }
+
/* thermal information */
child = ctk_thermal_new(gpu_handle, ctk_config);
diff --git a/src/gtk+-2.x/ctkxvideo.c b/src/gtk+-2.x/ctkxvideo.c
index 53063a6..2bd57c1 100644
--- a/src/gtk+-2.x/ctkxvideo.c
+++ b/src/gtk+-2.x/ctkxvideo.c
@@ -56,6 +56,15 @@ static const char *__xv_texture_sync_to_vblank_help =
"the vertical retrace of your display device "
"for the Texture Xv Adaptor.";
+static const char *__xv_texture_contrast_help =
+"The Video Texture Contrast slider controls "
+"the contrast level for the Texture Xv Adaptor.";
+
+static const char *__xv_texture_brightness_help =
+"The Video Texture Brightness slider controls "
+"the brightness level for the Texture Xv Adaptor.";
+
+
static const char *__xv_blitter_sync_to_vblank_help =
"The Video Blitter Sync To VBlank checkbox "
"toggles syncing XvPutVideo(3X) and XvPutStill(3X) to "
@@ -144,8 +153,10 @@ static void xv_sync_to_display_radio_button_enabled_add(CtkXVideo *ctk_xvideo,
#define __XV_OVERLAY_BRIGHTNESS (1 << 3)
#define __XV_OVERLAY_HUE (1 << 4)
#define __XV_TEXTURE_SYNC_TO_VBLANK (1 << 5)
-#define __XV_BLITTER_SYNC_TO_VBLANK (1 << 6)
-#define __XV_SYNC_TO_DISPLAY (1 << 7)
+#define __XV_TEXTURE_CONTRAST (1 << 6)
+#define __XV_TEXTURE_BRIGHTNESS (1 << 7)
+#define __XV_BLITTER_SYNC_TO_VBLANK (1 << 8)
+#define __XV_SYNC_TO_DISPLAY (1 << 9)
@@ -573,6 +584,19 @@ GtkWidget* ctk_xvideo_new(NvCtrlAttributeHandle *handle,
__xv_texture_sync_to_vblank_help,
NV_CTRL_ATTR_XV_TEXTURE_SYNC_TO_VBLANK,
__XV_TEXTURE_SYNC_TO_VBLANK);
+
+ ctk_xvideo->texture_brightness =
+ create_slider(ctk_xvideo, vbox, button, "Brightness",
+ __xv_texture_brightness_help,
+ NV_CTRL_ATTR_XV_TEXTURE_BRIGHTNESS,
+ __XV_TEXTURE_BRIGHTNESS);
+
+ ctk_xvideo->texture_contrast =
+ create_slider(ctk_xvideo, vbox, button, "Contrast",
+ __xv_texture_contrast_help,
+ NV_CTRL_ATTR_XV_TEXTURE_CONTRAST,
+ __XV_TEXTURE_CONTRAST);
+
}
/* XVideo Blitter */
@@ -706,11 +730,14 @@ static GtkWidget *create_slider(CtkXVideo *ctk_xvideo,
GtkWidget *scale, *widget;
gint min, max, val, step_incr, page_incr;
NVCTRLAttributeValidValuesRec range;
+ ReturnStatus ret;
/* get the attribute value */
- NvCtrlGetAttribute(ctk_xvideo->handle, attribute, &val);
-
+ ret = NvCtrlGetAttribute(ctk_xvideo->handle, attribute, &val);
+
+ if (ret != NvCtrlSuccess) return NULL;
+
/* get the range for the attribute */
NvCtrlGetValidAttributeValues(ctk_xvideo->handle, attribute, &range);
@@ -811,6 +838,9 @@ static void slider_changed(GtkAdjustment *adjustment, gpointer user_data)
case NV_CTRL_ATTR_XV_OVERLAY_CONTRAST: str = "Overlay Contrast"; break;
case NV_CTRL_ATTR_XV_OVERLAY_BRIGHTNESS: str = "Overlay Brightness"; break;
case NV_CTRL_ATTR_XV_OVERLAY_HUE: str = "Overlay Hue"; break;
+ case NV_CTRL_ATTR_XV_TEXTURE_CONTRAST: str = "Texture Contrast"; break;
+ case NV_CTRL_ATTR_XV_TEXTURE_BRIGHTNESS: str = "Texture Brightness"; break;
+
default:
return;
}
@@ -1006,6 +1036,12 @@ static void reset_defaults(GtkButton *button, gpointer user_data)
reset_check_button(ctk_xvideo, ctk_xvideo->texture_sync_to_blank,
NV_CTRL_ATTR_XV_TEXTURE_SYNC_TO_VBLANK);
+ reset_slider(ctk_xvideo, ctk_xvideo->texture_contrast,
+ NV_CTRL_ATTR_XV_TEXTURE_CONTRAST);
+
+ reset_slider(ctk_xvideo, ctk_xvideo->texture_brightness,
+ NV_CTRL_ATTR_XV_TEXTURE_BRIGHTNESS);
+
reset_check_button(ctk_xvideo, ctk_xvideo->blitter_sync_to_blank,
NV_CTRL_ATTR_XV_BLITTER_SYNC_TO_VBLANK);
@@ -1056,7 +1092,17 @@ GtkTextBuffer *ctk_xvideo_create_help(GtkTextTagTable *table,
ctk_help_heading(b, &i, "Video Texture Sync To VBlank");
ctk_help_para(b, &i, __xv_texture_sync_to_vblank_help);
}
-
+
+ if (ctk_xvideo->active_attributes & __XV_TEXTURE_CONTRAST) {
+ ctk_help_heading(b, &i, "Video Texture Contrast");
+ ctk_help_para(b, &i, __xv_texture_contrast_help);
+ }
+
+ if (ctk_xvideo->active_attributes & __XV_TEXTURE_BRIGHTNESS) {
+ ctk_help_heading(b, &i, "Video Texture Brightness");
+ ctk_help_para(b, &i, __xv_texture_brightness_help);
+ }
+
if (ctk_xvideo->active_attributes & __XV_BLITTER_SYNC_TO_VBLANK) {
ctk_help_heading(b, &i, "Video Blitter Sync To VBlank");
ctk_help_para(b, &i, __xv_blitter_sync_to_vblank_help);
diff --git a/src/gtk+-2.x/ctkxvideo.h b/src/gtk+-2.x/ctkxvideo.h
index 88a9e47..04f87f0 100644
--- a/src/gtk+-2.x/ctkxvideo.h
+++ b/src/gtk+-2.x/ctkxvideo.h
@@ -63,6 +63,8 @@ struct _CtkXVideo
GtkWidget *overlay_contrast;
GtkWidget *overlay_brightness;
GtkWidget *overlay_hue;
+ GtkWidget *texture_contrast;
+ GtkWidget *texture_brightness;
GtkWidget *texture_sync_to_blank;
GtkWidget *blitter_sync_to_blank;
GtkWidget *xv_sync_to_display_buttons[24];
diff --git a/src/libXNVCtrl/NVCtrl.h b/src/libXNVCtrl/NVCtrl.h
index ed882cf..a705c66 100644
--- a/src/libXNVCtrl/NVCtrl.h
+++ b/src/libXNVCtrl/NVCtrl.h
@@ -2804,12 +2804,15 @@
* initially, but allows them to migrate to video memory.
* NV_CTRL_INITIAL_PIXMAP_PLACEMENT_VIDMEM creates pixmaps in video memory
* when enough resources are available.
+ * NV_CTRL_INITIAL_PIXMAP_PLACEMENT_GPU_SYSMEM creates pixmaps in GPU accessible
+ * system memory when enough resources are available.
*/
#define NV_CTRL_INITIAL_PIXMAP_PLACEMENT 238 /* RW- */
#define NV_CTRL_INITIAL_PIXMAP_PLACEMENT_FORCE_SYSMEM 0
#define NV_CTRL_INITIAL_PIXMAP_PLACEMENT_SYSMEM 1
#define NV_CTRL_INITIAL_PIXMAP_PLACEMENT_VIDMEM 2
+#define NV_CTRL_INITIAL_PIXMAP_PLACEMENT_GPU_SYSMEM 4
/*
@@ -3059,7 +3062,41 @@
#define NV_CTRL_GVO_LOCK_OWNER_X_SCREEN 3
-#define NV_CTRL_LAST_ATTRIBUTE NV_CTRL_GVO_LOCK_OWNER
+/*
+ * NV_CTRL_HWOVERLAY - when a workstation overlay is in use, reports
+ * whether the hardware overlay is used, or if the overlay is emulated.
+ */
+
+#define NV_CTRL_HWOVERLAY 258 /* R-- */
+#define NV_CTRL_HWOVERLAY_FALSE 0
+#define NV_CTRL_HWOVERLAY_TRUE 1
+
+
+/*
+ * NV_CTRL_REFRESH_RATE_3 - Returns the refresh rate of the specified
+ * display device in 1000 * Hz (ie. to get the refresh rate in Hz, divide
+ * the returned value by 1000.)
+ *
+ * This attribute may be queried through XNVCTRLQueryTargetAttribute()
+ * using a NV_CTRL_TARGET_TYPE_GPU or NV_CTRL_TARGET_TYPE_X_SCREEN target.
+ */
+
+#define NV_CTRL_REFRESH_RATE_3 260 /* R-DG */
+
+
+/*
+ * NV_CTRL_ONDEMAND_VBLANK_INTERRUPTS - if the OnDemandVBlankInterrupts
+ * X driver option is set to true, this attribute can be used to
+ * determine if on-demand VBlank interrupt control is enabled on the
+ * specified GPU, as well as to enable or disable this feature.
+ */
+
+#define NV_CTRL_ONDEMAND_VBLANK_INTERRUPTS 261 /* RW-G */
+#define NV_CTRL_ONDEMAND_VBLANK_INTERRUPTS_OFF 0
+#define NV_CTRL_ONDEMAND_VBLANK_INTERRUPTS_ON 1
+
+
+#define NV_CTRL_LAST_ATTRIBUTE NV_CTRL_ONDEMAND_VBLANK_INTERRUPTS
/**************************************************************************/
@@ -3445,8 +3482,23 @@
#define NV_CTRL_STRING_TWINVIEW_XINERAMA_INFO_ORDER 27 /* RW-- */
+
+/*
+ * NV_CTRL_STRING_SLI_MODE - returns a string describing the current
+ * SLI mode, if any, or FALSE if SLI is not currently enabled.
+ *
+ * This string should be used for informational purposes only, and
+ * should not be used to distinguish between SLI modes, other than to
+ * recognize when SLI is disabled (FALSE is returned) or
+ * enabled (the returned string is non-NULL and describes the current
+ * SLI configuration).
+ */
+
+#define NV_CTRL_STRING_SLI_MODE 28 /* R---*/
+
+
#define NV_CTRL_STRING_LAST_ATTRIBUTE \
- NV_CTRL_STRING_TWINVIEW_XINERAMA_INFO_ORDER
+ NV_CTRL_STRING_SLI_MODE
/**************************************************************************/
diff --git a/src/libXNVCtrl/libXNVCtrl.a b/src/libXNVCtrl/libXNVCtrl.a
index cec7ec2..9f1eef0 100644
--- a/src/libXNVCtrl/libXNVCtrl.a
+++ b/src/libXNVCtrl/libXNVCtrl.a
Binary files differ
diff --git a/src/libXNVCtrlAttributes/NvCtrlAttributes.h b/src/libXNVCtrlAttributes/NvCtrlAttributes.h
index 372a956..0cd3edd 100644
--- a/src/libXNVCtrlAttributes/NvCtrlAttributes.h
+++ b/src/libXNVCtrlAttributes/NvCtrlAttributes.h
@@ -101,9 +101,12 @@ typedef void NvCtrlAttributeHandle;
#define NV_CTRL_ATTR_XV_OVERLAY_HUE (NV_CTRL_ATTR_XV_BASE + 3)
#define NV_CTRL_ATTR_XV_OVERLAY_SET_DEFAULTS (NV_CTRL_ATTR_XV_BASE + 4)
#define NV_CTRL_ATTR_XV_TEXTURE_SYNC_TO_VBLANK (NV_CTRL_ATTR_XV_BASE + 5)
-#define NV_CTRL_ATTR_XV_TEXTURE_SET_DEFAULTS (NV_CTRL_ATTR_XV_BASE + 6)
-#define NV_CTRL_ATTR_XV_BLITTER_SYNC_TO_VBLANK (NV_CTRL_ATTR_XV_BASE + 7)
-#define NV_CTRL_ATTR_XV_BLITTER_SET_DEFAULTS (NV_CTRL_ATTR_XV_BASE + 8)
+#define NV_CTRL_ATTR_XV_TEXTURE_CONTRAST (NV_CTRL_ATTR_XV_BASE + 6)
+#define NV_CTRL_ATTR_XV_TEXTURE_BRIGHTNESS (NV_CTRL_ATTR_XV_BASE + 7)
+#define NV_CTRL_ATTR_XV_TEXTURE_SET_DEFAULTS (NV_CTRL_ATTR_XV_BASE + 8)
+#define NV_CTRL_ATTR_XV_BLITTER_SYNC_TO_VBLANK (NV_CTRL_ATTR_XV_BASE + 9)
+#define NV_CTRL_ATTR_XV_BLITTER_SET_DEFAULTS (NV_CTRL_ATTR_XV_BASE + 10)
+
#define NV_CTRL_ATTR_XV_LAST_ATTRIBUTE \
(NV_CTRL_ATTR_XV_BLITTER_SET_DEFAULTS)
diff --git a/src/libXNVCtrlAttributes/NvCtrlAttributesPrivate.h b/src/libXNVCtrlAttributes/NvCtrlAttributesPrivate.h
index b7ba4cc..8072833 100644
--- a/src/libXNVCtrlAttributes/NvCtrlAttributesPrivate.h
+++ b/src/libXNVCtrlAttributes/NvCtrlAttributesPrivate.h
@@ -122,6 +122,8 @@ struct __NvCtrlXvOverlayAttributes {
struct __NvCtrlXvTextureAttributes {
unsigned int port;
NvCtrlXvAttribute *sync_to_vblank;
+ NvCtrlXvAttribute *contrast;
+ NvCtrlXvAttribute *brightness;
NvCtrlXvAttribute *defaults;
};
diff --git a/src/libXNVCtrlAttributes/NvCtrlAttributesXv.c b/src/libXNVCtrlAttributes/NvCtrlAttributesXv.c
index 1833038..c43b3e6 100644
--- a/src/libXNVCtrlAttributes/NvCtrlAttributesXv.c
+++ b/src/libXNVCtrlAttributes/NvCtrlAttributesXv.c
@@ -272,7 +272,7 @@ NvCtrlXvAttributes * NvCtrlInitXvAttributes(NvCtrlAttributePrivateHandle *h)
if (strcmp(ainfo[i].name, "NV17 Video Texture") == 0) {
NvCtrlXvTextureAttributes *attrs;
-
+
attrs = (NvCtrlXvTextureAttributes *)
malloc(sizeof(NvCtrlXvTextureAttributes));
if ( !attrs ) {
@@ -283,6 +283,10 @@ NvCtrlXvAttributes * NvCtrlInitXvAttributes(NvCtrlAttributePrivateHandle *h)
attrs->port = ainfo[i].base_id;
attrs->sync_to_vblank = getXvAttribute(h, attrs->port,
"XV_SYNC_TO_VBLANK");
+ attrs->contrast = getXvAttribute(h, attrs->port,
+ "XV_CONTRAST");
+ attrs->brightness = getXvAttribute(h, attrs->port,
+ "XV_BRIGHTNESS");
attrs->defaults = getXvAttribute(h, attrs->port,
"XV_SET_DEFAULTS");
if (!attrs->sync_to_vblank ||
@@ -551,21 +555,23 @@ static NvCtrlXvAttribute *getXvAttribute(NvCtrlAttributePrivateHandle *h,
static Bool checkAdaptor(NvCtrlAttributePrivateHandle *h,
unsigned int attribute)
{
+
switch(attribute) {
case NV_CTRL_ATTR_XV_OVERLAY_SATURATION:
case NV_CTRL_ATTR_XV_OVERLAY_CONTRAST:
case NV_CTRL_ATTR_XV_OVERLAY_BRIGHTNESS:
case NV_CTRL_ATTR_XV_OVERLAY_HUE:
- case NV_CTRL_ATTR_XV_OVERLAY_SET_DEFAULTS:
+ case NV_CTRL_ATTR_XV_OVERLAY_SET_DEFAULTS:
if (h && h->xv && h->xv->overlay) return True;
else return False;
-
+
case NV_CTRL_ATTR_XV_TEXTURE_SYNC_TO_VBLANK:
+ case NV_CTRL_ATTR_XV_TEXTURE_CONTRAST:
+ case NV_CTRL_ATTR_XV_TEXTURE_BRIGHTNESS:
case NV_CTRL_ATTR_XV_TEXTURE_SET_DEFAULTS:
if (h && h->xv && h->xv->texture) return True;
else return False;
-
case NV_CTRL_ATTR_XV_BLITTER_SYNC_TO_VBLANK:
case NV_CTRL_ATTR_XV_BLITTER_SET_DEFAULTS:
if (h && h->xv && h->xv->blitter) return True;
@@ -598,6 +604,8 @@ static unsigned int getXvPort(NvCtrlAttributePrivateHandle *h,
return h->xv->overlay->port;
case NV_CTRL_ATTR_XV_TEXTURE_SYNC_TO_VBLANK:
+ case NV_CTRL_ATTR_XV_TEXTURE_CONTRAST:
+ case NV_CTRL_ATTR_XV_TEXTURE_BRIGHTNESS:
case NV_CTRL_ATTR_XV_TEXTURE_SET_DEFAULTS:
return h->xv->texture->port;
@@ -639,12 +647,18 @@ static NvCtrlXvAttribute *getXvAttributePtr(NvCtrlAttributePrivateHandle *h,
case NV_CTRL_ATTR_XV_TEXTURE_SYNC_TO_VBLANK:
return h->xv->texture->sync_to_vblank;
+ case NV_CTRL_ATTR_XV_TEXTURE_CONTRAST:
+ return h->xv->texture->contrast;
+
+ case NV_CTRL_ATTR_XV_TEXTURE_BRIGHTNESS:
+ return h->xv->texture->brightness;
+
case NV_CTRL_ATTR_XV_BLITTER_SYNC_TO_VBLANK:
return h->xv->blitter->sync_to_vblank;
case NV_CTRL_ATTR_XV_OVERLAY_SET_DEFAULTS:
return h->xv->overlay->defaults;
-
+
case NV_CTRL_ATTR_XV_TEXTURE_SET_DEFAULTS:
return h->xv->texture->defaults;
diff --git a/src/parse.c b/src/parse.c
index 381bbad..4b12e23 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -60,6 +60,7 @@ static char *nv_strndup(char *s, int n);
#define A NV_PARSER_TYPE_NO_QUERY_ALL
#define Z NV_PARSER_TYPE_NO_ZERO_VALUE
#define H NV_PARSER_TYPE_100Hz
+#define K NV_PARSER_TYPE_1000Hz
#define S NV_PARSER_TYPE_STRING_ATTRIBUTE
AttributeTableEntry attributeTable[] = {
@@ -83,6 +84,7 @@ AttributeTableEntry attributeTable[] = {
{ "TextureSharpen", NV_CTRL_TEXTURE_SHARPEN, 0 },
{ "Ubb", NV_CTRL_UBB, 0 },
{ "Overlay", NV_CTRL_OVERLAY, 0 },
+ { "HWOverlay", NV_CTRL_HWOVERLAY, 0 },
{ "Stereo", NV_CTRL_STEREO, 0 },
{ "TwinView", NV_CTRL_TWINVIEW, 0 },
{ "ConnectedDisplays", NV_CTRL_CONNECTED_DISPLAYS, 0 },
@@ -102,6 +104,7 @@ AttributeTableEntry attributeTable[] = {
{ "FSAAAppControlled", NV_CTRL_FSAA_APPLICATION_CONTROLLED, 0 },
{ "LogAnisoAppControlled", NV_CTRL_LOG_ANISO_APPLICATION_CONTROLLED,0 },
{ "RefreshRate", NV_CTRL_REFRESH_RATE, N|H },
+ { "RefreshRate3", NV_CTRL_REFRESH_RATE_3, N|K },
{ "InitialPixmapPlacement",NV_CTRL_INITIAL_PIXMAP_PLACEMENT, N },
{ "PCIBus", NV_CTRL_PCI_BUS, N },
{ "PCIDevice", NV_CTRL_PCI_DEVICE, N },
@@ -116,6 +119,7 @@ AttributeTableEntry attributeTable[] = {
{ "GPUScalingActive", NV_CTRL_GPU_SCALING_ACTIVE, N },
{ "DFPScalingActive", NV_CTRL_DFP_SCALING_ACTIVE, N },
{ "FSAAAppEnhanced", NV_CTRL_FSAA_APPLICATION_ENHANCED, 0 },
+ { "OnDemandVBlankInterrupts", NV_CTRL_ONDEMAND_VBLANK_INTERRUPTS, 0 },
{ "FrameLockMaster", NV_CTRL_FRAMELOCK_MASTER, N|F|G|D },
{ "FrameLockSlaves", NV_CTRL_FRAMELOCK_SLAVES, N|F|G|D },
@@ -188,6 +192,8 @@ AttributeTableEntry attributeTable[] = {
{ "XVideoOverlayContrast", NV_CTRL_ATTR_XV_OVERLAY_CONTRAST, V },
{ "XVideoOverlayBrightness", NV_CTRL_ATTR_XV_OVERLAY_BRIGHTNESS, V },
{ "XVideoOverlayHue", NV_CTRL_ATTR_XV_OVERLAY_HUE, V },
+ { "XVideoTextureBrightness", NV_CTRL_ATTR_XV_TEXTURE_BRIGHTNESS, V },
+ { "XVideoTextureContrast", NV_CTRL_ATTR_XV_TEXTURE_CONTRAST, V },
{ "XVideoTextureSyncToVBlank", NV_CTRL_ATTR_XV_TEXTURE_SYNC_TO_VBLANK, V },
{ "XVideoBlitterSyncToVBlank", NV_CTRL_ATTR_XV_BLITTER_SYNC_TO_VBLANK, V },
{ "XVideoSyncToDisplay", NV_CTRL_XV_SYNC_TO_DISPLAY, D|Z },
@@ -207,6 +213,7 @@ AttributeTableEntry attributeTable[] = {
{ "XRandRVersion", NV_CTRL_STRING_XRANDR_VERSION, S|N },
{ "XF86VidModeVersion", NV_CTRL_STRING_XF86VIDMODE_VERSION, S|N },
{ "XvVersion", NV_CTRL_STRING_XV_VERSION, S|N },
+ { "SLIMode", NV_CTRL_STRING_SLI_MODE, S|N },
{ NULL, 0, 0 }
};
@@ -221,6 +228,7 @@ AttributeTableEntry attributeTable[] = {
#undef A
#undef Z
#undef H
+#undef K
#undef S
/*
@@ -230,7 +238,7 @@ AttributeTableEntry attributeTable[] = {
* about.
*/
-#if NV_CTRL_LAST_ATTRIBUTE != NV_CTRL_GVO_LOCK_OWNER
+#if NV_CTRL_LAST_ATTRIBUTE != NV_CTRL_ONDEMAND_VBLANK_INTERRUPTS
#warning "Have you forgotten to add a new integer attribute to attributeTable?"
#endif
diff --git a/src/parse.h b/src/parse.h
index b4bb8e1..8a596bd 100644
--- a/src/parse.h
+++ b/src/parse.h
@@ -43,18 +43,19 @@
* Flag values used in the flags field of the AttributeTableEntry struct.
*/
-#define NV_PARSER_TYPE_FRAMELOCK (1<<16)
-#define NV_PARSER_TYPE_COLOR_ATTRIBUTE (1<<17)
-#define NV_PARSER_TYPE_NO_CONFIG_WRITE (1<<18)
-#define NV_PARSER_TYPE_GUI_ATTRIUBUTE (1<<19)
-#define NV_PARSER_TYPE_XVIDEO_ATTRIBUTE (1<<20)
-#define NV_PARSER_TYPE_PACKED_ATTRIBUTE (1<<21)
-#define NV_PARSER_TYPE_VALUE_IS_DISPLAY (1<<22)
-#define NV_PARSER_TYPE_NO_QUERY_ALL (1<<23)
-#define NV_PARSER_TYPE_NO_ZERO_VALUE (1<<24)
-#define NV_PARSER_TYPE_100Hz (1<<25)
-#define NV_PARSER_TYPE_STRING_ATTRIBUTE (1<<26)
-#define NV_PARSER_TYPE_ASSIGN_ALL_DISPLAYS (1<<27)
+#define NV_PARSER_TYPE_FRAMELOCK (1<<16)
+#define NV_PARSER_TYPE_COLOR_ATTRIBUTE (1<<17)
+#define NV_PARSER_TYPE_NO_CONFIG_WRITE (1<<18)
+#define NV_PARSER_TYPE_GUI_ATTRIUBUTE (1<<19)
+#define NV_PARSER_TYPE_XVIDEO_ATTRIBUTE (1<<20)
+#define NV_PARSER_TYPE_PACKED_ATTRIBUTE (1<<21)
+#define NV_PARSER_TYPE_VALUE_IS_DISPLAY (1<<22)
+#define NV_PARSER_TYPE_NO_QUERY_ALL (1<<23)
+#define NV_PARSER_TYPE_NO_ZERO_VALUE (1<<24)
+#define NV_PARSER_TYPE_100Hz (1<<25)
+#define NV_PARSER_TYPE_STRING_ATTRIBUTE (1<<26)
+#define NV_PARSER_TYPE_ASSIGN_ALL_DISPLAYS (1<<27)
+#define NV_PARSER_TYPE_1000Hz (1<<28)
#define NV_PARSER_ASSIGNMENT 0
#define NV_PARSER_QUERY 1
diff --git a/src/query-assign.c b/src/query-assign.c
index c9faa91..2a490ef 100644
--- a/src/query-assign.c
+++ b/src/query-assign.c
@@ -755,6 +755,8 @@ static void print_queried_value(CtrlHandleTarget *t,
if (flags & NV_PARSER_TYPE_100Hz) {
snprintf(val_str, 64, "%.2f Hz", ((float) val) / 100.0);
+ } else if (flags & NV_PARSER_TYPE_1000Hz) {
+ snprintf(val_str, 64, "%.3f Hz", ((float) val) / 1000.0);
} else if (v->type == ATTRIBUTE_TYPE_BITMASK) {
snprintf(val_str, 64, "0x%08x", val);
} else if (flags & NV_PARSER_TYPE_PACKED_ATTRIBUTE) {