Commit Graph

242 Commits

Author SHA1 Message Date
Alan Coopersmith
5bafcc79bf Strip trailing whitespace from source files
Performed with: `git ls-files | xargs perl -i -p -e 's{[ \t]+$}{}'`

`git diff -w` & `git diff -b` show no diffs from this change

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-nv/-/merge_requests/29>
2025-12-15 19:36:18 +01:00
Alan Coopersmith
a3691dad26 g80: Avoid segfault if AccelMethod isn't set and XAA isn't built
Fixes: b1b6f64 ("g80: dont set accelmethod to xaa when xaa is disabled")
Reviewed-by: Yusuf Khan <yusisamerican@gmail.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-nv/-/merge_requests/27>
2025-12-15 17:35:28 +01:00
Enrico Weigelt, metux IT consult
74aae8609f drop obsolete XAA support
Since recent commits require xserver-1.18.0 or later to build against,
there's no reason leaving behind big chunks of code that can only build
against the XAA support removed in xserver-1.13.0 (released in 2012).

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-15 17:36:12 +01:00
Enrico Weigelt, metux IT consult
86c2a3e6ce drop compat with ancient xserver versions
We're relying on at least 1.8 now, so no need to carry ancient compat anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-08 19:02:43 +01:00
Enrico Weigelt, metux IT consult
5b3109a76e replace XNFcalloc() by calloc()
Standard C calloc() really is enough here, no need to extra Xserver
wrappers that are in process of being phased out anyways.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-08 16:51:03 +01:00
Enrico Weigelt, metux IT consult
93c6a64bab replace <region.h> by <regionstr.h>
The <region.h> header is deprecated, anything we might need from it
is already reachable via <regionstr.h>

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-11-20 15:14:10 +01:00
b-aaz
ca3f59fa84 FreeBSD: nv_driver: Disable check for pci driver in FreeBSD.
Seems like this check is also unnecessary in FreeBSD as in NetBSD.
Because the vgapci driver is always attached.

Signed-off-by: b-aaz <b-aazbsd.proton.me>
2025-06-30 15:56:51 +02:00
Yusuf Khan
a8608636da treewide: replace XNFcallocarray with XNFcalloc and add wrap it
Otherwise older xservers complain, also add a wrapper in case XNFcalloc
is dead.

Signed-off-by: Yusuf Khan <yusisamerican@gmail.com>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-nv/-/merge_requests/24>
2024-06-05 09:42:58 -05:00
Alan Coopersmith
6c68869907 Don't try to load xaa module if not compiled with XAA support
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-nv/-/merge_requests/22>
2024-05-14 18:04:59 -07:00
nia
5e90ec5ecf netbsd: disable not-useful check for an existing kernel driver
nv will refuse to work whenever there's a driver other than vga attached to
the device we're trying to probe, yet nv works fine on top of gffb or
genfb on NetBSD

Signed-off-by: Nia Alarie <nia@NetBSD.org>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-nv/-/merge_requests/20>
2024-05-12 17:19:47 +00:00
nia
8cf3065812 netbsd: Try getting the EDID via wscons if the DDC2 method fails.
Helps identifying displays on non-x86 hardware.

Patch from Michael Lorenz, autotools'ified by me.

Signed-off-by: Nia Alarie <nia@NetBSD.org>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-nv/-/merge_requests/19>
2024-05-12 17:05:37 +00:00
Yusuf Khan
93ac93ed7a nv: support GT 320M....hopefully
This is gt216 which is a close relative of my gt218 but...it should
be closer to the rest of the chipsets enough to work hopefully.

Signed-off-by: Yusuf Khan <yusisamerican@gmail.com>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-nv/-/merge_requests/16>
2024-05-11 19:56:18 +00:00
Yusuf Khan
714dcafbe2 g80/output: update known PCI rom sigs
See src/common/nvswitch/kernel/inc/rom_nvswitch.h in open-gpu-kernel-modules

Signed-off-by: Yusuf Khan <yusisamerican@gmail.com>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-nv/-/merge_requests/16>
2024-05-11 19:56:18 +00:00
Yusuf Khan
3d729d58bc g80/disp: preinit all heads we know in display
Signed-off-by: Yusuf Khan <yusisamerican@gmail.com>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-nv/-/merge_requests/16>
2024-05-11 19:56:18 +00:00
Yusuf Khan
30c27a60bf g80/display: Annotate functions
Signed-off-by: Yusuf Khan <yusisamerican@gmail.com>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-nv/-/merge_requests/16>
2024-05-11 19:56:18 +00:00
Enrico Weigelt, metux IT consult
fd20c34e7a use XNFcallocarray() instead of xnfcalloc macro
xnfcalloc is just an alias for XNFcallocarray() that doesn't seem to serve
any practical purpose, so it can go away once all drivers stopped using it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-nv/-/merge_requests/18>
2024-05-08 16:22:38 +02:00
Enrico Weigelt, metux IT consult
dd4a6d596b use XNFalloc() instead of xnfalloc
xnfalloc is just an alias for XNFalloc() that doesn't seem to serve
any practical purpose, so it can go away once all drivers stopped using it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-nv/-/merge_requests/18>
2024-05-08 13:01:50 +02:00
Yusuf Khan
63e8ad83c7 nv: support 0xf0 device id range
inspired by a bugzilla patch:

