Commit Graph

368 Commits

Author SHA1 Message Date
Thomas Hellstrom
7b163c018b Require at least XA version 2.4 to enable dri3
The XA version was bumped from 2.3 to 2.4 to signal that there were no
significant correctness or performance regressions when running dri3
compared to dri2 on the vmware driver stack.

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-05-17 09:17:45 +02:00
Thomas Hellstrom
6b7dc2f930 vmwgfx: Clear the DRM mode before use
Avoid sending partially uninitialized data to the kernel.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
2018-04-26 11:48:37 +02: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
1899b0896d vmwgfx: Fix server termination due to a mesa loader bug
Some versions of the Gallium loader close our drm file descriptor if
xa_tracker_create() fails (typically 2D VMs.) While this is mostly fixed
everywhere, we implement a workaround to avoid tracking down the same bug
again and again on those setups where this is not fixed in mesa.

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:33:48 +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
69632d06e2 vmwgfx: Fix potential libudev include and link failures
We were not including the proper include- and link flags for libudev.

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:30:05 +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
98199b4c0a vmwgfx: Remove old XWayland and XMir drivers
Old-style XWayland and XMir aren't available 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:26:26 +01:00
Thomas Hellstrom
943548ac76 vmwgfx: Fix compilation failure if dri3 is not available
Compilation on CentOS failed due to some code not being conditioned on
DRI3 headers being present.

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:25:57 +01:00
Thomas Hellstrom
2d769dc01e saa: Fix an include path
Fix compilation failure on CentOS 6.5 due to an incorrect include 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:05:37 +01:00
Thomas Hellstrom
c0a2f40d97 Bump version number for release candidate
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2018-01-03 21:28:56 +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
Thomas Hellstrom
08ad438e27 vmwgfx: Support DRI3 v2
Add server-side DRI3 support

Currently DRI3 introduces extra latency with gnome-shell for
the following reasons:
1) We enable GLX_EXT_buffer_age. Causes gnome-shell to post fullscreen damage.
2) We enable GLX_OML_sync_control. Cases additional slowdown.
Not exactly sure why.

Probably we want to implement workarounds in mesa so that we don't enable
these extensions for gnome-shell. That can be done with driconf, using some
trickery.

v2: Verify that sharing an ARGB surface as XRGB works before enabling
DRI3.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
2017-08-21 11:33:43 +02:00
Thomas Hellstrom
c8b8b2ee4a Revert "vmware/vmwgfx: Support multiple dri driver names"
This reverts commit d5550b7f83.

The commit was intended to support video drivers, but has the side effect
that GLX thinks our driver supports more than it does.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
2017-08-21 11:33:34 +02:00
Deepak Singh Rawat
3aff4ee5ca vmware/vmwgfx: Wrap deprecated
Deprecated with 43dbc556f3a4d743b9121d6cfc21961be4a9da56

Signed-off-by: Deepak Rawat <drawat@vmware.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
2017-08-07 16:12:56 -07: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
Sinclair Yeh
ed0fd2f282 Revert "Revert "vmware/vmwgfx: Support multiple dri driver names""
This reverts commit ea94dc5708.

Temporarily revert this for internal testing.
2017-07-13 20:27:40 +02:00
Sinclair Yeh
1388a1592c Revert "vmwgfx: Support DRI3 v2"
This reverts commit d0d5cf3e35.

Temporarily revert this for internal testing.
2017-07-13 20:27:29 +02:00
Thomas Hellstrom
d0d5cf3e35 vmwgfx: Support DRI3 v2
Add server-side DRI3 support

Currently DRI3 introduces extra latency with gnome-shell for
the following reasons:
1) We enable GLX_EXT_buffer_age. Causes gnome-shell to post fullscreen damage.
2) We enable GLX_OML_sync_control. Cases additional slowdown.
Not exactly sure why.

Probably we want to implement workarounds in mesa so that we don't enable
these extensions for gnome-shell. That can be done with driconf, using some
trickery.

v2: Verify that sharing an ARGB surface as XRGB works before enabling
DRI3.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
2017-05-11 07:34:52 -07:00
Thomas Hellstrom
ea94dc5708 Revert "vmware/vmwgfx: Support multiple dri driver names"
This reverts commit d5550b7f83.

The commit was intended to support video drivers, but has the side effect
that GLX thinks our driver supports more than it does.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
2017-05-11 07:34:19 -07:00
Mihail Konev
ed9d2a3fde autogen: add default patch prefix
Signed-off-by: Mihail Konev <k.mvc@ya.ru>
2017-01-26 14:00:22 +10:00
Emil Velikov
fa4998d1b9 autogen.sh: use quoted string variables
Place quotes around the $srcdir, $ORIGDIR and $0 variables to prevent
fall-outs, when they contain space.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-26 11:26:29 +10:00
Peter Hutterer
4a96179cdb autogen.sh: use exec instead of waiting for configure to finish
Syncs the invocation of configure with the one from the server.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-01-26 11:23:47 +10:00
Alan Coopersmith
670db8dbf2 autogen.sh: Honor NOCONFIGURE=1
See http://people.gnome.org/~walters/docs/build-api.txt

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2017-01-26 11:16:38 +10:00
Alan Coopersmith
91881a6619 configure: Drop AM_MAINTAINER_MODE
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2017-01-26 11:16:37 +10:00
Thomas Hellstrom
fade4f46e8 vmware/vmwgfx: Add a missing source file for distribution
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
2016-11-16 12:54:35 +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 Hellstrom
d5550b7f83 vmware/vmwgfx: Support multiple dri driver names
Support sending multiple driver names and dri2 INFOREC v4.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2016-05-30 14:01:31 +02:00
Thomas Hellstrom
0bcd4df184 vmware: Bump minor to signal availability of new features
While this may never be an official release, bump minor to enable the
new resolutionKMS functionality. This signals the availability of
autolayout and resolutionKMS support.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2016-05-30 14:00:25 +02:00
Thomas Hellstrom
5036e9d11a vmware/vmwgfx: Don't require screen objects to run
Using the vmwgfx ldu backend works just as fine except that we're limited
to implicit layout placement.

With this test on, we may end up in the odd situation that the vmwgfx kernel
module and the vwmare legacy Xorg driver are enabled simultaneously, and that
is an unsupported configuration. It will also break resolutionKMS which will
be enabled based on vmwgfx version but should be disabled since the legacy
Xorg driver runs...

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2016-05-30 13:59:42 +02:00
Thomas Hellstrom
57d4499cc2 vmware/vmwgfx: Disable autolayout if we detect an old resolutionset
While the autolayout feature should really avoid races both with the old
resolutionSet RandR12 code and with new compositor layout code, let's
disable the autolayout feature if someone tries to set the
layout / resolution through the vmwarectrl interface.
That's most likely an old resolutionSet.

Autolayout is turned on on each new screen generation.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
2016-02-11 09:15:12 +01:00
Thomas Hellstrom
48fb82f13c vmware/vmwgfx: Read the implicit output status from KMS if available.
This information is used to switch to software cursors if we have
multiple overlapping explicit outputs and thus might need to display
two cursors simultaneously.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
2016-02-11 09:15:12 +01:00
Thomas Hellstrom
a81e359d88 vmware/vmwgfx: Avoid filling the log with modeline printouts
There are specific debug options for that.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
2016-02-11 09:15:12 +01:00
Thomas Hellstrom
5978597da9 vmware/vmwgfx: Add a layout handler v2
Add a handler that, on hotplug events, scans for a new GUI layout and
tries to set that layout using XRandR similar to what the RandR1.2 part of
vmware tools resolutionSet module is doing today.

v2: Address review comments
- Keep the old layout in case of screen resizing errors
- Fix the vmwgfx_layout handler() declaration.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
2016-02-11 09:14:05 +01:00
Thomas Hellstrom
885e360b16 vmware/vmwgfx: Update RandR output properties on hotplug events v2
Update also RandR output properties when we receive hotplug events;
the RRGetInfo function doesn't do this.

This makes sure RandR sends out property change events to clients.
Also remove some debugging printouts.

v2: Address review comment from Sinclair Yeh;
make sure struct output_private::drm_connector is always valid.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
2016-02-11 09:13:36 +01:00
Thomas Hellstrom
ada41a5988 vmware/vmwgfx: Add missing includes of the config.h header.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
2016-02-01 15:07:23 +01:00
Thomas Hellstrom
755e38f373 vmware/vmwgfx: Expose kernel connector attributes and react to hotplug events
Much of this code is borrowed from the xf86-video-modesetting driver.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
2016-02-01 15:06:44 +01:00
Thomas Hellstrom
1e443c4717 vmware/vmwgfx: Try to use only_hw_present semantics if screen targets are enabled
If screen targets are enabled and there is a reasonable chance that the vmwgfx
drm driver can use the surface backing a pixmap as a screen target surface,
then make that surface a modesetting framebuffer rather than the corresponding
DMA buffer. In practice this applies when we start scanning out from the
origin (0,0) of the pixmap. However, we would also like to apply the constraint
that the scanout area is the entire pixmap, since that is the constraint used
by the drm driver, but that would currently require drm framebuffer
reallocations and possible flicker, so disable that for now. The drm driver
will correctly handle the possibly oversized surface handed to it anyway, and
the cost we pay for this is an extra hardware copy of the dirtied area when
doing a software update of the scanout.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
2015-05-04 23:26:34 -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
Adam Jackson
ab5be23120 saa: Adapt to GC client clip changes in xserver 1.17
1.17 always stores the client clip as a region, so there's no longer a
clientClipType member to look at.  Change the code to just inspect
whether the clientClip is non-null, since that works both before and
after 1.17.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
2015-01-15 08:51:57 +01:00
Thomas Hellstrom
3f7defa8dc vmware/vmwgfx: Make large Xv video blits cheaper
As screens grow larger, attempt to make large Xv video blits cheaper by
performing the color conversion and scaling in two steps:

1) Color conversion which has a 4x4 matrix multiplication shader is performed
   to a bounce buffer the size of which is never larger than the source image.
2) Scaling is performed as a src composite blit to the destination image with
   a simple copy shader.

This split is done only if the destination image is substantially larger than
the source image / bounce buffer

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
2014-11-18 19:53:27 +01:00
Stefan Dirsch
4664412d7a xf86xv.h cannot be included without first including xorg-server.h.
Without this the build fails on systems with the latest glibc,
throwing this error:

In file included from /usr/include/string.h:634:0,
                 from /usr/include/xorg/os.h:53,
                 from /usr/include/xorg/misc.h:115,
                 from /usr/include/xorg/screenint.h:50,
                 from /usr/include/xorg/scrnintstr.h:50,
                 from /usr/include/xorg/xvdix.h:55,
                 from /usr/include/xorg/xf86xv.h:32,
                 from vmwgfx_overlay.c:38:
/usr/include/xorg/os.h:579:1: error: expected identifier or '(' before '__extension__'
strndup(const char *str, size_t n);

This is caused by HAVE_STRNDUP not being set (it is set from xorg-server.h),
causing os.h to redefine it.

Signed-off-by: Stefan Dirsch <sndirsch@suse.de>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Thomas Hellstrom <thellstrom@vmware.com>
2014-10-14 09:41:52 +02:00
Thomas Hellstrom
8e1c4e5bd5 vmware/saa: Fix saa_check_poly_fill_rect_noreadback v2
We were not clipping the dirty region correctly, Fix this.
Also actually do what the comment in the function says: If there are more than
an ad-hoc number of rectangles to read back, then revert to the default
saa_check_poly_fill_rect function that reads back the whole damage region.

v2: Fix commit log message.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2014-09-24 11:59:06 +02:00
Thomas Hellstrom
c23fd33d8c vmware/saa: Fix saa_check_copy_window dirty region v3
The saa_check_copy_window could dirty regions that were never touched, since
we were using the X server provided damage region rather than the more
detailed region actually copied. This would have been OK if we had first done
a read-back of the region to be dirtied, but since we want to avoid that,
instead compute the detailed destination region and use that for dirtying.

This fixes rendering glitches seen with motif applications.

v2: Fix whitespace error.
v3: Move dirty region computation.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2014-09-24 11:57:08 +02:00
Thomas Hellstrom
f86434ac69 Revert "vmware/saa: Disable the noreadback polyfillrect optimization"
This reverts commit 88c487cb19.

While the commit made the rendering artefacts less frequent, they didn't
disappear completely and are likely caused by something else, so revert this
commit.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Acked-by: Sinclair Yeh <syeh@vmware.com>
2014-09-23 18:15:11 +02:00
Thomas Hellstrom
8545a16693 vmware/vmwgfx: Fix cursor problem with multimon
In a multimon environment, the cursor would sometimes disappear on the
newly enabled screen. Fix this.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2014-09-09 04:25:29 -07:00
Thomas Hellstrom
3256212975 vmware/vmwgfx: Don't add pixmaps to the pixmap list if they're already on it
This could cause loops through the list to spin indefinitely.
This would most likely occur at VT switches.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2014-09-03 07:27:53 -07:00