Commit b90c8a5b authored by Andreas Beckmann's avatar Andreas Beckmann

Merge tag 'upstream/418.56'

Upstream version 418.56
parents 254541ca 8f7e1c9e
NVIDIA_VERSION = 415.27
NVIDIA_VERSION = 418.56
......@@ -683,7 +683,7 @@ static AttrEntry attr_table[] = {
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 @@ static AttrEntry attr_table[] = {
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 }
};
......@@ -265,7 +265,7 @@ static const char *attr_int_table[NV_CTRL_LAST_ATTRIBUTE + 1] = {
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 @@ static const char *attr_int_table[NV_CTRL_LAST_ATTRIBUTE + 1] = {
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),/'
......
NVIDIA_VERSION = 415.27
NVIDIA_VERSION = 418.56
......@@ -20,6 +20,8 @@
* DEALINGS IN THE SOFTWARE.
*/
#define _GNU_SOURCE // needed for fileno
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
......@@ -88,16 +90,20 @@ void reset_current_terminal_width(unsigned short new_val)
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);
}
}
......
......@@ -681,6 +681,18 @@ static void apply_mode_attribute_token(char *token, char *value, void *data)
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 @@ nvModePtr mode_parse(nvDisplayPtr display, const char *mode_str)
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);
......@@ -1201,6 +1216,24 @@ static gchar *mode_get_str(nvLayoutPtr layout,
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}",
mode_str,
......
......@@ -82,6 +82,8 @@ static void display_viewport_out_activate(GtkWidget *widget,
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 @@ static const char * __dpy_forcefullcompositionpipeline_help =
"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 @@ static void display_forcefullcompositionpipeline_toggled(GtkWidget *widget,
/** 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 @@ static void update_forcecompositionpipeline_buttons(CtkDisplayConfig *ctk_object
/** 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 @@ GtkWidget* ctk_display_config_new(CtrlTarget *ctrl_target,
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 @@ GtkTextBuffer *ctk_display_config_create_help(GtkTextTagTable *table,
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 @@ static void setup_prime_display_page(CtkDisplayConfig *ctk_object)
}
/** 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 @@ static void setup_display_page(CtkDisplayConfig *ctk_object)
setup_display_panning(ctk_object);
setup_forcecompositionpipeline_buttons(ctk_object);
setup_primary_display(ctk_object);
setup_force_gsync(ctk_object);
} /* setup_display_page() */
......
......@@ -99,6 +99,8 @@ typedef struct _CtkDisplayConfig
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 @@ typedef struct _CtkDisplayConfig
GtkWidget *box_display_panning;
GtkWidget *txt_display_panning;
/* X Screen - Info */
GtkWidget *screen_page;
......
......@@ -64,6 +64,8 @@ static gboolean update_refresh_rate(InfoEntry *entry);
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 * __multistream_help =
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 @@ static InfoEntryData __info_entry_data[] = {
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)
......@@ -837,6 +864,59 @@ static gboolean update_audio_info(InfoEntry *entry)
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;
}
......
......@@ -2351,6 +2351,9 @@ static void select_display(CtkDisplayLayout *ctk_object, nvDisplayPtr display)
/* 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 @@ static void select_prime_display(CtkDisplayLayout *ctk_object, nvPrimeDisplayPtr
/* 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++) {
......
......@@ -228,6 +228,9 @@ typedef struct nvModeRec {
Bool forceCompositionPipeline;
Bool forceFullCompositionPipeline;
Bool allowGSYNC;
Bool allowGSYNCCompatibleSpecified;
Bool allowGSYNCCompatible;
int vrrMinRefreshRate;
} nvMode, *nvModePtr;
......
......@@ -332,7 +332,7 @@ static void ctk_event_class_init(CtkEventClass *ctk_event_class)
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 @@ static void ctk_event_class_init(CtkEventClass *ctk_event_class)
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 @@ static void ctk_event_class_init(CtkEventClass *ctk_event_class)
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 @@ static void ctk_event_class_init(CtkEventClass *ctk_event_class)
* 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
......
This diff is collapsed.
......@@ -39,6 +39,10 @@ G_BEGIN_DECLS
#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 @@ struct _CtkManageGridLicense
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.
};
/*
......
This diff is collapsed.
......@@ -57,8 +57,8 @@ struct _CtkOpenGL
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;
......
......@@ -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_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 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_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
/**************************************************************************/
......
NVIDIA_VERSION = 415.27
NVIDIA_VERSION = 418.56
......@@ -206,7 +206,7 @@ static Bool LoadNvml(NvCtrlNvmlAttributes *nvml)
#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();
......
......@@ -164,21 +164,21 @@ struct __NvCtrlNvmlAttributes {
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;
......
This diff is collapsed.
......@@ -129,8 +129,10 @@ const AttributeTableEntry attributeTable[] = {
{ "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 @@ const AttributeTableEntry attributeTable[] = {
{ "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." },