Commit Graph

190 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult
21ff050962 use new pixmap lifecycle api
Use server's new lifecycle API. That's an important step in order to decouple
ourselves from the old, fragile proc wrapping. Without it, the driver might not
work on newer Xservers anymore. For old Xservers adding a fallback.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-01-02 16:16:12 +01:00
Enrico Weigelt, metux IT consult
f0c20d7fca drop compat with really ancient Xserver versions
The oldest one we support is 25.0.0.1

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-18 16:34:52 +01:00
Enrico Weigelt, metux IT consult
e8f258454b drop hacks for ancient pre-libpciaccess Xservers
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-18 14:06:08 +01:00
Enrico Weigelt, metux IT consult
846c557d7c drop obsolete #ifdef XFree86LOADER
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-18 13:51:51 +01:00
Enrico Weigelt, metux IT consult
ea228a12f6 drop obsolete #ifdef HAVE_CONFIG_H
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-18 11:42:24 +01:00
Enrico Weigelt, metux IT consult
cbd330076a don't hard-crash Xserver on strdup() failure
The situation already is handled gracefully (by the next line),
so no need to hard-crash the Xserver.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-08 18:41:31 +01:00
Enrico Weigelt, metux IT consult
b0dcacb02b use strdup() instead of xstrdup() / Xstrdup()
The NULL check is trivial enough so that we don't need an actual
function call for this. Once nobody uses it anymore, it can be
dropped from Xserver ABI.

See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1800
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-08 18:39:23 +01:00
Enrico Weigelt, metux IT consult
0a87b26952 vmwarexinerama: fix missing include of extinit.h
Don't realy it being included indirectly from somewhere else by accident.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-24 16:33:41 +02:00
Enrico Weigelt, metux IT consult
90c79a5d26 use XNFstrdup() instead of xnfstrdup
xnfstrdup is just an alias for XNFstrdup() 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>
2025-06-20 18:56:57 +02:00
Enrico Weigelt, metux IT consult
50ac338a9d 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>
2025-06-20 18:56:52 +02:00
Enrico Weigelt, metux IT consult
d59bd31c4d drop obsolete check for _X_EXPORT
We're relying on xserver >= 1.18, so need to check for this macro anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-20 18:56:45 +02:00
Enrico Weigelt, metux IT consult
3f45b624ef drop compat with ancient xserver versions
We're relying on at least 1.18 now.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-20 18:56:37 +02:00
Enrico Weigelt, metux IT consult
7d7aa65d64 fix FTBS on XSERVER_LIBPCIACCESS
Not all Xserver versions define that symbol with a numeric value
(1 or 0), some just might not define it at all when disabled.

Using #if instead of #ifdef (as most sites do) will lead to compile break:

    ../../src/vmware.c:1102:25: error: expected value in expression
    #if XSERVER_LIBPCIACCESS
                        ^

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-20 18:56:29 +02:00
Enrico Weigelt, metux IT consult
4f854bb179 drop unused check for _MSC_VER
This driver obviously doesn't work under Windows.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 14:28:57 +01:00
Enrico Weigelt, metux IT consult
1aa9991347 drop compat for ancient xserver versions
We're relying on at least 1.18 now.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 14:28:57 +01:00
Enrico Weigelt, metux IT consult
f52fb170fb drop compat with ancient xserver versions
We're relying on at least 1.18 now.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 14:28:57 +01:00
Alan Coopersmith
3a7a8084fe common_compat.h: fix typo in header guard definition
Found by clang 13.0.1:

./common_compat.h:1:9: warning: '_COMMON_COMPAT_H_' is used as a header
 guard here, followed by #define of a different macro [-Wheader-guard]
#ifndef _COMMON_COMPAT_H_
        ^~~~~~~~~~~~~~~~~
./common_compat.h:2:9: note: '_COMMOM_COMPAT_H_' is defined here;
 did you mean '_COMMON_COMPAT_H_'?
#define _COMMOM_COMPAT_H_
        ^~~~~~~~~~~~~~~~~
        _COMMON_COMPAT_H_

