summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Plattner <aplattner@nvidia.com>2012-10-18 12:37:20 -0700
committerAaron Plattner <aplattner@nvidia.com>2012-10-18 12:37:20 -0700
commit32571903953df7c0447aea6483e5a384afa014a0 (patch)
treef5d917400c1968e333e852a86e3726acb63427da
parenta7ffe49011b002706153eea1690383f0958739c8 (diff)
304.60304.60
-rw-r--r--doc/version.mk2
-rw-r--r--samples/version.mk2
-rw-r--r--src/config-file.c69
-rw-r--r--src/gtk+-2.x/ctkdisplayconfig.c24
-rw-r--r--src/gtk+-2.x/ctkdisplaydevice.c13
-rw-r--r--src/gtk+-2.x/ctkdisplaydevice.h3
-rw-r--r--src/gtk+-2.x/ctkecc.c94
-rw-r--r--src/gtk+-2.x/ctkecc.h1
-rw-r--r--src/gtk+-2.x/ctkevent.c4
-rw-r--r--src/gtk+-2.x/ctkgpu.c106
-rw-r--r--src/gtk+-2.x/ctkgpu.h5
-rw-r--r--src/gtk+-2.x/ctkmultisample.c8
-rw-r--r--src/gtk+-2.x/ctkscreen.c66
-rw-r--r--src/gtk+-2.x/ctkwindow.c38
-rw-r--r--src/libXNVCtrl/NVCtrl.h22
-rw-r--r--src/libXNVCtrlAttributes/NvCtrlAttributes.c11
-rw-r--r--src/libXNVCtrlAttributes/NvCtrlAttributesPrivate.h7
-rw-r--r--src/libXNVCtrlAttributes/NvCtrlAttributesXrandr.c7
-rw-r--r--src/parse.c4
-rw-r--r--src/version.mk2
-rw-r--r--utils.mk9
-rw-r--r--version.mk2
22 files changed, 357 insertions, 142 deletions
diff --git a/doc/version.mk b/doc/version.mk
index 2335952..3fda853 100644
--- a/doc/version.mk
+++ b/doc/version.mk
@@ -1 +1 @@
-NVIDIA_VERSION = 304.51
+NVIDIA_VERSION = 304.60
diff --git a/samples/version.mk b/samples/version.mk
index 2335952..3fda853 100644
--- a/samples/version.mk
+++ b/samples/version.mk
@@ -1 +1 @@
-NVIDIA_VERSION = 304.51
+NVIDIA_VERSION = 304.60
diff --git a/src/config-file.c b/src/config-file.c
index a267a1c..e68da50 100644
--- a/src/config-file.c
+++ b/src/config-file.c
@@ -211,7 +211,7 @@ int nv_read_config_file(const char *file, const char *display_name,
int nv_write_config_file(const char *filename, CtrlHandles *h,
ParsedAttribute *p, ConfigProperties *conf)
{
- int screen, ret, entry, bit, val;
+ int screen, ret, entry, bit, val, display, randr_gamma_available;
FILE *stream;
time_t now;
AttributeTableEntry *a;
@@ -272,8 +272,8 @@ int nv_write_config_file(const char *filename, CtrlHandles *h,
fprintf(stream, "\n");
/*
- * Note: we only save writable attributes addressable by X screen
- * (i.e., we don't look at other target types, yet).
+ * Note: we only save writable attributes addressable by X screen here
+ * followed by attributes for display target types.
*/
for (screen = 0; screen < h->targets[X_SCREEN_TARGET].n; screen++) {
@@ -387,6 +387,69 @@ int nv_write_config_file(const char *filename, CtrlHandles *h,
} /* entry */
} /* screen */
+
+ /*
+ * Write attributes addresssable to display targets
+ */
+
+ for (display = 0; display < h->targets[DISPLAY_TARGET].n; display++) {
+
+ t = &h->targets[DISPLAY_TARGET].t[display];
+
+ /* skip it if we don't have a handle for this display */
+
+ if (!t->h) continue;
+
+ /*
+ * check to see if we have RANDR gamma available. We may
+ * skip writing attributes if it is missing.
+ */
+
+ status = NvCtrlGetAttribute(t->h,
+ NV_CTRL_ATTR_RANDR_GAMMA_AVAILABLE,
+ &randr_gamma_available);
+ if (status != NvCtrlSuccess) {
+ randr_gamma_available = 0;
+ }
+
+ /*
+ * use the full display name as the prefix for display targets
+ * until we can parse other display target names
+ */
+
+ prefix = t->name;
+
+ /* loop over all the entries in the table */
+
+ for (entry = 0; attributeTable[entry].name; entry++) {
+
+ a = &attributeTable[entry];
+
+ /*
+ * skip all attributes that are not supposed to be written
+ * to the config file
+ */
+
+ if (a->flags & NV_PARSER_TYPE_NO_CONFIG_WRITE) continue;
+
+ /*
+ * for the display target we only write color attributes for now
+ */
+
+ if (a->flags & NV_PARSER_TYPE_COLOR_ATTRIBUTE) {
+ float c[3], b[3], g[3];
+
+ if (!randr_gamma_available) continue;
+
+ status = NvCtrlGetColorAttributes(t->h, c, b, g);
+ if (status != NvCtrlSuccess) continue;
+
+ fprintf(stream, "%s%c%s=%f\n",
+ prefix, DISPLAY_NAME_SEPARATOR, a->name,
+ get_color_value(a->attr, c, b, g));
+ }
+ }
+ }
/*
* loop the ParsedAttribute list, writing the attributes to file.
diff --git a/src/gtk+-2.x/ctkdisplayconfig.c b/src/gtk+-2.x/ctkdisplayconfig.c
index 8111aa1..e3908a7 100644
--- a/src/gtk+-2.x/ctkdisplayconfig.c
+++ b/src/gtk+-2.x/ctkdisplayconfig.c
@@ -159,7 +159,7 @@ static int __position_table[] = { CONF_ADJ_ABSOLUTE,
/* Layout tooltips */
static const char * __layout_hidden_label_help =
-"To select a display, use the \"Model\" dropdown menu.";
+"To select a display, use the \"Selection\" dropdown menu.";
static const char * __layout_xinerama_button_help =
"The Enable Xinerama checkbox enables the Xinerama X extension; changing "
@@ -232,19 +232,19 @@ static const char * __screen_stereo_help =
"screen; changing this option will require restarting your X server.";
static const char * __screen_position_type_help =
-"The Position Type drop-down appears when two or more display devices are active. "
+"The Position Type drop-down appears when two or more X screens are active. "
"This allows you to set how the selected screen "
"is placed within the X server layout; changing this option will require "
"restarting your X server.";
static const char * __screen_position_relative_help =
-"The Position Relative drop-down appears when two or more display devices "
+"The Position Relative drop-down appears when two or more X screens "
"are active. This allows you to set which other Screen "
"the selected screen should be relative to; changing this option will "
"require restarting your X server.";
static const char * __screen_position_offset_help =
-"The Position Offset drop-down appears when two or more display devices "
+"The Position Offset drop-down appears when two or more X screens "
"are active. This identifies the top left of the selected Screen as "
"an offset from the top left of the X server layout in absolute coordinates; "
"changing this option will require restarting your X server.";
@@ -2036,11 +2036,10 @@ GtkTextBuffer *ctk_display_config_create_help(GtkTextTagTable *table,
ctk_help_para(b, &i, __selected_item_help);
ctk_help_para(b, &i, "");
- ctk_help_heading(b, &i, "Display Section");
- ctk_help_para(b, &i, "This section shows information and configuration "
- "settings for the currently selected display device.");
- ctk_help_heading(b, &i, "Model");
- ctk_help_para(b, &i, "The Model name is the name of the display device.");
+ ctk_help_heading(b, &i, "Display Options");
+ ctk_help_para(b, &i, "The following options are available when a display "
+ "device is selected in the Selection drop-down to configure "
+ "the settings for that display device.");
ctk_help_heading(b, &i, "Resolution");
ctk_help_para(b, &i, __dpy_resolution_mnu_help);
ctk_help_heading(b, &i, "Refresh");
@@ -2064,9 +2063,10 @@ GtkTextBuffer *ctk_display_config_create_help(GtkTextTagTable *table,
ctk_help_para(b, &i, "");
- ctk_help_heading(b, &i, "X Screen Section");
- ctk_help_para(b, &i, "This section shows information and configuration "
- "settings for the currently selected X screen.");
+ ctk_help_heading(b, &i, "X Screen Options");
+ ctk_help_para(b, &i, "The following options are available when an X "
+ "screen is selected in the Selection drop-down to configure "
+ "the settings for that X screen.");
ctk_help_heading(b, &i, "Virtual Size");
ctk_help_para(b, &i, "%s The Virtual screen size must be at least "
"304x200, and the width must be a multiple of 8.",
diff --git a/src/gtk+-2.x/ctkdisplaydevice.c b/src/gtk+-2.x/ctkdisplaydevice.c
index 40a3ea4..79e177f 100644
--- a/src/gtk+-2.x/ctkdisplaydevice.c
+++ b/src/gtk+-2.x/ctkdisplaydevice.c
@@ -70,7 +70,8 @@ static void unregister_refresh_rate_events(InfoEntry *entry);
static void add_color_correction_tab(CtkDisplayDevice *ctk_object,
CtkConfig *ctk_config,
CtkEvent *ctk_event,
- GtkWidget *notebook);
+ GtkWidget *notebook,
+ ParsedAttribute *p);
#define FRAME_PADDING 5
@@ -220,7 +221,8 @@ GtkWidget* ctk_display_device_new(NvCtrlAttributeHandle *handle,
CtkEvent *ctk_event,
CtkEvent *ctk_event_gpu,
char *name,
- char *typeBaseName)
+ char *typeBaseName,
+ ParsedAttribute *p)
{
GObject *object;
CtkDisplayDevice *ctk_object;
@@ -415,7 +417,7 @@ GtkWidget* ctk_display_device_new(NvCtrlAttributeHandle *handle,
/* add the color correction tab if RandR is available */
- add_color_correction_tab(ctk_object, ctk_config, ctk_event, notebook);
+ add_color_correction_tab(ctk_object, ctk_config, ctk_event, notebook, p);
/* Update the GUI */
@@ -864,7 +866,8 @@ static void callback_refresh_rate_changed(GtkObject *object, gpointer arg1,
static void add_color_correction_tab(CtkDisplayDevice *ctk_object,
CtkConfig *ctk_config,
CtkEvent *ctk_event,
- GtkWidget *notebook)
+ GtkWidget *notebook,
+ ParsedAttribute *p)
{
ReturnStatus ret;
gint val;
@@ -884,7 +887,7 @@ static void add_color_correction_tab(CtkDisplayDevice *ctk_object,
ctk_color_correction = ctk_color_correction_new(ctk_object->handle,
ctk_config,
- NULL /* ParsedAttribute*/,
+ p,
ctk_event);
if (ctk_color_correction == NULL) {
return;
diff --git a/src/gtk+-2.x/ctkdisplaydevice.h b/src/gtk+-2.x/ctkdisplaydevice.h
index 402450f..0715bc8 100644
--- a/src/gtk+-2.x/ctkdisplaydevice.h
+++ b/src/gtk+-2.x/ctkdisplaydevice.h
@@ -90,7 +90,8 @@ struct _CtkDisplayDeviceClass
GType ctk_display_device_get_type (void) G_GNUC_CONST;
GtkWidget* ctk_display_device_new (NvCtrlAttributeHandle *,
CtkConfig *, CtkEvent *,
- CtkEvent *, char *, char *);
+ CtkEvent *, char *, char *,
+ ParsedAttribute *);
GtkTextBuffer *ctk_display_device_create_help(GtkTextTagTable *,
CtkDisplayDevice *);
diff --git a/src/gtk+-2.x/ctkecc.c b/src/gtk+-2.x/ctkecc.c
index d6f0c3f..05525c4 100644
--- a/src/gtk+-2.x/ctkecc.c
+++ b/src/gtk+-2.x/ctkecc.c
@@ -66,9 +66,9 @@ 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_set_config_status(CtkEcc *);
static void ecc_configuration_update_received(GtkObject *, gpointer, gpointer);
-static void post_ecc_configuration_update(CtkEcc *, gboolean);
+static void post_ecc_configuration_update(CtkEcc *);
GType ctk_ecc_get_type(void)
{
@@ -192,26 +192,38 @@ static gboolean update_ecc_info(gpointer user_data)
* post_ecc_configuration_update() - this function update status bar string.
*/
-static void post_ecc_configuration_update(CtkEcc *ctk_ecc, gboolean enabled)
+static void post_ecc_configuration_update(CtkEcc *ctk_ecc)
{
- ctk_config_statusbar_message(ctk_ecc->ctk_config,
- "ECC %s.",
- enabled ? "enabled" : "disabled");
+ gboolean configured = ctk_ecc->ecc_configured;
+ gboolean enabled = ctk_ecc->ecc_enabled;
+
+ const char *conf_string = configured ? "enabled" : "disabled";
+ char message[128];
+
+ if (configured != enabled) {
+ snprintf(message, sizeof(message), "ECC will be %s after reboot.",
+ conf_string);
+ } else {
+ snprintf(message, sizeof(message), "ECC %s.", conf_string);
+ }
+
+ ctk_config_statusbar_message(ctk_ecc->ctk_config, message);
} /* post_ecc_configuration_update() */
/*
- * ecc_set_config_status() - set ECC configuration button status
+ * ecc_set_config_status() - set ECC configuration button status: caller
+ * should make sure ctk_ecc->ecc_configured is set correctly before calling.
*/
-static void ecc_set_config_status(CtkEcc *ctk_ecc, gboolean value)
+static void ecc_set_config_status(CtkEcc *ctk_ecc)
{
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);
+ ctk_ecc->ecc_configured);
g_signal_handlers_unblock_by_func(G_OBJECT(ctk_ecc->configuration_status),
G_CALLBACK(ecc_config_button_toggled),
@@ -231,12 +243,14 @@ static void ecc_configuration_update_received(GtkObject *object,
{
CtkEventStruct *event_struct = (CtkEventStruct *) arg1;
CtkEcc *ctk_ecc = CTK_ECC(user_data);
-
+
+ ctk_ecc->ecc_configured = event_struct->value;
+
/* set ECC configuration buttion status */
- ecc_set_config_status(ctk_ecc, event_struct->value);
+ ecc_set_config_status(ctk_ecc);
/* Update status bar message */
- post_ecc_configuration_update(ctk_ecc, event_struct->value);
+ post_ecc_configuration_update(ctk_ecc);
}
@@ -250,18 +264,31 @@ static void reset_default_config_button_clicked(GtkWidget *widget,
gpointer user_data)
{
gboolean status;
+ ReturnStatus ret;
CtkEcc *ctk_ecc = CTK_ECC(user_data);
/* get default status and set it to ECC configuration */
- NvCtrlGetAttribute(ctk_ecc->handle,
- NV_CTRL_GPU_ECC_DEFAULT_CONFIGURATION,
- &status);
- NvCtrlSetAttribute(ctk_ecc->handle,
- NV_CTRL_GPU_ECC_CONFIGURATION,
- status);
+ ret = NvCtrlGetAttribute(ctk_ecc->handle,
+ NV_CTRL_GPU_ECC_DEFAULT_CONFIGURATION,
+ &status);
+ if (ret != NvCtrlSuccess) {
+ ctk_config_statusbar_message(ctk_ecc->ctk_config,
+ "Failed to get default configuration!");
+ return;
+ }
+ ret = NvCtrlSetAttribute(ctk_ecc->handle,
+ NV_CTRL_GPU_ECC_CONFIGURATION,
+ status);
+ if (ret != NvCtrlSuccess) {
+ ctk_config_statusbar_message(ctk_ecc->ctk_config,
+ "Failed to set default configuration!");
+ return;
+ }
+
+ ctk_ecc->ecc_configured = status;
/* update ECC configuration button status */
- ecc_set_config_status(ctk_ecc, status);
+ ecc_set_config_status(ctk_ecc);
/* show popup dialog*/
show_ecc_toggle_warning_dlg(ctk_ecc);
@@ -348,20 +375,29 @@ static void ecc_config_button_toggled(GtkWidget *widget,
{
gboolean enabled;
CtkEcc *ctk_ecc = CTK_ECC(user_data);
+ ReturnStatus ret;
+
enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
/* show popup dialog when user first time click ECC config */
show_ecc_toggle_warning_dlg(ctk_ecc);
/* set the newly specified ECC value */
- NvCtrlSetAttribute(ctk_ecc->handle,
- NV_CTRL_GPU_ECC_CONFIGURATION,
- enabled);
+ ret = NvCtrlSetAttribute(ctk_ecc->handle,
+ NV_CTRL_GPU_ECC_CONFIGURATION,
+ enabled);
+ if (ret != NvCtrlSuccess) {
+ ctk_config_statusbar_message(ctk_ecc->ctk_config,
+ "Failed to set ECC configuration!");
+ return;
+ }
+
+ ctk_ecc->ecc_configured = enabled;
gtk_widget_set_sensitive(ctk_ecc->reset_default_config_button, TRUE);
/* Update status bar message */
- post_ecc_configuration_update(ctk_ecc, enabled);
+ post_ecc_configuration_update(ctk_ecc);
} /* ecc_config_button_toggled() */
@@ -428,6 +464,16 @@ GtkWidget* ctk_ecc_new(NvCtrlAttributeHandle *handle,
}
ctk_ecc->ecc_enabled = ecc_enabled;
+ /* Query ECC Configuration */
+
+ ret = NvCtrlGetAttribute(handle, NV_CTRL_GPU_ECC_CONFIGURATION, &val);
+ if (ret != NvCtrlSuccess ||
+ val == NV_CTRL_GPU_ECC_CONFIGURATION_DISABLED) {
+ ctk_ecc->ecc_configured = FALSE;
+ } else {
+ ctk_ecc->ecc_configured = TRUE;
+ }
+
/* get default status */
ret = NvCtrlGetAttribute(handle,
NV_CTRL_GPU_ECC_DEFAULT_CONFIGURATION,
@@ -547,7 +593,7 @@ GtkWidget* ctk_ecc_new(NvCtrlAttributeHandle *handle,
gtk_container_set_border_width(GTK_CONTAINER(hbox2), 5);
gtk_box_pack_start(GTK_BOX(vbox), hbox2, FALSE, FALSE, 0);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ctk_ecc->configuration_status),
- ecc_enabled);
+ ctk_ecc->ecc_configured);
ctk_config_set_tooltip(ctk_config, ctk_ecc->configuration_status,
__configuration_status_help);
g_signal_connect(G_OBJECT(ctk_ecc->configuration_status), "clicked",
diff --git a/src/gtk+-2.x/ctkecc.h b/src/gtk+-2.x/ctkecc.h
index b4706f9..1f5c7a4 100644
--- a/src/gtk+-2.x/ctkecc.h
+++ b/src/gtk+-2.x/ctkecc.h
@@ -64,6 +64,7 @@ struct _CtkEcc
GtkWidget* configuration_status;
gboolean ecc_enabled;
+ gboolean ecc_configured;
gboolean ecc_toggle_warning_dlg_shown;
gboolean dbit_error_available;
gboolean aggregate_dbit_error_available;
diff --git a/src/gtk+-2.x/ctkevent.c b/src/gtk+-2.x/ctkevent.c
index 6903af0..32b0b81 100644
--- a/src/gtk+-2.x/ctkevent.c
+++ b/src/gtk+-2.x/ctkevent.c
@@ -327,6 +327,8 @@ static void ctk_event_class_init(CtkEventClass *ctk_event_class)
MAKE_SIGNAL(NV_CTRL_FRAMELOCK_INCOMING_HOUSE_SYNC_RATE);
MAKE_SIGNAL(NV_CTRL_FXAA);
MAKE_SIGNAL(NV_CTRL_DISPLAY_RANDR_OUTPUT_ID);
+ MAKE_SIGNAL(NV_CTRL_TOTAL_DEDICATED_GPU_MEMORY);
+ MAKE_SIGNAL(NV_CTRL_USED_DEDICATED_GPU_MEMORY);
#undef MAKE_SIGNAL
/*
@@ -336,7 +338,7 @@ static void ctk_event_class_init(CtkEventClass *ctk_event_class)
* knows about.
*/
-#if NV_CTRL_LAST_ATTRIBUTE != NV_CTRL_DISPLAY_RANDR_OUTPUT_ID
+#if NV_CTRL_LAST_ATTRIBUTE != NV_CTRL_USED_DEDICATED_GPU_MEMORY
#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 929b1c4..7f4a1b7 100644
--- a/src/gtk+-2.x/ctkgpu.c
+++ b/src/gtk+-2.x/ctkgpu.c
@@ -35,7 +35,10 @@
static void probe_displays_received(GtkObject *object, gpointer arg1,
gpointer user_data);
+static gboolean update_gpu_memory_used(gpointer);
+
#define ARRAY_ELEMENTS 16
+#define DEFAULT_UPDATE_GPU_INFO_TIME_INTERVAL 3000
GType ctk_gpu_get_type(
void
@@ -188,7 +191,7 @@ GtkWidget* ctk_gpu_new(
GtkWidget *hseparator;
GtkWidget *table;
- char *product_name, *vbios_version, *video_ram, *irq;
+ char *product_name, *vbios_version, *video_ram, *gpu_memory_text, *irq;
gchar *pci_bus_id;
gchar pci_device_id[ARRAY_ELEMENTS];
gchar pci_vendor_id[ARRAY_ELEMENTS];
@@ -212,7 +215,8 @@ GtkWidget* ctk_gpu_new(
int len;
int i;
int row = 0;
- int total_rows = 19;
+ int total_rows = 21;
+ int gpu_memory;
/*
@@ -268,6 +272,16 @@ GtkWidget* ctk_gpu_new(
} else {
video_ram = g_strdup_printf("%d MB", tmp >> 10);
}
+
+ /* NV_CTRL_TOTAL_DEDICATED_GPU_MEMORY */
+
+ ret = NvCtrlGetAttribute(handle, NV_CTRL_TOTAL_DEDICATED_GPU_MEMORY,
+ &gpu_memory);
+ if (ret != NvCtrlSuccess) {
+ gpu_memory_text = NULL;
+ } else {
+ gpu_memory_text = g_strdup_printf("%d MB", gpu_memory);
+ }
/* NV_CTRL_GPU_CORES */
@@ -363,6 +377,7 @@ GtkWidget* ctk_gpu_new(
ctk_gpu->ctk_config = ctk_config;
ctk_gpu->ctk_event = ctk_event;
ctk_gpu->pcie_gen_queriable = FALSE;
+ ctk_gpu->gpu_memory = gpu_memory;
/* set container properties of the object */
@@ -424,8 +439,16 @@ GtkWidget* ctk_gpu_new(
0, 0.5, "VBIOS Version:",
0, 0.5, vbios_version);
add_table_row(table, row++,
- 0, 0.5, "Memory:",
+ 0, 0.5, "Total Memory:",
0, 0.5, video_ram);
+ add_table_row(table, row++,
+ 0, 0.5, "Total Dedicated Memory:",
+ 0, 0.5, gpu_memory_text);
+ ctk_gpu->gpu_memory_used_label =
+ add_table_row(table, row++,
+ 0, 0.5, "Used Dedicated Memory:",
+ 0, 0.5, NULL);
+ update_gpu_memory_used(ctk_gpu);
if ( ctk_gpu->memory_interface ) {
gtk_table_resize(GTK_TABLE(table), ++total_rows, 2);
add_table_row(table, row++,
@@ -491,6 +514,7 @@ GtkWidget* ctk_gpu_new(
g_free(screens);
g_free(displays);
g_free(bus);
+ g_free(gpu_memory_text);
gtk_widget_show_all(GTK_WIDGET(object));
@@ -501,6 +525,16 @@ GtkWidget* ctk_gpu_new(
G_CALLBACK(probe_displays_received),
(gpointer) ctk_gpu);
+ tmp_str = g_strdup_printf("Memory Used (GPU %d)",
+ NvCtrlGetTargetId(handle));
+
+ ctk_config_add_timer(ctk_gpu->ctk_config,
+ DEFAULT_UPDATE_GPU_INFO_TIME_INTERVAL,
+ tmp_str,
+ (GSourceFunc) update_gpu_memory_used,
+ (gpointer) ctk_gpu);
+ g_free(tmp_str);
+
return GTK_WIDGET(object);
}
@@ -534,7 +568,7 @@ GtkTextBuffer *ctk_gpu_create_help(GtkTextTagTable *table,
ctk_help_heading(b, &i, "VBIOS Version");
ctk_help_para(b, &i, "This is the Video BIOS version.");
- ctk_help_heading(b, &i, "Memory");
+ ctk_help_heading(b, &i, "Total Memory");
ctk_help_para(b, &i, "This is the overall amount of memory "
"available to your GPU. With TurboCache(TM) GPUs, "
"this value may exceed the amount of video "
@@ -543,6 +577,14 @@ GtkTextBuffer *ctk_gpu_create_help(GtkTextTagTable *table,
"dedicated system memory set aside by the system "
"BIOS for use by the integrated GPU.");
+ ctk_help_heading(b, &i, "Total Dedicated Memory");
+ ctk_help_para(b, &i, "This is the amount of memory dedicated "
+ "exclusively to your GPU.");
+
+ ctk_help_heading(b, &i, "Used Dedicated Memory");
+ ctk_help_para(b, &i, "This is the amount of dedicated memory used "
+ "by your GPU.");
+
if (ctk_gpu->memory_interface) {
ctk_help_heading(b, &i, "Memory Interface");
ctk_help_para(b, &i, "This is the bus bandwidth of the GPU's "
@@ -622,4 +664,60 @@ static void probe_displays_received(GtkObject *object, gpointer arg1,
g_free(str);
}
+static gboolean update_gpu_memory_used(gpointer user_data)
+{
+ CtkGpu *ctk_gpu;
+ gchar *memory_text;
+ ReturnStatus ret;
+ int value;
+ static int num_failures = 0;
+
+ ctk_gpu = CTK_GPU(user_data);
+
+ ret = NvCtrlGetAttribute(ctk_gpu->handle,
+ NV_CTRL_USED_DEDICATED_GPU_MEMORY,
+ &value);
+ if (ret != NvCtrlSuccess || value > ctk_gpu->gpu_memory || value < 0) {
+ gtk_label_set_text(GTK_LABEL(ctk_gpu->gpu_memory_used_label), "Unknown");
+ if(num_failures++ >= 10) {
+ return FALSE;
+ }
+ } else {
+ if (ctk_gpu->gpu_memory > 0) {
+ memory_text = g_strdup_printf("%d MB (%.0f%%)",
+ value,
+ 100.0 * (double) value /
+ (double) ctk_gpu->gpu_memory);
+ } else {
+ memory_text = g_strdup_printf("%d MB", value);
+ }
+
+ gtk_label_set_text(GTK_LABEL(ctk_gpu->gpu_memory_used_label), memory_text);
+ g_free(memory_text);
+ }
+
+ return TRUE;
+}
+
+void ctk_gpu_page_select(GtkWidget *widget)
+{
+ CtkGpu *ctk_gpu = CTK_GPU(widget);
+
+ /* Start the gpu timer */
+
+ ctk_config_start_timer(ctk_gpu->ctk_config,
+ (GSourceFunc) update_gpu_memory_used,
+ (gpointer) ctk_gpu);
+}
+
+void ctk_gpu_page_unselect(GtkWidget *widget)
+{
+ CtkGpu *ctk_gpu = CTK_GPU(widget);
+
+ /* Stop the gpu timer */
+
+ ctk_config_stop_timer(ctk_gpu->ctk_config,
+ (GSourceFunc) update_gpu_memory_used,
+ (gpointer) ctk_gpu);
+}
diff --git a/src/gtk+-2.x/ctkgpu.h b/src/gtk+-2.x/ctkgpu.h
index 5bee1da..eb95a0d 100644
--- a/src/gtk+-2.x/ctkgpu.h
+++ b/src/gtk+-2.x/ctkgpu.h
@@ -60,6 +60,8 @@ struct _CtkGpu
CtkEvent *ctk_event;
GtkWidget *displays;
+ GtkWidget *gpu_memory_used_label;
+ gint gpu_memory;
gint gpu_cores;
gint memory_interface;
gboolean pcie_gen_queriable;
@@ -84,6 +86,9 @@ void get_bus_id_str(NvCtrlAttributeHandle *handle,
GtkTextBuffer *ctk_gpu_create_help(GtkTextTagTable *,
CtkGpu *);
+void ctk_gpu_page_select(GtkWidget *);
+void ctk_gpu_page_unselect(GtkWidget *);
+
G_END_DECLS
#endif /* __CTK_GPU_H__ */
diff --git a/src/gtk+-2.x/ctkmultisample.c b/src/gtk+-2.x/ctkmultisample.c
index 8f439b8..7995df7 100644
--- a/src/gtk+-2.x/ctkmultisample.c
+++ b/src/gtk+-2.x/ctkmultisample.c
@@ -171,6 +171,7 @@ static const char *__texture_sharpening_help =
#define __FSAA_32x (__FSAA << NV_CTRL_FSAA_MODE_32x)
#define __FSAA_64xS (__FSAA << NV_CTRL_FSAA_MODE_64xS)
#define __FSAA_ENHANCE (__FSAA << (NV_CTRL_FSAA_MODE_MAX + 1))
+#define __FXAA (__FSAA << (NV_CTRL_FSAA_MODE_MAX + 2))
#define FRAME_PADDING 5
@@ -401,6 +402,8 @@ GtkWidget *ctk_multisample_new(NvCtrlAttributeHandle *handle,
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->active_attributes |= __FXAA;
ctk_multisample->fxaa_enable_check_button = check_button;
}
}
@@ -1641,6 +1644,11 @@ GtkTextBuffer *ctk_multisample_create_help(GtkTextTagTable *table,
}
}
+ if (ctk_multisample->active_attributes & __FXAA) {
+ ctk_help_term(b, &i, "Enable FXAA");
+ ctk_help_para(b, &i, __fxaa_enable_help);
+ }
+
if (ctk_multisample->active_attributes & __LOG_ANISO_RANGE) {
ctk_help_heading(b, &i, "Anisotropic Filtering");
diff --git a/src/gtk+-2.x/ctkscreen.c b/src/gtk+-2.x/ctkscreen.c
index 4fa2541..e486eeb 100644
--- a/src/gtk+-2.x/ctkscreen.c
+++ b/src/gtk+-2.x/ctkscreen.c
@@ -101,75 +101,13 @@ GType ctk_screen_get_type(
-/* Generates a list of display device names for those display devices that
- * are enabled on the given GPU and, if Xinerama is disabled, are also
- * associated to the given X screen (handle).
- */
-static gchar *make_gpu_display_device_list(NvCtrlAttributeHandle *handle,
- int gpu_id,
- int xinerama_enabled)
-{
- return create_display_name_list_string(handle,
- NV_CTRL_BINARY_DATA_DISPLAYS_ENABLED_ON_XSCREEN);
-}
-
-
-
/* Generates a list of display devices for the logical X screen
* given as "handle".
*/
static gchar *make_display_device_list(NvCtrlAttributeHandle *handle)
{
- ReturnStatus ret;
- int len;
- int i;
- int *pData;
- gchar *displays = NULL;
- int xinerama_enabled;
-
-
- /* See if Xinerama is enabled */
- ret = NvCtrlGetAttribute(handle, NV_CTRL_XINERAMA, &xinerama_enabled);
- if (ret != NvCtrlSuccess) {
- goto done;
- }
-
- /* Get all GPUs driving this X screen */
- ret = NvCtrlGetBinaryAttribute(handle,
- 0,
- NV_CTRL_BINARY_DATA_GPUS_USED_BY_LOGICAL_XSCREEN,
- (unsigned char **)(&pData),
- &len);
- if (ret != NvCtrlSuccess) {
- goto done;
- }
-
- /* Generate the list of display device names that display this X screen */
- for (i = 1; i <= pData[0]; i++) {
- gchar *new_str;
- gchar *tmp_str;
-
- new_str = make_gpu_display_device_list(handle, pData[i],
- xinerama_enabled);
- if (new_str) {
- if (displays) {
- tmp_str = g_strdup_printf("%s,\n%s", displays, new_str);
- g_free(displays);
- g_free(new_str);
- displays = tmp_str;
- } else {
- displays = new_str;
- }
- }
- }
-
- done:
- if (!displays) {
- displays = g_strdup("None");
- }
-
- return displays;
-
+ return create_display_name_list_string(handle,
+ NV_CTRL_BINARY_DATA_DISPLAYS_ENABLED_ON_XSCREEN);
} /* make_display_device_list() */
diff --git a/src/gtk+-2.x/ctkwindow.c b/src/gtk+-2.x/ctkwindow.c
index cb4cade..8437c5d 100644
--- a/src/gtk+-2.x/ctkwindow.c
+++ b/src/gtk+-2.x/ctkwindow.c
@@ -122,7 +122,8 @@ static void add_display_devices(CtkWindow *ctk_window, GtkTreeIter *iter,
NvCtrlAttributeHandle *handle,
CtkEvent *ctk_event,
GtkTextTagTable *tag_table,
- UpdateDisplaysData *data);
+ UpdateDisplaysData *data,
+ ParsedAttribute *p);
static void update_display_devices(GtkObject *object, gpointer arg1,
gpointer user_data);
@@ -819,6 +820,12 @@ 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_page_select, -1);
+ gtk_tree_store_set(ctk_window->tree_store, &iter,
+ CTK_WINDOW_UNSELECT_WIDGET_FUNC_COLUMN,
+ ctk_gpu_page_unselect, -1);
/* power savings */
@@ -876,7 +883,7 @@ GtkWidget *ctk_window_new(ParsedAttribute *p, ConfigProperties *conf,
(gpointer) data);
add_display_devices(ctk_window, &iter, gpu_handle, ctk_event, tag_table,
- data);
+ data, ctk_window->attribute_list);
}
/* add the per-vcs (e.g. Quadro Plex) entries into the tree model */
@@ -1369,7 +1376,8 @@ static void add_display_devices(CtkWindow *ctk_window, GtkTreeIter *iter,
NvCtrlAttributeHandle *gpu_handle,
CtkEvent *ctk_event_gpu,
GtkTextTagTable *tag_table,
- UpdateDisplaysData *data)
+ UpdateDisplaysData *data,
+ ParsedAttribute *p)
{
GtkTextBuffer *help;
ReturnStatus ret;
@@ -1407,13 +1415,21 @@ static void add_display_devices(CtkWindow *ctk_window, GtkTreeIter *iter,
GtkWidget *widget;
gchar *title;
CtkEvent *ctk_event;
+ CtrlHandles *handles = ctk_window->ctk_config->pCtrlHandles;
+
+ /*
+ * Get the ctrl handle that was passed into ctk_main so that updated
+ * backend color slider values, cached in the handle itself, can be
+ * saved to the RC file when the UI is closed.
+ */
+
+ if (handles) {
+ display_handle =
+ handles->targets[NV_CTRL_TARGET_TYPE_DISPLAY].t[display_id].h;
+ } else {
+ display_handle = NULL;
+ }
- display_handle =
- NvCtrlAttributeInit(NvCtrlGetDisplayPtr(gpu_handle),
- NV_CTRL_TARGET_TYPE_DISPLAY,
- display_id,
- NV_CTRL_ATTRIBUTES_NV_CONTROL_SUBSYSTEM |
- NV_CTRL_ATTRIBUTES_XRANDR_SUBSYSTEM);
if (!display_handle) {
continue;
}
@@ -1460,7 +1476,7 @@ static void add_display_devices(CtkWindow *ctk_window, GtkTreeIter *iter,
widget = ctk_display_device_new(display_handle,
ctk_window->ctk_config, ctk_event,
ctk_event_gpu,
- title, typeBaseName);
+ title, typeBaseName, p);
help = ctk_display_device_create_help(tag_table,
CTK_DISPLAY_DEVICE(widget));
} else {
@@ -1543,7 +1559,7 @@ static void update_display_devices(GtkObject *object, gpointer arg1,
add_display_devices(ctk_window, &parent_iter, gpu_handle,
CTK_GPU(widget)->ctk_event,
- tag_table, data);
+ tag_table, data, ctk_window->attribute_list);
/* 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 9e97279..495ed49 100644
--- a/src/libXNVCtrl/NVCtrl.h
+++ b/src/libXNVCtrl/NVCtrl.h
@@ -197,7 +197,7 @@
/*
- * NV_CTRL_VIDEO_RAM - returns the total amount of memory available
+ * NV_CTRL_TOTAL_GPU_MEMORY - 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
@@ -206,7 +206,8 @@
* BIOS for use by the integrated GPU.
*/
-#define NV_CTRL_VIDEO_RAM 6 /* R--G */
+#define NV_CTRL_TOTAL_GPU_MEMORY 6 /* R--G */
+#define NV_CTRL_VIDEO_RAM NV_CTRL_TOTAL_GPU_MEMORY
/*
@@ -3211,7 +3212,22 @@
*/
#define NV_CTRL_DISPLAY_RANDR_OUTPUT_ID 391 /* R-D- */
-#define NV_CTRL_LAST_ATTRIBUTE NV_CTRL_DISPLAY_RANDR_OUTPUT_ID
+/*
+ * NV_CTRL_TOTAL_DEDICATED_GPU_MEMORY - Returns the total amount of dedicated
+ * GPU video memory, in MB, on the specified GPU. This excludes any TurboCache
+ * padding included in the value returned by NV_CTRL_TOTAL_GPU_MEMORY.
+ */
+#define NV_CTRL_TOTAL_DEDICATED_GPU_MEMORY 393 /* R--G */
+
+/*
+ * NV_CTRL_USED_DEDICATED_GPU_MEMORY- Returns the amount of video memory
+ * currently used on the graphics card in MB.
+ */
+#define NV_CTRL_USED_DEDICATED_GPU_MEMORY 394 /* R--G */
+
+
+
+#define NV_CTRL_LAST_ATTRIBUTE NV_CTRL_USED_DEDICATED_GPU_MEMORY
/**************************************************************************/
diff --git a/src/libXNVCtrlAttributes/NvCtrlAttributes.c b/src/libXNVCtrlAttributes/NvCtrlAttributes.c
index 150126d..6970a3f 100644
--- a/src/libXNVCtrlAttributes/NvCtrlAttributes.c
+++ b/src/libXNVCtrlAttributes/NvCtrlAttributes.c
@@ -958,11 +958,18 @@ ReturnStatus NvCtrlSetColorAttributes(NvCtrlAttributeHandle *handle,
float g[3],
unsigned int bitmask)
{
+ ReturnStatus status;
+ int val = 0;
+
NvCtrlAttributePrivateHandle *h = (NvCtrlAttributePrivateHandle *) handle;
- if (h->target_type == NV_CTRL_TARGET_TYPE_X_SCREEN) {
+ status = NvCtrlGetAttribute(h, NV_CTRL_ATTR_RANDR_GAMMA_AVAILABLE, &val);
+
+ if ((status != NvCtrlSuccess || !val) &&
+ h->target_type == NV_CTRL_TARGET_TYPE_X_SCREEN) {
return NvCtrlVidModeSetColorAttributes(h, c, b, g, bitmask);
- } else if (h->target_type == NV_CTRL_TARGET_TYPE_DISPLAY) {
+ } else if (status == NvCtrlSuccess && val &&
+ h->target_type == NV_CTRL_TARGET_TYPE_DISPLAY) {
return NvCtrlXrandrSetColorAttributes(h, c, b, g, bitmask);
}
diff --git a/src/libXNVCtrlAttributes/NvCtrlAttributesPrivate.h b/src/libXNVCtrlAttributes/NvCtrlAttributesPrivate.h
index 36cbcb9..538f6b2 100644
--- a/src/libXNVCtrlAttributes/NvCtrlAttributesPrivate.h
+++ b/src/libXNVCtrlAttributes/NvCtrlAttributesPrivate.h
@@ -25,6 +25,13 @@
#include <GL/glx.h> /* GLX #defines */
#include <X11/extensions/Xrandr.h> /* Xrandr */
+/* Make sure we are compiling with XRandR version 1.2 or greater */
+#define MIN_RANDR_MAJOR 1
+#define MIN_RANDR_MINOR 2
+#if (RANDR_MAJOR < MIN_RANDR_MAJOR) || ((RANDR_MAJOR == MIN_RANDR_MAJOR) && (RANDR_MINOR < MIN_RANDR_MINOR))
+#error XRandR version 1.2 or greater is required.
+#endif
+
#define EXTENSION_NV_CONTROL 0x1
#define EXTENSION_XF86VIDMODE 0x2
diff --git a/src/libXNVCtrlAttributes/NvCtrlAttributesXrandr.c b/src/libXNVCtrlAttributes/NvCtrlAttributesXrandr.c
index c9c5eb9..9a77b94 100644
--- a/src/libXNVCtrlAttributes/NvCtrlAttributesXrandr.c
+++ b/src/libXNVCtrlAttributes/NvCtrlAttributesXrandr.c
@@ -38,13 +38,6 @@
#include "msg.h"
#include "parse.h"
-/* Make sure we are compiling with XRandR version 1.1 or greater */
-#define MIN_RANDR_MAJOR 1
-#define MIN_RANDR_MINOR 1
-#if (RANDR_MAJOR < MIN_RANDR_MAJOR) || ((RANDR_MAJOR == MIN_RANDR_MAJOR) && (RANDR_MINOR < MIN_RANDR_MINOR))
-#error XRandR version 1.1 or greater is required.
-#endif
-
typedef struct __libXrandrInfoRec {
/* libXrandr.so library handle */
diff --git a/src/parse.c b/src/parse.c
index efb0ba4..708027c 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -143,6 +143,8 @@ AttributeTableEntry attributeTable[] = {
{ "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." },
+ { "TotalDedicatedGPUMemory",NV_CTRL_TOTAL_DEDICATED_GPU_MEMORY, N, "Returns the amount of total dedicated memory on the specified GPU in MB." },
+ { "UsedDedicatedGPUMemory", NV_CTRL_USED_DEDICATED_GPU_MEMORY, N, "Returns the amount of dedicated memory used on the specified GPU in MB." },
{ "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." },
@@ -368,7 +370,7 @@ AttributeTableEntry attributeTable[] = {
* about.
*/
-#if NV_CTRL_LAST_ATTRIBUTE != NV_CTRL_DISPLAY_RANDR_OUTPUT_ID
+#if NV_CTRL_LAST_ATTRIBUTE != NV_CTRL_USED_DEDICATED_GPU_MEMORY
#warning "Have you forgotten to add a new integer attribute to attributeTable?"
#endif
diff --git a/src/version.mk b/src/version.mk
index 2335952..3fda853 100644
--- a/src/version.mk
+++ b/src/version.mk
@@ -1 +1 @@
-NVIDIA_VERSION = 304.51
+NVIDIA_VERSION = 304.60
diff --git a/utils.mk b/utils.mk
index b912f98..6e5ec42 100644
--- a/utils.mk
+++ b/utils.mk
@@ -100,6 +100,15 @@ else
LIBDL_LIBS =
endif
+# This variable controls which floating-point ABI is targeted. For ARM, it
+# defaults to "gnueabi" for softfp. Another option is "gnueabihf" for
+# hard(fp). This is necessary to pick up the correct rtld_test binary.
+# All other architectures default to empty.
+ifeq ($(TARGET_ARCH),armv7l)
+ TARGET_ARCH_ABI ?= gnueabi
+endif
+TARGET_ARCH_ABI ?=
+
OUTPUTDIR ?= _out/$(TARGET_OS)_$(TARGET_ARCH)
NV_QUIET_COMMAND_REMOVED_TARGET_PREFIX ?=
diff --git a/version.mk b/version.mk
index 2335952..3fda853 100644
--- a/version.mk
+++ b/version.mk
@@ -1 +1 @@
-NVIDIA_VERSION = 304.51
+NVIDIA_VERSION = 304.60