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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
When XA starts to correctly advertise version 2, we didn't allow it.
Fix this.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
This reverts commit 45b2457516.
Reverting this because using direct DMA for shared pixmaps should
boost performance. It should be usable both in a composited environment
and when running hosted. Need to retest the DMA flaws I saw before disabling
this code.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
We need to support also XA version 1, since we want to be backwards
compatible with older mesa releases.
Unfortunately, the intended way of detecting XA major version at
compile-time was broken on mesa 10 so we need a workaround that tests
for XA version 2 at config time.
v2: Update the test for XA version 2.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
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>
It's rarely used and things seem to work well enough on top of XA.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Zack Rusin <zackr@vmware.com>
Remove device-specific hacks. This may increase resource usage a little
on old hardware revisions, but we don't need separate code paths on
different hardware revisions.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Zack Rusin <zackr@vmware.com>
Note that for DRI2, a dri2_copy_region becomes a NOP when not master.
Additionally, all dri2 operations that lead to a potential kernel
access will return FALSE.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
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>
This fixes a failed assertion in the gallium/svga driver in the
svga_texture_get_handle() function. The texture resource wasn't
getting created with the PIPE_BIND_SHARED flag so the !cachable
assertion would fail and the X session would abort. This didn't
happen with release builds.
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
We use the empty rect purely as a placeholder and never
initialize it with its own memory so lets not try to free
it.
Spotted by Dave Airlie.
Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>