diff options
author | Aaron Plattner <aplattner@nvidia.com> | 2012-09-11 15:25:44 -0700 |
---|---|---|
committer | Aaron Plattner <aplattner@nvidia.com> | 2012-09-11 15:25:44 -0700 |
commit | 101e284417883c249b2ceea96a662a50d295a7b8 (patch) | |
tree | 14fce91155f52a5b756b1d238832c825e6b6c766 /src | |
parent | 85ab38c897e266d1e9805e4d276916dceb0ad801 (diff) |
304.48304.48
Diffstat (limited to 'src')
-rw-r--r-- | src/config-file.c | 23 | ||||
-rw-r--r-- | src/gtk+-2.x/ctk3dvisionpro.c | 7 | ||||
-rw-r--r-- | src/gtk+-2.x/ctkclocks.c | 26 | ||||
-rw-r--r-- | src/gtk+-2.x/ctkcolorcontrols.c | 3 | ||||
-rw-r--r-- | src/gtk+-2.x/ctkcolorcorrection.c | 6 | ||||
-rw-r--r-- | src/gtk+-2.x/ctkdisplayconfig-utils.c | 24 | ||||
-rw-r--r-- | src/gtk+-2.x/ctkdisplayconfig-utils.h | 3 | ||||
-rw-r--r-- | src/gtk+-2.x/ctkdisplayconfig.c | 17 | ||||
-rw-r--r-- | src/gtk+-2.x/ctkdisplaydevice.c | 24 | ||||
-rw-r--r-- | src/gtk+-2.x/ctkevent.c | 3 | ||||
-rw-r--r-- | src/gtk+-2.x/ctkframelock.c | 11 | ||||
-rw-r--r-- | src/gtk+-2.x/ctkglx.c | 3 | ||||
-rw-r--r-- | src/gtk+-2.x/ctkgvo-sync.c | 12 | ||||
-rw-r--r-- | src/gtk+-2.x/ctkmultisample.c | 47 | ||||
-rw-r--r-- | src/gtk+-2.x/ctkmultisample.h | 1 | ||||
-rw-r--r-- | src/gtk+-2.x/ctkslimm.c | 23 | ||||
-rw-r--r-- | src/gtk+-2.x/ctkthermal.c | 5 | ||||
-rw-r--r-- | src/gtk+-2.x/ctkwindow.c | 2 | ||||
-rw-r--r-- | src/version.mk | 2 |
19 files changed, 95 insertions, 147 deletions
diff --git a/src/config-file.c b/src/config-file.c index 5ea5c29..a267a1c 100644 --- a/src/config-file.c +++ b/src/config-file.c @@ -318,6 +318,14 @@ int nv_write_config_file(const char *filename, CtrlHandles *h, if (a->flags & NV_PARSER_TYPE_COLOR_ATTRIBUTE) { float c[3], b[3], g[3]; + + /* + * if we are using RandR gamma, skip saving the color info + */ + + status = NvCtrlGetAttribute(t->h, NV_CTRL_ATTR_RANDR_GAMMA_AVAILABLE, &val); + if (status == NvCtrlSuccess && val) continue; + status = NvCtrlGetColorAttributes(t->h, c, b, g); if (status != NvCtrlSuccess) continue; fprintf(stream, "%s%c%s=%f\n", @@ -497,8 +505,7 @@ static ParsedAttributeWrapper *parse_config_file(char *buf, const char *file, while (((c - buf) < length) && (*c != '\n') && - (*c != '\0') && - (*c != EOF)) { + (*c != '\0')) { if (comment) { c++; continue; } if (*c == '#') { comment = c; continue; } if (!isspace(*c)) has_data = NV_TRUE; @@ -543,9 +550,9 @@ static ParsedAttributeWrapper *parse_config_file(char *buf, const char *file, } } - if (((c - buf) >= length) || (*c == '\0') || (*c == EOF)) cur = NULL; + if (((c - buf) >= length) || (*c == '\0')) cur = NULL; else cur = c + 1; - + line++; } free(tmp); @@ -576,7 +583,7 @@ static int process_config_file_attributes(const char *file, ParsedAttributeWrapper *w, const char *display_name) { - int i, j, ret, found, n = 0; + int i, j, found, n = 0; CtrlHandles **h = NULL; int old_verbosity = __verbosity; @@ -632,9 +639,9 @@ static int process_config_file_attributes(const char *file, for (i = 0; w[i].line != -1; i++) { - ret = nv_process_parsed_attribute(&w[i].a, w[i].h, NV_TRUE, NV_FALSE, - "on line %d of configuration file " - "'%s'", w[i].line, file); + nv_process_parsed_attribute(&w[i].a, w[i].h, NV_TRUE, NV_FALSE, + "on line %d of configuration file " + "'%s'", w[i].line, file); /* * We do not fail if processing the attribute failed. If the * GPU or the X config changed (for example stereo is diff --git a/src/gtk+-2.x/ctk3dvisionpro.c b/src/gtk+-2.x/ctk3dvisionpro.c index 383a9e5..e08f407 100644 --- a/src/gtk+-2.x/ctk3dvisionpro.c +++ b/src/gtk+-2.x/ctk3dvisionpro.c @@ -170,10 +170,6 @@ static const char** get_signal_strength_icon(int signal_strength) static void ctk_3d_vision_pro_class_init(Ctk3DVisionProClass *ctk_3d_vision_pro_class) { - GObjectClass *gobject_class; - - gobject_class = (GObjectClass *) ctk_3d_vision_pro_class; - __signals[CHANGED] = g_signal_new("changed", G_OBJECT_CLASS_TYPE(ctk_3d_vision_pro_class), G_SIGNAL_RUN_LAST, @@ -396,7 +392,7 @@ static void create_glasses_info_table(GlassesInfoTable *table, GlassesInfo** gla GtkWidget *pack_in, CtkConfig *ctk_config) { GtkWidget *hbox, *hbox1; - GtkWidget *vbox, *vbox2; + GtkWidget *vbox; GtkWidget *label; GtkWidget *hseparator; GtkWidget *data_viewport, *full_viewport; @@ -417,7 +413,6 @@ static void create_glasses_info_table(GlassesInfoTable *table, GlassesInfo** gla hbox = gtk_hbox_new(FALSE, 0); vbox = gtk_vbox_new(FALSE, 5); - vbox2 = gtk_vbox_new(FALSE, 5); vpan = gtk_vpaned_new(); data_viewport = gtk_viewport_new(NULL, NULL); diff --git a/src/gtk+-2.x/ctkclocks.c b/src/gtk+-2.x/ctkclocks.c index 76f5ad6..b943445 100644 --- a/src/gtk+-2.x/ctkclocks.c +++ b/src/gtk+-2.x/ctkclocks.c @@ -793,7 +793,6 @@ static void overclocking_state_toggled(GtkWidget *widget, gpointer user_data) { CtkClocks *ctk_object = CTK_CLOCKS(user_data); gboolean enabled; - ReturnStatus ret; int value; gint result; @@ -836,10 +835,10 @@ static void overclocking_state_toggled(GtkWidget *widget, gpointer user_data) /* Update the server */ - - ret = NvCtrlSetAttribute(ctk_object->handle, - NV_CTRL_GPU_OVERCLOCKING_STATE, value); - + + NvCtrlSetAttribute(ctk_object->handle, + NV_CTRL_GPU_OVERCLOCKING_STATE, value); + /* Update the GUI */ overclocking_state_update_gui(ctk_object); @@ -1250,18 +1249,17 @@ static void reset_clocks_clicked(GtkWidget *widget, gpointer user_data) static void detect_clocks_clicked(GtkWidget *widget, gpointer user_data) { CtkClocks *ctk_object = CTK_CLOCKS(user_data); - ReturnStatus ret; gint result; - + if ( ctk_object->probing_optimal ) { /* Stop the test for optimal clock freqs */ - ret = NvCtrlSetAttribute(ctk_object->handle, - NV_CTRL_GPU_OPTIMAL_CLOCK_FREQS_DETECTION, - NV_CTRL_GPU_OPTIMAL_CLOCK_FREQS_DETECTION_CANCEL); + NvCtrlSetAttribute(ctk_object->handle, + NV_CTRL_GPU_OPTIMAL_CLOCK_FREQS_DETECTION, + NV_CTRL_GPU_OPTIMAL_CLOCK_FREQS_DETECTION_CANCEL); } else { - + /* User must hit the OK button to start the testing */ gtk_widget_show_all(ctk_object->detect_dialog); @@ -1273,9 +1271,9 @@ static void detect_clocks_clicked(GtkWidget *widget, gpointer user_data) case GTK_RESPONSE_ACCEPT: /* Start the test for optimal clock freqs */ - ret = NvCtrlSetAttribute(ctk_object->handle, - NV_CTRL_GPU_OPTIMAL_CLOCK_FREQS_DETECTION, - NV_CTRL_GPU_OPTIMAL_CLOCK_FREQS_DETECTION_START); + NvCtrlSetAttribute(ctk_object->handle, + NV_CTRL_GPU_OPTIMAL_CLOCK_FREQS_DETECTION, + NV_CTRL_GPU_OPTIMAL_CLOCK_FREQS_DETECTION_START); break; case GTK_RESPONSE_REJECT: diff --git a/src/gtk+-2.x/ctkcolorcontrols.c b/src/gtk+-2.x/ctkcolorcontrols.c index cb1f22d..c6262e8 100644 --- a/src/gtk+-2.x/ctkcolorcontrols.c +++ b/src/gtk+-2.x/ctkcolorcontrols.c @@ -599,6 +599,9 @@ static gboolean setup_color_range_dropdown(CtkColorControls *ctk_color_controls) ret = NvCtrlGetValidAttributeValues(ctk_color_controls->handle, NV_CTRL_COLOR_RANGE, &valid); + if (ret != NvCtrlSuccess) { + return FALSE; + } if (valid.type != ATTRIBUTE_TYPE_INT_BITS) { return FALSE; diff --git a/src/gtk+-2.x/ctkcolorcorrection.c b/src/gtk+-2.x/ctkcolorcorrection.c index 9c2fe1f..456dedb 100644 --- a/src/gtk+-2.x/ctkcolorcorrection.c +++ b/src/gtk+-2.x/ctkcolorcorrection.c @@ -158,10 +158,6 @@ static void ctk_color_correction_class_init(CtkColorCorrectionClass *ctk_color_correction_class) { - GObjectClass *gobject_class; - - gobject_class = (GObjectClass *) ctk_color_correction_class; - signals[CHANGED] = g_signal_new("changed", G_OBJECT_CLASS_TYPE(ctk_color_correction_class), @@ -170,8 +166,6 @@ ctk_color_correction_class_init(CtkColorCorrectionClass NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); - - } diff --git a/src/gtk+-2.x/ctkdisplayconfig-utils.c b/src/gtk+-2.x/ctkdisplayconfig-utils.c index 7d9005c..4add68d 100644 --- a/src/gtk+-2.x/ctkdisplayconfig-utils.c +++ b/src/gtk+-2.x/ctkdisplayconfig-utils.c @@ -249,6 +249,7 @@ void apply_screen_info_token(char *token, char *value, void *data) * **/ static nvModeLinePtr modeline_parse(nvDisplayPtr display, + nvGpuPtr gpu, const char *modeline_str, const int broken_doublescan_modelines) { @@ -358,15 +359,15 @@ static nvModeLinePtr modeline_parse(nvDisplayPtr display, } modeline->refresh_rate = 0; - if (display->is_sdi && display->gpu->num_gvo_modes) { + if (display->is_sdi && gpu->num_gvo_modes) { /* Fetch the SDI refresh rate of the mode from the gvo mode table */ int i; - for (i = 0; i < display->gpu->num_gvo_modes; i++) { - if (display->gpu->gvo_mode_data[i].id && - display->gpu->gvo_mode_data[i].name && - !strcmp(display->gpu->gvo_mode_data[i].name, + for (i = 0; i < gpu->num_gvo_modes; i++) { + if (gpu->gvo_mode_data[i].id && + gpu->gvo_mode_data[i].name && + !strcmp(gpu->gvo_mode_data[i].name, modeline->data.identifier)) { - modeline->refresh_rate = display->gpu->gvo_mode_data[i].rate; + modeline->refresh_rate = gpu->gvo_mode_data[i].rate; modeline->refresh_rate /= 1000.0; break; } @@ -961,7 +962,8 @@ static void display_remove_modelines(nvDisplayPtr display) * Queries the display's current modepool (modelines list). * **/ -Bool display_add_modelines_from_server(nvDisplayPtr display, gchar **err_str) +Bool display_add_modelines_from_server(nvDisplayPtr display, nvGpuPtr gpu, + gchar **err_str) { nvModeLinePtr modeline; char *modeline_strs = NULL; @@ -1014,7 +1016,8 @@ Bool display_add_modelines_from_server(nvDisplayPtr display, gchar **err_str) str = modeline_strs; while (strlen(str)) { - modeline = modeline_parse(display, str, broken_doublescan_modelines); + modeline = modeline_parse(display, gpu, str, + broken_doublescan_modelines); if (!modeline) { *err_str = g_strdup_printf("Failed to parse the following " "modeline of display device\n" @@ -2201,7 +2204,7 @@ nvDisplayPtr gpu_add_display_from_server(nvGpuPtr gpu, /* Query the modelines for the display device */ - if (!display_add_modelines_from_server(display, err_str)) { + if (!display_add_modelines_from_server(display, gpu, err_str)) { nv_warning_msg("Failed to add modelines to display device %d " "'%s'\nconnected to GPU-%d '%s'.", display_id, display->logName, @@ -3159,7 +3162,6 @@ static int save_xconfig_file(SaveXConfDlg *dlg, { gchar *backup_filename = NULL; FILE *fp = NULL; - size_t size; gchar *err_msg = NULL; struct stat st; @@ -3168,8 +3170,6 @@ static int save_xconfig_file(SaveXConfDlg *dlg, if (!buf || !filename) goto done; - size = strlen(buf) ; - /* Backup any existing file */ if ((access(filename, F_OK) == 0)) { diff --git a/src/gtk+-2.x/ctkdisplayconfig-utils.h b/src/gtk+-2.x/ctkdisplayconfig-utils.h index d2b663a..5aeb84f 100644 --- a/src/gtk+-2.x/ctkdisplayconfig-utils.h +++ b/src/gtk+-2.x/ctkdisplayconfig-utils.h @@ -62,7 +62,8 @@ void modeline_free(nvModeLinePtr m); int display_find_closest_mode_matching_modeline(nvDisplayPtr display, nvModeLinePtr modeline); Bool display_has_modeline(nvDisplayPtr display, nvModeLinePtr modeline); -Bool display_add_modelines_from_server(nvDisplayPtr display, gchar **err_str); +Bool display_add_modelines_from_server(nvDisplayPtr display, nvGpuPtr gpu, + gchar **err_str); void display_remove_modes(nvDisplayPtr display); diff --git a/src/gtk+-2.x/ctkdisplayconfig.c b/src/gtk+-2.x/ctkdisplayconfig.c index 9cb4e93..8111aa1 100644 --- a/src/gtk+-2.x/ctkdisplayconfig.c +++ b/src/gtk+-2.x/ctkdisplayconfig.c @@ -563,9 +563,9 @@ void xconfigPrint(MsgType t, const char *msg) } } - if (newline) printf("\n"); - printf("%s %s\n", prefix, msg); - if (newline) printf("\n"); + if (newline) fprintf(stream, "\n"); + fprintf(stream, "%s %s\n", prefix, msg); + if (newline) fprintf(stream, "\n"); } /* xconfigPrint */ @@ -2536,9 +2536,6 @@ static void setup_display_refresh_dropdown(CtkDisplayConfig *ctk_object) nvModeLinePtr m; int count_ref; /* # modelines with similar refresh rates */ int num_ref; /* Modeline # in a group of similar refresh rates */ - int is_doublescan; - int is_interlaced; - /* Ignore modelines of different resolution */ if (modeline->data.hdisplay != cur_modeline->data.hdisplay || @@ -2551,9 +2548,6 @@ static void setup_display_refresh_dropdown(CtkDisplayConfig *ctk_object) continue; } - is_doublescan = (modeline->data.flags & V_DBLSCAN); - is_interlaced = (modeline->data.flags & V_INTERLACE); - name = g_strdup_printf("%0.*f Hz", (display->is_sdi ? 3 : 0), modeline->refresh_rate); @@ -3213,12 +3207,9 @@ static void setup_primary_display(CtkDisplayConfig *ctk_object) static void setup_display_panning(CtkDisplayConfig *ctk_object) { char *tmp_str; - nvLayoutPtr layout; nvDisplayPtr display; nvModePtr mode; - layout = ctk_object->layout; - display = ctk_display_layout_get_selected_display (CTK_DISPLAY_LAYOUT(ctk_object->obj_layout)); @@ -4998,7 +4989,7 @@ static void display_config_changed(GtkWidget *widget, gpointer user_data) NV_CTRL_STRING_OPERATION_BUILD_MODEPOOL, "", &tokens); update = TRUE; - if (!display_add_modelines_from_server(display, &err_str)) { + if (!display_add_modelines_from_server(display, display->gpu, &err_str)) { nv_warning_msg(err_str); g_free(err_str); return; diff --git a/src/gtk+-2.x/ctkdisplaydevice.c b/src/gtk+-2.x/ctkdisplaydevice.c index 3a7e2fa..40a3ea4 100644 --- a/src/gtk+-2.x/ctkdisplaydevice.c +++ b/src/gtk+-2.x/ctkdisplaydevice.c @@ -360,6 +360,18 @@ GtkWidget* ctk_display_device_new(NvCtrlAttributeHandle *handle, nbox = gtk_vbox_new(FALSE, FRAME_PADDING); gtk_container_set_border_width(GTK_CONTAINER(nbox), FRAME_PADDING); + /* pack the reset button */ + + button = gtk_button_new_with_label("Reset Hardware Defaults"); + str = ctk_help_create_reset_hardware_defaults_text(typeBaseName, + name); + ctk_config_set_tooltip(ctk_config, button, str); + ctk_object->reset_button = button; + + alignment = gtk_alignment_new(1, 1, 0, 0); + gtk_container_add(GTK_CONTAINER(alignment), button); + gtk_box_pack_end(GTK_BOX(nbox), alignment, FALSE, FALSE, 0); + /* pack the color controls */ ctk_object->color_controls = @@ -392,18 +404,6 @@ GtkWidget* ctk_display_device_new(NvCtrlAttributeHandle *handle, FALSE, FALSE, 0); } - /* pack the reset button */ - - button = gtk_button_new_with_label("Reset Hardware Defaults"); - str = ctk_help_create_reset_hardware_defaults_text(typeBaseName, - name); - ctk_config_set_tooltip(ctk_config, button, str); - ctk_object->reset_button = button; - - alignment = gtk_alignment_new(1, 1, 0, 0); - gtk_container_add(GTK_CONTAINER(alignment), button); - gtk_box_pack_end(GTK_BOX(nbox), alignment, FALSE, FALSE, 0); - /* If no controls are created, don't add a controls tab */ if (ctk_object->color_controls || diff --git a/src/gtk+-2.x/ctkevent.c b/src/gtk+-2.x/ctkevent.c index 115b119..6903af0 100644 --- a/src/gtk+-2.x/ctkevent.c +++ b/src/gtk+-2.x/ctkevent.c @@ -105,11 +105,8 @@ GType ctk_event_get_type(void) static void ctk_event_class_init(CtkEventClass *ctk_event_class) { - GObjectClass *gobject_class; gint i; - gobject_class = (GObjectClass *) ctk_event_class; - /* clear the signal array */ for (i = 0; i <= NV_CTRL_LAST_ATTRIBUTE; i++) signals[i] = 0; diff --git a/src/gtk+-2.x/ctkframelock.c b/src/gtk+-2.x/ctkframelock.c index 5ac8ae5..7c6d0e9 100644 --- a/src/gtk+-2.x/ctkframelock.c +++ b/src/gtk+-2.x/ctkframelock.c @@ -1216,8 +1216,6 @@ static void list_entry_update_display_controls(CtkFramelock *ctk_framelock, { nvDisplayDataPtr data = (nvDisplayDataPtr)(entry->data); gboolean framelock_enabled = ctk_framelock->framelock_enabled; - gboolean server_checked; - gboolean client_checked; gboolean sensitive; nvListTreePtr tree = (nvListTreePtr)(ctk_framelock->tree); @@ -1232,11 +1230,6 @@ static void list_entry_update_display_controls(CtkFramelock *ctk_framelock, } } - server_checked = gtk_toggle_button_get_active - (GTK_TOGGLE_BUTTON(data->server_checkbox)); - client_checked = gtk_toggle_button_get_active - (GTK_TOGGLE_BUTTON(data->client_checkbox)); - /* Server Checkbox is unavailable when framelock is enabled, * this display cannot be master * (display is driven by GPU that is connected through a @@ -4439,11 +4432,7 @@ static void ctk_framelock_class_init( CtkFramelockClass *ctk_framelock_class ) { - GObjectClass *gobject_class; - - gobject_class = (GObjectClass *) ctk_framelock_class; parent_class = g_type_class_peek_parent(ctk_framelock_class); - } diff --git a/src/gtk+-2.x/ctkglx.c b/src/gtk+-2.x/ctkglx.c index cdbb9b9..0dba528 100644 --- a/src/gtk+-2.x/ctkglx.c +++ b/src/gtk+-2.x/ctkglx.c @@ -233,7 +233,7 @@ GtkWidget* ctk_glx_new(NvCtrlAttributeHandle *handle, GtkWidget *banner; GtkWidget *hseparator; GtkWidget *hbox; - GtkWidget *vbox, *vbox2; + GtkWidget *vbox; GtkWidget *scrollWin; GtkWidget *event; /* For setting the background color to white */ GtkWidget *data_table, *header_table; @@ -369,7 +369,6 @@ GtkWidget* ctk_glx_new(NvCtrlAttributeHandle *handle, hbox = gtk_hbox_new(FALSE, 0); vbox = gtk_vbox_new(FALSE, 10); - vbox2 = gtk_vbox_new(FALSE, 10); data_viewport = gtk_viewport_new(NULL, NULL); gtk_widget_set_size_request(data_viewport, 400, 50); diff --git a/src/gtk+-2.x/ctkgvo-sync.c b/src/gtk+-2.x/ctkgvo-sync.c index 43e5212..c1fc528 100644 --- a/src/gtk+-2.x/ctkgvo-sync.c +++ b/src/gtk+-2.x/ctkgvo-sync.c @@ -1179,17 +1179,9 @@ static void sync_mode_changed(CtkDropDownMenu *menu, gpointer user_data) { CtkGvoSync *ctk_gvo_sync = CTK_GVO_SYNC(user_data); gint value; - char *name; - + value = ctk_drop_down_menu_get_current_value(menu); - - switch (value) { - case NV_CTRL_GVO_SYNC_MODE_FREE_RUNNING: name = "Free Running"; break; - case NV_CTRL_GVO_SYNC_MODE_GENLOCK: name = "GenLock"; break; - case NV_CTRL_GVO_SYNC_MODE_FRAMELOCK: name = "FrameLock"; break; - default: return; - } - + NvCtrlSetAttribute(ctk_gvo_sync->handle, NV_CTRL_GVO_SYNC_MODE, value); if (value != NV_CTRL_GVO_SYNC_MODE_FREE_RUNNING) { diff --git a/src/gtk+-2.x/ctkmultisample.c b/src/gtk+-2.x/ctkmultisample.c index aa5c6b2..8f439b8 100644 --- a/src/gtk+-2.x/ctkmultisample.c +++ b/src/gtk+-2.x/ctkmultisample.c @@ -138,8 +138,7 @@ 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. Enabling " -"FXAA disables antialiasing and other antialiasing setting methods. FXAA " -"is not allowed when Unified Back Buffers are enabled."; +"FXAA disables antialiasing and other antialiasing setting methods."; static const char *__texture_sharpening_help = "To improve image quality, select this option " @@ -378,23 +377,16 @@ GtkWidget *ctk_multisample_new(NvCtrlAttributeHandle *handle, check_button = gtk_check_button_new_with_label("Enable FXAA"); - ret = NvCtrlGetAttribute(handle, NV_CTRL_FXAA, &val); - - ctk_multisample->fxaa_available = - (ret != NvCtrlAttributeNotAvailable); - - if (mode != NV_CTRL_FSAA_MODE_NONE || - !ctk_multisample->fxaa_available) { + if (mode == NV_CTRL_FSAA_MODE_NONE) { + ret = NvCtrlGetAttribute(handle, NV_CTRL_FXAA, &val); + if (val == NV_CTRL_FXAA_ENABLE) { + gtk_widget_set_sensitive(GTK_WIDGET(scale), FALSE); + } + } else { 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)); + (mode == NV_CTRL_FSAA_MODE_NONE)); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_button), val); g_signal_connect(G_OBJECT(check_button), "toggled", @@ -907,8 +899,13 @@ static void fsaa_setting_update_received(GtkObject *object, ret = NvCtrlGetAttribute(ctk_multisample->handle, NV_CTRL_FSAA_APPLICATION_ENHANCED, &val); - enhance = val; - idx = enhance ? 2 : 1; + if (ret == NvCtrlSuccess) { + enhance = val; + idx = enhance ? 2 : 1; + } else { + enhance = FALSE; + idx = 0; + } } else { idx = 1; } @@ -920,7 +917,11 @@ static void fsaa_setting_update_received(GtkObject *object, ret = NvCtrlGetAttribute(ctk_multisample->handle, NV_CTRL_FSAA_APPLICATION_CONTROLLED, &val); - override = !val; /* = !app_controlled */ + if (ret == NvCtrlSuccess) { + override = !val; /* = !app_controlled */ + } else { + override = FALSE; + } if (override) { idx = enhance ? 2 : 1; @@ -1020,8 +1021,7 @@ static void update_fxaa_from_fsaa_change(CtkMultisample *ctk_multisample, (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); + fsaa_value == NV_CTRL_FSAA_MODE_NONE); } /* update_fxaa_from_fsaa_change() */ /* @@ -1061,9 +1061,8 @@ static void update_fsaa_from_fxaa_change (CtkMultisample *ctk_multisample, 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)); + (fxaa_enabled == NV_CTRL_FXAA_ENABLE) || + (fsaa_val == NV_CTRL_FSAA_MODE_NONE)); gtk_widget_set_sensitive(GTK_WIDGET(fsaa_range), (fsaa_idx != 0) && // not app controlled (fxaa_enabled == NV_CTRL_FXAA_DISABLE)); diff --git a/src/gtk+-2.x/ctkmultisample.h b/src/gtk+-2.x/ctkmultisample.h index aaa8e74..a72621b 100644 --- a/src/gtk+-2.x/ctkmultisample.h +++ b/src/gtk+-2.x/ctkmultisample.h @@ -66,7 +66,6 @@ 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/gtk+-2.x/ctkslimm.c b/src/gtk+-2.x/ctkslimm.c index e2b0f79..3d784cd 100644 --- a/src/gtk+-2.x/ctkslimm.c +++ b/src/gtk+-2.x/ctkslimm.c @@ -229,8 +229,6 @@ static XConfigPtr xconfig_generate(XConfigPtr xconfCur, gint x_displays,y_displays; gint h_overlap, v_overlap; - gint x_total, y_total; - gchar *metamode_str = NULL; gchar *tmpstr; @@ -263,12 +261,6 @@ static XConfigPtr xconfig_generate(XConfigPtr xconfCur, h_overlap = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(ctk_object->spbtn_hedge_overlap)); v_overlap = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(ctk_object->spbtn_vedge_overlap)); - /* Total X Screen Size Calculation */ - x_total = x_displays * ctk_object->cur_modeline->data.hdisplay - - (x_displays - 1) * h_overlap; - y_total = y_displays * ctk_object->cur_modeline->data.vdisplay - - (y_displays - 1) * v_overlap; - for (yctr = 0; yctr < y_displays;yctr++) { for (xctr = 0; xctr < x_displays;xctr++) { tmpstr = g_strdup_printf("%s +%d+%d", @@ -563,8 +555,6 @@ static void setup_display_refresh_dropdown(CtkSLIMM *ctk_object) nvModeLinePtr m; int count_ref; /* # modelines with similar refresh rates */ int num_ref; /* Modeline # in a group of similar refresh rates */ - int is_doublescan; - int is_interlaced; gchar *extra = NULL; gchar *tmp; @@ -576,8 +566,6 @@ static void setup_display_refresh_dropdown(CtkSLIMM *ctk_object) } modeline_rate = modeline->refresh_rate; - is_doublescan = (modeline->data.flags & V_DBLSCAN); - is_interlaced = (modeline->data.flags & V_INTERLACE); name = g_strdup_printf("%.0f Hz", modeline_rate); @@ -1286,7 +1274,6 @@ GtkWidget* ctk_slimm_new(NvCtrlAttributeHandle *handle, int grid_menu_selected_id; int count; - Bool valid_layout = FALSE; Bool trust_slimm_available = FALSE; int vcs_target_count; @@ -1398,11 +1385,11 @@ GtkWidget* ctk_slimm_new(NvCtrlAttributeHandle *handle, layout = NULL; } else { - valid_layout = parse_slimm_layout(ctk_slimm, - layout, - &hoverlap, - &voverlap, - &grid_config_id); + parse_slimm_layout(ctk_slimm, + layout, + &hoverlap, + &voverlap, + &grid_config_id); } } diff --git a/src/gtk+-2.x/ctkthermal.c b/src/gtk+-2.x/ctkthermal.c index ca3967a..dc825cc 100644 --- a/src/gtk+-2.x/ctkthermal.c +++ b/src/gtk+-2.x/ctkthermal.c @@ -429,7 +429,6 @@ static void cooler_control_state_toggled(GtkWidget *widget, gpointer user_data) { CtkThermal *ctk_thermal = CTK_THERMAL(user_data); gboolean enabled; - ReturnStatus ret; int value; gint result; @@ -473,8 +472,8 @@ static void cooler_control_state_toggled(GtkWidget *widget, gpointer user_data) /* Update the server */ - ret = NvCtrlSetAttribute(ctk_thermal->attribute_handle, - NV_CTRL_GPU_COOLER_MANUAL_CONTROL, value); + NvCtrlSetAttribute(ctk_thermal->attribute_handle, + NV_CTRL_GPU_COOLER_MANUAL_CONTROL, value); /* Update the GUI */ diff --git a/src/gtk+-2.x/ctkwindow.c b/src/gtk+-2.x/ctkwindow.c index dee4e6a..cb4cade 100644 --- a/src/gtk+-2.x/ctkwindow.c +++ b/src/gtk+-2.x/ctkwindow.c @@ -175,11 +175,9 @@ GType ctk_window_get_type(void) static void ctk_window_class_init(CtkWindowClass *ctk_window_class) { - GObjectClass *gobject_class; GtkObjectClass *object_class; object_class = (GtkObjectClass *) ctk_window_class; - gobject_class = (GObjectClass *) ctk_window_class; parent_class = g_type_class_peek_parent(ctk_window_class); diff --git a/src/version.mk b/src/version.mk index 7753329..6de12aa 100644 --- a/src/version.mk +++ b/src/version.mk @@ -1 +1 @@ -NVIDIA_VERSION = 304.43 +NVIDIA_VERSION = 304.48 |