...
 
Commits (73)
nvidia-settings (390.48-2~bpo9+1) stretch-backports; urgency=medium
* Rebuild for stretch-backports.
-- Andreas Beckmann <anbe@debian.org> Tue, 08 May 2018 14:42:27 +0200
nvidia-settings (390.48-2) unstable; urgency=medium
* Add Provides+Conflicts: nvidia-settings-gtk-${nvidia:Version} to prevent
file conflicts with the legacy package built from the same upstream
version.
* Use dh_missing --fail-missing.
-- Andreas Beckmann <anbe@debian.org> Sun, 22 Apr 2018 20:22:08 +0200
nvidia-settings (390.48-1) unstable; urgency=medium
* New upstream release 390.48.
* Bump Standards-Version to 4.1.4. No changes needed.
* Switch to debhelper compat level 11.
-- Andreas Beckmann <anbe@debian.org> Sun, 22 Apr 2018 17:07:14 +0200
nvidia-settings (390.25-1) unstable; urgency=medium
* New upstream release 390.25.
* Only build nvidia-settings on platforms where it is going to be used.
(Closes: #892184)
* Upload to unstable.
-- Andreas Beckmann <anbe@debian.org> Tue, 06 Mar 2018 23:51:27 +0100
nvidia-settings (390.12-1) experimental; urgency=medium
* New upstream release 390.12.
- Updated the SLI Mosaic layout page in the nvidia-settings control
panel to support topologies with up to 32 displays.
- Added an OpenGL stereo preview feature to the screen page in
nvidia-settings.
* Merge changes from 384.111.
* Upload to experimental.
-- Andreas Beckmann <anbe@debian.org> Fri, 12 Jan 2018 01:57:07 +0100
nvidia-settings (387.34-2) unstable; urgency=medium
* Generate the GTK3|GTK2 dependency dynamically. (Closes: #885709)
* Merge changes from 384.111-1 (unstable), 384.111-1~deb9u1 (stretch).
* Add debian/upstream/metadata.
* Fix new Lintian issues.
* Switch Vcs-* URLs to salsa.debian.org.
* Upload to unstable.
-- Andreas Beckmann <anbe@debian.org> Tue, 06 Mar 2018 03:17:02 +0100
nvidia-settings (387.34-1) experimental; urgency=medium
* New upstream release 387.34.
* New upstream release 387.12.
- Fixed a bug that sometimes prevented the "Reset Default Configuration"
button in the nvidia-settings "ECC Settings" page from being available
when the ECC configuration is set to a non-default state.
- Fixed a bug that caused nvidia-settings to enforce overly aggressive
limits on display positions in the "X Server Display Configuration"
page under some circumstances.
- Fixed a bug that could cause the "Enable Base Mosaic (Surround)"
checkbox in nvidia-settings to disappear when an X screen, rather than
a display, is selected in the "X Server Display Configuration" page.
- Fixed a bug that caused the nvidia-settings control panel to retain
some settings that had been applied, but not confirmed. This resulted
in unwanted settings being applied to subsequent settings changes.
* Refresh patches.
* Bump Standards-Version to 4.1.2. No changes needed.
* Upload to experimental.
-- Andreas Beckmann <anbe@debian.org> Sun, 10 Dec 2017 08:49:46 +0100
nvidia-settings (384.111-1~deb9u1) stretch; urgency=medium
* Rebuild for stretch.
-- Andreas Beckmann <anbe@debian.org> Sun, 25 Feb 2018 18:18:20 +0100
nvidia-settings (384.111-1~bpo9+1) stretch-backports; urgency=medium
* Rebuild for stretch-backports.
......@@ -119,7 +202,7 @@ nvidia-settings (375.26-1) unstable; urgency=medium
to crash on startup with certain GPU configurations.
* New upstream release 375.20.
- Updated nvidia-settings to not have a build-time dependence on an
external nvml development package (a regression introduced in 375.10).
external NVML development package (a regression introduced in 375.10).
- Fixed a crash in nvidia-settings when adding Application Profile Rule
and Profile entries.
- Removed the "Enable Tooltip" option in nvidia-settings for the GTK 2
......@@ -456,7 +539,7 @@ nvidia-settings (331.67-1) unstable; urgency=medium
* New upstream release 331.67.
- Fixed a bug that could cause nvidia-settings to crash or display
incorrect information after switching virtual terminals while a
color correction confirmation countdown was active.
color correction confirmation count down was active.
* New upstream release 331.49.
* New upstream release 319 series.
- Updated nvidia-settings to use libjansson commit
......@@ -561,7 +644,7 @@ nvidia-settings (325.15-1) experimental; urgency=low
- Fixed a bug that exposed edge overlap controls on the SLI Mosaic
page of nvidia-settings on edges where overlap was impossible.
- Fixed a bug that caused some settings in the nvidia-settings control
panel to be reset when reprobing displays.
panel to be reset when re-probing displays.
- Added support for configuring SLI Mosaic and Base Mosaic in the "X Server
Display Configuration" page of nvidia-settings.
- Updated nvidia-settings to explicitly specify the direction of rotation
......@@ -704,7 +787,7 @@ nvidia-settings (310.19-1) experimental; urgency=low
enabled in the X configuration file.
- Added support for configuring the ViewPortIn and ViewPortOut for display
devices in nvidia-settings.
- Fixed metamode bookkeeping when modifying the display configuration in
- Fixed MetaMode bookkeeping when modifying the display configuration in
the "X Server Display Configuration" page of nvidia-settings.
- Added support for configuring rotation and reflection per display device
in nvidia-settings.
......
......@@ -7,7 +7,7 @@ Uploaders:
Vincent Cheng <vcheng@debian.org>,
Luca Boccassi <bluca@debian.org>,
Build-Depends:
debhelper (>= 10),
debhelper (>= 11),
dh-exec (>= 0.3),
m4,
libgl1-mesa-dev | libgl-dev,
......@@ -23,10 +23,10 @@ Build-Depends:
Build-Conflicts:
libxnvctrl-dev,
Rules-Requires-Root: no
Standards-Version: 4.1.3
Standards-Version: 4.1.4
Homepage: https://download.nvidia.com/XFree86/nvidia-settings/
Vcs-Git: https://anonscm.debian.org/git/pkg-nvidia/nvidia-settings.git
Vcs-Browser: https://anonscm.debian.org/cgit/pkg-nvidia/nvidia-settings.git
Vcs-Browser: https://salsa.debian.org/nvidia-team/nvidia-settings
Vcs-Git: https://salsa.debian.org/nvidia-team/nvidia-settings.git
Package: nvidia-settings
Section: contrib/x11
......@@ -36,12 +36,15 @@ Pre-Depends:
Depends:
${nvidia-alternative},
libxnvctrl0 (= ${binary:Version}),
libgtk-3-0 (>= 3.0.0) | libgtk2.0-0 (>= 2.8.0),
${shlibs:Depends}, ${misc:Depends}
Recommends:
libgl1-nvidia${nvidia:Legacy}-glvnd-glx | libgl1-nvidia${nvidia:Legacy}-glx,
nvidia${nvidia:Legacy}-vdpau-driver,
libnvidia${nvidia:Legacy}-ml1,
Provides:
nvidia-settings-gtk-${nvidia:Version},
Conflicts:
nvidia-settings-gtk-${nvidia:Version},
Description: tool for configuring the NVIDIA graphics driver${nvidia:LegacyDesc}
The nvidia-settings utility is a tool for configuring the NVIDIA
Linux graphics driver. It operates by communicating with the NVIDIA
......
......@@ -2,3 +2,4 @@
upstream-vcs-tag = %(version)s
upstream-branch = upstream
debian-branch = stretch-backports
debian-tag = debian/%(version)s
......@@ -4,7 +4,7 @@ Bug-Debian: https://bugs.debian.org/666909
--- a/src/Makefile
+++ b/src/Makefile
@@ -106,6 +106,9 @@ endif
@@ -113,6 +113,9 @@ endif
XNVCTRL_DIR ?= libXNVCtrl
XNVCTRL_MAKEFILE ?= Makefile
XNVCTRL_ARCHIVE ?= $(XNVCTRL_DIR)/libXNVCtrl.a
......@@ -14,7 +14,7 @@ Bug-Debian: https://bugs.debian.org/666909
XCONFIG_PARSER_DIR ?= XF86Config-parser
COMMON_UTILS_DIR ?= common-utils
COMMON_UNIX_DIR ?= common-unix
@@ -269,9 +272,9 @@ NVIDIA_SETTINGS_install: $(NVIDIA_SETTIN
@@ -286,9 +289,9 @@ NVIDIA_SETTINGS_install: $(NVIDIA_SETTIN
$(INSTALL) $(INSTALL_BIN_ARGS) $< $(BINDIR)/$(notdir $<)
$(eval $(call DEBUG_INFO_RULES, $(NVIDIA_SETTINGS)))
......@@ -25,26 +25,26 @@ Bug-Debian: https://bugs.debian.org/666909
+ -rdynamic -o $@ $(OBJS) $(XNVCTRL_LIB) $(LIBS)
$(eval $(call DEBUG_INFO_RULES, $(GTK2LIB)))
$(GTK2LIB).unstripped: $(GTK2_OBJS) $(XCP_OBJS) $(VERSION_MK)
@@ -279,7 +282,7 @@ $(GTK2LIB).unstripped: $(GTK2_OBJS) $(XC
$(GTK2LIB).unstripped: $(GTK2_OBJS) $(XCP_OBJS) $(IMAGE_OBJS) $(VERSION_MK)
@@ -296,7 +299,7 @@ $(GTK2LIB).unstripped: $(GTK2_OBJS) $(XC
-o $@ \
-Wl,-soname -Wl,$(GTK2LIB_SONAME) \
$(GTK2_OBJS) $(XCP_OBJS) \
$(GTK2_OBJS) $(IMAGE_OBJS) $(XCP_OBJS) \
- $(XNVCTRL_ARCHIVE) $(LIBS) $(GTK2_LIBS)
+ $(XNVCTRL_LIB) $(LIBS) $(GTK2_LIBS)
ifdef BUILD_GTK3LIB
$(eval $(call DEBUG_INFO_RULES, $(GTK3LIB)))
@@ -288,7 +291,7 @@ $(GTK3LIB).unstripped: $(GTK3_OBJS) $(XC
@@ -305,7 +308,7 @@ $(GTK3LIB).unstripped: $(GTK3_OBJS) $(XC
-o $@ \
-Wl,-soname -Wl,$(GTK3LIB_SONAME) \
$(GTK3_OBJS) $(XCP_OBJS) \
$(GTK3_OBJS) $(XCP_OBJS) $(IMAGE_OBJS) \
- $(XNVCTRL_ARCHIVE) $(LIBS) $(GTK3_LIBS)
+ $(XNVCTRL_LIB) $(LIBS) $(GTK3_LIBS)
endif
# define the rule to build each object file
@@ -299,7 +302,7 @@ $(foreach src,$(XCP_SRC),$(eval $(call D
@@ -316,7 +319,7 @@ $(foreach src,$(XCP_SRC),$(eval $(call D
$(eval $(call DEFINE_STAMP_C_RULE, $(OBJS),$(NVIDIA_SETTINGS_PROGRAM_NAME)))
# define the rule to build $(XNVCTRL_ARCHIVE)
......
......@@ -24,28 +24,28 @@ Description: link libraries after object files
endif
else
GTK3_CFLAGS ?=
@@ -276,19 +276,19 @@ $(NVIDIA_SETTINGS).unstripped: $(OBJS) $
@@ -293,19 +293,19 @@ $(NVIDIA_SETTINGS).unstripped: $(OBJS) $
$(eval $(call DEBUG_INFO_RULES, $(GTK2LIB)))
$(GTK2LIB).unstripped: $(GTK2_OBJS) $(XCP_OBJS) $(VERSION_MK)
$(GTK2LIB).unstripped: $(GTK2_OBJS) $(XCP_OBJS) $(IMAGE_OBJS) $(VERSION_MK)
$(call quiet_cmd,LINK) -shared $(CFLAGS) $(LDFLAGS) $(BIN_LDFLAGS) \
- $(XNVCTRL_ARCHIVE) $(LIBS) $(GTK2_LIBS) \
- -Wl,--unresolved-symbols=ignore-all -o $@ \
+ -o $@ \
-Wl,-soname -Wl,$(GTK2LIB_SONAME) \
- $(GTK2_OBJS) $(XCP_OBJS)
+ $(GTK2_OBJS) $(XCP_OBJS) \
- $(GTK2_OBJS) $(IMAGE_OBJS) $(XCP_OBJS)
+ $(GTK2_OBJS) $(IMAGE_OBJS) $(XCP_OBJS) \
+ $(XNVCTRL_ARCHIVE) $(LIBS) $(GTK2_LIBS)
ifdef BUILD_GTK3LIB
$(eval $(call DEBUG_INFO_RULES, $(GTK3LIB)))
$(GTK3LIB).unstripped: $(GTK3_OBJS) $(XCP_OBJS) $(VERSION_MK)
$(GTK3LIB).unstripped: $(GTK3_OBJS) $(XCP_OBJS) $(IMAGE_OBJS) $(VERSION_MK)
$(call quiet_cmd,LINK) -shared $(CFLAGS) $(LDFLAGS) $(BIN_LDFLAGS) \
- $(XNVCTRL_ARCHIVE) $(LIBS) $(GTK3_LIBS) \
- -Wl,--unresolved-symbols=ignore-all -o $@ \
+ -o $@ \
-Wl,-soname -Wl,$(GTK3LIB_SONAME) \
- $(GTK3_OBJS) $(XCP_OBJS)
+ $(GTK3_OBJS) $(XCP_OBJS) \
- $(GTK3_OBJS) $(XCP_OBJS) $(IMAGE_OBJS)
+ $(GTK3_OBJS) $(XCP_OBJS) $(IMAGE_OBJS) \
+ $(XNVCTRL_ARCHIVE) $(LIBS) $(GTK3_LIBS)
endif
......
......@@ -7,6 +7,7 @@ export NV_VERBOSE=1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
include /usr/share/dpkg/buildflags.mk
include /usr/share/dpkg/pkg-info.mk
PKG_CONFIG_XORG_XSERVER_LIBDIR = $(shell pkg-config --variable=libdir xorg-server)
CPPFLAGS += -DPKG_CONFIG_XORG_XSERVER_LIBDIR='\"$(PKG_CONFIG_XORG_XSERVER_LIBDIR)\"'
......@@ -26,6 +27,7 @@ export NV_USE_BUNDLED_LIBJANSSON = 0
include debian/rules.defs
NVIDIA_LEGACY ?=
NVIDIA_ALTERNATIVE ?= nvidia$(legacy)-alternative
NVIDIA_RELEASE = $(DEB_VERSION_UPSTREAM)
legacy = $(if $(NVIDIA_LEGACY),-legacy-$(NVIDIA_LEGACY)xx)
legacy_description = $(if $(NVIDIA_LEGACY), ($(NVIDIA_LEGACY)xx legacy version))
nvidia_private = nvidia$(if $(legacy),/$(patsubst -%,%,$(legacy)),/current)
......@@ -46,8 +48,13 @@ AUTOCLEAN = $(filter-out $(AUTOKEEP),$(AUTOGEN))
%:
dh $@
ifeq (,$(filter nvidia-settings,$(shell dh_listpackages)))
override_dh_auto_build: $(AUTOGEN)
CC_ONLY_CFLAGS="$(CPPFLAGS)" dh_auto_build --sourcedirectory=src/libXNVCtrl
override_dh_auto_install:
else
override_dh_auto_build: $(AUTOGEN)
$(RM) src/libXNVCtrl/libXNVCtrl.a
CC_ONLY_CFLAGS="$(CPPFLAGS)" dh_auto_build -O--parallel
$(MAKE) -C samples
......@@ -56,8 +63,13 @@ override_dh_auto_install:
install -m 0755 samples/$(OUTPUTDIR)/nv-control-dpy debian/tmp/usr/bin/
install -m 0644 doc/nvidia-settings.png debian/tmp/nvidia-settings$(legacy).png
override_dh_strip:
dh_strip -Nnvidia-settings
dh_strip --remaining-packages --no-automatic-dbgsym
endif
override_dh_missing:
dh_missing --list-missing
dh_missing --fail-missing
override_dh_auto_clean:
dh_auto_clean
......@@ -68,21 +80,21 @@ override_dh_auto_clean:
$(RM) $(AUTOCLEAN)
$(MAKE) -f debian/rules $(AUTOKEEP)
override_dh_strip:
dh_strip -Nnvidia-settings
dh_strip --remaining-packages --no-automatic-dbgsym
override_dh_compress:
dh_compress --exclude=.c --exclude=.mk
override_dh_gencontrol:
if [ -f debian/nvidia-settings.substvars ]; then \
sed -ri -e 's/libgtk2.0-0 \(>= 2.8.0\)//' \
-e 's/libgtk-3-0 \(>= 3.0.0\)//' \
debian/nvidia-settings.substvars ; \
set -ex; \
if [ -f debian/nvidia-settings$(legacy).substvars ]; then \
sed -ri -e 's/(^[^:]*:Depends=)/\1 GTK3 | GTK2, /' \
-e 's/(GTK2)(.*)(libgtk2.0-0 \([^\)]*\))/\3\2/' \
-e 's/(GTK3)(.*)(libgtk-3-0 \([^\)]*\))/\3\2/' \
debian/nvidia-settings$(legacy).substvars ; \
! grep GTK debian/nvidia-settings$(legacy).substvars ; \
fi
dh_gencontrol -- -V'nvidia:Legacy=$(legacy)' \
-V'nvidia:LegacyDesc=$(legacy_description)' \
-V'nvidia:Version=$(NVIDIA_RELEASE)' \
-V'nvidia-alternative=$(NVIDIA_ALTERNATIVE)'
# used by dpkg-genchanges
......
# upstream provides no signatures
debian-watch-may-check-gpg-signature
debian-watch-does-not-check-gpg-signature
Name: nvidia-settings
Repository: https://github.com/NVIDIA/nvidia-settings.git
Repository-Browse: https://github.com/NVIDIA/nvidia-settings
NVIDIA_VERSION = 384.111
NVIDIA_VERSION = 390.48
......@@ -70,6 +70,7 @@ int main(int ac, char **av)
Pixmap blendPixmap;
vertexDataRec warpData[6];
int nvDpyId;
Bool blendAfterWarp = False;
if (!xDpy) {
fprintf (stderr, "Could not open X Display %s!\n", XDisplayName(NULL));
......@@ -78,12 +79,16 @@ int main(int ac, char **av)
screenId = XDefaultScreen(xDpy);
if (ac != 2) {
fprintf (stderr, "Usage: ./nv-control-warpblend nvDpyId\n");
if ((ac != 2) && (ac != 3)) {
fprintf (stderr, "Usage: ./nv-control-warpblend nvDpyId [--blend-after-warp]\n");
fprintf (stderr, "See 'nvidia-settings -q CurrentMetaMode' for currently connected DPYs.\n");
return 1;
}
if (ac == 3) {
blendAfterWarp = (strcmp("--blend-after-warp", av[2]) == 0);
}
nvDpyId = atoi(av[1]);
// Start with two screen-aligned triangles, and warp them using the sample
......@@ -166,7 +171,7 @@ int main(int ac, char **av)
screenId,
nvDpyId,
blendPixmap,
False);
blendAfterWarp);
return 0;
}
NVIDIA_VERSION = 384.111
NVIDIA_VERSION = 390.48
......@@ -219,6 +219,8 @@ XCP_OBJS = $(call BUILD_OBJECT_LIST,$(XCP_SRC))
GTK2_OBJS = $(call BUILD_OBJECT_LIST_WITH_DIR,$(GTK_SRC),$(GTK2LIB_DIR))
GTK3_OBJS = $(call BUILD_OBJECT_LIST_WITH_DIR,$(GTK_SRC),$(GTK3LIB_DIR))
IMAGE_OBJS = $(addprefix $(OUTPUTDIR)/,$(addsuffix .o,$(notdir $(IMAGE_FILES))))
IMAGE_HEADERS = $(addprefix $(OUTPUTDIR)/,$(addsuffix .h,$(notdir $(IMAGE_FILES))))
CFLAGS += -I .
CFLAGS += -I image_data
......@@ -252,6 +254,13 @@ ifneq ($(NV_USE_BUNDLED_LIBJANSSON),0)
$(call BUILD_OBJECT_LIST,$(JANSSON_SRC)): CFLAGS += $(JANSSON_CFLAGS)
endif
define BINARY_DATA_HEADER_RULE
$$(OUTPUTDIR)/$(notdir $(1)).h:
$(at_if_quiet){ \
$$(PRINTF) "extern const char _binary_$(subst .,_,$(notdir $(1)))_start[];\n"; \
$$(PRINTF) "extern const char _binary_$(subst .,_,$(notdir $(1)))_end[];\n"; \
} > $$@
endef
##############################################################################
# build rules
......@@ -282,21 +291,21 @@ $(NVIDIA_SETTINGS).unstripped: $(OBJS) $(XNVCTRL_ARCHIVE)
-rdynamic -o $@ $(OBJS) $(XNVCTRL_ARCHIVE) $(LIBS)
$(eval $(call DEBUG_INFO_RULES, $(GTK2LIB)))
$(GTK2LIB).unstripped: $(GTK2_OBJS) $(XCP_OBJS) $(VERSION_MK)
$(GTK2LIB).unstripped: $(GTK2_OBJS) $(XCP_OBJS) $(IMAGE_OBJS) $(VERSION_MK)
$(call quiet_cmd,LINK) -shared $(CFLAGS) $(LDFLAGS) $(BIN_LDFLAGS) \
$(XNVCTRL_ARCHIVE) $(LIBS) $(GTK2_LIBS) \
-Wl,--unresolved-symbols=ignore-all -o $@ \
-Wl,-soname -Wl,$(GTK2LIB_SONAME) \
$(GTK2_OBJS) $(XCP_OBJS)
$(GTK2_OBJS) $(IMAGE_OBJS) $(XCP_OBJS)
ifdef BUILD_GTK3LIB
$(eval $(call DEBUG_INFO_RULES, $(GTK3LIB)))
$(GTK3LIB).unstripped: $(GTK3_OBJS) $(XCP_OBJS) $(VERSION_MK)
$(GTK3LIB).unstripped: $(GTK3_OBJS) $(XCP_OBJS) $(IMAGE_OBJS) $(VERSION_MK)
$(call quiet_cmd,LINK) -shared $(CFLAGS) $(LDFLAGS) $(BIN_LDFLAGS) \
$(XNVCTRL_ARCHIVE) $(LIBS) $(GTK3_LIBS) \
-Wl,--unresolved-symbols=ignore-all -o $@ \
-Wl,-soname -Wl,$(GTK3LIB_SONAME) \
$(GTK3_OBJS) $(XCP_OBJS)
$(GTK3_OBJS) $(XCP_OBJS) $(IMAGE_OBJS)
endif
# define the rule to build each object file
......@@ -315,7 +324,8 @@ build-xnvctrl:
clean clobber:
rm -rf $(NVIDIA_SETTINGS) *~ $(STAMP_C) \
$(OUTPUTDIR)/*.o $(OUTPUTDIR)/*.d \
$(GTK2LIB) $(GTK3LIB) $(GTK2LIB_DIR) $(GTK3LIB_DIR)
$(GTK2LIB) $(GTK3LIB) $(GTK2LIB_DIR) $(GTK3LIB_DIR) \
$(IMAGE_HEADERS)
@$(MAKE) -C $(XNVCTRL_DIR) -f $(XNVCTRL_MAKEFILE) clean
$(foreach src,$(GTK_SRC), \
......@@ -326,3 +336,14 @@ $(foreach src,$(GTK_SRC), \
$(eval $(call DEFINE_OBJECT_RULE_WITH_DIR,TARGET,$(src),$(GTK3LIB_DIR))))
endif
# Build $(IMAGE_OBJS)
$(foreach png,$(IMAGE_FILES), \
$(eval $(call READ_ONLY_OBJECT_FROM_FILE_RULE,$(png))))
# Build $(IMAGE_HEADERS)
$(foreach png,$(IMAGE_FILES), \
$(eval $(call BINARY_DATA_HEADER_RULE,$(png))))
$(GTK2_OBJS): $(IMAGE_HEADERS)
ifdef BUILD_GTK3LIB
$(GTK3_OBJS): $(IMAGE_HEADERS)
endif
This diff is collapsed.
......@@ -544,6 +544,9 @@ GtkTextBuffer *ctk_config_create_help(CtkConfig *ctk_config, GtkTextTagTable *ta
"consecutive polls (in milliseconds). The Active "
"Timers table is only visible when timers are active.");
ctk_help_heading(b, &i, "Save Current Configuration");
ctk_help_para(b, &i, "%s", __save_current_config_help);
ctk_help_finish(b);
return b;
......
......@@ -587,10 +587,9 @@ Bool mode_set_rotation(nvModePtr mode, Rotation rotation)
/** apply_mode_attribute_token() *************************************
*
* Modifies the nvMode structure (pointed to by data) with
* information from the token-value pair given. Currently accepts
* stereo (mode) data.
* information from the token-value pair given.
*
* Unknown token and/or values are silently ignored.
* Unknown tokens and/or values are silently ignored.
*
**/
static void apply_mode_attribute_token(char *token, char *value, void *data)
......@@ -674,6 +673,12 @@ static void apply_mode_attribute_token(char *token, char *value, void *data)
if (!strcasecmp("on", value)) {
mode->forceFullCompositionPipeline = True;
}
/* AllowGSYNC */
} else if (!strcasecmp("allowgsync", token)) {
if (!strcasecmp("off", value)) {
mode->allowGSYNC = False;
}
}
}
......@@ -714,6 +719,7 @@ nvModePtr mode_parse(nvDisplayPtr display, const char *mode_str)
mode->reflection = REFLECTION_NONE;
mode->passive_stereo_eye = PASSIVE_STEREO_EYE_NONE;
mode->position_type = CONF_ADJ_ABSOLUTE;
mode->allowGSYNC = True;
/* Read the mode name */
......@@ -1186,6 +1192,14 @@ static gchar *mode_get_str(nvLayoutPtr layout,
flags_str = tmp;
}
/* AllowGSYNC */
if (!mode->allowGSYNC) {
tmp = g_strdup_printf("%s, AllowGSYNC=Off",
(flags_str ? flags_str : ""));
g_free(flags_str);
flags_str = tmp;
}
if (flags_str) {
tmp = g_strdup_printf("%s {%s}",
mode_str,
......@@ -1637,31 +1651,6 @@ void display_remove_modes(nvDisplayPtr display)
/*!
* Sets all the modes on the display to the specified rotation
*
* \param[in] mode The display who's modes are to be modified
* \param[in] rotation The rotation to set
*
* \return TRUE if a new rotation was set for at least one mode, FALSE if all
* of the modes on the display were already set to the rotation given.
*/
Bool display_set_modes_rotation(nvDisplayPtr display, Rotation rotation)
{
nvModePtr mode;
Bool modified = FALSE;
for (mode = display->modes; mode; mode = mode->next) {
if (mode_set_rotation(mode, rotation)) {
modified = TRUE;
}
}
return modified;
}
/** display_free() ***************************************************
*
* Frees memory used by a display
......
......@@ -82,7 +82,6 @@ Bool display_has_modeline(nvDisplayPtr display, nvModeLinePtr modeline);
Bool display_add_modelines_from_server(nvDisplayPtr display, nvGpuPtr gpu,
gchar **err_str);
void display_remove_modes(nvDisplayPtr display);
Bool display_set_modes_rotation(nvDisplayPtr display, Rotation rotation);
/* Metamode functions */
......
......@@ -2541,19 +2541,30 @@ static void setup_mosaic_config(CtkDisplayConfig *ctk_object)
{
nvDisplayPtr display = ctk_display_layout_get_selected_display
(CTK_DISPLAY_LAYOUT(ctk_object->obj_layout));
nvScreenPtr screen = ctk_display_layout_get_selected_screen
(CTK_DISPLAY_LAYOUT(ctk_object->obj_layout));
nvGpuPtr gpu;
const char *tooltip;
const gchar *label;
gboolean display_gpu_support_mosaic = (display && display->gpu &&
display->gpu->mosaic_type != MOSAIC_TYPE_UNSUPPORTED);
gboolean screen_gpu_support_mosaic = (screen && screen->display_owner_gpu &&
screen->display_owner_gpu->mosaic_type != MOSAIC_TYPE_UNSUPPORTED);
if (!display || !display->gpu || !ctk_object->advanced_mode ||
display->gpu->mosaic_type == MOSAIC_TYPE_UNSUPPORTED) {
if (!ctk_object->advanced_mode ||
(!display_gpu_support_mosaic && !screen_gpu_support_mosaic)) {
gtk_widget_hide(ctk_object->chk_mosaic_enabled);
return;
}
gtk_widget_show(ctk_object->chk_mosaic_enabled);
gpu = display->gpu;
if (display_gpu_support_mosaic) {
gpu = display->gpu;
} else {
gpu = screen->display_owner_gpu;
}
switch (gpu->mosaic_type) {
case MOSAIC_TYPE_SLI_MOSAIC:
......@@ -6182,6 +6193,8 @@ static void display_refresh_changed(GtkWidget *widget, gpointer user_data)
gint idx;
nvModeLinePtr modeline;
nvDisplayPtr display;
Rotation old_rotation;
Reflection old_reflection;
/* Get the modeline and display to set */
......@@ -6190,6 +6203,9 @@ static void display_refresh_changed(GtkWidget *widget, gpointer user_data)
display = ctk_display_layout_get_selected_display
(CTK_DISPLAY_LAYOUT(ctk_object->obj_layout));
/* Save the current rotation and reflection settings */
old_rotation = display->cur_mode->rotation;
old_reflection = display->cur_mode->reflection;
/* In Basic view, we assume the user most likely wants
* to change which metamode is being used.
......@@ -6214,6 +6230,24 @@ static void display_refresh_changed(GtkWidget *widget, gpointer user_data)
&display->cur_mode->viewPortIn,
&display->cur_mode->viewPortOut);
/* If we are in Basic mode, apply the rotation and reflection settings from
* the previous mode to the new mode.
*/
if (!ctk_object->advanced_mode) {
if (display->cur_mode->rotation != old_rotation) {
ctk_display_layout_set_display_rotation(
CTK_DISPLAY_LAYOUT(ctk_object->obj_layout),
display, old_rotation);
}
if (display->cur_mode->reflection != old_reflection) {
ctk_display_layout_set_display_reflection(
CTK_DISPLAY_LAYOUT(ctk_object->obj_layout),
display, old_reflection);
}
}
/* Update the modename */
setup_display_modename(ctk_object);
......@@ -6236,6 +6270,8 @@ static void display_resolution_changed(GtkWidget *widget, gpointer user_data)
gint last_idx;
nvSelectedModePtr selected_mode;
nvDisplayPtr display;
Rotation old_rotation;
Reflection old_reflection;
/* Get the modeline and display to set */
......@@ -6254,6 +6290,9 @@ static void display_resolution_changed(GtkWidget *widget, gpointer user_data)
return;
}
/* Save the current rotation and reflection settings */
old_rotation = display->cur_mode->rotation;
old_reflection = display->cur_mode->reflection;
/* In Basic view, we assume the user most likely wants
* to change which metamode is being used.
......@@ -6289,6 +6328,24 @@ static void display_resolution_changed(GtkWidget *widget, gpointer user_data)
NULL /* viewPortOut */);
}
/* If we are in Basic mode, apply the rotation and reflection settings from
* the previous mode to the new mode.
*/
if (!ctk_object->advanced_mode) {
if (display->cur_mode->rotation != old_rotation) {
ctk_display_layout_set_display_rotation(
CTK_DISPLAY_LAYOUT(ctk_object->obj_layout),
display, old_rotation);
}
if (display->cur_mode->reflection != old_reflection) {
ctk_display_layout_set_display_reflection(
CTK_DISPLAY_LAYOUT(ctk_object->obj_layout),
display, old_reflection);
}
}
/* Update the UI */
setup_display_page(ctk_object);
......
......@@ -1965,6 +1965,8 @@ static int move_selected(CtkDisplayLayout *ctk_object, int x, int y, int snap)
sdim = get_screen_rect(info->screen, 1);
/* Prevent moving out of the max layout bounds */
/* Restrict movement in the positive direction */
x = MAX_LAYOUT_WIDTH - dim->width;
if (info->dst_dim.x > x) {
info->modify_dim.x += x - info->dst_dim.x;
......@@ -1975,12 +1977,18 @@ static int move_selected(CtkDisplayLayout *ctk_object, int x, int y, int snap)
info->modify_dim.y += y - info->dst_dim.y;
info->dst_dim.y = y;
}
x = layout->dim.width - MAX_LAYOUT_WIDTH;
/* Restrict movement in the negative direction. As long as the total
* distance does not exceed our maximum value, we can recalculate the
* layout origin. We should also make sure that the current origin (0,0)
* is accessible to the user.
*/
x = NV_MIN(layout->dim.width - MAX_LAYOUT_WIDTH, 0);
if (info->dst_dim.x < x) {
info->modify_dim.x += x - info->dst_dim.x;
info->dst_dim.x = x;
}
y = layout->dim.height - MAX_LAYOUT_HEIGHT;
y = NV_MIN(layout->dim.height - MAX_LAYOUT_HEIGHT, 0);
if (info->dst_dim.y < y) {
info->modify_dim.y += y - info->dst_dim.y;
info->dst_dim.y = y;
......@@ -4452,9 +4460,7 @@ void ctk_display_layout_set_display_panning(CtkDisplayLayout *ctk_object,
/*!
* Sets the rotation orientation for the display.
*
* In basic mode, this function will make all modes on the display have the
* same rotation. In advanced mode, only the current mode will have its
* rotation orientation modified.
* Only the current mode will have its rotation orientation modified.
*
* If a modification occurs, this function will call the modified_callback
* handler registered, if any.
......@@ -4467,23 +4473,13 @@ void ctk_display_layout_set_display_rotation(CtkDisplayLayout *ctk_object,
nvDisplayPtr display,
Rotation rotation)
{
Bool modified;
if (!display->cur_mode ||
!display->cur_mode->modeline) {
return;
}
if (ctk_object->advanced_mode) {
/* In advanced mode, only set the rotation of the current mode */
modified = mode_set_rotation(display->cur_mode, rotation);
} else {
/* In basic mode, make all the modes have the same rotation */
modified = display_set_modes_rotation(display, rotation);
}
if (mode_set_rotation(display->cur_mode, rotation)) {
if (modified) {
/* Update the layout */
ctk_display_layout_update(ctk_object);
......@@ -4500,9 +4496,7 @@ void ctk_display_layout_set_display_rotation(CtkDisplayLayout *ctk_object,
/*!
* Sets the reflection orientation for the display.
*
* In basic mode, this function will make all modes on the display have the
* same reflection. In advanced mode, only the current mode will have its
* reflection orientation modified.
* Only the current mode will have its reflection orientation modified.
*
* If a modification occurs, this function will call the modified_callback
* handler registered, if any.
......@@ -4515,33 +4509,15 @@ void ctk_display_layout_set_display_reflection(CtkDisplayLayout *ctk_object,
nvDisplayPtr display,
Reflection reflection)
{
Bool modified = FALSE;
if (!display->cur_mode ||
!display->cur_mode->modeline) {
return;
}
if (ctk_object->advanced_mode) {
/* In advanced mode, only set the reflection of the current mode */
if (display->cur_mode->reflection != reflection) {
modified = TRUE;
}
display->cur_mode->reflection = reflection;
} else {
nvModePtr mode;
if (display->cur_mode->reflection != reflection) {
/* In basic mode, make all the modes have the same reflection */
for (mode = display->modes; mode; mode = mode->next) {
if (mode->reflection != reflection) {
mode->reflection = reflection;
modified = TRUE;
}
}
}
display->cur_mode->reflection = reflection;
if (modified) {
/* Update the layout */
ctk_display_layout_update(ctk_object);
......
......@@ -226,6 +226,7 @@ typedef struct nvModeRec {
Bool forceCompositionPipeline;
Bool forceFullCompositionPipeline;
Bool allowGSYNC;
} nvMode, *nvModePtr;
......
......@@ -77,6 +77,7 @@ static void show_ecc_toggle_warning_dlg(CtkEcc *);
static void ecc_set_config_status(CtkEcc *);
static void ecc_configuration_update_received(GObject *, CtrlEvent *, gpointer);
static void post_ecc_configuration_update(CtkEcc *);
static void reset_default_config_button_clicked(GtkWidget *, gpointer);
GType ctk_ecc_get_type(void)
{
......@@ -164,12 +165,40 @@ static gboolean update_ecc_info(gpointer user_data)
CtkEcc *ctk_ecc = CTK_ECC(user_data);
CtrlTarget *ctrl_target = ctk_ecc->ctrl_target;
int64_t val;
gboolean status;
ReturnStatus ret;
if (ctk_ecc->ecc_enabled == FALSE) {
if (!ctk_ecc->ecc_config_supported && !ctk_ecc->ecc_enabled ) {
return FALSE;
}
/*
* The ECC Configuration may be changed by non NV-CONTROL clients so we
* can't rely on an event to update the configuration state.
*/
if (ctk_ecc->ecc_config_supported) {
ret = NvCtrlGetAttribute(ctrl_target, NV_CTRL_GPU_ECC_CONFIGURATION,
&status);
if (ret != NvCtrlSuccess ||
status == NV_CTRL_GPU_ECC_CONFIGURATION_DISABLED) {
ctk_ecc->ecc_configured = FALSE;
} else {
ctk_ecc->ecc_configured = TRUE;
}
ecc_set_config_status(ctk_ecc);
}
/* If ECC is not enabled, don't query ECC details but continue updating */
if (ctk_ecc->ecc_enabled == FALSE) {
return TRUE;
}
/* Query ECC Errors */
if (ctk_ecc->sbit_error) {
......@@ -257,6 +286,20 @@ static void ecc_set_config_status(CtkEcc *ctk_ecc)
g_signal_handlers_unblock_by_func(G_OBJECT(ctk_ecc->configuration_status),
G_CALLBACK(ecc_config_button_toggled),
(gpointer) ctk_ecc);
g_signal_handlers_block_by_func
(G_OBJECT(ctk_ecc->reset_default_config_button),
G_CALLBACK(reset_default_config_button_clicked),
(gpointer) ctk_ecc);
gtk_widget_set_sensitive
(ctk_ecc->reset_default_config_button,
ctk_ecc->ecc_config_supported &&
(ctk_ecc->ecc_configured != ctk_ecc->ecc_default_status));
g_signal_handlers_unblock_by_func
(G_OBJECT(ctk_ecc->reset_default_config_button),
G_CALLBACK(reset_default_config_button_clicked),
(gpointer) ctk_ecc);
}
......@@ -296,30 +339,21 @@ static void ecc_configuration_update_received(GObject *object,
static void reset_default_config_button_clicked(GtkWidget *widget,
gpointer user_data)
{
gboolean status;
ReturnStatus ret;
CtkEcc *ctk_ecc = CTK_ECC(user_data);
CtrlTarget *ctrl_target = ctk_ecc->ctrl_target;
/* get default status and set it to ECC configuration */
ret = NvCtrlGetAttribute(ctrl_target,
NV_CTRL_GPU_ECC_DEFAULT_CONFIGURATION,
&status);
if (ret != NvCtrlSuccess) {
ctk_config_statusbar_message(ctk_ecc->ctk_config,
"Failed to get default configuration!");
return;
}
/* set default status to ECC configuration */
ret = NvCtrlSetAttribute(ctrl_target,
NV_CTRL_GPU_ECC_CONFIGURATION,
status);
ctk_ecc->ecc_default_status);
if (ret != NvCtrlSuccess) {
ctk_config_statusbar_message(ctk_ecc->ctk_config,
"Failed to set default configuration!");
return;
}
ctk_ecc->ecc_configured = status;
ctk_ecc->ecc_configured = ctk_ecc->ecc_default_status;
/* update ECC configuration button status */
ecc_set_config_status(ctk_ecc);
......@@ -385,6 +419,9 @@ static void show_ecc_toggle_warning_dlg(CtkEcc *ctk_ecc)
if (ctk_ecc->ecc_toggle_warning_dlg_shown) {
return;
}
ctk_ecc_stop_timer(GTK_WIDGET(ctk_ecc));
ctk_ecc->ecc_toggle_warning_dlg_shown = TRUE;
parent = ctk_get_parent_window(GTK_WIDGET(ctk_ecc));
......@@ -397,6 +434,8 @@ static void show_ecc_toggle_warning_dlg(CtkEcc *ctk_ecc)
"taking effect.");
gtk_dialog_run(GTK_DIALOG(dlg));
gtk_widget_destroy (dlg);
ctk_ecc_start_timer(GTK_WIDGET(ctk_ecc));
}
......@@ -431,7 +470,9 @@ static void ecc_config_button_toggled(GtkWidget *widget,
ctk_ecc->ecc_configured = enabled;
gtk_widget_set_sensitive(ctk_ecc->reset_default_config_button, TRUE);
gtk_widget_set_sensitive(ctk_ecc->reset_default_config_button,
ctk_ecc->ecc_config_supported &&
(enabled != ctk_ecc->ecc_default_status));
/* Update status bar message */
post_ecc_configuration_update(ctk_ecc);
......@@ -458,7 +499,6 @@ GtkWidget* ctk_ecc_new(CtrlTarget *ctrl_target,
gboolean dbit_error_available;
gboolean aggregate_dbit_error_available;
gboolean ecc_enabled;
gboolean ecc_default_status;
ReturnStatus ret;
gchar *ecc_enabled_string;
gchar *str = NULL;
......@@ -528,9 +568,9 @@ GtkWidget* ctk_ecc_new(CtrlTarget *ctrl_target,
&val);
if (ret != NvCtrlSuccess ||
val == NV_CTRL_GPU_ECC_DEFAULT_CONFIGURATION_DISABLED) {
ecc_default_status = FALSE;
ctk_ecc->ecc_default_status = FALSE;
} else {
ecc_default_status = TRUE;
ctk_ecc->ecc_default_status = TRUE;
}
/* Query ECC errors */
......@@ -572,6 +612,8 @@ GtkWidget* ctk_ecc_new(CtrlTarget *ctrl_target,
ecc_config_supported = 0;
}
ctk_ecc->ecc_config_supported = ecc_config_supported;
/* set container properties for the CtkEcc widget */
gtk_box_set_spacing(GTK_BOX(ctk_ecc), 5);
......@@ -720,7 +762,7 @@ GtkWidget* ctk_ecc_new(CtrlTarget *ctrl_target,
__reset_default_config_button_help);
gtk_widget_set_sensitive(ctk_ecc->reset_default_config_button,
ecc_config_supported &&
(ecc_enabled != ecc_default_status));
(ecc_enabled != ctk_ecc->ecc_default_status));
g_signal_connect(G_OBJECT(ctk_ecc->reset_default_config_button),
"clicked",
G_CALLBACK(reset_default_config_button_clicked),
......
......@@ -58,7 +58,6 @@ struct _CtkEcc
GtkWidget* dbit_error;
GtkWidget* aggregate_sbit_error;
GtkWidget* aggregate_dbit_error;
GtkWidget* ecc_config_supported;
GtkWidget* clear_button;
GtkWidget* clear_aggregate_button;
GtkWidget* reset_default_config_button;
......@@ -71,6 +70,8 @@ struct _CtkEcc
gboolean dbit_error_available;
gboolean aggregate_sbit_error_available;
gboolean aggregate_dbit_error_available;
gboolean ecc_config_supported;
gboolean ecc_default_status;
};
......
......@@ -18,7 +18,6 @@
*/
#include <gtk/gtk.h>
#include <gdk-pixbuf/gdk-pixdata.h>
#include "NvCtrlAttributes.h"
#include "NVCtrlLib.h"
......@@ -34,15 +33,15 @@
#include "ctkhelp.h"
#include "ctkevent.h"
#include "led_green_pixdata.h"
#include "led_red_pixdata.h"
#include "led_grey_pixdata.h"
#include "led_green.png.h"
#include "led_red.png.h"
#include "led_grey.png.h"
#include "rj45_input_pixdata.h"
#include "rj45_output_pixdata.h"
#include "rj45_unused_pixdata.h"
#include "rj45_input.png.h"
#include "rj45_output.png.h"
#include "rj45_unused.png.h"
#include "bnc_cable_pixdata.h"
#include "bnc_cable.png.h"
#include "parse.h"
#include "msg.h"
......@@ -4941,19 +4940,13 @@ GtkWidget* ctk_framelock_new(CtrlTarget *ctrl_target,
/* Cache images */
ctk_framelock->led_grey_pixbuf =
gdk_pixbuf_from_pixdata(&led_grey_pixdata, TRUE, NULL);
ctk_framelock->led_green_pixbuf =
gdk_pixbuf_from_pixdata(&led_green_pixdata, TRUE, NULL);
ctk_framelock->led_red_pixbuf =
gdk_pixbuf_from_pixdata(&led_red_pixdata, TRUE, NULL);
ctk_framelock->led_grey_pixbuf = CTK_LOAD_PIXBUF(led_grey);
ctk_framelock->led_green_pixbuf = CTK_LOAD_PIXBUF(led_green);
ctk_framelock->led_red_pixbuf = CTK_LOAD_PIXBUF(led_red);
ctk_framelock->rj45_input_pixbuf =
gdk_pixbuf_from_pixdata(&rj45_input_pixdata, TRUE, NULL);
ctk_framelock->rj45_output_pixbuf =
gdk_pixbuf_from_pixdata(&rj45_output_pixdata, TRUE, NULL);
ctk_framelock->rj45_unused_pixbuf =
gdk_pixbuf_from_pixdata(&rj45_unused_pixdata, TRUE, NULL);
ctk_framelock->rj45_input_pixbuf = CTK_LOAD_PIXBUF(rj45_input);
ctk_framelock->rj45_output_pixbuf = CTK_LOAD_PIXBUF(rj45_output);
ctk_framelock->rj45_unused_pixbuf = CTK_LOAD_PIXBUF(rj45_unused);
g_object_ref(ctk_framelock->led_grey_pixbuf);
g_object_ref(ctk_framelock->led_green_pixbuf);
......@@ -5035,8 +5028,7 @@ GtkWidget* ctk_framelock_new(CtrlTarget *ctrl_target,
gtk_container_add(GTK_CONTAINER(frame), padding);
/* add house sync BNC connector image */
image = gtk_image_new_from_pixbuf
(gdk_pixbuf_from_pixdata(&bnc_cable_pixdata, TRUE, NULL));
image = gtk_image_new_from_pixbuf(CTK_LOAD_PIXBUF(bnc_cable));
hbox = gtk_hbox_new(FALSE, 0);
gtk_box_pack_end(GTK_BOX(hbox), image, FALSE, FALSE, 0);
......
/*
* nvidia-settings: A tool for configuring the NVIDIA X driver on Unix
* and Linux systems.
*
* Copyright (C) 2017 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,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses>.
*/
#include "ctkutils.h"
#include "ctkglstereo.h"
#ifdef CTK_GTK3
#include <GL/gl.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "right.png.h"
#include "left.png.h"
#include "nvlogo.png.h"
#include "matrix_utils.h"
#include "opengl_loading.h"
#include "ctkglwidget.h"
#endif
#ifdef CTK_GTK3
const unsigned int animateDiv = 1000;
static void animate(StereoAppData *appData, int eye)
{
float x;
int op;
float delta = 0.2;
GLfloat tm[16]; // Temporary matrix
GLfloat *mvp; // Model-View-Projection matrix
mvp = appData->cube->mvp;
if (eye == GL_LEFT) {
op = 1;
} else {
op = -1;
}
x = 2 * M_PI / animateDiv * appData->animationCounter;
genIdentityMatrix(mvp);
genRotateMatrixX(M_PI / 4, tm);
matrixMult(mvp, tm);
genRotateMatrixZ(M_PI / 4, tm);
matrixMult(mvp, tm);
// Apply the calculated rotation for this
// frame along axis X and Y to generate the
// animated effect
genRotateMatrixX(x, tm);
matrixMult(mvp, tm);
genRotateMatrixY(x, tm);
matrixMult(mvp, tm);
// Translates depending on eye
// and locates the object away from zero in the z-axis so
// that is viewable in the fov we define in the next step.
genTranslateMatrix(op * delta, 0, -1.5, tm);
matrixMult(mvp, tm);
genPerspectiveMatrix(M_PI / 2 , 1, 0.5, 5, tm);
matrixMult(mvp, tm);
}
static void produceFrameStereoTest(void *_appData)
{
StereoAppData *appData = _appData;
dGL.glDrawBuffer(GL_BACK_LEFT);
dGL.glClearColor(206.0/255, 206.0/255, 206.0/255, 1);
dGL.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
animate(appData, GL_LEFT);
drawModel(appData->cube);
drawModel(appData->labelLeft);
dGL.glDrawBuffer(GL_BACK_RIGHT);
dGL.glClearColor(206.0/255, 206.0/255, 206.0/255, 1);
dGL.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
animate(appData, GL_RIGHT);
drawModel(appData->cube);
drawModel(appData->labelRight);
appData->animationCounter++;
appData->animationCounter %= animateDiv;
}
static int verifyOpenglForStereo(void)
{
GLint majorVer = 0;
dGL.glGetIntegerv(GL_MAJOR_VERSION, &majorVer);
if (majorVer < 3) {
return -1;
}
return 0;
}
static int setupStereoTest(void *_appData)
{
StereoAppData *appData = _appData;
GdkPixbuf *nvidiaLogo = CTK_LOAD_PIXBUF(nvlogo);
GdkPixbuf *imageLeft = CTK_LOAD_PIXBUF(left);
GdkPixbuf *imageRight = CTK_LOAD_PIXBUF(right);
if (verifyOpenglForStereo() != 0) {
return -2;
}
dGL.glViewport(0, 0, 200, 200);
dGL.glEnable(GL_DEPTH_TEST);
dGL.glEnable(GL_BLEND);
dGL.glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
dGL.glEnable(GL_TEXTURE_2D);
dGL.glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
appData->animationCounter = 0;
appData->cube = cubeSetup(nvidiaLogo);
appData->labelLeft = labelSetup(-0.75, 0.90, // x and y
0.5, 0.20, // width and height
1, 0, 0, // rgb
imageLeft // GdkPixbuf *
);
appData->labelRight = labelSetup(0.70, 0.85, // x and y
0.6, 0.20, // width and height
0, 0, 1, // rgb
imageRight // GdkPixbuf *
);
g_object_unref(nvidiaLogo);
g_object_unref(imageLeft);
g_object_unref(imageRight);
if (appData->cube == NULL ||
appData->labelLeft == NULL ||
appData->labelRight == NULL) {
return -1;
}
return 0;
}
#endif
GtkWidget *ctk_glstereo_new(void)
{
#ifdef CTK_GTK3
GtkWidget *gtk_widget;
CtkGLWidget *ctk_glwidget;
int glx_attributes[] = {
GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT,
GLX_RENDER_TYPE, GLX_RGBA_BIT,
GLX_DOUBLEBUFFER, 1,
GLX_RED_SIZE, 1,
GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1,
GLX_ALPHA_SIZE, 1,
GLX_DEPTH_SIZE, 1,
GLX_STEREO, 1,