summaryrefslogtreecommitdiff
path: root/vmwgfx
AgeCommit message (Collapse)Author
2022-09-29Spelling fixes.Ville Skyttä
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-06-21Garbled XvPutImage output for FOURCC_YV12 when using 3D-accel-texture adaptorMartin Krastev
A helper for the PutImage callback in adaptor 'XA G3D Textured Video' was not taking into account the source data pitches for YV12 format, resulting in garbled frames for misaligned frame widths. Issue reported by Doug Brown. This patch is based off the patch proposed by Doug. Repro of the original issue: gst-launch-1.0 videotestsrc ! video/x-raw,format=YV12,width=449,height=240 ! xvimagesink Reported-by: Doug Brown <doug@schmorgal.com> Signed-off-by: Martin Krastev <krastevm@vmware.com> Reviewed-by: Zack Rusin <zackr@vmware.com>
2022-05-08vmwgfx: fix missing array notation Rudi Heitbaum
Fixes error identified by gcc-12.1.0 compiler make CC libvmwgfx_la-vmwgfx_tex_video.lo vmwgfx_tex_video.c: In function 'stop_video': vmwgfx_tex_video.c:240:20: error: the comparison will always evaluate as 'true' for the address of 'yuv' will never be NULL [-Werror=address] 240 | if (priv->yuv[i]) { | ^~~~
2021-11-30vmwgfx: Change header inclusion order to avoid xorg headers catching stdbool.hMartin Krastev
libdrm commit e641e2a632d779f638ac2ba983b9fceb20b3fac4 added stdbool.h to the library headers which conflicts with xorg headers. Signed-off-by: Martin Krastev <krastevm@vmware.com> Reviewed-by: Zack Rusin <zackr@vmware.com> Signed-off-by: Zack Rusin <zackr@vmware.com>
2019-01-28vmwgfx: Unify style in scanout_update and present functionsThomas Hellstrom
Since the functions are pretty similar, Make them look more similar in terms of memory allocation methods and variable names Reported-by: Brian Paul <brianp@vmware.com> Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com>
2019-01-28vmwgfx: Limit the number of cliprects in a drm present_readback command v3Thomas Hellstrom
The drm present readback command number of cliprects should not exceed DRM_MODE_FB_DIRTY_MAX_CLIPS. If that number is exceeded, split the command up. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Deepak Rawat <drawat@vmware.com> #v1
2019-01-28vmwgfx: Limit the number of cliprects in a drm present command v3Thomas Hellstrom
The drm present command number of cliprects should not exceed DRM_MODE_FB_DIRTY_MAX_CLIPS. If that number is exceeded, split the command up. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com> #v2 Reviewed-by: Deepak Rawat < drawat@vmware.com> #v1
2019-01-28vmwgfx: Limit the number of cliprects in a drm dirtyfb command v3Thomas Hellstrom
The drm dirtyfb command would error if the number of cliprects were larger than DRM_MODE_FB_DIRTY_MAX_CLIPS. If that number is exceeded, split the command up. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com> #v2 Reviewed-by: Deepak Rawat <drawat@vmware.com> #v1
2019-01-28vmwgfx: Don't exceed the device command size limit v3Thomas Hellstrom
With a huge number of DMA clip rects we could exceed the device command buffer command size limit. Fix this by sending multiple DMA commands when we exceed the limit. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Deepak Rawat <drawat@vmware.com> #v1
2018-11-29vmwgfx: Fix invalid memory accesses in CloseScreenThomas Hellstrom
Some of the CloseScreen callbacks were referencing XA objects so move the destruction of the XA state tracker to the end of drv_close_screen to avoid referencing freed resources. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Deepak Rawat <drawat@vmware.com>
2018-11-29vmwgfx: Use libdrm to obtain the drm device node name v2Thomas Hellstrom
We were relying on a linux-specific way to do this. Now that the code is used also on FreeBSD and there is functionality in libdrm to do this, Use that functionality. v2: Remove unused variable warning in the !VMWGFX_LIBDRM_DEVICENAME case. Co-authored-by: Johannes Lundberg <johalun0@gmail.com> Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Deepak Rawat <drawat@vmware.com> #v1
2018-11-28vmwgfx: Fix a memory leakThomas Hellstrom
We were leaking a pointer to a drm encoder. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com>
2018-11-28vmwgfx: Fix XVideo memory leaksThomas Hellstrom
We were not properly freeing the port privates. In order to access those at CloseScreen time, don't free the adaptor pointers at XV screen init, but hold on to them until CloseScreen. Also properly free the new_adaptors pointer. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com>
2018-05-17Require at least XA version 2.4 to enable dri3Thomas Hellstrom
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-04-26vmwgfx: Clear the DRM mode before useThomas Hellstrom
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-02-20Fix a couple of shadowed declaration warningsThomas Hellstrom
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-20Build fixesThomas Hellstrom
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-15vmwgfx: Fix server termination due to a mesa loader bugThomas Hellstrom
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-15vmwgfx: Fix potential libudev include and link failuresThomas Hellstrom
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-15Fix a number of compilation warningsThomas Hellstrom
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-15vmwgfx: Remove old XWayland and XMir driversThomas Hellstrom
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-15vmwgfx: Fix compilation failure if dri3 is not availableThomas Hellstrom
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>
2017-08-21vmwgfx: Support DRI3 v2Thomas Hellstrom
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-21Revert "vmware/vmwgfx: Support multiple dri driver names"Thomas Hellstrom
This reverts commit d5550b7f8375c3d9003731578c1570e014577348. 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-07vmware/vmwgfx: Wrap deprecatedDeepak Singh Rawat
Deprecated with 43dbc556f3a4d743b9121d6cfc21961be4a9da56 Signed-off-by: Deepak Rawat <drawat@vmware.com> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
2017-08-07vmware: Fix build warningsDeepak Singh Rawat
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-07-13Revert "Revert "vmware/vmwgfx: Support multiple dri driver names""Sinclair Yeh
This reverts commit ea94dc570846655bbb8a7c75bf465907e454bef9. Temporarily revert this for internal testing.
2017-07-13Revert "vmwgfx: Support DRI3 v2"Sinclair Yeh
This reverts commit d0d5cf3e35fd47b44f32065c5cb64ba62661f03a. Temporarily revert this for internal testing.
2017-05-11vmwgfx: Support DRI3 v2Thomas Hellstrom
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-11Revert "vmware/vmwgfx: Support multiple dri driver names"Thomas Hellstrom
This reverts commit d5550b7f8375c3d9003731578c1570e014577348. 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>
2016-11-16vmware/vmwgfx: Add a missing source file for distributionThomas Hellstrom
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Sinclair Yeh <syeh@vmware.com>
2016-05-30vmware/vmwgfx: Support multiple dri driver namesThomas Hellstrom
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-30vmware/vmwgfx: Don't require screen objects to runThomas Hellstrom
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-02-11vmware/vmwgfx: Disable autolayout if we detect an old resolutionsetThomas Hellstrom
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-11vmware/vmwgfx: Read the implicit output status from KMS if available.Thomas Hellstrom
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-11vmware/vmwgfx: Avoid filling the log with modeline printoutsThomas Hellstrom
There are specific debug options for that. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Sinclair Yeh <syeh@vmware.com>
2016-02-11vmware/vmwgfx: Add a layout handler v2Thomas Hellstrom
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-11vmware/vmwgfx: Update RandR output properties on hotplug events v2Thomas Hellstrom
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-01vmware/vmwgfx: Add missing includes of the config.h header.Thomas Hellstrom
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Sinclair Yeh <syeh@vmware.com>
2016-02-01vmware/vmwgfx: Expose kernel connector attributes and react to hotplug eventsThomas Hellstrom
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>
2015-05-04vmware/vmwgfx: Try to use only_hw_present semantics if screen targets are ↵Thomas Hellstrom
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>
2014-11-18vmware/vmwgfx: Make large Xv video blits cheaperThomas Hellstrom
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-10-14xf86xv.h cannot be included without first including xorg-server.h.Stefan Dirsch
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-09-09vmware/vmwgfx: Fix cursor problem with multimonThomas Hellstrom
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-03vmware/vmwgfx: Don't add pixmaps to the pixmap list if they're already on itThomas Hellstrom
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-08-11vmware/vmwgfx: Fix compilation issue on older X serversJakob Bornecrantz
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-07-03vmware/vmwgfx: Fix an error path segfaultThomas Hellstrom
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-05-23vmware/vmwgfx: Fix auto colorkey fill usageJakob Bornecrantz
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com> Reviewed-by: Thomas Hellström <thellstrom@vmware.com>
2014-05-23vmware/vmwgfx: A bit more error logging when handling cursorsJakob Bornecrantz
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com> Reviewed-by: Thomas Hellström <thellstrom@vmware.com>
2014-05-23vmware/vmwgfx: Don't move cursors without imagesJakob Bornecrantz
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com> Reviewed-by: Thomas Hellström <thellstrom@vmware.com>