438 Commits

Author SHA1 Message Date
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
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
0825d98744 vmware/vmwgfx: Fix compilation issue on older X servers
Introduced in 268307 "Add support for server managed fds"

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-11 19:08:07 +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
Thomas Hellstrom
0a596fd0c9 vmware/vmwgfx: Fix an error path segfault
Part of freedesktop.org bugzilla bug #80645
If taking a scanout reference on a pixmap fails, the
struct vmwgfx_screen_entry::pixmap pointer must be set to NULL, otherwise
the driver will incorrectly attempt to remove the scanout reference in the
error path, causing a segfault.

This problem is seen in the above-mentioned bug, but it is not the root
cause of the problem. With this patch applied, the server will terminate
cleanly instead of segfaulting.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2014-07-03 03:46:13 -07: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
Jakob Bornecrantz
82c9b0c1d3 vmware/vmwgfx: Fix auto colorkey fill usage
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Thomas Hellström <thellstrom@vmware.com>
2014-05-23 12:57:00 +02:00
Jakob Bornecrantz
43e043868f vmware/vmwgfx: A bit more error logging when handling cursors
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Thomas Hellström <thellstrom@vmware.com>
2014-05-23 12:57:00 +02:00
Jakob Bornecrantz
aa73092548 vmware/vmwgfx: Don't move cursors without images
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Thomas Hellström <thellstrom@vmware.com>
2014-05-23 12:56:59 +02:00
Thomas Hellstrom
e8d6facf34 vmware/vmwgfx: Fix xwayland build on newer XA versions
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2014-05-21 02:35:29 -07: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
Thomas Hellstrom
88c487cb19 vmware/saa: Disable the noreadback polyfillrect optimization
It causes rendering artefacts with some motif applications due to
damage area confusion. Until that is sorted out, temporarily disable the
optimization.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2014-05-09 11:41:40 +02:00
Thomas Hellstrom
f31eed4a57 vmware/vmwgfx: Fix initial dirty region for pixmaps
When storage is attached to pixmaps for the first time the dirty region is
set to cover either the hardware surface or the software buffer based on
the presence of the hardware surface.

However, if the storage was created as part of an accelerated operation,
the dirty region was assigned before the hardware surface was assigned to the
pixmap, causing the dirty region to incorrectly cover the software buffer.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2014-05-08 09:46:14 +02:00
Thomas Hellstrom
1ed14687a3 vmware/vmwgfx: Set desired modes after xMir screen init
While XMir does initial mode configuration, it leaves setting initial
modes to the DDX driver.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-11 12:35:11 +02:00
Thomas Hellstrom
64e0faf148 vmware/vmwgfx: Don't tell XA that we have a mask when we haven't
In some cases, the X server sends us a composit operation with
mask_pict != NULL, but mask_pix == NULL. Assume there's no mask
involved in that case.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-03 10:38:19 +02:00
Thomas Hellstrom
c062d08a50 vmware/vmwgfx: Don't change backing-store of active scanout surfaces
With option "HwPresents" on, the driver would sometimes change backing
store of active scanout surfaces, making the kernel module refuse to
present. This was caused by scanout surfaces not having the RENDERTARGET flag
on by default. So when rendered to, using copies or composites, they
would be reallocated. Fix this by adding the RENDERTARGET flag from start.

Also add code that prints out an error message when we change backing store
of active scanout surfaces

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2014-04-03 10:37:41 +02:00
Julien Cristau
c42e1f7506 configure: fix build without xatracker
ACTION-IF-NOT-FOUND is the fourth argument to PKG_CHECK_MODULES, not the
fifth.

Debian bug#743239 <https://bugs.debian.org/743239>

Reviewed-by: Thomas Klausner <wiz@NetBSD.org>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2014-04-01 14:12:00 +02:00
Jakob Bornecrantz
cbd56b3759 Bump the version number to 13.0.2
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2014-03-26 12:46:25 +01: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
8da981712f vmware/vmwgfx: Always allocate shared hardware surfaces.
Hardware surfaces are all likely to be shared at some point, and we *really*
don't want to change a hardware surface that is bound as a drm framebuffer.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2014-01-15 11:11:55 +01:00
Thomas Hellstrom
31bff9f7f3 vmware: Require libdrm 2.4.38 to build XMir.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2014-01-09 14:32:27 +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
f37684e716 vmwgfx: Block DMA to prime surfaces for now
Since there is currently no _good_ way to get the surface format of a
prime surface, we block DMA to these surfaces; we don't know if our
software data is compatible with the surface format.

This patch also makes sure that there is a hardware surface backing the
drawable we copy from.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2014-01-09 11:49:57 +01:00
Thomas Hellstrom
97ce302ddd vmwgfx: Enable direct dmas
Enable direct dmas instead of using the xa-provided dma functionality.
This saves a bounce-buffer software copy of all dma'd contents.

This also implies that all drawables with mixed software / hardware contents
will use a kernel buffer for software rendering.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-08 18:46:53 +01:00
Thomas Hellstrom
fd636e39a3 vmwgfx: Add support for XWayland
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:47:17 -08:00
Thomas Hellstrom
c020923597 vmwgfx: Add support for XMir v2.
Use the hosted infrastructure to add support for XMir.
Helpers go in vmwgfx_saa.c.

v2: Added comments for the helpers, and added a
vmwgfx_flush_dri2 to be executed when coming back from vt switch.

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:47:11 -08: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