Fixes: d8c2f85 ("vmware: Fix build warnings")
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-vmware/-/merge_requests/14>
2024-11-10 12:48:44 -08:00
Ville Skyttä
c59c5d241a Spelling fixes.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-09-29 18:04:25 -07:00
Thomas Hellstrom
86189966c3 vmwgfx: Limit the number of cliprects in a drm dirtyfb command v3
The drm dirtyfb command would error if the number of cliprects were larger
than DRM_MODE_FB_DIRTY_MAX_CLIPS. If that number is exceeded, split the
command up.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com> #v2
Reviewed-by: Deepak Rawat <drawat@vmware.com> #v1
2019-01-28 14:47:55 +01:00
Thomas Hellstrom
ba4ef498fd vmwgfx: Don't exceed the device command size limit v3
With a huge number of DMA clip rects we could exceed the device command
buffer command size limit. Fix this by sending multiple DMA commands
when we exceed the limit.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Deepak Rawat <drawat@vmware.com> #v1
2019-01-28 14:47:55 +01:00
Alan Coopersmith
71c85a70f1 Remove obsolete B16 & B32 tags in struct definitions
They were defined as empty strings on all platforms except for the
long unsupported Cray systems which needed to use bitfields to define
any type smaller than 64-bits.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
2018-11-12 13:35:21 +01:00
Adam Jackson
0f90e2ed52 saa: Build compatibility with xserver 1.20
fbGetRotatedPixmap went away with 24bpp support, just treat it as NULL
and we'll do the right thing.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2018-03-14 21:49:14 +01:00
Thomas Hellstrom
3cdeaa5db7 Fix a couple of shadowed declaration warnings
In some enviroments, "index", "y1" and "y2" are defined globally causing
warnings about shadowed declarations. Fix this.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2018-02-20 09:36:20 +01:00
Thomas Hellstrom
4ea5c4d5fa Build fixes
A couple of more build fixes for older X servers.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
2018-02-20 09:35:41 +01:00
Thomas Hellstrom
ea77ce3a20 legacy: Silence a warning about an unused constant
VMWAREBuildStr was only used in the !LIBPCIACCESS path.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
Reviewed-by: Deepak Rawat <drawat@vmware.com>
2018-02-15 08:32:38 +01:00
Thomas Hellstrom
7503135a72 legacy: Avoid using the xf86[Un]blockSigio functions
They have been deprecated since mouse doesn't use SIGIO anymore.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
Reviewed-by: Deepak Rawat <drawat@vmware.com>
2018-02-15 08:31:27 +01:00
Thomas Hellstrom
dc85a6da15 Fix a number of compilation warnings
There are a number of compilation warnings caused by const char pointers
being either explicitly or implicitly cast to char pointers. There
are a number of ABI differences that have hindered this so far, but
make a new attempt using the common_compat.h defines.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
Reviewed-by: Deepak Rawat <drawat@vmware.com>
2018-02-15 08:27:30 +01:00
Thomas Hellstrom
1674782e35 Add the common_compat.h source file for distribution
The common_compat.h source file was missing from Makefile.am causing
"make distcheck" to fail.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2018-01-03 21:26:22 +01:00
Deepak Singh Rawat
d8c2f85013 vmware: Fix build warnings
Due to following commit in xserver there were
build warnings, as variables now declared const.

d89b42bda46d36fc0879611cc3b3566957ce36d0
e1e01d2e33c632e395d7e396f73fba8ae606b15a

Added a compat header file.

Signed-off-by: Deepak Rawat <drawat@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>:q
2017-08-07 15:57:56 -07:00
Hans de Goede
d64d01c7a5 Adapt Block/WakeupHandler signature for ABI 23
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Thomas Hellstrom <thellstrom@vmware.com>
2016-11-16 11:09:12 +07:00
Thomas Klausner
8f0cf7c035 Add 2560x1440 to supported resolutions.
Native resolution on iMac 27".
Reported missing by Benjamin Lorenz in
http://gnats.netbsd.org/49094

Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
2015-01-20 08:20:37 +01:00
Thomas Hellstrom
8b6316a312 vmware/legacy: Fix overlay related compile breakage on earlier X servers
Introduced by commit:
vmware/legacy: Apply same fix to auto colrkey fill

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2014-08-28 15:45:41 +02:00
Thomas Hellstrom
8a47e9a450 vmware: Fix bootstrap related compile errors on earlier X servers
Introduced by commit
Add support for XSERVER_PLATFORM_BUS

Note that the vmware DriverRec declaration can be cleaned up
considerably using C99 designated initializers. Perhaps something for
the next release...

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2014-08-28 15:41:17 +02:00
Thomas Hellstrom
f5d8c8f1fe vmware: Clear the PITCHLOCK register if available before modeset
In some situations the fbdev driver may have set this register before legacy
driver startup causing a weird-looking desktop. Make sure this register
is cleared on each modeset.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2014-08-25 11:50:07 +02:00
Jakob Bornecrantz
b169743434 vmware/legacy: Fix out of bound array indexing
Spotted by coverity.

