Update to xf86-video-vmware 13.1.0

This commit is contained in:
matthieu 2015-01-25 18:57:12 +00:00
parent b914c84312
commit 166b04a2db
17 changed files with 657 additions and 65 deletions

View File

@ -1,3 +1,384 @@
commit 891ee48e4c1baa2643eda048b4207f8263a37dca
Author: Thomas Hellstrom <thellstrom@vmware.com>
Date: Mon Jan 19 11:23:50 2015 +0100
vmware: Bump version number for release
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
commit 79289b0ffc553ded902eea7b8b9803b098f340e3
Author: Adam Jackson <ajax@redhat.com>
Date: Thu Dec 4 10:35:04 2014 -0500
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>
commit 4664412d7a5266d2b392957406b34abc5db95e48
Author: Stefan Dirsch <sndirsch@suse.de>
Date: Tue Oct 7 11:29:32 2014 +0200
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>
commit 8e1c4e5bd521ec2d4f1a21da432f110c606b3fde
Author: Thomas Hellstrom <thellstrom@vmware.com>
Date: Mon Sep 22 12:09:13 2014 +0200
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>
commit c23fd33d8ce8491891255d93c04e053bf333bd4e
Author: Thomas Hellstrom <thellstrom@vmware.com>
Date: Mon Sep 22 11:43:02 2014 +0200
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>
commit f86434ac69bd288c7fba65d178c22a91a0f4f6c2
Author: Thomas Hellstrom <thellstrom@vmware.com>
Date: Mon Sep 15 15:13:53 2014 +0200
Revert "vmware/saa: Disable the noreadback polyfillrect optimization"
This reverts commit 88c487cb19aaf2882d582f7f887a52935ef8d92e.
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>
commit 8545a166931617af0d2a9ca8175fd8b11c67e246
Author: Thomas Hellstrom <thellstrom@vmware.com>
Date: Tue Sep 9 01:59:07 2014 -0700
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>
commit 32562129750077a23f26f2e69adc8403eb24bf3f
Author: Thomas Hellstrom <thellstrom@vmware.com>
Date: Wed Sep 3 07:08:41 2014 -0700
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>
commit 8b6316a312689d83ca8f8de939698bc137206f58
Author: Thomas Hellstrom <thellstrom@vmware.com>
Date: Thu Aug 28 15:32:45 2014 +0200
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>
commit 8a47e9a45036005d46a60cf8df366baffcb9a8d1
Author: Thomas Hellstrom <thellstrom@vmware.com>
Date: Thu Aug 28 13:43:03 2014 +0200
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>
commit f5d8c8f1fe2de727018600f471b6a8829fe492ad
Author: Thomas Hellstrom <thellstrom@vmware.com>
Date: Wed Aug 20 13:02:58 2014 +0200
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>
commit b1697434348799b0808a6c9e9a899394075b980c
Author: Jakob Bornecrantz <jakob@vmware.com>
Date: Thu Aug 14 16:42:05 2014 +0200
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>
commit 0825d98744b20a20af7bd81d347334ab4a1de015
Author: Jakob Bornecrantz <jakob@vmware.com>
Date: Sat Aug 9 00:19:17 2014 +0200
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>
commit 0a212afefd8670a1823c9b6474de8bf26d33bdeb
Author: Jakob Bornecrantz <jakob@vmware.com>
Date: Fri Aug 8 21:37:38 2014 +0200
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>
commit 0a596fd0c92fdcf73071869a59029263a2596018
Author: Thomas Hellstrom <thellstrom@vmware.com>
Date: Wed Jul 2 14:21:45 2014 +0200
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>
commit 4e378a730d2d2deffc915af2a3d013d2a994a1b0
Author: Jakob Bornecrantz <jakob@vmware.com>
Date: Wed May 21 11:52:29 2014 +0200
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>
commit 82c9b0c1d34459c568d004521e3f35a69f5d7ae3
Author: Jakob Bornecrantz <jakob@vmware.com>
Date: Wed May 21 11:51:46 2014 +0200
vmware/vmwgfx: Fix auto colorkey fill usage
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Thomas Hellström <thellstrom@vmware.com>
commit 43e043868fbd74e28cd392a3665b36abdfe87de0
Author: Jakob Bornecrantz <jakob@vmware.com>
Date: Wed May 21 11:54:48 2014 +0200
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>
commit aa7309254808e27a4ac5d3dc674be179646280b5
Author: Jakob Bornecrantz <jakob@vmware.com>
Date: Wed May 21 11:54:24 2014 +0200
vmware/vmwgfx: Don't move cursors without images
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Thomas Hellström <thellstrom@vmware.com>
commit e8d6facf34adf1c601a3afd0a984ce90ad8fe059
Author: Thomas Hellstrom <thellstrom@vmware.com>
Date: Tue May 20 06:29:19 2014 -0700
vmware/vmwgfx: Fix xwayland build on newer XA versions
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
commit 268307e85c06be27345a6808bcf2b3c9887bf8bc
Author: Hans de Goede <hdegoede@redhat.com>
Date: Tue May 6 16:33:21 2014 +0200
Add support for server managed fds
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
commit 675fe58eee8acdb302c3501236b86a3289991053
Author: Hans de Goede <hdegoede@redhat.com>
Date: Tue May 6 16:00:50 2014 +0200
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>
commit 88c487cb19aaf2882d582f7f887a52935ef8d92e
Author: Thomas Hellstrom <thellstrom@vmware.com>
Date: Fri May 9 09:35:59 2014 +0200
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>
commit f31eed4a578784329a7038aa01acaa10a2d0c246
Author: Thomas Hellstrom <thellstrom@vmware.com>
Date: Thu May 8 09:24:04 2014 +0200
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>
commit 1ed14687a3f1092db8504fb9cf4f446451801665
Author: Thomas Hellstrom <thellstrom@vmware.com>
Date: Thu Apr 10 14:05:24 2014 +0200
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>
commit 64e0faf1480663a990e0f6aeef7af0e69845af49
Author: Thomas Hellstrom <thellstrom@vmware.com>
Date: Wed Apr 2 14:05:23 2014 +0200
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>
commit c062d08a50a26c99a3b8f565a8b2b00e8dc21c3f
Author: Thomas Hellstrom <thellstrom@vmware.com>
Date: Thu Jan 16 18:27:57 2014 +0100
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>
commit c42e1f750629f18144d065b8bba5e2eaf6cbf675
Author: Julien Cristau <jcristau@debian.org>
Date: Tue Apr 1 10:11:13 2014 +0200
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>
commit cbd56b3759f01ec18ae0705d023e4c0b2ab38c25 commit cbd56b3759f01ec18ae0705d023e4c0b2ab38c25
Author: Jakob Bornecrantz <jakob@vmware.com> Author: Jakob Bornecrantz <jakob@vmware.com>
Date: Wed Mar 26 12:45:52 2014 +0100 Date: Wed Mar 26 12:45:52 2014 +0100

View File

@ -1,6 +1,6 @@
#! /bin/sh #! /bin/sh
# Guess values for system-dependent variables and create Makefiles. # Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for xf86-video-vmware 13.0.2. # Generated by GNU Autoconf 2.69 for xf86-video-vmware 13.1.0.
# #
# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>. # Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
# #
@ -591,8 +591,8 @@ MAKEFLAGS=
# Identity of this package. # Identity of this package.
PACKAGE_NAME='xf86-video-vmware' PACKAGE_NAME='xf86-video-vmware'
PACKAGE_TARNAME='xf86-video-vmware' PACKAGE_TARNAME='xf86-video-vmware'
PACKAGE_VERSION='13.0.2' PACKAGE_VERSION='13.1.0'
PACKAGE_STRING='xf86-video-vmware 13.0.2' PACKAGE_STRING='xf86-video-vmware 13.1.0'
PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg' PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg'
PACKAGE_URL='' PACKAGE_URL=''
@ -1373,7 +1373,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing. # Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh. # This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF cat <<_ACEOF
\`configure' configures xf86-video-vmware 13.0.2 to adapt to many kinds of systems. \`configure' configures xf86-video-vmware 13.1.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]... Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1444,7 +1444,7 @@ fi
if test -n "$ac_init_help"; then if test -n "$ac_init_help"; then
case $ac_init_help in case $ac_init_help in
short | recursive ) echo "Configuration of xf86-video-vmware 13.0.2:";; short | recursive ) echo "Configuration of xf86-video-vmware 13.1.0:";;
esac esac
cat <<\_ACEOF cat <<\_ACEOF
@ -1584,7 +1584,7 @@ fi
test -n "$ac_init_help" && exit $ac_status test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then if $ac_init_version; then
cat <<\_ACEOF cat <<\_ACEOF
xf86-video-vmware configure 13.0.2 xf86-video-vmware configure 13.1.0
generated by GNU Autoconf 2.69 generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc. Copyright (C) 2012 Free Software Foundation, Inc.
@ -1908,7 +1908,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake. running configure, to aid debugging if configure makes a mistake.
It was created by xf86-video-vmware $as_me 13.0.2, which was It was created by xf86-video-vmware $as_me 13.1.0, which was
generated by GNU Autoconf 2.69. Invocation command line was generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@ $ $0 $@
@ -3790,7 +3790,7 @@ fi
# Define the identity of the package. # Define the identity of the package.
PACKAGE='xf86-video-vmware' PACKAGE='xf86-video-vmware'
VERSION='13.0.2' VERSION='13.1.0'
cat >>confdefs.h <<_ACEOF cat >>confdefs.h <<_ACEOF
@ -19282,7 +19282,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their # report actual input values of CONFIG_FILES etc. instead of their
# values after options handling. # values after options handling.
ac_log=" ac_log="
This file was extended by xf86-video-vmware $as_me 13.0.2, which was This file was extended by xf86-video-vmware $as_me 13.1.0, which was
generated by GNU Autoconf 2.69. Invocation command line was generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES CONFIG_FILES = $CONFIG_FILES
@ -19348,7 +19348,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\ ac_cs_version="\\
xf86-video-vmware config.status 13.0.2 xf86-video-vmware config.status 13.1.0
configured by $0, generated by GNU Autoconf 2.69, configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\" with options \\"\$ac_cs_config\\"

View File

@ -23,7 +23,7 @@
# Initialize Autoconf # Initialize Autoconf
AC_PREREQ([2.60]) AC_PREREQ([2.60])
AC_INIT([xf86-video-vmware], AC_INIT([xf86-video-vmware],
[13.0.2], [13.1.0],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
[xf86-video-vmware]) [xf86-video-vmware])
AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_SRCDIR([Makefile.am])

View File

@ -349,7 +349,7 @@ saa_gc_reads_destination(DrawablePtr pDrawable, GCPtr pGC)
{ {
return ((pGC->alu != GXcopy && pGC->alu != GXclear && pGC->alu != GXset && return ((pGC->alu != GXcopy && pGC->alu != GXclear && pGC->alu != GXset &&
pGC->alu != GXcopyInverted) || pGC->fillStyle == FillStippled || pGC->alu != GXcopyInverted) || pGC->fillStyle == FillStippled ||
pGC->clientClipType != CT_NONE || pGC->clientClip != NULL ||
!SAA_PM_IS_SOLID(pDrawable, pGC->planemask)); !SAA_PM_IS_SOLID(pDrawable, pGC->planemask));
} }

View File

@ -421,17 +421,20 @@ saa_check_poly_fill_rect_noreadback(DrawablePtr pDrawable, GCPtr pGC,
if (!region) if (!region)
goto out_no_region; goto out_no_region;
REGION_TRANSLATE(pGC->pScreen, region, xoff + pDrawable->x, REGION_TRANSLATE(pGC->pScreen, region, pDrawable->x, pDrawable->y);
yoff + pDrawable->y); REGION_INTERSECT(pGC->pScreen, region, fbGetCompositeClip(pGC), region);
REGION_TRANSLATE(pGC->pScreen, region, xoff, yoff);
access = SAA_ACCESS_W; access = SAA_ACCESS_W;
if (saa_gc_reads_destination(pDrawable, pGC)) { if (saa_gc_reads_destination(pDrawable, pGC)) {
/* /*
* We need to do a readback anyway. In case of more than an * We need to do a readback anyway. In case of more than an
* ad hoc number of say 10 rectangles, we might as well do a * ad hoc number of say 4 rectangles, we might as well do a
* readback of the whole damage area to avoid fragmentation. * readback of the whole damage area to avoid fragmentation.
*/ */
if (REGION_NUM_RECTS(region) > 4)
goto out_no_access;
access |= SAA_ACCESS_R; access |= SAA_ACCESS_R;
ret = saa_prepare_access_pixmap(pPixmap, access, region); ret = saa_prepare_access_pixmap(pPixmap, access, region);
} else } else
@ -451,13 +454,8 @@ saa_check_poly_fill_rect_noreadback(DrawablePtr pDrawable, GCPtr pGC,
saa_finish_access_pixmap(pPixmap, access); saa_finish_access_pixmap(pPixmap, access);
if (spix->damage) { if (spix->damage) {
/* REGION_INTERSECT(pGC->pScreen, region, region,
* Not sure why the region can be larger than the pending damage region saa_pix_damage_pending(spix));
* at this point, (happens on clipped-away drawables). To avoid potential
* rendering problems, we clip to the pending damage region.
*/
REGION_INTERSECT(pGC->pScreen, region, region, saa_pix_damage_pending(spix));
saa_pixmap_dirty(pPixmap, FALSE, region); saa_pixmap_dirty(pPixmap, FALSE, region);
} }
@ -617,10 +615,32 @@ saa_check_copy_window(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
goto out_no_access;; goto out_no_access;;
if (saa_prepare_access_pixmap(pPixmap, SAA_ACCESS_W, NULL)) { if (saa_prepare_access_pixmap(pPixmap, SAA_ACCESS_W, NULL)) {
struct saa_pixmap *spix;
RegionRec rgnDst;
REGION_NULL(pScreen, &rgnDst);
REGION_COPY(pScreen, &rgnDst, prgnSrc);
saa_swap(sscreen, pScreen, CopyWindow); saa_swap(sscreen, pScreen, CopyWindow);
pScreen->CopyWindow(pWin, ptOldOrg, prgnSrc); pScreen->CopyWindow(pWin, ptOldOrg, prgnSrc);
saa_swap(sscreen, pScreen, CopyWindow); saa_swap(sscreen, pScreen, CopyWindow);
saa_fad_write(pDrawable, SAA_ACCESS_W); saa_finish_access_pixmap(pPixmap, SAA_ACCESS_W);
spix = saa_get_saa_pixmap(pPixmap);
if (spix->damage) {
int dx, dy;
dx = ptOldOrg.x - pWin->drawable.x;
dy = ptOldOrg.y - pWin->drawable.y;
REGION_TRANSLATE(pScreen, &rgnDst, -dx, -dy);
REGION_INTERSECT(pSreen, &rgnDst, &pWin->borderClip, &rgnDst);
REGION_TRANSLATE(pScreen, &rgnDst, xoff, yoff);
REGION_INTERSECT(pScreen, &rgnDst, &rgnDst,
saa_pix_damage_pending(spix));
saa_pixmap_dirty(pPixmap, FALSE, &rgnDst);
}
REGION_UNINIT(pScreen, &rgnDst);
} }
saa_fad_read(pDrawable); saa_fad_read(pDrawable);
out_no_access: out_no_access:

View File

@ -310,9 +310,6 @@ VMWAREPreInit(ScrnInfoPtr pScrn, int flags)
pVMWARE->pvtSema = &pScrn->vtSema; pVMWARE->pvtSema = &pScrn->vtSema;
pVMWARE->pEnt = xf86GetEntityInfo(pScrn->entityList[0]); pVMWARE->pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
if (pVMWARE->pEnt->location.type != BUS_PCI) {
return FALSE;
}
pVMWARE->PciInfo = xf86GetPciInfoForEntity(pVMWARE->pEnt->index); pVMWARE->PciInfo = xf86GetPciInfoForEntity(pVMWARE->pEnt->index);
if (pVMWARE->PciInfo == NULL) { if (pVMWARE->PciInfo == NULL) {
return FALSE; return FALSE;
@ -378,7 +375,8 @@ VMWAREPreInit(ScrnInfoPtr pScrn, int flags)
#ifdef ACCELERATE_OPS #ifdef ACCELERATE_OPS
pVMWARE->vmwareCapability = vmwareReadReg(pVMWARE, SVGA_REG_CAPABILITIES); pVMWARE->vmwareCapability = vmwareReadReg(pVMWARE, SVGA_REG_CAPABILITIES);
#else #else
pVMWARE->vmwareCapability = 0; pVMWARE->vmwareCapability = vmwareReadReg(pVMWARE, SVGA_REG_CAPABILITIES) &
SVGA_CAP_PITCHLOCK;
#endif #endif
pVMWARE->bitsPerPixel = vmwareReadReg(pVMWARE, pVMWARE->bitsPerPixel = vmwareReadReg(pVMWARE,
@ -861,6 +859,8 @@ VMWAREModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode, Bool rebuildPixmap)
return FALSE; return FALSE;
pScrn->vtSema = TRUE; pScrn->vtSema = TRUE;
if (pVMWARE->vmwareCapability & SVGA_CAP_PITCHLOCK)
vmwareWriteReg(pVMWARE, SVGA_REG_PITCHLOCK, 0);
vmwareReg->svga_reg_enable = 1; vmwareReg->svga_reg_enable = 1;
vmwareReg->svga_reg_width = max(mode->HDisplay, pScrn->virtualX); vmwareReg->svga_reg_width = max(mode->HDisplay, pScrn->virtualX);
vmwareReg->svga_reg_height = max(mode->VDisplay, pScrn->virtualY); vmwareReg->svga_reg_height = max(mode->VDisplay, pScrn->virtualY);

View File

@ -50,6 +50,10 @@
#include <xf86_libc.h> #include <xf86_libc.h>
#endif #endif
#ifdef XSERVER_PLATFORM_BUS
#include "xf86platformBus.h"
#endif
#ifdef HaveDriverFuncs #ifdef HaveDriverFuncs
#define VMWARE_DRIVER_FUNC HaveDriverFuncs #define VMWARE_DRIVER_FUNC HaveDriverFuncs
#else #else
@ -247,9 +251,6 @@ VMwarePreinitStub(ScrnInfoPtr pScrn, int flags)
vmwlegacy_hookup(pScrn); vmwlegacy_hookup(pScrn);
pEnt = xf86GetEntityInfo(pScrn->entityList[0]); pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
if (pEnt->location.type != BUS_PCI)
return FALSE;
pciInfo = xf86GetPciInfoForEntity(pEnt->index); pciInfo = xf86GetPciInfoForEntity(pEnt->index);
if (pciInfo == NULL) if (pciInfo == NULL)
return FALSE; return FALSE;
@ -407,6 +408,45 @@ VMWAREProbe(DriverPtr drv, int flags)
} }
#endif #endif
#ifdef XSERVER_PLATFORM_BUS
static Bool
VMwarePlatformProbe(DriverPtr drv, int entity, int flags,
struct xf86_platform_device *dev, intptr_t match_data)
{
ScrnInfoPtr pScrn;
int scrnFlag = 0;
if (!dev->pdev)
return FALSE;
if (flags & PLATFORM_PROBE_GPU_SCREEN)
scrnFlag = XF86_ALLOCATE_GPU_SCREEN;
pScrn = xf86AllocateScreen(drv, scrnFlag);
if (!pScrn)
return FALSE;
if (xf86IsEntitySharable(entity))
xf86SetEntityShared(entity);
xf86AddEntityToScreen(pScrn, entity);
pScrn->driverVersion = VMWARE_DRIVER_VERSION;
pScrn->driverName = VMWARE_DRIVER_NAME;
pScrn->name = VMWARE_NAME;
pScrn->Probe = NULL;
#ifdef BUILD_VMWGFX
vmwgfx_hookup(pScrn);
#else
vmwlegacy_hookup(pScrn);
#endif
pScrn->driverPrivate = pScrn->PreInit;
pScrn->PreInit = VMwarePreinitStub;
return TRUE;
}
#endif
static void static void
VMWAREIdentify(int flags) VMWAREIdentify(int flags)
{ {
@ -456,6 +496,10 @@ VMWareDriverFunc(ScrnInfoPtr pScrn,
pScrn->yDpi / 2) / pScrn->yDpi; pScrn->yDpi / 2) / pScrn->yDpi;
} }
return TRUE; return TRUE;
#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 18
case SUPPORTS_SERVER_FDS:
return TRUE;
#endif
default: default:
return FALSE; return FALSE;
} }
@ -478,9 +522,21 @@ _X_EXPORT DriverRec vmware = {
#if VMWARE_DRIVER_FUNC #if VMWARE_DRIVER_FUNC
VMWareDriverFunc, VMWareDriverFunc,
#endif #endif
#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 4
#if XSERVER_LIBPCIACCESS #if XSERVER_LIBPCIACCESS
VMwareDeviceMatch, VMwareDeviceMatch,
VMwarePciProbe, VMwarePciProbe,
#else
NULL,
NULL,
#endif
#endif
#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 13
#ifdef XSERVER_PLATFORM_BUS
VMwarePlatformProbe,
#else
NULL,
#endif
#endif #endif
}; };

View File

@ -58,6 +58,10 @@
((GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) == 1) && \ ((GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) == 1) && \
(GET_ABI_MINOR(ABI_VIDEODRV_VERSION) >= 2))) (GET_ABI_MINOR(ABI_VIDEODRV_VERSION) >= 2)))
#if HAVE_FILLKEYHELPERDRAWABLE
#include <damage.h>
#endif
#define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE) #define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE)
/* /*
@ -687,7 +691,12 @@ vmwareVideoInitStream(ScrnInfoPtr pScrn, VMWAREVideoPtr pVid,
int nBoxes = REGION_NUM_RECTS(&pVid->clipBoxes); int nBoxes = REGION_NUM_RECTS(&pVid->clipBoxes);
#if HAVE_FILLKEYHELPERDRAWABLE #if HAVE_FILLKEYHELPERDRAWABLE
xf86XVFillKeyHelperDrawable(draw, pVid->colorKey, clipBoxes); if (draw->type == DRAWABLE_WINDOW) {
xf86XVFillKeyHelperDrawable(draw, pVid->colorKey, clipBoxes);
DamageDamageRegion(draw, clipBoxes);
} else {
xf86XVFillKeyHelper(pScrn->pScreen, pVid->colorKey, clipBoxes);
}
#else #else
xf86XVFillKeyHelper(pScrn->pScreen, pVid->colorKey, clipBoxes); xf86XVFillKeyHelper(pScrn->pScreen, pVid->colorKey, clipBoxes);
#endif #endif
@ -789,7 +798,8 @@ vmwareVideoPlay(ScrnInfoPtr pScrn, VMWAREVideoPtr pVid,
struct PACKED _body { struct PACKED _body {
uint32 escape; uint32 escape;
uint32 streamId; uint32 streamId;
struct _item items[SVGA_VIDEO_NUM_REGS]; /* Old hosts can not handle more then these regs */
struct _item items[SVGA_VIDEO_DATA_GMRID];
}; };
struct PACKED _cmdSetRegs { struct PACKED _cmdSetRegs {
@ -831,7 +841,7 @@ vmwareVideoPlay(ScrnInfoPtr pScrn, VMWAREVideoPtr pVid,
cmdSetRegs.body.streamId = pVid->streamId; cmdSetRegs.body.streamId = pVid->streamId;
items = cmdSetRegs.body.items; items = cmdSetRegs.body.items;
for (i = SVGA_VIDEO_ENABLED; i < SVGA_VIDEO_NUM_REGS; i++) { for (i = SVGA_VIDEO_ENABLED; i < SVGA_VIDEO_DATA_GMRID; i++) {
items[i].regId = i; items[i].regId = i;
} }

View File

@ -193,6 +193,7 @@ crtc_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
crtcp->entry.pixmap = pixmap; crtcp->entry.pixmap = pixmap;
crtcp->scanout_id = vmwgfx_scanout_ref(&crtcp->entry); crtcp->scanout_id = vmwgfx_scanout_ref(&crtcp->entry);
if (crtcp->scanout_id == -1) { if (crtcp->scanout_id == -1) {
crtcp->entry.pixmap = NULL;
LogMessage(X_ERROR, "Failed to convert pixmap to scanout.\n"); LogMessage(X_ERROR, "Failed to convert pixmap to scanout.\n");
return FALSE; return FALSE;
} }
@ -212,6 +213,15 @@ crtc_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
crtc->active = TRUE; crtc->active = TRUE;
#endif #endif
/*
* Strictly, this needs to be done only once per configuration change,
* not once per crtc, but there's no better place to put this. Since
* Intel wrote the crtc code, let's do what the xf86-video-intel driver
* does.
*/
if (pScreen)
xf86_reload_cursors(pScreen);
return TRUE; return TRUE;
} }
@ -276,6 +286,10 @@ crtc_set_cursor_position(xf86CrtcPtr crtc, int x, int y)
modesettingPtr ms = modesettingPTR(crtc->scrn); modesettingPtr ms = modesettingPTR(crtc->scrn);
struct crtc_private *crtcp = crtc->driver_private; struct crtc_private *crtcp = crtc->driver_private;
/* Seems like newer X servers try to move cursors without images */
if (!crtcp->cursor_bo)
return;
drmModeMoveCursor(ms->fd, crtcp->drm_crtc->crtc_id, x, y); drmModeMoveCursor(ms->fd, crtcp->drm_crtc->crtc_id, x, y);
} }
@ -296,8 +310,11 @@ crtc_load_cursor_argb_kms(xf86CrtcPtr crtc, CARD32 * image)
if (!crtcp->cursor_bo) { if (!crtcp->cursor_bo) {
size_t size = 64*64*4; size_t size = 64*64*4;
crtcp->cursor_bo = vmwgfx_dmabuf_alloc(ms->fd, size); crtcp->cursor_bo = vmwgfx_dmabuf_alloc(ms->fd, size);
if (!crtcp->cursor_bo) if (!crtcp->cursor_bo) {
xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR,
"Failed to create a dmabuf for cursor.\n");
return; return;
}
crtcp->cursor_handle = crtcp->cursor_bo->handle; crtcp->cursor_handle = crtcp->cursor_bo->handle;
} }
@ -305,6 +322,9 @@ crtc_load_cursor_argb_kms(xf86CrtcPtr crtc, CARD32 * image)
if (ptr) { if (ptr) {
memcpy(ptr, image, 64*64*4); memcpy(ptr, image, 64*64*4);
vmwgfx_dmabuf_unmap(crtcp->cursor_bo); vmwgfx_dmabuf_unmap(crtcp->cursor_bo);
} else {
xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR,
"Failed to map cursor dmabuf.\n");
} }
if (crtc->cursor_shown) if (crtc->cursor_shown)

View File

@ -54,6 +54,10 @@
#include <pciaccess.h> #include <pciaccess.h>
#ifdef XSERVER_PLATFORM_BUS
#include "xf86platformBus.h"
#endif
#include "vmwgfx_driver.h" #include "vmwgfx_driver.h"
#include <saa.h> #include <saa.h>
@ -243,6 +247,15 @@ static const xf86CrtcConfigFuncsRec crtc_config_funcs = {
.resize = drv_crtc_resize .resize = drv_crtc_resize
}; };
static Bool vmwgfx_use_server_fd(modesettingPtr ms)
{
#ifdef XF86_PDEV_SERVER_FD
return ms->platform_dev && (ms->platform_dev->flags & XF86_PDEV_SERVER_FD);
#else
return FALSE;
#endif
}
static Bool static Bool
drv_init_drm(ScrnInfoPtr pScrn) drv_init_drm(ScrnInfoPtr pScrn)
{ {
@ -253,6 +266,12 @@ drv_init_drm(ScrnInfoPtr pScrn)
ms->fd = vmwgfx_hosted_drm_fd(ms->hdriver, ms->hosted, ms->PciInfo); ms->fd = vmwgfx_hosted_drm_fd(ms->hdriver, ms->hosted, ms->PciInfo);
#ifdef ODEV_ATTRIB_FD
if (ms->fd < 0 && vmwgfx_use_server_fd(ms))
ms->fd = xf86_get_platform_device_int_attrib(ms->platform_dev,
ODEV_ATTRIB_FD, -1);
#endif
if (ms->fd < 0) { if (ms->fd < 0) {
char bus_id[64]; char bus_id[64];
@ -465,13 +484,18 @@ drv_pre_init(ScrnInfoPtr pScrn, int flags)
pScrn->displayWidth = 640; /* default it */ pScrn->displayWidth = 640; /* default it */
if (ms->pEnt->location.type != BUS_PCI) { ms->PciInfo = xf86GetPciInfoForEntity(ms->pEnt->index);
if (!ms->PciInfo) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Incorrect bus for device.\n"); "Incorrect bus for device.\n");
goto out_err_bus; goto out_err_bus;
} }
ms->PciInfo = xf86GetPciInfoForEntity(ms->pEnt->index); #ifdef XSERVER_PLATFORM_BUS
if (pEnt->location.type == BUS_PLATFORM)
ms->platform_dev = pEnt->location.id.plat;
#endif
xf86SetPrimInitDone(pScrn->entityList[0]); xf86SetPrimInitDone(pScrn->entityList[0]);
ms->hdriver = vmwgfx_hosted_detect(); ms->hdriver = vmwgfx_hosted_detect();
@ -605,7 +629,7 @@ drv_pre_init(ScrnInfoPtr pScrn, int flags)
free(ms->Options); free(ms->Options);
out_depth: out_depth:
out_drm_version: out_drm_version:
if (!vmwgfx_is_hosted(ms->hdriver)) if (!vmwgfx_is_hosted(ms->hdriver) && !vmwgfx_use_server_fd(ms))
close(ms->fd); close(ms->fd);
out_no_drm: out_no_drm:
vmwgfx_hosted_destroy(ms->hdriver, ms->hosted); vmwgfx_hosted_destroy(ms->hdriver, ms->hosted);
@ -783,8 +807,8 @@ drv_set_master(ScrnInfoPtr pScrn)
{ {
modesettingPtr ms = modesettingPTR(pScrn); modesettingPtr ms = modesettingPTR(pScrn);
if (!vmwgfx_is_hosted(ms->hdriver) && !ms->isMaster && if (!vmwgfx_is_hosted(ms->hdriver) && !vmwgfx_use_server_fd(ms) &&
drmSetMaster(ms->fd) != 0) { !ms->isMaster && drmSetMaster(ms->fd) != 0) {
if (errno == EINVAL) { if (errno == EINVAL) {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING, xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"drmSetMaster failed: 2.6.29 or newer kernel required for " "drmSetMaster failed: 2.6.29 or newer kernel required for "
@ -1184,7 +1208,8 @@ drv_leave_vt(VT_FUNC_ARGS_DECL)
vmwgfx_saa_drop_master(pScrn->pScreen); vmwgfx_saa_drop_master(pScrn->pScreen);
if (!vmwgfx_is_hosted(ms->hdriver) && drmDropMaster(ms->fd)) if (!vmwgfx_is_hosted(ms->hdriver) && !vmwgfx_use_server_fd(ms) &&
drmDropMaster(ms->fd))
xf86DrvMsg(pScrn->scrnIndex, X_WARNING, xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"drmDropMaster failed: %s\n", strerror(errno)); "drmDropMaster failed: %s\n", strerror(errno));
ms->isMaster = FALSE; ms->isMaster = FALSE;

View File

@ -83,6 +83,7 @@ enum xorg_throttling_reason {
}; };
struct vmwgfx_hosted; struct vmwgfx_hosted;
struct xf86_platform_device;
typedef struct _modesettingRec typedef struct _modesettingRec
{ {
@ -98,6 +99,7 @@ typedef struct _modesettingRec
int Chipset; int Chipset;
EntityInfoPtr pEnt; EntityInfoPtr pEnt;
struct pci_device *PciInfo; struct pci_device *PciInfo;
struct xf86_platform_device *platform_dev;
/* Accel */ /* Accel */
Bool accelerate_render; Bool accelerate_render;

View File

@ -35,6 +35,7 @@
*/ */
#include "xorg-server.h"
#include "xf86xv.h" #include "xf86xv.h"
#include "fourcc.h" #include "fourcc.h"
#define debug_printf(...) #define debug_printf(...)
@ -162,7 +163,7 @@ struct vmwgfx_overlay_port
int (*play)(ScrnInfoPtr, struct vmwgfx_overlay_port *, int (*play)(ScrnInfoPtr, struct vmwgfx_overlay_port *,
short, short, short, short, short, short, short, short, short, short,
short, short, short, int, unsigned char*, short, short, short, int, unsigned char*,
short, short, RegionPtr); short, short, RegionPtr, DrawablePtr);
/* values to go into the SVGAOverlayUnit */ /* values to go into the SVGAOverlayUnit */
uint32 streamId; uint32 streamId;
@ -217,13 +218,15 @@ static int vmw_video_port_init(ScrnInfoPtr pScrn,
short drw_y, short src_w, short src_h, short drw_y, short src_w, short src_h,
short drw_w, short drw_h, int format, short drw_w, short drw_h, int format,
unsigned char *buf, short width, unsigned char *buf, short width,
short height, RegionPtr clipBoxes); short height, RegionPtr clipBoxes,
DrawablePtr pDraw);
static int vmw_video_port_play(ScrnInfoPtr pScrn, struct vmwgfx_overlay_port *port, static int vmw_video_port_play(ScrnInfoPtr pScrn, struct vmwgfx_overlay_port *port,
short src_x, short src_y, short drw_x, short src_x, short src_y, short drw_x,
short drw_y, short src_w, short src_h, short drw_y, short src_w, short src_h,
short drw_w, short drw_h, int format, short drw_w, short drw_h, int format,
unsigned char *buf, short width, unsigned char *buf, short width,
short height, RegionPtr clipBoxes); short height, RegionPtr clipBoxes,
DrawablePtr pDraw);
static void vmw_video_port_cleanup(ScrnInfoPtr pScrn, struct vmwgfx_overlay_port *port); static void vmw_video_port_cleanup(ScrnInfoPtr pScrn, struct vmwgfx_overlay_port *port);
static int vmw_video_buffer_alloc(int drm_fd, int size, static int vmw_video_buffer_alloc(int drm_fd, int size,
@ -380,7 +383,7 @@ vmw_video_port_init(ScrnInfoPtr pScrn, struct vmwgfx_overlay_port *port,
short drw_y, short src_w, short src_h, short drw_y, short src_w, short src_h,
short drw_w, short drw_h, int format, short drw_w, short drw_h, int format,
unsigned char *buf, short width, unsigned char *buf, short width,
short height, RegionPtr clipBoxes) short height, RegionPtr clipBoxes, DrawablePtr pDraw)
{ {
unsigned short w, h; unsigned short w, h;
int i, ret; int i, ret;
@ -412,7 +415,7 @@ vmw_video_port_init(ScrnInfoPtr pScrn, struct vmwgfx_overlay_port *port,
REGION_NULL(pScrn->pScreen, &port->clipBoxes); REGION_NULL(pScrn->pScreen, &port->clipBoxes);
port->play = vmw_video_port_play; port->play = vmw_video_port_play;
return port->play(pScrn, port, src_x, src_y, drw_x, drw_y, src_w, src_h, return port->play(pScrn, port, src_x, src_y, drw_x, drw_y, src_w, src_h,
drw_w, drw_h, format, buf, width, height, clipBoxes); drw_w, drw_h, format, buf, width, height, clipBoxes, pDraw);
out_no_buffer: out_no_buffer:
while(i-- != 0) { while(i-- != 0) {
@ -448,7 +451,7 @@ vmw_video_port_play(ScrnInfoPtr pScrn, struct vmwgfx_overlay_port *port,
short drw_y, short src_w, short src_h, short drw_y, short src_w, short src_h,
short drw_w, short drw_h, int format, short drw_w, short drw_h, int format,
unsigned char *buf, short width, unsigned char *buf, short width,
short height, RegionPtr clipBoxes) short height, RegionPtr clipBoxes, DrawablePtr pDraw)
{ {
struct drm_vmw_control_stream_arg arg; struct drm_vmw_control_stream_arg arg;
unsigned short w, h; unsigned short w, h;
@ -468,7 +471,7 @@ vmw_video_port_play(ScrnInfoPtr pScrn, struct vmwgfx_overlay_port *port,
vmw_xv_stop_video(pScrn, port, TRUE); vmw_xv_stop_video(pScrn, port, TRUE);
return port->play(pScrn, port, src_x, src_y, drw_x, drw_y, src_w, return port->play(pScrn, port, src_x, src_y, drw_x, drw_y, src_w,
src_h, drw_w, drw_h, format, buf, width, height, src_h, drw_w, drw_h, format, buf, width, height,
clipBoxes); clipBoxes, pDraw);
} }
memcpy(port->bufs[port->currBuf].data, buf, port->size); memcpy(port->bufs[port->currBuf].data, buf, port->size);
@ -502,8 +505,14 @@ vmw_video_port_play(ScrnInfoPtr pScrn, struct vmwgfx_overlay_port *port,
*/ */
if (!REGION_EQUAL(pScrn->pScreen, &port->clipBoxes, clipBoxes)) { if (!REGION_EQUAL(pScrn->pScreen, &port->clipBoxes, clipBoxes)) {
REGION_COPY(pScrn->pScreen, &port->clipBoxes, clipBoxes); REGION_COPY(pScrn->pScreen, &port->clipBoxes, clipBoxes);
if (port->isAutoPaintColorkey) if (port->isAutoPaintColorkey) {
xf86XVFillKeyHelper(pScrn->pScreen, port->colorKey, clipBoxes); if (pDraw->type == DRAWABLE_WINDOW) {
xf86XVFillKeyHelperDrawable(pDraw, port->colorKey, clipBoxes);
DamageDamageRegion(pDraw, clipBoxes);
} else {
xf86XVFillKeyHelper(pScrn->pScreen, port->colorKey, clipBoxes);
}
}
} }
xorg_flush(pScrn->pScreen); xorg_flush(pScrn->pScreen);
@ -667,7 +676,7 @@ vmw_xv_put_image(ScrnInfoPtr pScrn, short src_x, short src_y,
width, height); width, height);
return port->play(pScrn, port, src_x, src_y, drw_x, drw_y, src_w, src_h, return port->play(pScrn, port, src_x, src_y, drw_x, drw_y, src_w, src_h,
drw_w, drw_h, format, buf, width, height, clipBoxes); drw_w, drw_h, format, buf, width, height, clipBoxes, dst);
} }

View File

@ -610,9 +610,9 @@ vmwgfx_pix_resize(PixmapPtr pixmap, unsigned int old_pitch,
} }
if (vpix->hw) { if (vpix->hw) {
if (xa_surface_redefine(vpix->hw, draw->width, draw->height, if (!vmwgfx_xa_surface_redefine(vpix, vpix->hw, draw->width,
draw->depth, xa_type_argb, draw->height, draw->depth, xa_type_argb,
xa_format_unknown, vpix->xa_flags, 1) != 0) xa_format_unknown, vpix->xa_flags, 1))
return FALSE; return FALSE;
} }
@ -694,7 +694,8 @@ vmwgfx_modify_pixmap_header (PixmapPtr pixmap, int w, int h, int depth,
vmwgfx_pix_resize(pixmap, old_pitch, old_height, old_width); vmwgfx_pix_resize(pixmap, old_pitch, old_height, old_width);
vmwgfx_pixmap_free_storage(vpix); vmwgfx_pixmap_free_storage(vpix);
WSBMLISTADDTAIL(&vpix->pixmap_list, &vsaa->pixmaps); if (WSBMLISTEMPTY(&vpix->pixmap_list))
WSBMLISTADDTAIL(&vpix->pixmap_list, &vsaa->pixmaps);
return TRUE; return TRUE;
@ -824,11 +825,11 @@ vmwgfx_create_hw(struct vmwgfx_saa *vsaa,
return FALSE; return FALSE;
vpix->xa_flags = new_flags; vpix->xa_flags = new_flags;
vpix->hw = hw;
if (!vmwgfx_pixmap_add_damage(pixmap)) if (!vmwgfx_pixmap_add_damage(pixmap))
goto out_no_damage; goto out_no_damage;
vpix->hw = hw;
vpix->backing |= VMWGFX_PIX_SURFACE; vpix->backing |= VMWGFX_PIX_SURFACE;
vmwgfx_pixmap_free_storage(vpix); vmwgfx_pixmap_free_storage(vpix);
@ -841,6 +842,7 @@ vmwgfx_create_hw(struct vmwgfx_saa *vsaa,
return TRUE; return TRUE;
out_no_damage: out_no_damage:
vpix->hw = NULL;
xa_surface_destroy(hw); xa_surface_destroy(hw);
return FALSE; return FALSE;
} }
@ -1158,6 +1160,8 @@ vmwgfx_composite_prepare(struct saa_driver *driver, CARD8 op,
* and check whether XA can accelerate. * and check whether XA can accelerate.
*/ */
if (!mask_pix)
mask_pict = NULL;
xa_comp = vmwgfx_xa_setup_comp(vsaa->vcomp, op, xa_comp = vmwgfx_xa_setup_comp(vsaa->vcomp, op,
src_pict, mask_pict, dst_pict); src_pict, mask_pict, dst_pict);
if (!xa_comp) if (!xa_comp)
@ -1504,7 +1508,8 @@ vmwgfx_scanout_ref(struct vmwgfx_screen_entry *entry)
* The KMS fb will be a HW surface. Create it, add damage * The KMS fb will be a HW surface. Create it, add damage
* and get the handle. * and get the handle.
*/ */
if (!vmwgfx_hw_accel_validate(pixmap, 0, XA_FLAG_SCANOUT, 0, NULL)) if (!vmwgfx_hw_accel_validate(pixmap, 0, XA_FLAG_SCANOUT |
XA_FLAG_RENDER_TARGET, 0, NULL))
goto out_err; goto out_err;
if (_xa_surface_handle(vpix->hw, &handle, &dummy) != 0) if (_xa_surface_handle(vpix->hw, &handle, &dummy) != 0)
goto out_err; goto out_err;

View File

@ -100,6 +100,17 @@ vmwgfx_hw_composite_dst_stage(PixmapPtr pixmap,
Bool Bool
vmwgfx_hw_commit(PixmapPtr pixmap); vmwgfx_hw_commit(PixmapPtr pixmap);
Bool
vmwgfx_xa_surface_redefine(struct vmwgfx_saa_pixmap *vpix,
struct xa_surface *srf,
int width,
int height,
int depth,
enum xa_surface_type stype,
enum xa_formats rgb_format,
unsigned int new_flags,
int copy_contents);
/* /*
* vmwgfx_xa_composite.c * vmwgfx_xa_composite.c
*/ */

View File

@ -43,6 +43,52 @@ static const enum xa_surface_type vmwgfx_stype_map[] = {
static const unsigned int vmwgfx_stype_map_size = static const unsigned int vmwgfx_stype_map_size =
sizeof(vmwgfx_stype_map) / sizeof(enum xa_surface_type); sizeof(vmwgfx_stype_map) / sizeof(enum xa_surface_type);
/**
* vmwgfx_xa_surface_redefine - wrapper around xa_surface_redefine
*
* @vpix: Pointer to the struct vmwgfx_saa_pixmap the surface is attached to.
* @srf: The surface.
* @width: New width.
* @height: New height.
* @depth: New pixel depth.
* @stype: New surface type.
* @rgb_format: New rgb format.
* @new_flags: New surface flags.
* @copy_contents: Copy contents if new backing store is allocated.
*
* This is a wrapper that prints out an error message if the backing store
* of an active scanout surface is changed.
*/
Bool
vmwgfx_xa_surface_redefine(struct vmwgfx_saa_pixmap *vpix,
struct xa_surface *srf,
int width,
int height,
int depth,
enum xa_surface_type stype,
enum xa_formats rgb_format,
unsigned int new_flags,
int copy_contents)
{
uint32_t handle, new_handle, dummy;
Bool have_handle = FALSE;
if (!WSBMLISTEMPTY(&vpix->scanout_list))
have_handle = (_xa_surface_handle(srf, &handle, &dummy) == XA_ERR_NONE);
if (xa_surface_redefine(srf, width, height, depth, stype, rgb_format,
new_flags, copy_contents) != XA_ERR_NONE)
return FALSE;
if (!WSBMLISTEMPTY(&vpix->scanout_list) && have_handle &&
_xa_surface_handle(srf, &new_handle, &dummy) == XA_ERR_NONE &&
new_handle != handle) {
LogMessage(X_ERROR, "Changed active scanout surface handle.\n");
}
return TRUE;
}
/* /*
* Create an xa format from a PICT format. * Create an xa format from a PICT format.
@ -323,13 +369,14 @@ vmwgfx_hw_commit(PixmapPtr pixmap)
if (vpix->staging_format != xa_surface_format(vpix->hw)) if (vpix->staging_format != xa_surface_format(vpix->hw))
LogMessage(X_INFO, "Changing hardware format.\n"); LogMessage(X_INFO, "Changing hardware format.\n");
if (xa_surface_redefine(vpix->hw, if (!vmwgfx_xa_surface_redefine(vpix,
pixmap->drawable.width, vpix->hw,
pixmap->drawable.height, pixmap->drawable.width,
0, pixmap->drawable.height,
xa_type_other, 0,
vpix->staging_format, xa_type_other,
new_flags, 1) != XA_ERR_NONE) vpix->staging_format,
new_flags, 1) != XA_ERR_NONE)
return FALSE; return FALSE;
vpix->xa_flags = new_flags; vpix->xa_flags = new_flags;
} else if (!vmwgfx_create_hw(vsaa, pixmap)) } else if (!vmwgfx_create_hw(vsaa, pixmap))

View File

@ -36,6 +36,7 @@
#include "vmwgfx_hosted.h" #include "vmwgfx_hosted.h"
#include "vmwgfx_saa.h" #include "vmwgfx_saa.h"
#include <xf86Crtc.h>
#include <xf86Priv.h> #include <xf86Priv.h>
#include <xmir.h> #include <xmir.h>
@ -103,6 +104,11 @@ vmwgfx_xmir_screen_init(struct vmwgfx_hosted *hosted, ScreenPtr pScreen)
return FALSE; return FALSE;
hosted->pScreen = pScreen; hosted->pScreen = pScreen;
if (!xf86SetDesiredModes(hosted->pScrn)) {
xmir_screen_close(hosted->pScreen, hosted->xmir);
hosted->pScreen = NULL;
return FALSE;
}
return TRUE; return TRUE;
} }

View File

@ -62,7 +62,7 @@ vmwgfx_create_window_buffer(struct xwl_window *xwl_window,
* surface. * surface.
*/ */
vpix->hw_is_hosted = TRUE; vpix->hw_is_hosted = TRUE;
if (xa_surface_handle(vpix->hw, &name, &pitch) != XA_ERR_NONE) if (_xa_surface_handle(vpix->hw, &name, &pitch) != XA_ERR_NONE)
return BadDrawable; return BadDrawable;
return xwl_create_window_buffer_drm(xwl_window, pixmap, name); return xwl_create_window_buffer_drm(xwl_window, pixmap, name);