diff options
-rw-r--r-- | doc/nvidia-settings.1.m4 | 3 | ||||
-rw-r--r-- | doc/version.mk | 2 | ||||
-rw-r--r-- | samples/version.mk | 2 | ||||
-rw-r--r-- | src/gtk+-2.x/ctkdisplayconfig-utils.c | 6 | ||||
-rw-r--r-- | src/gtk+-2.x/ctkdisplaydevice.c | 52 | ||||
-rw-r--r-- | src/gtk+-2.x/ctkdisplaydevice.h | 1 | ||||
-rw-r--r-- | src/gtk+-2.x/ctkimagesliders.c | 29 | ||||
-rw-r--r-- | src/gtk+-2.x/ctkmultisample.c | 138 | ||||
-rw-r--r-- | src/gtk+-2.x/ctkmultisample.h | 1 | ||||
-rw-r--r-- | src/parse.c | 4 | ||||
-rw-r--r-- | src/version.mk | 2 | ||||
-rw-r--r-- | version.mk | 2 |
12 files changed, 220 insertions, 22 deletions
diff --git a/doc/nvidia-settings.1.m4 b/doc/nvidia-settings.1.m4 index 1349ccd..b98da21 100644 --- a/doc/nvidia-settings.1.m4 +++ b/doc/nvidia-settings.1.m4 @@ -317,7 +317,8 @@ For example: .fi .PP Multiple queries and assignments may be specified on the command line for a single invocation of -.B nvidia\-settings. +.B nvidia\-settings. +Assignments are processed in the order they are entered on the command line. If multiple assignments are made to the same attribute or to multiple attributes with dependencies, then the later assignments will have priority. .PP If either the .B \-\-query diff --git a/doc/version.mk b/doc/version.mk index 82c0323..c7ccc7a 100644 --- a/doc/version.mk +++ b/doc/version.mk @@ -1 +1 @@ -NVIDIA_VERSION = 304.32 +NVIDIA_VERSION = 304.37 diff --git a/samples/version.mk b/samples/version.mk index 82c0323..c7ccc7a 100644 --- a/samples/version.mk +++ b/samples/version.mk @@ -1 +1 @@ -NVIDIA_VERSION = 304.32 +NVIDIA_VERSION = 304.37 diff --git a/src/gtk+-2.x/ctkdisplayconfig-utils.c b/src/gtk+-2.x/ctkdisplayconfig-utils.c index 04156ef..7d9005c 100644 --- a/src/gtk+-2.x/ctkdisplayconfig-utils.c +++ b/src/gtk+-2.x/ctkdisplayconfig-utils.c @@ -2200,10 +2200,6 @@ nvDisplayPtr gpu_add_display_from_server(nvGpuPtr gpu, } - /* Add the display at the end of gpu's display list */ - gpu_add_display(gpu, display); - - /* Query the modelines for the display device */ if (!display_add_modelines_from_server(display, err_str)) { nv_warning_msg("Failed to add modelines to display device %d " @@ -2213,6 +2209,8 @@ nvDisplayPtr gpu_add_display_from_server(nvGpuPtr gpu, goto fail; } + /* Add the display at the end of gpu's display list */ + gpu_add_display(gpu, display); return display; diff --git a/src/gtk+-2.x/ctkdisplaydevice.c b/src/gtk+-2.x/ctkdisplaydevice.c index fab08ef..b74dfb2 100644 --- a/src/gtk+-2.x/ctkdisplaydevice.c +++ b/src/gtk+-2.x/ctkdisplaydevice.c @@ -62,7 +62,9 @@ static void update_native_resolution(InfoEntry *entry); static void update_refresh_rate(InfoEntry *entry); static void register_link_events(InfoEntry *entry); +static void unregister_link_events(InfoEntry *entry); static void register_refresh_rate_events(InfoEntry *entry); +static void unregister_refresh_rate_events(InfoEntry *entry); #define FRAME_PADDING 5 @@ -101,7 +103,7 @@ typedef struct { const gchar **tooltip; InfoEntryFunc update_func; InfoEntryFunc register_events_func; - + InfoEntryFunc unregister_events_func; } InfoEntryData; static InfoEntryData __info_entry_data[] = { @@ -110,30 +112,35 @@ static InfoEntryData __info_entry_data[] = { &__info_chip_location_help, update_chip_info, NULL, + NULL, }, { "Signal", &__info_signal_help, update_signal_info, NULL, + NULL, }, { "Connection link", &__info_link_help, update_link_info, register_link_events, + unregister_link_events, }, { "Native Resolution", &__native_res_help, update_native_resolution, NULL, + NULL, }, { "Refresh Rate", &__refresh_rate_help, update_refresh_rate, register_refresh_rate_events, + unregister_refresh_rate_events, }, }; @@ -176,14 +183,26 @@ static void ctk_display_device_finalize( ) { CtkDisplayDevice *ctk_object = CTK_DISPLAY_DEVICE(object); - g_free(ctk_object->name); - g_signal_handlers_disconnect_matched(ctk_object->ctk_event, + int i; + + g_signal_handlers_disconnect_matched(G_OBJECT(ctk_object->ctk_event_gpu), G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, (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->unregister_events_func) { + entryData->unregister_events_func(entry); + } + } + + g_free(ctk_object->name); } @@ -219,6 +238,7 @@ GtkWidget* ctk_display_device_new(NvCtrlAttributeHandle *handle, ctk_object = CTK_DISPLAY_DEVICE(object); ctk_object->handle = handle; ctk_object->ctk_event = ctk_event; + ctk_object->ctk_event_gpu = ctk_event_gpu; ctk_object->ctk_config = ctk_config; ctk_object->name = g_strdup(name); @@ -760,6 +780,19 @@ static void register_link_events(InfoEntry *entry) (gpointer) entry); } +static void unregister_link_events(InfoEntry *entry) +{ + CtkDisplayDevice *ctk_object = entry->ctk_object; + + g_signal_handlers_disconnect_matched(G_OBJECT(ctk_object->ctk_event), + G_SIGNAL_MATCH_DATA, + 0, /* signal_id */ + 0, /* detail */ + NULL, /* closure */ + NULL, /* func */ + (gpointer) entry); +} + static void register_refresh_rate_events(InfoEntry *entry) { CtkDisplayDevice *ctk_object = entry->ctk_object; @@ -770,6 +803,19 @@ static void register_refresh_rate_events(InfoEntry *entry) (gpointer) entry); } +static void unregister_refresh_rate_events(InfoEntry *entry) +{ + CtkDisplayDevice *ctk_object = entry->ctk_object; + + g_signal_handlers_disconnect_matched(G_OBJECT(ctk_object->ctk_event), + G_SIGNAL_MATCH_DATA, + 0, /* signal_id */ + 0, /* detail */ + NULL, /* closure */ + NULL, /* func */ + (gpointer) entry); +} + /* diff --git a/src/gtk+-2.x/ctkdisplaydevice.h b/src/gtk+-2.x/ctkdisplaydevice.h index ab5b90a..402450f 100644 --- a/src/gtk+-2.x/ctkdisplaydevice.h +++ b/src/gtk+-2.x/ctkdisplaydevice.h @@ -65,6 +65,7 @@ struct _CtkDisplayDevice NvCtrlAttributeHandle *handle; CtkConfig *ctk_config; CtkEvent *ctk_event; + CtkEvent *ctk_event_gpu; GtkWidget *image_sliders; GtkWidget *reset_button; GtkWidget *edid; diff --git a/src/gtk+-2.x/ctkimagesliders.c b/src/gtk+-2.x/ctkimagesliders.c index 3fff22e..e6aa842 100644 --- a/src/gtk+-2.x/ctkimagesliders.c +++ b/src/gtk+-2.x/ctkimagesliders.c @@ -36,6 +36,9 @@ static const char *__image_sharpening_help = "The Image Sharpening slider " "alters the level of Image Sharpening for this display device."; +static void ctk_image_sliders_class_init(CtkImageSliders *ctk_object_class); +static void ctk_image_sliders_finalize(GObject *object); + static GtkWidget * add_scale(CtkConfig *ctk_config, int attribute, char *name, @@ -64,7 +67,7 @@ GType ctk_image_sliders_get_type(void) sizeof (CtkImageSlidersClass), NULL, /* base_init */ NULL, /* base_finalize */ - NULL, /* class_init, */ + (GClassInitFunc) ctk_image_sliders_class_init, NULL, /* class_finalize */ NULL, /* class_data */ sizeof (CtkImageSliders), @@ -80,6 +83,30 @@ GType ctk_image_sliders_get_type(void) return ctk_image_sliders_type; } +static void ctk_image_sliders_class_init( + CtkImageSliders *ctk_object_class +) +{ + GObjectClass *gobject_class = (GObjectClass *)ctk_object_class; + gobject_class->finalize = ctk_image_sliders_finalize; +} + +static void ctk_image_sliders_finalize( + GObject *object +) +{ + CtkImageSliders *ctk_image_sliders = CTK_IMAGE_SLIDERS(object); + + g_signal_handlers_disconnect_matched(G_OBJECT(ctk_image_sliders->ctk_event), + G_SIGNAL_MATCH_DATA, + 0, /* signal_id */ + 0, /* detail */ + NULL, /* closure */ + NULL, /* func */ + (gpointer) ctk_image_sliders); +} + + GtkWidget* ctk_image_sliders_new(NvCtrlAttributeHandle *handle, CtkConfig *ctk_config, CtkEvent *ctk_event, diff --git a/src/gtk+-2.x/ctkmultisample.c b/src/gtk+-2.x/ctkmultisample.c index 69c5597..aa5c6b2 100644 --- a/src/gtk+-2.x/ctkmultisample.c +++ b/src/gtk+-2.x/ctkmultisample.c @@ -105,6 +105,11 @@ static void texture_sharpening_update_received(GtkObject *object, gpointer arg1, gpointer user_data); +static void update_fxaa_from_fsaa_change(CtkMultisample *ctk_multisample, + int fsaa_value); +static void update_fsaa_from_fxaa_change(CtkMultisample *ctk_multisample, + gboolean fxaa_enabled); + static const char *__aa_override_app_help = "Enable the Antialiasing \"Override Application Setting\" " "checkbox to make the antialiasing slider active and " @@ -117,7 +122,8 @@ static const char *__aa_menu_help = "the slider."; static const char *__aa_slider_help = -"The Antialiasing slider controls the level of antialiasing."; +"The Antialiasing slider controls the level of antialiasing. Using " +"antialiasing disables FXAA."; static const char *__aniso_override_app_help = "Enable the Anisotropic Filtering \"Override Application Setting\" " @@ -131,7 +137,9 @@ static const char *__aniso_slider_help = 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."; +"OpenGL applications that are started after this option is set. Enabling " +"FXAA disables antialiasing and other antialiasing setting methods. FXAA " +"is not allowed when Unified Back Buffers are enabled."; static const char *__texture_sharpening_help = "To improve image quality, select this option " @@ -215,7 +223,7 @@ GtkWidget *ctk_multisample_new(NvCtrlAttributeHandle *handle, GtkObject *adjustment; gint min, max; - gint val, app_control, override, enhance, i; + gint val, app_control, override, enhance, mode, i; NVCTRLAttributeValidValuesRec valid; @@ -248,9 +256,9 @@ GtkWidget *ctk_multisample_new(NvCtrlAttributeHandle *handle, build_fsaa_translation_table(ctk_multisample, valid); - ret = NvCtrlGetAttribute(handle, NV_CTRL_FSAA_MODE, &val); + ret = NvCtrlGetAttribute(handle, NV_CTRL_FSAA_MODE, &mode); - val = map_nv_ctrl_fsaa_value_to_slider(ctk_multisample, val); + val = map_nv_ctrl_fsaa_value_to_slider(ctk_multisample, mode); ret0 = NvCtrlGetAttribute(handle, NV_CTRL_FSAA_APPLICATION_CONTROLLED, @@ -371,7 +379,23 @@ GtkWidget *ctk_multisample_new(NvCtrlAttributeHandle *handle, 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); + + ctk_multisample->fxaa_available = + (ret != NvCtrlAttributeNotAvailable); + + if (mode != NV_CTRL_FSAA_MODE_NONE || + !ctk_multisample->fxaa_available) { + val = NV_CTRL_FXAA_DISABLE; + } + + if (val == NV_CTRL_FXAA_ENABLE) { + gtk_widget_set_sensitive(GTK_WIDGET(scale), FALSE); + } + + gtk_widget_set_sensitive(GTK_WIDGET(check_button), + (mode == NV_CTRL_FSAA_MODE_NONE) && + (ctk_multisample->fxaa_available)); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_button), val); g_signal_connect(G_OBJECT(check_button), "toggled", G_CALLBACK(fxaa_checkbox_toggled), @@ -739,9 +763,15 @@ static GtkWidget *create_fsaa_setting_menu(CtkMultisample *ctk_multisample, static void post_fsaa_setting_changed(CtkMultisample *ctk_multisample, gboolean override, gboolean enhance) { + GtkWidget *fxaa_checkbox = ctk_multisample->fxaa_enable_check_button; + gboolean fxaa_value = + gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(fxaa_checkbox)); + if (ctk_multisample->fsaa_scale) { gtk_widget_set_sensitive - (GTK_WIDGET(ctk_multisample->fsaa_scale), override); + (GTK_WIDGET(ctk_multisample->fsaa_scale), + (override && + (fxaa_value == NV_CTRL_FXAA_DISABLE))); } ctk_config_statusbar_message(ctk_multisample->ctk_config, @@ -785,6 +815,9 @@ static void update_fsaa_setting(CtkMultisample *ctk_multisample, g_signal_handlers_unblock_by_func(G_OBJECT(range), G_CALLBACK(fsaa_value_changed), (gpointer) ctk_multisample); + + update_fxaa_from_fsaa_change(ctk_multisample, + NV_CTRL_FSAA_MODE_NONE); } post_fsaa_setting_changed(ctk_multisample, override, enhance); @@ -952,6 +985,89 @@ static void post_fsaa_value_changed(CtkMultisample *ctk_multisample, gint val) } /* post_fsaa_value_changed() */ +/* + * update_fxaa_from_fsaa_change - helper function for changes to fsaa in order + * to update fxaa and enable/disable fxaa or fsaa widgets based on the new + * value of fsaa. + */ + +static void update_fxaa_from_fsaa_change(CtkMultisample *ctk_multisample, + int fsaa_value) +{ + GtkRange *fsaa_range = GTK_RANGE(ctk_multisample->fsaa_scale); + GtkWidget *fsaa_menu = ctk_multisample->fsaa_menu; + GtkWidget *fxaa_checkbox = ctk_multisample->fxaa_enable_check_button; + gboolean fxaa_value; + + /* The FSAA dropdown menu is: 0 == app, 1 == override, 2 == enhance */ + gint fsaa_idx = gtk_option_menu_get_history(GTK_OPTION_MENU(fsaa_menu)) ; + + if (fsaa_value != NV_CTRL_FSAA_MODE_NONE) { + g_signal_handlers_block_by_func(G_OBJECT(fxaa_checkbox), + G_CALLBACK(fxaa_checkbox_toggled), + (gpointer) ctk_multisample); + + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(fxaa_checkbox), FALSE); + + g_signal_handlers_unblock_by_func(G_OBJECT(fxaa_checkbox), + G_CALLBACK(fxaa_checkbox_toggled), + (gpointer) ctk_multisample); + } + + fxaa_value = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(fxaa_checkbox)); + + gtk_widget_set_sensitive(GTK_WIDGET(fsaa_range), + (fsaa_idx != 0) && // not app controlled + (fxaa_value == NV_CTRL_FXAA_DISABLE)); + gtk_widget_set_sensitive(GTK_WIDGET(fxaa_checkbox), + fsaa_value == NV_CTRL_FSAA_MODE_NONE && + ctk_multisample->fxaa_available); +} /* update_fxaa_from_fsaa_change() */ + +/* + * update_fsaa_from_fxaa_change - helper function for changes to fxaa in order + * to update fsaa and enable/disable fxaa or fsaa widgets based on the new + * value of fxaa. + */ + +static void update_fsaa_from_fxaa_change (CtkMultisample *ctk_multisample, + gboolean fxaa_enabled) +{ + GtkWidget *fxaa_checkbox = ctk_multisample->fxaa_enable_check_button; + GtkRange *fsaa_range = GTK_RANGE(ctk_multisample->fsaa_scale); + gint fsaa_value_none = map_nv_ctrl_fsaa_value_to_slider(ctk_multisample, 0); + GtkWidget *fsaa_menu = ctk_multisample->fsaa_menu; + + /* The FSAA dropdown menu is: 0 == app, 1 == override, 2 == enhance */ + gint fsaa_idx = gtk_option_menu_get_history(GTK_OPTION_MENU(fsaa_menu)) ; + + gint fsaa_val; + + if (fxaa_enabled == NV_CTRL_FXAA_ENABLE) { + g_signal_handlers_block_by_func(G_OBJECT(fsaa_range), + G_CALLBACK(fsaa_value_changed), + (gpointer) ctk_multisample); + + gtk_range_set_value(fsaa_range, fsaa_value_none); + + g_signal_handlers_unblock_by_func(G_OBJECT(fsaa_range), + G_CALLBACK(fsaa_value_changed), + (gpointer) ctk_multisample); + } + + fsaa_val = gtk_range_get_value(fsaa_range); + if (fsaa_val > NV_CTRL_FSAA_MODE_MAX) fsaa_val = NV_CTRL_FSAA_MODE_MAX; + if (fsaa_val < 0) fsaa_val = 0; + fsaa_val = ctk_multisample->fsaa_translation_table[fsaa_val]; + + gtk_widget_set_sensitive(GTK_WIDGET(fxaa_checkbox), + ((fxaa_enabled == NV_CTRL_FXAA_ENABLE) || + (fsaa_val == NV_CTRL_FSAA_MODE_NONE)) && + (ctk_multisample->fxaa_available)); + gtk_widget_set_sensitive(GTK_WIDGET(fsaa_range), + (fsaa_idx != 0) && // not app controlled + (fxaa_enabled == NV_CTRL_FXAA_DISABLE)); +} /* update_fsaa_from_fxaa_change */ /* * fsaa_value_changed() - callback for the "value-changed" signal from @@ -971,6 +1087,8 @@ static void fsaa_value_changed(GtkRange *range, gpointer user_data) val = ctk_multisample->fsaa_translation_table[val]; NvCtrlSetAttribute(ctk_multisample->handle, NV_CTRL_FSAA_MODE, val); + + update_fxaa_from_fsaa_change(ctk_multisample, val); post_fsaa_value_changed(ctk_multisample, val); @@ -991,6 +1109,8 @@ static void fxaa_checkbox_toggled(GtkWidget *widget, NvCtrlSetAttribute(ctk_multisample->handle, NV_CTRL_FXAA, enabled); + update_fsaa_from_fxaa_change(ctk_multisample, enabled); + post_fxaa_toggled(ctk_multisample, enabled); } /* fxaa_checkbox_toggled */ @@ -1015,6 +1135,8 @@ static void fxaa_update_received(GtkObject *object, (gpointer) ctk_multisample); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_button), fxaa_value); + + update_fsaa_from_fxaa_change(ctk_multisample, fxaa_value); g_signal_handlers_unblock_by_func(G_OBJECT(check_button), G_CALLBACK(fxaa_checkbox_toggled), @@ -1067,6 +1189,8 @@ static void fsaa_update_received(GtkObject *object, (gpointer) ctk_multisample); gtk_range_set_value(range, val); + + update_fxaa_from_fsaa_change(ctk_multisample, event_struct->value); g_signal_handlers_unblock_by_func(G_OBJECT(range), G_CALLBACK(fsaa_value_changed), diff --git a/src/gtk+-2.x/ctkmultisample.h b/src/gtk+-2.x/ctkmultisample.h index a72621b..aaa8e74 100644 --- a/src/gtk+-2.x/ctkmultisample.h +++ b/src/gtk+-2.x/ctkmultisample.h @@ -66,6 +66,7 @@ struct _CtkMultisample gint fsaa_translation_table[NV_CTRL_FSAA_MODE_MAX + 1]; gint fsaa_translation_table_size; + gboolean fxaa_available; }; struct _CtkMultisampleClass diff --git a/src/parse.c b/src/parse.c index 045b00c..e4112dc 100644 --- a/src/parse.c +++ b/src/parse.c @@ -114,12 +114,12 @@ AttributeTableEntry attributeTable[] = { /* OpenGL */ { "SyncToVBlank", NV_CTRL_SYNC_TO_VBLANK, 0, "Enables sync to vertical blanking for OpenGL clients. This setting only takes effect on OpenGL clients started after it is set." }, { "LogAniso", NV_CTRL_LOG_ANISO, 0, "Enables anisotropic filtering for OpenGL clients; on some NVIDIA hardware, this can only be enabled or disabled; on other hardware different levels of anisotropic filtering can be specified. This setting only takes effect on OpenGL clients started after it is set." }, - { "FSAA", NV_CTRL_FSAA_MODE, 0, "The full screen antialiasing setting for OpenGL clients. This setting only takes effect on OpenGL clients started after it is set." }, + { "FSAA", NV_CTRL_FSAA_MODE, 0, "The full screen antialiasing setting for OpenGL clients. This setting only takes effect on OpenGL clients started after it is set. Enabling antialiasing will disable FXAA." }, { "TextureSharpen", NV_CTRL_TEXTURE_SHARPEN, 0, "Enables texture sharpening for OpenGL clients. This setting only takes effect on OpenGL clients started after it is set." }, { "ForceGenericCpu", NV_CTRL_FORCE_GENERIC_CPU, N, "Inhibit the use of CPU-specific features such as MMX, SSE, or 3DNOW! for OpenGL clients; this option may result in performance loss, but may be useful in conjunction with software such as the Valgrind memory debugger. This setting only takes effect on OpenGL clients started after it is set." }, { "GammaCorrectedAALines", NV_CTRL_OPENGL_AA_LINE_GAMMA, 0, "For OpenGL clients, allow gamma-corrected antialiased lines to consider variances in the color display capabilities of output devices when rendering smooth lines. Only available on recent Quadro GPUs. This setting only takes effect on OpenGL clients started after it is set." }, { "TextureClamping", NV_CTRL_TEXTURE_CLAMPING, 0, "Define the behavior of OpenGL texture clamping for unbordered textures. If enabled (1), the conformant behavior is used. If disabled (0), GL_CLAMP is remapped to GL_CLAMP_TO_EDGE to avoid seams in applications that rely on this behavior, which was the only option in some very old hardware." }, - { "FXAA", NV_CTRL_FXAA, 0, "Enables or disables the use of FXAA, Fast Approximate Anti-Aliasing" }, + { "FXAA", NV_CTRL_FXAA, 0, "Enables or disables the use of FXAA, Fast Approximate Anti-Aliasing. Enabling FXAA will disable regular antialiasing modes." }, { "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." }, diff --git a/src/version.mk b/src/version.mk index 82c0323..c7ccc7a 100644 --- a/src/version.mk +++ b/src/version.mk @@ -1 +1 @@ -NVIDIA_VERSION = 304.32 +NVIDIA_VERSION = 304.37 @@ -1 +1 @@ -NVIDIA_VERSION = 304.32 +NVIDIA_VERSION = 304.37 |