Reported-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2014-08-14 16:46:48 +02:00
Jakob Bornecrantz
0a212afefd vmware/legacy: Fix uninitialized values in video commands
Fixed bug where video stopped working on systems that didn't have the new kms
enabled kernel driver installed. Found on CentOS 6.4.

After updating the register header SVGA_VIDEO_NUM_REGS value got upped by two
in order to support GMR and Screen Objects. Since this path is mostly used
on older hosts that may not support them, don't send them at all.

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-11 19:08:03 +02:00
Jakob Bornecrantz
4e378a730d vmware/legacy: Apply same fix to auto colorkey fill
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Thomas Hellström <thellstrom@vmware.com>
2014-05-23 12:57:01 +02:00
Hans de Goede
268307e85c Add support for server managed fds
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2014-05-14 12:08:17 +02:00
Hans de Goede
675fe58eee Add support for XSERVER_PLATFORM_BUS
This is a preparation patch for adding support for server managed fds.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2014-05-14 12:08:17 +02:00
Jakob Bornecrantz
51cdfa6f51 vmware: Fix compilation on newer X servers
Found by Bryan Lee. Later versions of X.org turns dispMode pointers
into const upsetting gcc, turn them into size_t's instead.

Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
2014-02-26 19:02:45 +01:00
Thomas Hellstrom
d6b179a5ad vmware: Fix build errors and warnings
A previous commit and the hosted merge unfortunately brought in some build
errors / warnings on early X servers.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2014-01-09 14:31:46 +01:00
Thomas Hellstrom
c8e1c49843 vmwgfx: Add an infrastructure to be able to run hosted under a compositor v2
Figure out what's needed both for XMir and XWayland and make a common
driver structure out of it.

v2: Added a lot of comments. No code change.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2013-12-19 07:46:20 -08:00
Thomas Hellstrom
7ac45326ec vmwgfx: Fix some compilation warnings and indentations
Most of the compilation warnings we're seeing are due to bad xorg headers,
but fix the ones we can fix in the driver. Some indentation fixes as well.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2013-12-05 01:01:14 -08:00
Zack Rusin
23d87c92b7 Kill mibstore
It was a noop for at least 5 years and it has been removed.

Signed-off-by: Zack Rusin <zackr@vmware.com>
2013-02-14 20:48:57 -08:00
Dave Airlie
e5ac80d8f7 vmware: avoid warnings about shadowing 'i'
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-07-03 13:50:30 +01:00
Dave Airlie
46c0862d20 vmware: drop infoFromScreen inline in favour of new interface
This also should fix the build regression introduced with the fix
for this macro.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-07-03 13:49:27 +01:00
Robert Hooker
50c01998c7 vmware: Fix up some warnings after new compat API change.
Fixes multiple instances of these warnings on x86_64:
../../src/vmware.h:180:5: warning: implicit declaration of function 'xf86ScreenToScrn' [-Wimplicit-function-declaration]
../../src/vmware.h:180:5: warning: nested extern declaration of 'xf86ScreenToScrn' [-Wnested-externs]
../../src/vmware.h:180:5: warning: return makes pointer from integer without a cast [enabled by default]
Function `xf86ScreenToScrn' implicitly converted to pointer at ../../src/vmware.h:180

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Robert Hooker <sarvatt@ubuntu.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2012-06-15 20:21:32 +02:00
Dave Airlie
61df95a86f vmware: port vmware driver to new compat API
This is a port of the vmware driver to the new compat API.

Tested-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2012-06-09 05:54:30 +02:00
Jakob Bornecrantz
c6f27561c7 vmware/legacy: Fix crash on Xserver 1.12.0
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Zack Rusin <zackr@vmware.com>
2012-03-20 22:17:55 +01:00
Gaetan Nadon
04169f3860 config: include saa and vmwgfx subdirs in the tarball
Use AM_CONDITIONAL. Automake knows what to distribute.
It needs to be able to navigate down the subdirs to find what
needs to be included in the tarball.

To test reliably, create a tarball and expand it into a separate
directory and build with xatracker. Distcheck will not detect
missing code when such code is configured not to build.

The content of a tarball *must* always be identical, regardless
of the configuration options used or on which platform it was configured.

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2012-03-13 21:37:52 +01:00