diff -Nru nvidia-settings-415.27/debian/changelog nvidia-settings-418.56/debian/changelog --- nvidia-settings-415.27/debian/changelog 2019-01-15 18:41:46.000000000 +0000 +++ nvidia-settings-418.56/debian/changelog 2019-03-23 10:00:00.000000000 +0000 @@ -1,3 +1,21 @@ +nvidia-settings (418.56-0ubuntu0~gpu14.04.1) trusty; urgency=medium + + * New upstream release + + -- Michael Marley Sat, 23 Mar 2019 06:00:00 -0400 + +nvidia-settings (418.43-0ubuntu0~gpu14.04.1) trusty; urgency=medium + + * New upstream release + + -- Michael Marley Fri, 22 Feb 2019 17:00:00 -0500 + +nvidia-settings (418.30-0ubuntu0~gpu14.04.1) trusty; urgency=medium + + * New upstream release + + -- Michael Marley Wed, 30 Jan 2019 17:00:00 -0500 + nvidia-settings (415.27-0ubuntu0~gpu14.04.1) trusty; urgency=medium * New upstream release diff -Nru nvidia-settings-415.27/debian/patches/05_add_polkit_support.patch nvidia-settings-418.56/debian/patches/05_add_polkit_support.patch --- nvidia-settings-415.27/debian/patches/05_add_polkit_support.patch 2019-01-15 18:41:17.000000000 +0000 +++ nvidia-settings-418.56/debian/patches/05_add_polkit_support.patch 2019-01-30 19:55:46.000000000 +0000 @@ -1,8 +1,8 @@ -Index: nvidia-settings-415.27/src/gtk+-2.x/ctkdisplayconfig-utils.c +Index: nvidia-settings-418.30/src/gtk+-2.x/ctkdisplayconfig-utils.c =================================================================== ---- nvidia-settings-415.27.orig/src/gtk+-2.x/ctkdisplayconfig-utils.c -+++ nvidia-settings-415.27/src/gtk+-2.x/ctkdisplayconfig-utils.c -@@ -4186,6 +4186,77 @@ static void update_banner(XConfigPtr con +--- nvidia-settings-418.30.orig/src/gtk+-2.x/ctkdisplayconfig-utils.c ++++ nvidia-settings-418.30/src/gtk+-2.x/ctkdisplayconfig-utils.c +@@ -4219,6 +4219,77 @@ static void update_banner(XConfigPtr con } /* update_banner() */ @@ -80,7 +80,7 @@ /** save_xconfig_file() ********************************************** -@@ -4206,6 +4277,9 @@ static int save_xconfig_file(SaveXConfDl +@@ -4239,6 +4310,9 @@ static int save_xconfig_file(SaveXConfDl int ret = 0; diff -Nru nvidia-settings-415.27/doc/version.mk nvidia-settings-418.56/doc/version.mk --- nvidia-settings-415.27/doc/version.mk 2018-12-20 23:41:43.000000000 +0000 +++ nvidia-settings-418.56/doc/version.mk 2019-03-15 17:56:18.000000000 +0000 @@ -1 +1 @@ -NVIDIA_VERSION = 415.27 +NVIDIA_VERSION = 418.56 diff -Nru nvidia-settings-415.27/samples/nv-control-events.c nvidia-settings-418.56/samples/nv-control-events.c --- nvidia-settings-415.27/samples/nv-control-events.c 2018-12-20 23:41:46.000000000 +0000 +++ nvidia-settings-418.56/samples/nv-control-events.c 2019-03-15 17:56:20.000000000 +0000 @@ -683,7 +683,7 @@ MAKE_ENTRY(NV_CTRL_GVI_TEST_MODE), MAKE_ENTRY(NV_CTRL_COLOR_SPACE), MAKE_ENTRY(NV_CTRL_COLOR_RANGE), - MAKE_ENTRY(NV_CTRL_SHOW_GSYNC_VISUAL_INDICATOR), + MAKE_ENTRY(NV_CTRL_SHOW_VRR_VISUAL_INDICATOR), MAKE_ENTRY(NV_CTRL_GPU_SCALING_DEFAULT_TARGET), MAKE_ENTRY(NV_CTRL_GPU_SCALING_DEFAULT_METHOD), MAKE_ENTRY(NV_CTRL_DITHERING_MODE), @@ -736,6 +736,8 @@ MAKE_ENTRY(NV_CTRL_XV_SYNC_TO_DISPLAY_ID), MAKE_ENTRY(NV_CTRL_CURRENT_XV_SYNC_TO_DISPLAY_ID), MAKE_ENTRY(NV_CTRL_PALETTE_UPDATE_EVENT), - MAKE_ENTRY(NV_CTRL_GSYNC_ALLOWED), + MAKE_ENTRY(NV_CTRL_VRR_ALLOWED), + MAKE_ENTRY(NV_CTRL_DISPLAY_VRR_MODE), + MAKE_ENTRY(NV_CTRL_DISPLAY_VRR_MIN_REFRESH_RATE), { -1, NULL, NULL } }; diff -Nru nvidia-settings-415.27/samples/nv-control-info.c nvidia-settings-418.56/samples/nv-control-info.c --- nvidia-settings-415.27/samples/nv-control-info.c 2018-12-20 23:41:46.000000000 +0000 +++ nvidia-settings-418.56/samples/nv-control-info.c 2019-03-15 17:56:20.000000000 +0000 @@ -265,7 +265,7 @@ MAKE_ENTRY(NV_CTRL_THERMAL_COOLER_SPEED), MAKE_ENTRY(NV_CTRL_PALETTE_UPDATE_EVENT), MAKE_ENTRY(NV_CTRL_VIDEO_ENCODER_UTILIZATION), - MAKE_ENTRY(NV_CTRL_GSYNC_ALLOWED), + MAKE_ENTRY(NV_CTRL_VRR_ALLOWED), MAKE_ENTRY(NV_CTRL_GPU_NVCLOCK_OFFSET), MAKE_ENTRY(NV_CTRL_GPU_MEM_TRANSFER_RATE_OFFSET), MAKE_ENTRY(NV_CTRL_VIDEO_DECODER_UTILIZATION), @@ -273,9 +273,11 @@ MAKE_ENTRY(NV_CTRL_GPU_CURRENT_CORE_VOLTAGE), MAKE_ENTRY(NV_CTRL_CURRENT_COLOR_SPACE), MAKE_ENTRY(NV_CTRL_CURRENT_COLOR_RANGE), - MAKE_ENTRY(NV_CTRL_SHOW_GSYNC_VISUAL_INDICATOR), + MAKE_ENTRY(NV_CTRL_SHOW_VRR_VISUAL_INDICATOR), MAKE_ENTRY(NV_CTRL_THERMAL_COOLER_CURRENT_LEVEL), MAKE_ENTRY(NV_CTRL_STEREO_SWAP_MODE), + MAKE_ENTRY(NV_CTRL_DISPLAY_VRR_MODE), + MAKE_ENTRY(NV_CTRL_DISPLAY_VRR_MIN_REFRESH_RATE), }; // grep 'define.*\/\*' NVCtrl.h | grep -v NV_CTRL_TARGET_TYPE_ | grep -v "not supported" | grep -v "renamed" | grep -v "deprecated" | grep NV_CTRL_STRING_ | grep -v NV_CTRL_STRING_OPERATION_ | sed 's/.*define \([^ ]*\).*/ MAKE_ENTRY(\1),/' diff -Nru nvidia-settings-415.27/samples/version.mk nvidia-settings-418.56/samples/version.mk --- nvidia-settings-415.27/samples/version.mk 2018-12-20 23:41:43.000000000 +0000 +++ nvidia-settings-418.56/samples/version.mk 2019-03-15 17:56:18.000000000 +0000 @@ -1 +1 @@ -NVIDIA_VERSION = 415.27 +NVIDIA_VERSION = 418.56 diff -Nru nvidia-settings-415.27/src/common-utils/msg.c nvidia-settings-418.56/src/common-utils/msg.c --- nvidia-settings-415.27/src/common-utils/msg.c 2018-12-20 23:41:43.000000000 +0000 +++ nvidia-settings-418.56/src/common-utils/msg.c 2019-03-15 17:56:18.000000000 +0000 @@ -20,6 +20,8 @@ * DEALINGS IN THE SOFTWARE. */ +#define _GNU_SOURCE // needed for fileno + #include #include #include @@ -88,16 +90,20 @@ static void format(FILE *stream, const char *prefix, const char *buf, const int whitespace) { - int i; - TextRows *t; + if (isatty(fileno(stream))) { + int i; + TextRows *t; - if (!__terminal_width) reset_current_terminal_width(0); + if (!__terminal_width) reset_current_terminal_width(0); - t = nv_format_text_rows(prefix, buf, __terminal_width, whitespace); + t = nv_format_text_rows(prefix, buf, __terminal_width, whitespace); - for (i = 0; i < t->n; i++) fprintf(stream, "%s\n", t->t[i]); + for (i = 0; i < t->n; i++) fprintf(stream, "%s\n", t->t[i]); - nv_free_text_rows(t); + nv_free_text_rows(t); + } else { + fprintf(stream, "%s%s\n", prefix ? prefix : "", buf); + } } diff -Nru nvidia-settings-415.27/src/gtk+-2.x/ctkdisplayconfig.c nvidia-settings-418.56/src/gtk+-2.x/ctkdisplayconfig.c --- nvidia-settings-415.27/src/gtk+-2.x/ctkdisplayconfig.c 2018-12-20 23:41:45.000000000 +0000 +++ nvidia-settings-418.56/src/gtk+-2.x/ctkdisplayconfig.c 2019-03-15 17:56:19.000000000 +0000 @@ -82,6 +82,8 @@ gpointer user_data); static void display_panning_activate(GtkWidget *widget, gpointer user_data); +static void update_force_gsync_button(CtkDisplayConfig *ctk_object); + static void setup_screen_page(CtkDisplayConfig *ctk_object); static void screen_virtual_size_activate(GtkWidget *widget, gpointer user_data); @@ -276,6 +278,10 @@ "This option implicitly enables \"ForceCompositionPipeline\" and additionally " "makes use of the composition pipeline to apply ViewPortOut scaling."; +static const char * __dpy_force_allow_gsync_help = +"This option allows enabling G-SYNC on displays that are not validated as " +"G-SYNC Compatible."; + /* Screen tooltips */ static const char * __screen_virtual_size_help = @@ -1181,6 +1187,33 @@ +/** display_gsync_compatible_toggled() ******************************** + * + * Sets AllowGSYNCCompatible for a dpy. + * + **/ +static void display_gsync_compatible_toggled(GtkWidget *widget, + gpointer user_data) +{ + CtkDisplayConfig *ctk_object = CTK_DISPLAY_CONFIG(user_data); + gint enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); + nvDisplayPtr display = ctk_display_layout_get_selected_display + (CTK_DISPLAY_LAYOUT(ctk_object->obj_layout)); + + if (enabled) { + display->cur_mode->allowGSYNCCompatibleSpecified = TRUE; + display->cur_mode->allowGSYNCCompatible = TRUE; + } else { + display->cur_mode->allowGSYNCCompatibleSpecified = FALSE; + display->cur_mode->allowGSYNCCompatible = FALSE; + } + + update_force_gsync_button(ctk_object); + user_changed_attributes(ctk_object); +} + + + /** update_forcecompositionpipeline_buttons() ************************* * * Updates the buttons for Force{Full,}CompositionPipeline to reflect their @@ -1229,6 +1262,36 @@ +/** update_force_gsync_button() *************************************** + * + * Updates the button for AllowGSYNCCompatible to reflect its current + * state. + * + **/ + +static void update_force_gsync_button(CtkDisplayConfig *ctk_object) +{ + nvDisplayPtr display = ctk_display_layout_get_selected_display + (CTK_DISPLAY_LAYOUT(ctk_object->obj_layout)); + + g_signal_handlers_block_by_func + (G_OBJECT(ctk_object->chk_force_allow_gsync), + G_CALLBACK(display_gsync_compatible_toggled), + (gpointer)ctk_object); + + gtk_toggle_button_set_active + (GTK_TOGGLE_BUTTON(ctk_object->chk_force_allow_gsync), + display->cur_mode->allowGSYNCCompatibleSpecified && + display->cur_mode->allowGSYNCCompatible); + + g_signal_handlers_unblock_by_func + (G_OBJECT(ctk_object->chk_force_allow_gsync), + G_CALLBACK(display_gsync_compatible_toggled), + (gpointer)ctk_object); +} + + + /** screen_primary_display_toggled() ****************************** * * Sets the primary display for a screen. @@ -2120,6 +2183,21 @@ ctk_object->chk_forcefullcompositionpipeline_enabled, TRUE, TRUE, 0); + /* checkbox for AllowGSYNCCompatible */ + hbox = gtk_hbox_new(FALSE, 5); + gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, TRUE, 0); + ctk_object->chk_force_allow_gsync = + gtk_check_button_new_with_label( + "Allow G-SYNC on monitor not validated as G-SYNC Compatible"); + ctk_config_set_tooltip(ctk_config, ctk_object->chk_force_allow_gsync, + __dpy_force_allow_gsync_help); + g_signal_connect(G_OBJECT(ctk_object->chk_force_allow_gsync), + "toggled", + G_CALLBACK(display_gsync_compatible_toggled), + (gpointer) ctk_object); + gtk_box_pack_start(GTK_BOX(hbox), ctk_object->chk_force_allow_gsync, + TRUE, TRUE, 0); + /* Up the object ref count to make sure that the page and its widgets * do not get freed if/when the page is removed from the notebook. */ @@ -2503,6 +2581,8 @@ ctk_help_para(b, &i, "%s", __dpy_forcecompositionpipeline_help); ctk_help_heading(b, &i, "Force Full Composition Pipeline"); ctk_help_para(b, &i, "%s", __dpy_forcefullcompositionpipeline_help); + ctk_help_heading(b, &i, "Allow G-SYNC on monitor not validated as G-SYNC Compatible"); + ctk_help_para(b, &i, "%s", __dpy_force_allow_gsync_help); ctk_help_para(b, &i, ""); @@ -4568,6 +4648,55 @@ } +/** setup_force_gsync() *********************************************** + * + * Control whether to make visible the checkbox that allows enabling G-SYNC + * on displays not validated as G-SYNC compatible. + * + **/ + +static void setup_force_gsync(CtkDisplayConfig *ctk_object) +{ + nvDisplayPtr display = ctk_display_layout_get_selected_display + (CTK_DISPLAY_LAYOUT(ctk_object->obj_layout)); + ReturnStatus ret; + int val; + + if (!display || !display->screen || !display->cur_mode || + !ctk_object->advanced_mode) { + goto hide; + } + + ret = NvCtrlGetAttribute(display->ctrl_target, + NV_CTRL_DISPLAY_VRR_MODE, &val); + if (ret != NvCtrlSuccess) { + goto hide; + } + + /* + * Show the checkbox only in advanced mode, and only if the display is not + * validated as G-SYNC Compatible. + */ + switch (val) { + case NV_CTRL_DISPLAY_VRR_MODE_GSYNC_COMPATIBLE_UNVALIDATED: + gtk_widget_show(ctk_object->chk_force_allow_gsync); + break; + case NV_CTRL_DISPLAY_VRR_MODE_GSYNC: + case NV_CTRL_DISPLAY_VRR_MODE_GSYNC_COMPATIBLE: + case NV_CTRL_DISPLAY_VRR_MODE_NONE: + default: + goto hide; + break; + } + + update_force_gsync_button(ctk_object); + return; + +hide: + gtk_widget_hide(ctk_object->chk_force_allow_gsync); +} + + /** setup_display_page() ******************************************** * * Updates the display frame to reflect the current state of the @@ -4607,6 +4736,7 @@ setup_display_panning(ctk_object); setup_forcecompositionpipeline_buttons(ctk_object); setup_primary_display(ctk_object); + setup_force_gsync(ctk_object); } /* setup_display_page() */ diff -Nru nvidia-settings-415.27/src/gtk+-2.x/ctkdisplayconfig.h nvidia-settings-418.56/src/gtk+-2.x/ctkdisplayconfig.h --- nvidia-settings-415.27/src/gtk+-2.x/ctkdisplayconfig.h 2018-12-20 23:41:46.000000000 +0000 +++ nvidia-settings-418.56/src/gtk+-2.x/ctkdisplayconfig.h 2019-03-15 17:56:19.000000000 +0000 @@ -99,6 +99,8 @@ GtkWidget *chk_forcecompositionpipeline_enabled; GtkWidget *chk_forcefullcompositionpipeline_enabled; + GtkWidget *chk_force_allow_gsync; + GtkWidget *mnu_selected_item; SelectableItem *selected_item_table; int selected_item_table_len; @@ -163,6 +165,7 @@ GtkWidget *box_display_panning; GtkWidget *txt_display_panning; + /* X Screen - Info */ GtkWidget *screen_page; diff -Nru nvidia-settings-415.27/src/gtk+-2.x/ctkdisplayconfig-utils.c nvidia-settings-418.56/src/gtk+-2.x/ctkdisplayconfig-utils.c --- nvidia-settings-415.27/src/gtk+-2.x/ctkdisplayconfig-utils.c 2018-12-20 23:41:45.000000000 +0000 +++ nvidia-settings-418.56/src/gtk+-2.x/ctkdisplayconfig-utils.c 2019-03-15 17:56:19.000000000 +0000 @@ -681,6 +681,18 @@ mode->allowGSYNC = False; } + /* AllowGSYNCCompatible */ + } else if (!strcasecmp("allowgsynccompatible", token)) { + mode->allowGSYNCCompatibleSpecified = True; + if (!strcasecmp("on", value)) { + mode->allowGSYNCCompatible = True; + } else { + mode->allowGSYNCCompatible = False; + } + + /* VRRMinRefreshRate */ + } else if (!strcasecmp("vrrminrefreshrate", token)) { + parse_read_integer(value, &(mode->vrrMinRefreshRate)); } } @@ -722,6 +734,9 @@ mode->passive_stereo_eye = PASSIVE_STEREO_EYE_NONE; mode->position_type = CONF_ADJ_ABSOLUTE; mode->allowGSYNC = True; + mode->allowGSYNCCompatibleSpecified = False; + mode->allowGSYNCCompatible = True; + mode->vrrMinRefreshRate = 0; /* Read the mode name */ str = parse_read_name(str, &mode_name, 0); @@ -1200,6 +1215,24 @@ g_free(flags_str); flags_str = tmp; } + + /* AllowGSYNCCompatible */ + if (mode->allowGSYNCCompatibleSpecified) { + tmp = g_strdup_printf("%s, AllowGSYNCCompatible=%s", + (flags_str ? flags_str : ""), + mode->allowGSYNCCompatible ? "On" : "Off"); + g_free(flags_str); + flags_str = tmp; + } + + /* VRRMinRefreshRate */ + if (mode->vrrMinRefreshRate) { + tmp = g_strdup_printf("%s, VRRMinRefreshRate=%d", + (flags_str ? flags_str : ""), + mode->vrrMinRefreshRate); + g_free(flags_str); + flags_str = tmp; + } if (flags_str) { tmp = g_strdup_printf("%s {%s}", diff -Nru nvidia-settings-415.27/src/gtk+-2.x/ctkdisplaydevice.c nvidia-settings-418.56/src/gtk+-2.x/ctkdisplaydevice.c --- nvidia-settings-415.27/src/gtk+-2.x/ctkdisplaydevice.c 2018-12-20 23:41:44.000000000 +0000 +++ nvidia-settings-418.56/src/gtk+-2.x/ctkdisplaydevice.c 2019-03-15 17:56:18.000000000 +0000 @@ -64,6 +64,8 @@ static gboolean update_connector_type_info(InfoEntry *entry); static gboolean update_multistream_info(InfoEntry *entry); static gboolean update_audio_info(InfoEntry *entry); +static gboolean update_vrr_type_info(InfoEntry *entry); +static gboolean update_vrr_enabled_info(InfoEntry *entry); static gboolean register_link_events(InfoEntry *entry); static gboolean unregister_link_events(InfoEntry *entry); @@ -115,6 +117,17 @@ static const char * __audio_help = "Report whether the configured DisplayPort display is capable of playing audio."; +static const char * __vrr_type_help = +"Report whether the configured display supports G-SYNC, G-SYNC Compatible, or " +"neither."; + +static const char * __vrr_enabled_help = +"Report whether the configured display enabled variable refresh mode at " +"modeset time. On displays capable of variable refresh mode but which are not " +"validated as G-SYNC compatible, variable refresh mode can be enabled on the X " +"Server Display Configuration page, or by using the AllowGSYNCCompatible " +"MetaMode attribute."; + typedef gboolean (*InfoEntryFunc)(InfoEntry *entry); typedef struct { @@ -189,6 +202,20 @@ NULL, NULL, }, + { + "G-SYNC Mode Available", + &__vrr_type_help, + update_vrr_type_info, + NULL, + NULL, + }, + { + "G-SYNC Mode Enabled", + &__vrr_enabled_help, + update_vrr_enabled_info, + NULL, + NULL, + }, }; GType ctk_display_device_get_type(void) @@ -836,6 +863,59 @@ return TRUE; } + +static gboolean update_vrr_type_info(InfoEntry *entry) +{ + CtkDisplayDevice *ctk_object = entry->ctk_object; + CtrlTarget *ctrl_target = ctk_object->ctrl_target; + ReturnStatus ret; + gint val; + const char *str; + + ret = NvCtrlGetAttribute(ctrl_target, + NV_CTRL_DISPLAY_VRR_MODE, &val); + if (ret != NvCtrlSuccess) { + return FALSE; + } + + switch (val) { + case NV_CTRL_DISPLAY_VRR_MODE_GSYNC: + str = "G-SYNC"; + break; + case NV_CTRL_DISPLAY_VRR_MODE_GSYNC_COMPATIBLE: + str = "G-SYNC Compatible"; + break; + case NV_CTRL_DISPLAY_VRR_MODE_GSYNC_COMPATIBLE_UNVALIDATED: + str = "G-SYNC Unvalidated"; + break; + default: + case NV_CTRL_DISPLAY_VRR_MODE_NONE: + str = "None"; + break; + } + + gtk_label_set_text(GTK_LABEL(entry->txt), str); + + return TRUE; +} + +static gboolean update_vrr_enabled_info(InfoEntry *entry) +{ + CtkDisplayDevice *ctk_object = entry->ctk_object; + CtrlTarget *ctrl_target = ctk_object->ctrl_target; + ReturnStatus ret; + gint val; + + ret = NvCtrlGetAttribute(ctrl_target, + NV_CTRL_DISPLAY_VRR_ENABLED, &val); + if (ret != NvCtrlSuccess) { + return FALSE; + } + + gtk_label_set_text(GTK_LABEL(entry->txt), val ? "Yes" : "No"); + + return TRUE; +} diff -Nru nvidia-settings-415.27/src/gtk+-2.x/ctkdisplaylayout.c nvidia-settings-418.56/src/gtk+-2.x/ctkdisplaylayout.c --- nvidia-settings-415.27/src/gtk+-2.x/ctkdisplaylayout.c 2018-12-20 23:41:45.000000000 +0000 +++ nvidia-settings-418.56/src/gtk+-2.x/ctkdisplaylayout.c 2019-03-15 17:56:19.000000000 +0000 @@ -2351,6 +2351,9 @@ /* Move the screen and its displays to the top of the Z order */ select_screen(ctk_object, display->screen); + /* Clear any previously selected PRIME display */ + ctk_object->selected_prime_display = NULL; + /* Move the display to the top of the Z order */ for (i = 0; i < ctk_object->Zcount; i++) { @@ -2396,6 +2399,9 @@ /* Move the screen and its displays to the top of the Z order */ select_screen(ctk_object, prime->screen); + /* Clear any previously selected display */ + ctk_object->selected_display = NULL; + /* Move the display to the top of the Z order */ for (i = 0; i < ctk_object->Zcount; i++) { diff -Nru nvidia-settings-415.27/src/gtk+-2.x/ctkdisplaylayout.h nvidia-settings-418.56/src/gtk+-2.x/ctkdisplaylayout.h --- nvidia-settings-415.27/src/gtk+-2.x/ctkdisplaylayout.h 2018-12-20 23:41:46.000000000 +0000 +++ nvidia-settings-418.56/src/gtk+-2.x/ctkdisplaylayout.h 2019-03-15 17:56:19.000000000 +0000 @@ -228,6 +228,9 @@ Bool forceCompositionPipeline; Bool forceFullCompositionPipeline; Bool allowGSYNC; + Bool allowGSYNCCompatibleSpecified; + Bool allowGSYNCCompatible; + int vrrMinRefreshRate; } nvMode, *nvModePtr; diff -Nru nvidia-settings-415.27/src/gtk+-2.x/ctkevent.c nvidia-settings-418.56/src/gtk+-2.x/ctkevent.c --- nvidia-settings-415.27/src/gtk+-2.x/ctkevent.c 2018-12-20 23:41:44.000000000 +0000 +++ nvidia-settings-418.56/src/gtk+-2.x/ctkevent.c 2019-03-15 17:56:18.000000000 +0000 @@ -332,7 +332,7 @@ MAKE_SIGNAL(NV_CTRL_THERMAL_COOLER_SPEED); MAKE_SIGNAL(NV_CTRL_PALETTE_UPDATE_EVENT); MAKE_SIGNAL(NV_CTRL_VIDEO_ENCODER_UTILIZATION); - MAKE_SIGNAL(NV_CTRL_GSYNC_ALLOWED); + MAKE_SIGNAL(NV_CTRL_VRR_ALLOWED); MAKE_SIGNAL(NV_CTRL_GPU_NVCLOCK_OFFSET); MAKE_SIGNAL(NV_CTRL_GPU_MEM_TRANSFER_RATE_OFFSET); MAKE_SIGNAL(NV_CTRL_GPU_NVCLOCK_OFFSET_ALL_PERFORMANCE_LEVELS); @@ -340,7 +340,7 @@ MAKE_SIGNAL(NV_CTRL_VIDEO_DECODER_UTILIZATION); MAKE_SIGNAL(NV_CTRL_GPU_OVER_VOLTAGE_OFFSET); MAKE_SIGNAL(NV_CTRL_GPU_CURRENT_CORE_VOLTAGE); - MAKE_SIGNAL(NV_CTRL_SHOW_GSYNC_VISUAL_INDICATOR); + MAKE_SIGNAL(NV_CTRL_SHOW_VRR_VISUAL_INDICATOR); MAKE_SIGNAL(NV_CTRL_THERMAL_COOLER_CURRENT_LEVEL); MAKE_SIGNAL(NV_CTRL_STEREO_SWAP_MODE); MAKE_SIGNAL(NV_CTRL_GPU_FRAMELOCK_FIRMWARE_UNSUPPORTED); @@ -348,6 +348,9 @@ MAKE_SIGNAL(NV_CTRL_DISPLAYPORT_IS_MULTISTREAM); MAKE_SIGNAL(NV_CTRL_DISPLAYPORT_SINK_IS_AUDIO_CAPABLE); MAKE_SIGNAL(NV_CTRL_SHOW_GRAPHICS_VISUAL_INDICATOR); + MAKE_SIGNAL(NV_CTRL_DISPLAY_VRR_MODE); + MAKE_SIGNAL(NV_CTRL_DISPLAY_VRR_MIN_REFRESH_RATE); + MAKE_SIGNAL(NV_CTRL_DISPLAY_VRR_ENABLED); #undef MAKE_SIGNAL /* @@ -357,7 +360,7 @@ * knows about. */ -#if NV_CTRL_LAST_ATTRIBUTE != NV_CTRL_SHOW_GRAPHICS_VISUAL_INDICATOR +#if NV_CTRL_LAST_ATTRIBUTE != NV_CTRL_DISPLAY_VRR_ENABLED #warning "There are attributes that do not emit signals!" #endif diff -Nru nvidia-settings-415.27/src/gtk+-2.x/ctkgridlicense.c nvidia-settings-418.56/src/gtk+-2.x/ctkgridlicense.c --- nvidia-settings-415.27/src/gtk+-2.x/ctkgridlicense.c 2018-12-20 23:41:45.000000000 +0000 +++ nvidia-settings-418.56/src/gtk+-2.x/ctkgridlicense.c 2019-03-15 17:56:19.000000000 +0000 @@ -2,7 +2,7 @@ * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix * and Linux systems. * - * Copyright (C) 2017 NVIDIA Corporation. + * Copyright (C) 2019 NVIDIA Corporation. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -43,17 +43,17 @@ #include #include -#define DEFAULT_UPDATE_GRID_LICENSE_STATUS_INFO_TIME_INTERVAL 1000 -#define GRID_CONFIG_FILE "/etc/nvidia/gridd.conf" -#define GRID_CONFIG_FILE_TEMPLATE "/etc/nvidia/gridd.conf.template" +#define DEFAULT_UPDATE_GRID_LICENSE_STATUS_INFO_TIME_INTERVAL 1000 +#define GRID_CONFIG_FILE "/etc/nvidia/gridd.conf" +#define GRID_CONFIG_FILE_TEMPLATE "/etc/nvidia/gridd.conf.template" static const char * __manage_grid_licenses_help = "Use the Manage GRID License page to obtain licenses " -"for GRID vGPU or Quadro Virtual Datacenter Workstation on supported Tesla products."; +"for GRID vGPU or Quadro Virtual Data Center Workstation on supported Tesla products."; static const char * __grid_virtual_workstation_help = -"Select this option to enable Quadro Virtual Datacenter Workstation license."; +"Select this option to enable Quadro Virtual Data Center Workstation license."; static const char * __grid_vapp_help = -"Select this option to disable the Quadro Virtual Datacenter Workstation license."; +"Select this option to disable the Quadro Virtual Data Center Workstation license."; static const char * __license_edition_help = "This section indicates the status of GRID licensing for the system."; static const char * __license_server_help = @@ -119,7 +119,7 @@ static gboolean enable_disable_ui_controls(GtkWidget *widget, GdkEvent *event, gpointer user_data); static void update_gui_from_griddconfig(gpointer user_data); static gboolean licenseStateQueryFailed = FALSE; -static void get_licensed_feature_code(gpointer user_data); +static void get_licensed_feature_information(gpointer user_data); static gboolean is_restart_required(gpointer user_data); static gboolean queryLicensedFeatureCode = TRUE; int64_t licensedFeatureCode = NV_GRID_LICENSE_FEATURE_TYPE_VAPP; @@ -739,16 +739,15 @@ return ret; } - /* * update_manage_grid_license_state_info() - update manage_grid_license state */ - static gboolean update_manage_grid_license_state_info(gpointer user_data) { CtkManageGridLicense *ctk_manage_grid_license = CTK_MANAGE_GRID_LICENSE(user_data); gchar *licenseStatusMessage = ""; gboolean ret = TRUE; + char licenseStatusMsgTmp[GRID_MESSAGE_MAX_BUFFER_SIZE] = {0}; int licenseStatus = NV_GRID_UNLICENSED_VGPU; int licenseState = NV_GRID_UNLICENSED; @@ -844,7 +843,7 @@ break; } if (queryLicensedFeatureCode == TRUE) { - get_licensed_feature_code(ctk_manage_grid_license); + get_licensed_feature_information(ctk_manage_grid_license); queryLicensedFeatureCode = FALSE; } } @@ -925,58 +924,47 @@ switch (licenseStatus) { case NV_GRID_UNLICENSED_VGPU: - licenseStatusMessage = "Your system does not have a valid GRID vGPU license.\n" - "Enter license server details and apply."; + snprintf(licenseStatusMsgTmp, sizeof(licenseStatusMsgTmp), "Your system does not have a valid %s license.\n" + "Enter license server details and apply.", ctk_manage_grid_license->productName); + licenseStatusMessage = licenseStatusMsgTmp; break; case NV_GRID_UNLICENSED_VAPP: - licenseStatusMessage = "Your system is currently configured for " - "GRID Virtual Apps."; + snprintf(licenseStatusMsgTmp, sizeof(licenseStatusMsgTmp), "Your system is currently configured for %s.", GRID_VIRTUAL_APPLICATIONS); + licenseStatusMessage = licenseStatusMsgTmp; break; case NV_GRID_UNLICENSED_QDWS_SELECTED: - licenseStatusMessage = "Your system is currently configured for GRID Virtual Apps.\n" - "Enter license server details and apply."; + snprintf(licenseStatusMsgTmp, sizeof(licenseStatusMsgTmp), "Your system is currently configured for %s.\n" + "Enter license server details and apply.", GRID_VIRTUAL_APPLICATIONS); + licenseStatusMessage = licenseStatusMsgTmp; break; case NV_GRID_LICENSE_ACQUIRED_VGPU: - licenseStatusMessage = "Your system is licensed for GRID vGPU."; - break; case NV_GRID_LICENSE_ACQUIRED_QDWS: - licenseStatusMessage = "Your system is licensed for Quadro Virtual Datacenter " - "Workstation."; + snprintf(licenseStatusMsgTmp, sizeof(licenseStatusMsgTmp), "Your system is licensed for %s.", ctk_manage_grid_license->productName); + licenseStatusMessage = licenseStatusMsgTmp; break; case NV_GRID_LICENSE_REQUESTING_VGPU: - licenseStatusMessage = "Acquiring license for GRID vGPU.\n" - "Your system does not have a valid GRID vGPU license."; - break; case NV_GRID_LICENSE_REQUESTING_QDWS: - licenseStatusMessage = "Acquiring license for Quadro Virtual Datacenter " - "Workstation.\n" - " Your system is currently configured for GRID Virtual Apps."; + snprintf(licenseStatusMsgTmp, sizeof(licenseStatusMsgTmp), "Acquiring license for %s.", ctk_manage_grid_license->productName); + licenseStatusMessage = licenseStatusMsgTmp; break; case NV_GRID_LICENSE_FAILED_VGPU: - licenseStatusMessage = "Failed to acquire GRID vGPU license."; - break; case NV_GRID_LICENSE_FAILED_QDWS: - licenseStatusMessage = "Failed to acquire Quadro Virtual Datacenter " - "Worstation license.\n" - " Your system is currently configured for GRID Virtual Apps."; + snprintf(licenseStatusMsgTmp, sizeof(licenseStatusMsgTmp), "Failed to acquire %s license.", ctk_manage_grid_license->productName); + licenseStatusMessage = licenseStatusMsgTmp; break; case NV_GRID_LICENSE_EXPIRED_VGPU: - licenseStatusMessage = "GRID vGPU license has expired.\n" - "Your system does not have a valid GRID vGPU license."; - break; case NV_GRID_LICENSE_EXPIRED_QDWS: - licenseStatusMessage = "License for Quadro Virtual Datacenter Workstation " - "has expired.\n" - "Your system does not have a valid Quadro Virtual Datacenter " - "Workstation license."; + snprintf(licenseStatusMsgTmp, sizeof(licenseStatusMsgTmp), "%s license has expired.", ctk_manage_grid_license->productName); + licenseStatusMessage = licenseStatusMsgTmp; break; case NV_GRID_LICENSE_RESTART_REQUIRED: - licenseStatusMessage = "Restart your system for GRID Virtual Apps.\n" - "Your system is currently licensed for Quadro Virtual Datacenter " - "Workstation."; + snprintf(licenseStatusMsgTmp, sizeof(licenseStatusMsgTmp), "Restart your system for %s.\n" + "Your system is currently licensed for %s.", GRID_VIRTUAL_APPLICATIONS, ctk_manage_grid_license->productName); + licenseStatusMessage = licenseStatusMsgTmp; break; case NV_GRID_LICENSE_RESTART_REQUIRED_VAPP: - licenseStatusMessage = "Restart your system for GRID Virtual Apps."; + snprintf(licenseStatusMsgTmp, sizeof(licenseStatusMsgTmp), "Restart your system for %s.",GRID_VIRTUAL_APPLICATIONS); + licenseStatusMessage = licenseStatusMsgTmp; break; case NV_GRID_UNLICENSED_REQUEST_DETAILS: default: @@ -1010,7 +998,6 @@ /* * apply_clicked() - Called when the user clicks on the "Apply" button. */ - static void apply_clicked(GtkWidget *widget, gpointer user_data) { CtkManageGridLicense *ctk_manage_grid_license = CTK_MANAGE_GRID_LICENSE(user_data); @@ -1093,9 +1080,9 @@ } /* - * get_licensed_feature_code() - Get the feature code of the feature that is licensed on this system. + * get_licensed_feature_information() - Get the details of the feature that is licensed on this system. */ -static void get_licensed_feature_code(gpointer user_data) +static void get_licensed_feature_information(gpointer user_data) { CtkManageGridLicense *ctk_manage_grid_license = CTK_MANAGE_GRID_LICENSE(user_data); nvmlGridLicensableFeatures_t *gridLicensableFeatures; @@ -1110,6 +1097,11 @@ for (i = 0; i < gridLicensableFeatures->licensableFeaturesCount; i++) { + strncpy(ctk_manage_grid_license->productName, + gridLicensableFeatures->gridLicensableFeatures[i].productName, + sizeof(ctk_manage_grid_license->productName) - 1); + ctk_manage_grid_license->productName[sizeof(ctk_manage_grid_license->productName) - 1] = '\0'; + if (gridLicensableFeatures->gridLicensableFeatures[i].featureState != 0) { licensedFeatureCode = gridLicensableFeatures->gridLicensableFeatures[i].featureCode; @@ -1122,7 +1114,6 @@ /* * cancel_clicked() - Called when the user clicks on the "Cancel" button. */ - static void cancel_clicked(GtkWidget *widget, gpointer user_data) { CtkManageGridLicense *ctk_manage_grid_license = CTK_MANAGE_GRID_LICENSE(user_data); @@ -1157,7 +1148,7 @@ gtk_entry_set_text(GTK_ENTRY(ctk_manage_grid_license->txt_secondary_server_port), griddConfig->str[NV_GRIDD_BACKUP_SERVER_PORT]); /* set default value for feature type based on the user configured parameter or virtualization mode */ - /* Check Feature type "2" for Quadro Virtual Datacenter Workstation. */ + /* Check Feature type "2" for Quadro Virtual Data Center Workstation. */ if (strcmp(griddConfig->str[NV_GRIDD_FEATURE_TYPE], "2") == 0) { ctk_manage_grid_license->feature_type = NV_GRID_LICENSE_FEATURE_TYPE_QDWS; } @@ -1174,11 +1165,11 @@ /* Set license edition toggle button active */ if (ctk_manage_grid_license->radio_btn_qdws && ctk_manage_grid_license->radio_btn_vapp) { if (ctk_manage_grid_license->feature_type == NV_GRID_LICENSE_FEATURE_TYPE_QDWS) { - /* Set 'Quadro Virtual Datacenter Workstation' toggle button active */ + /* Set 'Quadro Virtual Data Center Workstation' toggle button active */ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ctk_manage_grid_license->radio_btn_qdws), TRUE); } else { - /* Set 'GRID Virtual Apps' toggle button active */ + /* Set 'GRID Virtual Applications' toggle button active */ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ctk_manage_grid_license->radio_btn_vapp), TRUE); } } @@ -1216,6 +1207,7 @@ gboolean enabled; gchar *statusBarMsg = ""; NvGriddConfigParams *griddConfig; + char licenseStatusMsgTmp[GRID_MESSAGE_MAX_BUFFER_SIZE] = {0}; const char *textBoxServerStr, *textBoxServerPortStr, *textBoxSecondaryServerStr, *textBoxSecondaryServerPortStr; griddConfig = GetNvGriddConfigParams(); @@ -1237,7 +1229,8 @@ if (GPOINTER_TO_INT(user_data) == NV_GRID_LICENSE_FEATURE_TYPE_QDWS) { gtk_widget_set_sensitive(ctk_manage_grid_license->box_server_info, TRUE); - statusBarMsg = "You selected Quadro Virtual Datacenter Workstation Edition."; + snprintf(licenseStatusMsgTmp, sizeof(licenseStatusMsgTmp), "You selected %s", ctk_manage_grid_license->productName); + statusBarMsg = licenseStatusMsgTmp; ctk_manage_grid_license->feature_type = NV_GRID_LICENSE_FEATURE_TYPE_QDWS; /* Enable Apply/Cancel button if the feature type selection has changed*/ @@ -1268,7 +1261,8 @@ gtk_widget_set_sensitive(ctk_manage_grid_license->box_server_info, FALSE); ctk_manage_grid_license->feature_type = NV_GRID_LICENSE_FEATURE_TYPE_VAPP; - statusBarMsg = "You selected GRID Virtual Apps Edition."; + snprintf(licenseStatusMsgTmp, sizeof(licenseStatusMsgTmp), "You selected %s", GRID_VIRTUAL_APPLICATIONS); + statusBarMsg = licenseStatusMsgTmp; /* Enable Apply/Cancel button if the feature type selection has changed*/ if (strcmp(griddConfig->str[NV_GRIDD_FEATURE_TYPE], "0") != 0) { gtk_widget_set_sensitive(ctk_manage_grid_license->btn_apply, TRUE); @@ -1451,11 +1445,9 @@ if (configFile) { fclose(configFile); } - return ret; + return ret; } - - GtkWidget* ctk_manage_grid_license_new(CtrlTarget *target, CtkConfig *ctk_config) { @@ -1505,10 +1497,10 @@ } /* GRID M6 is licensable gpu so we want to allow users to choose - * Quadro Virtual Datacenter Workstation and GRID Virtual Apps on baremetal setup. + * Quadro Virtual Data Center Workstation and GRID Virtual Applications on baremetal setup. * When virtualization mode is NV_CTRL_ATTR_NVML_GPU_VIRTUALIZATION_MODE_NONE * treat it same way like NV_CTRL_ATTR_NVML_GPU_VIRTUALIZATION_MODE_PASSTHROUGH. - * So that it will show the Quadro Virtual Datacenter Workstation interface in case of + * So that it will show the Quadro Virtual Data Center Workstation interface in case of * baremetal setup. */ if (mode == NV_CTRL_ATTR_NVML_GPU_VIRTUALIZATION_MODE_NONE) { @@ -1566,6 +1558,8 @@ gtk_box_set_spacing(GTK_BOX(ctk_manage_grid_license), 5); + get_licensed_feature_information(ctk_manage_grid_license); + /* banner */ banner = ctk_banner_image_new(BANNER_ARTWORK_SERVER_LICENSING); @@ -1594,7 +1588,7 @@ gtk_container_set_border_width(GTK_CONTAINER(vbox3), 5); ctk_manage_grid_license->radio_btn_qdws = gtk_radio_button_new_with_label(NULL, - "Quadro Virtual Datacenter Workstation"); + ctk_manage_grid_license->productName); slist = gtk_radio_button_get_group(GTK_RADIO_BUTTON(ctk_manage_grid_license->radio_btn_qdws)); gtk_box_pack_start(GTK_BOX(vbox3), ctk_manage_grid_license->radio_btn_qdws, FALSE, FALSE, 0); g_object_set_data(G_OBJECT(ctk_manage_grid_license->radio_btn_qdws), "button_id", @@ -1603,7 +1597,7 @@ G_CALLBACK(license_edition_toggled), (gpointer) ctk_manage_grid_license); - ctk_manage_grid_license->radio_btn_vapp = gtk_radio_button_new_with_label(slist, "GRID Virtual Apps"); + ctk_manage_grid_license->radio_btn_vapp = gtk_radio_button_new_with_label(slist, GRID_VIRTUAL_APPLICATIONS); gtk_box_pack_start(GTK_BOX(vbox3), ctk_manage_grid_license->radio_btn_vapp, FALSE, FALSE, 0); g_object_set_data(G_OBJECT(ctk_manage_grid_license->radio_btn_vapp), "button_id", GINT_TO_POINTER(NV_GRID_LICENSE_FEATURE_TYPE_VAPP)); @@ -1785,8 +1779,6 @@ /* Update GUI with information from the nvidia-gridd config file */ update_gui_from_griddconfig(ctk_manage_grid_license); - get_licensed_feature_code(ctk_manage_grid_license); - /* Set the license feature type fetched from nvidia-gridd */ ctk_manage_grid_license->gridd_feature_type = ctk_manage_grid_license->feature_type; @@ -1835,10 +1827,10 @@ if (ctk_manage_grid_license->license_edition_state == NV_CTRL_ATTR_NVML_GPU_VIRTUALIZATION_MODE_PASSTHROUGH) { - ctk_help_heading(b, &i, "Quadro Virtual Datacenter Workstation"); + ctk_help_heading(b, &i, "%s", ctk_manage_grid_license->productName); ctk_help_para(b, &i, "%s", __grid_virtual_workstation_help); - ctk_help_heading(b, &i, "GRID Virtual Apps"); + ctk_help_heading(b, &i, "%s", GRID_VIRTUAL_APPLICATIONS); ctk_help_para(b, &i, "%s", __grid_vapp_help); } diff -Nru nvidia-settings-415.27/src/gtk+-2.x/ctkgridlicense.h nvidia-settings-418.56/src/gtk+-2.x/ctkgridlicense.h --- nvidia-settings-415.27/src/gtk+-2.x/ctkgridlicense.h 2018-12-20 23:41:46.000000000 +0000 +++ nvidia-settings-418.56/src/gtk+-2.x/ctkgridlicense.h 2019-03-15 17:56:19.000000000 +0000 @@ -39,6 +39,10 @@ #define CTK_MANAGE_GRID_LICENSE_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), CTK_TYPE_MANAGE_GRID_LICENSE, CtkMANAGE_GRID_LICENSEClass)) +#define GRID_LICENSE_INFO_MAX_LENGTH 128 +#define GRID_MESSAGE_MAX_BUFFER_SIZE 512 +#define GRID_VIRTUAL_APPLICATIONS "GRID Virtual Applications" + typedef struct _CtkManageGridLicense CtkManageGridLicense; typedef struct _CtkManageGridLicenseClass CtkManageGridLicenseClass; @@ -64,8 +68,9 @@ DbusData *dbusData; CtrlTarget *target; gint license_edition_state; - gint feature_type; // Feature type from UI/gridd.conf. - int gridd_feature_type; // Feature type fetched from nvidia-gridd. + gint feature_type; // Feature type from UI/gridd.conf. + int gridd_feature_type; // Feature type fetched from nvidia-gridd. + char productName[GRID_LICENSE_INFO_MAX_LENGTH]; // GRID product name fetched from nvml. }; /* diff -Nru nvidia-settings-415.27/src/gtk+-2.x/ctkopengl.c nvidia-settings-418.56/src/gtk+-2.x/ctkopengl.c --- nvidia-settings-415.27/src/gtk+-2.x/ctkopengl.c 2018-12-20 23:41:44.000000000 +0000 +++ nvidia-settings-418.56/src/gtk+-2.x/ctkopengl.c 2019-03-15 17:56:18.000000000 +0000 @@ -37,9 +37,9 @@ static void post_allow_flipping_button_toggled(CtkOpenGL *, gboolean); -static void post_allow_gsync_button_toggled(CtkOpenGL *, gboolean); +static void post_allow_vrr_button_toggled(CtkOpenGL *, gboolean); -static void post_show_gsync_visual_indicator_button_toggled(CtkOpenGL *, gboolean); +static void post_show_vrr_visual_indicator_button_toggled(CtkOpenGL *, gboolean); static void post_force_stereo_button_toggled(CtkOpenGL *, gboolean); @@ -61,9 +61,9 @@ static void allow_flipping_button_toggled(GtkWidget *, gpointer); -static void allow_gsync_button_toggled(GtkWidget *, gpointer); +static void allow_vrr_button_toggled(GtkWidget *, gpointer); -static void show_gsync_visual_indicator_button_toggled(GtkWidget *, gpointer); +static void show_vrr_visual_indicator_button_toggled(GtkWidget *, gpointer); static void force_stereo_button_toggled (GtkWidget *, gpointer); @@ -206,11 +206,11 @@ "seams at the edges of textures in some older games such as " "Quake 3."; -static const char *__show_gsync_visual_indicator_help = +static const char *__show_vrr_visual_indicator_help = "Enabling this option causes OpenGL to draw an indicator showing whether " -"G-SYNC is in use, when an application is swapping using flipping. This " -"option is applied to OpenGL applications that are started after this option " -"is set."; +"G-SYNC/G-SYNC Compatible is in use, when an application is swapping using " +"flipping. This option is applied to OpenGL applications that are started " +"after this option is set."; #define __SYNC_TO_VBLANK (1 << 1) #define __ALLOW_FLIPPING (1 << 2) @@ -224,8 +224,8 @@ #define __STEREO_EYES_EXCHANGE (1 << 10) #define __SHOW_MULTIGPU_VISUAL_INDICATOR (1 << 11) #define __CONFORMANT_CLAMPING (1 << 12) -#define __ALLOW_GSYNC (1 << 13) -#define __SHOW_GSYNC_VISUAL_INDICATOR (1 << 14) +#define __ALLOW_VRR (1 << 13) +#define __SHOW_VRR_VISUAL_INDICATOR (1 << 14) #define __STEREO_SWAP_MODE (1 << 15) #define __SHOW_GRAPHICS_VISUAL_INDICATOR (1 << 16) @@ -299,8 +299,8 @@ gint sync_to_vblank = 0; gint flipping_allowed = 0; - gint gsync_allowed = 0; - gint show_gsync_visual_indicator = 0; + gint vrr_allowed = 0; + gint show_vrr_visual_indicator = 0; gint force_stereo = 0; gint xinerama_stereo = 0; gint stereo_eyes_exchange = 0; @@ -315,8 +315,8 @@ ReturnStatus ret_sync_to_vblank; ReturnStatus ret_flipping_allowed; - ReturnStatus ret_gsync_allowed; - ReturnStatus ret_show_gsync_visual_indicator; + ReturnStatus ret_vrr_allowed; + ReturnStatus ret_show_vrr_visual_indicator; ReturnStatus ret_force_stereo; ReturnStatus ret_xinerama_stereo; ReturnStatus ret_stereo_eyes_exchange; @@ -340,15 +340,15 @@ NV_CTRL_FLIPPING_ALLOWED, &flipping_allowed); - ret_gsync_allowed = + ret_vrr_allowed = NvCtrlGetAttribute(ctrl_target, - NV_CTRL_GSYNC_ALLOWED, - &gsync_allowed); + NV_CTRL_VRR_ALLOWED, + &vrr_allowed); - ret_show_gsync_visual_indicator = + ret_show_vrr_visual_indicator = NvCtrlGetAttribute(ctrl_target, - NV_CTRL_SHOW_GSYNC_VISUAL_INDICATOR, - &show_gsync_visual_indicator); + NV_CTRL_SHOW_VRR_VISUAL_INDICATOR, + &show_vrr_visual_indicator); ret_force_stereo = NvCtrlGetAttribute(ctrl_target, @@ -411,8 +411,8 @@ /* There are no OpenGL settings to change (OpenGL disabled?) */ if ((ret_sync_to_vblank != NvCtrlSuccess) && (ret_flipping_allowed != NvCtrlSuccess) && - (ret_gsync_allowed != NvCtrlSuccess) && - (ret_show_gsync_visual_indicator != NvCtrlSuccess) && + (ret_vrr_allowed != NvCtrlSuccess) && + (ret_show_vrr_visual_indicator != NvCtrlSuccess) && (ret_force_stereo != NvCtrlSuccess) && (ret_xinerama_stereo != NvCtrlSuccess) && (ret_stereo_eyes_exchange != NvCtrlSuccess) && @@ -530,70 +530,70 @@ } /* - * allow G-SYNC + * allow G-SYNC/G-SYNC Compatible * * Always create the checkbox, but only show it if the attribute starts out * available. */ - label = gtk_label_new("Allow G-SYNC"); + label = gtk_label_new("Allow G-SYNC/G-SYNC Compatible"); check_button = gtk_check_button_new(); gtk_container_add(GTK_CONTAINER(check_button), label); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_button), - gsync_allowed); + vrr_allowed); gtk_box_pack_start(GTK_BOX(vbox), check_button, FALSE, FALSE, 0); g_signal_connect(G_OBJECT(check_button), "toggled", - G_CALLBACK(allow_gsync_button_toggled), + G_CALLBACK(allow_vrr_button_toggled), (gpointer) ctk_opengl); g_signal_connect(G_OBJECT(ctk_event), - CTK_EVENT_NAME(NV_CTRL_GSYNC_ALLOWED), + CTK_EVENT_NAME(NV_CTRL_VRR_ALLOWED), G_CALLBACK(value_changed), (gpointer) ctk_opengl); ctk_config_set_tooltip(ctk_config, check_button, "Enabling this option allows OpenGL to flip " - "using G-SYNC when possible. This option is " - "applied immediately."); + "using G-SYNC/G-SYNC Compatible when possible. " + "This option is applied immediately."); - ctk_opengl->active_attributes |= __ALLOW_GSYNC; + ctk_opengl->active_attributes |= __ALLOW_VRR; - ctk_opengl->allow_gsync_button = check_button; + ctk_opengl->allow_vrr_button = check_button; /* - * show G-SYNC visual indicator + * show G-SYNC/G-SYNC Compatible visual indicator * * Always create the checkbox, but only show it if the attribute starts out * available. */ - label = gtk_label_new("Enable G-SYNC Visual Indicator"); + label = gtk_label_new("Enable G-SYNC/G-SYNC Compatible Visual Indicator"); check_button = gtk_check_button_new(); gtk_container_add(GTK_CONTAINER(check_button), label); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_button), - show_gsync_visual_indicator); + show_vrr_visual_indicator); gtk_box_pack_start(GTK_BOX(vbox), check_button, FALSE, FALSE, 0); g_signal_connect(G_OBJECT(check_button), "toggled", - G_CALLBACK(show_gsync_visual_indicator_button_toggled), + G_CALLBACK(show_vrr_visual_indicator_button_toggled), (gpointer) ctk_opengl); g_signal_connect(G_OBJECT(ctk_event), - CTK_EVENT_NAME(NV_CTRL_SHOW_GSYNC_VISUAL_INDICATOR), + CTK_EVENT_NAME(NV_CTRL_SHOW_VRR_VISUAL_INDICATOR), G_CALLBACK(value_changed), (gpointer) ctk_opengl); ctk_config_set_tooltip(ctk_config, check_button, - __show_gsync_visual_indicator_help); + __show_vrr_visual_indicator_help); - ctk_opengl->active_attributes |= __SHOW_GSYNC_VISUAL_INDICATOR; + ctk_opengl->active_attributes |= __SHOW_VRR_VISUAL_INDICATOR; - ctk_opengl->show_gsync_visual_indicator_button = check_button; + ctk_opengl->show_vrr_visual_indicator_button = check_button; if (ret_force_stereo == NvCtrlSuccess) { @@ -920,14 +920,14 @@ gtk_widget_show_all(GTK_WIDGET(object)); /* - * If GSYNC is not currently available, start out with the GSYNC button - * hidden. + * If G-SYNC/G-SYNC Compatible is not currently available, start out with + * the button hidden. */ - if (ret_gsync_allowed != NvCtrlSuccess) { - gtk_widget_hide(GTK_WIDGET(ctk_opengl->allow_gsync_button)); + if (ret_vrr_allowed != NvCtrlSuccess) { + gtk_widget_hide(GTK_WIDGET(ctk_opengl->allow_vrr_button)); } - if (ret_show_gsync_visual_indicator != NvCtrlSuccess) { - gtk_widget_hide(GTK_WIDGET(ctk_opengl->show_gsync_visual_indicator_button)); + if (ret_show_vrr_visual_indicator != NvCtrlSuccess) { + gtk_widget_hide(GTK_WIDGET(ctk_opengl->show_vrr_visual_indicator_button)); } return GTK_WIDGET(object); @@ -952,20 +952,20 @@ enabled ? "allowed" : "not allowed"); } -static void post_allow_gsync_button_toggled(CtkOpenGL *ctk_opengl, - gboolean enabled) +static void post_allow_vrr_button_toggled(CtkOpenGL *ctk_opengl, + gboolean enabled) { ctk_config_statusbar_message(ctk_opengl->ctk_config, - "G-SYNC %s.", + "G-SYNC/G-SYNC Compatible %s.", enabled ? "allowed" : "not allowed"); } -static void post_show_gsync_visual_indicator_button_toggled(CtkOpenGL *ctk_opengl, - gboolean enabled) +static void post_show_vrr_visual_indicator_button_toggled(CtkOpenGL *ctk_opengl, + gboolean enabled) { ctk_config_statusbar_message(ctk_opengl->ctk_config, - "G-SYNC visual indicator %s.", - enabled ? "enabled" : "disabled"); + "G-SYNC/G-SYNC Compatible visual indicator " + "%s.", enabled ? "enabled" : "disabled"); } static void post_force_stereo_button_toggled(CtkOpenGL *ctk_opengl, @@ -1065,8 +1065,8 @@ post_allow_flipping_button_toggled(ctk_opengl, enabled); } -static void allow_gsync_button_toggled(GtkWidget *widget, - gpointer user_data) +static void allow_vrr_button_toggled(GtkWidget *widget, + gpointer user_data) { CtkOpenGL *ctk_opengl = CTK_OPENGL(user_data); CtrlTarget *ctrl_target = ctk_opengl->ctrl_target; @@ -1074,12 +1074,12 @@ enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); - NvCtrlSetAttribute(ctrl_target, NV_CTRL_GSYNC_ALLOWED, enabled); - post_allow_gsync_button_toggled(ctk_opengl, enabled); + NvCtrlSetAttribute(ctrl_target, NV_CTRL_VRR_ALLOWED, enabled); + post_allow_vrr_button_toggled(ctk_opengl, enabled); } -static void show_gsync_visual_indicator_button_toggled(GtkWidget *widget, - gpointer user_data) +static void show_vrr_visual_indicator_button_toggled(GtkWidget *widget, + gpointer user_data) { CtkOpenGL *ctk_opengl = CTK_OPENGL(user_data); CtrlTarget *ctrl_target = ctk_opengl->ctrl_target; @@ -1087,8 +1087,8 @@ enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); - NvCtrlSetAttribute(ctrl_target, NV_CTRL_SHOW_GSYNC_VISUAL_INDICATOR, enabled); - post_show_gsync_visual_indicator_button_toggled(ctk_opengl, enabled); + NvCtrlSetAttribute(ctrl_target, NV_CTRL_SHOW_VRR_VISUAL_INDICATOR, enabled); + post_show_vrr_visual_indicator_button_toggled(ctk_opengl, enabled); } static void force_stereo_button_toggled(GtkWidget *widget, @@ -1242,16 +1242,16 @@ func = G_CALLBACK(allow_flipping_button_toggled); post_allow_flipping_button_toggled(ctk_opengl, value); break; - case NV_CTRL_GSYNC_ALLOWED: - button = GTK_TOGGLE_BUTTON(ctk_opengl->allow_gsync_button); - func = G_CALLBACK(allow_gsync_button_toggled); - post_allow_gsync_button_toggled(ctk_opengl, value); + case NV_CTRL_VRR_ALLOWED: + button = GTK_TOGGLE_BUTTON(ctk_opengl->allow_vrr_button); + func = G_CALLBACK(allow_vrr_button_toggled); + post_allow_vrr_button_toggled(ctk_opengl, value); check_available = TRUE; break; - case NV_CTRL_SHOW_GSYNC_VISUAL_INDICATOR: - button = GTK_TOGGLE_BUTTON(ctk_opengl->show_gsync_visual_indicator_button); - func = G_CALLBACK(show_gsync_visual_indicator_button_toggled); - post_show_gsync_visual_indicator_button_toggled(ctk_opengl, value); + case NV_CTRL_SHOW_VRR_VISUAL_INDICATOR: + button = GTK_TOGGLE_BUTTON(ctk_opengl->show_vrr_visual_indicator_button); + func = G_CALLBACK(show_vrr_visual_indicator_button_toggled); + post_show_vrr_visual_indicator_button_toggled(ctk_opengl, value); check_available = TRUE; break; case NV_CTRL_FORCE_STEREO: @@ -1801,37 +1801,44 @@ "after the option is set."); } - if (ctk_opengl->active_attributes & __ALLOW_GSYNC) { - ctk_help_heading(b, &i, "Allow G-SYNC"); - ctk_help_para(b, &i, "Enabling this option allows OpenGL to use G-SYNC " - "when available. G-SYNC is a technology that allows a " - "monitor to delay updating the screen until the GPU is " - "ready to display a new frame. Without G-SYNC, the GPU " - "waits for the display to be ready to accept a new frame " - "instead."); + if (ctk_opengl->active_attributes & __ALLOW_VRR) { + ctk_help_heading(b, &i, "Allow G-SYNC/G-SYNC Compatible"); + ctk_help_para(b, &i, "Enabling this option allows OpenGL to use " + "G-SYNC/G-SYNC Compatible when available. G-SYNC and " + "G-SYNC Compatible are technologies that allow monitors " + "to delay updating the screen until the GPU is ready to " + "display a new frame. Without G-SYNC or G-SYNC " + "Compatible, the GPU waits for the display to be ready " + "to accept a new frame instead."); ctk_help_para(b, &i, "Note that this option is applied immediately, " "unlike most other OpenGL options which are only " "applied to OpenGL applications that are started " "after the option is set."); - ctk_help_para(b, &i, "When G-SYNC is active and \"Sync to VBlank\" is " - "disabled, applications rendering faster than the " - "maximum refresh rate will tear. This eliminates tearing " - "for frame rates below the monitor's maximum refresh " - "rate while minimizing latency for frame rates above it. " - "When \"Sync to VBlank\" is enabled, the frame rate is " + ctk_help_para(b, &i, "When G-SYNC is active on a G-SYNC or G-SYNC " + "Compatible display and \"Sync to VBlank\" is disabled, " + "applications rendering faster than the maximum refresh " + "rate will tear. This eliminates tearing for frame rates " + "below the monitor's maximum refresh rate while " + "minimizing latency for frame rates above it. When " + "\"Sync to VBlank\" is enabled, the frame rate is " "limited to the monitor's maximum refresh rate to " - "eliminate tearing completely."); + "eliminate tearing completely. When a G-SYNC Compatible " + "display is in use, applications rendering slower than " + "the minimum refresh rate may tear when " + "\"Sync to VBlank\" is disabled, and their swaps may " + "not complete until the next vblank when \"Sync to " + "VBlank\" is enabled."); ctk_help_para(b, &i, "This option can be overridden on a " - "per-application basis using the GLGSYNCAllowed " + "per-application basis using the GLVRRAllowed " "application profile key."); } - if (ctk_opengl->active_attributes & __SHOW_GSYNC_VISUAL_INDICATOR) { - ctk_help_heading(b, &i, "G-SYNC Visual Indicator"); - ctk_help_para(b, &i, "%s", __show_gsync_visual_indicator_help); + if (ctk_opengl->active_attributes & __SHOW_VRR_VISUAL_INDICATOR) { + ctk_help_heading(b, &i, "G-SYNC/G-SYNC Compatible Visual Indicator"); + ctk_help_para(b, &i, "%s", __show_vrr_visual_indicator_help); } if (ctk_opengl->active_attributes & __FORCE_STEREO) { diff -Nru nvidia-settings-415.27/src/gtk+-2.x/ctkopengl.h nvidia-settings-418.56/src/gtk+-2.x/ctkopengl.h --- nvidia-settings-415.27/src/gtk+-2.x/ctkopengl.h 2018-12-20 23:41:45.000000000 +0000 +++ nvidia-settings-418.56/src/gtk+-2.x/ctkopengl.h 2019-03-15 17:56:19.000000000 +0000 @@ -57,8 +57,8 @@ GtkWidget *sync_to_vblank_button; GtkWidget *allow_flipping_button; - GtkWidget *allow_gsync_button; - GtkWidget *show_gsync_visual_indicator_button; + GtkWidget *allow_vrr_button; + GtkWidget *show_vrr_visual_indicator_button; GtkWidget *use_conformant_clamping_button; GtkWidget *force_stereo_button; GtkWidget *xinerama_stereo_button; diff -Nru nvidia-settings-415.27/src/libXNVCtrl/NVCtrl.h nvidia-settings-418.56/src/libXNVCtrl/NVCtrl.h --- nvidia-settings-415.27/src/libXNVCtrl/NVCtrl.h 2018-12-20 23:41:44.000000000 +0000 +++ nvidia-settings-418.56/src/libXNVCtrl/NVCtrl.h 2019-03-15 17:56:18.000000000 +0000 @@ -3281,13 +3281,24 @@ #define NV_CTRL_VIDEO_ENCODER_UTILIZATION 407 /* R--G */ /* - * NV_CTRL_GSYNC_ALLOWED - when TRUE, OpenGL will enable G-SYNC when possible; - * when FALSE, OpenGL will always use a fixed monitor refresh rate. + * NV_CTRL_VRR_ALLOWED - when TRUE, OpenGL will enable G-SYNC and Adaptive-Sync + * when possible; when FALSE, OpenGL will always use a fixed monitor refresh + * rate. */ -#define NV_CTRL_GSYNC_ALLOWED 408 /* RW-X */ -#define NV_CTRL_GSYNC_ALLOWED_FALSE 0 -#define NV_CTRL_GSYNC_ALLOWED_TRUE 1 +#define NV_CTRL_VRR_ALLOWED 408 /* RW-X */ +#define NV_CTRL_VRR_ALLOWED_FALSE 0 +#define NV_CTRL_VRR_ALLOWED_TRUE 1 + +/* + * NV_CTRL_GSYNC_ALLOWED - renamed + * + * NV_CTRL_VRR_ALLOWED should be used instead. + */ + +#define NV_CTRL_GSYNC_ALLOWED NV_CTRL_VRR_ALLOWED +#define NV_CTRL_GSYNC_ALLOWED_FALSE NV_CTRL_VRR_ALLOWED_FALSE +#define NV_CTRL_GSYNC_ALLOWED_TRUE NV_CTRL_VRR_ALLOWED_TRUE /* * NV_CTRL_GPU_NVCLOCK_OFFSET - This attribute controls the GPU clock offsets @@ -3379,13 +3390,26 @@ #define NV_CTRL_CURRENT_COLOR_RANGE_LIMITED 1 /* - * NV_CTRL_SHOW_GSYNC_VISUAL_INDICATOR - when TRUE, OpenGL will indicate when - * G-SYNC is in use for full-screen applications. + * NV_CTRL_SHOW_VRR_VISUAL_INDICATOR - when TRUE, OpenGL will indicate when + * G-SYNC or G-SYNC Compatible is in use for full-screen applications. */ -#define NV_CTRL_SHOW_GSYNC_VISUAL_INDICATOR 416 /* RW-X */ -#define NV_CTRL_SHOW_GSYNC_VISUAL_INDICATOR_FALSE 0 -#define NV_CTRL_SHOW_GSYNC_VISUAL_INDICATOR_TRUE 1 +#define NV_CTRL_SHOW_VRR_VISUAL_INDICATOR 416 /* RW-X */ +#define NV_CTRL_SHOW_VRR_VISUAL_INDICATOR_FALSE 0 +#define NV_CTRL_SHOW_VRR_VISUAL_INDICATOR_TRUE 1 + +/* + * NV_CTRL_SHOW_GSYNC_VISUAL_INDICATOR - renamed + * + * NV_CTRL_SHOW_VRR_VISUAL_INDICATOR should be used instead. + */ + +#define NV_CTRL_SHOW_GSYNC_VISUAL_INDICATOR \ + NV_CTRL_SHOW_VRR_VISUAL_INDICATOR +#define NV_CTRL_SHOW_GSYNC_VISUAL_INDICATOR_FALSE \ + NV_CTRL_SHOW_VRR_VISUAL_INDICATOR_FALSE +#define NV_CTRL_SHOW_GSYNC_VISUAL_INDICATOR_TRUE \ + NV_CTRL_SHOW_VRR_VISUAL_INDICATOR_TRUE /* * NV_CTRL_THERMAL_COOLER_CURRENT_LEVEL - Returns cooler's current @@ -3522,7 +3546,37 @@ #define NV_CTRL_SHOW_GRAPHICS_VISUAL_INDICATOR_FALSE 0 #define NV_CTRL_SHOW_GRAPHICS_VISUAL_INDICATOR_TRUE 1 -#define NV_CTRL_LAST_ATTRIBUTE NV_CTRL_SHOW_GRAPHICS_VISUAL_INDICATOR +/* + * NV_CTRL_DISPLAY_VRR_MODE - Indicates whether the specified display device + * supports G-SYNC, G-SYNC Compatible (validated or unvalidated), or none of + * the above. + */ + +#define NV_CTRL_DISPLAY_VRR_MODE 429 /* R-D- */ +#define NV_CTRL_DISPLAY_VRR_MODE_NONE 0 +#define NV_CTRL_DISPLAY_VRR_MODE_GSYNC 1 +#define NV_CTRL_DISPLAY_VRR_MODE_GSYNC_COMPATIBLE 2 +#define NV_CTRL_DISPLAY_VRR_MODE_GSYNC_COMPATIBLE_UNVALIDATED 3 + +/* + * NV_CTRL_DISPLAY_VRR_MIN_REFRESH_RATE - Indicates the minimum refresh rate for + * the specified VRR display device. + */ + +#define NV_CTRL_DISPLAY_VRR_MIN_REFRESH_RATE 430 /* R-D- */ + +/* + * NV_CTRL_DISPLAY_VRR_ENABLED - Indicates whether the specified display + * device enabled VRR at modeset time, and is capable of VRR flipping if + * NV_CTRL_VRR_ALLOWED is set. If this is FALSE, NV_CTRL_VRR_ALLOWED has no + * effect. + */ + +#define NV_CTRL_DISPLAY_VRR_ENABLED 431 /* R-D- */ +#define NV_CTRL_DISPLAY_VRR_ENABLED_FALSE 0 +#define NV_CTRL_DISPLAY_VRR_ENABLED_TRUE 1 + +#define NV_CTRL_LAST_ATTRIBUTE NV_CTRL_DISPLAY_VRR_ENABLED /**************************************************************************/ diff -Nru nvidia-settings-415.27/src/libXNVCtrl/version.mk nvidia-settings-418.56/src/libXNVCtrl/version.mk --- nvidia-settings-415.27/src/libXNVCtrl/version.mk 2018-12-20 23:41:43.000000000 +0000 +++ nvidia-settings-418.56/src/libXNVCtrl/version.mk 2019-03-15 17:56:18.000000000 +0000 @@ -1 +1 @@ -NVIDIA_VERSION = 415.27 +NVIDIA_VERSION = 418.56 diff -Nru nvidia-settings-415.27/src/libXNVCtrlAttributes/NvCtrlAttributesNvml.c nvidia-settings-418.56/src/libXNVCtrlAttributes/NvCtrlAttributesNvml.c --- nvidia-settings-415.27/src/libXNVCtrlAttributes/NvCtrlAttributesNvml.c 2018-12-20 23:41:44.000000000 +0000 +++ nvidia-settings-418.56/src/libXNVCtrlAttributes/NvCtrlAttributesNvml.c 2019-03-15 17:56:18.000000000 +0000 @@ -206,7 +206,7 @@ #define GET_SYMBOL_OPTIONAL(_proc, _name) \ nvml->lib._proc = dlsym(nvml->lib.handle, _name); - GET_SYMBOL_OPTIONAL(deviceGetGridLicensableFeatures, "nvmlDeviceGetGridLicensableFeatures"); + GET_SYMBOL_OPTIONAL(deviceGetGridLicensableFeatures, "nvmlDeviceGetGridLicensableFeatures_v2"); #undef GET_SYMBOL_OPTIONAL ret = nvml->lib.init(); diff -Nru nvidia-settings-415.27/src/libXNVCtrlAttributes/NvCtrlAttributesPrivate.h nvidia-settings-418.56/src/libXNVCtrlAttributes/NvCtrlAttributesPrivate.h --- nvidia-settings-415.27/src/libXNVCtrlAttributes/NvCtrlAttributesPrivate.h 2018-12-20 23:41:45.000000000 +0000 +++ nvidia-settings-418.56/src/libXNVCtrlAttributes/NvCtrlAttributesPrivate.h 2019-03-15 17:56:19.000000000 +0000 @@ -164,21 +164,21 @@ struct { void *handle; - typeof(nvmlInit) (*init); - typeof(nvmlShutdown) (*shutdown); - typeof(nvmlDeviceGetHandleByIndex) (*deviceGetHandleByIndex); - typeof(nvmlDeviceGetUUID) (*deviceGetUUID); - typeof(nvmlDeviceGetCount) (*deviceGetCount); - typeof(nvmlDeviceGetTemperature) (*deviceGetTemperature); - typeof(nvmlDeviceGetFanSpeed) (*deviceGetFanSpeed); - typeof(nvmlDeviceGetName) (*deviceGetName); - typeof(nvmlDeviceGetVbiosVersion) (*deviceGetVbiosVersion); - typeof(nvmlDeviceGetMemoryInfo) (*deviceGetMemoryInfo); - typeof(nvmlDeviceGetPciInfo) (*deviceGetPciInfo); - typeof(nvmlDeviceGetMaxPcieLinkGeneration) (*deviceGetMaxPcieLinkGeneration); - typeof(nvmlDeviceGetMaxPcieLinkWidth) (*deviceGetMaxPcieLinkWidth); - typeof(nvmlDeviceGetVirtualizationMode) (*deviceGetVirtualizationMode); - typeof(nvmlDeviceGetGridLicensableFeatures) (*deviceGetGridLicensableFeatures); + typeof(nvmlInit) (*init); + typeof(nvmlShutdown) (*shutdown); + typeof(nvmlDeviceGetHandleByIndex) (*deviceGetHandleByIndex); + typeof(nvmlDeviceGetUUID) (*deviceGetUUID); + typeof(nvmlDeviceGetCount) (*deviceGetCount); + typeof(nvmlDeviceGetTemperature) (*deviceGetTemperature); + typeof(nvmlDeviceGetFanSpeed) (*deviceGetFanSpeed); + typeof(nvmlDeviceGetName) (*deviceGetName); + typeof(nvmlDeviceGetVbiosVersion) (*deviceGetVbiosVersion); + typeof(nvmlDeviceGetMemoryInfo) (*deviceGetMemoryInfo); + typeof(nvmlDeviceGetPciInfo) (*deviceGetPciInfo); + typeof(nvmlDeviceGetMaxPcieLinkGeneration) (*deviceGetMaxPcieLinkGeneration); + typeof(nvmlDeviceGetMaxPcieLinkWidth) (*deviceGetMaxPcieLinkWidth); + typeof(nvmlDeviceGetVirtualizationMode) (*deviceGetVirtualizationMode); + typeof(nvmlDeviceGetGridLicensableFeatures_v2) (*deviceGetGridLicensableFeatures); } lib; diff -Nru nvidia-settings-415.27/src/nvml.h nvidia-settings-418.56/src/nvml.h --- nvidia-settings-415.27/src/nvml.h 2018-12-20 23:41:44.000000000 +0000 +++ nvidia-settings-418.56/src/nvml.h 2019-03-15 17:56:19.000000000 +0000 @@ -715,6 +715,7 @@ */ typedef enum nvmlReturn_enum { + // cppcheck-suppress * NVML_SUCCESS = 0, //!< The operation was successful NVML_ERROR_UNINITIALIZED = 1, //!< NVML was not first initialized with nvmlInit() NVML_ERROR_INVALID_ARGUMENT = 2, //!< A supplied argument is invalid @@ -3059,6 +3060,32 @@ */ nvmlReturn_t DECLDIR nvmlDeviceGetFanSpeed(nvmlDevice_t device, unsigned int *speed); + +/** + * Retrieves the intended operating speed of the device's specified fan. + * + * Note: The reported speed is the intended fan speed. If the fan is physically blocked and unable to spin, the + * output will not match the actual fan speed. + * + * For all discrete products with dedicated fans. + * + * The fan speed is expressed as a percentage of the maximum, i.e. full speed is 100% + * + * @param device The identifier of the target device + * @param fan The index of the target fan, zero indexed. + * @param speed Reference in which to return the fan speed percentage + * + * @return + * - \ref NVML_SUCCESS if \a speed has been set + * - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized + * - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a fan is not an acceptable index, or \a speed is NULL + * - \ref NVML_ERROR_NOT_SUPPORTED if the device does not have a fan or is newer than Maxwell + * - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible + * - \ref NVML_ERROR_UNKNOWN on any unexpected error + */ +nvmlReturn_t DECLDIR nvmlDeviceGetFanSpeed_v2(nvmlDevice_t device, unsigned int fan, unsigned int * speed); + + /** * Retrieves the current temperature readings for the device, in degrees C. * @@ -4344,6 +4371,12 @@ * * See \ref nvmlEnableState_t for available modes. * + * After calling this API with mode set to NVML_FEATURE_DISABLED on a device that has its own NUMA + * memory, the given device handle will no longer be valid, and to continue to interact with this + * device, a new handle should be obtained from one of the nvmlDeviceGetHandleBy*() APIs. This + * limitation is currently only applicable to devices that have a coherent NVLink connection to + * system memory. + * * @param device The identifier of the target device * @param mode The target persistence mode * @@ -5337,7 +5370,7 @@ * - \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuCount is NULL or \a device is invalid * - \ref NVML_ERROR_NOT_SUPPORTED if vGPU is not supported by the device * - \ref NVML_ERROR_VGPU_ECC_NOT_SUPPORTED if ECC is enabled on the device - * - \ref NVML_ERROR_UNKNOWN on any unexpected error + * - \ref NVML_ERROR_UNKNOWN on any unexpected error */ nvmlReturn_t DECLDIR nvmlDeviceGetSupportedVgpus(nvmlDevice_t device, unsigned int *vgpuCount, nvmlVgpuTypeId_t *vgpuTypeIds); @@ -6112,12 +6145,12 @@ /***************************************************************************************************/ /** - * Structure representing a range of vGPU version + * Structure representing range of vGPU versions. */ typedef struct nvmlVgpuVersion_st { - unsigned int minVersion; //!< Minimum vGPU version. - unsigned int maxVersion; //!< Maximum vGPU version. + unsigned int minVersion; //!< Minimum vGPU version. + unsigned int maxVersion; //!< Maximum vGPU version. } nvmlVgpuVersion_t; /** @@ -6191,7 +6224,7 @@ * * nvmlVgpuInstanceGetMetadata() may be called at any time for a vGPU instance. Some fields in the returned structure are * dependent on information obtained from the guest VM, which may not yet have reached a state where that information - * is available. The current state of these dependent fields is reflected in the info structure's \ref guestInfoState field. + * is available. The current state of these dependent fields is reflected in the info structure's \ref nvmlVgpuGuestInfoState_t field. * * The VMM may choose to read and save the vGPU's VM info as persistent metadata associated with the VM, and provide * it to GRID Virtual GPU Manager when creating a vGPU for subsequent instances of the VM. @@ -6259,41 +6292,62 @@ */ nvmlReturn_t DECLDIR nvmlGetVgpuCompatibility(nvmlVgpuMetadata_t *vgpuMetadata, nvmlVgpuPgpuMetadata_t *pgpuMetadata, nvmlVgpuPgpuCompatibility_t *compatibilityInfo); +/* + * Virtual GPU (vGPU) version + * + * The NVIDIA vGPU Manager and the guest drivers are tagged with a range of supported vGPU versions. This determines the range of NVIDIA guest driver versions that + * are compatible for vGPU feature support with a given NVIDIA vGPU Manager. For vGPU feature support, the range of supported versions for the NVIDIA vGPU Manager + * and the guest driver must overlap. Otherwise, the guest driver fails to load in the VM. + * + * When the NVIDIA guest driver loads, either when the VM is booted or when the driver is installed or upgraded, a negotiation occurs between the guest driver + * and the NVIDIA vGPU Manager to select the highest mutually compatible vGPU version. The negotiated vGPU version stays the same across VM migration. + */ + /** - * Returns the following two version range structures \ref nvmlVgpuVersion_t : - * 1. \a supported : structure representing the range of vGPU versions supported by the host; - * 2. \a current : structure representing the range of supported versions enforced by the caller via \ref nvmlSetVgpuVersion(). - * - * The caller pass in the pointer to the structures, into which the compatible ranges are written. + * Query the ranges of supported vGPU versions. + * + * This function gets the linear range of supported vGPU versions that is preset for the NVIDIA vGPU Manager and the range set by an administrator. + * If the preset range has not been overridden by \ref nvmlSetVgpuVersion, both ranges are the same. * - * @note: 1. The guest driver will fail to load if the version is below the range returned in the \a current structure. - * 2. If the guest driver is above the range, it will be downgraded to the current structure maximum version. + * The caller passes pointers to the following \ref nvmlVgpuVersion_t structures, into which the NVIDIA vGPU Manager writes the ranges: + * 1. \a supported structure that represents the preset range of vGPU versions supported by the NVIDIA vGPU Manager. + * 2. \a current structure that represents the range of supported vGPU versions set by an administrator. By default, this range is the same as the preset range. * - * @param supported Pointer to caller-supplied structure into which the supported vGPU version range is returned - * @param current Pointer to caller-supplied structure into which the caller enforced supported vGPU version range is returned. + * @param supported Pointer to the structure in which the preset range of vGPU versions supported by the NVIDIA vGPU Manager is written + * @param current Pointer to the structure in which the range of supported vGPU versions set by an administrator is written * * @return - * - \ref NVML_SUCCESS vGPU version range structure was successfully returned - * - \ref NVML_ERROR_NOT_SUPPORTED API not supported - * - \ref NVML_ERROR_UNKNOWN Error while getting the data + * - \ref NVML_SUCCESS The vGPU version range structures were successfully obtained. + * - \ref NVML_ERROR_NOT_SUPPORTED The API is not supported. + * - \ref NVML_ERROR_INVALID_ARGUMENT The \a supported parameter or the \a current parameter is NULL. + * - \ref NVML_ERROR_UNKNOWN An error occurred while the data was being fetched. */ nvmlReturn_t DECLDIR nvmlGetVgpuVersion(nvmlVgpuVersion_t *supported, nvmlVgpuVersion_t *current); /** - * Takes a vGPU version range structure \ref nvmlVgpuVersion_t and set the vGPU compatible version range to the one provided as input. - * The caller should call the \ref nvmlGetVgpuVersion() to get the range of supported version by the host driver. + * Override the preset range of vGPU versions supported by the NVIDIA vGPU Manager with a range set by an administrator. + * + * This function configures the NVIDIA vGPU Manager with a range of supported vGPU versions set by an administrator. This range must be a subset of the + * preset range that the NVIDIA vGPU Manager supports. The custom range set by an administrator takes precedence over the preset range and is advertised to + * the guest VM for negotiating the vGPU version. See \ref nvmlGetVgpuVersion for details of how to query the preset range of versions supported. * - * @note: 1. The guest driver will fail to load if the version is below the range set via \a vgpuVersion structure. - * 2. If the guest driver is above the range, it will be downgraded to the \a vgpuVersion structure maximum version. - * 3. This will result error if there are VMs already active on the host or the supported range being set is outside the range supported by host driver. + * This function takes a pointer to vGPU version range structure \ref nvmlVgpuVersion_t as input to override the preset vGPU version range that the NVIDIA vGPU Manager supports. * - * @param vgpuVersion Pointer to caller-supplied vGPU supported version range. + * After host system reboot or driver reload, the range of supported versions reverts to the range that is preset for the NVIDIA vGPU Manager. + * + * @note 1. The range set by the administrator must be a subset of the preset range that the NVIDIA vGPU Manager supports. Otherwise, an error is returned. + * 2. If the range of supported guest driver versions does not overlap the range set by the administrator, the guest driver fails to load. + * 3. If the range of supported guest driver versions overlaps the range set by the administrator, the guest driver will load with a negotiated + * vGPU version that is the maximum value in the overlapping range. + * 4. No VMs must be running on the host when this function is called. If a VM is running on the host, the call to this function fails. + * + * @param vgpuVersion Pointer to a caller-supplied range of supported vGPU versions. * * @return - * - \ref NVML_SUCCESS vGPU metadata structure was successfully returned - * - \ref NVML_ERROR_NOT_SUPPORTED API not supported - * - \ref NVML_ERROR_IN_USE Range not set as VM is running on the host - * - \ref NVML_ERROR_INVALID_ARGUMENT Range being set is outside the range supported by host driver + * - \ref NVML_SUCCESS The preset range of supported vGPU versions was successfully overridden. + * - \ref NVML_ERROR_NOT_SUPPORTED The API is not supported. + * - \ref NVML_ERROR_IN_USE The range was not overridden because a VM is running on the host. + * - \ref NVML_ERROR_INVALID_ARGUMENT The \a vgpuVersion parameter specifies a range that is outside the range supported by the NVIDIA vGPU Manager or if \a vgpuVersion is NULL. */ nvmlReturn_t DECLDIR nvmlSetVgpuVersion(nvmlVgpuVersion_t *vgpuVersion); diff -Nru nvidia-settings-415.27/src/parse.c nvidia-settings-418.56/src/parse.c --- nvidia-settings-415.27/src/parse.c 2018-12-20 23:41:44.000000000 +0000 +++ nvidia-settings-418.56/src/parse.c 2019-03-15 17:56:18.000000000 +0000 @@ -129,8 +129,10 @@ { "SliMosaicModeAvailable", NV_CTRL_SLI_MOSAIC_MODE_AVAILABLE, INT_ATTR, {0,0,0,0,1,0}, { .int_flags = {0,0,0,0,0,0,0} }, "Returns whether or not SLI Mosaic Mode is supported." }, { "SLIMode", NV_CTRL_STRING_SLI_MODE, STR_ATTR, {0,0,0,0,1,0}, {}, "Returns a string describing the current SLI mode, if any." }, { "MultiGpuMode", NV_CTRL_STRING_MULTIGPU_MODE, STR_ATTR, {0,0,0,0,1,0}, {}, "Returns a string describing the current MultiGPU mode, if any." }, - { "AllowGSYNC", NV_CTRL_GSYNC_ALLOWED, INT_ATTR, {0,0,0,0,0,0}, { .int_flags = {0,0,0,0,0,0,0} }, "Enables or disables the use of G-SYNC when available." }, - { "ShowGSYNCVisualIndicator", NV_CTRL_SHOW_GSYNC_VISUAL_INDICATOR, INT_ATTR, {0,0,0,0,0,0}, { .int_flags = {0,0,0,0,0,0,0} }, "If this is enabled (1), the driver will draw an indicator showing whether G-SYNC is in use, when an application is swapping using flipping." }, + { "AllowGSYNC", NV_CTRL_GSYNC_ALLOWED, INT_ATTR, {0,0,0,0,0,0}, { .int_flags = {0,0,0,0,0,0,0} }, "DEPRECATED: use \"AllowVRR\" instead." }, + { "AllowVRR", NV_CTRL_VRR_ALLOWED, INT_ATTR, {0,0,0,0,0,0}, { .int_flags = {0,0,0,0,0,0,0} }, "Enables or disables the use of G-SYNC and G-SYNC Compatible when available." }, + { "ShowGSYNCVisualIndicator", NV_CTRL_SHOW_GSYNC_VISUAL_INDICATOR, INT_ATTR, {0,0,0,0,0,0}, { .int_flags = {0,0,0,0,0,0,0} }, "DEPRECATED: use \"ShowVRRVisualIndicator\" instead." }, + { "ShowVRRVisualIndicator", NV_CTRL_SHOW_VRR_VISUAL_INDICATOR, INT_ATTR, {0,0,0,0,0,0}, { .int_flags = {0,0,0,0,0,0,0} }, "If this is enabled (1), the driver will draw an indicator showing whether G-SYNC or G-SYNC Compatible is in use, when an application is swapping using flipping." }, { "StereoSwapMode", NV_CTRL_STEREO_SWAP_MODE, INT_ATTR, {0,0,0,0,0,0}, { .int_flags = {0,0,0,0,0,0,0} }, "Controls the swap mode when Quad-Buffered stereo is used." }, { "ShowGraphicsVisualIndicator", NV_CTRL_SHOW_GRAPHICS_VISUAL_INDICATOR, INT_ATTR, {0,0,0,0,0,0}, { .int_flags = {0,0,0,0,0,0,0} }, "If this is enabled (1), the driver will draw information about the graphics API in use into a \"visual indicator\" inside application windows. This setting only takes effect on clients started after it is set." }, @@ -340,6 +342,9 @@ { "DisplayPortConnectorType", NV_CTRL_DISPLAYPORT_CONNECTOR_TYPE, INT_ATTR, {0,0,0,0,1,0}, {}, "Returns the DisplayPort connector type."}, { "DisplayPortIsMultiStream", NV_CTRL_DISPLAYPORT_IS_MULTISTREAM, INT_ATTR, {0,0,0,0,1,0}, {}, "Returns 1 if the DisplayPort display is a MultiStream device, and 0 otherwise."}, { "DisplayPortSinkIsAudioCapable", NV_CTRL_DISPLAYPORT_SINK_IS_AUDIO_CAPABLE, INT_ATTR, {0,0,0,0,1,0}, {}, "Returns 1 if the DisplayPort display is capable of playing audio, and 0 otherwise."}, + { "DisplayVRRMode", NV_CTRL_DISPLAY_VRR_MODE, INT_ATTR, {0,0,0,0,1,0}, { .int_flags = {0,0,0,0,0,0,0} }, "Whether the specified display device is G-SYNC or G-SYNC Compatible." }, + { "DisplayVRRMinRefreshRate", NV_CTRL_DISPLAY_VRR_MIN_REFRESH_RATE, INT_ATTR, {0,0,0,0,1,0}, { .int_flags = {0,0,0,0,0,0,0} }, "The minimum refresh rate for the specified VRR display device." }, + { "DisplayVRREnabled", NV_CTRL_DISPLAY_VRR_ENABLED, INT_ATTR, {0,0,0,0,1,0}, { .int_flags = {0,0,0,0,0,0,0} }, "If this is enabled (1), then VRR was enabled on this display at modeset time." }, /* TV */ { "TVOverScan", NV_CTRL_TV_OVERSCAN, INT_ATTR, {0,0,0,0,0,0}, { .int_flags = {0,0,0,0,0,0,0} }, "Adjusts the amount of overscan on the specified display device." }, @@ -393,7 +398,7 @@ * the last attribute that the table knows about. */ -#if NV_CTRL_LAST_ATTRIBUTE != NV_CTRL_SHOW_GRAPHICS_VISUAL_INDICATOR +#if NV_CTRL_LAST_ATTRIBUTE != NV_CTRL_DISPLAY_VRR_ENABLED #warning "Have you forgotten to add a new integer attribute to attributeTable?" #endif diff -Nru nvidia-settings-415.27/src/version.h nvidia-settings-418.56/src/version.h --- nvidia-settings-415.27/src/version.h 2018-12-20 23:41:43.000000000 +0000 +++ nvidia-settings-418.56/src/version.h 2019-03-15 17:56:18.000000000 +0000 @@ -1 +1 @@ -#define NVIDIA_VERSION "415.27" +#define NVIDIA_VERSION "418.56" diff -Nru nvidia-settings-415.27/src/version.mk nvidia-settings-418.56/src/version.mk --- nvidia-settings-415.27/src/version.mk 2018-12-20 23:41:43.000000000 +0000 +++ nvidia-settings-418.56/src/version.mk 2019-03-15 17:56:18.000000000 +0000 @@ -1 +1 @@ -NVIDIA_VERSION = 415.27 +NVIDIA_VERSION = 418.56 diff -Nru nvidia-settings-415.27/version.mk nvidia-settings-418.56/version.mk --- nvidia-settings-415.27/version.mk 2018-12-20 23:41:43.000000000 +0000 +++ nvidia-settings-418.56/version.mk 2019-03-15 17:56:18.000000000 +0000 @@ -1 +1 @@ -NVIDIA_VERSION = 415.27 +NVIDIA_VERSION = 418.56