Commit 90dc574f authored by Andreas Beckmann's avatar Andreas Beckmann

Merge tag 'upstream/410.93'

Upstream version 410.93
parents 0dcd22c5 b4112b9e
......@@ -109,7 +109,6 @@ $(MANPAGE_not_gzipped): nvidia-settings.1.m4 $(OPTIONS_1_INC) $(VERSION_MK)
-D__HEADER__=$(AUTO_TEXT) \
-D__BUILD_OS__=$(TARGET_OS) \
-D__VERSION__=$(NVIDIA_VERSION) \
-D__DATE__="`$(DATE) +%F`" \
-I $(OUTPUTDIR) \
$< > $@
......
......@@ -10,7 +10,7 @@ __HEADER__
\\$2 \(la \\$1 \(ra\\$3
..
.if \n[.g] .mso www.tmac
.TH nvidia\-settings 1 "__DATE__" "nvidia\-settings __VERSION__"
.TH nvidia\-settings 1 "2018-03-20" "nvidia\-settings __VERSION__"
.SH NAME
nvidia\-settings \- configure the NVIDIA graphics driver
.SH SYNOPSIS
......
NVIDIA_VERSION = 396.54
NVIDIA_VERSION = 410.93
NVIDIA_VERSION = 396.54
NVIDIA_VERSION = 410.93
......@@ -124,8 +124,6 @@ VIRTUAL_RESOLUTIONS_DIR ?= $(COMMON_UNIX_DIR)/virtual-resolutions
NVIDIA_SETTINGS = $(OUTPUTDIR)/nvidia-settings
NVIDIA_SETTINGS_PROGRAM_NAME = "nvidia-settings"
NVIDIA_SETTINGS_VERSION := $(NVIDIA_VERSION)
GTK2LIB_NAME = libnvidia-gtk2.so
......@@ -212,8 +210,6 @@ SRC += $(addprefix $(COMMON_UTILS_DIR)/,$(COMMON_UTILS_SRC))
include $(VIRTUAL_RESOLUTIONS_DIR)/src.mk
SRC += $(addprefix $(VIRTUAL_RESOLUTIONS_DIR)/,$(VIRTUAL_RESOLUTIONS_SRC))
SRC += $(STAMP_C)
OBJS = $(call BUILD_OBJECT_LIST,$(SRC))
XCP_OBJS = $(call BUILD_OBJECT_LIST,$(XCP_SRC))
......@@ -312,9 +308,6 @@ endif
$(foreach src,$(SRC),$(eval $(call DEFINE_OBJECT_RULE,TARGET,$(src))))
$(foreach src,$(XCP_SRC),$(eval $(call DEFINE_OBJECT_RULE,TARGET,$(src))))
# define the rule to generate $(STAMP_C)
$(eval $(call DEFINE_STAMP_C_RULE, $(OBJS),$(NVIDIA_SETTINGS_PROGRAM_NAME)))
# define the rule to build $(XNVCTRL_ARCHIVE)
$(XNVCTRL_ARCHIVE): build-xnvctrl
......@@ -322,7 +315,7 @@ build-xnvctrl:
@$(MAKE) -C $(XNVCTRL_DIR) -f $(XNVCTRL_MAKEFILE)
clean clobber:
rm -rf $(NVIDIA_SETTINGS) *~ $(STAMP_C) \
rm -rf $(NVIDIA_SETTINGS) *~ \
$(OUTPUTDIR)/*.o $(OUTPUTDIR)/*.d \
$(GTK2LIB) $(GTK3LIB) $(GTK2LIB_DIR) $(GTK3LIB_DIR) \
$(IMAGE_HEADERS)
......
......@@ -1319,7 +1319,8 @@ static int get_xserver_information(const char *versionString,
int *isXorg,
int *autoloadsGLX,
int *supportsExtensionSection,
int *xineramaPlusCompositeWorks)
int *xineramaPlusCompositeWorks,
const char **compositeExtensionName)
{
#define XSERVER_VERSION_FORMAT_1 "X Window System Version"
#define XSERVER_VERSION_FORMAT_2 "X.Org X Server"
......@@ -1397,6 +1398,18 @@ static int get_xserver_information(const char *versionString,
} else {
*xineramaPlusCompositeWorks = TRUE;
}
/*
* With X.Org xserver version 1.20, the name of the composite
* extension was changed from "Composite" to "COMPOSITE". As of
* that release extension names are case-sensitive so we must
* ensure the correct case is used.
*/
if (major == 1 && minor >= 20) {
*compositeExtensionName = "COMPOSITE";
} else {
*compositeExtensionName = "Composite";
}
return TRUE;
......@@ -1434,6 +1447,7 @@ void xconfigGetXServerInUse(GenerateOptions *gop)
gop->supports_extension_section = FALSE;
gop->autoloads_glx = FALSE;
gop->xinerama_plus_composite_works = FALSE;
gop->compositeExtensionName = NULL;
/* run `X -version` with a PATH that hopefully includes the X binary */
......@@ -1463,7 +1477,8 @@ void xconfigGetXServerInUse(GenerateOptions *gop)
&isXorg,
&gop->autoloads_glx,
&gop->supports_extension_section,
&gop->xinerama_plus_composite_works);
&gop->xinerama_plus_composite_works,
&gop->compositeExtensionName);
if (found) {
if (isXorg) {
......
......@@ -625,6 +625,7 @@ typedef struct {
int supports_extension_section;
int autoloads_glx;
int xinerama_plus_composite_works;
const char *compositeExtensionName;
} GenerateOptions;
......
......@@ -45,12 +45,10 @@ static void print_help(void);
* print_version() - print version information
*/
extern const char *pNV_ID;
static void print_version(void)
{
nv_msg(NULL, "");
nv_msg(NULL, "%s", pNV_ID);
nv_msg(NULL, NV_ID_STRING);
nv_msg(TAB, "The NVIDIA X Server Settings tool.");
nv_msg(NULL, "");
nv_msg(TAB, "This program is used to configure the "
......
......@@ -132,4 +132,6 @@ typedef enum {
NV_OPTIONAL_BOOL_TRUE = TRUE
} NVOptionalBool;
#define NV_ID_STRING PROGRAM_NAME ": version " NVIDIA_VERSION
#endif /* __COMMON_UTILS_H__ */
......@@ -3340,6 +3340,8 @@ nvPrimeDisplayPtr add_prime_display_from_server(nvScreenPtr screen,
prime->screen_num = atoi(value);
} else if (!strcmp(tok, "name")) {
prime->label = g_strdup(value);
} else if (!strcmp(tok, "sync")) {
prime->sync = (0 == strcmp(value, "1"));
}
}
tok = strtok(NULL, ",");
......@@ -4136,8 +4138,6 @@ nvDisplayPtr layout_get_display(const nvLayoutPtr layout,
* Code adapted from nvidia-xconfig
*/
extern const char *pNV_ID;
static void update_banner(XConfigPtr config)
{
static const char *banner =
......@@ -4178,7 +4178,7 @@ static void update_banner(XConfigPtr config)
/* add our prefix lines at the start of the comment */
config->comment = g_strconcat(prefix, banner,
"# ", pNV_ID, "\n",
"# " NV_ID_STRING "\n",
(s ? s : ""),
NULL);
if (s) g_free(s);
......
......@@ -323,6 +323,19 @@ static const char * __screen_metamode_delete_button_help =
"MetaMode for the screen; This option can be applied to your currently "
"running X server.";
/* Prime Display tooltips */
static const char *__prime_viewport_help =
"This shows the width, height, and offset in pixels of the region that "
"should be displayed from the desktop.";
static const char *__prime_name_help =
"This is the name of the display.";
static const char *__prime_sync_help =
"This shows the status of synchronization for the PRIME display. Without "
"synchronization, applications will not be able to sync to the display's "
"vblank.";
/* General button tooltips */
......@@ -2234,6 +2247,8 @@ GtkWidget* ctk_display_config_new(CtrlTarget *ctrl_target,
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
ctk_object->lbl_prime_display_view = gtk_label_new("");
ctk_config_set_tooltip(ctk_config, ctk_object->lbl_prime_display_view,
__prime_viewport_help);
gtk_box_pack_start(GTK_BOX(hbox),
ctk_object->lbl_prime_display_view,
FALSE, FALSE, 5);
......@@ -2245,11 +2260,26 @@ GtkWidget* ctk_display_config_new(CtrlTarget *ctrl_target,
labels = g_slist_append(labels, label);
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
ctk_object->lbl_prime_display_name = gtk_label_new("");
ctk_config_set_tooltip(ctk_config, ctk_object->lbl_prime_display_name,
__prime_name_help);
gtk_box_pack_start(GTK_BOX(hbox),
ctk_object->lbl_prime_display_name,
FALSE, FALSE, 5);
ctk_object->box_prime_display_name = hbox;
hbox = gtk_hbox_new(FALSE, 5);
gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5);
label = gtk_label_new("Synchronization:");
labels = g_slist_append(labels, label);
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
ctk_object->lbl_prime_display_sync = gtk_label_new("");
ctk_config_set_tooltip(ctk_config, ctk_object->lbl_prime_display_sync,
__prime_sync_help);
gtk_box_pack_start(GTK_BOX(hbox),
ctk_object->lbl_prime_display_sync,
FALSE, FALSE, 5);
g_object_ref(ctk_object->prime_display_page);
gtk_widget_show_all(ctk_object->prime_display_page);
}
......@@ -2504,6 +2534,21 @@ GtkTextBuffer *ctk_display_config_create_help(GtkTextTagTable *table,
"is enabled.", __screen_metamode_delete_button_help);
ctk_help_para(b, &i, "");
ctk_help_heading(b, &i, "PRIME Display Options");
ctk_help_para(b, &i, "The following attributes are available when a "
"configured PRIME display is selected in the Selection "
"drop-down. These attributes cannot be changed within "
"nvidia-settings.");
ctk_help_heading(b, &i, "Viewport");
ctk_help_para(b, &i, "%s", __prime_viewport_help);
ctk_help_heading(b, &i, "Name");
ctk_help_para(b, &i, "%s This attribute may not be available.",
__prime_name_help);
ctk_help_heading(b, &i, "Synchronization");
ctk_help_para(b, &i, "%s", __prime_sync_help);
ctk_help_para(b, &i, "");
ctk_help_heading(b, &i, "Buttons");
ctk_help_heading(b, &i, "Apply");
......@@ -4515,6 +4560,9 @@ static void setup_prime_display_page(CtkDisplayConfig *ctk_object)
gtk_widget_hide(ctk_object->box_prime_display_name);
}
gtk_label_set_text(GTK_LABEL(ctk_object->lbl_prime_display_sync),
prime->sync ? "On" : "Off");
gtk_widget_set_sensitive(ctk_object->prime_display_page, True);
}
......@@ -9186,9 +9234,12 @@ static int generateXConfig(CtkDisplayConfig *ctk_object, XConfigPtr *pConfig)
if (!config->extensions) {
config->extensions = nvalloc(sizeof(XConfigExtensionsRec));
}
xconfigRemoveNamedOption(&(config->extensions->options), "Composite",
xconfigRemoveNamedOption(&(config->extensions->options),
go.compositeExtensionName,
NULL);
xconfigAddNewOption(&config->extensions->options, "Composite", "Disable");
xconfigAddNewOption(&config->extensions->options,
go.compositeExtensionName,
"Disable");
nvfree(composite_disabled_str);
}
}
......
......@@ -199,6 +199,7 @@ typedef struct _CtkDisplayConfig
GtkWidget *lbl_prime_display_view;
GtkWidget *lbl_prime_display_name;
GtkWidget *lbl_prime_display_sync;
GtkWidget *box_prime_display_name;
......
......@@ -303,6 +303,7 @@ typedef struct nvPrimeDisplayRec {
GdkRectangle rect;
char *label;
int screen_num;
Bool sync;
} nvPrimeDisplay, *nvPrimeDisplayPtr;
......
......@@ -346,6 +346,7 @@ static void ctk_event_class_init(CtkEventClass *ctk_event_class)
MAKE_SIGNAL(NV_CTRL_DISPLAYPORT_CONNECTOR_TYPE);
MAKE_SIGNAL(NV_CTRL_DISPLAYPORT_IS_MULTISTREAM);
MAKE_SIGNAL(NV_CTRL_DISPLAYPORT_SINK_IS_AUDIO_CAPABLE);
MAKE_SIGNAL(NV_CTRL_SHOW_GRAPHICS_VISUAL_INDICATOR);
#undef MAKE_SIGNAL
/*
......@@ -355,7 +356,7 @@ static void ctk_event_class_init(CtkEventClass *ctk_event_class)
* knows about.
*/
#if NV_CTRL_LAST_ATTRIBUTE != NV_CTRL_FRAMELOCK_FIRMWARE_MINOR_VERSION
#if NV_CTRL_LAST_ATTRIBUTE != NV_CTRL_SHOW_GRAPHICS_VISUAL_INDICATOR
#warning "There are attributes that do not emit signals!"
#endif
......
......@@ -48,6 +48,8 @@ static void post_show_sli_visual_indicator_button_toggled(CtkOpenGL *,
static void post_show_multigpu_visual_indicator_button_toggled(CtkOpenGL *,
gboolean);
static void post_show_graphics_visual_indicator_button_toggled(CtkOpenGL *,
gboolean);
static void post_xinerama_stereo_button_toggled(CtkOpenGL *, gboolean);
static void post_stereo_eyes_exchange_button_toggled(CtkOpenGL *, gboolean);
......@@ -76,6 +78,8 @@ static void show_sli_visual_indicator_button_toggled (GtkWidget *, gpointer);
static void show_multigpu_visual_indicator_button_toggled (GtkWidget *, gpointer);
static void show_graphics_visual_indicator_button_toggled (GtkWidget *, gpointer);
static void value_changed (GObject *, CtrlEvent *, gpointer);
static const gchar *get_image_settings_string(gint val);
......@@ -182,6 +186,14 @@ static const char *__show_multigpu_visual_indicator_help =
"applications that are started after this option is "
"set.";
static const char *__show_graphics_visual_indicator_help =
"Enabling this option causes the driver to draw "
"information about the graphics API in use, such as "
"instant framerate, vsync status, and whether the "
"application is blitting or flipping. "
"This option is applied to applications that are "
"started after this option is set.";
static const char *__stereo_eyes_exchange_help =
"Enabling this option causes OpenGL to draw the left "
"eye image in the right eye and vice versa for stereo "
......@@ -214,6 +226,7 @@ static const char *__show_gsync_visual_indicator_help =
#define __ALLOW_GSYNC (1 << 13)
#define __SHOW_GSYNC_VISUAL_INDICATOR (1 << 14)
#define __STEREO_SWAP_MODE (1 << 15)
#define __SHOW_GRAPHICS_VISUAL_INDICATOR (1 << 16)
......@@ -297,6 +310,7 @@ GtkWidget* ctk_opengl_new(CtrlTarget *ctrl_target,
gint use_conformant_clamping = 0;
gint show_sli_visual_indicator = 0;
gint show_multigpu_visual_indicator = 0;
gint show_graphics_visual_indicator = 0;
ReturnStatus ret_sync_to_vblank;
ReturnStatus ret_flipping_allowed;
......@@ -311,6 +325,7 @@ GtkWidget* ctk_opengl_new(CtrlTarget *ctrl_target,
ReturnStatus ret_use_conformant_clamping;
ReturnStatus ret_show_sli_visual_indicator;
ReturnStatus ret_show_multigpu_visual_indicator;
ReturnStatus ret_show_graphics_visual_indicator;
/* Query OpenGL settings */
......@@ -387,6 +402,11 @@ GtkWidget* ctk_opengl_new(CtrlTarget *ctrl_target,
NV_CTRL_SHOW_MULTIGPU_VISUAL_INDICATOR,
&show_multigpu_visual_indicator);
ret_show_graphics_visual_indicator =
NvCtrlGetAttribute(ctrl_target,
NV_CTRL_SHOW_GRAPHICS_VISUAL_INDICATOR,
&show_graphics_visual_indicator);
/* There are no OpenGL settings to change (OpenGL disabled?) */
if ((ret_sync_to_vblank != NvCtrlSuccess) &&
(ret_flipping_allowed != NvCtrlSuccess) &&
......@@ -400,7 +420,8 @@ GtkWidget* ctk_opengl_new(CtrlTarget *ctrl_target,
(ret_aa_line_gamma != NvCtrlSuccess) &&
(ret_use_conformant_clamping != NvCtrlSuccess) &&
(ret_show_sli_visual_indicator != NvCtrlSuccess) &&
(ret_show_multigpu_visual_indicator != NvCtrlSuccess)) {
(ret_show_multigpu_visual_indicator != NvCtrlSuccess) &&
(ret_show_graphics_visual_indicator != NvCtrlSuccess)) {
return NULL;
}
......@@ -867,6 +888,34 @@ GtkWidget* ctk_opengl_new(CtrlTarget *ctrl_target,
ctk_opengl->show_multigpu_visual_indicator_button = check_button;
}
if (ret_show_graphics_visual_indicator == NvCtrlSuccess) {
label = gtk_label_new("Enable Graphics API 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_graphics_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_graphics_visual_indicator_button_toggled),
(gpointer) ctk_opengl);
g_signal_connect(G_OBJECT(ctk_event),
CTK_EVENT_NAME(NV_CTRL_SHOW_GRAPHICS_VISUAL_INDICATOR),
G_CALLBACK(value_changed), (gpointer) ctk_opengl);
ctk_config_set_tooltip(ctk_config, check_button,
__show_graphics_visual_indicator_help);
ctk_opengl->active_attributes |= __SHOW_GRAPHICS_VISUAL_INDICATOR;
ctk_opengl->show_graphics_visual_indicator_button = check_button;
}
gtk_widget_show_all(GTK_WIDGET(object));
/*
......@@ -943,6 +992,15 @@ post_show_multigpu_visual_indicator_button_toggled(CtkOpenGL *ctk_opengl,
enabled ? "enabled" : "disabled");
}
static void
post_show_graphics_visual_indicator_button_toggled(CtkOpenGL *ctk_opengl,
gboolean enabled)
{
ctk_config_statusbar_message(ctk_opengl->ctk_config,
"Graphics API Visual Indicator %s.",
enabled ? "enabled" : "disabled");
}
static void post_xinerama_stereo_button_toggled(CtkOpenGL *ctk_opengl,
gboolean enabled)
{
......@@ -1073,6 +1131,20 @@ static void show_multigpu_visual_indicator_button_toggled(GtkWidget *widget,
post_show_multigpu_visual_indicator_button_toggled(ctk_opengl, enabled);
}
static void show_graphics_visual_indicator_button_toggled(GtkWidget *widget,
gpointer user_data)
{
CtkOpenGL *ctk_opengl = CTK_OPENGL(user_data);
CtrlTarget *ctrl_target = ctk_opengl->ctrl_target;
gboolean enabled;
enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
NvCtrlSetAttribute(ctrl_target,
NV_CTRL_SHOW_GRAPHICS_VISUAL_INDICATOR, enabled);
post_show_graphics_visual_indicator_button_toggled(ctk_opengl, enabled);
}
static void xinerama_stereo_button_toggled(GtkWidget *widget,
gpointer user_data)
{
......@@ -1219,6 +1291,12 @@ static void value_changed(GObject *object, CtrlEvent *event, gpointer user_data)
func = G_CALLBACK(show_multigpu_visual_indicator_button_toggled);
post_show_multigpu_visual_indicator_button_toggled(ctk_opengl, value);
break;
case NV_CTRL_SHOW_GRAPHICS_VISUAL_INDICATOR:
button =
GTK_TOGGLE_BUTTON(ctk_opengl->show_graphics_visual_indicator_button);
func = G_CALLBACK(show_graphics_visual_indicator_button_toggled);
post_show_graphics_visual_indicator_button_toggled(ctk_opengl, value);
break;
default:
return;
}
......@@ -1873,6 +1951,11 @@ GtkTextBuffer *ctk_opengl_create_help(GtkTextTagTable *table,
"multi-GPU AA and single-GPU AA modes.");
}
if (ctk_opengl->active_attributes & __SHOW_GRAPHICS_VISUAL_INDICATOR) {
ctk_help_heading(b, &i, "Graphics API Visual Indicator");
ctk_help_para(b, &i, "%s", __show_graphics_visual_indicator_help);
}
ctk_help_finish(b);
return b;
......
......@@ -68,6 +68,7 @@ struct _CtkOpenGL
GtkWidget *aa_line_gamma_scale;
GtkWidget *show_sli_visual_indicator_button;
GtkWidget *show_multigpu_visual_indicator_button;
GtkWidget *show_graphics_visual_indicator_button;
gint *stereo_swap_mode_table;
gint stereo_swap_mode_table_size;
......
......@@ -627,6 +627,7 @@ GtkWidget *ctk_window_new(ParsedAttribute *p, ConfigProperties *conf,
child = ctk_display_config_new(server_target, ctk_config);
if (child) {
ctk_window->display_config_widget = child;
add_page(child,
ctk_display_config_create_help(tag_table,
CTK_DISPLAY_CONFIG(child)),
......@@ -1358,6 +1359,11 @@ static void save_settings_and_exit(CtkWindow *ctk_window)
}
#endif
if (ctk_window->display_config_widget) {
CtkDisplayConfig *display_config =
CTK_DISPLAY_CONFIG(ctk_window->display_config_widget);
layout_free(display_config->layout);
}
add_special_config_file_attributes(ctk_window);
gtk_main_quit();
......
......@@ -78,6 +78,8 @@ struct _CtkWindow
GtkTextTagTable *help_tag_table;
GtkTextBuffer *help_text_buffer;
GtkWidget *display_config_widget;
};
struct _CtkWindowClass
......
......@@ -46,7 +46,6 @@ CFLAGS += -I $(OUTPUTDIR)
CFLAGS += -DPROGRAM_NAME=\"$(LIBXNVCTRL_PROGRAM_NAME)\"
SRC += NVCtrl.c
SRC += $(STAMP_C)
OBJS = $(call BUILD_OBJECT_LIST,$(SRC))
......@@ -65,9 +64,6 @@ $(LIBXNVCTRL) : $(OBJS)
# define the rule to build each object file
$(foreach src,$(SRC),$(eval $(call DEFINE_OBJECT_RULE,TARGET,$(src))))
# define the rule to generate $(STAMP_C)
$(eval $(call DEFINE_STAMP_C_RULE, $(OBJS),$(LIBXNVCTRL_PROGRAM_NAME)))
clean:
rm -rf $(LIBXNVCTRL) *~ $(STAMP_C) \
rm -rf $(LIBXNVCTRL) *~ \
$(OUTPUTDIR)/*.o $(OUTPUTDIR)/*.d
......@@ -3520,7 +3520,17 @@
#define NV_CTRL_FRAMELOCK_FIRMWARE_MINOR_VERSION 427 /* R--F */
#define NV_CTRL_LAST_ATTRIBUTE NV_CTRL_FRAMELOCK_FIRMWARE_MINOR_VERSION
/*
* NV_CTRL_SHOW_GRAPHICS_VISUAL_INDICATOR - when TRUE, graphics APIs will
* indicate various runtime information such as flip/blit, vsync status, API
* in use.
*/
#define NV_CTRL_SHOW_GRAPHICS_VISUAL_INDICATOR 428 /* RW-X */
#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
/**************************************************************************/
......
......@@ -74,9 +74,7 @@ PRINTF ?= printf
MKDIR ?= mkdir -p
RM ?= rm -f
TOUCH ?= touch
WHOAMI ?= whoami
HARDLINK ?= ln -f
HOSTNAME_CMD ?= hostname
DATE ?= date
GZIP_CMD ?= gzip
CHMOD ?= chmod
......@@ -214,6 +212,8 @@ ifndef NVIDIA_VERSION
$(error NVIDIA_VERSION undefined)
endif
CFLAGS += -DNVIDIA_VERSION=\"$(NVIDIA_VERSION)\"
##############################################################################
# Several of the functions below take an argument that indicates if
......@@ -424,37 +424,6 @@ define DEBUG_INFO_RULES
endif
endef
##############################################################################
# STAMP_C - this is a source file that is generated during the build
# to capture information about the build environment for the utility.
#
# The DEFINE_STAMP_C_RULE function is used to define the rule for
# generating STAMP_C. First argument is a list of dependencies for
# STAMP_C (g_stamp.o is filtered out of the list); second argument is
# the name of the program being built.
#
# The includer of utils.mk should add $(STAMP_C) to its list of source
# files
##############################################################################
STAMP_C = $(OUTPUTDIR)/g_stamp.c
define DEFINE_STAMP_C_RULE
$$(STAMP_C): $$(filter-out \
$$(call BUILD_OBJECT_LIST,$$(STAMP_C)),$(1)) \
$$(VERSION_MK)
@ $$(RM) $$@
@ $$(PRINTF) "%s" "const char NV_ID[] = \"nvidia id: " >> $$@
@ $$(PRINTF) "%s" "$(2): " >> $$@
@ $$(PRINTF) "%s" "version $$(NVIDIA_VERSION) " >> $$@
@ $$(PRINTF) "%s" "($$(shell $$(WHOAMI))" >> $$@
@ $$(PRINTF) "%s" "@$$(shell $$(HOSTNAME_CMD))) " >> $$@
@ $$(PRINTF) "%s\n" "$$(shell $(DATE))\";" >> $$@
@ $$(PRINTF) "%s\n" "const char *pNV_ID = NV_ID + 11;" >> $$@
endef
##############################################################################
# Define rules that can be used for embedding a file into an ELF object that
# contains the raw contents of that file and symbols pointing to the embedded
......
NVIDIA_VERSION = 396.54
NVIDIA_VERSION = 410.93
......@@ -321,6 +321,7 @@ NvCtrlNvmlAttributes *NvCtrlInitNvmlAttributes(NvCtrlAttributePrivateHandle *h)
unsigned int count;
unsigned int *nvctrlToNvmlId;
int i;
int nvctrlCoolerCount;
/* Check parameters */
if (h == NULL || !TARGET_TYPE_IS_NVML_COMPATIBLE(h->target_type)) {
......@@ -405,6 +406,17 @@ NvCtrlNvmlAttributes *NvCtrlInitNvmlAttributes(NvCtrlAttributePrivateHandle *h)
}
}
/*
* NVML doesn't have support to handle more than 1 fan per GPU. Make sure
* total number of cooler probed by NVML are same as that of reported by
* NV-CONTROL, otherwise do not initialize NVML sub-system.
*/
if (!XNVCTRLQueryTargetCount(h->dpy, NV_CTRL_TARGET_TYPE_COOLER,
&nvctrlCoolerCount) ||
(nvctrlCoolerCount != nvml->coolerCount)) {
goto fail;
}
nvfree(nvctrlToNvmlId);
return nvml;
......
......@@ -103,7 +103,7 @@ const AttributeTableEntry attributeTable[] = {
{ "ScreenPosition", NV_CTRL_STRING_SCREEN_RECTANGLE, STR_ATTR, {0,0,0,0,1,0}, {}, "Returns the physical X Screen's initial position and size (in absolute coordinates) within the desktop as the \"token=value \" string: \"x=#, y=#, width=#, height=#\"." },
{ "AddMetaMode", NV_CTRL_STRING_OPERATION_ADD_METAMODE, SOP_ATTR, {0,0,0,0,1,1}, {}, "Adds the given MetaMode to the X screen." },
{ "ParseMetaMode", NV_CTRL_STRING_OPERATION_ADD_METAMODE, SOP_ATTR, {0,0,0,0,1,1}, {}, "Parses and validates a given MetaMode." },
{ "PrimeOutputsData", NV_CTRL_STRING_PRIME_OUTPUTS_DATA , STR_ATTR, {0,0,0,0,1,1}, {}, "Lists configured PRIME displays' configuration information." },
{ "PrimeOutputsData", NV_CTRL_STRING_PRIME_OUTPUTS_DATA , STR_ATTR, {0,0,0,0,1,0}, {}, "Lists configured PRIME displays' configuration information." },
/* OpenGL */
{ "SyncToVBlank", NV_CTRL_SYNC_TO_VBLANK, INT_ATTR, {0,0,0,0,0,0}, { .int_flags = {0,0,0,0,0,0,0} }, "Enables sync to vertical blanking for OpenGL clients. This setting only takes effect on OpenGL clients started after it is set." },
......@@ -131,6 +131,7 @@ const AttributeTableEntry attributeTable[] = {
{ "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." },
{ "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." },
/* GPU */
{ "BusType", NV_CTRL_BUS_TYPE, INT_ATTR, {0,0,0,0,1,0}, { .int_flags = {0,0,0,0,0,0,0} }, "Returns the type of bus connecting the specified device to the computer. If the target is an X screen, then it uses the GPU driving the X screen as the device." },
......@@ -391,7 +392,7 @@ const int attributeTableLen = ARRAY_LEN(attributeTable);
* the last attribute that the table knows about.
*/
#if NV_CTRL_LAST_ATTRIBUTE != NV_CTRL_FRAMELOCK_FIRMWARE_MINOR_VERSION
#if NV_CTRL_LAST_ATTRIBUTE != NV_CTRL_SHOW_GRAPHICS_VISUAL_INDICATOR
#warning "Have you forgotten to add a new integer attribute to attributeTable?"
#endif
......
#define NVIDIA_VERSION "396.54"
#define NVIDIA_VERSION "410.93"
NVIDIA_VERSION = 396.54
NVIDIA_VERSION = 410.93
......@@ -74,9 +74,7 @@ PRINTF ?= printf
MKDIR ?= mkdir -p
RM ?= rm -f
TOUCH ?= touch
WHOAMI ?= whoami
HARDLINK ?= ln -f
HOSTNAME_CMD ?= hostname
DATE ?= date
GZIP_CMD ?= gzip
CHMOD ?= chmod
......@@ -214,6 +212,8 @@ ifndef NVIDIA_VERSION
$(error NVIDIA_VERSION undefined)
endif
CFLAGS += -DNVIDIA_VERSION=\"$(NVIDIA_VERSION)\"
##############################################################################
# Several of the functions below take an argument that indicates if
......@@ -424,37 +424,6 @@ define DEBUG_INFO_RULES
endif
endef
##############################################################################
# STAMP_C - this is a source file that is generated during the build
# to capture information about the build environment for the utility.
#
# The DEFINE_STAMP_C_RULE function is used to define the rule for
# generating STAMP_C. First argument is a list of dependencies for
# STAMP_C (g_stamp.o is filtered out of the list); second argument is
# the name of the program being built.
#
# The includer of utils.mk should add $(STAMP_C) to its list of source
# files
##############################################################################
STAMP_C = $(OUTPUTDIR)/g_stamp.c
define DEFINE_STAMP_C_RULE
$$(STAMP_C): $$(filter-out \
$$(call BUILD_OBJECT_LIST,$$(STAMP_C)),$(1)) \
$$(VERSION_MK)
@ $$(RM) $$@
@ $$(PRINTF) "%s" "const char NV_ID[] = \"nvidia id: " >> $$@
@ $$(PRINTF) "%s" "$(2): " >> $$@
@ $$(PRINTF) "%s" "version $$(NVIDIA_VERSION) " >> $$@
@ $$(PRINTF) "%s" "($$(shell $$(WHOAMI))" >> $$@
@ $$(PRINTF) "%s" "@$$(shell $$(HOSTNAME_CMD))) " >> $$@
@ $$(PRINTF) "%s\n" "$$(shell $(DATE))\";" >> $$@
@ $$(PRINTF) "%s\n" "const char *pNV_ID = NV_ID + 11;" >> $$@
endef
##############################################################################
# Define rules that can be used for embedding a file into an ELF object that
# contains the raw contents of that file and symbols pointing to the embedded
......
NVIDIA_VERSION = 396.54
NVIDIA_VERSION = 410.93
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment