diff options
author | Aaron Plattner <aplattner@nvidia.com> | 2021-06-22 08:45:19 -0700 |
---|---|---|
committer | Aaron Plattner <aplattner@nvidia.com> | 2021-06-22 08:45:19 -0700 |
commit | ebdd4d69f0e143dedbc4265f63be30d421343b0d (patch) | |
tree | 1b42191d3215407a6dcfd61de4268737bdff61a8 | |
parent | 459b2974f0382e1b58c9cc5ec06a7e77339ddeac (diff) |
470.42.01
-rw-r--r-- | common-utils/gen-manpage-opts-helper.c | 3 | ||||
-rw-r--r-- | common-utils/nvgetopt.h | 4 | ||||
-rw-r--r-- | multiple_screens.c | 15 | ||||
-rw-r--r-- | utils.mk | 8 | ||||
-rw-r--r-- | version.mk | 2 |
5 files changed, 19 insertions, 13 deletions
diff --git a/common-utils/gen-manpage-opts-helper.c b/common-utils/gen-manpage-opts-helper.c index b41e2aa..56ba7b3 100644 --- a/common-utils/gen-manpage-opts-helper.c +++ b/common-utils/gen-manpage-opts-helper.c @@ -31,7 +31,8 @@ static void print_option(const NVGetoptOption *o) { - char scratch[64], *s; + char scratch[64]; + const char *s; int j, len; int italics, bold, omitWhiteSpace, firstchar; diff --git a/common-utils/nvgetopt.h b/common-utils/nvgetopt.h index 0262aac..37da80e 100644 --- a/common-utils/nvgetopt.h +++ b/common-utils/nvgetopt.h @@ -117,8 +117,8 @@ typedef struct { const char *name; int val; unsigned int flags; - char *arg_name; /* not used by nvgetopt() */ - char *description; /* not used by nvgetopt() */ + const char *arg_name; /* not used by nvgetopt() */ + const char *description; /* not used by nvgetopt() */ } NVGetoptOption; diff --git a/multiple_screens.c b/multiple_screens.c index cb04740..bfa9b23 100644 --- a/multiple_screens.c +++ b/multiple_screens.c @@ -302,6 +302,7 @@ DevicesPtr find_devices(Options *op) DevicesPtr pDevices = NULL; DisplayDevicePtr pDisplayDevice; int i, j, n, count = 0; + int swappedIndex; unsigned int mask, bit; DeviceRec tmpDevice; NvCfgPciDevice *devs = NULL; @@ -366,9 +367,7 @@ DevicesPtr find_devices(Options *op) __GET_FUNC(__getEDID, "nvCfgGetEDID"); __GET_FUNC(__closeDevice, "nvCfgCloseDevice"); __GET_FUNC(__getDeviceUUID, "nvCfgGetDeviceUUID"); - - /* optional functions */ - __isPrimaryDevice = dlsym(lib_handle, "nvCfgIsPrimaryDevice"); + __GET_FUNC(__isPrimaryDevice,"nvCfgIsPrimaryDevice"); if (__getPciDevices(&count, &devs) != NVCFG_TRUE) { return NULL; @@ -449,17 +448,21 @@ DevicesPtr find_devices(Options *op) pDevices->devices[i].displayDevices = NULL; } - if ((i != 0) && (__isPrimaryDevice != NULL) && + /* Use this index instead of i to close device after a possible swap */ + swappedIndex = i; + + if ((i != 0) && (__isPrimaryDevice(pDevices->devices[i].handle, &is_primary_device) == NVCFG_TRUE) && (is_primary_device == NVCFG_TRUE)) { memcpy(&tmpDevice, &pDevices->devices[0], sizeof(DeviceRec)); memcpy(&pDevices->devices[0], &pDevices->devices[i], sizeof(DeviceRec)); memcpy(&pDevices->devices[i], &tmpDevice, sizeof(DeviceRec)); + swappedIndex = 0; } - ret = __closeDevice(pDevices->devices[i].handle); - pDevices->devices[i].handle = NULL; + ret = __closeDevice(pDevices->devices[swappedIndex].handle); + pDevices->devices[swappedIndex].handle = NULL; if (ret != NVCFG_TRUE) { goto fail; @@ -36,8 +36,8 @@ CC ?= gcc CXX ?= g++ LD ?= ld AR ?= ar -# only set these warnings and optimizations if CFLAGS is unset -CFLAGS ?= -Wall -O2 +# only set these warnings if CFLAGS is unset +CFLAGS ?= -Wall # always set these -f CFLAGS CFLAGS += -fno-strict-aliasing -fno-omit-frame-pointer -Wformat=2 CC_ONLY_CFLAGS ?= @@ -67,6 +67,8 @@ ifeq ($(DEBUG),1) DO_STRIP ?= CFLAGS += -O0 -g CFLAGS += -DDEBUG=1 +else + CFLAGS += -O2 endif ifeq ($(DEVELOP),1) @@ -301,7 +303,7 @@ host_target = $(patsubst HOST,HOST_,$(patsubst TARGET,,$(1))) ifeq ($(NV_AUTO_DEPEND),1) AUTO_DEP_SUFFIX = -MMD -MF $$(@:.o=.d.to_be_processed) -MP -MT $$@ && \ - $$(SED) -e "1,3s@ $$< @ @" < $$(@:.o=.d.to_be_processed) > $$(@:.o=.d) + $$(SED) -e "1,3s| $$< | |" < $$(@:.o=.d.to_be_processed) > $$(@:.o=.d) else AUTO_DEP_SUFFIX = endif @@ -1,4 +1,4 @@ -NVIDIA_VERSION = 465.31 +NVIDIA_VERSION = 470.42.01 # This file. VERSION_MK_FILE := $(lastword $(MAKEFILE_LIST)) |