"nv-2.1.12 : patch to add the latest and a lot of Nvidia CPUs (56) (until February 2009)"

Signed-off-by: Yusuf Khan <yusisamerican@gmail.com>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-nv/-/merge_requests/17>
2024-05-02 23:06:24 +00:00
Yusuf Khan
b1b6f64bde g80: dont set accelmethod to xaa when xaa is disabled
Signed-off-by: Yusuf Khan <yusisamerican@gmail.com>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-nv/-/merge_requests/15>
2024-04-19 00:44:20 -05:00
Yusuf Khan
d06264d7a3 treewide: #if -> #ifdef
I think the latest version of gcc got stricter in regards to this
for some reason.

Signed-off-by: Yusuf Khan <yusisamerican@gmail.com>
2024-03-17 20:52:28 +00:00
Alan Coopersmith
c8ab8f7868 riva_hw.c: Ensure ABS macro expands correctly
Handles warning from Oracle Parfait static analyser:

Error: Misleading macro
   Misleading macro [misleading-macro]:
      misleading evaluation of unary '-' operator in expansion of macro ABS due to missing parentheses
        at line 104 of src/riva_hw.c.
        binary '+' operator has lower precedence than unary '-' operator inside macro body at line 298
        if (ABS(ainfo->vburst_size) + (ABS(ainfo->wcvlwm + 32) & ~0xf)  - tmp> VFIFO_SIZE)
        low precedence binary '+' operator is hidden by expansion of macro argument a at line 104
	#define	ABS(a)	(a>0?a:-a)

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-01-26 09:30:27 -08:00
Alan Coopersmith
eff27e0d6a Fix warning: no previous prototype for ‘G80ExaInit’ [-Wmissing-prototypes]
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-01-08 14:38:23 -08:00
Alan Coopersmith
fa0bd081e0 Fix -Wdiscarded-qualifiers warning in G80PreInit
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-01-08 14:24:25 -08:00
Alan Coopersmith
947720bc20 Fix warning: ‘NVPatternROP’ defined but not used [-Wunused-const-variable=]
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-01-08 14:10:39 -08:00
Alan Coopersmith
0176634d5e Fix warning: ‘NVDMAKickoffCallback’ defined but not used [-Wunused-function]
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-01-08 14:09:14 -08:00
Alan Coopersmith
57cfa71b2c Fix 4 -Wdiscarded-qualifiers warnings
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-01-08 14:05:42 -08:00
Alan Coopersmith
52db99b4d8 Add X.Org's standard C warning flags to AM_CFLAGS
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-01-08 14:03:29 -08:00
Alan Coopersmith
e64b5ac6db Don't call xf86DisableRandR in ABI_VIDEODRV_VERSION 24 & later
The API was removed by Xserver commit dd00e5466a0e4ea313d1860824da4123692827ed
in xorg-server-1.20.0 and later.

Found by gcc -Werror=implicit:

riva_driver.c: In function ‘RivaScreenInit’:
riva_driver.c:1213:12: error: implicit declaration of function
 ‘xf86DisableRandR’; did you mean ‘xf86DisableIO’?
 [-Werror=implicit-function-declaration]
 1213 |            xf86DisableRandR();
      |            ^~~~~~~~~~~~~~~~
      |            xf86DisableIO
nv_driver.c: In function ‘NVScreenInit’:
nv_driver.c:2635:16: error: implicit declaration of function
 ‘xf86DisableRandR’; did you mean ‘xf86DisableIO’?
 [-Werror=implicit-function-declaration]
 2635 |                xf86DisableRandR();
      |                ^~~~~~~~~~~~~~~~
      |                xf86DisableIO

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-12-07 18:23:53 -08:00
Yusuf Khan
1b735e8c96 fix nv on powerpc
Written by either Julio Merino <julio at meroh.net> or Nathan Whitehorn
<nwhitehorn at freebsd.org> (emails obfuscated similar to freebsd
convention, authorship is in doubt)
2022-07-29 12:50:20 +00:00
Alan Coopersmith
94d6ea6137 riva_xaa: don't build RivaSetRopPattern when XAA is not supported
Fixes gcc warnings:

riva_xaa.c: In function ‘RivaSetRopPattern’:
riva_xaa.c:94:33: warning: implicit declaration of function
  ‘XAAGetPatternROP’; did you mean ‘RivaSetPattern’?
  [-Wimplicit-function-declaration]
         pRiva->riva.Rop->Rop3 = XAAGetPatternROP(rop);
                                 ^~~~~~~~~~~~~~~~
                                 RivaSetPattern
At top level:
riva_xaa.c:89:1: warning: ‘RivaSetRopPattern’ defined but not used
  [-Wunused-function]
 RivaSetRopPattern(RivaPtr pRiva, int rop)
 ^~~~~~~~~~~~~~~~~

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-07-25 19:15:07 -07:00
Yusuf
b9f256b16f Replace xf86PciInfo.h with our own pci ids
Signed-off-by: YusufKhan-improves-things's avatarYusuf Khan <yusisamerican@gmail.com>
---
v2: Add header to Makefile

