[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#684871: unblock: nvidia-graphics-drivers/304.37-1, nvidia-settings/304.37-1, nvidia-xconfig/304.37-1



Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock

Please unblock packages nvidia-graphics-drivers, nvidia-settings, and
nvidia-xconfig.

The new upstream long lived branch release nvidia-graphics-drivers
304.37 fixes the following bugs (and perhaps a few more where we
didn't get feedback, yet):

* #684781: CVE-2012-4225
* #683758: blue tinted screen when using DirectColor visuals
* #681453: EDID detection on some laptop internal panels
* #679577: black screen or corruption after waking up from suspend

At the same time several packaging updates have accumulated in
experimental, this is the merged and annotated debian-only changelog
since 302.17-3:

  * [ several new upstream beta releases ]
  * Update nv-readme.ids.
  * Update symbols control files.
  * Update lintian overrides.
  * Work around dpkg-gencontrol bug #659814. 
    [ add empty first paragraph in the long descriptions because the first
    two paragraphs get merged if there are substvars in the long
    description ]
  * Convert *-ia32 into transitional packages due to ia32-libs transition:
    - $pkg:i386 Provides: $pkg-i386
    - $pkg-ia32 Recommends: $pkg-i386
    - Add multiarch instructions to long descriptions.
    [ the -ia32 packages are no longer buildable due to the transitional
      ia32-libs in sid ]
  * xserver-xorg-video-nvidia.postrm: Do not fail if the debconf templates
    from nvidia-support are not available.
  * Disable patch-3.0-rt-nvidia.patch, no longer needed.
  * Add legacy qualification to nvidia-settings suggestion.
    [ this will be relevant for n-g-d-legacy-173xx, see below ]
  * nvidia-opencl-icd: Ship new library libnvidia-opencl.so.1 and tighten
    dependency on nvidia-opencl-common and libnvidia-compiler.
    (Closes: #683678)
    [ upstream split this functionality from libcuda.so.1 ]
  * debian/rules: get-orig-source: Make --pasv overridable.
  * Add xorg-video-abi-13 as alternative dependency.
  * nvidia-kernel-source: Add Built-Using attribute to the generated module
    packages to record the exact versions of linux and nvidia-graphics-drivers
    that were used during the build.
    [ noticed by Philipp Kern in nvidia-graphics-modules ]
  * libgl1-nvidia-glx:i386: Add Breaks: ia32-libs (<< 20120701) because that
    is shipping /usr/lib32/libGL.so.1 which gets no longer diverted away.
    [ avoid the same problem as reported against fglrx-driver #683853 ]
  * 3.6_kernel.patch: New patch to fix compilation with Linux 3.6, taken from
    rpmfusion.  (Closes: #684486)
  * nvidia-kernel-dkms: Set Multi-Arch: foreign (instead of allowed).
  * Add nvidia-kernel-dkms (= ${binary:Version}) as preferred alternative to
    (virtual) nvidia-kernel-${nvidia:Version}.  (Closes: #684782)

There is also a new feature in 304.xx that has not yet been included as
it requires a new package (nvidia-cuda-proxy).

Two of these changes are unavoidable (-ia32 stuff,
libnvidia-opencl.so.1), the others are rather simple.


The nvidia-{settings,xconfig} packages should be kept in sync with the
driver version (at least the major version) s.t. they may utilize and
configure all the new features that were introduced recently.

nvidia-xconfig has no Debian specific changes (compared to the version
currently in wheezy), while nvidia-settings adds conflicts with older
and legacy driver versions because nvidia-settings is no longer
backwards compatible to these versions (there were significant driver
changes in 302.xx and 304.xx and -settings was adjusted for these new
features). nvidia-settings-legacy-173xx (currently in NEW) is an
older version that can be used by the 173xx legacy driver (the older
legacy drivers are no longer supported and have been converted to
transitional packages).

unblock nvidia-graphics-drivers/304.37-1
unblock nvidia-settings/304.37-1
unblock nvidia-xconfig/304.37-1

debdiffs are attached.


Thanks,

Andreas
diffstat for nvidia-graphics-drivers-302.17 nvidia-graphics-drivers-304.37

 changelog                                    |  189 +++++++++++++++++++++++++
 control                                      |  198 ++++++++++++---------------
 libcuda1-ia32.install.in                     |    1 
 libcuda1-ia32.links.in                       |    2 
 libcuda1-ia32.postinst.in                    |   18 --
 libcuda1-ia32.symbols                        |    1 
 libcuda1.lintian-overrides.in                |    1 
 libcuda1.symbols                             |   28 +++
 libgl1-nvidia-glx-ia32.docs                  |    1 
 libgl1-nvidia-glx-ia32.install.in            |    4 
 libgl1-nvidia-glx-ia32.links.in              |    1 
 libgl1-nvidia-glx-ia32.lintian-overrides.in  |   17 --
 libgl1-nvidia-glx-ia32.postinst.in           |   12 -
 libgl1-nvidia-glx-ia32.symbols               |    1 
 libgl1-nvidia-glx.symbols                    |    5 
 libnvidia-compiler-ia32.install.in           |    1 
 libnvidia-compiler-ia32.lintian-overrides.in |    9 -
 libnvidia-compiler-ia32.symbols              |    1 
 libnvidia-ml1.symbols                        |   14 +
 module/debian/control.template.in            |    1 
 module/debian/patches/3.6_kernel.patch       |   20 ++
 module/debian/patches/series                 |    3 
 module/debian/rules                          |    6 
 nv-readme.ids                                |    4 
 nvidia-libopencl1-ia32.install               |    1 
 nvidia-libopencl1-ia32.links                 |    2 
 nvidia-libopencl1-ia32.lintian-overrides     |    8 -
 nvidia-libopencl1-ia32.shlibs                |    1 
 nvidia-libopencl1-ia32.symbols               |    1 
 nvidia-opencl-icd.install.in                 |    1 
 nvidia-opencl-icd.links.in                   |    1 
 nvidia-opencl-icd.lintian-overrides.in       |   11 +
 nvidia-opencl-icd.symbols                    |    4 
 nvidia-vdpau-driver-ia32.docs                |    1 
 nvidia-vdpau-driver-ia32.install.in          |    1 
 nvidia-vdpau-driver-ia32.links.in            |    1 
 rules                                        |   14 -
 rules.defs                                   |    4 
 xserver-xorg-video-nvidia.postrm             |    2 
 39 files changed, 382 insertions(+), 209 deletions(-)

diff -Nru --exclude '*.run' nvidia-graphics-drivers-302.17/debian/changelog nvidia-graphics-drivers-304.37/debian/changelog
--- nvidia-graphics-drivers-302.17/debian/changelog	2012-06-30 18:15:58.000000000 +0200
+++ nvidia-graphics-drivers-304.37/debian/changelog	2012-08-14 09:41:14.000000000 +0200
@@ -1,3 +1,192 @@
+nvidia-graphics-drivers (304.37-1) unstable; urgency=low
+
+  * New upstream long lived branch release 304.37 (2012-08-13).
+    - Removed the ability to enable SLI on GPUs with ECC enabled.
+    - Fixed several bugs that prevented some RandR transform geometries from
+      being applied.
+    - Fixed a bug that caused frequent hangs or crashes on some systems.
+    - Fixed a bug that would cause corruption and performance issues in certain
+      OpenGL applications such as Amnesia: The Dark Descent on GeForce 6 and 7
+      GPUs.
+  * New upstream release 295 series.
+    * CVE-2012-4225  (Closes: 684781)
+    - Implemented hotfix for a privilege escalation vulnerability reported on
+      August 1, 2012.  For more details, see:
+      http://nvidia.custhelp.com/app/answers/detail/a_id/3140
+  * nvidia-kernel-source: Add Built-Using attribute to the generated module
+    packages to record the exact versions of linux and nvidia-graphics-drivers
+    that were used during the build.
+  * libgl1-nvidia-glx:i386: Add Breaks: ia32-libs (<< 20120701) because that
+    is shipping /usr/lib32/libGL.so.1 which gets no longer diverted away.
+  * 3.6_kernel.patch: New patch to fix compilation with Linux 3.6, taken from
+    rpmfusion.  (Closes: #684486)
+  * nvidia-kernel-dkms: Set Multi-Arch: foreign (instead of allowed).
+  * Add nvidia-kernel-dkms (= ${binary:Version}) as preferred alternative to
+    (virtual) nvidia-kernel-${nvidia:Version}.  (Closes: #684782)
+  * Upload to unstable.
+
+ -- Andreas Beckmann <debian@abeckmann.de>  Tue, 14 Aug 2012 09:36:31 +0200
+
+nvidia-graphics-drivers (304.32-1) experimental; urgency=low
+
+  * New upstream beta 304.32 (2012-08-03).
+    - Fixed a bug that caused applications that use DirectColor visuals, such as
+      Enemy Territory: Quake Wars and Braid, to appear in shades of blue instead
+      of the correct colors.  (Closes: #683758)
+    - Modified handling of RRSetScreenSize requests to ignore requests that
+      do not actually resize the screen.  This reduces screen flicker in certain
+      cases when using GNOME.
+  * debian/rules: get-orig-source: Make --pasv overridable.
+  * Add xorg-video-abi-13 as alternative dependency.
+  * Update symbols control files.
+
+ -- Andreas Beckmann <debian@abeckmann.de>  Sat, 04 Aug 2012 14:41:00 +0200
+
+nvidia-graphics-drivers (304.30-2) experimental; urgency=low
+
+  * Disable patch-3.0-rt-nvidia.patch, no longer needed.
+  * Add legacy qualification to nvidia-settings suggestion.
+  * nvidia-opencl-icd: Ship new library libnvidia-opencl.so.1 and tighten
+    dependency on nvidia-opencl-common and libnvidia-compiler.
+    (Closes: #683678)
+
+ -- Andreas Beckmann <debian@abeckmann.de>  Fri, 03 Aug 2012 13:41:12 +0200
+
+nvidia-graphics-drivers (304.30-1) experimental; urgency=low
+
+  * New upstream beta 304.30 (2012-07-30).
+    - Added support for xserver ABI 13 (xorg-server 1.13).
+    - Added support for RandR per-CRTC gamma manipulation through the
+      RandR 1.2 RRGetCrtcGammaSize, RRGetCrtcGamma, and RRSetCrtcGamma
+      requests.
+    - Fixed a bug that caused RRSetOutputPrimary requests to incorrectly
+      generate BadValue errors when setting the primary output to None.  This
+      caused gnome-settings-daemon to crash after changing the screen
+      configuration in response to a display hotplug or the display change
+      hot-key being pressed.
+    - Fixed a problem where RENDER Glyphs operations would exhibit severe
+      performance issues in certain cases, such as when used with gradients
+      by Cairo and Chromium.
+    - Fixed a bug that caused X to hang when resuming certain DisplayPort
+      display devices (such as Apple brand mini-DisplayPort to dual-link DVI
+      adapters) from power-saving mode.
+    - Added support for the following GPU: Tesla K10.
+    - Fixed a bug that caused an X screen to be extended to Quadro SDI Output
+      devices by default.  An X screen will still use an SDI Output device if
+      it is the only display device available.  To use a SDI Output device on
+      an X screen with other display devices available, include the SDI Output
+      device with either the "UseDisplayDevice" or "MetaMode" X configuration
+      options.
+    - Updated X11 modeline validation such that modes not defined in a
+      display device's EDID are discarded if the EDID 1.3 "GTF Supported"
+      flag is unset or if the EDID 1.4 "Continuous Frequency" flag is
+      unset.  The new "AllowNonEdidModes" token for the ModeValidation
+      X configuration option can be used to disable this new check.
+    - Fixed a bug, introduced in the 295.xx release series, with EDID
+      detection on some laptop internal panels.  This bug caused the
+      laptop internal panel to show six small copies of the desktop.
+      (Closes: #681453)
+    - Added support for FXAA, Fast Approximate Anti-Aliasing.
+  * Update nv-readme.ids.
+  * Update symbols control files.
+  * xserver-xorg-video-nvidia.postrm: Do not fail if the debconf templates
+    from nvidia-support are not available.
+
+ -- Andreas Beckmann <debian@abeckmann.de>  Tue, 31 Jul 2012 11:36:58 +0200
+
+nvidia-graphics-drivers (304.22-1) experimental; urgency=low
+
+  * New upstream beta 304.22 (2012-07-13).
+    - Added support for the following GPUs: GeForce GTX 680M, Quadro K1000M,
+      Quadro K2000M.
+    - Enhanced the functionality of the IncludeImplicitMetaModes X
+      configuration option:
+      + Implicit MetaModes will be added for the primary display device,
+        even if multiple display devices are in use when X is initialized.
+      + Implicit MetaModes will be added for common resolutions, even
+        if there isn't a mode with that resolution in the mode pool of
+        the display device.
+      + Extended the syntax of the IncludeImplicitMetaModes X
+        configuration option, e.g., to control which display device is
+        used for creation of implicit MetaModes.
+      See the description of the IncludeImplicitMetaModes X configuration
+      option in the README for details.
+    - Modified the handling of the RandR 1.0/1.1 requests RRGetScreenInfo
+      and RRSetScreenConfig (e.g., `xrandr -q --q1` and `xrandr --size ...`
+      and `xrandr --orientation ...`) such that they operate on MetaModes.
+      This was the behavior in NVIDIA X driver versions 295.xx and
+      earlier, but 302.xx releases altered the handling of these RandR
+      1.0/1.1 requests to operate on a single RandR output's modes.
+    - With the above changes to IncludeImplicitMetaModes and RandR 1.0/1.1
+      handling, fullscreen applications (e.g., SDL-based applications,
+      Wine), should have more resolutions available to them, and should
+      interact better with multiple monitor configurations.
+    - Fixed a bug that could cause G8x, G9x, and GT2xx GPUs to display a black
+      screen or corruption after waking up from suspend.  (Closes: #679577)
+    - Fixed several bugs that could cause some OpenGL programs to hang
+      when calling fork(3).
+    - Fixed an nvidia-settings bug that caused the results of ProbeDisplays
+      queries made with the --display-device-string option to be formatted
+      incorrectly.
+    - Improved the responsiveness of updates to the nvidia-settings
+      control panel when displays are hotplugged.
+    - Fixed a bug that caused display corruption when setting some
+      transforms, especially when panning a transformed display.
+    - Fixed a bug that caused extra RandR events to be generated the first
+      time a display is hotplugged.
+    - Fixed a bug that caused X11 modelines with '@' in their names to
+      be rejected.
+    - Added support for DisplayPort 1.2 branch devices, which allow multiple
+      displays to be connected to a single DisplayPort connector on a graphics
+      board.
+    - Fixed a bug that caused most OpenGL texture uploads to be slow when
+      the context was bound rendering to an RGB overlay drawable.
+    - Fixed a bug that caused audio over HDMI to not work after restarting
+      the X server on some MCP7x (IGP) GPUs.
+    - Updated the X configuration option "UseDisplayDevice" to honor the
+      value "none" on any GPU.
+    - Added support for DKMS in nvidia-installer. Installing the kernel
+      module through DKMS allows the module to be rebuilt automatically
+      when changing to a different Linux kernel. See the README and the
+      nvidia-installer help text for the "--dkms" option.
+    - Added RandR output properties _ConnectorLocation, ConnectorNumber,
+      ConnectorType, EDID, _GUID, and SignalFormat.  See the README for details
+      on these properties.
+    - Extended support for Base Mosaic to all G80+ SLI configurations with up
+      to three displays.
+    - Fixed a bug that caused some monitors to fail to wake from DPMS suspend
+      mode when multiple DisplayPort monitors were attached to one GPU.
+    - Removed controls for XVideo attributes from the "X Server XVideo
+      Settings" page of the nvidia-settings control panel. XVideo attributes
+      can be configured in XVideo player applications, or through utilities
+      such as xvattr.
+    - Fixed a bug that caused all ports on an XVideo adaptor to share
+      color correction settings.
+    - Removed support for the following X configuration options:
+         SecondMonitorHorizSync
+         SecondMonitorVertRefresh
+       Similar control is available through the NVIDIA HorizSync and
+       VertRefresh X configuration options.  Please see the NVIDIA driver
+       README for details.
+    - Fixed a bug that prevented NVIDIA 3D Vision Pro from working
+      properly when switching between X servers on different VTs.
+  * New upstream release 302 series.
+    - Added support for desktop panning when rotation, reflection,
+      or transformation is applied to a display device (either through
+      RandR or through the MetaMode syntax); panning would previously be
+      ignored in that case.
+  * Upload to experimental.
+  * Update nv-readme.ids.
+  * Update symbols control files.
+  * Update lintian overrides.
+  * Work around dpkg-gencontrol bug #659814. 
+  * Convert *-ia32 into transitional packages due to ia32-libs transition:
+    - $pkg:i386 Provides: $pkg-i386
+    - $pkg-ia32 Recommends: $pkg-i386
+    - Add multiarch instructions to long descriptions.
+
+ -- Andreas Beckmann <debian@abeckmann.de>  Tue, 17 Jul 2012 19:29:40 +0200
+
 nvidia-graphics-drivers (302.17-3) unstable; urgency=low
 
   * nvidia-smi: Add missing Depends: libnvidia-ml1.  (Closes: #679332)
diff -Nru --exclude '*.run' nvidia-graphics-drivers-302.17/debian/control nvidia-graphics-drivers-304.37/debian/control
--- nvidia-graphics-drivers-302.17/debian/control	2012-06-30 18:15:58.000000000 +0200
+++ nvidia-graphics-drivers-304.37/debian/control	2012-08-14 09:41:14.000000000 +0200
@@ -15,7 +15,6 @@
  libxext6,
  libxvmc1,
  quilt,
- ia32-libs (>= 20090804) [amd64],
 Standards-Version: 3.9.3
 Homepage: http://www.nvidia.com
 XS-Autobuild: yes
@@ -31,16 +30,20 @@
  xserver-xorg-video-nvidia${nvidia:Legacy} (= ${binary:Version}),
  nvidia-vdpau-driver (= ${binary:Version}),
  nvidia-alternative${nvidia:Legacy} (= ${binary:Version}),
- nvidia-kernel-${nvidia:Version}${nvidia:Perfkit},
+ nvidia-kernel${nvidia:Legacy}-dkms (= ${binary:Version})
+ | nvidia-kernel-${nvidia:Version}${nvidia:Perfkit},
  nvidia-support,
  ${shlibs:Depends}, ${misc:Depends}
+Recommends:
+ libgl1-nvidia${nvidia:Legacy}-glx-i386 [amd64],
 Suggests:
- nvidia-settings,
+ nvidia-settings${nvidia:Legacy},
  nvidia-kernel${nvidia:Legacy}-dkms (>= ${nvidia:Version})
  | nvidia-kernel${nvidia:Legacy}-source (>= ${nvidia:Version})
 Provides:
  nvidia-glx-any,
 Description: NVIDIA metapackage${nvidia:LegacyDesc}
+ .
  This metapackage depends on the NVIDIA binary driver and libraries
  that provide optimized hardware acceleration of
  OpenGL applications via a direct-rendering X Server.
@@ -69,9 +72,10 @@
  ${shlibs:Depends}, ${misc:Depends}
 Recommends:
  nvidia-vdpau-driver (>= ${nvidia:Version}),
- nvidia-kernel-${nvidia:Version}${nvidia:Perfkit},
+ nvidia-kernel${nvidia:Legacy}-dkms (= ${binary:Version})
+ | nvidia-kernel-${nvidia:Version}${nvidia:Perfkit},
 Suggests:
- nvidia-settings,
+ nvidia-settings${nvidia:Legacy},
  nvidia-kernel${nvidia:Legacy}-dkms (>= ${nvidia:Version})
  | nvidia-kernel${nvidia:Legacy}-source (>= ${nvidia:Version})
 Provides:
@@ -83,10 +87,11 @@
  nvidia-glx-legacy-71xx (<< 71.86.14-3),
  nvidia-glx-legacy-96xx (<< 96.43.19-2),
  nvidia-glx-legacy-173xx (<< 173.14.30-2),
- fglrx-driver (<< 11-6-~),
+ fglrx-driver (<< 1:11-6-~),
 Replaces:
  nvidia-glx${nvidia:Legacy} (<< 275.09.07-2),
 Description: NVIDIA binary Xorg driver${nvidia:LegacyDesc}
+ .
  These binary drivers provide optimized hardware acceleration of
  OpenGL applications via a direct-rendering X Server.
  AGP, PCIe, SLI, TV-out and flat panel displays are also supported.
@@ -123,11 +128,13 @@
  nvidia-support,
  ${shlibs:Depends}, ${misc:Depends}
 Recommends:
- nvidia-kernel-${nvidia:Version}${nvidia:Perfkit},
+ nvidia-kernel${nvidia:Legacy}-dkms (= ${binary:Version})
+ | nvidia-kernel-${nvidia:Version}${nvidia:Perfkit},
 Suggests:
  nvidia-kernel${nvidia:Legacy}-dkms (>= ${nvidia:Version})
  | nvidia-kernel${nvidia:Legacy}-source (>= ${nvidia:Version})
 Provides:
+ libgl1-nvidia${nvidia:Legacy}-glx-i386 [i386],
  libgl1-nvidia-glx-any,
 Conflicts:
  libgl1-nvidia${nvidia:Legacy}-dev,
@@ -144,12 +151,14 @@
  libgl1-nvidia-legacy-71xx-glx (<< 71.86.14-3),
  libgl1-nvidia-legacy-96xx-glx (<< 96.43.19-2),
  libgl1-nvidia-legacy-173xx-glx (<< 173.14.30-2),
- fglrx-glx (<< 11-6-~),
+ fglrx-glx (<< 1:11-6-~),
+ ia32-libs (<< 20120701) [i386],
 Replaces:
  nvidia-glx${nvidia:Legacy} (<< 195.36.31),
  libgl1-nvidia${nvidia:Legacy}-dev,
  nvidia-glx${nvidia:Legacy}-dev,
 Description: NVIDIA binary OpenGL libraries${nvidia:LegacyDesc}
+ .
  These binary libraries provide optimized hardware acceleration of
  OpenGL applications via a direct-rendering X Server.
  .
@@ -158,23 +167,16 @@
  for a complete list of supported GPUs and PCI IDs.
 
 Package: libgl1-nvidia-glx-ia32
+Section: non-free/oldlibs
 Priority: extra
 Architecture: amd64
 Pre-Depends:
  libc6-i386 (>= 2.9-18),
  nvidia-installer-cleanup,
- ${misc:Pre-Depends}
 Depends:
- libgl1-nvidia-alternatives-ia32,
- nvidia-support,
  ${shlibs:Depends}, ${misc:Depends}
 Recommends:
- nvidia-kernel-${nvidia:Version}${nvidia:Perfkit},
-Suggests:
- nvidia-kernel${nvidia:Legacy}-dkms (>= ${nvidia:Version})
- | nvidia-kernel${nvidia:Legacy}-source (>= ${nvidia:Version})
-Provides:
- libgl1-nvidia-glx-ia32-any,
+ libgl1-nvidia${nvidia:Legacy}-glx-i386,
 Conflicts:
  libgl1-nvidia-glx-ia32,
  libgl1-nvidia-glx-ia32-any,
@@ -188,13 +190,13 @@
  libgl1-nvidia${nvidia:Legacy}-glx (<< ${nvidia:Version}),
 Replaces:
  nvidia-glx${nvidia:Legacy}-ia32 (<< 195.36.31),
-Description: NVIDIA binary OpenGL 32-bit libraries${nvidia:LegacyDesc}
- These binary 32-bit libraries provide optimized hardware acceleration of
- OpenGL applications via a direct-rendering X Server.
+Description: please switch to multiarch libgl1-nvidia${nvidia:Legacy}-glx:i386
  .
- See the description of the nvidia-glx${nvidia:Legacy} package
- or /usr/share/doc/libgl1-nvidia${nvidia:Legacy}-glx/README.txt.gz
- for a complete list of supported GPUs and PCI IDs.
+ This is an empty transitional package to aid switching to multiarch.
+ .
+ Run the following commands to install the multiarch library:
+ * dpkg --add-architecture i386 ; apt-get update
+ * apt-get install libgl1-nvidia${nvidia:Legacy}-glx:i386
 
 Package: nvidia-alternative
 Architecture: i386 amd64
@@ -208,6 +210,7 @@
  nvidia-glx${nvidia:Legacy} (<< 275.09.07-2),
  libgl1-nvidia${nvidia:Legacy}-glx (<< 275.09.07-2),
 Description: allows the selection of NVIDIA as GLX provider
+ .
  In setups with several NVIDIA driver versions installed (e.g. current and
  legacy) this metapackage registers an alternative to allow easy switching
  between the different versions.
@@ -221,7 +224,7 @@
 Package: nvidia-kernel-dkms
 Section: non-free/kernel
 Architecture: i386 amd64
-Multi-Arch: allowed
+Multi-Arch: foreign
 Pre-Depends:
  nvidia-installer-cleanup,
 Depends:
@@ -238,6 +241,7 @@
 Breaks:
  make (= 3.82-1),
 Description: NVIDIA binary kernel module DKMS source${nvidia:LegacyDesc}
+ .
  This package builds the NVIDIA Xorg binary kernel module needed by
  nvidia-glx${nvidia:Legacy}, using DKMS.
  Provided that you have the kernel header packages installed, the kernel
@@ -270,6 +274,7 @@
 Breaks:
  make (= 3.82-1),
 Description: NVIDIA binary kernel module source${nvidia:LegacyDesc}
+ .
  This package provides the source for the NVIDIA Xorg binary kernel module
  needed by nvidia-glx${nvidia:Legacy} in a form suitable
  for use by module-assistant or kernel-package.
@@ -298,13 +303,15 @@
  libvdpau1,
  ${shlibs:Depends}, ${misc:Depends}
 Recommends:
- nvidia-kernel-${nvidia:Version}${nvidia:Perfkit},
+ nvidia-kernel${nvidia:Legacy}-dkms (= ${binary:Version})
+ | nvidia-kernel-${nvidia:Version}${nvidia:Perfkit},
 Suggests:
  nvidia-kernel${nvidia:Legacy}-dkms (>= ${nvidia:Version})
  | nvidia-kernel${nvidia:Legacy}-source (>= ${nvidia:Version})
 Enhances:
  libvdpau1,
 Provides:
+ nvidia-vdpau-driver-i386 [i386],
  vdpau-driver,
 Conflicts:
  nvidia-libvdpau,
@@ -322,6 +329,7 @@
  nvidia-libvdpau1,
  nvidia-libvdpau1-driver,
 Description: NVIDIA vdpau driver
+ .
  These libraries provide the Video Decode and Presentation API for Unix.
  They provide accelerated video playback (incl. H.264) for the supported
  graphics cards.
@@ -337,24 +345,16 @@
  This will provide nvidia-kernel-${nvidia:Version}${nvidia:Perfkit}.
 
 Package: nvidia-vdpau-driver-ia32
+Section: non-free/oldlibs
 Priority: extra
 Architecture: amd64
 Pre-Depends:
  libc6-i386 (>= 2.9-18),
  nvidia-installer-cleanup,
- ${misc:Pre-Depends}
 Depends:
- lib32vdpau1,
  ${shlibs:Depends}, ${misc:Depends}
 Recommends:
- nvidia-kernel-${nvidia:Version}${nvidia:Perfkit},
-Suggests:
- nvidia-kernel${nvidia:Legacy}-dkms (>= ${nvidia:Version})
- | nvidia-kernel${nvidia:Legacy}-source (>= ${nvidia:Version})
-Enhances:
- lib32vdpau1,
-Provides:
- vdpau-driver,
+ nvidia-vdpau-driver-i386,
 Conflicts:
  nvidia-libvdpau,
  nvidia-libvdpau1,
@@ -368,20 +368,12 @@
  nvidia-libvdpau1,
  nvidia-libvdpau1-ia32,
  nvidia-libvdpau1-driver-ia32,
-Description: NVIDIA vdpau 32-bit driver
- These libraries provide the Video Decode and Presentation API for Unix.
- They provide accelerated video playback (incl. H.264) for the supported
- graphics cards.
- .
- This package contains the NVIDIA VDPAU driver (32-bit).
+Description: please switch to multiarch nvidia-vdpau-driver:i386
+ This is an empty transitional package to aid switching to multiarch.
  .
- See /usr/share/doc/nvidia-vdpau-driver-ia32/README.txt.gz
- for more information.
- .
- Please see the nvidia-kernel${nvidia:Legacy}-dkms or
- nvidia-kernel${nvidia:Legacy}-source packages
- for building the kernel module required by this package.
- This will provide nvidia-kernel-${nvidia:Version}${nvidia:Perfkit}.
+ Run the following commands to install the multiarch library:
+ * dpkg --add-architecture i386 ; apt-get update
+ * apt-get install nvidia-vdpau-driver:i386
 
 Package: nvidia-smi
 Section: non-free/utils
@@ -390,7 +382,8 @@
  libnvidia-ml1 (= ${binary:Version}),
  ${shlibs:Depends}, ${misc:Depends}
 Recommends:
- nvidia-kernel-${nvidia:Version}${nvidia:Perfkit},
+ nvidia-kernel${nvidia:Legacy}-dkms (= ${binary:Version})
+ | nvidia-kernel-${nvidia:Version}${nvidia:Perfkit},
 Suggests:
  nvidia-kernel${nvidia:Legacy}-dkms (>= ${nvidia:Version})
  | nvidia-kernel${nvidia:Legacy}-source (>= ${nvidia:Version})
@@ -407,11 +400,14 @@
 Depends:
  ${shlibs:Depends}, ${misc:Depends}
 Recommends:
- nvidia-kernel-${nvidia:Version}${nvidia:Perfkit},
+ nvidia-kernel${nvidia:Legacy}-dkms (= ${binary:Version})
+ | nvidia-kernel-${nvidia:Version}${nvidia:Perfkit},
  nvidia-smi,
 Suggests:
  nvidia-kernel${nvidia:Legacy}-dkms (>= ${nvidia:Version})
  | nvidia-kernel${nvidia:Legacy}-source (>= ${nvidia:Version})
+Provides:
+ libcuda1-i386 [i386],
 Conflicts:
  libcuda1-dev,
  libcuda1-ia32 [i386],
@@ -421,6 +417,7 @@
  libcuda1-dev,
 Homepage: http://www.nvidia.com/CUDA
 Description: NVIDIA CUDA runtime library
+ .
  The Compute Unified Device Architecture (CUDA) enables NVIDIA
  graphics processing units (GPUs) to be used for massively parallel
  general purpose computation.
@@ -436,35 +433,24 @@
  This will provide nvidia-kernel-${nvidia:Version}${nvidia:Perfkit}.
 
 Package: libcuda1-ia32
+Section: non-free/oldlibs
 Priority: extra
 Architecture: amd64
 Pre-Depends:
  libc6-i386 (>= 2.9-18),
- ${misc:Pre-Depends}
 Depends:
  ${shlibs:Depends}, ${misc:Depends}
 Recommends:
- nvidia-kernel-${nvidia:Version}${nvidia:Perfkit},
-Suggests:
- nvidia-kernel${nvidia:Legacy}-dkms (>= ${nvidia:Version})
- | nvidia-kernel${nvidia:Legacy}-source (>= ${nvidia:Version})
+ libcuda1-i386,
 Replaces:
  nvidia-glx-ia32 (<< 185.18.14-2),
 Homepage: http://www.nvidia.com/CUDA
-Description: NVIDIA CUDA runtime library (32-bit)
- The Compute Unified Device Architecture (CUDA) enables NVIDIA
- graphics processing units (GPUs) to be used for massively parallel
- general purpose computation.
- .
- This package contains the driver specific runtime library (32-bit).
- .
- Supported NVIDIA devices include GPUs starting from GeForce 8 and Quadro FX
- series, as well as the Tesla computing processors.
+Description: please switch to multiarch libcuda1:i386
+ This is an empty transitional package to aid switching to multiarch.
  .
- Please see the nvidia-kernel${nvidia:Legacy}-dkms or
- nvidia-kernel${nvidia:Legacy}-source packages
- for building the kernel module required by this package.
- This will provide nvidia-kernel-${nvidia:Version}${nvidia:Perfkit}.
+ Run the following commands to install the multiarch library:
+ * dpkg --add-architecture i386 ; apt-get update
+ * apt-get install libcuda1:i386
 
 Package: libnvidia-compiler
 Architecture: i386 amd64
@@ -472,8 +458,9 @@
 Pre-Depends:
  ${misc:Pre-Depends}
 Depends:
- libcuda1 (= ${binary:Version}),
  ${shlibs:Depends}, ${misc:Depends}
+Provides:
+ libnvidia-compiler-i386 [i386],
 Conflicts:
  libnvidia-compiler1,
  libnvidia-compiler-ia32 [i386],
@@ -487,24 +474,25 @@
  This package contains the runtime compiler library.
 
 Package: libnvidia-compiler-ia32
+Section: non-free/oldlibs
 Priority: extra
 Architecture: amd64
 Pre-Depends:
  libc6-i386 (>= 2.9-18),
- ${misc:Pre-Depends}
 Depends:
- libcuda1-ia32 (= ${binary:Version}),
  ${shlibs:Depends}, ${misc:Depends}
+Recommends:
+ libnvidia-compiler-i386,
 Conflicts:
  libnvidia-compiler1-ia32,
 Replaces:
  libnvidia-compiler1-ia32,
-Description: NVIDIA runtime compiler library (32-bit)
- The Compute Unified Device Architecture (CUDA) enables NVIDIA
- graphics processing units (GPUs) to be used for massively parallel
- general purpose computation.
+Description: please switch to multiarch libnvidia-compiler:i386
+ This is an empty transitional package to aid switching to multiarch.
  .
- This package contains the runtime compiler library (32-bit).
+ Run the following commands to install the multiarch library:
+ * dpkg --add-architecture i386 ; apt-get update
+ * apt-get install libnvidia-compiler:i386
 
 Package: libnvcuvid1
 Architecture: i386 amd64
@@ -547,7 +535,9 @@
 Depends:
  ${misc:Depends}
 Recommends:
- nvidia-opencl-icd | nvidia-opencl-icd-ia32 [amd64]
+ nvidia-opencl-icd
+Breaks:
+ nvidia-opencl-icd (<< ${nvidia:Version}),
 Description: NVIDIA OpenCL driver
  OpenCL (Open Computing Language) is a multivendor open standard for
  general-purpose parallel programming of heterogeneous systems that include
@@ -559,18 +549,20 @@
 Package: nvidia-opencl-icd
 Architecture: i386 amd64
 Multi-Arch: same
+Pre-Depends:
+ ${misc:Pre-Depends}
 Depends:
- nvidia-opencl-common,
+ nvidia-opencl-common (= ${binary:Version}),
  libopencl1,
- libcuda1,
- libnvidia-compiler,
- ${misc:Depends}
+ libnvidia-compiler (= ${binary:Version}),
+ ${shlibs:Depends}, ${misc:Depends}
 Enhances:
  libopencl1,
 Conflicts:
  nvidia-opencl-icd-ia32 [i386],
 Provides:
  opencl-icd,
+ nvidia-opencl-icd-i386 [i386],
 Description: NVIDIA OpenCL ICD
  OpenCL (Open Computing Language) is a multivendor open standard for
  general-purpose parallel programming of heterogeneous systems that include
@@ -580,25 +572,19 @@
  OpenCL.
 
 Package: nvidia-opencl-icd-ia32
+Section: non-free/oldlibs
 Priority: extra
 Architecture: amd64
 Depends:
- nvidia-opencl-common,
- lib32opencl1,
- libcuda1-ia32,
- libnvidia-compiler-ia32,
  ${misc:Depends}
-Enhances:
- lib32opencl1,
-Provides:
- opencl-icd,
-Description: NVIDIA OpenCL ICD (32-bit)
- OpenCL (Open Computing Language) is a multivendor open standard for
- general-purpose parallel programming of heterogeneous systems that include
- CPUs, GPUs and other processors.
- .
- This metapackage provides the 32-bit NVIDIA installable client driver (ICD) for
- OpenCL.
+Recommends:
+ nvidia-opencl-icd-i386,
+Description: please switch to multiarch nvidia-opencl-icd:i386
+ This is an empty transitional package to aid switching to multiarch.
+ .
+ Run the following commands to install the multiarch library:
+ * dpkg --add-architecture i386 ; apt-get update
+ * apt-get install nvidia-opencl-icd:i386
 
 Package: nvidia-libopencl1
 Architecture: i386 amd64
@@ -611,6 +597,7 @@
  opencl-icd | nvidia-opencl-icd,
 Provides:
  libopencl1,
+ nvidia-libopencl1-i386 [i386],
 Conflicts:
  libopencl1,
  nvidia-libopencl1-dev,
@@ -627,24 +614,21 @@
  library provided by NVIDIA.
 
 Package: nvidia-libopencl1-ia32
+Section: non-free/oldlibs
 Priority: extra
 Architecture: amd64
 Pre-Depends:
  libc6-i386 (>= 2.9-18),
- ${misc:Pre-Depends}
 Depends:
  ${shlibs:Depends}, ${misc:Depends}
 Recommends:
- opencl-icd | nvidia-opencl-icd-ia32,
-Provides:
- lib32opencl1,
-Description: NVIDIA OpenCL 32-bit library
- OpenCL (Open Computing Language) is a multivendor open standard for
- general-purpose parallel programming of heterogeneous systems that include
- CPUs, GPUs and other processors.
- .
- This package contains the installable client driver loader (ICD Loader)
- 32-bit library provided by NVIDIA.
+ nvidia-libopencl1-i386,
+Description: please switch to multiarch nvidia-libopencl1:i386
+ This is an empty transitional package to aid switching to multiarch.
+ .
+ Run the following commands to install the multiarch library:
+ * dpkg --add-architecture i386 ; apt-get update
+ * apt-get install nvidia-libopencl1:i386
 
 Package: libgl1-nvidia-alternatives
 Section: non-free/oldlibs
diff -Nru --exclude '*.run' nvidia-graphics-drivers-302.17/debian/libcuda1-ia32.install.in nvidia-graphics-drivers-304.37/debian/libcuda1-ia32.install.in
--- nvidia-graphics-drivers-302.17/debian/libcuda1-ia32.install.in	2011-07-07 17:14:10.000000000 +0200
+++ nvidia-graphics-drivers-304.37/debian/libcuda1-ia32.install.in	1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-32/libcuda.so.#VERSION#		usr/lib32/
diff -Nru --exclude '*.run' nvidia-graphics-drivers-302.17/debian/libcuda1-ia32.links.in nvidia-graphics-drivers-304.37/debian/libcuda1-ia32.links.in
--- nvidia-graphics-drivers-302.17/debian/libcuda1-ia32.links.in	2010-05-19 17:04:01.000000000 +0200
+++ nvidia-graphics-drivers-304.37/debian/libcuda1-ia32.links.in	1970-01-01 01:00:00.000000000 +0100
@@ -1,2 +0,0 @@
-usr/lib32/libcuda.so.#VERSION#	usr/lib32/libcuda.so.1
-usr/lib32/libcuda.so.1		usr/lib32/libcuda.so
diff -Nru --exclude '*.run' nvidia-graphics-drivers-302.17/debian/libcuda1-ia32.postinst.in nvidia-graphics-drivers-304.37/debian/libcuda1-ia32.postinst.in
--- nvidia-graphics-drivers-302.17/debian/libcuda1-ia32.postinst.in	2011-08-30 15:06:27.000000000 +0200
+++ nvidia-graphics-drivers-304.37/debian/libcuda1-ia32.postinst.in	1970-01-01 01:00:00.000000000 +0100
@@ -1,18 +0,0 @@
-#!/bin/sh
-set -e
-
-
-if [ "$1" = "configure" ]
-then
-
-	if [ -x /usr/lib/nvidia/check-for-mismatching-nvidia-module ]
-	then
-		/usr/lib/nvidia/check-for-mismatching-nvidia-module #VERSION#
-	fi
-
-fi
-
-
-#DEBHELPER#
-
-exit 0
diff -Nru --exclude '*.run' nvidia-graphics-drivers-302.17/debian/libcuda1-ia32.symbols nvidia-graphics-drivers-304.37/debian/libcuda1-ia32.symbols
--- nvidia-graphics-drivers-302.17/debian/libcuda1-ia32.symbols	2010-06-03 13:17:14.000000000 +0200
+++ nvidia-graphics-drivers-304.37/debian/libcuda1-ia32.symbols	1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-#include "libcuda1.symbols"
diff -Nru --exclude '*.run' nvidia-graphics-drivers-302.17/debian/libcuda1.lintian-overrides.in nvidia-graphics-drivers-304.37/debian/libcuda1.lintian-overrides.in
--- nvidia-graphics-drivers-302.17/debian/libcuda1.lintian-overrides.in	2012-05-21 21:50:51.000000000 +0200
+++ nvidia-graphics-drivers-304.37/debian/libcuda1.lintian-overrides.in	2012-08-14 09:41:14.000000000 +0200
@@ -1,5 +1,6 @@
 # The NVIDIA license does not allow any form of modification.
 [i386]: embedded-library usr/lib*/libcuda.so.#VERSION#: libm
+embedded-library usr/lib*/libcuda.so.#VERSION#: zlib
 shlib-with-executable-stack
 [i386]: shlib-with-non-pic-code
 unstripped-binary-or-object
diff -Nru --exclude '*.run' nvidia-graphics-drivers-302.17/debian/libcuda1.symbols nvidia-graphics-drivers-304.37/debian/libcuda1.symbols
--- nvidia-graphics-drivers-302.17/debian/libcuda1.symbols	2012-03-23 14:37:21.000000000 +0100
+++ nvidia-graphics-drivers-304.37/debian/libcuda1.symbols	2012-08-14 09:41:14.000000000 +0200
@@ -1,6 +1,6 @@
 libcuda.so.1 #PACKAGE# #MINVER#
- clGetExtensionFunctionAddress@Base 195
- clGetPlatformInfo@Base 195.30
+#MISSING: 304.30# clGetExtensionFunctionAddress@Base 195
+#MISSING: 304.30# clGetPlatformInfo@Base 195.30
  cuArray3DCreate@Base 177
  cuArray3DCreate_v2@Base 260
  cuArray3DGetDescriptor@Base 177
@@ -74,6 +74,7 @@
  cuGraphicsGLRegisterBuffer@Base 195
  cuGraphicsGLRegisterImage@Base 195
  cuGraphicsMapResources@Base 195
+ cuGraphicsResourceGetMappedMipmappedArray@Base 304
  cuGraphicsResourceGetMappedPointer@Base 195
  cuGraphicsResourceGetMappedPointer_v2@Base 260
  cuGraphicsResourceSetMapFlags@Base 195
@@ -173,6 +174,9 @@
  cuMemsetD8@Base 169
  cuMemsetD8Async@Base 260
  cuMemsetD8_v2@Base 260
+ cuMipmappedArrayCreate@Base 304
+ cuMipmappedArrayDestroy@Base 304
+ cuMipmappedArrayGetLevel@Base 304
  cuModuleGetFunction@Base 169
  cuModuleGetGlobal@Base 169
  cuModuleGetGlobal_v2@Base 260
@@ -192,14 +196,23 @@
  cuProfilerInitialize@Base 270
  cuProfilerStart@Base 270
  cuProfilerStop@Base 270
+ cuStreamAddCallback@Base 304
  cuStreamCreate@Base 169
  cuStreamDestroy@Base 169
  cuStreamDestroy_v2@Base 270
  cuStreamQuery@Base 169
  cuStreamSynchronize@Base 169
  cuStreamWaitEvent@Base 260
+ cuSurfObjectCreate@Base 304
+ cuSurfObjectDestroy@Base 304
+ cuSurfObjectGetResourceDesc@Base 304
  cuSurfRefGetArray@Base 256
  cuSurfRefSetArray@Base 256
+ cuTexObjectCreate@Base 304
+ cuTexObjectDestroy@Base 304
+ cuTexObjectGetResourceDesc@Base 304
+ cuTexObjectGetResourceViewDesc@Base 304
+ cuTexObjectGetTextureDesc@Base 304
  cuTexRefCreate@Base 169
  cuTexRefDestroy@Base 169
  cuTexRefGetAddress@Base 169
@@ -209,6 +222,11 @@
  cuTexRefGetFilterMode@Base 169
  cuTexRefGetFlags@Base 169
  cuTexRefGetFormat@Base 177
+ cuTexRefGetMaxAnisotropy@Base 304
+ cuTexRefGetMipmapFilterMode@Base 304
+ cuTexRefGetMipmapLevelBias@Base 304
+ cuTexRefGetMipmapLevelClamp@Base 304
+ cuTexRefGetMipmappedArray@Base 304
  cuTexRefSetAddress2D@Base 185
  cuTexRefSetAddress2D_v2@Base 260
  cuTexRefSetAddress2D_v3@Base 285
@@ -219,9 +237,15 @@
  cuTexRefSetFilterMode@Base 169
  cuTexRefSetFlags@Base 169
  cuTexRefSetFormat@Base 169
+ cuTexRefSetMaxAnisotropy@Base 304
+ cuTexRefSetMipmapFilterMode@Base 304
+ cuTexRefSetMipmapLevelBias@Base 304
+ cuTexRefSetMipmapLevelClamp@Base 304
+ cuTexRefSetMipmappedArray@Base 304
  cuVDPAUCtxCreate@Base 256
  cuVDPAUCtxCreate_v2@Base 260
  cuVDPAUGetDevice@Base 256
  cudbgGetAPI@Base 195
  cudbgGetAPIVersion@Base 195
+ cudbgMain@Base 304
  gpudbgDebuggerAttached@Base 177
diff -Nru --exclude '*.run' nvidia-graphics-drivers-302.17/debian/libgl1-nvidia-glx-ia32.docs nvidia-graphics-drivers-304.37/debian/libgl1-nvidia-glx-ia32.docs
--- nvidia-graphics-drivers-302.17/debian/libgl1-nvidia-glx-ia32.docs	2010-08-26 11:34:37.000000000 +0200
+++ nvidia-graphics-drivers-304.37/debian/libgl1-nvidia-glx-ia32.docs	1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-debian/README.alternatives
diff -Nru --exclude '*.run' nvidia-graphics-drivers-302.17/debian/libgl1-nvidia-glx-ia32.install.in nvidia-graphics-drivers-304.37/debian/libgl1-nvidia-glx-ia32.install.in
--- nvidia-graphics-drivers-302.17/debian/libgl1-nvidia-glx-ia32.install.in	2011-07-07 17:14:10.000000000 +0200
+++ nvidia-graphics-drivers-304.37/debian/libgl1-nvidia-glx-ia32.install.in	1970-01-01 01:00:00.000000000 +0100
@@ -1,4 +0,0 @@
-32/libGL.so.#VERSION#			usr/lib32/nvidia/
-32/libnvidia-glcore.so.#VERSION#	usr/lib32/
-32/libnvidia-tls.so.#VERSION#		usr/lib32/
-32/tls/libnvidia-tls.so.#VERSION#	usr/lib32/tls/
diff -Nru --exclude '*.run' nvidia-graphics-drivers-302.17/debian/libgl1-nvidia-glx-ia32.links.in nvidia-graphics-drivers-304.37/debian/libgl1-nvidia-glx-ia32.links.in
--- nvidia-graphics-drivers-302.17/debian/libgl1-nvidia-glx-ia32.links.in	2011-07-07 17:14:10.000000000 +0200
+++ nvidia-graphics-drivers-304.37/debian/libgl1-nvidia-glx-ia32.links.in	1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-usr/lib32/nvidia/libGL.so.#VERSION#		usr/lib32/nvidia/libGL.so.1
diff -Nru --exclude '*.run' nvidia-graphics-drivers-302.17/debian/libgl1-nvidia-glx-ia32.lintian-overrides.in nvidia-graphics-drivers-304.37/debian/libgl1-nvidia-glx-ia32.lintian-overrides.in
--- nvidia-graphics-drivers-302.17/debian/libgl1-nvidia-glx-ia32.lintian-overrides.in	2012-05-21 21:50:51.000000000 +0200
+++ nvidia-graphics-drivers-304.37/debian/libgl1-nvidia-glx-ia32.lintian-overrides.in	1970-01-01 01:00:00.000000000 +0100
@@ -1,17 +0,0 @@
-# The NVIDIA license does not allow any form of modification.
-shlib-with-non-pic-code
-spelling-error-in-binary
-shlib-calls-exit
-hardening-no-fortify-functions
-hardening-no-relro
-hardening-no-stackprotector
-
-# Packages built against the NVIDIA libGL should declare dependencies on
-# the free version for Debian's purposes.  Therefore we use a special
-# combination of shlibs files (for libGL.so.1) and symbols files (for all
-# other libraries).
-shlibs-declares-dependency-on-other-package ia32-libs (>= 20090804)
-
-# Due to complex maintainer script operations (migration of diversions) a
-# simple Breaks+Replaces is not sufficient to ensure clean up-/downgrades.
-conflicts-with-version nvidia-glx#LEGACY#-ia32 *
diff -Nru --exclude '*.run' nvidia-graphics-drivers-302.17/debian/libgl1-nvidia-glx-ia32.postinst.in nvidia-graphics-drivers-304.37/debian/libgl1-nvidia-glx-ia32.postinst.in
--- nvidia-graphics-drivers-302.17/debian/libgl1-nvidia-glx-ia32.postinst.in	2011-08-30 15:06:26.000000000 +0200
+++ nvidia-graphics-drivers-304.37/debian/libgl1-nvidia-glx-ia32.postinst.in	2012-08-14 09:41:14.000000000 +0200
@@ -4,17 +4,7 @@
 
 if [ "$1" = "configure" ]; then
 
-	update-alternatives --install /usr/lib32/libGL.so.1 ia32-libGL.so.1 /usr/lib32/nvidia/libGL.so.1 42
-
-	if [ -x /usr/lib/nvidia/check-for-conflicting-opengl-libraries ]
-	then
-		/usr/lib/nvidia/check-for-conflicting-opengl-libraries
-	fi
-
-	if [ -x /usr/lib/nvidia/check-for-mismatching-nvidia-module ]
-	then
-		/usr/lib/nvidia/check-for-mismatching-nvidia-module #VERSION#
-	fi
+	update-alternatives --remove ia32-libGL.so.1 /usr/lib32/nvidia/libGL.so.1
 
 fi
 
diff -Nru --exclude '*.run' nvidia-graphics-drivers-302.17/debian/libgl1-nvidia-glx-ia32.symbols nvidia-graphics-drivers-304.37/debian/libgl1-nvidia-glx-ia32.symbols
--- nvidia-graphics-drivers-302.17/debian/libgl1-nvidia-glx-ia32.symbols	2010-06-28 04:52:27.000000000 +0200
+++ nvidia-graphics-drivers-304.37/debian/libgl1-nvidia-glx-ia32.symbols	1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-#include "libgl1-nvidia-glx.symbols.common"
diff -Nru --exclude '*.run' nvidia-graphics-drivers-302.17/debian/libgl1-nvidia-glx.symbols nvidia-graphics-drivers-304.37/debian/libgl1-nvidia-glx.symbols
--- nvidia-graphics-drivers-302.17/debian/libgl1-nvidia-glx.symbols	2011-07-07 17:14:10.000000000 +0200
+++ nvidia-graphics-drivers-304.37/debian/libgl1-nvidia-glx.symbols	2012-08-14 09:41:14.000000000 +0200
@@ -29,18 +29,23 @@
  XvMCSyncSubpicture@Base 1.0.4349
  XvMCSyncSurface@Base 1.0.4349
 libnvidia-cfg.so.1 #PACKAGE# #MINVER#
+ nvCfgCloseAllGSyncDevices@Base 304.30
  nvCfgCloseAllPciDevices@Base 180.35
  nvCfgCloseDevice@Base 1.0.8174
  nvCfgDebug@Base 180
+ nvCfgFlashGSyncDevice@Base 304.30
  nvCfgGetDevices@Base 1.0.8174
  nvCfgGetDisplayDevices@Base 1.0.8174
  nvCfgGetEDID@Base 1.0.8174
  nvCfgGetEDIDData@Base 1.0.8174
+ nvCfgGetGSyncDeviceFirmwareVersion@Base 304.30
+ nvCfgGetGSyncDeviceType@Base 304.30
  nvCfgGetNumCRTCs@Base 1.0.8174
  nvCfgGetPciDevices@Base 180.35
  nvCfgGetProductName@Base 1.0.8174
  nvCfgGetSupportedDisplayDevices@Base 180
  nvCfgGetTeslaSerialNumbers@Base 185.18
+ nvCfgOpenAllGSyncDevices@Base 304.30
  nvCfgOpenAllPciDevices@Base 180.35
  nvCfgOpenDevice@Base 1.0.8174
  nvCfgOpenPciDevice@Base 180.35
diff -Nru --exclude '*.run' nvidia-graphics-drivers-302.17/debian/libnvidia-compiler-ia32.install.in nvidia-graphics-drivers-304.37/debian/libnvidia-compiler-ia32.install.in
--- nvidia-graphics-drivers-302.17/debian/libnvidia-compiler-ia32.install.in	2011-07-07 17:14:10.000000000 +0200
+++ nvidia-graphics-drivers-304.37/debian/libnvidia-compiler-ia32.install.in	1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-32/libnvidia-compiler.so.#VERSION#	usr/lib32/
diff -Nru --exclude '*.run' nvidia-graphics-drivers-302.17/debian/libnvidia-compiler-ia32.lintian-overrides.in nvidia-graphics-drivers-304.37/debian/libnvidia-compiler-ia32.lintian-overrides.in
--- nvidia-graphics-drivers-302.17/debian/libnvidia-compiler-ia32.lintian-overrides.in	2012-05-21 21:50:51.000000000 +0200
+++ nvidia-graphics-drivers-304.37/debian/libnvidia-compiler-ia32.lintian-overrides.in	1970-01-01 01:00:00.000000000 +0100
@@ -1,9 +0,0 @@
-# The NVIDIA license does not allow any form of modification.
-binary-has-unneeded-section
-embedded-library usr/lib32/libnvidia-compiler.so.#VERSION#: libm
-shlib-with-executable-stack
-shlib-with-non-pic-code
-spelling-error-in-binary
-hardening-no-fortify-functions
-hardening-no-relro
-hardening-no-stackprotector
diff -Nru --exclude '*.run' nvidia-graphics-drivers-302.17/debian/libnvidia-compiler-ia32.symbols nvidia-graphics-drivers-304.37/debian/libnvidia-compiler-ia32.symbols
--- nvidia-graphics-drivers-302.17/debian/libnvidia-compiler-ia32.symbols	2011-07-07 17:14:10.000000000 +0200
+++ nvidia-graphics-drivers-304.37/debian/libnvidia-compiler-ia32.symbols	1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-#include "libnvidia-compiler.symbols"
diff -Nru --exclude '*.run' nvidia-graphics-drivers-302.17/debian/libnvidia-ml1.symbols nvidia-graphics-drivers-304.37/debian/libnvidia-ml1.symbols
--- nvidia-graphics-drivers-302.17/debian/libnvidia-ml1.symbols	2012-02-15 21:37:53.000000000 +0100
+++ nvidia-graphics-drivers-304.37/debian/libnvidia-ml1.symbols	2012-08-14 09:41:14.000000000 +0200
@@ -1,11 +1,13 @@
 libnvidia-ml.so.1 #PACKAGE# #MINVER#
  nvmlDeviceClearEccErrorCounts@Base 270
+ nvmlDeviceGetApplicationsClock@Base 304.30
  nvmlDeviceGetClockInfo@Base 270
  nvmlDeviceGetComputeMode@Base 270
  nvmlDeviceGetComputeRunningProcesses@Base 285
  nvmlDeviceGetCount@Base 270
  nvmlDeviceGetCurrPcieLinkGeneration@Base 295
  nvmlDeviceGetCurrPcieLinkWidth@Base 295
+ nvmlDeviceGetCurrentClocksThrottleReasons@Base 304
  nvmlDeviceGetDetailedEccErrors@Base 270
  nvmlDeviceGetDisplayMode@Base 270
  nvmlDeviceGetDriverModel@Base 270
@@ -15,22 +17,30 @@
  nvmlDeviceGetHandleByPciBusId@Base 270
  nvmlDeviceGetHandleBySerial@Base 270
  nvmlDeviceGetHandleByUUID@Base 295
+ nvmlDeviceGetInforomConfigurationChecksum@Base 304
+ nvmlDeviceGetInforomImageVersion@Base 304
  nvmlDeviceGetInforomVersion@Base 270
  nvmlDeviceGetMaxClockInfo@Base 285
  nvmlDeviceGetMaxPcieLinkGeneration@Base 295
  nvmlDeviceGetMaxPcieLinkWidth@Base 295
+ nvmlDeviceGetMemoryErrorCounter@Base 304
  nvmlDeviceGetMemoryInfo@Base 270
  nvmlDeviceGetName@Base 270
  nvmlDeviceGetPciInfo@Base 270
  nvmlDeviceGetPciInfo_v2@Base 285
  nvmlDeviceGetPerformanceState@Base 285
  nvmlDeviceGetPersistenceMode@Base 270
+ nvmlDeviceGetPowerManagementDefaultLimit@Base 304
  nvmlDeviceGetPowerManagementLimit@Base 270
+ nvmlDeviceGetPowerManagementLimitConstraints@Base 304
  nvmlDeviceGetPowerManagementMode@Base 270
  nvmlDeviceGetPowerState@Base 270
  nvmlDeviceGetPowerUsage@Base 270
  nvmlDeviceGetSerial@Base 270
+ nvmlDeviceGetSupportedClocksThrottleReasons@Base 304
  nvmlDeviceGetSupportedEventTypes@Base 285
+ nvmlDeviceGetSupportedGraphicsClocks@Base 304
+ nvmlDeviceGetSupportedMemoryClocks@Base 304
  nvmlDeviceGetTemperature@Base 270
  nvmlDeviceGetTotalEccErrors@Base 270
  nvmlDeviceGetUUID@Base 270
@@ -38,10 +48,14 @@
  nvmlDeviceGetVbiosVersion@Base 285
  nvmlDeviceOnSameBoard@Base 295
  nvmlDeviceRegisterEvents@Base 285
+ nvmlDeviceResetApplicationsClocks@Base 304.30
+ nvmlDeviceSetApplicationsClocks@Base 304.30
  nvmlDeviceSetComputeMode@Base 270
  nvmlDeviceSetDriverModel@Base 270
  nvmlDeviceSetEccMode@Base 270
  nvmlDeviceSetPersistenceMode@Base 270
+ nvmlDeviceSetPowerManagementLimit@Base 304
+ nvmlDeviceValidateInforom@Base 304
  nvmlErrorString@Base 280
 #MISSING: 295# nvmlEventDataGetEccErrorCount@Base 285
 #MISSING: 295# nvmlEventDataGetPerformanceState@Base 285
diff -Nru --exclude '*.run' nvidia-graphics-drivers-302.17/debian/module/debian/control.template.in nvidia-graphics-drivers-304.37/debian/module/debian/control.template.in
--- nvidia-graphics-drivers-302.17/debian/module/debian/control.template.in	2011-11-04 21:14:39.000000000 +0100
+++ nvidia-graphics-drivers-304.37/debian/module/debian/control.template.in	2012-08-14 09:41:14.000000000 +0200
@@ -12,6 +12,7 @@
 Provides: nvidia-kernel-#VERSION#
 Depends: nvidia-kernel-common (>= 20110213)
 Recommends: linux-image-#KVERS#
+Built-Using: ${built:using:kernel}, ${built:using:nvidia}
 Description: NVIDIA binary kernel module for Linux #KVERS#
  This package provides the non-free NVIDIA binary kernel module built for
  the Debian Linux kernel package.  This kernel module is required by the
diff -Nru --exclude '*.run' nvidia-graphics-drivers-302.17/debian/module/debian/patches/3.6_kernel.patch nvidia-graphics-drivers-304.37/debian/module/debian/patches/3.6_kernel.patch
--- nvidia-graphics-drivers-302.17/debian/module/debian/patches/3.6_kernel.patch	1970-01-01 01:00:00.000000000 +0100
+++ nvidia-graphics-drivers-304.37/debian/module/debian/patches/3.6_kernel.patch	2012-08-14 09:41:14.000000000 +0200
@@ -0,0 +1,20 @@
+From: Leigh Scott <leigh123linux@googlemail.com>
+Subject: fix compilation with linux kernel 3.6
+Origin: vendor, http://cvs.rpmfusion.org/viewvc/rpms/nvidia-kmod/devel/3.6_kernel.patch?revision=1.2&root=nonfree&view=markup
+Bug: http://www.nvnews.net/vbulletin/showthread.php?t=187620
+Bug-Debian: http://bugs.debian.org/684486
+
+--- a/nv-acpi.c
++++ b/nv-acpi.c
+@@ -300,7 +300,11 @@ static int nv_acpi_remove(struct acpi_de
+     if (pNvAcpiObject->notify_handler_installed)
+     {
+         // no status returned for this function
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)
++        acpi_os_wait_events_complete();
++#else
+         acpi_os_wait_events_complete(NULL);
++#endif
+ 
+         // remove event notifier
+         status = acpi_remove_notify_handler(device->handle, ACPI_DEVICE_NOTIFY, nv_acpi_event);
diff -Nru --exclude '*.run' nvidia-graphics-drivers-302.17/debian/module/debian/patches/series nvidia-graphics-drivers-304.37/debian/module/debian/patches/series
--- nvidia-graphics-drivers-302.17/debian/module/debian/patches/series	2012-05-21 21:50:51.000000000 +0200
+++ nvidia-graphics-drivers-304.37/debian/module/debian/patches/series	2012-08-14 09:41:14.000000000 +0200
@@ -1,6 +1,7 @@
-patch-3.0-rt-nvidia.patch
+#patch-3.0-rt-nvidia.patch
 use-nv-kernel.o.ARCH.patch
 conditionally-include-linux_version.h.patch
 avoid-ld.gold.patch
 fix-typos.patch
 linux3.patch
+3.6_kernel.patch
diff -Nru --exclude '*.run' nvidia-graphics-drivers-302.17/debian/module/debian/rules nvidia-graphics-drivers-304.37/debian/module/debian/rules
--- nvidia-graphics-drivers-302.17/debian/module/debian/rules	2011-07-07 16:54:46.000000000 +0200
+++ nvidia-graphics-drivers-304.37/debian/module/debian/rules	2012-08-14 09:41:14.000000000 +0200
@@ -63,6 +63,8 @@
 	$(MAKE) LINUXDIR=$(KSRC)
 	touch $@
 
+get_built_using	?= $(filter-out (=),$(shell dpkg-query -f='$${source:Package} (=$${source:Version})' -W $1))
+
 binary: binary-arch binary-indep
 binary-indep:
 binary-arch: build-stamp
@@ -79,7 +81,9 @@
 	dh_compress
 	dh_fixperms
 	dh_installdeb
-	dh_gencontrol -- -v`cat debian/VERSION`
+	dh_gencontrol -- -v`cat debian/VERSION` \
+		-V'built:using:kernel=$(call get_built_using,linux-headers-$(KVERS))' \
+		-V'built:using:nvidia=$(call get_built_using,$(shell dpkg-parsechangelog | sed -nr '/^Source:/s/Source: //p')-source)'
 	dh_md5sums
 	dh_builddeb --destdir=$(KPKG_DEST_DIR)
 
diff -Nru --exclude '*.run' nvidia-graphics-drivers-302.17/debian/nv-readme.ids nvidia-graphics-drivers-304.37/debian/nv-readme.ids
--- nvidia-graphics-drivers-302.17/debian/nv-readme.ids	2012-06-15 10:51:08.000000000 +0200
+++ nvidia-graphics-drivers-304.37/debian/nv-readme.ids	2012-08-14 09:41:14.000000000 +0200
@@ -437,6 +437,8 @@
 10DE0FD5
 10DE0FD8
 10DE0FE0
+10DE0FFB
+10DE0FFC
 10DE0FFF
 10DE1040
 10DE1042
@@ -476,6 +478,8 @@
 10DE1180
 10DE1188
 10DE1189
+10DE118F
+10DE11A0
 10DE1200
 10DE1201
 10DE1203
diff -Nru --exclude '*.run' nvidia-graphics-drivers-302.17/debian/nvidia-libopencl1-ia32.install nvidia-graphics-drivers-304.37/debian/nvidia-libopencl1-ia32.install
--- nvidia-graphics-drivers-302.17/debian/nvidia-libopencl1-ia32.install	2011-07-07 17:14:10.000000000 +0200
+++ nvidia-graphics-drivers-304.37/debian/nvidia-libopencl1-ia32.install	1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-32/libOpenCL.so.1.0.0	usr/lib32/
diff -Nru --exclude '*.run' nvidia-graphics-drivers-302.17/debian/nvidia-libopencl1-ia32.links nvidia-graphics-drivers-304.37/debian/nvidia-libopencl1-ia32.links
--- nvidia-graphics-drivers-302.17/debian/nvidia-libopencl1-ia32.links	2010-05-21 12:35:13.000000000 +0200
+++ nvidia-graphics-drivers-304.37/debian/nvidia-libopencl1-ia32.links	1970-01-01 01:00:00.000000000 +0100
@@ -1,2 +0,0 @@
-usr/lib32/libOpenCL.so.1.0.0	usr/lib32/libOpenCL.so.1
-usr/lib32/libOpenCL.so.1	usr/lib32/libOpenCL.so
diff -Nru --exclude '*.run' nvidia-graphics-drivers-302.17/debian/nvidia-libopencl1-ia32.lintian-overrides nvidia-graphics-drivers-304.37/debian/nvidia-libopencl1-ia32.lintian-overrides
--- nvidia-graphics-drivers-302.17/debian/nvidia-libopencl1-ia32.lintian-overrides	2012-05-21 21:50:51.000000000 +0200
+++ nvidia-graphics-drivers-304.37/debian/nvidia-libopencl1-ia32.lintian-overrides	1970-01-01 01:00:00.000000000 +0100
@@ -1,8 +0,0 @@
-# The NVIDIA license does not allow any form of modification.
-shlib-with-executable-stack
-hardening-no-fortify-functions
-hardening-no-relro
-hardening-no-stackprotector
-
-# A single symbolic link does not justify the creation of a new package.
-non-dev-pkg-with-shlib-symlink
diff -Nru --exclude '*.run' nvidia-graphics-drivers-302.17/debian/nvidia-libopencl1-ia32.shlibs nvidia-graphics-drivers-304.37/debian/nvidia-libopencl1-ia32.shlibs
--- nvidia-graphics-drivers-302.17/debian/nvidia-libopencl1-ia32.shlibs	2010-05-21 12:35:13.000000000 +0200
+++ nvidia-graphics-drivers-304.37/debian/nvidia-libopencl1-ia32.shlibs	1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-libOpenCL	1 lib32opencl1
diff -Nru --exclude '*.run' nvidia-graphics-drivers-302.17/debian/nvidia-libopencl1-ia32.symbols nvidia-graphics-drivers-304.37/debian/nvidia-libopencl1-ia32.symbols
--- nvidia-graphics-drivers-302.17/debian/nvidia-libopencl1-ia32.symbols	2010-06-03 13:17:14.000000000 +0200
+++ nvidia-graphics-drivers-304.37/debian/nvidia-libopencl1-ia32.symbols	1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-#include "nvidia-libopencl1.symbols"
diff -Nru --exclude '*.run' nvidia-graphics-drivers-302.17/debian/nvidia-opencl-icd.install.in nvidia-graphics-drivers-304.37/debian/nvidia-opencl-icd.install.in
--- nvidia-graphics-drivers-302.17/debian/nvidia-opencl-icd.install.in	1970-01-01 01:00:00.000000000 +0100
+++ nvidia-graphics-drivers-304.37/debian/nvidia-opencl-icd.install.in	2012-08-14 09:41:14.000000000 +0200
@@ -0,0 +1 @@
+libnvidia-opencl.so.#VERSION#	#LIBDIR#/
diff -Nru --exclude '*.run' nvidia-graphics-drivers-302.17/debian/nvidia-opencl-icd.links.in nvidia-graphics-drivers-304.37/debian/nvidia-opencl-icd.links.in
--- nvidia-graphics-drivers-302.17/debian/nvidia-opencl-icd.links.in	1970-01-01 01:00:00.000000000 +0100
+++ nvidia-graphics-drivers-304.37/debian/nvidia-opencl-icd.links.in	2012-08-14 09:41:14.000000000 +0200
@@ -0,0 +1 @@
+#LIBDIR#/libnvidia-opencl.so.#VERSION#	#LIBDIR#/libnvidia-opencl.so.1
diff -Nru --exclude '*.run' nvidia-graphics-drivers-302.17/debian/nvidia-opencl-icd.lintian-overrides.in nvidia-graphics-drivers-304.37/debian/nvidia-opencl-icd.lintian-overrides.in
--- nvidia-graphics-drivers-302.17/debian/nvidia-opencl-icd.lintian-overrides.in	1970-01-01 01:00:00.000000000 +0100
+++ nvidia-graphics-drivers-304.37/debian/nvidia-opencl-icd.lintian-overrides.in	2012-08-14 09:41:14.000000000 +0200
@@ -0,0 +1,11 @@
+# The NVIDIA license does not allow any form of modification.
+[i386]: embedded-library usr/lib*/libnvidia-opencl.so.#VERSION#: libm
+shlib-with-executable-stack
+[i386]: shlib-with-non-pic-code
+unstripped-binary-or-object
+hardening-no-fortify-functions
+hardening-no-relro
+hardening-no-stackprotector
+
+# This library is only used indirectly via nvidia.icd.
+package-name-doesnt-match-sonames libnvidia-opencl1
diff -Nru --exclude '*.run' nvidia-graphics-drivers-302.17/debian/nvidia-opencl-icd.symbols nvidia-graphics-drivers-304.37/debian/nvidia-opencl-icd.symbols
--- nvidia-graphics-drivers-302.17/debian/nvidia-opencl-icd.symbols	1970-01-01 01:00:00.000000000 +0100
+++ nvidia-graphics-drivers-304.37/debian/nvidia-opencl-icd.symbols	2012-08-14 09:41:14.000000000 +0200
@@ -0,0 +1,4 @@
+libnvidia-opencl.so.1 #PACKAGE# #MINVER#
+ clGetExportTable@Base 304.30
+ clGetExtensionFunctionAddress@Base 304.30
+ clGetPlatformInfo@Base 304.30
diff -Nru --exclude '*.run' nvidia-graphics-drivers-302.17/debian/nvidia-vdpau-driver-ia32.docs nvidia-graphics-drivers-304.37/debian/nvidia-vdpau-driver-ia32.docs
--- nvidia-graphics-drivers-302.17/debian/nvidia-vdpau-driver-ia32.docs	2011-07-07 16:54:47.000000000 +0200
+++ nvidia-graphics-drivers-304.37/debian/nvidia-vdpau-driver-ia32.docs	1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-debian/tmp/README.txt
diff -Nru --exclude '*.run' nvidia-graphics-drivers-302.17/debian/nvidia-vdpau-driver-ia32.install.in nvidia-graphics-drivers-304.37/debian/nvidia-vdpau-driver-ia32.install.in
--- nvidia-graphics-drivers-302.17/debian/nvidia-vdpau-driver-ia32.install.in	2011-07-07 17:14:10.000000000 +0200
+++ nvidia-graphics-drivers-304.37/debian/nvidia-vdpau-driver-ia32.install.in	1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-32/libvdpau_nvidia.so.#VERSION#		usr/lib32/vdpau/
diff -Nru --exclude '*.run' nvidia-graphics-drivers-302.17/debian/nvidia-vdpau-driver-ia32.links.in nvidia-graphics-drivers-304.37/debian/nvidia-vdpau-driver-ia32.links.in
--- nvidia-graphics-drivers-302.17/debian/nvidia-vdpau-driver-ia32.links.in	2010-05-19 17:03:58.000000000 +0200
+++ nvidia-graphics-drivers-304.37/debian/nvidia-vdpau-driver-ia32.links.in	1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-usr/lib32/vdpau/libvdpau_nvidia.so.#VERSION#	usr/lib32/vdpau/libvdpau_nvidia.so.1
diff -Nru --exclude '*.run' nvidia-graphics-drivers-302.17/debian/rules nvidia-graphics-drivers-304.37/debian/rules
--- nvidia-graphics-drivers-302.17/debian/rules	2012-06-30 18:15:58.000000000 +0200
+++ nvidia-graphics-drivers-304.37/debian/rules	2012-08-14 09:41:14.000000000 +0200
@@ -40,11 +40,8 @@
 			$(patsubst debian/nvidia-alternative%,debian/nvidia-alternative$(legacy)%,\
 			$(patsubst debian/xserver-xorg-video-nvidia%,debian/xserver-xorg-video-nvidia$(legacy)%,\
 				$(RENAME_CONTROL))))))
-IA32_OVERRIDES	 = nvidia-vdpau-driver libcuda1
-GEN_IA32_OVERRIDES := $(foreach p,$(IA32_OVERRIDES),$(if $(wildcard debian/$p.lintian-overrides*),$p))
 TEMPLATES	:= $(wildcard debian/*.in debian/module/debian/*.in debian/detect/*.in)
 AUTOGEN		+= $(patsubst %.in,%,$(TEMPLATES))
-AUTOGEN		+= $(foreach pkg,$(GEN_IA32_OVERRIDES), debian/$(pkg)-ia32.lintian-overrides)
 AUTOGEN		+= debian/module/debian/changelog
 AUTOGEN		+= $(patsubst %.in,%,$(RENAMED_CONTROL))
 AUTOKEEP	 = debian/watch
@@ -244,13 +241,9 @@
 	# Redirect shlibs for libGL.so.1 to libgl1-mesa-glx | libgl1.
 	test ! -f debian/libgl1-nvidia$(legacy)-glx/DEBIAN/shlibs || \
 		sed -i -e '/^libGL 1 /s/.*/libGL 1 libgl1-mesa-glx | libgl1/' debian/libgl1-nvidia$(legacy)-glx/DEBIAN/shlibs
-	test ! -f debian/libgl1-nvidia$(legacy)-glx-ia32/DEBIAN/shlibs || \
-		sed -i -e '/^libGL 1 /s/.*/libGL 1 ia32-libs (>= 20090804)/' debian/libgl1-nvidia$(legacy)-glx-ia32/DEBIAN/shlibs
 	# Remove libGL.so from symbols files in order not to override our special shlibs files.
 	test ! -f debian/libgl1-nvidia$(legacy)-glx/DEBIAN/symbols || \
 		sed -i -e '/^libGL\.so/,/^lib/{/^libGL\.so\|^ /d}' debian/libgl1-nvidia$(legacy)-glx/DEBIAN/symbols
-	test ! -f debian/libgl1-nvidia$(legacy)-glx-ia32/DEBIAN/symbols || \
-		sed -i -e '/^libGL\.so/,/^lib/{/^libGL\.so\|^ /d}' debian/libgl1-nvidia$(legacy)-glx-ia32/DEBIAN/symbols
 
 override_dh_shlibdeps:
 	LD_LIBRARY_PATH=/$(libdir)/$(nvidia_private):$(LD_LIBRARY_PATH) dh_shlibdeps
@@ -290,9 +283,6 @@
 	-e 's{#PRIVATE#}{$(nvidia_private)}g;' \
 	< $< > $@
 
-%-ia32.lintian-overrides: %.lintian-overrides
-	sed -r -e '/^\[amd64\]: /d; s/^\[i386\]: //; s%$(libdir)%usr/lib32%g' $< > $@
-
 debian/module/debian/changelog: debian/changelog
 	sed '1s/^nvidia-graphics-drivers/nvidia-kernel/g' $< > $@
 
@@ -351,11 +341,13 @@
 
 ############################################################################
 
+PASV	?= --pasv
+
 .PHONY: get-orig-source
 get-orig-source:
 	rm -rf get-orig-source || true
 	mkdir get-orig-source
-	uscan --no-symlink --download-current-version --pasv \
+	uscan --no-symlink --download-current-version $(PASV) \
 	    --watchfile debian/watch --destdir get-orig-source
 	test `ls get-orig-source/* | wc -l` = 2  # we need exactly 2 downloaded files
 	@set -e -x ; \
diff -Nru --exclude '*.run' nvidia-graphics-drivers-302.17/debian/rules.defs nvidia-graphics-drivers-304.37/debian/rules.defs
--- nvidia-graphics-drivers-302.17/debian/rules.defs	2012-06-30 18:15:58.000000000 +0200
+++ nvidia-graphics-drivers-304.37/debian/rules.defs	2012-08-14 09:41:14.000000000 +0200
@@ -1,8 +1,8 @@
 # If needed, set to the major part of the upstream version number.
 #NVIDIA_LEGACY		 =
 #WATCH_VERSION		 =
-XORG_ABI_LIST		 = 12 11 10 8 6.0
-XORG_BOUND		 = (<< 2:1.12.99)
+XORG_ABI_LIST		 = 13 12 11 10 8 6.0
+XORG_BOUND		 = (<< 2:1.13.99)
 
 NVIDIA_DIRNAME_X86	 = NVIDIA-Linux-x86-${NVIDIA_RELEASE}
 NVIDIA_DIRNAME_X86_64	 = NVIDIA-Linux-x86_64-${NVIDIA_RELEASE}
diff -Nru --exclude '*.run' nvidia-graphics-drivers-302.17/debian/xserver-xorg-video-nvidia.postrm nvidia-graphics-drivers-304.37/debian/xserver-xorg-video-nvidia.postrm
--- nvidia-graphics-drivers-302.17/debian/xserver-xorg-video-nvidia.postrm	2012-06-30 18:15:58.000000000 +0200
+++ nvidia-graphics-drivers-304.37/debian/xserver-xorg-video-nvidia.postrm	2012-08-14 09:41:14.000000000 +0200
@@ -6,7 +6,7 @@
 warn_about_remaining_xorg_configuration()
 {
 	# allow to disable the check via preseeding
-	db_get nvidia-support/check-xorg-conf-on-removal
+	db_get nvidia-support/check-xorg-conf-on-removal || true
 	test "$RET" = "true" || return 0
 
 	XORG_CONF=$(grep -l '^[^#]*nvidia' /etc/X11/xorg.conf /etc/X11/xorg.conf.d/*.conf 2>/dev/null || true)
diffstat for nvidia-settings-302.17 nvidia-settings-304.37

 debian/changelog                                   |    9 
 debian/control                                     |    4 
 doc/Makefile                                       |    8 
 doc/nvidia-settings.1.m4                           |    3 
 doc/version.mk                                     |    2 
 samples/Makefile                                   |    2 
 samples/version.mk                                 |    2 
 src/Makefile                                       |    2 
 src/common-utils/common-utils.c                    |   60 +
 src/common-utils/common-utils.h                    |    2 
 src/common-utils/nvgetopt.c                        |    3 
 src/gtk+-2.x/ctkdisplayconfig-utils.c              |    6 
 src/gtk+-2.x/ctkdisplaydevice.c                    |  604 ++++++++++++-------
 src/gtk+-2.x/ctkdisplaydevice.h                    |   19 
 src/gtk+-2.x/ctkdisplaylayout.c                    |   18 
 src/gtk+-2.x/ctkevent.c                            |   14 
 src/gtk+-2.x/ctkframelock.c                        |  323 ++++++----
 src/gtk+-2.x/ctkframelock.h                        |    3 
 src/gtk+-2.x/ctkgpu.c                              |    1 
 src/gtk+-2.x/ctkgpu.h                              |    1 
 src/gtk+-2.x/ctkimagesliders.c                     |   29 
 src/gtk+-2.x/ctkmultisample.c                      |  231 +++++++
 src/gtk+-2.x/ctkmultisample.h                      |    2 
 src/gtk+-2.x/ctkslimm.c                            |   74 +-
 src/gtk+-2.x/ctkwindow.c                           |   18 
 src/gtk+-2.x/ctkxvideo.c                           |  636 ---------------------
 src/gtk+-2.x/ctkxvideo.h                           |   10 
 src/libXNVCtrl/NVCtrl.c                            |   26 
 src/libXNVCtrl/NVCtrl.h                            |   32 -
 src/libXNVCtrl/NVCtrlLib.h                         |    3 
 src/libXNVCtrl/libXNVCtrl.a                        |binary
 src/libXNVCtrlAttributes/NvCtrlAttributes.c        |   29 
 src/libXNVCtrlAttributes/NvCtrlAttributes.h        |   26 
 src/libXNVCtrlAttributes/NvCtrlAttributesPrivate.h |   48 -
 src/libXNVCtrlAttributes/NvCtrlAttributesXv.c      |  443 --------------
 src/parse.c                                        |   55 -
 src/parse.h                                        |    1 
 src/query-assign.c                                 |   98 ++-
 src/query-assign.h                                 |   12 
 src/version.mk                                     |    2 
 utils.mk                                           |   37 -
 version.mk                                         |    2 
 42 files changed, 1233 insertions(+), 1667 deletions(-)

diff -Nru nvidia-settings-302.17/debian/changelog nvidia-settings-304.37/debian/changelog
--- nvidia-settings-302.17/debian/changelog	2012-06-30 19:33:08.000000000 +0200
+++ nvidia-settings-304.37/debian/changelog	2012-08-14 10:27:39.000000000 +0200
@@ -1,3 +1,12 @@
+nvidia-settings (304.37-1) unstable; urgency=low
+
+  * New upstream release.
+  * Add Breaks: xserver-xorg-video-nvidia (<< 302).  (Closes: #681182) 
+  * Add Conflicts: xserver-xorg-video-nvidia-legacy-173xx.
+  * Note: Use nvidia-settings-legacy-173xx for the legacy driver.
+
+ -- Andreas Beckmann <debian@abeckmann.de>  Tue, 14 Aug 2012 10:27:39 +0200
+
 nvidia-settings (302.17-2) unstable; urgency=low
 
   * debian/rules: Really use the hardened CPPFLAGS.
diff -Nru nvidia-settings-302.17/debian/control nvidia-settings-304.37/debian/control
--- nvidia-settings-302.17/debian/control	2012-06-27 09:15:26.000000000 +0200
+++ nvidia-settings-304.37/debian/control	2012-07-31 17:24:52.000000000 +0200
@@ -24,7 +24,9 @@
 Architecture: i386 amd64
 Pre-Depends: nvidia-installer-cleanup
 Depends: pkg-config, ${shlibs:Depends}, ${misc:Depends}
-Recommends: libgl1-nvidia-glx-any
+Recommends: libgl1-nvidia-glx
+Breaks: xserver-xorg-video-nvidia (<< 302)
+Conflicts: xserver-xorg-video-nvidia-legacy-173xx
 Description: Tool for configuring the NVIDIA graphics driver
  The nvidia-settings utility is a tool for configuring the NVIDIA
  Linux graphics driver.  It operates by communicating with the NVIDIA
diff -Nru nvidia-settings-302.17/doc/Makefile nvidia-settings-304.37/doc/Makefile
--- nvidia-settings-302.17/doc/Makefile	2012-06-13 04:51:29.000000000 +0200
+++ nvidia-settings-304.37/doc/Makefile	2012-08-09 06:04:19.000000000 +0200
@@ -56,9 +56,11 @@
 GEN_MANPAGE_OPTS        = $(OUTPUTDIR)/gen-manpage-opts
 OPTIONS_1_INC           = $(OUTPUTDIR)/options.1.inc
 
-CFLAGS     += -I $(COMMON_UTILS_DIR)
-CFLAGS     += -I ../src/libXNVCtrlAttributes
+common_cflags += -I $(COMMON_UTILS_DIR)
+common_cflags += -I ../src/libXNVCtrlAttributes
 
+CFLAGS += $(common_cflags)
+HOST_CFLAGS += $(common_cflags)
 
 ##############################################################################
 # build rules
@@ -93,7 +95,7 @@
 GEN_MANPAGE_OPTS_OBJS = $(call BUILD_OBJECT_LIST,$(GEN_MANPAGE_OPTS_SRC))
 
 $(foreach src, $(GEN_MANPAGE_OPTS_SRC), \
-    $(eval $(call DEFINE_OBJECT_RULE,HOST_CC,$(src))))
+    $(eval $(call DEFINE_OBJECT_RULE,HOST,$(src))))
 
 $(GEN_MANPAGE_OPTS): $(GEN_MANPAGE_OPTS_OBJS)
 	$(call quiet_cmd,HOST_LINK) \
diff -Nru nvidia-settings-302.17/doc/nvidia-settings.1.m4 nvidia-settings-304.37/doc/nvidia-settings.1.m4
--- nvidia-settings-302.17/doc/nvidia-settings.1.m4	2012-06-13 04:51:40.000000000 +0200
+++ nvidia-settings-304.37/doc/nvidia-settings.1.m4	2012-08-09 06:04:20.000000000 +0200
@@ -317,7 +317,8 @@
 .fi
 .PP
 Multiple queries and assignments may be specified on the command line for a single invocation of
-.B nvidia\-settings.
+.B nvidia\-settings. 
+Assignments are processed in the order they are entered on the command line. If multiple assignments are made to the same attribute or to multiple attributes with dependencies, then the later assignments will have priority.
 .PP
 If either the
 .B \-\-query
diff -Nru nvidia-settings-302.17/doc/version.mk nvidia-settings-304.37/doc/version.mk
--- nvidia-settings-302.17/doc/version.mk	2012-06-13 04:51:29.000000000 +0200
+++ nvidia-settings-304.37/doc/version.mk	2012-08-09 06:04:19.000000000 +0200
@@ -1 +1 @@
-NVIDIA_VERSION = 302.17
+NVIDIA_VERSION = 304.37
diff -Nru nvidia-settings-302.17/samples/Makefile nvidia-settings-304.37/samples/Makefile
--- nvidia-settings-302.17/samples/Makefile	2012-06-13 04:51:29.000000000 +0200
+++ nvidia-settings-304.37/samples/Makefile	2012-08-09 06:04:19.000000000 +0200
@@ -79,7 +79,7 @@
 .PHONY: all clean clobber install
 
 # define the rule to build each object file
-$(foreach src, $(SAMPLE_SOURCES), $(eval $(call DEFINE_OBJECT_RULE,CC,$(src))))
+$(foreach src, $(SAMPLE_SOURCES), $(eval $(call DEFINE_OBJECT_RULE,TARGET,$(src))))
 
 # define the rule to link each sample app from its corresponding object file
 define link_sample_from_object
diff -Nru nvidia-settings-302.17/samples/version.mk nvidia-settings-304.37/samples/version.mk
--- nvidia-settings-302.17/samples/version.mk	2012-06-13 04:51:29.000000000 +0200
+++ nvidia-settings-304.37/samples/version.mk	2012-08-09 06:04:19.000000000 +0200
@@ -1 +1 @@
-NVIDIA_VERSION = 302.17
+NVIDIA_VERSION = 304.37
diff -Nru nvidia-settings-302.17/src/Makefile nvidia-settings-304.37/src/Makefile
--- nvidia-settings-302.17/src/Makefile	2012-06-13 04:51:29.000000000 +0200
+++ nvidia-settings-304.37/src/Makefile	2012-08-09 06:04:19.000000000 +0200
@@ -163,7 +163,7 @@
 	$(call quiet_cmd,STRIP_CMD) $@
 
 # define the rule to build each object file
-$(foreach src,$(SRC),$(eval $(call DEFINE_OBJECT_RULE,CC,$(src))))
+$(foreach src,$(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)))
diff -Nru nvidia-settings-302.17/src/common-utils/common-utils.c nvidia-settings-304.37/src/common-utils/common-utils.c
--- nvidia-settings-302.17/src/common-utils/common-utils.c	2012-06-13 04:51:40.000000000 +0200
+++ nvidia-settings-304.37/src/common-utils/common-utils.c	2012-08-09 06:04:21.000000000 +0200
@@ -586,3 +586,63 @@
     }
     NV_VFORMAT(stream, TRUE, prefix, fmt);
 }
+
+
+/*
+ * Read from the given FILE stream until a newline, EOF, or nul
+ * terminator is encountered, writing data into a growable buffer.
+ * The eof parameter is set to TRUE when EOF is encountered.  In all
+ * cases, the returned string is null-terminated.
+ *
+ * XXX this function will be rather slow because it uses fgetc() to
+ * pull each character off the stream one at a time; this is done so
+ * that each character can be examined as it's read so that we can
+ * appropriately deal with EOFs and newlines.  A better implementation
+ * would use fgets(), but that would still require us to parse each
+ * read line, checking for newlines or guessing if we hit an EOF.
+ */
+char *fget_next_line(FILE *fp, int *eof)
+{
+    char *buf = NULL, *tmpbuf;
+    char *c = NULL;
+    int len = 0, buflen = 0;
+    int ret;
+
+    const int __fget_next_line_len = 32;
+
+    if (eof) {
+        *eof = FALSE;
+    }
+
+    while (1) {
+        if (buflen == len) { /* buffer isn't big enough -- grow it */
+            buflen += __fget_next_line_len;
+            tmpbuf = nvalloc(buflen);
+            if (buf) {
+                memcpy(tmpbuf, buf, len);
+                nvfree(buf);
+            }
+            buf = tmpbuf;
+            c = buf + len;
+        }
+
+        ret = fgetc(fp);
+
+        if ((ret == EOF) && (eof)) {
+            *eof = TRUE;
+        }
+
+        if ((ret == EOF) || (ret == '\n') || (ret == '\0')) {
+            *c = '\0';
+            return buf;
+        }
+
+        *c = (char) ret;
+
+        len++;
+        c++;
+
+    } /* while (1) */
+
+    return NULL; /* should never get here */
+}
diff -Nru nvidia-settings-302.17/src/common-utils/common-utils.h nvidia-settings-304.37/src/common-utils/common-utils.h
--- nvidia-settings-302.17/src/common-utils/common-utils.h	2012-06-13 04:51:40.000000000 +0200
+++ nvidia-settings-304.37/src/common-utils/common-utils.h	2012-08-09 06:04:21.000000000 +0200
@@ -65,6 +65,8 @@
 void fmtwarn(const char *fmt, ...);
 void fmt(FILE *stream, const char *prefix, const char *fmt, ...);
 
+char *fget_next_line(FILE *fp, int *eof);
+
 /*
  * NV_VSNPRINTF(): macro that assigns buf using vsnprintf().  This is
  * correct for differing semantics of the vsnprintf() return value:
diff -Nru nvidia-settings-302.17/src/common-utils/nvgetopt.c nvidia-settings-304.37/src/common-utils/nvgetopt.c
--- nvidia-settings-302.17/src/common-utils/nvgetopt.c	2012-06-13 04:51:40.000000000 +0200
+++ nvidia-settings-304.37/src/common-utils/nvgetopt.c	2012-08-09 06:04:21.000000000 +0200
@@ -22,6 +22,7 @@
 #include <string.h>
 #include <stdlib.h>
 #include <ctype.h>
+#include <limits.h>
 
 #include "nvgetopt.h"
 #include "common-utils.h"
@@ -401,7 +402,7 @@
          * prepend the single character version of the option,
          * possibly with an argument; e.g., "-f" or "-f BAR"
          */
-        if (isalpha(o->val)) {
+        if (o->val <= UCHAR_MAX && o->val >= 0 && isalpha(o->val)) {
             char scratch[16];
             char *tmp;
             snprintf(scratch, sizeof(scratch), "%c", o->val);
diff -Nru nvidia-settings-302.17/src/gtk+-2.x/ctkdisplayconfig-utils.c nvidia-settings-304.37/src/gtk+-2.x/ctkdisplayconfig-utils.c
--- nvidia-settings-302.17/src/gtk+-2.x/ctkdisplayconfig-utils.c	2012-06-13 04:51:30.000000000 +0200
+++ nvidia-settings-304.37/src/gtk+-2.x/ctkdisplayconfig-utils.c	2012-08-09 06:04:20.000000000 +0200
@@ -2200,10 +2200,6 @@
     }
 
 
-    /* Add the display at the end of gpu's display list */
-    gpu_add_display(gpu, display);
-
-
     /* Query the modelines for the display device */
     if (!display_add_modelines_from_server(display, err_str)) {
         nv_warning_msg("Failed to add modelines to display device %d "
@@ -2213,6 +2209,8 @@
         goto fail;
     }
 
+    /* Add the display at the end of gpu's display list */
+    gpu_add_display(gpu, display);
 
     return display;
 
diff -Nru nvidia-settings-302.17/src/gtk+-2.x/ctkdisplaydevice.c nvidia-settings-304.37/src/gtk+-2.x/ctkdisplaydevice.c
--- nvidia-settings-302.17/src/gtk+-2.x/ctkdisplaydevice.c	2012-06-13 04:51:30.000000000 +0200
+++ nvidia-settings-304.37/src/gtk+-2.x/ctkdisplaydevice.c	2012-08-09 06:04:20.000000000 +0200
@@ -20,6 +20,10 @@
 #include <gtk/gtk.h>
 #include <NvCtrlAttributes.h>
 #include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "common-utils.h"
 
 #include "ctkbanner.h"
 
@@ -32,7 +36,6 @@
 #include "ctkconfig.h"
 #include "ctkhelp.h"
 #include "ctkutils.h"
-#include <stdio.h>
 
 static void ctk_display_device_class_init(CtkDisplayDeviceClass *);
 static void ctk_display_device_finalize(GObject *);
@@ -43,14 +46,25 @@
 
 static void display_device_setup(CtkDisplayDevice *ctk_object);
 
+static void enabled_displays_received(GtkObject *object, gpointer arg1,
+                                      gpointer user_data);
+
 static void callback_link_changed(GtkObject *object, gpointer arg1,
                                   gpointer user_data);
 
-static void enabled_displays_received(GtkObject *object, gpointer arg1,
-                                      gpointer user_data);
+static void callback_refresh_rate_changed(GtkObject *object, gpointer arg1,
+                                          gpointer user_data);
 
-static void info_update_received(GtkObject *object, gpointer arg1,
-                                 gpointer user_data);
+static void update_chip_info(InfoEntry *entry);
+static void update_signal_info(InfoEntry *entry);
+static void update_link_info(InfoEntry *entry);
+static void update_native_resolution(InfoEntry *entry);
+static void update_refresh_rate(InfoEntry *entry);
+
+static void register_link_events(InfoEntry *entry);
+static void unregister_link_events(InfoEntry *entry);
+static void register_refresh_rate_events(InfoEntry *entry);
+static void unregister_refresh_rate_events(InfoEntry *entry);
 
 
 #define FRAME_PADDING 5
@@ -82,6 +96,54 @@
 "The refresh rate displays the rate at which the screen is currently "
 "refreshing the image.";
 
+typedef void (*InfoEntryFunc)(InfoEntry *entry);
+
+typedef struct {
+    const char *str;
+    const gchar **tooltip;
+    InfoEntryFunc update_func;
+    InfoEntryFunc register_events_func;
+    InfoEntryFunc unregister_events_func;
+} InfoEntryData;
+
+static InfoEntryData __info_entry_data[] = {
+    {
+        "Chip Location",
+        &__info_chip_location_help,
+        update_chip_info,
+        NULL,
+        NULL,
+    },
+    {
+        "Signal",
+        &__info_signal_help,
+        update_signal_info,
+        NULL,
+        NULL,
+    },
+    {
+        "Connection link",
+        &__info_link_help,
+        update_link_info,
+        register_link_events,
+        unregister_link_events,
+    },
+    {
+        "Native Resolution",
+        &__native_res_help,
+        update_native_resolution,
+        NULL,
+        NULL,
+    },
+    {
+        "Refresh Rate",
+        &__refresh_rate_help,
+        update_refresh_rate,
+        register_refresh_rate_events,
+        unregister_refresh_rate_events,
+    },
+};
+
 GType ctk_display_device_get_type(void)
 {
     static GType ctk_object_type = 0;
@@ -121,14 +183,26 @@
 )
 {
     CtkDisplayDevice *ctk_object = CTK_DISPLAY_DEVICE(object);
-    g_free(ctk_object->name);
-    g_signal_handlers_disconnect_matched(ctk_object->ctk_event,
+    int i;
+
+    g_signal_handlers_disconnect_matched(G_OBJECT(ctk_object->ctk_event_gpu),
                                          G_SIGNAL_MATCH_DATA,
                                          0,
                                          0,
                                          NULL,
                                          NULL,
                                          (gpointer) ctk_object);
+
+    for (i = 0; i < ctk_object->num_info_entries; i++) {
+        InfoEntryData *entryData = &__info_entry_data[i];
+        InfoEntry *entry = &ctk_object->info_entries[i];
+
+        if (entryData->unregister_events_func) {
+            entryData->unregister_events_func(entry);
+        }
+    }
+
+    g_free(ctk_object->name);
 }
 
 
@@ -139,6 +213,7 @@
 GtkWidget* ctk_display_device_new(NvCtrlAttributeHandle *handle,
                                   CtkConfig *ctk_config,
                                   CtkEvent *ctk_event,
+                                  CtkEvent *ctk_event_gpu,
                                   char *name,
                                   char *typeBaseName)
 {
@@ -155,6 +230,7 @@
     GtkWidget *hseparator;
     GtkWidget *button;
     gchar *str;
+    int i;
 
     object = g_object_new(CTK_TYPE_DISPLAY_DEVICE, NULL);
     if (!object) return NULL;
@@ -162,6 +238,7 @@
     ctk_object = CTK_DISPLAY_DEVICE(object);
     ctk_object->handle = handle;
     ctk_object->ctk_event = ctk_event;
+    ctk_object->ctk_event_gpu = ctk_event_gpu;
     ctk_object->ctk_config = ctk_config;
     ctk_object->name = g_strdup(name);
 
@@ -225,103 +302,49 @@
      * widgets don't expand to fill all of the space within the
      * frame
      */
-    
+
     tmpbox = gtk_vbox_new(FALSE, FRAME_PADDING);
     gtk_container_set_border_width(GTK_CONTAINER(tmpbox), FRAME_PADDING);
     gtk_container_add(GTK_CONTAINER(hbox), tmpbox);
 
-    /* Make the txt widgets that will get updated */
-    ctk_object->txt_chip_location = gtk_label_new("");
-    ctk_object->txt_link = gtk_label_new("");
-    ctk_object->txt_signal = gtk_label_new("");
-    ctk_object->txt_native_resolution = gtk_label_new("");
-    ctk_object->txt_refresh_rate = gtk_label_new("");
+    /* Create and add the information widgets */
 
-    /* Add information widget lines */
-    {
-        typedef struct {
-            GtkWidget *label;
-            GtkWidget *txt;
-            const gchar *tooltip;
-        } TextLineInfo;
-
-        TextLineInfo lines[] = {
-            {
-                gtk_label_new("Chip location:"),
-                ctk_object->txt_chip_location,
-                __info_chip_location_help
-            },
-            {
-                gtk_label_new("Connection link:"),
-                ctk_object->txt_link,
-                __info_link_help
-            },
-            {
-                gtk_label_new("Signal:"),
-                ctk_object->txt_signal,
-                __info_signal_help
-            },
-            {
-                gtk_label_new("Native Resolution:"),
-                ctk_object->txt_native_resolution,
-                __native_res_help,
-            },
-            {
-                gtk_label_new("Refresh Rate:"),
-                ctk_object->txt_refresh_rate,
-                __refresh_rate_help,
-            },
-            { NULL, NULL, NULL }
-        };
-        int i;
+    ctk_object->num_info_entries = ARRAY_LEN(__info_entry_data);
+    ctk_object->info_entries = calloc(ctk_object->num_info_entries,
+                                      sizeof(InfoEntry));
+    if (!ctk_object->info_entries) {
+        ctk_object->num_info_entries = 0;
+    }
+
+    for (i = 0; i < ctk_object->num_info_entries; i++) {
+        InfoEntryData *entryData = __info_entry_data+i;
+        InfoEntry *entry = ctk_object->info_entries+i;
+        gchar *str;
+
+        entry->ctk_object = ctk_object;
+        str = g_strconcat(entryData->str, ":", NULL);
+        entry->label = gtk_label_new(str);
+        g_free(str);
 
-        GtkRequisition req;
-        int max_width;
+        entry->txt = gtk_label_new("");
 
-        /* Compute max width of lables and setup text alignments */
-        max_width = 0;
-        for (i = 0; lines[i].label; i++) {
-            gtk_misc_set_alignment(GTK_MISC(lines[i].label), 0.0f, 0.5f);
-            gtk_misc_set_alignment(GTK_MISC(lines[i].txt), 0.0f, 0.5f);
+        gtk_misc_set_alignment(GTK_MISC(entry->label), 0.0f, 0.5f);
+        gtk_misc_set_alignment(GTK_MISC(entry->txt), 0.0f, 0.5f);
 
-            gtk_widget_size_request(lines[i].label, &req);
-            if (max_width < req.width) {
-                max_width = req.width;
-            }
-        }
+        ctk_config_set_tooltip(ctk_config,
+                               entry->label,
+                               *(entryData->tooltip));
+        ctk_config_set_tooltip(ctk_config,
+                               entry->txt,
+                               *(entryData->tooltip));
+
+        entry->hbox = gtk_hbox_new(FALSE, FRAME_PADDING);
+        gtk_box_pack_start(GTK_BOX(entry->hbox), entry->label,
+                           FALSE, TRUE, FRAME_PADDING);
+        gtk_box_pack_start(GTK_BOX(entry->hbox), entry->txt,
+                           FALSE, TRUE, FRAME_PADDING);
 
-        /* Pack labels */
-        for (i = 0; lines[i].label; i++) {
-            GtkWidget *tmphbox;
-
-            /* Add separators */
-            if (i == 3 || i == 5 || i == 7) {
-                GtkWidget *separator = gtk_hseparator_new();
-                gtk_box_pack_start(GTK_BOX(tmpbox), separator,
-                                   FALSE, FALSE, 0);
-            }
-
-            /* Set the label's width */
-            gtk_widget_set_size_request(lines[i].label, max_width, -1);
-
-            /* add the widgets for this line */
-            tmphbox = gtk_hbox_new(FALSE, FRAME_PADDING);
-            gtk_box_pack_start(GTK_BOX(tmphbox), lines[i].label,
-                               FALSE, TRUE, FRAME_PADDING);
-            gtk_box_pack_start(GTK_BOX(tmphbox), lines[i].txt,
-                               FALSE, TRUE, FRAME_PADDING);
-
-            /* Include tooltips */
-            if (lines[i].tooltip) {
-                ctk_config_set_tooltip(ctk_config, 
-                                       lines[i].label, 
-                                       lines[i].tooltip);
-                ctk_config_set_tooltip(ctk_config, 
-                                       lines[i].txt, 
-                                       lines[i].tooltip);
-            }
-            gtk_box_pack_start(GTK_BOX(tmpbox), tmphbox, FALSE, FALSE, 0);
-        }
+        gtk_box_pack_start(GTK_BOX(tmpbox), entry->hbox, FALSE, FALSE, 0);
     }
 
     /* pack the EDID button */
@@ -397,27 +420,19 @@
                      "clicked", G_CALLBACK(reset_button_clicked),
                      (gpointer) ctk_object);
 
-    if (ctk_object->txt_link) {
-        g_signal_connect(G_OBJECT(ctk_event),
-                         CTK_EVENT_NAME(NV_CTRL_FLATPANEL_LINK),
-                         G_CALLBACK(callback_link_changed),
-                         (gpointer) ctk_object);
-
-        g_signal_connect(G_OBJECT(ctk_event),
-                         CTK_EVENT_NAME(NV_CTRL_DISPLAYPORT_LINK_RATE),
-                         G_CALLBACK(callback_link_changed),
-                         (gpointer) ctk_object);
-    }
-
-    g_signal_connect(G_OBJECT(ctk_event),
+    g_signal_connect(G_OBJECT(ctk_event_gpu),
                      CTK_EVENT_NAME(NV_CTRL_ENABLED_DISPLAYS),
                      G_CALLBACK(enabled_displays_received),
                      (gpointer) ctk_object);
 
-    g_signal_connect(G_OBJECT(ctk_event),
-                     CTK_EVENT_NAME(NV_CTRL_REFRESH_RATE),
-                     G_CALLBACK(info_update_received),
-                     (gpointer) ctk_object);
+    for (i = 0; i < ctk_object->num_info_entries; i++) {
+        InfoEntryData *entryData = __info_entry_data+i;
+        InfoEntry *entry = ctk_object->info_entries+i;
+
+        if (entryData->register_events_func) {
+            entryData->register_events_func(entry);
+        }
+    }
 
     return GTK_WIDGET(object);
 
@@ -463,6 +478,7 @@
     GtkTextIter i;
     GtkTextBuffer *b;
     GtkTooltipsData *td;
+    int j;
 
     b = gtk_text_buffer_new(table);
 
@@ -473,20 +489,12 @@
     ctk_help_heading(b, &i, "Device Information");
     ctk_help_para(b, &i, __info_help);
 
-    ctk_help_term(b, &i, "Chip Location");
-    ctk_help_para(b, &i, __info_chip_location_help);
-
-    ctk_help_term(b, &i, "Link");
-    ctk_help_para(b, &i, __info_link_help);
+    for (j = 0; j < ARRAY_LEN(__info_entry_data); j++) {
+        InfoEntryData *entryData = __info_entry_data+j;
 
-    ctk_help_term(b, &i, "Signal");
-    ctk_help_para(b, &i, __info_signal_help);
-
-    ctk_help_term(b, &i, "Native Resolution");
-    ctk_help_para(b, &i, __native_res_help);
-
-    ctk_help_term(b, &i, "Refresh Rate");
-    ctk_help_para(b, &i, __refresh_rate_help);
+        ctk_help_term(b, &i, entryData->str);
+        ctk_help_para(b, &i, *entryData->tooltip);
+    }
 
     add_acquire_edid_help(b, &i);
 
@@ -509,136 +517,215 @@
 } /* ctk_display_device_create_help() */
 
 
-static void update_link(CtkDisplayDevice *ctk_object)
+
+
+
+static void update_chip_info(InfoEntry *entry)
 {
+    CtkDisplayDevice *ctk_object = entry->ctk_object;
     ReturnStatus ret;
-    gint val, signal_type = ctk_object->signal_type;
-    const char *link = "Unknown";
-    char tmp[32];
-
-    ret = NvCtrlGetAttribute(ctk_object->handle, NV_CTRL_FLATPANEL_LINK, &val);
-    if (ret == NvCtrlSuccess) {
-        if (signal_type == NV_CTRL_FLATPANEL_SIGNAL_DISPLAYPORT) {
-            int lanes;
-
-            lanes = val + 1;
-
-            ret = NvCtrlGetAttribute(ctk_object->handle,
-                                     NV_CTRL_DISPLAYPORT_LINK_RATE, &val);
-            if ((ret == NvCtrlSuccess) &&
-                (val == NV_CTRL_DISPLAYPORT_LINK_RATE_DISABLED)) {
-                link = "Disabled";
-            } else {
-                const char *bw = "unknown bandwidth";
+    gint val;
+    const gchar *str;
 
-                if (ret == NvCtrlSuccess) {
-                    switch (val) {
-                    case NV_CTRL_DISPLAYPORT_LINK_RATE_1_62GBPS:
-                        bw = "1.62 Gbps";
-                        break;
-                    case NV_CTRL_DISPLAYPORT_LINK_RATE_2_70GBPS:
-                        bw = "2.70 Gbps";
-                        break;
-                    }
-                }
-
-                snprintf(tmp, 32, "%d lane%s @ %s", lanes, lanes == 1 ? "" : "s",
-                         bw);
-                link = tmp;
-            }
-        } else {
-            // LVDS or TMDS
-            switch(val) {
-            case NV_CTRL_FLATPANEL_LINK_SINGLE:
-                link = "Single";
-                break;
-            case NV_CTRL_FLATPANEL_LINK_DUAL:
-                link = "Dual";
-                break;
-            }
-        }
+    ret = NvCtrlGetAttribute(ctk_object->handle,
+                             NV_CTRL_FLATPANEL_CHIP_LOCATION, &val);
+    if (ret != NvCtrlSuccess) {
+        gtk_widget_hide(entry->hbox);
+        return;
+    }
+
+    switch (val) {
+    case NV_CTRL_FLATPANEL_CHIP_LOCATION_INTERNAL:
+        str = "Internal";
+        break;
+    case NV_CTRL_FLATPANEL_CHIP_LOCATION_EXTERNAL:
+        str = "External";
+        break;
+    default:
+        str = "Unknown";
+        break;
     }
 
-    gtk_label_set_text(GTK_LABEL(ctk_object->txt_link), link);
+    gtk_label_set_text(GTK_LABEL(entry->txt), str);
+    gtk_widget_show(entry->hbox);
 }
 
 
 
-/*
- * update_device_info() - (Re)Queries the static display device information.
- */
-static void update_device_info(CtkDisplayDevice *ctk_object)
+static void update_signal_info(InfoEntry *entry)
 {
+    CtkDisplayDevice *ctk_object = entry->ctk_object;
     ReturnStatus ret;
     gint val;
-    gchar *str;
+    const char *str;
 
-    /* Chip location */
+    ret = NvCtrlGetAttribute(ctk_object->handle, NV_CTRL_FLATPANEL_SIGNAL,
+                             &val);
+    if (ret != NvCtrlSuccess) {
+        gtk_widget_hide(entry->hbox);
+        return;
+    }
+
+    switch (val) {
+    case NV_CTRL_FLATPANEL_SIGNAL_LVDS:
+        str = "LVDS";
+        break;
+    case NV_CTRL_FLATPANEL_SIGNAL_TMDS:
+        str = "TMDS";
+        break;
+    case NV_CTRL_FLATPANEL_SIGNAL_DISPLAYPORT:
+        str = "DisplayPort";
+        break;
+    default:
+        str = "Unknown";
+        break;
+    }
 
-    str = "Unknown";
-    ret = NvCtrlGetAttribute(ctk_object->handle,
-                             NV_CTRL_FLATPANEL_CHIP_LOCATION, &val);
-    if (ret == NvCtrlSuccess) {
-        switch (val) {
-        case NV_CTRL_FLATPANEL_CHIP_LOCATION_INTERNAL:
-            str = "Internal";
-            break;
-        case NV_CTRL_FLATPANEL_CHIP_LOCATION_EXTERNAL:
-            str = "External";
-            break;
-        }
+    gtk_label_set_text(GTK_LABEL(entry->txt), str);
+    gtk_widget_show(entry->hbox);
+
+    ctk_object->signal_type = val;
+}
+
+
+/* NOTE: Link information is dependent on signal type, and this function
+ * assumes the signal type is querried first.
+ */
+static void update_link_info(InfoEntry *entry)
+{
+    CtkDisplayDevice *ctk_object = entry->ctk_object;
+    ReturnStatus ret;
+    gint val;
+    const char *link;
+    char tmp[32];
+
+    ret = NvCtrlGetAttribute(ctk_object->handle, NV_CTRL_FLATPANEL_LINK, &val);
+    if (ret != NvCtrlSuccess) {
+        gtk_widget_hide(entry->hbox);
+        return;
     }
-    gtk_label_set_text(GTK_LABEL(ctk_object->txt_chip_location), str);
 
-    /* Signal */
+    if (ctk_object->signal_type == NV_CTRL_FLATPANEL_SIGNAL_DISPLAYPORT) {
+        int lanes;
 
-    str = "Unknown";
-    ret = NvCtrlGetAttribute(ctk_object->handle, NV_CTRL_FLATPANEL_SIGNAL,
-                             &val);
-    if (ret == NvCtrlSuccess) {
-        switch (val) {
-        case NV_CTRL_FLATPANEL_SIGNAL_LVDS:
-            str = "LVDS";
+        lanes = val + 1;
+
+        ret = NvCtrlGetAttribute(ctk_object->handle,
+                                 NV_CTRL_DISPLAYPORT_LINK_RATE, &val);
+        if ((ret == NvCtrlSuccess) &&
+            (val == NV_CTRL_DISPLAYPORT_LINK_RATE_DISABLED)) {
+            link = "Disabled";
+        } else {
+            if (ret != NvCtrlSuccess) {
+                val = 0;
+            }
+
+            if (val > 0) {
+                snprintf(tmp, 32, "%d lane%s @ %.2f Gbps", lanes, lanes == 1 ? "" : "s",
+                         val * 0.27);
+            } else {
+                snprintf(tmp, 32, "%d lane%s @ unknown bandwidth", lanes,
+                         lanes == 1 ? "" : "s");
+            }
+            link = tmp;
+        }
+    } else {
+        // LVDS or TMDS
+        switch(val) {
+        case NV_CTRL_FLATPANEL_LINK_SINGLE:
+            link = "Single";
             break;
-        case NV_CTRL_FLATPANEL_SIGNAL_TMDS:
-            str = "TMDS";
+        case NV_CTRL_FLATPANEL_LINK_DUAL:
+            link = "Dual";
             break;
-        case NV_CTRL_FLATPANEL_SIGNAL_DISPLAYPORT:
-            str = "DisplayPort";
+        default:
+            link = "Unknown";
             break;
         }
     }
-    gtk_label_set_text(GTK_LABEL(ctk_object->txt_signal), str);
-    ctk_object->signal_type = val;
 
-    /* Link */
+    gtk_label_set_text(GTK_LABEL(entry->txt), link);
+    gtk_widget_show(entry->hbox);
+}
+
 
-    update_link(ctk_object);
 
-    /* Native Resolution */
+static void update_native_resolution(InfoEntry *entry)
+{
+    CtkDisplayDevice *ctk_object = entry->ctk_object;
+    ReturnStatus ret;
+    gint val;
+    char *str;
 
     ret = NvCtrlGetAttribute(ctk_object->handle,
                              NV_CTRL_FLATPANEL_NATIVE_RESOLUTION, &val);
-    if (ret == NvCtrlSuccess) {
-        str = g_strdup_printf("%dx%d", (val >> 16), (val & 0xFFFF));
-        gtk_label_set_text(GTK_LABEL(ctk_object->txt_native_resolution),
-                           str);
-        g_free(str);
-    } else {
-        gtk_label_set_text(GTK_LABEL(ctk_object->txt_native_resolution),
-                           "Unknown");
+    if (ret != NvCtrlSuccess) {
+        gtk_widget_hide(entry->hbox);
+        return;
     }
 
-    /* Refresh Rate */
+    str = g_strdup_printf("%dx%d", (val >> 16), (val & 0xFFFF));
+    gtk_label_set_text(GTK_LABEL(entry->txt), str);
+    g_free(str);
+
+    gtk_widget_show(entry->hbox);
+}
+
+
+
+static void update_refresh_rate(InfoEntry *entry)
+{
+    CtkDisplayDevice *ctk_object = entry->ctk_object;
+    ReturnStatus ret;
+    gint val;
+    char *str;
+    float fvalue;
 
     ret = NvCtrlGetAttribute(ctk_object->handle, NV_CTRL_REFRESH_RATE, &val);
-    if (ret == NvCtrlSuccess) {
-        float fvalue = ((float)(val)) / 100.0f;
-        str = g_strdup_printf("%.2f Hz", fvalue);
-        gtk_label_set_text(GTK_LABEL(ctk_object->txt_refresh_rate), str);
-        g_free(str);
-    } else {
-        gtk_label_set_text(GTK_LABEL(ctk_object->txt_refresh_rate), "Unknown");
+    if (ret != NvCtrlSuccess) {
+        gtk_widget_hide(entry->hbox);
+        return;
+    }
+
+    fvalue = ((float)(val)) / 100.0f;
+    str = g_strdup_printf("%.2f Hz", fvalue);
+
+    gtk_label_set_text(GTK_LABEL(entry->txt), str);
+    g_free(str);
+
+    gtk_widget_show(entry->hbox);
+}
+
+
+
+/*
+ * update_device_info() - (Re)Queries the static display device information.
+ */
+static void update_device_info(CtkDisplayDevice *ctk_object)
+{
+    int i;
+    int max_width;
+    GtkRequisition req;
+
+
+    max_width = 0;
+    for (i = 0; i < ctk_object->num_info_entries; i++) {
+        InfoEntryData *entryData = __info_entry_data+i;
+        InfoEntry *entry = ctk_object->info_entries+i;
+
+        entryData->update_func(entry);
+
+        if (GTK_WIDGET_VISIBLE(entry->hbox)) {
+            gtk_widget_size_request(entry->label, &req);
+            if (max_width < req.width) {
+                max_width = req.width;
+            }
+        }
+    }
+
+    for (i = 0; i < ctk_object->num_info_entries; i++) {
+        InfoEntry *entry = ctk_object->info_entries+i;
+        gtk_widget_set_size_request(entry->label, max_width, -1);
     }
 
 } /* update_device_info() */
@@ -678,12 +765,55 @@
 
 
 
-static void callback_link_changed(GtkObject *object, gpointer arg1,
-                                  gpointer user_data)
+static void register_link_events(InfoEntry *entry)
 {
-    CtkDisplayDevice *ctk_object = CTK_DISPLAY_DEVICE(user_data);
+    CtkDisplayDevice *ctk_object = entry->ctk_object;
 
-    update_link(ctk_object);
+    g_signal_connect(G_OBJECT(ctk_object->ctk_event),
+                     CTK_EVENT_NAME(NV_CTRL_FLATPANEL_LINK),
+                     G_CALLBACK(callback_link_changed),
+                     (gpointer) entry);
+
+    g_signal_connect(G_OBJECT(ctk_object->ctk_event),
+                     CTK_EVENT_NAME(NV_CTRL_DISPLAYPORT_LINK_RATE),
+                     G_CALLBACK(callback_link_changed),
+                     (gpointer) entry);
+}
+
+static void unregister_link_events(InfoEntry *entry)
+{
+    CtkDisplayDevice *ctk_object = entry->ctk_object;
+
+    g_signal_handlers_disconnect_matched(G_OBJECT(ctk_object->ctk_event),
+                                         G_SIGNAL_MATCH_DATA,
+                                         0, /* signal_id */
+                                         0, /* detail */
+                                         NULL, /* closure */
+                                         NULL, /* func */
+                                         (gpointer) entry);
+}
+
+static void register_refresh_rate_events(InfoEntry *entry)
+{
+    CtkDisplayDevice *ctk_object = entry->ctk_object;
+
+    g_signal_connect(G_OBJECT(ctk_object->ctk_event),
+                     CTK_EVENT_NAME(NV_CTRL_REFRESH_RATE),
+                     G_CALLBACK(callback_refresh_rate_changed),
+                     (gpointer) entry);
+}
+
+static void unregister_refresh_rate_events(InfoEntry *entry)
+{
+    CtkDisplayDevice *ctk_object = entry->ctk_object;
+
+    g_signal_handlers_disconnect_matched(G_OBJECT(ctk_object->ctk_event),
+                                         G_SIGNAL_MATCH_DATA,
+                                         0, /* signal_id */
+                                         0, /* detail */
+                                         NULL, /* closure */
+                                         NULL, /* func */
+                                         (gpointer) entry);
 }
 
 
@@ -705,13 +835,19 @@
 } /* enabled_displays_received() */
 
 
-/*
- * Update UI when display information changed.
- */
-static void info_update_received(GtkObject *object, gpointer arg1,
-                                 gpointer user_data)
+static void callback_link_changed(GtkObject *object, gpointer arg1,
+                                  gpointer user_data)
 {
-    CtkDisplayDevice *ctk_object = CTK_DISPLAY_DEVICE(user_data);
+    InfoEntry *entry = (InfoEntry *)user_data;
 
-    update_device_info(ctk_object);
+    update_link_info(entry);
+}
+
+
+static void callback_refresh_rate_changed(GtkObject *object, gpointer arg1,
+                                          gpointer user_data)
+{
+    InfoEntry *entry = (InfoEntry *)user_data;
+
+    update_refresh_rate(entry);
 }
diff -Nru nvidia-settings-302.17/src/gtk+-2.x/ctkdisplaydevice.h nvidia-settings-304.37/src/gtk+-2.x/ctkdisplaydevice.h
--- nvidia-settings-302.17/src/gtk+-2.x/ctkdisplaydevice.h	2012-06-13 04:51:37.000000000 +0200
+++ nvidia-settings-304.37/src/gtk+-2.x/ctkdisplaydevice.h	2012-08-09 06:04:20.000000000 +0200
@@ -49,6 +49,15 @@
 typedef struct _CtkDisplayDevice       CtkDisplayDevice;
 typedef struct _CtkDisplayDeviceClass  CtkDisplayDeviceClass;
 
+typedef struct InfoEntryRec {
+    GtkWidget *hbox;
+    GtkWidget *label;
+    GtkWidget *txt;
+
+    struct _CtkDisplayDevice *ctk_object;
+
+} InfoEntry;
+
 struct _CtkDisplayDevice
 {
     GtkVBox parent;
@@ -56,17 +65,15 @@
     NvCtrlAttributeHandle *handle;
     CtkConfig *ctk_config;
     CtkEvent *ctk_event;
+    CtkEvent *ctk_event_gpu;
     GtkWidget *image_sliders;
     GtkWidget *reset_button;
     GtkWidget *edid;
     GtkWidget *dithering_controls;
     GtkWidget *color_controls;
 
-    GtkWidget *txt_chip_location;
-    GtkWidget *txt_link;
-    GtkWidget *txt_signal;
-    GtkWidget *txt_native_resolution;
-    GtkWidget *txt_refresh_rate;
+    InfoEntry *info_entries;
+    int num_info_entries;
 
     gboolean display_enabled;
     unsigned int active_attributes;
@@ -83,7 +90,7 @@
 GType       ctk_display_device_get_type  (void) G_GNUC_CONST;
 GtkWidget*  ctk_display_device_new       (NvCtrlAttributeHandle *,
                                           CtkConfig *, CtkEvent *,
-                                          char *, char *);
+                                          CtkEvent *, char *, char *);
 
 GtkTextBuffer *ctk_display_device_create_help(GtkTextTagTable *,
                                               CtkDisplayDevice *);
diff -Nru nvidia-settings-302.17/src/gtk+-2.x/ctkdisplaylayout.c nvidia-settings-304.37/src/gtk+-2.x/ctkdisplaylayout.c
--- nvidia-settings-302.17/src/gtk+-2.x/ctkdisplaylayout.c	2012-06-13 04:51:30.000000000 +0200
+++ nvidia-settings-304.37/src/gtk+-2.x/ctkdisplaylayout.c	2012-08-09 06:04:20.000000000 +0200
@@ -205,6 +205,7 @@
     }
     ctk_object->Zcount = 0;
     ctk_object->selected_display = NULL;
+    ctk_object->selected_screen = NULL;
 
 
     /* Count the number of Z-orderable elements in the layout */
@@ -2253,13 +2254,14 @@
     int screen_at;
     ZNode *tmpzo;
 
-    if (!screen) return;
+    if (!screen) {
+        goto done;
+    }
 
 
      /* Move the screen and its displays to the top */
     move_to = 0 + screen->num_displays;
 
-
     tmpzo = get_screen_zorder_move_data(ctk_object, screen, move_to,
                                         &screen_at);
     if (!tmpzo) {
@@ -2276,7 +2278,7 @@
            (1 + screen->num_displays)*sizeof(ZNode));
 
     free(tmpzo);
-    
+
  done:
     ctk_object->selected_screen = screen;
 
@@ -2295,13 +2297,13 @@
     int i;
 
     if (!display) {
-        return;
+        select_screen(ctk_object, NULL);
+        goto done;
     }
 
     /* Move the screen and its displays to the top of the Z order */
     select_screen(ctk_object, display->screen);
 
-
     /* Move the display to the top of the Z order */
     for (i = 0; i < ctk_object->Zcount; i++) {
 
@@ -2322,6 +2324,7 @@
         }
     }
 
+ done:
     ctk_object->selected_display = display;
 
 } /* select_display() */
@@ -3298,11 +3301,6 @@
     sync_scaling(ctk_object);
     ctk_object->modify_info.modify_dirty = 1;
 
-    /* Make sure the selected display/screen is up to date */
-    if (ctk_object->selected_display) {
-        ctk_object->selected_screen = ctk_object->selected_display->screen;
-    }
-
     queue_layout_redraw(ctk_object);
 
 } /* ctk_display_layout_update() */
diff -Nru nvidia-settings-302.17/src/gtk+-2.x/ctkevent.c nvidia-settings-304.37/src/gtk+-2.x/ctkevent.c
--- nvidia-settings-302.17/src/gtk+-2.x/ctkevent.c	2012-06-13 04:51:30.000000000 +0200
+++ nvidia-settings-304.37/src/gtk+-2.x/ctkevent.c	2012-08-09 06:04:20.000000000 +0200
@@ -327,6 +327,8 @@
     MAKE_SIGNAL(NV_CTRL_GVO_AUDIO_BLANKING);
     MAKE_SIGNAL(NV_CTRL_CURRENT_METAMODE_ID);
     MAKE_SIGNAL(NV_CTRL_DISPLAY_ENABLED);
+    MAKE_SIGNAL(NV_CTRL_FRAMELOCK_INCOMING_HOUSE_SYNC_RATE);
+    MAKE_SIGNAL(NV_CTRL_FXAA);
 #undef MAKE_SIGNAL
     
     /*
@@ -336,7 +338,7 @@
      * knows about.
      */
 
-#if NV_CTRL_LAST_ATTRIBUTE != NV_CTRL_DISPLAY_ENABLED
+#if NV_CTRL_LAST_ATTRIBUTE != NV_CTRL_FXAA
 #warning "There are attributes that do not emit signals!"
 #endif
 
@@ -560,14 +562,14 @@
 
 static gboolean ctk_event_prepare(GSource *source, gint *timeout)
 {
+    CtkEventSource *event_source = (CtkEventSource *) source;
     *timeout = -1;
-    
+
     /*
-     * XXX We could check if any events are pending on the Display
-     * connection
+     * Check if any events are pending on the Display connection
      */
-    
-    return FALSE;
+
+    return XPending(event_source->dpy);
 }
 
 
diff -Nru nvidia-settings-302.17/src/gtk+-2.x/ctkframelock.c nvidia-settings-304.37/src/gtk+-2.x/ctkframelock.c
--- nvidia-settings-302.17/src/gtk+-2.x/ctkframelock.c	2012-06-13 04:51:30.000000000 +0200
+++ nvidia-settings-304.37/src/gtk+-2.x/ctkframelock.c	2012-08-09 06:04:20.000000000 +0200
@@ -178,7 +178,8 @@
 
     GtkWidget *rate_label;
     GtkWidget *rate_text;
-    guint      rate;
+    /* Rate in milliHz */
+    guint      rate_mHz;
     guint      rate_precision;
 
     GtkWidget *stereo_label;
@@ -218,6 +219,8 @@
     GtkWidget *delay_text;
 
     GtkWidget *house_label;
+    GtkWidget *house_sync_rate_label;
+    GtkWidget *house_sync_rate_text;
     GtkWidget *house_hbox; /* LED */
 
     GtkWidget *port0_label;
@@ -287,9 +290,11 @@
 "The Sync Edge drop-down allows you to select which edge the master "
 "frame lock device will use to decode the incoming house sync signal.";
 
-static const char * __video_mode_combo_help =
+static const char * __video_mode_help =
 "The Video Mode drop-down allows you to select which video mode the server "
-"G-Sync device will use to decode the incoming house sync signal.";
+"G-Sync device will use to decode the incoming house sync signal.  On some "
+"G-Sync devices, this will be auto-detected and will be reported as "
+"read-only information.";
 
 static const char * __detect_video_mode_button_help =
 "The Detect Video Mode button will attempt to automatically detect the format "
@@ -1185,7 +1190,15 @@
 
 static gboolean framelock_refresh_rates_compatible(int server, int client)
 {
-    int range = ABS(((int64_t)(server - client) * 1000000) / client);
+    int range;
+
+    /* client can be 0, e.g. if querying NV_CTRL_REFRESH_RATE{,_3} fails,
+     * or if the display device is disabled. */
+    if (client == 0) {
+        return FALSE;
+    }
+
+    range = ABS(((int64_t)(server - client) * 1000000) / client);
 
     /* Framelock can be achieved if the range between refresh rates is less
      * than 50 ppm */
@@ -1247,7 +1260,8 @@
      */
     sensitive = (data->slaveable &&
         (!server_data ||
-         framelock_refresh_rates_compatible(server_data->rate, data->rate)));
+         framelock_refresh_rates_compatible(server_data->rate_mHz,
+                                            data->rate_mHz)));
     gtk_widget_set_sensitive(data->rate_label, sensitive);
     gtk_widget_set_sensitive(data->rate_text, sensitive);
     gtk_widget_set_sensitive(data->label, sensitive);
@@ -2065,9 +2079,10 @@
     }
     entry->data = (gpointer)(data);
     entry->data_type = ENTRY_DATA_FRAMELOCK;
+    entry->ctk_event = CTK_EVENT(ctk_event_new(data->handle));
 
     /* Pack the data's widgets into the list entry data hbox */
-    
+
     gtk_box_pack_start(GTK_BOX(entry->label_hbox), data->label,
                        FALSE, FALSE, 5);
 
@@ -2076,34 +2091,34 @@
     padding = gtk_hbox_new(FALSE, 0);
 
     gtk_container_set_border_width(GTK_CONTAINER(hbox), 2);
-    
+
     gtk_box_pack_end(GTK_BOX(entry->data_hbox), frame, FALSE, FALSE, 0);
     gtk_container_add(GTK_CONTAINER(frame), hbox);
-    
+
     gtk_box_pack_start(GTK_BOX(hbox), data->receiving_hbox, FALSE, FALSE, 0);
     gtk_box_pack_start(GTK_BOX(hbox), data->receiving_label, FALSE, FALSE, 0);
 
     vseparator = gtk_vseparator_new();
     gtk_box_pack_start(GTK_BOX(hbox), vseparator, FALSE, FALSE, 0);
-    
+
     gtk_box_pack_start(GTK_BOX(hbox), data->rate_label, FALSE, FALSE, 0);
     gtk_box_pack_start(GTK_BOX(hbox), data->rate_text, FALSE, FALSE, 0);
 
     vseparator = gtk_vseparator_new();
     gtk_box_pack_start(GTK_BOX(hbox), vseparator, FALSE, FALSE, 0);
-    
+
     gtk_box_pack_start(GTK_BOX(hbox), data->house_hbox, FALSE, FALSE, 0);
     gtk_box_pack_start(GTK_BOX(hbox), data->house_label, FALSE, FALSE, 0);
 
     vseparator = gtk_vseparator_new();
     gtk_box_pack_start(GTK_BOX(hbox), vseparator, FALSE, FALSE, 0);
-    
+
     gtk_box_pack_start(GTK_BOX(hbox), data->port0_hbox, FALSE, FALSE, 0);
     gtk_box_pack_start(GTK_BOX(hbox), data->port0_label, FALSE, FALSE, 0);
 
     vseparator = gtk_vseparator_new();
     gtk_box_pack_start(GTK_BOX(hbox), vseparator, FALSE, FALSE, 0);
-    
+
     gtk_box_pack_start(GTK_BOX(hbox), data->port1_hbox, FALSE, FALSE, 0);
     gtk_box_pack_start(GTK_BOX(hbox), data->port1_label, FALSE, FALSE, 0);
 
@@ -2124,6 +2139,16 @@
     gtk_box_pack_start(GTK_BOX(data->extra_info_hbox), vseparator,
                        FALSE, FALSE, 0);
 
+    gtk_box_pack_start(GTK_BOX(data->extra_info_hbox),
+                       data->house_sync_rate_label,
+                       FALSE, FALSE, 0);
+    gtk_box_pack_start(GTK_BOX(data->extra_info_hbox),
+                       data->house_sync_rate_text,
+                       FALSE, FALSE, 0);
+    vseparator = gtk_vseparator_new();
+    gtk_box_pack_start(GTK_BOX(data->extra_info_hbox), vseparator,
+                       FALSE, FALSE, 0);
+
     gtk_box_pack_start(GTK_BOX(data->extra_info_hbox), data->revision_label,
                        FALSE, FALSE, 0);
     gtk_box_pack_start(GTK_BOX(data->extra_info_hbox), data->revision_text,
@@ -2156,24 +2181,25 @@
     }
     entry->data = (gpointer)(data);
     entry->data_type = ENTRY_DATA_GPU;
+    entry->ctk_event = CTK_EVENT(ctk_event_new(data->handle));
 
     /* Pack the data's widgets into the list entry data hbox */
-    
+
     gtk_box_pack_start(GTK_BOX(entry->label_hbox), data->label,
                        FALSE, FALSE, 5);
 
     frame = gtk_frame_new(NULL);
     hbox = gtk_hbox_new(FALSE, 5);
     padding = gtk_hbox_new(FALSE, 0);
-    
+
     gtk_container_set_border_width(GTK_CONTAINER(hbox), 2);
-    
+
     gtk_box_pack_end(GTK_BOX(entry->data_hbox), frame, FALSE, FALSE, 0);
     gtk_container_add(GTK_CONTAINER(frame), hbox);
-    
+
     gtk_box_pack_start(GTK_BOX(hbox), data->timing_hbox, FALSE, FALSE, 0);
     gtk_box_pack_start(GTK_BOX(hbox), data->timing_label, FALSE, FALSE, 0);
-    
+
     gtk_box_pack_end(GTK_BOX(hbox), padding, FALSE, FALSE, 0);
 
     return entry;
@@ -2204,7 +2230,7 @@
     entry->data_type = ENTRY_DATA_DISPLAY;
 
    /* Pack the data's widgets into the list entry data hbox */
-    
+
     gtk_box_pack_start(GTK_BOX(entry->label_hbox), data->label,
                        FALSE, FALSE, 5);
 
@@ -2216,28 +2242,28 @@
 
     gtk_box_pack_end(GTK_BOX(entry->data_hbox), frame, FALSE, FALSE, 0);
     gtk_container_add(GTK_CONTAINER(frame), hbox);
-    
+
     gtk_box_pack_start(GTK_BOX(hbox), data->stereo_hbox, FALSE, FALSE, 0);
     gtk_box_pack_start(GTK_BOX(hbox), data->stereo_label, FALSE, FALSE, 0);
-    
+
     vseparator = gtk_vseparator_new();
     gtk_box_pack_start(GTK_BOX(hbox), vseparator, FALSE, FALSE, 0);
-    
+
     gtk_box_pack_start(GTK_BOX(hbox), data->rate_label, FALSE, FALSE, 0);
     gtk_box_pack_start(GTK_BOX(hbox), data->rate_text, FALSE, FALSE, 0);
-    
+
     vseparator = gtk_vseparator_new();
     gtk_box_pack_start(GTK_BOX(hbox), vseparator, FALSE, FALSE, 0);
-    
+
     gtk_box_pack_start(GTK_BOX(hbox), data->server_checkbox, FALSE, FALSE, 0);
     gtk_box_pack_start(GTK_BOX(hbox), data->server_label, FALSE, FALSE, 0);
-    
+
     vseparator = gtk_vseparator_new();
     gtk_box_pack_start(GTK_BOX(hbox), vseparator, FALSE, FALSE, 0);
-    
+
     gtk_box_pack_start(GTK_BOX(hbox), data->client_checkbox, FALSE, FALSE, 0);
     gtk_box_pack_start(GTK_BOX(hbox), data->client_label, FALSE, FALSE, 0);
-    
+
     gtk_box_pack_end(GTK_BOX(hbox), padding, FALSE, FALSE, 0);
 
     return entry;
@@ -3581,6 +3607,21 @@
     snprintf(str, 32, "%.2f uS", fvalue); // 10.2f
     gtk_label_set_text(GTK_LABEL(data->delay_text), str);
 
+    /* Incomming signal rate */
+    gtk_widget_set_sensitive(data->house_sync_rate_label, framelock_enabled);
+    gtk_widget_set_sensitive(data->house_sync_rate_text, framelock_enabled);
+
+    ret =
+        NvCtrlGetAttribute(data->handle,
+                           NV_CTRL_FRAMELOCK_INCOMING_HOUSE_SYNC_RATE,
+                           &rate);
+    if (ret == NvCtrlSuccess) {
+        snprintf(str, 32, "%d.%.4d Hz", (rate / 10000), (rate % 10000));
+    } else {
+        snprintf(str, 32, "Unknown");
+    }
+    gtk_label_set_text(GTK_LABEL(data->house_sync_rate_text), str);
+    
     /* House Sync and Ports are always active */
     update_image(data->house_hbox,
                  (house ? ctk_framelock->led_green_pixbuf :
@@ -3955,16 +3996,43 @@
             house_format = NV_CTRL_FRAMELOCK_VIDEO_MODE_NONE;
         if (house_format > NV_CTRL_FRAMELOCK_VIDEO_MODE_HDTV)
             house_format = NV_CTRL_FRAMELOCK_VIDEO_MODE_HDTV;
-        
-        gtk_entry_set_text
-            (GTK_ENTRY(GTK_COMBO(ctk_framelock->video_mode_combo)->entry),
-             houseFormatStrings[house_format]);
+
+        if (!ctk_framelock->video_mode_read_only) {
+            gtk_entry_set_text
+                (GTK_ENTRY(GTK_COMBO(ctk_framelock->video_mode_widget)->entry),
+                 houseFormatStrings[house_format]);
+        } else {
+            gtk_label_set_text(GTK_LABEL(ctk_framelock->video_mode_widget),
+                               houseFormatStrings[house_format]);
+        }
 
     }
 }
 
 
 
+static void update_display_rate_txt(nvDisplayDataPtr data,
+                                    guint rate_mHz, int precision)
+{
+    float fvalue;
+    char str[32];
+
+    /* Don't overwrite REFRESH_RATE_3 with REFRESH_RATE data */
+    if (precision < data->rate_precision) {
+        return;
+    }
+
+    data->rate_precision = precision;
+    data->rate_mHz = rate_mHz;
+
+    fvalue = ((float)(data->rate_mHz)) / 1000.0f;
+    snprintf(str, 32, "%.*f Hz", precision, fvalue);
+
+    gtk_label_set_text(GTK_LABEL(data->rate_text), str);
+}
+
+
+
 /** gpu_state_received() *********************************************
  *
  * Signal handler for gpu target events.
@@ -3983,6 +4051,8 @@
     CtkFramelock *ctk_framelock = gpu_entry->tree->ctk_framelock;
     gboolean sensitive;
     gboolean checked;
+    int rateMultiplier = 1;
+    int precision = 3;
 
     switch (event->attribute) {
     case NV_CTRL_FRAMELOCK_MASTER:
@@ -4195,32 +4265,21 @@
 
 
     case NV_CTRL_REFRESH_RATE:
+        rateMultiplier = 10;
+        precision = 2;
+        /* fallthrough */
     case NV_CTRL_REFRESH_RATE_3:
         /* Update the display device's refresh rate */
         display_entry = get_display_on_gpu(gpu_entry, event->display_mask);
         if (display_entry && display_entry->data) {
-            float fvalue;
-            char str[32];
-
             display_data =
                 (nvDisplayDataPtr)(display_entry->data);
 
-            display_data->rate = event->value;
-            if (event->attribute == NV_CTRL_REFRESH_RATE_3 &&
-                display_data->rate_precision == 3) {
-                fvalue = ((float)(display_data->rate)) / 1000.0f;
-                snprintf(str, 32, "%.3f Hz", fvalue);
-            } else if (display_data->rate_precision == 2 ){
-                fvalue = ((float)(display_data->rate)) / 100.0f;
-                snprintf(str, 32, "%.2f Hz", fvalue);
-            } else {
-                // wrong signal (got 2 but support 3 or got 3 but
-                // don't support it);
-                break;
-            }
-            gtk_label_set_text(GTK_LABEL(display_data->rate_text), str);   
+            update_display_rate_txt(display_data,
+                                    event->value * rateMultiplier,
+                                    precision);
         }
-        
+
         /* Make sure the framelock controls are in a consistent state */
         update_framelock_controls(ctk_framelock);
         break;
@@ -4328,19 +4387,24 @@
         if (house_format > NV_CTRL_FRAMELOCK_VIDEO_MODE_HDTV)
             house_format = NV_CTRL_FRAMELOCK_VIDEO_MODE_HDTV;
 
-        g_signal_handlers_block_by_func
-            (G_OBJECT(GTK_COMBO(ctk_framelock->video_mode_combo)->entry),
-             G_CALLBACK(changed_video_mode),
-             (gpointer) ctk_framelock);
+        if (!ctk_framelock->video_mode_read_only) {
+            g_signal_handlers_block_by_func
+                (G_OBJECT(GTK_COMBO(ctk_framelock->video_mode_widget)->entry),
+                 G_CALLBACK(changed_video_mode),
+                 (gpointer) ctk_framelock);
+
+            gtk_entry_set_text
+                (GTK_ENTRY(GTK_COMBO(ctk_framelock->video_mode_widget)->entry),
+                 houseFormatStrings[house_format]);
 
-        gtk_entry_set_text
-            (GTK_ENTRY(GTK_COMBO(ctk_framelock->video_mode_combo)->entry),
-             houseFormatStrings[house_format]);
-        
-        g_signal_handlers_unblock_by_func
-            (G_OBJECT(GTK_COMBO(ctk_framelock->video_mode_combo)->entry),
-             G_CALLBACK(changed_video_mode),
-             (gpointer) ctk_framelock);
+            g_signal_handlers_unblock_by_func
+                (G_OBJECT(GTK_COMBO(ctk_framelock->video_mode_widget)->entry),
+                 G_CALLBACK(changed_video_mode),
+                 (gpointer) ctk_framelock);
+        } else {
+            gtk_label_set_text(GTK_LABEL(ctk_framelock->video_mode_widget),
+                               houseFormatStrings[house_format]);
+        }
         break;
 
     default:
@@ -4487,6 +4551,7 @@
     ctk_framelock->attribute_handle = handle;
     ctk_framelock->ctk_config = ctk_config;
     ctk_framelock->parent_window = GTK_WINDOW(parent_window);
+    ctk_framelock->video_mode_read_only = TRUE;
 
     /* create the watch cursor */
 
@@ -4585,28 +4650,42 @@
 
     /* Create combo boxes */
 
-    combo = gtk_combo_new();
-    glist = NULL;
-    glist = g_list_append
-        (glist,
-         houseFormatStrings[NV_CTRL_FRAMELOCK_VIDEO_MODE_COMPOSITE_AUTO]);
-    glist = g_list_append
-        (glist,
-         houseFormatStrings[NV_CTRL_FRAMELOCK_VIDEO_MODE_COMPOSITE_BI_LEVEL]);
-    glist = g_list_append
-        (glist,
-         houseFormatStrings[NV_CTRL_FRAMELOCK_VIDEO_MODE_COMPOSITE_TRI_LEVEL]);
-    glist = g_list_append
-        (glist, houseFormatStrings[NV_CTRL_FRAMELOCK_VIDEO_MODE_TTL]);
-    
-    gtk_combo_set_popdown_strings(GTK_COMBO(combo), glist);
-    gtk_editable_set_editable(GTK_EDITABLE(GTK_COMBO(combo)->entry), FALSE);
-    g_signal_connect(G_OBJECT(GTK_EDITABLE(GTK_COMBO(combo)->entry)),
-                     "changed", G_CALLBACK(changed_video_mode),
-                     (gpointer) ctk_framelock);
-    ctk_config_set_tooltip(ctk_config, combo,
-                           __video_mode_combo_help);
-    ctk_framelock->video_mode_combo = combo;
+    /* Select video mode widget dropdown/label depending on 
+     * video mode is read-only.
+     */
+    ret = NvCtrlGetValidAttributeValues(ctk_framelock->attribute_handle,
+                                        NV_CTRL_FRAMELOCK_VIDEO_MODE,
+                                        &valid);
+    if ((ret == NvCtrlSuccess) && (valid.permissions & ATTRIBUTE_TYPE_WRITE)) {
+        ctk_framelock->video_mode_read_only = FALSE;
+    }
+
+    if (!ctk_framelock->video_mode_read_only) {
+        combo = gtk_combo_new();
+        glist = NULL;
+        glist = g_list_append
+            (glist,
+             houseFormatStrings[NV_CTRL_FRAMELOCK_VIDEO_MODE_COMPOSITE_AUTO]);
+        glist = g_list_append
+            (glist,
+             houseFormatStrings[NV_CTRL_FRAMELOCK_VIDEO_MODE_COMPOSITE_BI_LEVEL]);
+        glist = g_list_append
+            (glist,
+             houseFormatStrings[NV_CTRL_FRAMELOCK_VIDEO_MODE_COMPOSITE_TRI_LEVEL]);
+        glist = g_list_append
+            (glist, houseFormatStrings[NV_CTRL_FRAMELOCK_VIDEO_MODE_TTL]);
+
+        gtk_combo_set_popdown_strings(GTK_COMBO(combo), glist);
+        gtk_editable_set_editable(GTK_EDITABLE(GTK_COMBO(combo)->entry), FALSE);
+        g_signal_connect(G_OBJECT(GTK_EDITABLE(GTK_COMBO(combo)->entry)),
+                         "changed", G_CALLBACK(changed_video_mode),
+                         (gpointer) ctk_framelock);
+        ctk_framelock->video_mode_widget = combo;
+    } else {
+        ctk_framelock->video_mode_widget = gtk_label_new("None");
+    } 
+    ctk_config_set_tooltip(ctk_config, ctk_framelock->video_mode_widget,
+                           __video_mode_help);
 
 
     combo = gtk_combo_new();
@@ -4827,7 +4906,7 @@
         gtk_container_add(GTK_CONTAINER(frame2), hbox);
 
         gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, TRUE, 5);
-        gtk_box_pack_start(GTK_BOX(hbox), ctk_framelock->video_mode_combo,
+        gtk_box_pack_start(GTK_BOX(hbox), ctk_framelock->video_mode_widget,
                            FALSE, FALSE, 5);
         gtk_box_pack_start(GTK_BOX(hbox), ctk_framelock->video_mode_detect,
                            FALSE, TRUE, 5);
@@ -5026,14 +5105,12 @@
     nvGPUDataPtr      gpu_data;
     nvListEntryPtr    entry;
     ReturnStatus      ret;
-    
+
     unsigned int enabled_displays;
     unsigned int display_mask;
 
     unsigned int master_mask;
     unsigned int slaves_mask;
-    gfloat       fvalue; /* To print the refresh rate */
-    gchar        rr_str[32];
 
     nvListEntryPtr   server_entry = NULL;
 
@@ -5097,11 +5174,14 @@
     /* Cache the server/clients masks */
     gpu_data->server_mask = master_mask;
     gpu_data->clients_mask = slaves_mask;
-    
+
 
     /* Add all enabled displays found on the GPU */
     display_mask = 1;
     while (display_mask) {
+        int rate;
+        int precision;
+
         if (display_mask & enabled_displays) {
 
             /* Create the display structure */
@@ -5110,11 +5190,11 @@
             if (!display_data) {
                 goto fail;
             }
-            
+
             /* Setup the display information */
             display_data->handle      = gpu_data->handle;
             display_data->device_mask = display_mask;
-            
+
             ret = NvCtrlGetDisplayAttribute(gpu_data->handle,
                                             display_mask,
                                             NV_CTRL_FRAMELOCK_MASTERABLE,
@@ -5123,30 +5203,8 @@
                 goto fail;
             }
 
-            // If we can't get either percision, then fail
-            if (NvCtrlSuccess !=
-                (ret = NvCtrlGetDisplayAttribute(gpu_data->handle,
-                                             display_mask,
-                                             NV_CTRL_REFRESH_RATE_3,
-                                             (int *)&(display_data->rate)))) {
-                ret = NvCtrlGetDisplayAttribute(gpu_data->handle,
-                                                display_mask,
-                                                NV_CTRL_REFRESH_RATE,
-                                                (int *)&(display_data->rate));
-                fvalue = ((float)(display_data->rate)) / 100.0f;
-                snprintf(rr_str, 32, "%.2f Hz", fvalue);
-                display_data->rate_precision = 2;
-            } else {
-                fvalue = ((float)(display_data->rate)) / 1000.0f;
-                snprintf(rr_str, 32, "%.3f Hz", fvalue);
-                display_data->rate_precision = 3;
-            }
-            if (ret != NvCtrlSuccess) {
-                goto fail;
-            }
-
             display_data->label           = gtk_label_new("");
-            
+
             display_data->server_label    = gtk_label_new("Server");
             display_data->server_checkbox = gtk_check_button_new();
             ctk_config_set_tooltip(ctk_framelock->ctk_config,
@@ -5158,9 +5216,10 @@
             ctk_config_set_tooltip(ctk_framelock->ctk_config,
                                    display_data->client_checkbox,
                                    __client_checkbox_help);
-            
+
+
             display_data->rate_label      = gtk_label_new("Refresh:");
-            display_data->rate_text       = gtk_label_new(rr_str);
+            display_data->rate_text       = gtk_label_new("");
 
             display_data->stereo_label    = gtk_label_new("Stereo");
             display_data->stereo_hbox     = gtk_hbox_new(FALSE, 0);
@@ -5170,10 +5229,31 @@
 
             update_entry_label(ctk_framelock, entry);
             list_entry_update_status(ctk_framelock, entry);
-                       
+
             /* Add display to GPU entry */
             list_entry_add_child(gpu_entry, entry);
-            
+
+
+            /* Refresh Rate */
+            ret = NvCtrlGetDisplayAttribute(display_data->handle,
+                                            display_data->device_mask,
+                                            NV_CTRL_REFRESH_RATE_3, &rate);
+            if (ret != NvCtrlSuccess) {
+                ret = NvCtrlGetDisplayAttribute(display_data->handle,
+                                                display_data->device_mask,
+                                                NV_CTRL_REFRESH_RATE, &rate);
+                if (ret != NvCtrlSuccess) {
+                    rate = 0;
+                    precision = 0;
+                } else {
+                    rate = rate * 10;
+                    precision = 2;
+                }
+            } else {
+                precision = 3;
+            }
+            update_display_rate_txt(display_data, rate, precision);
+
             /* Setup state */
             if (!display_data->masterable) {
                 gtk_widget_set_sensitive(display_data->server_label, FALSE);
@@ -5318,8 +5398,6 @@
                                &(gpu_data->enabled));
             ctk_framelock->framelock_enabled |= gpu_data->enabled;
 
-            entry->ctk_event = CTK_EVENT(ctk_event_new(gpu_data->handle));
-
             for (i = 0; i < ARRAY_LEN(__GPUSignals); i++) {
                 g_signal_connect(G_OBJECT(entry->ctk_event),
                                  __GPUSignals[i],
@@ -5425,6 +5503,10 @@
 
         framelock_data->house_label = gtk_label_new("House");
         framelock_data->house_hbox = gtk_hbox_new(FALSE, 0);
+        
+        framelock_data->house_sync_rate_label =
+            gtk_label_new("House Sync Rate:");
+        framelock_data->house_sync_rate_text = gtk_label_new("");
 
         framelock_data->port0_label = gtk_label_new("Port 0");
         framelock_data->port0_hbox = gtk_hbox_new(FALSE, 0);
@@ -5454,9 +5536,6 @@
             list_tree_add_entry((nvListTreePtr)(ctk_framelock->tree),
                                 entry);
 
-            entry->ctk_event =
-                CTK_EVENT(ctk_event_new(framelock_data->handle));
-
             for (i = 0; i < ARRAY_LEN(__FrameLockSignals); i++) {
                 g_signal_connect(G_OBJECT(entry->ctk_event),
                                  __FrameLockSignals[i],
@@ -5926,7 +6005,7 @@
                   "only.");
 
     ctk_help_heading(b, &i, "Video Mode");
-    ctk_help_para(b, &i, __video_mode_combo_help);
+    ctk_help_para(b, &i, __video_mode_help);
 
     ctk_help_heading(b, &i, "Video Mode Detect");
     ctk_help_para(b, &i, __detect_video_mode_button_help);
diff -Nru nvidia-settings-302.17/src/gtk+-2.x/ctkframelock.h nvidia-settings-304.37/src/gtk+-2.x/ctkframelock.h
--- nvidia-settings-302.17/src/gtk+-2.x/ctkframelock.h	2012-06-13 04:51:37.000000000 +0200
+++ nvidia-settings-304.37/src/gtk+-2.x/ctkframelock.h	2012-08-09 06:04:20.000000000 +0200
@@ -80,11 +80,12 @@
     GtkWidget             *sync_edge_frame;
     GtkWidget             *sync_edge_combo;
     GtkWidget             *video_mode_frame;
-    GtkWidget             *video_mode_combo;
+    GtkWidget             *video_mode_widget;
     GtkWidget             *video_mode_detect;
 
     gint                   current_detect_format;
     guint                  video_mode_detect_timer;
+    gboolean               video_mode_read_only;
 
     /* Dialogs */
     GtkWidget             *add_devices_dialog;
diff -Nru nvidia-settings-302.17/src/gtk+-2.x/ctkgpu.c nvidia-settings-304.37/src/gtk+-2.x/ctkgpu.c
--- nvidia-settings-302.17/src/gtk+-2.x/ctkgpu.c	2012-06-13 04:51:30.000000000 +0200
+++ nvidia-settings-304.37/src/gtk+-2.x/ctkgpu.c	2012-08-09 06:04:20.000000000 +0200
@@ -361,6 +361,7 @@
     ctk_gpu->gpu_cores = (gpu_cores != NULL) ? 1 : 0;
     ctk_gpu->memory_interface = (memory_interface != NULL) ? 1 : 0;
     ctk_gpu->ctk_config = ctk_config;
+    ctk_gpu->ctk_event = ctk_event;
     ctk_gpu->pcie_gen_queriable = FALSE;
 
     /* set container properties of the object */
diff -Nru nvidia-settings-302.17/src/gtk+-2.x/ctkgpu.h nvidia-settings-304.37/src/gtk+-2.x/ctkgpu.h
--- nvidia-settings-302.17/src/gtk+-2.x/ctkgpu.h	2012-06-13 04:51:37.000000000 +0200
+++ nvidia-settings-304.37/src/gtk+-2.x/ctkgpu.h	2012-08-09 06:04:20.000000000 +0200
@@ -57,6 +57,7 @@
 
     NvCtrlAttributeHandle *handle;
     CtkConfig *ctk_config;
+    CtkEvent *ctk_event;
 
     GtkWidget *displays;
     gint gpu_cores;
diff -Nru nvidia-settings-302.17/src/gtk+-2.x/ctkimagesliders.c nvidia-settings-304.37/src/gtk+-2.x/ctkimagesliders.c
--- nvidia-settings-302.17/src/gtk+-2.x/ctkimagesliders.c	2012-06-13 04:51:30.000000000 +0200
+++ nvidia-settings-304.37/src/gtk+-2.x/ctkimagesliders.c	2012-08-09 06:04:20.000000000 +0200
@@ -36,6 +36,9 @@
 "alters the level of Image Sharpening for this display device.";
 
 
+static void ctk_image_sliders_class_init(CtkImageSliders *ctk_object_class);
+static void ctk_image_sliders_finalize(GObject *object);
+
 static GtkWidget * add_scale(CtkConfig *ctk_config,
                              int attribute,
                              char *name,
@@ -64,7 +67,7 @@
             sizeof (CtkImageSlidersClass),
             NULL, /* base_init */
             NULL, /* base_finalize */
-            NULL, /* class_init, */
+            (GClassInitFunc) ctk_image_sliders_class_init,
             NULL, /* class_finalize */
             NULL, /* class_data */
             sizeof (CtkImageSliders),
@@ -80,6 +83,30 @@
     return ctk_image_sliders_type;
 }
 
+static void ctk_image_sliders_class_init(
+    CtkImageSliders *ctk_object_class
+)
+{
+    GObjectClass *gobject_class = (GObjectClass *)ctk_object_class;
+    gobject_class->finalize = ctk_image_sliders_finalize;
+}
+
+static void ctk_image_sliders_finalize(
+    GObject *object
+)
+{
+    CtkImageSliders *ctk_image_sliders = CTK_IMAGE_SLIDERS(object);
+
+    g_signal_handlers_disconnect_matched(G_OBJECT(ctk_image_sliders->ctk_event),
+                                         G_SIGNAL_MATCH_DATA,
+                                         0, /* signal_id */
+                                         0, /* detail */
+                                         NULL, /* closure */
+                                         NULL, /* func */
+                                         (gpointer) ctk_image_sliders);
+}
+
+
 
 GtkWidget* ctk_image_sliders_new(NvCtrlAttributeHandle *handle,
                                  CtkConfig *ctk_config, CtkEvent *ctk_event,
diff -Nru nvidia-settings-302.17/src/gtk+-2.x/ctkmultisample.c nvidia-settings-304.37/src/gtk+-2.x/ctkmultisample.c
--- nvidia-settings-302.17/src/gtk+-2.x/ctkmultisample.c	2012-06-13 04:51:30.000000000 +0200
+++ nvidia-settings-304.37/src/gtk+-2.x/ctkmultisample.c	2012-08-09 06:04:20.000000000 +0200
@@ -62,6 +62,15 @@
 static void fsaa_update_received(GtkObject *object,
                                  gpointer arg1, gpointer user_data);
 
+static void fxaa_checkbox_toggled(GtkWidget *widget,
+                                  gpointer user_data);
+
+static void fxaa_update_received(GtkObject *object,
+                                 gpointer arg1, gpointer user_data);
+
+static void post_fxaa_toggled(CtkMultisample *ctk_multisample, 
+                              gboolean enable);
+
 static void
 post_log_aniso_app_override_toggled(CtkMultisample *ctk_multisample,
                                     gboolean override);
@@ -96,6 +105,11 @@
                                                gpointer arg1,
                                                gpointer user_data);
 
+static void update_fxaa_from_fsaa_change(CtkMultisample *ctk_multisample,
+                                         int fsaa_value);
+static void update_fsaa_from_fxaa_change(CtkMultisample *ctk_multisample,
+                                         gboolean fxaa_enabled);
+
 static const char *__aa_override_app_help =
 "Enable the Antialiasing \"Override Application Setting\" "
 "checkbox to make the antialiasing slider active and "
@@ -108,7 +122,8 @@
 "the slider.";
 
 static const char *__aa_slider_help =
-"The Antialiasing slider controls the level of antialiasing.";
+"The Antialiasing slider controls the level of antialiasing. Using "
+"antialiasing disables FXAA.";
 
 static const char *__aniso_override_app_help =
 "Enable the Anisotropic Filtering \"Override Application Setting\" "
@@ -120,6 +135,12 @@
 "The Anisotropic Filtering slider controls the "
 "level of automatic anisotropic texture filtering.";
 
+static const char *__fxaa_enable_help = 
+"Enable Fast Approximate Anti-Aliasing. This option is applied to "
+"OpenGL applications that are started after this option is set. Enabling "
+"FXAA disables antialiasing and other antialiasing setting methods. FXAA "
+"is not allowed when Unified Back Buffers are enabled.";
+
 static const char *__texture_sharpening_help =
 "To improve image quality, select this option "
 "to sharpen textures when running OpenGL applications "
@@ -202,7 +223,7 @@
     GtkObject *adjustment;
     gint min, max;
     
-    gint val, app_control, override, enhance, i;
+    gint val, app_control, override, enhance, mode, i;
     
     NVCTRLAttributeValidValuesRec valid;
 
@@ -235,9 +256,9 @@
         
         build_fsaa_translation_table(ctk_multisample, valid);
         
-        ret = NvCtrlGetAttribute(handle, NV_CTRL_FSAA_MODE, &val);
+        ret = NvCtrlGetAttribute(handle, NV_CTRL_FSAA_MODE, &mode);
         
-        val = map_nv_ctrl_fsaa_value_to_slider(ctk_multisample, val);
+        val = map_nv_ctrl_fsaa_value_to_slider(ctk_multisample, mode);
 
         ret0 = NvCtrlGetAttribute(handle,
                                   NV_CTRL_FSAA_APPLICATION_CONTROLLED,
@@ -352,6 +373,43 @@
             for (i = 0; i < ctk_multisample->fsaa_translation_table_size; i++)
                 ctk_multisample->active_attributes |=
                     (1 << (__FSAA+ctk_multisample->fsaa_translation_table[i]));
+
+            /* FXAA Option button */
+
+            check_button = gtk_check_button_new_with_label("Enable FXAA");
+
+            ret = NvCtrlGetAttribute(handle, NV_CTRL_FXAA, &val);
+
+            ctk_multisample->fxaa_available = 
+                (ret != NvCtrlAttributeNotAvailable);
+
+            if (mode != NV_CTRL_FSAA_MODE_NONE || 
+                !ctk_multisample->fxaa_available) {
+                val = NV_CTRL_FXAA_DISABLE;
+            }
+
+            if (val == NV_CTRL_FXAA_ENABLE) {
+                gtk_widget_set_sensitive(GTK_WIDGET(scale), FALSE);
+            }
+
+            gtk_widget_set_sensitive(GTK_WIDGET(check_button),
+                                     (mode == NV_CTRL_FSAA_MODE_NONE) &&
+                                     (ctk_multisample->fxaa_available));
+            gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_button), val);
+
+            g_signal_connect(G_OBJECT(check_button), "toggled",
+                             G_CALLBACK(fxaa_checkbox_toggled),
+                             (gpointer) ctk_multisample);
+
+            g_signal_connect(G_OBJECT(ctk_event),
+                             CTK_EVENT_NAME(NV_CTRL_FXAA),
+                             G_CALLBACK(fxaa_update_received),
+                             (gpointer) ctk_multisample);
+
+            ctk_config_set_tooltip(ctk_config, check_button,
+                                   __fxaa_enable_help);
+            gtk_box_pack_start(GTK_BOX(vbox), check_button, FALSE, FALSE, 0);
+            ctk_multisample->fxaa_enable_check_button = check_button;
         }
     }
     
@@ -705,9 +763,15 @@
 static void post_fsaa_setting_changed(CtkMultisample *ctk_multisample,
                                       gboolean override, gboolean enhance)
 {
+    GtkWidget *fxaa_checkbox = ctk_multisample->fxaa_enable_check_button;
+    gboolean fxaa_value = 
+        gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(fxaa_checkbox));
+
     if (ctk_multisample->fsaa_scale) {
         gtk_widget_set_sensitive
-            (GTK_WIDGET(ctk_multisample->fsaa_scale), override);
+            (GTK_WIDGET(ctk_multisample->fsaa_scale), 
+            (override &&
+            (fxaa_value == NV_CTRL_FXAA_DISABLE)));
     }
 
     ctk_config_statusbar_message(ctk_multisample->ctk_config,
@@ -751,6 +815,9 @@
         g_signal_handlers_unblock_by_func(G_OBJECT(range),
                                           G_CALLBACK(fsaa_value_changed),
                                           (gpointer) ctk_multisample);
+
+        update_fxaa_from_fsaa_change(ctk_multisample,
+                                     NV_CTRL_FSAA_MODE_NONE);
     }
 
     post_fsaa_setting_changed(ctk_multisample, override, enhance);
@@ -918,6 +985,89 @@
 } /* post_fsaa_value_changed() */
 
 
+/*
+ * update_fxaa_from_fsaa_change - helper function for changes to fsaa in order
+ * to update fxaa and enable/disable fxaa or fsaa widgets based on the new 
+ * value of fsaa.
+ */
+
+static void update_fxaa_from_fsaa_change(CtkMultisample *ctk_multisample,
+                                         int fsaa_value)
+{
+    GtkRange *fsaa_range = GTK_RANGE(ctk_multisample->fsaa_scale);
+    GtkWidget *fsaa_menu = ctk_multisample->fsaa_menu;
+    GtkWidget *fxaa_checkbox = ctk_multisample->fxaa_enable_check_button;
+    gboolean fxaa_value;
+
+    /* The FSAA dropdown menu is: 0 == app, 1 == override, 2 == enhance */
+    gint fsaa_idx = gtk_option_menu_get_history(GTK_OPTION_MENU(fsaa_menu)) ;
+    
+    if (fsaa_value != NV_CTRL_FSAA_MODE_NONE) {
+        g_signal_handlers_block_by_func(G_OBJECT(fxaa_checkbox),
+                                        G_CALLBACK(fxaa_checkbox_toggled),
+                                        (gpointer) ctk_multisample);
+
+        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(fxaa_checkbox), FALSE);
+
+        g_signal_handlers_unblock_by_func(G_OBJECT(fxaa_checkbox),
+                                          G_CALLBACK(fxaa_checkbox_toggled),
+                                          (gpointer) ctk_multisample);
+    }
+
+    fxaa_value = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(fxaa_checkbox));
+
+    gtk_widget_set_sensitive(GTK_WIDGET(fsaa_range), 
+                             (fsaa_idx != 0) && // not app controlled
+                             (fxaa_value == NV_CTRL_FXAA_DISABLE));
+    gtk_widget_set_sensitive(GTK_WIDGET(fxaa_checkbox),
+                             fsaa_value == NV_CTRL_FSAA_MODE_NONE &&
+                             ctk_multisample->fxaa_available);
+} /* update_fxaa_from_fsaa_change() */
+
+/*
+ * update_fsaa_from_fxaa_change - helper function for changes to fxaa in order
+ * to update fsaa and enable/disable fxaa or fsaa widgets based on the new 
+ * value of fxaa.
+ */
+
+static void update_fsaa_from_fxaa_change (CtkMultisample *ctk_multisample,
+                                          gboolean fxaa_enabled)
+{
+    GtkWidget *fxaa_checkbox = ctk_multisample->fxaa_enable_check_button;
+    GtkRange *fsaa_range = GTK_RANGE(ctk_multisample->fsaa_scale);
+    gint fsaa_value_none = map_nv_ctrl_fsaa_value_to_slider(ctk_multisample, 0);
+    GtkWidget *fsaa_menu = ctk_multisample->fsaa_menu;
+
+    /* The FSAA dropdown menu is: 0 == app, 1 == override, 2 == enhance */
+    gint fsaa_idx = gtk_option_menu_get_history(GTK_OPTION_MENU(fsaa_menu)) ;
+    
+    gint fsaa_val;
+
+    if (fxaa_enabled == NV_CTRL_FXAA_ENABLE) {
+        g_signal_handlers_block_by_func(G_OBJECT(fsaa_range),
+                                        G_CALLBACK(fsaa_value_changed),
+                                        (gpointer) ctk_multisample);
+
+        gtk_range_set_value(fsaa_range, fsaa_value_none);
+
+        g_signal_handlers_unblock_by_func(G_OBJECT(fsaa_range),
+                                          G_CALLBACK(fsaa_value_changed),
+                                          (gpointer) ctk_multisample);
+    }
+
+    fsaa_val = gtk_range_get_value(fsaa_range);
+    if (fsaa_val > NV_CTRL_FSAA_MODE_MAX) fsaa_val = NV_CTRL_FSAA_MODE_MAX;
+    if (fsaa_val < 0) fsaa_val = 0;
+    fsaa_val = ctk_multisample->fsaa_translation_table[fsaa_val];
+
+    gtk_widget_set_sensitive(GTK_WIDGET(fxaa_checkbox), 
+                             ((fxaa_enabled == NV_CTRL_FXAA_ENABLE) || 
+                             (fsaa_val == NV_CTRL_FSAA_MODE_NONE)) &&
+                             (ctk_multisample->fxaa_available));
+    gtk_widget_set_sensitive(GTK_WIDGET(fsaa_range), 
+                             (fsaa_idx != 0) && // not app controlled
+                             (fxaa_enabled == NV_CTRL_FXAA_DISABLE));
+} /* update_fsaa_from_fxaa_change */
 
 /*
  * fsaa_value_changed() - callback for the "value-changed" signal from
@@ -937,12 +1087,81 @@
     val = ctk_multisample->fsaa_translation_table[val];
 
     NvCtrlSetAttribute(ctk_multisample->handle, NV_CTRL_FSAA_MODE, val);
+
+    update_fxaa_from_fsaa_change(ctk_multisample, val);
     
     post_fsaa_value_changed(ctk_multisample, val);
 
 } /* fsaa_value_changed() */
 
 
+/*
+ * fxaa_checkbox_toggled - callback for a change to
+ * the FXAA settings in the control panel
+ */
+static void fxaa_checkbox_toggled(GtkWidget *widget,
+                                  gpointer user_data)
+{
+    CtkMultisample *ctk_multisample = CTK_MULTISAMPLE(user_data);
+    gboolean enabled;
+
+    enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
+
+    NvCtrlSetAttribute(ctk_multisample->handle, NV_CTRL_FXAA, enabled);
+
+    update_fsaa_from_fxaa_change(ctk_multisample, enabled);
+
+    post_fxaa_toggled(ctk_multisample, enabled);
+
+} /* fxaa_checkbox_toggled */
+
+
+/*
+ * fxaa_update_received() - callback function for when the
+ * NV_CTRL_FXAA attribute is changed by another NV-CONTROL
+ * client.
+ */
+
+static void fxaa_update_received(GtkObject *object,
+                                 gpointer arg1, gpointer user_data)
+{
+    CtkEventStruct *event_struct = (CtkEventStruct *) arg1;
+    CtkMultisample *ctk_multisample = CTK_MULTISAMPLE(user_data);
+    gboolean fxaa_value = event_struct->value;
+    GtkWidget *check_button = ctk_multisample->fxaa_enable_check_button;
+
+    g_signal_handlers_block_by_func(G_OBJECT(check_button),
+                                    G_CALLBACK(fxaa_checkbox_toggled),
+                                    (gpointer) ctk_multisample);
+
+    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_button), fxaa_value);
+    
+    update_fsaa_from_fxaa_change(ctk_multisample, fxaa_value);
+
+    g_signal_handlers_unblock_by_func(G_OBJECT(check_button),
+                                      G_CALLBACK(fxaa_checkbox_toggled),
+                                      (gpointer) ctk_multisample);
+
+    post_fxaa_toggled(ctk_multisample, fxaa_value);
+
+} /* fxaa_update_received() */
+
+/*
+ * post_fxaa_toggled() - helper function for fxaa_button_toggled() 
+ * and fxaa_update_received(); this does whatever work is necessary 
+ * after the app control check button has been toggled.
+ */
+
+static void
+post_fxaa_toggled(CtkMultisample *ctk_multisample, gboolean enable)
+{
+    ctk_config_statusbar_message(ctk_multisample->ctk_config,
+                                 "FXAA "
+                                 "%s.", enable ? "enabled" : "disabled");
+
+} /* post_fxaa_toggled() */
+
+
 
 /*
  * fsaa_update_received() - callback function for when the
@@ -970,6 +1189,8 @@
                                     (gpointer) ctk_multisample);
     
     gtk_range_set_value(range, val);
+
+    update_fxaa_from_fsaa_change(ctk_multisample, event_struct->value);
     
     g_signal_handlers_unblock_by_func(G_OBJECT(range),
                                       G_CALLBACK(fsaa_value_changed),
diff -Nru nvidia-settings-302.17/src/gtk+-2.x/ctkmultisample.h nvidia-settings-304.37/src/gtk+-2.x/ctkmultisample.h
--- nvidia-settings-302.17/src/gtk+-2.x/ctkmultisample.h	2012-06-13 04:51:37.000000000 +0200
+++ nvidia-settings-304.37/src/gtk+-2.x/ctkmultisample.h	2012-08-09 06:04:20.000000000 +0200
@@ -57,6 +57,7 @@
     GtkWidget *fsaa_app_override_check_button;
     GtkWidget *fsaa_menu;
     GtkWidget *fsaa_scale;
+    GtkWidget *fxaa_enable_check_button;
     GtkWidget *log_aniso_app_override_check_button;
     GtkWidget *log_aniso_scale;
     GtkWidget *texture_sharpening_button;
@@ -65,6 +66,7 @@
 
     gint fsaa_translation_table[NV_CTRL_FSAA_MODE_MAX + 1];
     gint fsaa_translation_table_size;
+    gboolean fxaa_available;
 };
 
 struct _CtkMultisampleClass
diff -Nru nvidia-settings-302.17/src/gtk+-2.x/ctkslimm.c nvidia-settings-304.37/src/gtk+-2.x/ctkslimm.c
--- nvidia-settings-302.17/src/gtk+-2.x/ctkslimm.c	2012-06-13 04:51:30.000000000 +0200
+++ nvidia-settings-304.37/src/gtk+-2.x/ctkslimm.c	2012-08-09 06:04:20.000000000 +0200
@@ -26,6 +26,7 @@
 
 #include "msg.h"
 #include "parse.h"
+#include "common-utils.h"
 
 #include "ctkbanner.h"
 
@@ -70,24 +71,53 @@
 
 
 
-/** 
+/**
  * The gridConfigs array enumerates the display grid configurations
  * that are presently supported.
  *
  **/
 
 static GridConfig gridConfigs[] = {
-    {2, 2, FALSE}, // rows, columns, valid
-    {2, 3, FALSE},
-    {2, 4, FALSE},
-    {3, 1, FALSE},
-    {3, 2, FALSE},
-    {1, 3, FALSE},
-    {2, 1, FALSE},
-    {1, 2, FALSE},
-    {4, 1, FALSE},
-    {1, 4, FALSE},
-    {0, 0, FALSE}
+    {4, 4,  FALSE}, // rows, columns, valid
+    {5, 3,  FALSE},
+    {3, 5,  FALSE},
+    {3, 4,  FALSE},
+    {4, 3,  FALSE},
+    {3, 3,  FALSE},
+    {2, 8,  FALSE},
+    {8, 2,  FALSE},
+    {2, 7,  FALSE},
+    {7, 2,  FALSE},
+    {2, 6,  FALSE},
+    {6, 2,  FALSE},
+    {2, 5,  FALSE},
+    {5, 2,  FALSE},
+    {1, 16, FALSE},
+    {16, 1, FALSE},
+    {1, 15, FALSE},
+    {15, 1, FALSE},
+    {1, 14, FALSE},
+    {14, 1, FALSE},
+    {1, 13, FALSE},
+    {13, 1, FALSE},
+    {1, 12, FALSE},
+    {12, 1, FALSE},
+    {1, 11, FALSE},
+    {11, 1, FALSE},
+    {1, 10, FALSE},
+    {10, 1, FALSE},
+    {1, 9,  FALSE},
+    {9, 1,  FALSE},
+    {2, 2,  FALSE},
+    {2, 3,  FALSE},
+    {2, 4,  FALSE},
+    {3, 1,  FALSE},
+    {3, 2,  FALSE},
+    {1, 3,  FALSE},
+    {2, 1,  FALSE},
+    {1, 2,  FALSE},
+    {4, 1,  FALSE},
+    {1, 4,  FALSE},
 };
 
 GType ctk_slimm_get_type()
@@ -136,7 +166,7 @@
 static GridConfig *get_ith_valid_grid_config(int idx)
 {
     int i, count = 0;
-    for (i = 0; gridConfigs[i].rows; i++) {
+    for (i = 0; i < ARRAY_LEN(gridConfigs); i++) {
         if (!gridConfigs[i].valid) continue;
         if (count == idx) return &gridConfigs[i];
         count++;
@@ -840,14 +870,14 @@
 
     /* Make space for the display location array */
     if (!locs) {
-        for (loc_idx = 0; gridConfigs[loc_idx].rows; loc_idx++ ) {
+        for (loc_idx = 0; loc_idx < ARRAY_LEN(gridConfigs); loc_idx++ ) {
             if ( max_rows < gridConfigs[loc_idx].rows) {
                 max_rows = gridConfigs[loc_idx].rows;
             }
             if ( max_cols < gridConfigs[loc_idx].columns) {
                 max_cols = gridConfigs[loc_idx].columns;
             }
-            if (max_locs < 
+            if (max_locs <
                 (gridConfigs[loc_idx].rows * gridConfigs[loc_idx].columns)) {
                 max_locs =
                     gridConfigs[loc_idx].rows * gridConfigs[loc_idx].columns;
@@ -1010,10 +1040,10 @@
                 goto fail;
             }
         }
-        
+
         /* Make sure this is a known/supported grid config */
         found = 0;
-        for (i = 0; gridConfigs[i].rows; i++) {
+        for (i = 0; i < ARRAY_LEN(gridConfigs); i++) {
             if ((gridConfigs[i].rows == rows) &&
                 (gridConfigs[i].columns == cols)) {
                 *grid_config_id = i;
@@ -1333,7 +1363,7 @@
         nvGpuPtr gpu;
         int num_displays = 0;
         int min_displays = 0;
-        GridConfig *grid;
+        int i;
         int num_valid = 0;
 
         for (gpu = layout->gpus; gpu; gpu = gpu->next_in_layout) {
@@ -1341,7 +1371,9 @@
         }
 
         /* Mark configs that have enough displays as valid */
-        for (grid = gridConfigs; grid->rows; grid++) {
+        for (i = 0; i < ARRAY_LEN(gridConfigs); i++) {
+            GridConfig *grid = &(gridConfigs[i]);
+
             if (!min_displays ||
                 (min_displays > (grid->rows * grid->columns))) {
                 min_displays = grid->rows * grid->columns;
@@ -1351,7 +1383,7 @@
                 num_valid++;
             }
         }
-        
+
         /* Make sure we have enough dislays for the minimum config */
         if (num_valid <= 0) {
             err_str = g_strdup_printf("Not enough display devices to "
@@ -1476,7 +1508,7 @@
 
     grid_menu_selected_id = 0;
     count = 0;
-    for (iter = 0; gridConfigs[iter].rows; iter++) {
+    for (iter = 0; iter < ARRAY_LEN(gridConfigs); iter++) {
         /* Don't show invalid configs */
         if (!gridConfigs[iter].valid) continue;
         tmp = g_strdup_printf("%d x %d grid",
diff -Nru nvidia-settings-302.17/src/gtk+-2.x/ctkwindow.c nvidia-settings-304.37/src/gtk+-2.x/ctkwindow.c
--- nvidia-settings-302.17/src/gtk+-2.x/ctkwindow.c	2012-06-13 04:51:30.000000000 +0200
+++ nvidia-settings-304.37/src/gtk+-2.x/ctkwindow.c	2012-08-09 06:04:20.000000000 +0200
@@ -119,6 +119,7 @@
 
 static void add_display_devices(CtkWindow *ctk_window, GtkTreeIter *iter,
                                 NvCtrlAttributeHandle *handle,
+                                CtkEvent *ctk_event,
                                 GtkTextTagTable *tag_table,
                                 UpdateDisplaysData *data);
 
@@ -561,7 +562,7 @@
     /* create the container widget for the "pages" */
 
     hbox = gtk_hbox_new(FALSE, 0);
-    gtk_paned_pack2(GTK_PANED(hpane), hbox, TRUE, TRUE);
+    gtk_paned_pack2(GTK_PANED(hpane), hbox, TRUE, FALSE);
 
     ctk_window->page_viewer = hbox;
     ctk_window->page = NULL;
@@ -858,7 +859,8 @@
                          G_CALLBACK(update_display_devices),
                          (gpointer) data);
 
-        add_display_devices(ctk_window, &iter, gpu_handle, tag_table, data);
+        add_display_devices(ctk_window, &iter, gpu_handle, ctk_event, tag_table,
+                            data);
     }
 
     /* add the per-vcs (e.g. Quadro Plex) entries into the tree model */
@@ -1349,6 +1351,7 @@
 
 static void add_display_devices(CtkWindow *ctk_window, GtkTreeIter *iter,
                                 NvCtrlAttributeHandle *gpu_handle,
+                                CtkEvent *ctk_event_gpu,
                                 GtkTextTagTable *tag_table,
                                 UpdateDisplaysData *data)
 {
@@ -1439,6 +1442,7 @@
                    (strcmp(typeBaseName, "CRT") == 0)) {
             widget = ctk_display_device_new(display_handle,
                                             ctk_window->ctk_config, ctk_event,
+                                            ctk_event_gpu,
                                             title, typeBaseName);
             help = ctk_display_device_create_help(tag_table,
                                                   CTK_DISPLAY_DEVICE(widget));
@@ -1482,6 +1486,7 @@
     gboolean parent_expanded;
     GtkTreeSelection *tree_selection =
         gtk_tree_view_get_selection(ctk_window->treeview);
+    GtkWidget *widget;
 
 
     /* Keep track if the parent row is expanded */
@@ -1496,7 +1501,6 @@
     while (data->num_displays) {
 
         GtkTreeIter *iter = &(data->display_iters[data->num_displays -1]);
-        GtkWidget *widget;
 
         /* Select the parent (GPU) iter if we're removing the selected page */
         if (gtk_tree_selection_iter_is_selected(tree_selection, iter)) {
@@ -1516,7 +1520,13 @@
     }
 
     /* Add back all the connected display devices */
-    add_display_devices(ctk_window, &parent_iter, gpu_handle, tag_table, data);
+
+    gtk_tree_model_get(GTK_TREE_MODEL(ctk_window->tree_store), &parent_iter,
+                       CTK_WINDOW_WIDGET_COLUMN, &widget, -1);
+
+    add_display_devices(ctk_window, &parent_iter, gpu_handle,
+                        CTK_GPU(widget)->ctk_event,
+                        tag_table, data);
 
     /* Expand the GPU entry if it used to be */
     if (parent_expanded) {
diff -Nru nvidia-settings-302.17/src/gtk+-2.x/ctkxvideo.c nvidia-settings-304.37/src/gtk+-2.x/ctkxvideo.c
--- nvidia-settings-302.17/src/gtk+-2.x/ctkxvideo.c	2012-06-13 04:51:30.000000000 +0200
+++ nvidia-settings-304.37/src/gtk+-2.x/ctkxvideo.c	2012-08-09 06:04:20.000000000 +0200
@@ -18,6 +18,7 @@
  */
 
 #include <stdlib.h>
+#include <stdio.h>
 #include <gtk/gtk.h>
 #include "NvCtrlAttributes.h"
 
@@ -29,58 +30,9 @@
 #include "ctkhelp.h"
 
 
-static const char *__xv_overlay_saturation_help =
-"The Video Overlay Saturation slider controls "
-"the saturation level for the Overlay Xv Adaptor.";
-
-static const char *__xv_overlay_contrast_help =
-"The Video Overlay Contrast slider controls "
-"the contrast level for the Overlay Xv Adaptor.";
-
-static const char *__xv_overlay_brightness_help =
-"The Video Overlay Brightness slider controls "
-"the brightness level for the Overlay Xv Adaptor.";
-
-static const char *__xv_overlay_hue_help =
-"The Video Overlay Hue slider controls "
-"the hue level for the Overlay Xv Adaptor.";
-
-static const char *__xv_texture_sync_to_vblank_help =
-"The Video Texture Sync To VBlank checkbox "
-"toggles syncing XvPutVideo(3X) and XvPutStill(3X) to "
-"the vertical retrace of your display device "
-"for the Texture Xv Adaptor.";
-
-static const char *__xv_texture_contrast_help =
-"The Video Texture Contrast slider controls "
-"the contrast level for the Texture Xv Adaptor.";
-
-static const char *__xv_texture_brightness_help =
-"The Video Texture Brightness slider controls "
-"the brightness level for the Texture Xv Adaptor.";
-
-static const char *__xv_texture_hue_help =
-"The Video Texture Hue slider controls "
-"the hue level for the Texture Xv Adaptor.";
-
-static const char *__xv_texture_saturation_help =
-"The Video Texture Saturation slider controls "
-"the saturation level for the Texture Xv Adaptor.";
-
-static const char *__xv_blitter_sync_to_vblank_help =
-"The Video Blitter Sync To VBlank checkbox "
-"toggles syncing XvPutVideo(3X) and XvPutStill(3X) to "
-"the vertical retrace of your display device "
-"for the Blitter Xv Adaptor.";
-
 static const char *__xv_sync_to_display_help =
 "This controls which display device will be synched to when "
 "XVideo Sync To VBlank is enabled.";
- 
-static const char *__reset_button_help =
-"The Reset Hardware Defaults button restores "
-"the XVideo settings to their default values.";
-
 
 static void xv_sync_to_display_changed(GtkWidget *widget, gpointer user_data);
 
@@ -98,45 +50,6 @@
 static void xv_sync_to_display_update_received(GtkObject *object, gpointer arg1,
                                                gpointer user_data);
 
-static GtkWidget *create_slider(CtkXVideo *ctk_xvideo,
-                                GtkWidget *vbox,
-                                GtkWidget *button,
-                                const gchar *name,
-                                const char *help,
-                                gint attribute,
-                                unsigned int bit);
-
-static void reset_slider(CtkXVideo *ctk_xvideo,
-                         GtkWidget *slider,
-                         gint attribute);
-
-static void slider_changed(GtkAdjustment *adjustment, gpointer user_data);
-
-static GtkWidget *create_check_button(CtkXVideo *ctk_xvideo,
-                                      GtkWidget *vbox,
-                                      GtkWidget *button,
-                                      const gchar *name,
-                                      const char *help,
-                                      gint attribute,
-                                      unsigned int bit);
-
-static void check_button_toggled(GtkWidget *widget, gpointer user_data);
-
-
-static void post_check_button_toggled(CtkXVideo *ctk_xvideo,
-                                      gchar *str,
-                                      gboolean enabled);
-
-static void sensitize_radio_buttons(CtkXVideo *ctk_xvideo);
-
-static void reset_check_button(CtkXVideo *ctk_xvideo,
-                               GtkWidget *check_button,
-                               gint attribute);
-
-static void set_button_sensitive(GtkButton *button);
-
-static void reset_defaults(GtkButton *button, gpointer user_data);
-
 static void post_xv_sync_to_display_changed(CtkXVideo *ctk_xvideo,
                                             gboolean enabled,
                                             gchar *label);
@@ -150,18 +63,7 @@
 #define FRAME_PADDING 5
 
 
-#define __XV_OVERLAY_SATURATION     (1 << 1)
-#define __XV_OVERLAY_CONTRAST       (1 << 2)
-#define __XV_OVERLAY_BRIGHTNESS     (1 << 3)
-#define __XV_OVERLAY_HUE            (1 << 4)
-#define __XV_TEXTURE_SYNC_TO_VBLANK (1 << 5)
-#define __XV_TEXTURE_CONTRAST       (1 << 6)
-#define __XV_TEXTURE_BRIGHTNESS     (1 << 7)
-#define __XV_TEXTURE_SATURATION     (1 << 8)
-#define __XV_TEXTURE_HUE            (1 << 9)
-#define __XV_BLITTER_SYNC_TO_VBLANK (1 << 10)
-#define __XV_SYNC_TO_DISPLAY        (1 << 11)
-
+#define __XV_SYNC_TO_DISPLAY 1
 
 
 GType ctk_xvideo_get_type(
@@ -370,7 +272,6 @@
         if (mask & remove_devices_mask)
             xv_sync_to_display_radio_button_remove(ctk_xvideo, mask);
      }
-     sensitize_radio_buttons(ctk_xvideo);
      gtk_widget_show_all(ctk_xvideo->xv_sync_to_display_button_box);
 } /* nv_ctrl_enabled_displays() */
 
@@ -472,10 +373,7 @@
     GtkWidget *banner;
     GtkWidget *frame;
     GtkWidget *alignment;
-    GtkWidget *hbox;
-    GtkWidget *label;
     GtkWidget *vbox;
-    GtkWidget *button;
     int sync_mask;
     int xv_overlay_present, xv_texture_present, xv_blitter_present;
     ReturnStatus ret;
@@ -517,127 +415,11 @@
     gtk_box_set_spacing(GTK_BOX(ctk_xvideo), 10);
     
     
-    /* Create button, but don't pack it, yet */
-
-    label = gtk_label_new("Reset Hardware Defaults");
-    hbox = gtk_hbox_new(FALSE, 0);
-    button = gtk_button_new();
-
-    gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 15);
-    gtk_container_add(GTK_CONTAINER(button), hbox);
-    
-    g_signal_connect(G_OBJECT(button), "clicked",
-                     G_CALLBACK(reset_defaults), (gpointer) ctk_xvideo);
-    
-    ctk_config_set_tooltip(ctk_config, button, __reset_button_help);
-    
     /* Video film banner */
     
     banner = ctk_banner_image_new(BANNER_ARTWORK_XVIDEO);
     gtk_box_pack_start(GTK_BOX(object), banner, FALSE, FALSE, 0);
 
-    
-    /* XVideo Overlay sliders */
-    
-    if (xv_overlay_present) {
-        
-        frame = gtk_frame_new("Video Overlay Adaptor");
-        gtk_box_pack_start(GTK_BOX(object), frame, FALSE, FALSE, 0);
-        
-        vbox = gtk_vbox_new(FALSE, 5);
-        gtk_container_set_border_width(GTK_CONTAINER(vbox), FRAME_PADDING);
-        gtk_container_add(GTK_CONTAINER(frame), vbox);
-        
-        ctk_xvideo->overlay_saturation =
-            create_slider(ctk_xvideo, vbox, button, "Saturation",
-                          __xv_overlay_saturation_help,
-                          NV_CTRL_ATTR_XV_OVERLAY_SATURATION,
-                          __XV_OVERLAY_SATURATION);
-        
-        ctk_xvideo->overlay_contrast =
-            create_slider(ctk_xvideo, vbox, button, "Contrast",
-                          __xv_overlay_contrast_help,
-                          NV_CTRL_ATTR_XV_OVERLAY_CONTRAST,
-                          __XV_OVERLAY_CONTRAST);
-        
-        ctk_xvideo->overlay_brightness =
-            create_slider(ctk_xvideo, vbox, button, "Brightness",
-                          __xv_overlay_brightness_help,
-                          NV_CTRL_ATTR_XV_OVERLAY_BRIGHTNESS,
-                          __XV_OVERLAY_BRIGHTNESS);
-        
-        ctk_xvideo->overlay_hue =
-            create_slider(ctk_xvideo, vbox, button, "Hue",
-                          __xv_overlay_hue_help,
-                          NV_CTRL_ATTR_XV_OVERLAY_HUE,
-                          __XV_OVERLAY_HUE);
-    }
-
-    /* XVideo Texture */
-
-    if (xv_texture_present) {
-        
-        frame = gtk_frame_new("Video Texture Adaptor");
-        gtk_box_pack_start(GTK_BOX(object), frame, FALSE, FALSE, 0);
-        
-        vbox = gtk_vbox_new(FALSE, 5);
-        gtk_container_set_border_width(GTK_CONTAINER(vbox), FRAME_PADDING);
-        gtk_container_add(GTK_CONTAINER(frame), vbox);
-        
-        ctk_xvideo->texture_sync_to_blank =
-            create_check_button(ctk_xvideo, vbox, button, "Sync to VBlank",
-                                __xv_texture_sync_to_vblank_help,
-                                NV_CTRL_ATTR_XV_TEXTURE_SYNC_TO_VBLANK,
-                                __XV_TEXTURE_SYNC_TO_VBLANK);
-        
-        ctk_xvideo->texture_brightness =
-            create_slider(ctk_xvideo, vbox, button, "Brightness",
-                          __xv_texture_brightness_help,
-                          NV_CTRL_ATTR_XV_TEXTURE_BRIGHTNESS,
-                          __XV_TEXTURE_BRIGHTNESS);
-        
-        ctk_xvideo->texture_contrast =
-            create_slider(ctk_xvideo, vbox, button, "Contrast",
-                          __xv_texture_contrast_help,
-                          NV_CTRL_ATTR_XV_TEXTURE_CONTRAST,
-                          __XV_TEXTURE_CONTRAST);
-
-        ctk_xvideo->texture_hue =
-            create_slider(ctk_xvideo, vbox, button, "Hue",
-                          __xv_texture_hue_help,
-                          NV_CTRL_ATTR_XV_TEXTURE_HUE,
-                          __XV_TEXTURE_HUE);
-        
-        ctk_xvideo->texture_saturation =
-            create_slider(ctk_xvideo, vbox, button, "Saturation",
-                          __xv_texture_saturation_help,
-                          NV_CTRL_ATTR_XV_TEXTURE_SATURATION,
-                          __XV_TEXTURE_SATURATION);
-    
-    }
-    
-    /* XVideo Blitter */
-
-    if (xv_blitter_present) {
-
-        frame = gtk_frame_new("Video Blitter Adaptor Settings");
-        gtk_box_pack_start(GTK_BOX(object), frame, FALSE, FALSE, 0);
-        
-        vbox = gtk_vbox_new(FALSE, 5);
-        gtk_container_set_border_width(GTK_CONTAINER(vbox), FRAME_PADDING);
-        gtk_container_add(GTK_CONTAINER(frame), vbox);
-        
-        ctk_xvideo->blitter_sync_to_blank =
-            create_check_button(ctk_xvideo,
-                                vbox,
-                                button,
-                                "Sync to VBlank",
-                                __xv_blitter_sync_to_vblank_help,
-                                NV_CTRL_ATTR_XV_BLITTER_SYNC_TO_VBLANK,
-                                __XV_BLITTER_SYNC_TO_VBLANK);
-
-    }
-
     /* Sync to display selection */
     if (xv_texture_present || xv_blitter_present) {
         ret = NvCtrlGetAttribute(handle,
@@ -714,7 +496,6 @@
                                  CTK_EVENT_NAME(NV_CTRL_ENABLED_DISPLAYS),
                                  G_CALLBACK(nv_ctrl_enabled_displays),
                                  (gpointer) ctk_xvideo);
-                sensitize_radio_buttons(ctk_xvideo);
 
                 if (current != -1)
                     xv_sync_to_display_update_radio_buttons(ctk_xvideo, current);
@@ -723,11 +504,7 @@
         }
     }
     
-    /* Reset button */
-
-    sensitize_radio_buttons(ctk_xvideo);
     alignment = gtk_alignment_new(1, 1, 0, 0);
-    gtk_container_add(GTK_CONTAINER(alignment), button);
     gtk_box_pack_start(GTK_BOX(object), alignment, TRUE, TRUE, 0);
     
     /* finally, show the widget */
@@ -738,362 +515,6 @@
     
 } /* ctk_xvideo_new() */
 
-
-
-/*
- * create_slider() - 
- */
-
-static GtkWidget *create_slider(CtkXVideo *ctk_xvideo,
-                                GtkWidget *vbox,
-                                GtkWidget *button,
-                                const gchar *name,
-                                const char *help,
-                                gint attribute,
-                                unsigned int bit)
-{
-    GtkObject *adjustment;
-    GtkWidget *scale, *widget;
-    gint min, max, val, step_incr, page_incr;
-    NVCTRLAttributeValidValuesRec range;
-    ReturnStatus ret;
-    
-    /* get the attribute value */
-
-    ret = NvCtrlGetAttribute(ctk_xvideo->handle, attribute, &val);
-    
-    if (ret != NvCtrlSuccess) return NULL;
-    
-    /* get the range for the attribute */
-
-    NvCtrlGetValidAttributeValues(ctk_xvideo->handle, attribute, &range);
-
-    if (range.type != ATTRIBUTE_TYPE_RANGE) return NULL;
-    
-    min = range.u.range.min;
-    max = range.u.range.max;
-
-    step_incr = ((max) - (min))/250;
-    if (step_incr <= 0) step_incr = 1;
-    
-    page_incr = ((max) - (min))/25;
-    if (page_incr <= 0) page_incr = 1;
-
-    /* create the slider */
-    
-    adjustment = gtk_adjustment_new(val, min, max,
-                                    step_incr, page_incr, 0.0);
-
-    g_object_set_data(G_OBJECT(adjustment), "xvideo_attribute",
-                      GINT_TO_POINTER(attribute));
-
-    g_signal_connect(G_OBJECT(adjustment), "value_changed",
-                     G_CALLBACK(slider_changed),
-                     (gpointer) ctk_xvideo);
-
-    g_signal_connect_swapped(G_OBJECT(adjustment), "value_changed",
-                             G_CALLBACK(set_button_sensitive),
-                             (gpointer) button);
-
-    scale = ctk_scale_new(GTK_ADJUSTMENT(adjustment), name,
-                          ctk_xvideo->ctk_config, G_TYPE_INT);
-
-    gtk_box_pack_start(GTK_BOX(vbox), scale, TRUE, TRUE, 0);
-
-    ctk_xvideo->active_attributes |= bit;
-
-    widget = CTK_SCALE(scale)->gtk_scale;
-    
-    ctk_config_set_tooltip(ctk_xvideo->ctk_config, widget, help);
-
-    return scale;
-    
-} /* create_slider() */
-
-
-
-/*
- * reset_slider() - 
- */
-
-static void reset_slider(CtkXVideo *ctk_xvideo,
-                         GtkWidget *slider,
-                         gint attribute)
-{
-    GtkAdjustment *adjustment;
-    gint val;
-    
-    if (!slider) return;
-
-    adjustment = CTK_SCALE(slider)->gtk_adjustment;
-
-    NvCtrlGetAttribute(ctk_xvideo->handle, attribute, &val);
-    
-    g_signal_handlers_block_matched
-        (G_OBJECT(adjustment), G_SIGNAL_MATCH_FUNC, 0, 0, NULL,
-         G_CALLBACK(slider_changed), NULL);
-
-    gtk_adjustment_set_value(GTK_ADJUSTMENT(adjustment), val);
-    
-    g_signal_handlers_unblock_matched
-        (G_OBJECT(adjustment), G_SIGNAL_MATCH_FUNC, 0, 0, NULL,
-         G_CALLBACK(slider_changed), NULL);
-
-} /* reset_slider() */
-
-
-
-/*
- * slider_changed() -
- */
-
-static void slider_changed(GtkAdjustment *adjustment, gpointer user_data)
-{
-    CtkXVideo *ctk_xvideo = CTK_XVIDEO(user_data);
-    gint attribute, value;
-    gchar *str;
-    
-    user_data = g_object_get_data(G_OBJECT(adjustment), "xvideo_attribute");
-    attribute = GPOINTER_TO_INT(user_data);
-    value = (gint) adjustment->value;
-    
-    NvCtrlSetAttribute(ctk_xvideo->handle, attribute, value);
-
-    switch (attribute) {
-    case NV_CTRL_ATTR_XV_OVERLAY_SATURATION: str = "Overlay Saturation"; break;
-    case NV_CTRL_ATTR_XV_OVERLAY_CONTRAST:   str = "Overlay Contrast";   break;
-    case NV_CTRL_ATTR_XV_OVERLAY_BRIGHTNESS: str = "Overlay Brightness"; break;
-    case NV_CTRL_ATTR_XV_OVERLAY_HUE:        str = "Overlay Hue";        break;
-    case NV_CTRL_ATTR_XV_TEXTURE_CONTRAST:   str = "Texture Contrast";   break;
-    case NV_CTRL_ATTR_XV_TEXTURE_BRIGHTNESS: str = "Texture Brightness"; break;
-    case NV_CTRL_ATTR_XV_TEXTURE_HUE:        str = "Texture Hue";        break;
-    case NV_CTRL_ATTR_XV_TEXTURE_SATURATION: str = "Texture Saturation"; break;
-
-    default:
-        return;
-    }
-    
-    ctk_config_statusbar_message(ctk_xvideo->ctk_config,
-                                 "Set XVideo %s to %d.", str, value);
-    
-} /* slider_changed() */
-
-
-
-/*
- * create_check_button() - 
- */
-
-static GtkWidget *create_check_button(CtkXVideo *ctk_xvideo,
-                                      GtkWidget *vbox,
-                                      GtkWidget *button,
-                                      const gchar *name,
-                                      const char *help,
-                                      gint attribute,
-                                      unsigned int bit)
-{
-    GtkWidget *check_button;
-    ReturnStatus ret;
-    int val;
-    
-    /* get the attribute value */
-    
-    ret = NvCtrlGetAttribute(ctk_xvideo->handle, attribute, &val);
-    
-    if (ret != NvCtrlSuccess) return NULL;
-    
-    check_button = gtk_check_button_new_with_label(name);
-    
-    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_button), val);
-            
-    g_signal_connect(G_OBJECT(check_button), "toggled",
-                     G_CALLBACK(check_button_toggled),
-                     (gpointer) ctk_xvideo);
-
-    g_signal_connect_swapped(G_OBJECT(check_button), "toggled",
-                             G_CALLBACK(set_button_sensitive),
-                             (gpointer) button);
-
-    g_object_set_data(G_OBJECT(check_button), "xvideo_attribute",
-                      GINT_TO_POINTER(attribute));
-
-    ctk_config_set_tooltip(ctk_xvideo->ctk_config, check_button, name);
-
-    gtk_box_pack_start(GTK_BOX(vbox), check_button, FALSE, FALSE, 0);
-    
-    ctk_xvideo->active_attributes |= bit;
-
-    ctk_config_set_tooltip(ctk_xvideo->ctk_config, check_button, help);
-
-    return check_button;
-    
-} /* create_check_button() */
-
-
-
-/*
- * check_button_toggled() - 
- */
-
-static void check_button_toggled(GtkWidget *widget, gpointer user_data)
-{
-    CtkXVideo *ctk_xvideo = CTK_XVIDEO(user_data);
-    gint attribute, enabled;
-    gchar *str;
-    
-    user_data = g_object_get_data(G_OBJECT(widget), "xvideo_attribute");
-    attribute = GPOINTER_TO_INT(user_data);
-
-    enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
-    
-    NvCtrlSetAttribute(ctk_xvideo->handle, attribute, enabled);
-    
-    switch (attribute) {
-    case NV_CTRL_ATTR_XV_TEXTURE_SYNC_TO_VBLANK:
-        str = "Texture Sync To VBlank"; break;
-    case NV_CTRL_ATTR_XV_BLITTER_SYNC_TO_VBLANK:
-        str = "Blitter Sync To VBlank"; break;
-
-    default:
-        return;
-    }
-    sensitize_radio_buttons(ctk_xvideo);
-    post_check_button_toggled(ctk_xvideo, str, enabled);
-} /* check_button_toggled() */
-
-/*
- * post_check_button_toggled()
- */
-
-static void post_check_button_toggled(CtkXVideo *ctk_xvideo, gchar *str, gboolean enabled)
-{
-    ctk_config_statusbar_message(ctk_xvideo->ctk_config, "%s XVideo %s.",
-                                 enabled ? "Enabled" : "Disabled", str);
-} /* post_check_button_toggled() */
-
-/*
- * sensitize_radio_buttons()
- */
-static void sensitize_radio_buttons(CtkXVideo *ctk_xvideo)
-{
-    int i;
-    gboolean enabled;
-
-    if (!ctk_xvideo->blitter_sync_to_blank &&
-        !ctk_xvideo->texture_sync_to_blank) return;
-
-    enabled = FALSE;
-    if (ctk_xvideo->blitter_sync_to_blank) {
-        enabled |= gtk_toggle_button_get_active
-            (GTK_TOGGLE_BUTTON(ctk_xvideo->blitter_sync_to_blank));
-    }
-    if (ctk_xvideo->texture_sync_to_blank) {
-        enabled |= gtk_toggle_button_get_active
-            (GTK_TOGGLE_BUTTON(ctk_xvideo->texture_sync_to_blank));
-    }
-    for (i = 0; i < 24; i++) {
-        GtkWidget *b = ctk_xvideo->xv_sync_to_display_buttons[i];
-        if (!b) continue;
-        gtk_widget_set_sensitive(b, enabled);
-    }
-} /* sensitize_radio_buttons() */
-
-
-/*
- * reset_check_button() - 
- */
-
-static void reset_check_button(CtkXVideo *ctk_xvideo,
-                               GtkWidget *check_button,
-                               gint attribute)
-{
-    gint val;
-
-    if (!check_button) return;
-    
-    NvCtrlGetAttribute(ctk_xvideo->handle, attribute, &val);
-    
-    g_signal_handlers_block_matched
-        (G_OBJECT(check_button), G_SIGNAL_MATCH_FUNC, 0, 0, NULL,
-         G_CALLBACK(check_button_toggled), NULL);
-
-    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_button), val);
-
-    g_signal_handlers_unblock_matched
-        (G_OBJECT(check_button), G_SIGNAL_MATCH_FUNC, 0, 0, NULL,
-         G_CALLBACK(check_button_toggled), NULL);
-    sensitize_radio_buttons(ctk_xvideo);
-
-} /* reset_check_button() */
-
-
-
-static void set_button_sensitive(GtkButton *button)
-{
-    gtk_widget_set_sensitive(GTK_WIDGET(button), TRUE);
-}
-
-
-
-
-static void reset_defaults(GtkButton *button, gpointer user_data)
-{
-    CtkXVideo *ctk_xvideo = CTK_XVIDEO(user_data);
-    
-    /*
-     * XXX should we expose separate buttons for each adaptor's
-     * defaults?
-     */
-    
-    NvCtrlSetAttribute(ctk_xvideo->handle,
-                       NV_CTRL_ATTR_XV_OVERLAY_SET_DEFAULTS, 1);
-
-    NvCtrlSetAttribute(ctk_xvideo->handle,
-                       NV_CTRL_ATTR_XV_TEXTURE_SET_DEFAULTS, 1);
-    
-    NvCtrlSetAttribute(ctk_xvideo->handle,
-                       NV_CTRL_ATTR_XV_BLITTER_SET_DEFAULTS, 1);
-    
-
-    reset_slider(ctk_xvideo, ctk_xvideo->overlay_saturation,
-                 NV_CTRL_ATTR_XV_OVERLAY_SATURATION);
-    
-    reset_slider(ctk_xvideo, ctk_xvideo->overlay_contrast,
-                 NV_CTRL_ATTR_XV_OVERLAY_CONTRAST);
-    
-    reset_slider(ctk_xvideo, ctk_xvideo->overlay_brightness,
-                 NV_CTRL_ATTR_XV_OVERLAY_BRIGHTNESS);
-    
-    reset_slider(ctk_xvideo, ctk_xvideo->overlay_hue,
-                 NV_CTRL_ATTR_XV_OVERLAY_HUE);
-
-    reset_check_button(ctk_xvideo, ctk_xvideo->texture_sync_to_blank,
-                       NV_CTRL_ATTR_XV_TEXTURE_SYNC_TO_VBLANK);
-    
-    reset_slider(ctk_xvideo, ctk_xvideo->texture_contrast,
-                 NV_CTRL_ATTR_XV_TEXTURE_CONTRAST);
-    
-    reset_slider(ctk_xvideo, ctk_xvideo->texture_brightness,
-                 NV_CTRL_ATTR_XV_TEXTURE_BRIGHTNESS);
-
-    reset_slider(ctk_xvideo, ctk_xvideo->texture_hue,
-                 NV_CTRL_ATTR_XV_TEXTURE_HUE);
-
-    reset_slider(ctk_xvideo, ctk_xvideo->texture_saturation,
-                 NV_CTRL_ATTR_XV_TEXTURE_SATURATION);
-
-
-    reset_check_button(ctk_xvideo, ctk_xvideo->blitter_sync_to_blank,
-                       NV_CTRL_ATTR_XV_BLITTER_SYNC_TO_VBLANK);
-    
-
-    gtk_widget_set_sensitive(GTK_WIDGET(button), FALSE);
-
-    ctk_config_statusbar_message
-        (CTK_CONFIG(ctk_xvideo->ctk_config),
-         "Reset XVideo hardware defaults.");
-}
-
 GtkTextBuffer *ctk_xvideo_create_help(GtkTextTagTable *table,
                                       CtkXVideo *ctk_xvideo)
 {
@@ -1108,65 +529,12 @@
 
     ctk_help_para(b, &i, "The X Server XVideo Settings page uses the XVideo "
                   "X extension.");
-
-    if (ctk_xvideo->active_attributes & __XV_OVERLAY_SATURATION) {
-        ctk_help_heading(b, &i, "Video Overlay Saturation");
-        ctk_help_para(b, &i, __xv_overlay_saturation_help);
-    }
-    
-    if (ctk_xvideo->active_attributes & __XV_OVERLAY_CONTRAST) {
-        ctk_help_heading(b, &i, "Video Overlay Contrast");
-        ctk_help_para(b, &i, __xv_overlay_contrast_help);
-    }
-    
-    if (ctk_xvideo->active_attributes & __XV_OVERLAY_BRIGHTNESS) {   
-        ctk_help_heading(b, &i, "Video Overlay Brightness");
-        ctk_help_para(b, &i, __xv_overlay_brightness_help);
-    }
-    
-    if (ctk_xvideo->active_attributes & __XV_OVERLAY_HUE) {
-        ctk_help_heading(b, &i, "Video Overlay Hue");
-        ctk_help_para(b, &i, __xv_overlay_hue_help);
-    }
-    
-    if (ctk_xvideo->active_attributes & __XV_TEXTURE_SYNC_TO_VBLANK) {
-        ctk_help_heading(b, &i, "Video Texture Sync To VBlank");
-        ctk_help_para(b, &i, __xv_texture_sync_to_vblank_help);
-    }
-    
-    if (ctk_xvideo->active_attributes & __XV_TEXTURE_BRIGHTNESS) {   
-        ctk_help_heading(b, &i, "Video Texture Brightness");
-        ctk_help_para(b, &i, __xv_texture_brightness_help);
-    }
-
-    if (ctk_xvideo->active_attributes & __XV_TEXTURE_CONTRAST) {
-        ctk_help_heading(b, &i, "Video Texture Contrast");
-        ctk_help_para(b, &i, __xv_texture_contrast_help);
-    }
-    
-    if (ctk_xvideo->active_attributes & __XV_TEXTURE_HUE) {
-        ctk_help_heading(b, &i, "Video Texture Hue");
-        ctk_help_para(b, &i, __xv_texture_hue_help);
-    }
-    
-    if (ctk_xvideo->active_attributes & __XV_TEXTURE_SATURATION) {
-        ctk_help_heading(b, &i, "Video Texture Saturation");
-        ctk_help_para(b, &i, __xv_texture_saturation_help);
-    }
-
-    if (ctk_xvideo->active_attributes & __XV_BLITTER_SYNC_TO_VBLANK) {
-        ctk_help_heading(b, &i, "Video Blitter Sync To VBlank");
-        ctk_help_para(b, &i, __xv_blitter_sync_to_vblank_help);
-    }
     
     if (ctk_xvideo->active_attributes & __XV_SYNC_TO_DISPLAY) {
         ctk_help_heading(b, &i, "Sync to this display device");
         ctk_help_para(b, &i, __xv_sync_to_display_help);
     }
     
-    ctk_help_heading(b, &i, "Reset Hardware Defaults");
-    ctk_help_para(b, &i, __reset_button_help);
-
     ctk_help_finish(b);
 
     return b;
diff -Nru nvidia-settings-302.17/src/gtk+-2.x/ctkxvideo.h nvidia-settings-304.37/src/gtk+-2.x/ctkxvideo.h
--- nvidia-settings-302.17/src/gtk+-2.x/ctkxvideo.h	2012-06-13 04:51:37.000000000 +0200
+++ nvidia-settings-304.37/src/gtk+-2.x/ctkxvideo.h	2012-08-09 06:04:20.000000000 +0200
@@ -54,16 +54,6 @@
     NvCtrlAttributeHandle *handle;
     CtkConfig *ctk_config;
 
-    GtkWidget *overlay_saturation;
-    GtkWidget *overlay_contrast;
-    GtkWidget *overlay_brightness;
-    GtkWidget *overlay_hue;
-    GtkWidget *texture_contrast;
-    GtkWidget *texture_brightness;
-    GtkWidget *texture_hue;
-    GtkWidget *texture_saturation;
-    GtkWidget *texture_sync_to_blank;
-    GtkWidget *blitter_sync_to_blank;
     GtkWidget *xv_sync_to_display_buttons[24];
     GtkWidget *xv_sync_to_display_button_box;
     unsigned int active_attributes;
diff -Nru nvidia-settings-302.17/src/libXNVCtrl/NVCtrl.c nvidia-settings-304.37/src/libXNVCtrl/NVCtrl.c
--- nvidia-settings-302.17/src/libXNVCtrl/NVCtrl.c	2012-06-13 04:51:40.000000000 +0200
+++ nvidia-settings-304.37/src/libXNVCtrl/NVCtrl.c	2012-08-09 06:04:20.000000000 +0200
@@ -45,7 +45,9 @@
 #define NVCTRL_EXT_EXISTS              1
 #define NVCTRL_EXT_NEED_TARGET_SWAP    2
 #define NVCTRL_EXT_64_BIT_ATTRIBUTES   4
-#define NVCTRL_EXT_NEED_CHECK          (1 << (sizeof(XPointer) - 1))
+/* SetAttributeAndGetStatus supports target type other than X_SCREEN */
+#define NVCTRL_EXT_HAS_TARGET_SET_GET  8
+#define NVCTRL_EXT_NEED_CHECK          (~(uintptr_t)0)
 
 static XExtensionInfo _nvctrl_ext_info_data;
 static XExtensionInfo *nvctrl_ext_info = &_nvctrl_ext_info_data;
@@ -56,9 +58,12 @@
 #define XNVCTRLSimpleCheckExtension(dpy,i) \
   XextSimpleCheckExtension (dpy, i, nvctrl_extension_name)
 
-static int close_display();
 static uintptr_t version_flags(Display *dpy, XExtDisplayInfo *info);
-static Bool wire_to_event();
+static Bool wire_to_event(Display *dpy, XEvent *host, xEvent *wire);
+
+// This is needed to define nvctrl_extension_hooks
+static XEXT_GENERATE_CLOSE_DISPLAY (close_display, nvctrl_ext_info)
+
 static /* const */ XExtensionHooks nvctrl_extension_hooks = {
     NULL,                               /* create_gc */
     NULL,                               /* copy_gc */
@@ -79,8 +84,6 @@
                                    NV_CONTROL_EVENTS,
                                    (XPointer)NVCTRL_EXT_NEED_CHECK)
 
-static XEXT_GENERATE_CLOSE_DISPLAY (close_display, nvctrl_ext_info)
-
 /*
  * NV-CONTROL versions 1.8 and 1.9 pack the target_type and target_id
  * fields in reversed order.  In order to talk to one of these servers,
@@ -136,6 +139,9 @@
             if (major == 1 && (minor == 8 || minor == 9)) {
                 data |= NVCTRL_EXT_NEED_TARGET_SWAP;
             }
+            if ((major > 1) || ((major == 1) && (minor > 18))) {
+                data |= NVCTRL_EXT_HAS_TARGET_SET_GET;
+            }
             if ((major > 1) || ((major == 1) && (minor > 20))) {
                 data |= NVCTRL_EXT_64_BIT_ATTRIBUTES;
             }
@@ -291,10 +297,20 @@
     xnvCtrlSetAttributeAndGetStatusReq *req;
     xnvCtrlSetAttributeAndGetStatusReply rep;
     Bool success;
+    uintptr_t flags;
 
     if(!XextHasExtension(info))
         return False;
 
+    flags = version_flags(dpy, info);
+
+    if (!(flags & NVCTRL_EXT_EXISTS))
+        return False;
+
+    if (!(flags & NVCTRL_EXT_HAS_TARGET_SET_GET) &&
+        target_type != NV_CTRL_TARGET_TYPE_X_SCREEN)
+        return False;
+
     XNVCTRLCheckExtension (dpy, info, False);
 
     LockDisplay (dpy);
diff -Nru nvidia-settings-302.17/src/libXNVCtrl/NVCtrl.h nvidia-settings-304.37/src/libXNVCtrl/NVCtrl.h
--- nvidia-settings-302.17/src/libXNVCtrl/NVCtrl.h	2012-06-13 04:51:40.000000000 +0200
+++ nvidia-settings-304.37/src/libXNVCtrl/NVCtrl.h	2012-08-09 06:04:20.000000000 +0200
@@ -2276,14 +2276,15 @@
 
 /*
  * NV_CTRL_DISPLAYPORT_LINK_RATE - returns the negotiated lane bandwidth of the
- * DisplayPort main link.
+ * DisplayPort main link.  The numerical value of this attribute is the link
+ * rate in bps divided by 27000000.
  * This attribute is only available for DisplayPort flat panels.
  */
 
 #define NV_CTRL_DISPLAYPORT_LINK_RATE                           291 /* R-DG */
 #define NV_CTRL_DISPLAYPORT_LINK_RATE_DISABLED                  0x0
-#define NV_CTRL_DISPLAYPORT_LINK_RATE_1_62GBPS                  0x6
-#define NV_CTRL_DISPLAYPORT_LINK_RATE_2_70GBPS                  0xA
+#define NV_CTRL_DISPLAYPORT_LINK_RATE_1_62GBPS                  0x6 /* deprecated */
+#define NV_CTRL_DISPLAYPORT_LINK_RATE_2_70GBPS                  0xA /* deprecated */
 
 /*
  * NV_CTRL_STEREO_EYES_EXCHANGE - Controls whether or not the left and right
@@ -3184,8 +3185,27 @@
 #define NV_CTRL_DISPLAY_ENABLED_TRUE                              1
 #define NV_CTRL_DISPLAY_ENABLED_FALSE                             0
 
+/* 
+ * NV_CTRL_FRAMELOCK_INCOMING_HOUSE_SYNC_RATE: this is the rate 
+ * of an incomming house sync signal to the frame lock board, in milliHz.
+ *
+ * This attribute may be queried through XNVCTRLQueryTargetAttribute()
+ * using a NV_CTRL_TARGET_TYPE_FRAMELOCK or NV_CTRL_TARGET_TYPE_X_SCREEN
+ * target.
+ */
+#define NV_CTRL_FRAMELOCK_INCOMING_HOUSE_SYNC_RATE              389 /* R--F */
+
+/*
+ * NV_CTRL_FXAA - enables FXAA. A pixel shader based anti-  
+ * aliasing method.
+ */
+#define NV_CTRL_FXAA                                            390 /* RW-X */
+#define NV_CTRL_FXAA_DISABLE                                    0
+#define NV_CTRL_FXAA_ENABLE                                     1
+  
+
 
-#define NV_CTRL_LAST_ATTRIBUTE NV_CTRL_DISPLAY_ENABLED
+#define NV_CTRL_LAST_ATTRIBUTE NV_CTRL_FXAA
 
 /**************************************************************************/
 
@@ -3483,8 +3503,6 @@
  *                          the Monitor section of the X config file
  *             "option"   - HorizSync is from the "HorizSync" NVIDIA X
  *                          config option
- *             "twinview" - HorizSync is from the "SecondMonitorHorizSync"
- *                          NVIDIA X config option
  *             "builtin"  - HorizSync is from NVIDIA X driver builtin
  *                          default values
  *
@@ -3518,8 +3536,6 @@
  *                          the Monitor section of the X config file
  *             "option"   - VertRefresh is from the "VertRefresh" NVIDIA X
  *                          config option
- *             "twinview" - VertRefresh is from the "SecondMonitorVertRefresh"
- *                          NVIDIA X config option
  *             "builtin"  - VertRefresh is from NVIDIA X driver builtin
  *                          default values
  *
diff -Nru nvidia-settings-302.17/src/libXNVCtrl/NVCtrlLib.h nvidia-settings-304.37/src/libXNVCtrl/NVCtrlLib.h
--- nvidia-settings-302.17/src/libXNVCtrl/NVCtrlLib.h	2012-06-13 04:51:40.000000000 +0200
+++ nvidia-settings-304.37/src/libXNVCtrl/NVCtrlLib.h	2012-08-09 06:04:20.000000000 +0200
@@ -421,7 +421,8 @@
  *
  * Returns True if the attribute exists.  Returns False otherwise.  If
  * XNVCTRLQueryAttributePermissions returns True, permissions will
- * indicate the permission flags for the attribute.
+ * indicate the permission flags for the attribute.  It excludes read
+ * and write permissions.
  */
 
 Bool XNVCTRLQueryAttributePermissions (
Binary files /tmp/Qg3k7ptY12/nvidia-settings-302.17/src/libXNVCtrl/libXNVCtrl.a and /tmp/i7I93U9Xor/nvidia-settings-304.37/src/libXNVCtrl/libXNVCtrl.a differ
diff -Nru nvidia-settings-302.17/src/libXNVCtrlAttributes/NvCtrlAttributes.c nvidia-settings-304.37/src/libXNVCtrlAttributes/NvCtrlAttributes.c
--- nvidia-settings-302.17/src/libXNVCtrlAttributes/NvCtrlAttributes.c	2012-06-13 04:51:30.000000000 +0200
+++ nvidia-settings-304.37/src/libXNVCtrlAttributes/NvCtrlAttributes.c	2012-08-09 06:04:20.000000000 +0200
@@ -26,8 +26,6 @@
 
 #include "parse.h"
 
-#include <X11/extensions/xf86vmode.h>
-#include <X11/extensions/Xvlib.h>
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
@@ -531,9 +529,7 @@
 NvCtrlGetDisplayAttribute64(NvCtrlAttributeHandle *handle,
                             unsigned int display_mask, int attr, int64_t *val)
 {
-    ReturnStatus status;
     NvCtrlAttributePrivateHandle *h;
-    int value_32;
 
     h = (NvCtrlAttributePrivateHandle *) handle;
 
@@ -545,11 +541,11 @@
           case NV_CTRL_ATTR_EXT_VM_PRESENT:
             *val = (h->vm) ? True : False; break;
           case NV_CTRL_ATTR_EXT_XV_OVERLAY_PRESENT:
-            *val = (h->xv && h->xv->overlay) ? True : False; break;
+            *val = h->xv && h->xv->overlay; break;
           case NV_CTRL_ATTR_EXT_XV_TEXTURE_PRESENT:
-            *val = (h->xv && h->xv->texture) ? True : False; break;
+            *val = h->xv && h->xv->texture; break;
           case NV_CTRL_ATTR_EXT_XV_BLITTER_PRESENT:
-            *val = (h->xv && h->xv->blitter) ? True : False; break;
+            *val = h->xv && h->xv->blitter; break;
           default:
             return NvCtrlNoAttribute;
         }
@@ -563,13 +559,6 @@
         return NvCtrlNvControlGetAttribute(h, display_mask, attr, val);
     }
 
-    if ((attr >= NV_CTRL_ATTR_XV_BASE) &&
-        (attr <= NV_CTRL_ATTR_XV_LAST_ATTRIBUTE)) {
-        status = NvCtrlXvGetAttribute(h, attr, &value_32);
-        *val = value_32;
-        return status;
-    }
-
     return NvCtrlNoAttribute;
     
 } /* NvCtrlGetDisplayAttribute64() */
@@ -602,12 +591,6 @@
         return NvCtrlNvControlSetAttribute(h, display_mask, attr, val);
     }
 
-    if ((attr >= NV_CTRL_ATTR_XV_BASE) &&
-        (attr <= NV_CTRL_ATTR_XV_LAST_ATTRIBUTE)) {
-        
-        return NvCtrlXvSetAttribute(h, attr, val);
-    }
-
     return NvCtrlNoAttribute;
 
 } /* NvCtrlSetDisplayAttribute() */
@@ -666,12 +649,6 @@
                                                       attr, val);
     }
 
-    if ((attr >= NV_CTRL_ATTR_XV_BASE) &&
-        (attr <= NV_CTRL_ATTR_XV_LAST_ATTRIBUTE)) {
-
-        return NvCtrlXvGetValidAttributeValues(h, attr, val);
-    }
-    
     return NvCtrlNoAttribute;
     
 } /* NvCtrlGetValidDisplayAttributeValues() */
diff -Nru nvidia-settings-302.17/src/libXNVCtrlAttributes/NvCtrlAttributes.h nvidia-settings-304.37/src/libXNVCtrlAttributes/NvCtrlAttributes.h
--- nvidia-settings-302.17/src/libXNVCtrlAttributes/NvCtrlAttributes.h	2012-06-13 04:51:37.000000000 +0200
+++ nvidia-settings-304.37/src/libXNVCtrlAttributes/NvCtrlAttributes.h	2012-08-09 06:04:20.000000000 +0200
@@ -96,34 +96,10 @@
 #define NV_CTRL_ATTR_NV_LAST_ATTRIBUTE \
        (NV_CTRL_ATTR_NV_MINOR_VERSION)
 
-#define NV_CTRL_ATTR_XV_BASE \
-       (NV_CTRL_ATTR_NV_LAST_ATTRIBUTE + 1)
-
-#define NV_CTRL_ATTR_XV_OVERLAY_SATURATION      (NV_CTRL_ATTR_XV_BASE + 0)
-#define NV_CTRL_ATTR_XV_OVERLAY_CONTRAST        (NV_CTRL_ATTR_XV_BASE + 1)
-#define NV_CTRL_ATTR_XV_OVERLAY_BRIGHTNESS      (NV_CTRL_ATTR_XV_BASE + 2)
-#define NV_CTRL_ATTR_XV_OVERLAY_HUE             (NV_CTRL_ATTR_XV_BASE + 3)
-#define NV_CTRL_ATTR_XV_OVERLAY_SET_DEFAULTS    (NV_CTRL_ATTR_XV_BASE + 4)
-#define NV_CTRL_ATTR_XV_TEXTURE_SYNC_TO_VBLANK  (NV_CTRL_ATTR_XV_BASE + 5)
-#define NV_CTRL_ATTR_XV_TEXTURE_CONTRAST        (NV_CTRL_ATTR_XV_BASE + 6)
-#define NV_CTRL_ATTR_XV_TEXTURE_BRIGHTNESS      (NV_CTRL_ATTR_XV_BASE + 7)
-#define NV_CTRL_ATTR_XV_TEXTURE_SATURATION      (NV_CTRL_ATTR_XV_BASE + 8)
-#define NV_CTRL_ATTR_XV_TEXTURE_HUE             (NV_CTRL_ATTR_XV_BASE + 9)
-#define NV_CTRL_ATTR_XV_TEXTURE_SET_DEFAULTS    (NV_CTRL_ATTR_XV_BASE + 10)
-#define NV_CTRL_ATTR_XV_BLITTER_SYNC_TO_VBLANK  (NV_CTRL_ATTR_XV_BASE + 11)
-#define NV_CTRL_ATTR_XV_BLITTER_SET_DEFAULTS    (NV_CTRL_ATTR_XV_BASE + 12)
-
-
-#define NV_CTRL_ATTR_XV_LAST_ATTRIBUTE \
-       (NV_CTRL_ATTR_XV_BLITTER_SET_DEFAULTS)
-
-#define NV_CTRL_ATTR_XV_NUM \
-       (NV_CTRL_ATTR_XV_LAST_ATTRIBUTE - NV_CTRL_ATTR_XV_BASE + 1)
-
 /* GLX */
 
 #define NV_CTRL_ATTR_GLX_BASE \
-       (NV_CTRL_ATTR_XV_LAST_ATTRIBUTE + 1)
+       (NV_CTRL_ATTR_NV_LAST_ATTRIBUTE + 1)
 
 #define NV_CTRL_ATTR_GLX_FBCONFIG_ATTRIBS  (NV_CTRL_ATTR_GLX_BASE +  0)
 
diff -Nru nvidia-settings-302.17/src/libXNVCtrlAttributes/NvCtrlAttributesPrivate.h nvidia-settings-304.37/src/libXNVCtrlAttributes/NvCtrlAttributesPrivate.h
--- nvidia-settings-302.17/src/libXNVCtrlAttributes/NvCtrlAttributesPrivate.h	2012-06-13 04:51:37.000000000 +0200
+++ nvidia-settings-304.37/src/libXNVCtrlAttributes/NvCtrlAttributesPrivate.h	2012-08-09 06:04:20.000000000 +0200
@@ -23,7 +23,6 @@
 #include "NvCtrlAttributes.h"
 #include "NVCtrl.h"
 #include <GL/glx.h> /* GLX #defines */
-#include <X11/extensions/Xvlib.h> /* Xv */
 
 
 #define EXTENSION_NV_CONTROL  0x1
@@ -99,42 +98,12 @@
     float gamma[3];
 };
 
-struct __NvCtrlXvAttribute {
-    Atom atom;
-    NVCTRLAttributeValidValuesRec range;
-};
-
-struct __NvCtrlXvOverlayAttributes {
-    unsigned int port;
-    NvCtrlXvAttribute *saturation;
-    NvCtrlXvAttribute *contrast;
-    NvCtrlXvAttribute *brightness;
-    NvCtrlXvAttribute *hue;
-    NvCtrlXvAttribute *defaults;
-};
-
-struct __NvCtrlXvTextureAttributes {
-    unsigned int port;
-    NvCtrlXvAttribute *sync_to_vblank;
-    NvCtrlXvAttribute *contrast;
-    NvCtrlXvAttribute *brightness;
-    NvCtrlXvAttribute *hue;
-    NvCtrlXvAttribute *saturation;
-    NvCtrlXvAttribute *defaults;
-};
-
-struct __NvCtrlXvBlitterAttributes {
-    unsigned int port;
-    NvCtrlXvAttribute *sync_to_vblank;
-    NvCtrlXvAttribute *defaults;
-};
-
 struct __NvCtrlXvAttributes {
     unsigned int major_version;
     unsigned int minor_version;
-    NvCtrlXvOverlayAttributes *overlay; /* XVideo info (overlay) */
-    NvCtrlXvTextureAttributes *texture; /* XVideo info (texture) */
-    NvCtrlXvBlitterAttributes *blitter; /* XVideo info (blitter) */
+    Bool overlay; 
+    Bool texture;
+    Bool blitter;
 };
 
 struct __NvCtrlXrandrAttributes {
@@ -175,20 +144,9 @@
 NvCtrlXvAttributesClose (NvCtrlAttributePrivateHandle *);
 
 ReturnStatus
-NvCtrlXvGetAttribute (NvCtrlAttributePrivateHandle *, int, int *);
-
-ReturnStatus
-NvCtrlXvSetAttribute (NvCtrlAttributePrivateHandle *, int, int);
-
-ReturnStatus
 NvCtrlXvGetStringAttribute (NvCtrlAttributePrivateHandle *,
                            unsigned int, int, char **);
 
-ReturnStatus
-NvCtrlXvGetValidAttributeValues(NvCtrlAttributePrivateHandle *, int,
-                                NVCTRLAttributeValidValuesRec *);
-
-
 /* GLX extension attribute functions */
 
 Bool
diff -Nru nvidia-settings-302.17/src/libXNVCtrlAttributes/NvCtrlAttributesXv.c nvidia-settings-304.37/src/libXNVCtrlAttributes/NvCtrlAttributesXv.c
--- nvidia-settings-302.17/src/libXNVCtrlAttributes/NvCtrlAttributesXv.c	2012-06-13 04:51:30.000000000 +0200
+++ nvidia-settings-304.37/src/libXNVCtrlAttributes/NvCtrlAttributesXv.c	2012-08-09 06:04:20.000000000 +0200
@@ -28,18 +28,6 @@
 
 #include "msg.h"
 
-static NvCtrlXvAttribute *getXvAttribute (NvCtrlAttributePrivateHandle *,
-                                          XvPortID, const char *);
-
-static Bool checkAdaptor(NvCtrlAttributePrivateHandle *h,
-                         unsigned int attribute);
-
-static unsigned int getXvPort(NvCtrlAttributePrivateHandle *h,
-                              unsigned int attribute);
-
-static NvCtrlXvAttribute *getXvAttributePtr(NvCtrlAttributePrivateHandle *h,
-                                            unsigned int attribute);
-
 typedef struct __libXvInfoRec {
 
     /* libXv.so library handle */
@@ -47,9 +35,6 @@
     int   ref_count; /* # users of the library */
 
     /* libXv functions used */
-    int           (* XvGetPortAttribute)    (Display *, XvPortID, Atom, int *);
-    int           (* XvSetPortAttribute)    (Display *, XvPortID, Atom, int);
-    XvAttribute * (* XvQueryPortAttributes) (Display *, XvPortID, int *);
     int           (* XvQueryExtension)      (Display *, unsigned int *,
                                              unsigned int *, unsigned int *,
                                              unsigned int *, unsigned int *);
@@ -104,16 +89,6 @@
         NV_DLSYM(__libXv->handle, "XvQueryAdaptors");
     if ((error_str = dlerror()) != NULL) goto fail;
     
-    __libXv->XvGetPortAttribute =
-        NV_DLSYM(__libXv->handle, "XvGetPortAttribute");
-    if ((error_str = dlerror()) != NULL) goto fail;
-
-    __libXv->XvSetPortAttribute =
-        NV_DLSYM(__libXv->handle, "XvSetPortAttribute");
-    if ((error_str = dlerror()) != NULL) goto fail;
-    
-    __libXv->XvQueryPortAttributes =
-        NV_DLSYM(__libXv->handle, "XvQueryPortAttributes");
     if ((error_str = dlerror()) != NULL) goto fail;
 
 
@@ -208,9 +183,6 @@
                                     &event_base, &error_base);
     if (ret != Success) goto fail;
     
-    /* XXX do we have a minimum Xv version? */
-
-
     /* Get the list of adaptors */
     ret = __libXv->XvQueryAdaptors(h->dpy, RootWindow(h->dpy, h->target_id),
                                    &nadaptors, &ainfo);
@@ -221,111 +193,15 @@
         
         if ((strcmp(ainfo[i].name, "NV17 Video Overlay") == 0) ||
             (strcmp(ainfo[i].name, "NV10 Video Overlay") == 0)) {
-        
-            NvCtrlXvOverlayAttributes *attrs;
-            
-            attrs = malloc(sizeof(NvCtrlXvOverlayAttributes));
-            if ( !attrs ) {
-                error_str = "Out of memory.";
-                goto fail;
-            }
-        
-            attrs->port = ainfo[i].base_id;
-            attrs->saturation = getXvAttribute(h, attrs->port,
-                                               "XV_SATURATION");
-            attrs->contrast   = getXvAttribute(h, attrs->port,
-                                               "XV_CONTRAST");
-            attrs->brightness = getXvAttribute(h, attrs->port,
-                                               "XV_BRIGHTNESS");
-            attrs->hue        = getXvAttribute(h, attrs->port,
-                                               "XV_HUE");
-            attrs->defaults   = getXvAttribute(h, attrs->port,
-                                               "XV_SET_DEFAULTS");
-        
-            if (!attrs->saturation ||
-                !attrs->contrast ||
-                !attrs->brightness ||
-                !attrs->hue ||
-                !attrs->defaults) {
-
-                if (attrs->saturation) free(attrs->saturation);
-                if (attrs->contrast)   free(attrs->contrast);
-                if (attrs->brightness) free(attrs->brightness);
-                if (attrs->hue)        free(attrs->hue);
-                if (attrs->defaults)   free(attrs->defaults);
-                
-                free(attrs);
-                attrs = NULL;
-                
-            } else {
-                xv->overlay = attrs;
-            }
+            xv->overlay = True;
         }
 
         if (strcmp(ainfo[i].name, "NV17 Video Texture") == 0) {
-            
-            NvCtrlXvTextureAttributes *attrs;
-            
-            attrs = malloc(sizeof(NvCtrlXvTextureAttributes));
-            if ( !attrs ) {
-                error_str = "Out of memory.";
-                goto fail;
-            }
-
-            attrs->port = ainfo[i].base_id;
-            attrs->sync_to_vblank = getXvAttribute(h, attrs->port,
-                                                   "XV_SYNC_TO_VBLANK");
-            attrs->contrast       = getXvAttribute(h, attrs->port,
-                                                   "XV_CONTRAST");
-            attrs->brightness     = getXvAttribute(h, attrs->port,
-                                                   "XV_BRIGHTNESS");
-            attrs->saturation     = getXvAttribute(h, attrs->port,
-                                                   "XV_SATURATION");
-            attrs->hue            = getXvAttribute(h, attrs->port,
-                                                   "XV_HUE");
-            attrs->defaults       = getXvAttribute(h, attrs->port,
-                                                   "XV_SET_DEFAULTS");
-            if (!attrs->sync_to_vblank ||
-                !attrs->defaults) {
-                
-                if (attrs->sync_to_vblank) free(attrs->sync_to_vblank);
-                if (attrs->defaults)       free(attrs->defaults);
-                
-                free(attrs);
-                attrs = NULL;
-                
-            } else {
-                xv->texture = attrs;
-            }
+            xv->texture = True;
         }
 
         if (strcmp(ainfo[i].name, "NV05 Video Blitter") == 0) {
-            
-            NvCtrlXvBlitterAttributes *attrs;
-
-            attrs = malloc(sizeof(NvCtrlXvBlitterAttributes));
-            if ( !attrs ) {
-                error_str = "Out of memory.";
-                goto fail;
-            }
-
-            attrs->port = ainfo[i].base_id;
-            attrs->sync_to_vblank = getXvAttribute(h, attrs->port,
-                                                   "XV_SYNC_TO_VBLANK");
-            attrs->defaults       = getXvAttribute(h, attrs->port,
-                                                   "XV_SET_DEFAULTS");
-            if (!attrs->sync_to_vblank ||
-                !attrs->defaults) {
-                
-                if (attrs->sync_to_vblank) free(attrs->sync_to_vblank);
-                if (attrs->defaults)       free(attrs->defaults);
-                
-                free(attrs);
-                attrs = NULL;
-                
-            } else {
-                xv->blitter = attrs;
-            }
+            xv->blitter = True;
         }
     }
 
@@ -340,93 +216,14 @@
     if (warn_str) {
         nv_warning_msg("libXv setup warning: %s\n", warn_str);
     }
-    if (xv != NULL) {
-        if (xv->overlay) {
-            free(xv->overlay);
-        }
-        if (xv->texture) {
-            free(xv->texture);
-        }
-        if (xv->blitter) {
-            free(xv->blitter);
-        }
-        free(xv);
-    }
+
+    free(xv);
 
     return NULL;
 
 } /* NvCtrlInitXvAttributes() */
 
                       
-
-ReturnStatus NvCtrlXvGetAttribute(NvCtrlAttributePrivateHandle *h,
-                                  int attr, int *val)
-{
-    NvCtrlXvAttribute *a = NULL;
-    unsigned int port;
-
-    /* first, check that we have the necessary adaptor */
-    
-    if (!checkAdaptor(h, attr)) return NvCtrlAttributeNotAvailable;
-
-    /* get the attribute pointer */
-
-    a = getXvAttributePtr(h, attr);
-    if (!a) return NvCtrlAttributeNotAvailable;
-    
-    if (! (a->range.permissions & ATTRIBUTE_TYPE_READ))
-        return NvCtrlWriteOnlyAttribute;
-    
-    /* get the port */
-    
-    port = getXvPort(h, attr);
-    if (!port) return NvCtrlAttributeNotAvailable;
-
-    /* finally, query the value */
-    
-    if (__libXv->XvGetPortAttribute(h->dpy, port, a->atom, val) != Success) {
-        return NvCtrlError;
-    }
-    
-    return NvCtrlSuccess;
-    
-} /* NvCtrlXvGetAttribute() */
-
-
-
-ReturnStatus NvCtrlXvSetAttribute(NvCtrlAttributePrivateHandle *h,
-                                  int attr, int val)
-{
-    NvCtrlXvAttribute *a = NULL;
-    unsigned int port;
-
-    /* first, check that we have the necessary adaptor */
-    
-    if (!checkAdaptor(h, attr)) return NvCtrlAttributeNotAvailable;
-    
-    /* get the attribute pointer */
-    
-    a = getXvAttributePtr(h, attr);
-    if (!a) return NvCtrlAttributeNotAvailable;
-
-    /* get the port */
-    
-    port = getXvPort(h, attr);
-    if (!port) return NvCtrlAttributeNotAvailable;
-    
-    /* finally, set the value */
-    
-    if (__libXv->XvSetPortAttribute(h->dpy, port, a->atom, val) != Success) {
-        return NvCtrlError;
-    }
-    
-    XFlush(h->dpy);
-
-    return NvCtrlSuccess; 
-    
-} /* NvCtrlXvSetAttribute() */
-
-
 /*
  * Get Xv String Attribute values 
  */
@@ -457,226 +254,6 @@
 } /* NvCtrlXvGetStringAttribute() */
 
 
-ReturnStatus
-NvCtrlXvGetValidAttributeValues(NvCtrlAttributePrivateHandle *h, int attr,
-                                NVCTRLAttributeValidValuesRec *val)
-{
-    NvCtrlXvAttribute *a;
-
-    /* first, check that we have the necessary adaptor */
-    
-    if (!checkAdaptor(h, attr)) return NvCtrlAttributeNotAvailable;
-    
-    /* get the attribute pointer */
-    
-    a = getXvAttributePtr(h, attr);
-    if (!a) return NvCtrlAttributeNotAvailable;
-    
-    /* XXX should we force _SET_DEFAULTS to bool? */
-    
-    /* assign range and return */
-    
-    *val = a->range;
-
-    return NvCtrlSuccess;
-
-} /* NvCtrlXvGetValidAttributeValues() */
-
-
-
-/*
- * getXvAttribute() - loop through the attributes for the given port,
- * looking for the attribute specified by 'name'.  If the named
- * attribute is found, get its minimum and maximum values, and (if
- * possible) get its current value.  Return a malloced and initialized
- * NvCtrlXvAttribute struct if successful, otherwise return NULL.
- */
-
-static NvCtrlXvAttribute *getXvAttribute(NvCtrlAttributePrivateHandle *h,
-                                         XvPortID port,
-                                         const char *name)
-{
-    NvCtrlXvAttribute *attr = NULL;
-    XvAttribute *attributes = NULL;
-    int i, n;
-    
-    attributes = __libXv->XvQueryPortAttributes(h->dpy, port, &n);
-
-    if (!attributes || !n) goto failed;
-    
-    for (i = 0; i < n; i++) {
-        if (strcmp(attributes[i].name, name) != 0) continue;
-
-        attr = malloc(sizeof(NvCtrlXvAttribute));
-        attr->range.type = ATTRIBUTE_TYPE_RANGE;
-        attr->range.u.range.min = attributes[i].min_value;
-        attr->range.u.range.max = attributes[i].max_value;
-        attr->atom = XInternAtom(h->dpy, name, True);
-        if (attr->atom == None) goto failed;
-        
-        if (! (attributes[i].flags & XvSettable)) goto failed;
-        
-        attr->range.permissions = ATTRIBUTE_TYPE_WRITE;
-        
-        if (attributes[i].flags & XvGettable) {
-            attr->range.permissions |= ATTRIBUTE_TYPE_READ;
-        }
-        
-        /* All Xv attributes are controlled with X screen target type */
-
-        attr->range.permissions |= ATTRIBUTE_TYPE_X_SCREEN;
-
-        break;
-    }
-
-    if (attributes) XFree(attributes);
-
-    return attr;
-
- failed:
-    if (attr) free(attr);
-    if (attributes) XFree(attributes);
-    return NULL;
-
-} /* getXvAttribute() */
-
-
-
-/*
- * checkAdaptor() - check that the handle has data for the adaptor
- * needed for the specified attribute.
- */
-
-static Bool checkAdaptor(NvCtrlAttributePrivateHandle *h,
-                         unsigned int attribute)
-{
-    
-    switch(attribute) {
-        
-    case NV_CTRL_ATTR_XV_OVERLAY_SATURATION:
-    case NV_CTRL_ATTR_XV_OVERLAY_CONTRAST:
-    case NV_CTRL_ATTR_XV_OVERLAY_BRIGHTNESS:
-    case NV_CTRL_ATTR_XV_OVERLAY_HUE:
-    case NV_CTRL_ATTR_XV_OVERLAY_SET_DEFAULTS:    
-        if (h && h->xv && h->xv->overlay) return True;
-        else return False;
-    
-    case NV_CTRL_ATTR_XV_TEXTURE_SYNC_TO_VBLANK:
-    case NV_CTRL_ATTR_XV_TEXTURE_CONTRAST:
-    case NV_CTRL_ATTR_XV_TEXTURE_BRIGHTNESS:
-    case NV_CTRL_ATTR_XV_TEXTURE_HUE:
-    case NV_CTRL_ATTR_XV_TEXTURE_SATURATION:
-    case NV_CTRL_ATTR_XV_TEXTURE_SET_DEFAULTS:
-        if (h && h->xv && h->xv->texture) return True;
-        else return False;
-    case NV_CTRL_ATTR_XV_BLITTER_SYNC_TO_VBLANK:
-    case NV_CTRL_ATTR_XV_BLITTER_SET_DEFAULTS:
-        if (h && h->xv && h->xv->blitter) return True;
-        else return False;
-        
-    default:
-        return False;
-    }
-} /* checkAdaptor() */
-
-
-
-/*
- * look up the port number for the adaptor for the attribute
- * specified; returns 0 if the attribute/adaptor is not available.
- */
-
-static unsigned int getXvPort(NvCtrlAttributePrivateHandle *h,
-                              unsigned int attribute)
-{
-    if (!checkAdaptor(h, attribute)) return 0;
-
-    switch(attribute) {
-        
-    case NV_CTRL_ATTR_XV_OVERLAY_SATURATION:
-    case NV_CTRL_ATTR_XV_OVERLAY_CONTRAST:
-    case NV_CTRL_ATTR_XV_OVERLAY_BRIGHTNESS:
-    case NV_CTRL_ATTR_XV_OVERLAY_HUE:
-    case NV_CTRL_ATTR_XV_OVERLAY_SET_DEFAULTS:
-        return h->xv->overlay->port;
-        
-    case NV_CTRL_ATTR_XV_TEXTURE_SYNC_TO_VBLANK:
-    case NV_CTRL_ATTR_XV_TEXTURE_CONTRAST:
-    case NV_CTRL_ATTR_XV_TEXTURE_BRIGHTNESS:
-    case NV_CTRL_ATTR_XV_TEXTURE_HUE:
-    case NV_CTRL_ATTR_XV_TEXTURE_SATURATION:
-    case NV_CTRL_ATTR_XV_TEXTURE_SET_DEFAULTS:
-        return h->xv->texture->port;
-        
-    case NV_CTRL_ATTR_XV_BLITTER_SYNC_TO_VBLANK:
-    case NV_CTRL_ATTR_XV_BLITTER_SET_DEFAULTS:
-        return h->xv->blitter->port;
-        
-    default:
-        return 0;
-    }
-} /* getXvPort() */
-
-
-
-/*
- * getXvAttributePtr() - return the NvCtrlXvAttribute pointer for the
- * specified attribute; or NULL if that attribute is not available.
- */
-
-static NvCtrlXvAttribute *getXvAttributePtr(NvCtrlAttributePrivateHandle *h,
-                                            unsigned int attribute)
-{
-    if (!checkAdaptor(h, attribute)) return NULL;
-    
-    switch (attribute) {
-        
-    case NV_CTRL_ATTR_XV_OVERLAY_SATURATION:
-        return h->xv->overlay->saturation;
-        
-    case NV_CTRL_ATTR_XV_OVERLAY_CONTRAST:
-        return h->xv->overlay->contrast;
-        
-    case NV_CTRL_ATTR_XV_OVERLAY_BRIGHTNESS:
-        return h->xv->overlay->brightness;
-        
-    case NV_CTRL_ATTR_XV_OVERLAY_HUE:
-        return h->xv->overlay->hue;
-        
-    case NV_CTRL_ATTR_XV_TEXTURE_SYNC_TO_VBLANK:
-        return h->xv->texture->sync_to_vblank;
-        
-    case NV_CTRL_ATTR_XV_TEXTURE_CONTRAST:
-        return h->xv->texture->contrast;
-    
-    case NV_CTRL_ATTR_XV_TEXTURE_BRIGHTNESS:
-        return h->xv->texture->brightness;
-
-    case NV_CTRL_ATTR_XV_TEXTURE_HUE:
-        return h->xv->texture->hue;
-    
-    case NV_CTRL_ATTR_XV_TEXTURE_SATURATION:
-        return h->xv->texture->saturation;
-
-    case NV_CTRL_ATTR_XV_BLITTER_SYNC_TO_VBLANK:
-        return h->xv->blitter->sync_to_vblank;
-        
-    case NV_CTRL_ATTR_XV_OVERLAY_SET_DEFAULTS:
-        return h->xv->overlay->defaults;
-    
-    case NV_CTRL_ATTR_XV_TEXTURE_SET_DEFAULTS:
-        return h->xv->texture->defaults;
-
-    case NV_CTRL_ATTR_XV_BLITTER_SET_DEFAULTS:
-        return h->xv->blitter->defaults;
-
-    default:
-        return NULL;
-    }
-} /* getXvAttributePtr() */
-
-
-
 /*
  * Frees and relinquishes any resource used by the Xv Attributes
  */
@@ -690,16 +267,6 @@
 
     close_libxv();
 
-    if (h->xv->overlay) {
-        free(h->xv->overlay);
-    }
-    if (h->xv->texture) {
-        free(h->xv->texture);
-    }
-    if (h->xv->blitter) {
-        free(h->xv->blitter);
-    }
-
     free(h->xv);
     h->xv = NULL;
 
diff -Nru nvidia-settings-302.17/src/parse.c nvidia-settings-304.37/src/parse.c
--- nvidia-settings-302.17/src/parse.c	2012-06-13 04:51:30.000000000 +0200
+++ nvidia-settings-304.37/src/parse.c	2012-08-09 06:04:20.000000000 +0200
@@ -94,7 +94,7 @@
     { "CursorShadowXOffset",           NV_CTRL_CURSOR_SHADOW_X_OFFSET,            0,     "Hardware cursor shadow X offset." },
     { "CursorShadowYOffset",           NV_CTRL_CURSOR_SHADOW_Y_OFFSET,            0,     "Hardware cursor shadow Y offset." },
     { "AssociatedDisplays",            NV_CTRL_ASSOCIATED_DISPLAY_DEVICES,        N|D,   "Display device mask indicating which display devices are \"associated\" with the specified X screen (i.e., are available for displaying the desktop)." },
-    { "ProbeDisplays",                 NV_CTRL_PROBE_DISPLAYS,                    A,     "When this attribute is queried, the X driver re-probes the hardware to detect which display devices are connected to the GPU or DPU driving the specified X screen.  Returns a display mask of the currently connected display devices." },
+    { "ProbeDisplays",                 NV_CTRL_PROBE_DISPLAYS,                    A|D,   "When this attribute is queried, the X driver re-probes the hardware to detect which display devices are connected to the GPU or DPU driving the specified X screen.  Returns a display mask of the currently connected display devices." },
     { "InitialPixmapPlacement",        NV_CTRL_INITIAL_PIXMAP_PLACEMENT,          N,     "Controls where X pixmaps are initially created." },
     { "DynamicTwinview",               NV_CTRL_DYNAMIC_TWINVIEW,                  N,     "Does the X screen support dynamic TwinView." },
     { "MultiGpuDisplayOwner",          NV_CTRL_MULTIGPU_DISPLAY_OWNER,            N,     "GPU ID of the GPU that has the display device(s) used for showing the X screen." },
@@ -114,11 +114,12 @@
     /* OpenGL */
     { "SyncToVBlank",               NV_CTRL_SYNC_TO_VBLANK,                   0,   "Enables sync to vertical blanking for OpenGL clients.  This setting only takes effect on OpenGL clients started after it is set." },
     { "LogAniso",                   NV_CTRL_LOG_ANISO,                        0,   "Enables anisotropic filtering for OpenGL clients; on some NVIDIA hardware, this can only be enabled or disabled; on other hardware different levels of anisotropic filtering can be specified.  This setting only takes effect on OpenGL clients started after it is set." },
-    { "FSAA",                       NV_CTRL_FSAA_MODE,                        0,   "The full screen antialiasing setting for OpenGL clients.  This setting only takes effect on OpenGL clients started after it is set." },
+    { "FSAA",                       NV_CTRL_FSAA_MODE,                        0,   "The full screen antialiasing setting for OpenGL clients.  This setting only takes effect on OpenGL clients started after it is set. Enabling antialiasing will disable FXAA." },
     { "TextureSharpen",             NV_CTRL_TEXTURE_SHARPEN,                  0,   "Enables texture sharpening for OpenGL clients.  This setting only takes effect on OpenGL clients started after it is set." },
     { "ForceGenericCpu",            NV_CTRL_FORCE_GENERIC_CPU,                N,   "Inhibit the use of CPU-specific features such as MMX, SSE, or 3DNOW! for OpenGL clients; this option may result in performance loss, but may be useful in conjunction with software such as the Valgrind memory debugger.  This setting only takes effect on OpenGL clients started after it is set." },
     { "GammaCorrectedAALines",      NV_CTRL_OPENGL_AA_LINE_GAMMA,             0,   "For OpenGL clients, allow gamma-corrected antialiased lines to consider variances in the color display capabilities of output devices when rendering smooth lines.  Only available on recent Quadro GPUs.  This setting only takes effect on OpenGL clients started after it is set." },
     { "TextureClamping",            NV_CTRL_TEXTURE_CLAMPING,                 0,   "Define the behavior of OpenGL texture clamping for unbordered textures.  If enabled (1), the conformant behavior is used.  If disabled (0), GL_CLAMP is remapped to GL_CLAMP_TO_EDGE to avoid seams in applications that rely on this behavior, which was the only option in some very old hardware." },
+    { "FXAA",                       NV_CTRL_FXAA,                             0,   "Enables or disables the use of FXAA, Fast Approximate Anti-Aliasing. Enabling FXAA will disable regular antialiasing modes." },
 
     { "AllowFlipping",              NV_CTRL_FLIPPING_ALLOWED,                 0,   "Defines the swap behavior of OpenGL.  When 1, OpenGL will swap by flipping when possible;  When 0, OpenGL will always swap by blitting." },
     { "FSAAAppControlled",          NV_CTRL_FSAA_APPLICATION_CONTROLLED,      0,   "When Application Control for FSAA is enabled, then what the application requests is used, and the FSAA attribute is ignored.  If this is disabled, then any application setting is overridden with the FSAA attribute." },
@@ -208,6 +209,7 @@
     { "FrameLockFPGARevision", NV_CTRL_FRAMELOCK_FPGA_REVISION,     N|F|G,   "Returns the FPGA revision of the Frame Lock device." },
     { "FrameLockSyncRate4",    NV_CTRL_FRAMELOCK_SYNC_RATE_4,       N|F|G,   "Returns the refresh rate that the frame lock board is sending to the GPU in 1/10000 Hz (i.e., to get the refresh rate in Hz, divide the returned value by 10000)." },
     { "FrameLockSyncDelayResolution", NV_CTRL_FRAMELOCK_SYNC_DELAY_RESOLUTION, N|F|G, "Returns the number of nanoseconds that one unit of FrameLockSyncDelay corresponds to." },
+    { "FrameLockIncomingHouseSyncRate", NV_CTRL_FRAMELOCK_INCOMING_HOUSE_SYNC_RATE, N|F|G, "Returns the rate of the incoming house sync signal to the frame lock board, in mHz (Millihertz) (i.e., to get the house sync rate in Hz, divide the returned value by 1000)." },
 
     /* GVO */
     { "GvoSupported",                    NV_CTRL_GVO_SUPPORTED,                        I|N,   "Returns whether this X screen supports GVO; if this screen does not support GVO output, then all other GVO attributes are unavailable." },
@@ -313,17 +315,6 @@
     { "TVSaturation",    NV_CTRL_TV_SATURATION,     0, "Adjusts the amount of saturation on the specified display device." },
 
     /* X Video */
-    { "XVideoOverlaySaturation",   NV_CTRL_ATTR_XV_OVERLAY_SATURATION,     V,   "Controls the amount of saturation in the X video overlay." },
-    { "XVideoOverlayContrast",     NV_CTRL_ATTR_XV_OVERLAY_CONTRAST,       V,   "Controls the amount of contrast in the X video overlay." },
-    { "XVideoOverlayBrightness",   NV_CTRL_ATTR_XV_OVERLAY_BRIGHTNESS,     V,   "Controls the amount of brightness in the X video overlay." },
-    { "XVideoOverlayHue",          NV_CTRL_ATTR_XV_OVERLAY_HUE,            V,   "Controls the amount of hue in the X video overlay." },
-    { "XVideoTextureBrightness",   NV_CTRL_ATTR_XV_TEXTURE_BRIGHTNESS,     V,   "Controls the amount of brightness in the X video texture adaptor." },
-    { "XVideoTextureContrast",     NV_CTRL_ATTR_XV_TEXTURE_CONTRAST,       V,   "Controls the amount of contrast in the X video texture adaptor." },
-    { "XVideoTextureHue",          NV_CTRL_ATTR_XV_TEXTURE_HUE,            V,   "Controls the amount of hue in the X video texture adaptor." },
-    { "XVideoTextureSaturation",   NV_CTRL_ATTR_XV_TEXTURE_SATURATION,     V,   "Controls the amount of saturation in the X video texture adaptor." },
-
-    { "XVideoTextureSyncToVBlank", NV_CTRL_ATTR_XV_TEXTURE_SYNC_TO_VBLANK, V,   "Enables sync to vertical blanking for X video texture adaptor." },
-    { "XVideoBlitterSyncToVBlank", NV_CTRL_ATTR_XV_BLITTER_SYNC_TO_VBLANK, V,   "Enables sync to vertical blanking for X video blitter adaptor." },
     { "XVideoSyncToDisplay",       NV_CTRL_XV_SYNC_TO_DISPLAY,             D|Z, "Controls which display device is synced to by the texture and blitter adaptors when they are set to synchronize to the vertical blanking." },
 
     /* 3D Vision Pro */
@@ -376,7 +367,7 @@
  * about.
  */
 
-#if NV_CTRL_LAST_ATTRIBUTE != NV_CTRL_DISPLAY_ENABLED
+#if NV_CTRL_LAST_ATTRIBUTE != NV_CTRL_FXAA
 #warning "Have you forgotten to add a new integer attribute to attributeTable?"
 #endif
 
@@ -796,23 +787,36 @@
         }
 
         /*
-         * everything after the colon should be numeric; assign it to
-         * the target_id
+         * are all characters numeric? compute the target_id integer as we scan
+         * the string to check
          */
-        
+
+        digits_only = NV_TRUE;
         target_id = 0;
 
-        for (s = colon + 1; *s; s++) {
+        for (s = colon +1; *s; s++) {
             if (!isdigit(*s)) {
-                free(tmp);
-                return NV_PARSER_STATUS_TARGET_SPEC_BAD_TARGET_ID;
+                digits_only = NV_FALSE;
+                break;
             }
             target_id = (target_id * 10) + ctoi(*s);
         }
-        
+
+        /*
+         * if all characters are numeric, this is the target_id, otherwise,
+         * this is a target type-specific name.
+         */
+
         a->target_type = target_type;
-        a->target_id = target_id;
-        
+
+        if (digits_only) {
+            a->target_id = target_id;
+            a->target_name = NULL;
+        } else {
+            a->target_id = -1;
+            a->target_name = strdup(colon +1);
+        }
+
         a->flags |= NV_PARSER_HAS_TARGET;
 
         /* we're finally done with the temp string */
@@ -1278,8 +1282,9 @@
 
     if (p->display) free(p->display);
     if (p->name) free(p->name);
-    
-    memset(p, 0, sizeof(ParsedAttribute));
+    free(p->target_name);
+
+    memset(p, 0, sizeof(*p));
 
 } /* nv_parsed_attribute_clean() */
 
diff -Nru nvidia-settings-302.17/src/parse.h nvidia-settings-304.37/src/parse.h
--- nvidia-settings-302.17/src/parse.h	2012-06-13 04:51:30.000000000 +0200
+++ nvidia-settings-304.37/src/parse.h	2012-08-09 06:04:20.000000000 +0200
@@ -117,6 +117,7 @@
     char *name;
     int target_type;
     int target_id;
+    char *target_name;
     int attr;
     union {
         int i;
diff -Nru nvidia-settings-302.17/src/query-assign.c nvidia-settings-304.37/src/query-assign.c
--- nvidia-settings-302.17/src/query-assign.c	2012-06-13 04:51:30.000000000 +0200
+++ nvidia-settings-304.37/src/query-assign.c	2012-08-09 06:04:20.000000000 +0200
@@ -87,6 +87,28 @@
 
 
 /*
+ * query_display_target_names() - retrieves the list of display device names
+ * for the given target.
+ */
+static void query_display_target_names(CtrlHandleTarget *t)
+{
+    NvCtrlGetStringAttribute(t->h, NV_CTRL_STRING_DISPLAY_NAME_TYPE_BASENAME,
+                             &(t->protoNames[NV_DPY_PROTO_NAME_TYPE_BASENAME]));
+    NvCtrlGetStringAttribute(t->h, NV_CTRL_STRING_DISPLAY_NAME_TYPE_ID,
+                             &(t->protoNames[NV_DPY_PROTO_NAME_TYPE_ID]));
+    NvCtrlGetStringAttribute(t->h, NV_CTRL_STRING_DISPLAY_NAME_DP_GUID,
+                             &(t->protoNames[NV_DPY_PROTO_NAME_DP_GUID]));
+    NvCtrlGetStringAttribute(t->h, NV_CTRL_STRING_DISPLAY_NAME_EDID_HASH,
+                             &(t->protoNames[NV_DPY_PROTO_NAME_EDID_HASH]));
+    NvCtrlGetStringAttribute(t->h, NV_CTRL_STRING_DISPLAY_NAME_TARGET_INDEX,
+                             &(t->protoNames[NV_DPY_PROTO_NAME_TARGET_INDEX]));
+    NvCtrlGetStringAttribute(t->h, NV_CTRL_STRING_DISPLAY_NAME_RANDR,
+                             &(t->protoNames[NV_DPY_PROTO_NAME_RANDR]));
+}
+
+
+
+/*
  * nv_alloc_ctrl_handles() - allocate a new CtrlHandles structure,
  * connect to the X server identified by display, and initialize an
  * NvCtrlAttributeHandle for each possible target (X screens, gpus,
@@ -291,6 +313,10 @@
                 } else {
                     h->targets[target].t[i].name = tmp;
                 }
+
+                if (target == DISPLAY_TARGET) {
+                    query_display_target_names(&(h->targets[target].t[i]));
+                }
             }
 
             /*
@@ -372,26 +398,32 @@
          */
         XCloseDisplay(h->dpy);
         h->dpy = NULL;
-        
+
         for (j = 0; targetTypeTable[j].name; j++) {
-            
+
             target = targetTypeTable[j].target_index;
-            
+
             for (i = 0; i < h->targets[target].n; i++) {
-                
-                NvCtrlAttributeClose(h->targets[target].t[i].h);
-                
-                if (h->targets[target].t[i].name) {
-                    free(h->targets[target].t[i].name);
+                CtrlHandleTarget *t = &(h->targets[target].t[i]);
+                int n;
+
+                NvCtrlAttributeClose(t->h);
+                free(t->name);
+                for (n = 0; n < NV_DPY_PROTO_NAME_MAX; n++) {
+                    if (t->protoNames[n]) {
+                        XFree(t->protoNames[n]);
+                    }
                 }
+
+                memset(t, 0, sizeof(*t));
             }
-            
+
             if (h->targets[target].t) free(h->targets[target].t);
         }
     }
-    
+
     free(h);
-    
+
 } /* nv_free_ctrl_handles() */
 
 
@@ -619,8 +651,9 @@
                      a->name, NvCtrlAttributesStrError(status));
         return NV_FALSE;
     }
-    
-    if (valid.permissions & ATTRIBUTE_TYPE_DISPLAY) {
+
+    if (target_type != NV_CTRL_TARGET_TYPE_DISPLAY &&
+        valid.permissions & ATTRIBUTE_TYPE_DISPLAY) {
         tmp_d_str = display_device_mask_to_display_device_name(d);
         sprintf(d_str, ", display device: %s", tmp_d_str);
         free(tmp_d_str);
@@ -898,7 +931,8 @@
 
     /* append the display device name, if necessary */
 
-    if (v->permissions & ATTRIBUTE_TYPE_DISPLAY) {
+    if ((NvCtrlGetTargetType(t->h) != NV_CTRL_TARGET_TYPE_DISPLAY) &&
+        v->permissions & ATTRIBUTE_TYPE_DISPLAY) {
         tmp_d_str = display_device_mask_to_display_device_name(mask);
         snprintf(d_str, 64, "; display device: %s", tmp_d_str);
         free(tmp_d_str);
@@ -1548,8 +1582,9 @@
     ReturnStatus status;
     char str[32], *tmp_d_str;
     int ret;
-    
-    if (valid.permissions & ATTRIBUTE_TYPE_DISPLAY) {
+
+    if (target_type != NV_CTRL_TARGET_TYPE_DISPLAY &&
+        valid.permissions & ATTRIBUTE_TYPE_DISPLAY) {
         tmp_d_str = display_device_mask_to_display_device_name(d);
         sprintf(str, ", display device: %s", tmp_d_str);
         free(tmp_d_str);
@@ -1748,6 +1783,37 @@
             nv_error_msg("Invalid target specified %s.", whence);
             goto done; 
         }
+
+        /*
+         * If the target was named, match it to one of the probed targets
+         * to obtain the target_id
+         */
+
+        if (a->target_name) {
+            Bool found = FALSE;
+            for (i = 0; i < h->targets[target].n; i++) {
+                int j;
+                t = &(h->targets[target].t[i]);
+                for (j = 0; j < NV_DPY_PROTO_NAME_MAX; j++) {
+                    char *name = t->protoNames[j];
+                    if (!name) continue;
+                    if (strcasecmp(name, a->target_name) == 0) {
+                        a->target_id = NvCtrlGetTargetId(t->h);
+                        found = TRUE;
+                        break;
+                    }
+                }
+                if (found) break;
+            }
+
+            if (!found) {
+                nv_error_msg("Invalid name '%s' specified for %s "
+                             "specified %s.", a->target_name,
+                             target_type_name, whence);
+                goto done;
+            }
+        }
+
         
         /* make sure the target_id is in range */
         
diff -Nru nvidia-settings-302.17/src/query-assign.h nvidia-settings-304.37/src/query-assign.h
--- nvidia-settings-302.17/src/query-assign.h	2012-06-13 04:51:30.000000000 +0200
+++ nvidia-settings-304.37/src/query-assign.h	2012-08-09 06:04:20.000000000 +0200
@@ -30,6 +30,15 @@
 #include "parse.h"
 #include "command-line.h"
 
+enum {
+    NV_DPY_PROTO_NAME_TYPE_BASENAME = 0,
+    NV_DPY_PROTO_NAME_TYPE_ID,
+    NV_DPY_PROTO_NAME_DP_GUID,
+    NV_DPY_PROTO_NAME_EDID_HASH,
+    NV_DPY_PROTO_NAME_TARGET_INDEX,
+    NV_DPY_PROTO_NAME_RANDR,
+    NV_DPY_PROTO_NAME_MAX,
+};
 
 /*
  * The CtrlHandles struct contains an array of target types for an X
@@ -43,7 +52,8 @@
     NvCtrlAttributeHandle *h; /* handle for this target */
     uint32 d;                 /* display device mask for this target */
     uint32 c;                 /* Connected display device mask for target */
-    char *name;               /* name for this target */
+    char *name;               /* Name for this target */
+    char *protoNames[NV_DPY_PROTO_NAME_MAX];  /* List of valid names for this target */
 } CtrlHandleTarget;
 
 typedef struct {
diff -Nru nvidia-settings-302.17/src/version.mk nvidia-settings-304.37/src/version.mk
--- nvidia-settings-302.17/src/version.mk	2012-06-13 04:51:29.000000000 +0200
+++ nvidia-settings-304.37/src/version.mk	2012-08-09 06:04:19.000000000 +0200
@@ -1 +1 @@
-NVIDIA_VERSION = 302.17
+NVIDIA_VERSION = 304.37
diff -Nru nvidia-settings-302.17/utils.mk nvidia-settings-304.37/utils.mk
--- nvidia-settings-302.17/utils.mk	2012-06-13 04:51:29.000000000 +0200
+++ nvidia-settings-304.37/utils.mk	2012-08-09 06:04:19.000000000 +0200
@@ -65,6 +65,7 @@
 HOSTNAME_CMD          ?= hostname
 DATE                  ?= date
 GZIP_CMD              ?= gzip
+CHMOD                 ?= chmod
 
 NV_AUTO_DEPEND        ?= 1
 NV_VERBOSE            ?= 0
@@ -156,6 +157,25 @@
 $(error NVIDIA_VERSION undefined)
 endif
 
+
+##############################################################################
+# Several of the functions below take an argument that indicates if
+# the expression is for the target platform (the system the built
+# program is going to run on) or the host platform (the system
+# performing the build).  The argument is either "HOST" or "TARGET"
+# and needs to be converted:
+#
+# "HOST" -> "HOST_"
+# "TARGET" -> ""
+#
+# and prepended to "CC" or "CFLAGS"
+##############################################################################
+
+host_target = $(patsubst HOST,HOST_,$(patsubst TARGET,,$(1)))
+host_target_cc = $(call host_target,$(1))CC
+host_target_cflags = $(call host_target,$(1))CFLAGS
+
+
 ##############################################################################
 # to generate the dependency files, use the compiler's "-MM" option to
 # generate output of the form "foo.o : foo.c foo.h"; then, use sed to
@@ -168,13 +188,14 @@
 # applies to the object files produced in the build.
 #
 # Arguments:
-# $(1): CC command (CC or HOST_CC)
+# $(1): whether for host or target platform ("HOST" or "TARGET")
 # $(2): source filename
 # $(3): object filename
 ##############################################################################
 
 ifeq ($(NV_AUTO_DEPEND),1)
-  AUTO_DEP_CMD = && $($(1)) -MM $$(CFLAGS) $$< | $$(SED) \
+  AUTO_DEP_CMD = && $($(call host_target_cc,$(1))) \
+    -MM $$($(call host_target_cflags,$(1))) $$< | $$(SED) \
     -e "s,: ,: $$$$\(wildcard ," \
     -e "s,\([^\\]\)$$$$,\1)," \
     -e "s;^$$(addsuffix .o,$$(notdir $$(basename $(2)))): ;$(3): ;" \
@@ -249,11 +270,12 @@
 
 ##############################################################################
 # functions to define a rule to build an object file; the first
-# argument is either CC or HOST_CC, the second argument is the source
-# file to compile, and the third argument (_WITH_OBJECT_NAME-only) is
-# the object filename to produce.  Example usage:
+# argument whether the rule is for the target or host platform ("HOST"
+# or "TARGET"), the second argument is the source file to compile, and
+# the third argument (_WITH_OBJECT_NAME-only) is the object filename
+# to produce.  Example usage:
 #
-#  $(eval $(call DEFINE_OBJECT_RULE,CC,foo.c))
+#  $(eval $(call DEFINE_OBJECT_RULE,TARGET,foo.c))
 #
 # Note this also attempts to include the dependency file for this
 # source file.
@@ -266,7 +288,8 @@
 define DEFINE_OBJECT_RULE_WITH_OBJECT_NAME
   $(3): $(2)
 	@$(MKDIR) $(OUTPUTDIR)
-	$$(call quiet_cmd,$(1)) $$(CFLAGS) -c $$< -o $$@ \
+	$$(call quiet_cmd,$(call host_target_cc,$(1))) \
+	  $$($(call host_target_cflags,$(1))) -c $$< -o $$@ \
 	  $(call AUTO_DEP_CMD,$(1),$(2),$(3))
 
   -include $$(call BUILD_DEPENDENCY_LIST,$(3))
diff -Nru nvidia-settings-302.17/version.mk nvidia-settings-304.37/version.mk
--- nvidia-settings-302.17/version.mk	2012-06-13 04:51:29.000000000 +0200
+++ nvidia-settings-304.37/version.mk	2012-08-09 06:04:19.000000000 +0200
@@ -1 +1 @@
-NVIDIA_VERSION = 302.17
+NVIDIA_VERSION = 304.37
diffstat for nvidia-xconfig-302.17 nvidia-xconfig-304.37

 Makefile                    |   17 ++++---
 common-utils/common-utils.c |   60 +++++++++++++++++++++++++++
 common-utils/common-utils.h |    2 
 common-utils/nvgetopt.c     |    3 -
 debian/changelog            |    6 ++
 multiple_screens.c          |    6 --
 nvidia-cfg.h                |   74 +++++++++++++++++++++++++++++++++
 nvidia-xconfig.1.m4         |   14 ++++++
 nvidia-xconfig.h            |    2 
 option_table.h              |   97 ++++++++++++++++++++++----------------------
 util.c                      |   54 ------------------------
 utils.mk                    |   37 +++++++++++++---
 version.mk                  |    2 
 13 files changed, 249 insertions(+), 125 deletions(-)

diff -Nru nvidia-xconfig-302.17/Makefile nvidia-xconfig-304.37/Makefile
--- nvidia-xconfig-302.17/Makefile	2012-06-13 04:51:48.000000000 +0200
+++ nvidia-xconfig-304.37/Makefile	2012-08-09 06:04:22.000000000 +0200
@@ -80,13 +80,14 @@
 
 OBJS = $(call BUILD_OBJECT_LIST,$(SRC))
 
-CFLAGS += -I XF86Config-parser
-CFLAGS += -I $(OUTPUTDIR)
-CFLAGS += -I $(NVIDIA_CFG_DIR)
-CFLAGS += -I $(COMMON_UTILS_DIR)
-CFLAGS += -DPROGRAM_NAME=\"nvidia-xconfig\"
+common_cflags += -I XF86Config-parser
+common_cflags += -I $(OUTPUTDIR)
+common_cflags += -I $(NVIDIA_CFG_DIR)
+common_cflags += -I $(COMMON_UTILS_DIR)
+common_cflags += -DPROGRAM_NAME=\"nvidia-xconfig\"
 
-HOST_CFLAGS += $(CFLAGS)
+CFLAGS += $(common_cflags)
+HOST_CFLAGS += $(common_cflags)
 
 LIBS += -lm
 
@@ -123,7 +124,7 @@
 	$(call quiet_cmd,STRIP_CMD) $@
 
 # define the rule to build each object file
-$(foreach src, $(SRC), $(eval $(call DEFINE_OBJECT_RULE,CC,$(src))))
+$(foreach src, $(SRC), $(eval $(call DEFINE_OBJECT_RULE,TARGET,$(src))))
 
 # define the rule to generate $(STAMP_C)
 $(eval $(call DEFINE_STAMP_C_RULE, $(OBJS),$(NVIDIA_XCONFIG_PROGRAM_NAME)))
@@ -148,7 +149,7 @@
 GEN_MANPAGE_OPTS_OBJS = $(call BUILD_OBJECT_LIST,$(GEN_MANPAGE_OPTS_SRC))
 
 $(foreach src, $(GEN_MANPAGE_OPTS_SRC), \
-    $(eval $(call DEFINE_OBJECT_RULE,HOST_CC,$(src))))
+    $(eval $(call DEFINE_OBJECT_RULE,HOST,$(src))))
 
 $(GEN_MANPAGE_OPTS): $(GEN_MANPAGE_OPTS_OBJS)
 	$(call quiet_cmd,HOST_LINK) \
diff -Nru nvidia-xconfig-302.17/common-utils/common-utils.c nvidia-xconfig-304.37/common-utils/common-utils.c
--- nvidia-xconfig-302.17/common-utils/common-utils.c	2012-06-13 04:51:49.000000000 +0200
+++ nvidia-xconfig-304.37/common-utils/common-utils.c	2012-08-09 06:04:23.000000000 +0200
@@ -586,3 +586,63 @@
     }
     NV_VFORMAT(stream, TRUE, prefix, fmt);
 }
+
+
+/*
+ * Read from the given FILE stream until a newline, EOF, or nul
+ * terminator is encountered, writing data into a growable buffer.
+ * The eof parameter is set to TRUE when EOF is encountered.  In all
+ * cases, the returned string is null-terminated.
+ *
+ * XXX this function will be rather slow because it uses fgetc() to
+ * pull each character off the stream one at a time; this is done so
+ * that each character can be examined as it's read so that we can
+ * appropriately deal with EOFs and newlines.  A better implementation
+ * would use fgets(), but that would still require us to parse each
+ * read line, checking for newlines or guessing if we hit an EOF.
+ */
+char *fget_next_line(FILE *fp, int *eof)
+{
+    char *buf = NULL, *tmpbuf;
+    char *c = NULL;
+    int len = 0, buflen = 0;
+    int ret;
+
+    const int __fget_next_line_len = 32;
+
+    if (eof) {
+        *eof = FALSE;
+    }
+
+    while (1) {
+        if (buflen == len) { /* buffer isn't big enough -- grow it */
+            buflen += __fget_next_line_len;
+            tmpbuf = nvalloc(buflen);
+            if (buf) {
+                memcpy(tmpbuf, buf, len);
+                nvfree(buf);
+            }
+            buf = tmpbuf;
+            c = buf + len;
+        }
+
+        ret = fgetc(fp);
+
+        if ((ret == EOF) && (eof)) {
+            *eof = TRUE;
+        }
+
+        if ((ret == EOF) || (ret == '\n') || (ret == '\0')) {
+            *c = '\0';
+            return buf;
+        }
+
+        *c = (char) ret;
+
+        len++;
+        c++;
+
+    } /* while (1) */
+
+    return NULL; /* should never get here */
+}
diff -Nru nvidia-xconfig-302.17/common-utils/common-utils.h nvidia-xconfig-304.37/common-utils/common-utils.h
--- nvidia-xconfig-302.17/common-utils/common-utils.h	2012-06-13 04:51:49.000000000 +0200
+++ nvidia-xconfig-304.37/common-utils/common-utils.h	2012-08-09 06:04:23.000000000 +0200
@@ -65,6 +65,8 @@
 void fmtwarn(const char *fmt, ...);
 void fmt(FILE *stream, const char *prefix, const char *fmt, ...);
 
+char *fget_next_line(FILE *fp, int *eof);
+
 /*
  * NV_VSNPRINTF(): macro that assigns buf using vsnprintf().  This is
  * correct for differing semantics of the vsnprintf() return value:
diff -Nru nvidia-xconfig-302.17/common-utils/nvgetopt.c nvidia-xconfig-304.37/common-utils/nvgetopt.c
--- nvidia-xconfig-302.17/common-utils/nvgetopt.c	2012-06-13 04:51:49.000000000 +0200
+++ nvidia-xconfig-304.37/common-utils/nvgetopt.c	2012-08-09 06:04:23.000000000 +0200
@@ -22,6 +22,7 @@
 #include <string.h>
 #include <stdlib.h>
 #include <ctype.h>
+#include <limits.h>
 
 #include "nvgetopt.h"
 #include "common-utils.h"
@@ -401,7 +402,7 @@
          * prepend the single character version of the option,
          * possibly with an argument; e.g., "-f" or "-f BAR"
          */
-        if (isalpha(o->val)) {
+        if (o->val <= UCHAR_MAX && o->val >= 0 && isalpha(o->val)) {
             char scratch[16];
             char *tmp;
             snprintf(scratch, sizeof(scratch), "%c", o->val);
diff -Nru nvidia-xconfig-302.17/debian/changelog nvidia-xconfig-304.37/debian/changelog
--- nvidia-xconfig-302.17/debian/changelog	2012-06-30 19:24:07.000000000 +0200
+++ nvidia-xconfig-304.37/debian/changelog	2012-08-14 10:21:02.000000000 +0200
@@ -1,3 +1,9 @@
+nvidia-xconfig (304.37-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Andreas Beckmann <debian@abeckmann.de>  Tue, 14 Aug 2012 10:21:02 +0200
+
 nvidia-xconfig (302.17-2) unstable; urgency=low
 
   * Fix building with DEB_BUILD_OPTIONS=noopt.
diff -Nru nvidia-xconfig-302.17/multiple_screens.c nvidia-xconfig-304.37/multiple_screens.c
--- nvidia-xconfig-302.17/multiple_screens.c	2012-06-13 04:51:48.000000000 +0200
+++ nvidia-xconfig-304.37/multiple_screens.c	2012-08-09 06:04:23.000000000 +0200
@@ -781,10 +781,9 @@
                                XConfigLayoutPtr layout)
 {
     XConfigAdjacencyPtr adj, prev_adj;
-    XConfigScreenPtr screen, prev;
+    XConfigScreenPtr screen;
     int i;
-    
-    prev = NULL;
+
     i = 0;
     prev_adj = NULL;
     
@@ -803,7 +802,6 @@
         }
         
         prev_adj = adj;
-        prev = screen;
         i++;
     }
     
diff -Nru nvidia-xconfig-302.17/nvidia-cfg.h nvidia-xconfig-304.37/nvidia-cfg.h
--- nvidia-xconfig-302.17/nvidia-cfg.h	2012-06-13 04:51:48.000000000 +0200
+++ nvidia-xconfig-304.37/nvidia-cfg.h	2012-08-09 06:04:22.000000000 +0200
@@ -64,6 +64,21 @@
 } NvCfgPciDevice;
 
 
+/*
+ * NvCfgGSyncDeviceType - type of the GSync device
+ */
+
+typedef enum {
+    NVCFG_TYPE_GSYNC1 = 0,
+    NVCFG_TYPE_GSYNC2,
+    NVCFG_TYPE_GSYNC3
+} NvCfgGSyncDeviceType;
+
+
+
+#define NV_CFG_GSYNC_DEVICE_FIRMWARE_FORMAT_1 1
+
+
 
 /*
  * NvCfgDisplayDeviceInformation - this data structure contains
@@ -133,6 +148,15 @@
 
 
 /*
+ * NvCfgGSyncHandle - this is an opaque handle identifying a
+ * GSync device.
+ */
+
+typedef void * NvCfgGSyncHandle;
+
+
+
+/*
  * NvCfg Boolean values
  */
 
@@ -329,4 +353,54 @@
 
 NvCfgBool nvCfgGetTeslaSerialNumbers(char ***serials);
 
+
+/*
+ * nvCfgOpenAllGSyncDevices() - returns an array of NvCfgGSyncHandle's
+ * indicating what GSync devices are present in the system. On success,
+ * NVCFG_TRUE will be returned, n will contain the number of GSync devices
+ * present in the system, and handles will be an allocated array containing
+ * a handle for each of the GSync devices.The caller should free the
+ * handles array when no longer needed. On failure, NVCFG_FALSE will be
+ * returned.
+ */
+
+NvCfgBool nvCfgOpenAllGSyncDevices(int *n, NvCfgGSyncHandle **handles);
+
+
+/*
+ * nvCfgCloseAllGSyncDevices() - close all the GSync device connections
+ * opened by a previous call to nvCfgOpenAllGSyncDevices().
+ */
+
+NvCfgBool nvCfgCloseAllGSyncDevices(void);
+
+
+/*
+ * nvCfgGetGSyncDeviceType() - returns the type of GSync device referenced
+ * by handle.
+ */
+
+NvCfgGSyncDeviceType nvCfgGetGSyncDeviceType(NvCfgGSyncHandle handle);
+
+
+/*
+ * nvCfgGetGSyncDeviceFirmwareVersion() - returns the firmware version of
+ * the GSync device referenced by handle.
+ */
+
+int nvCfgGetGSyncDeviceFirmwareVersion(NvCfgGSyncHandle handle);
+
+
+/*
+ * nvCfgFlashGSyncDevice() - flashes the GSync device referenced by handle.
+ * format contains the firmware format, newFirmwareImage contains the
+ * new firmware image to be flashed, and size contains the size of
+ * newFirmwareImage. On success, NVCFG_TRUE will be returned.
+ * On failure, NVCFG_FALSE will be returned.
+ */
+
+NvCfgBool nvCfgFlashGSyncDevice(NvCfgGSyncHandle handle, int format,
+                                const unsigned char *newFirmwareImage,
+                                int size);
+
 #endif /* __NVIDIA_CFG__ */
diff -Nru nvidia-xconfig-302.17/nvidia-xconfig.1.m4 nvidia-xconfig-304.37/nvidia-xconfig.1.m4
--- nvidia-xconfig-302.17/nvidia-xconfig.1.m4	2012-06-13 04:51:48.000000000 +0200
+++ nvidia-xconfig-304.37/nvidia-xconfig.1.m4	2012-08-09 06:04:23.000000000 +0200
@@ -4,6 +4,11 @@
 .\" Copyright (C) 2005-2010 NVIDIA Corporation.
 .\"
 __HEADER__
+.\" Define the URL macro and then load the URL package if it exists.
+.de URL
+\\$2 \(laURL: \\$1 \(ra\\$3
+..
+.if \n[.g] .mso www.tmac
 .TH nvidia\-xconfig 1 "__DATE__" "nvidia\-xconfig __VERSION__"
 .SH NAME
 nvidia-xconfig \- manipulate X configuration files for the NVIDIA driver
@@ -61,6 +66,15 @@
 option can be used to print the new configuration to standard out in tree form instead.  This option is useful to see what
 .B nvidia-xconfig
 will do while leaving the original configuration intact.
+.PP
+The source code to
+.B nvidia\-xconfig
+is released under the GPL and available here:
+.sp
+.ti +5
+.URL "ftp://download.nvidia.com/XFree86/nvidia\-xconfig/";
+.sp
+Patches are welcome.
 dnl Call gen-manpage-opts to generate this section.
 __OPTIONS__
 .SH EXAMPLES
diff -Nru nvidia-xconfig-302.17/nvidia-xconfig.h nvidia-xconfig-304.37/nvidia-xconfig.h
--- nvidia-xconfig-302.17/nvidia-xconfig.h	2012-06-13 04:51:48.000000000 +0200
+++ nvidia-xconfig-304.37/nvidia-xconfig.h	2012-08-09 06:04:23.000000000 +0200
@@ -201,8 +201,6 @@
 
 int directory_exists(const char *dir);
 
-char *fget_next_line(FILE *fp, int *eof);
-
 /* make_usable.c */
 
 int update_modules(XConfigPtr config);
diff -Nru nvidia-xconfig-302.17/option_table.h nvidia-xconfig-304.37/option_table.h
--- nvidia-xconfig-302.17/option_table.h	2012-06-13 04:51:48.000000000 +0200
+++ nvidia-xconfig-304.37/option_table.h	2012-08-09 06:04:23.000000000 +0200
@@ -12,54 +12,55 @@
 
 #include "nvidia-xconfig.h"
 
-#define SCREEN_OPTION                       1
-#define LAYOUT_OPTION                       2
-#define X_PREFIX_OPTION                     3
-#define KEYBOARD_OPTION                     5
-#define KEYBOARD_LIST_OPTION                6
-#define KEYBOARD_DRIVER_OPTION              7
-#define MOUSE_OPTION                        8
-#define FORCE_GENERATE_OPTION               9
-#define MOUSE_LIST_OPTION                   10
-#define MODE_OPTION                         11
-#define MODE_LIST_OPTION                    12
-#define REMOVE_MODE_OPTION                  13
-#define NVIDIA_CFG_PATH_OPTION              14
-#define NVAGP_OPTION                        15
-#define SLI_OPTION                          16
-#define DISABLE_SCF_OPTION                  17
-#define TRANSPARENT_INDEX_OPTION            18
-#define STEREO_OPTION                       19
-#define ROTATE_OPTION                       20
-#define QUERY_GPU_INFO_OPTION               21
-#define EXTRACT_EDIDS_OUTPUT_FILE_OPTION    22
-#define MULTI_GPU_OPTION                    23
-#define NVIDIA_XINERAMA_INFO_ORDER_OPTION 24
-#define LOGO_PATH_OPTION                    25
-#define METAMODE_ORIENTATION_OPTION         26
-#define VIRTUAL_OPTION                      27
-#define USE_DISPLAY_DEVICE_OPTION           28
-#define CUSTOM_EDID_OPTION                  29
-#define TV_STANDARD_OPTION                  30
-#define TV_OUT_FORMAT_OPTION                31
-#define TV_OVER_SCAN_OPTION                 32
-#define COOL_BITS_OPTION                    33
-#define ACPID_SOCKET_PATH_OPTION            34
-#define HANDLE_SPECIAL_KEYS_OPTION          35
-#define PRESERVE_DRIVER_NAME_OPTION         36
-#define CONNECTED_MONITOR_OPTION            37
-#define REGISTRY_DWORDS_OPTION              38
-#define META_MODES_OPTION                   39
-#define COLOR_SPACE_OPTION                  40
-#define COLOR_RANGE_OPTION                  41
-#define BUSID_OPTION                        42
-#define DEVICE_OPTION                       43
-#define FLATPANEL_PROPERTIES_OPTION         44
-#define NVIDIA_3DVISION_USB_PATH_OPTION     45
-#define NVIDIA_3DVISIONPRO_CONFIG_FILE_OPTION  46
-#define NVIDIA_3DVISION_DISPLAY_TYPE_OPTION 47
-/* skip 48-57, as these are '0' - '9' */
-#define RESTORE_ORIGINAL_BACKUP_OPTION      58
+enum {
+    SCREEN_OPTION = 1024,
+    LAYOUT_OPTION,
+    X_PREFIX_OPTION,
+    KEYBOARD_OPTION,
+    KEYBOARD_LIST_OPTION,
+    KEYBOARD_DRIVER_OPTION,
+    MOUSE_OPTION,
+    FORCE_GENERATE_OPTION,
+    MOUSE_LIST_OPTION,
+    MODE_OPTION,
+    MODE_LIST_OPTION,
+    REMOVE_MODE_OPTION,
+    NVIDIA_CFG_PATH_OPTION,
+    NVAGP_OPTION,
+    SLI_OPTION,
+    DISABLE_SCF_OPTION,
+    TRANSPARENT_INDEX_OPTION,
+    STEREO_OPTION,
+    ROTATE_OPTION,
+    QUERY_GPU_INFO_OPTION,
+    EXTRACT_EDIDS_OUTPUT_FILE_OPTION,
+    MULTI_GPU_OPTION,
+    NVIDIA_XINERAMA_INFO_ORDER_OPTION,
+    LOGO_PATH_OPTION,
+    METAMODE_ORIENTATION_OPTION,
+    VIRTUAL_OPTION,
+    USE_DISPLAY_DEVICE_OPTION,
+    CUSTOM_EDID_OPTION,
+    TV_STANDARD_OPTION,
+    TV_OUT_FORMAT_OPTION,
+    TV_OVER_SCAN_OPTION,
+    COOL_BITS_OPTION,
+    ACPID_SOCKET_PATH_OPTION,
+    HANDLE_SPECIAL_KEYS_OPTION,
+    PRESERVE_DRIVER_NAME_OPTION,
+    CONNECTED_MONITOR_OPTION,
+    REGISTRY_DWORDS_OPTION,
+    META_MODES_OPTION,
+    COLOR_SPACE_OPTION,
+    COLOR_RANGE_OPTION,
+    BUSID_OPTION,
+    DEVICE_OPTION,
+    FLATPANEL_PROPERTIES_OPTION,
+    NVIDIA_3DVISION_USB_PATH_OPTION,
+    NVIDIA_3DVISIONPRO_CONFIG_FILE_OPTION,
+    NVIDIA_3DVISION_DISPLAY_TYPE_OPTION,
+    RESTORE_ORIGINAL_BACKUP_OPTION,
+};
 
 /*
  * To add a boolean option to nvidia-xconfig:
diff -Nru nvidia-xconfig-302.17/util.c nvidia-xconfig-304.37/util.c
--- nvidia-xconfig-302.17/util.c	2012-06-13 04:51:48.000000000 +0200
+++ nvidia-xconfig-304.37/util.c	2012-08-09 06:04:23.000000000 +0200
@@ -187,57 +187,3 @@
     if (newline) fmt(stream, NULL, "");
     
 } /* xconfigPrint */
-
-
-/*
- * fget_next_line() - read from the given FILE stream until a newline,
- * EOF, or null terminator is encountered, writing data into a
- * growable buffer.  The eof parameter is set to TRUE when EOF is
- * encountered.  In all cases, the returned string is null-terminated.
- *
- * XXX this function will be rather slow because it uses fgetc() to
- * pull each character off the stream one at a time; this is done so
- * that each character can be examined as it's read so that we can
- * appropriately deal with EOFs and newlines.  A better implementation
- * would use fgets(), but that would still require us to parse each
- * read line, checking for newlines or guessing if we hit an EOF.
- */
-
-#define NV_LINE_LEN 32
-
-char *fget_next_line(FILE *fp, int *eof)
-{
-    char *buf = NULL, *tmpbuf;
-    char *c = NULL;
-    int len = 0, buflen = 0;
-    
-    if (eof) *eof = FALSE;
-    
-    while (1) {
-        if (buflen == len) { /* buffer isn't big enough -- grow it */
-            buflen += NV_LINE_LEN;
-            tmpbuf = (char *) nvalloc (buflen);
-            if (buf) {
-                memcpy (tmpbuf, buf, len);
-                free (buf);
-            }
-            buf = tmpbuf;
-            c = buf + len;
-        }
-
-        *c = fgetc(fp);
-        
-        if ((*c == EOF) && (eof)) *eof = TRUE;
-        if ((*c == EOF) || (*c == '\n') || (*c == '\0')) {
-            *c = '\0';
-            return buf;
-        }
-
-        len++;
-        c++;
-
-    } /* while (1) */
-    
-    return NULL; /* should never get here */
-   
-} /* fget_next_line() */
diff -Nru nvidia-xconfig-302.17/utils.mk nvidia-xconfig-304.37/utils.mk
--- nvidia-xconfig-302.17/utils.mk	2012-06-13 04:51:48.000000000 +0200
+++ nvidia-xconfig-304.37/utils.mk	2012-08-09 06:04:22.000000000 +0200
@@ -65,6 +65,7 @@
 HOSTNAME_CMD          ?= hostname
 DATE                  ?= date
 GZIP_CMD              ?= gzip
+CHMOD                 ?= chmod
 
 NV_AUTO_DEPEND        ?= 1
 NV_VERBOSE            ?= 0
@@ -156,6 +157,25 @@
 $(error NVIDIA_VERSION undefined)
 endif
 
+
+##############################################################################
+# Several of the functions below take an argument that indicates if
+# the expression is for the target platform (the system the built
+# program is going to run on) or the host platform (the system
+# performing the build).  The argument is either "HOST" or "TARGET"
+# and needs to be converted:
+#
+# "HOST" -> "HOST_"
+# "TARGET" -> ""
+#
+# and prepended to "CC" or "CFLAGS"
+##############################################################################
+
+host_target = $(patsubst HOST,HOST_,$(patsubst TARGET,,$(1)))
+host_target_cc = $(call host_target,$(1))CC
+host_target_cflags = $(call host_target,$(1))CFLAGS
+
+
 ##############################################################################
 # to generate the dependency files, use the compiler's "-MM" option to
 # generate output of the form "foo.o : foo.c foo.h"; then, use sed to
@@ -168,13 +188,14 @@
 # applies to the object files produced in the build.
 #
 # Arguments:
-# $(1): CC command (CC or HOST_CC)
+# $(1): whether for host or target platform ("HOST" or "TARGET")
 # $(2): source filename
 # $(3): object filename
 ##############################################################################
 
 ifeq ($(NV_AUTO_DEPEND),1)
-  AUTO_DEP_CMD = && $($(1)) -MM $$(CFLAGS) $$< | $$(SED) \
+  AUTO_DEP_CMD = && $($(call host_target_cc,$(1))) \
+    -MM $$($(call host_target_cflags,$(1))) $$< | $$(SED) \
     -e "s,: ,: $$$$\(wildcard ," \
     -e "s,\([^\\]\)$$$$,\1)," \
     -e "s;^$$(addsuffix .o,$$(notdir $$(basename $(2)))): ;$(3): ;" \
@@ -249,11 +270,12 @@
 
 ##############################################################################
 # functions to define a rule to build an object file; the first
-# argument is either CC or HOST_CC, the second argument is the source
-# file to compile, and the third argument (_WITH_OBJECT_NAME-only) is
-# the object filename to produce.  Example usage:
+# argument whether the rule is for the target or host platform ("HOST"
+# or "TARGET"), the second argument is the source file to compile, and
+# the third argument (_WITH_OBJECT_NAME-only) is the object filename
+# to produce.  Example usage:
 #
-#  $(eval $(call DEFINE_OBJECT_RULE,CC,foo.c))
+#  $(eval $(call DEFINE_OBJECT_RULE,TARGET,foo.c))
 #
 # Note this also attempts to include the dependency file for this
 # source file.
@@ -266,7 +288,8 @@
 define DEFINE_OBJECT_RULE_WITH_OBJECT_NAME
   $(3): $(2)
 	@$(MKDIR) $(OUTPUTDIR)
-	$$(call quiet_cmd,$(1)) $$(CFLAGS) -c $$< -o $$@ \
+	$$(call quiet_cmd,$(call host_target_cc,$(1))) \
+	  $$($(call host_target_cflags,$(1))) -c $$< -o $$@ \
 	  $(call AUTO_DEP_CMD,$(1),$(2),$(3))
 
   -include $$(call BUILD_DEPENDENCY_LIST,$(3))
diff -Nru nvidia-xconfig-302.17/version.mk nvidia-xconfig-304.37/version.mk
--- nvidia-xconfig-302.17/version.mk	2012-06-13 04:51:48.000000000 +0200
+++ nvidia-xconfig-304.37/version.mk	2012-08-09 06:04:22.000000000 +0200
@@ -1 +1 @@
-NVIDIA_VERSION = 302.17
+NVIDIA_VERSION = 304.37

Reply to: