summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/xa/xa_tracker.c
Commit message (Collapse)AuthorAgeFilesLines
* st/xa: replace call to dup(2) with fcntl(F_DUPFD_CLOEXEC)Matt Whitlock2016-10-041-1/+2
| | | | | | | | | | Without this fix, duplicated file descriptors leak into child processes. See commit aaac913e901229d11a1894f6aaf646de6b1a542c for one instance where the same fix was employed. Cc: <mesa-stable@lists.freedesktop.org> Signed-off-by: Matt Whitlock <freedesktop@mattwhitlock.name> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
* gallium: add a pipe_context parameter to resource_get_handleMarek Olšák2016-08-251-1/+2
| | | | | | | | radeonsi needs to do some operations (DCC decompression) for OpenGL-OpenCL interop and this is the only way to make it coherent with the current context. It can optionally be set to NULL. Reviewed-by: Brian Paul <brianp@vmware.com>
* st/xa: don't call close(-1) in xa_tracker_create error pathEmil Velikov2016-05-231-3/+3
| | | | | | | Analogous to previous commit. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Leo Liu <leo.liu@amd.com>
* gallium: add external usage flags to resource_from(get)_handle (v2)Marek Olšák2016-03-091-2/+4
| | | | | | | | | This will allow drivers to make better decisions about texture sharing for DRI2, DRI3, Wayland, and OpenCL. v2: add read/write flags, take advantage of __DRI_IMAGE_USE_BACKBUFFER Reviewed-by: Axel Davy <axel.davy@ens.fr>
* st/xa: fd management cleanupsEmil Velikov2015-11-291-1/+8
| | | | | | | | | Analogous to previous commit. Spotted by Coverity (CID 1339866) Cc: mesa-stable@lists.freedesktop.org Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
* {st,targets}/xa: use static/dynamic pipe-loaderEmil Velikov2015-11-211-14/+2
| | | | | | | Analogous to previous commits. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Acked-by: Rob Clark <robclark@freedesktop.org>
* gallium: remove library_path argument from pipe_loader_create_screen()Emil Velikov2015-11-211-1/+1
| | | | | | | | | | | | | | | Currently the location is determined at configure/build time and consistently copied across gallium. Just remove the extra argument, and use PIPE_SEARCH_DIR where appropriate. This will allow us to remove the duplication in the *configuration and *screen_create APIs by moving util_dl_get_proc_address() and friends to probe time. v2: rebase on top of vl_winsys_drm.c addition Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Acked-by: Rob Clark <robclark@freedesktop.org>
* st/xa: Use PIPE_FORMAT_R8_UNORM when availableThomas Hellstrom2015-09-171-8/+20
| | | | | | | | | | | | XA has been using L8_UNORM for a8 and yuv component surfaces. This commit instead makes XA prefer R8_UNORM since it's assumed to have a higher availability. Also neither of these formats are suitable as destination formats using destination alpha blending, so reject those operations. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com>
* xa: add xa_surface_from_handle2 v2Rob Clark2015-09-071-10/+31
| | | | | | | | | | | | | | | | | Like xa_surface_from_handle(), but takes a handle type, rather than hard-coding 'shared' handle. This is needed to fix bugs seen with xf86-video-freedreno with xrandr rotation, for example. The root issue is that doing a GEM_OPEN ioctl on a bo that already has a GEM handle associated with the drm_file will result in two unique handles for the same bo. Which causes all sorts of follow-on fail. v2: - Add support for for fd handles. - Avoid duplicating code. - Bump xa version minor. Signed-off-by: Rob Clark <robclark@freedesktop.org> Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
* pipe-loader: remove pipe_loader_drm_probe_fd() x_auth argumentEmil Velikov2015-07-131-1/+1
| | | | | | | | No longer used by anyone, as of last commit. Cc: Tom Stellard <thomas.stellard@amd.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Francisco Jerez <currojerez@riseup.net>
* xa: don't leak fencesRob Clark2015-07-101-1/+1
| | | | | | | | | | | | XA was never unref'ing last_fence in the various call paths to pipe->flush(). Add this to xa_context_flush() and update the other open-coded calls to pipe->flush() to use xa_context_flush() instead. This fixes a memory leak reported with xf86-video-freedreno. Reported-by: Nicolas Dechesne <nicolas.dechesne@linaro.org> Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org> Signed-off-by: Rob Clark <robclark@freedesktop.org>
* mesa; add a dummy _mesa_error_no_memory() symbol to libglsl_utilEmil Velikov2015-06-121-12/+0
| | | | | | | | | | | | Rather than forcing everyone to provide their own definition of the symbol provide a common (dummy) one. This helps us resolve the build of the standalone pipe-drivers (amongst others), which are missing the symbol. Cc: Rob Clark <robclark@freedesktop.org> Cc: "10.6" <mesa-stable@lists.freedesktop.org> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
* xa: support for drivers which use NIRRob Clark2015-04-051-0/+12
| | | | | | | | | | We need to pull in libnir.la and it's dependency libglsl_util.la. Also, _mesa_error_no_memory() must be defined. Fortunately with libnir.la (vs pulling in all of libglsl.la) we don't also need libstdc++. Signed-off-by: Rob Clark <robclark@freedesktop.org>
* st/xa: silence unused variable warningBrian Paul2014-09-221-0/+1
| | | | Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
* st/xa: Don't close the drm fd on failure v2Thomas Hellstrom2014-07-031-1/+6
| | | | | | | | | | | | | | | | If XA fails to initialize with pipe_loader enabled, the pipe_loader's cleanup function will close the drm file descriptor. That's pretty bad because the file descriptor will probably be the X server driver's only connection to drm. Temporarily solve this by dup()'ing the file descriptor before handing it over to the pipe loader. This fixes freedesktop.org bugzilla bug #80645. v2: Fix CC addresses. Cc: "10.2" <mesa-stable@lists.freedesktop.org> Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
* targets/xa: provide alternative(static) xa targetEmil Velikov2014-06-301-0/+8
| | | | | | | | | | | | | | | | Now we can build the xa target (libxatracker) with either static pipe-drivers or shared ones. Currently we default to static. - Remove the unused CFLAGS/CPPFLAGS. - Use GALLIUM_TARGET_CFLAGS where applicable. v2: Update the printout messages at configure. v3: Drop inclusion of the wrapper winsys and softpipe/llvmpipe. Cc: Jakob Bornecrantz <jakob@vmware.com> Cc: Rob Clark <robclark@freedesktop.org> Cc: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
* st/xa: missing handle typeRob Clark2014-02-161-0/+1
| | | | | | | DRM_API_HANDLE_TYPE_SHARED is zero, so doesn't actually fix anything. But we shouldn't rely on SHARED handle type being zero. Signed-off-by: Rob Clark <robclark@freedesktop.org>
* st/xa: use pipe-loader to get screenRob Clark2014-02-161-1/+6
| | | | | | This lets multiple gallium drivers use XA. Signed-off-by: Rob Clark <robclark@freedesktop.org>
* xa: move surface to ref/unref apiJerome Glisse2013-07-251-1/+15
| | | | | | | This make ddx life easier. Signed-off-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Rob Clark <robclark@freedesktop.org>
* xa: add handle type parameter to get handleJerome Glisse2013-07-251-1/+10
| | | | | | Allow to retrieve non shared handle. Signed-off-by: Jerome Glisse <jglisse@redhat.com>
* xa: add xa_surface_from_handle()Rob Clark2013-07-251-4/+37
| | | | | | | | | | | For freedreno DDX, we have to create the scanout GEM bo in a special way (until we have our own KMS/DRM kernel driver.. and even then for phones/tablets you probably need to use the android drivers if you don't want to port the lcd panel driver support). The easiest way to handle this is let the DDX create the scanout bo, and then create the xa surface from that. Signed-off-by: Rob Clark <robclark@freedesktop.org>
* gallium: extend pipe_context::flush for it to accept an END_OF_FRAME flagMarek Olšák2013-01-041-1/+1
| | | | | | | | | | | | | | | | | Usage with pipe_context: pipe->flush(pipe, NULL, PIPE_FLUSH_END_OF_FRAME); Usage with st_context_iface: st->flush(st, ST_FLUSH_END_OF_FRAME, NULL); The flag is only a hint for drivers. Radeon will use it for buffer eviction heuristics in the kernel (e.g. for queries like how many frames have passed since a buffer was used). The flag is currently only generated by st/dri on SwapBuffers. Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
* st/xa, xa/vmwgfx: Use XA_EXPORT attribute to indicate global visibilityThomas Hellstrom2011-11-251-9/+9
| | | | | | | Also fix up Makefiles to use the default mesa compilation flags. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Jakob Bornecrants <jakob@vmware.com>
* st/xa: Add a scanout flag for surfacesThomas Hellstrom2011-11-011-0/+12
| | | | | | | Bump minor to signal availability. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
* gallium: rename ZS stencil type to UINT (v2)Dave Airlie2011-10-111-2/+2
| | | | | | | | | | these are never USCALED, always UINT in reality. taken from some work by Christoph Bumiller v2: fixup formatting of table + tabs Signed-off-by: Dave Airlie <airlied@redhat.com>
* st/xa: surfaces and sampler views are per contextThomas Hellstrom2011-09-291-4/+5
| | | | | | | | Don't store references to these on the surface but on the context. References to transfers are still stored on the surface since we allow only a single map of a surface at a time. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
* st/xa: Add a function to check for supported formatsThomas Hellstrom2011-06-271-4/+26
| | | | | | | | | | | | | Typically this was done by having a surface creation function fail if the format was not supported. However, in some situations when changing hardware surface formats, it's desirable to do this check before attempting costly readback operations. Also updated the surface_redefine interface. Bump minor. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
* st/xa: Really support xa_surface_format. Bump minor.Thomas Hellstrom2011-06-211-0/+6
| | | | Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
* st/xa: Initial import of the xa state-tracker and the xa-vmwgfx target.Thomas Hellstrom2011-06-151-0/+420
See the file src/gallium/state_trackers/xa/README for more info. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>