v3: commit v2
2022-06-24 18:46:06 -05:00
Alan Coopersmith
6168d93489 Fix spelling/wording issues
Found by using:
    codespell --builtin clear,rare,usage,informal,code,names

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-01-22 14:02:12 -08:00
Adam Jackson
42e260a7ab Adapt Block/WakeupHandler signature for ABI 23
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-07-19 10:12:45 -04:00
Matthieu Herrb
38d888e0f3 Fix shadow framebuffer implementation.
Makes it possible to run the nv driver without XAA on cards where
EXA is not supported.

Signed-off-by: Matthieu Herrb <matthieu@herrb.eu>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2015-12-21 16:45:08 +01:00
Egbert Eich
0b6619fec3 init: Initialize VGA IOBase before using it
The NV driver did never set the VGA IOBase for those registers which
have different addresses dependent whether the VGA engine is running in
mono or color mode.
This has not been detected as the VGA mode and font save/restore
functions initialize this value themselves.

Signed-off-by: Egbert Eich <eich@freedesktop.org>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
2013-08-16 09:14:04 +02:00
Jeremy White
49ee1c26ea Include xf86Modes.h to use functions from hw/xfree86/modes/xf86Modes.c.
Signed-off-by: Jeremy White <jwhite@codeweavers.com>
Reviewed-by: Robert Morell <rmorell@nvidia.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
2013-03-24 10:37:41 -07:00
Adam Jackson
fc78fe9822 Remove mibstore.h
Signed-off-by: Adam Jackson <ajax@redhat.com>
2012-09-25 08:54:49 -04:00
Dave Airlie
0d4ea629bc nv: add missing fbman includes.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-07-17 16:48:56 +10:00
Dave Airlie
86e83109d6 xf86-video-nv: bump to version 2.1.19
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-07-17 16:47:03 +10:00
Dave Airlie
e5e3e733d9 nv: make XAA optional.
This allows nv to build without XAA.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-07-16 18:48:32 +10:00
Dave Airlie
713e9501b8 nv: port to new compat API.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-07 15:52:16 +01:00
Adam Jackson
b3d6182883 Fix for new vgahw ABI
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-12-19 16:57:40 -05:00
Adam Jackson
5b7f07f817 Make failure to XAA non-fatal
Fall back to NoAccel on G80 since there's no shadowfb support there,
otherwise fall to shadowfb.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-12-19 16:55:30 -05:00
Nicolas Kaiser
4b03459a83 remove duplicated includes
Remove duplicated includes of guarded headers.

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
2011-04-25 12:01:54 -07:00
Cyril Brulebois
2b17d1ac57 Fix compiler warning.
Get rid of this with CFLAGS="-Wall -Werror":
|   CC     g80_display.lo
| cc1: warnings being treated as errors
| g80_display.c: In function ‘G80CrtcSetPClk’:
| g80_display.c:216: error: unused variable ‘i’

Signed-off-by: Cyril Brulebois <kibi@debian.org>
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Tested-by: Aaron Plattner <aplattner@nvidia.com>
2011-03-01 18:14:16 -08:00
Gaetan Nadon
470c5c662f Remove RANDR_12_INTERFACE checking, always defined.
RANDR_12_INTERFACE is defined in xserver/randr/randstr.h since version 1.2.
This driver only configures against xserver 1.3 or higher.

Reported-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
2010-07-23 11:28:52 -07:00
Aaron Plattner
90ee9cbb11 Add a missing " }," pointed out by Johannes Obermayr.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
2010-07-19 15:52:06 -07:00
Aaron Plattner
fd341048ba Merge branch 'master' of git://soprano/~aaron/xf86-video-nv 2010-07-19 11:34:39 -07:00
Gaetan Nadon
6d2431a37f The /compat code is no longer required.
This was used at one point in time to backport the modes code from server
1.3 to server 1.2. When the tarball was created, whatever modes code
was on the developer disk was included.

The server 1.2 as shipped in the tarball on the web does not contain the
modes code. It was added just after and found in git branch server-1.2-branch.

The modes code was initially included in version 2.0.95 and still compiles
with server 1.2. As of version 2.1.9 it no longer compiles.
Subsequent versions are not backward compatible and probably not meant to be.

The XRandR wiki points to articles saying that XRandR 1.2 first appeared in
server 1.3 and nv 2.0.95. Given that modes code in current server version
does not compile with server 1.2, and that the modes code is included in
version 1.3 and up, might as well stop including this modes code in the driver.

This patch makes the driver requiring server 1.3 or later.

This will solve the issue where "make dist" fails "out of the box"
and requires manual fix-up on the build machine which is documented
in the compat/README file.

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
2010-07-19 11:34:30 -07:00
Aaron Plattner
a2dc32c5c9 Add PCI table entries for the GeForce 315
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
2010-07-19 11:28:01 -07:00