summaryrefslogtreecommitdiff
path: root/va/x11
Commit message (Collapse)AuthorAgeFilesLines
* Fixes file descriptor leakGavin Stark2020-06-092-2/+8
| | | | | | | | | | | | | | If code calls va_isDRI2Connected multiple times there is no protection against calling open(device_name, O_RDWR) again and losing the reference to the original file descriptor. A recent change (bc8a12) calls the method twice each time libva is initialized, thus causing a leak of device file descriptors. This change moves the initializing of the fd and auth_type to the creation of the dri_state and then checks to see if they have already been initialized. If so, the method va_isDRIConnected returns true and fills in driver_name.
* VA/X11: VAAPI driver mapping for iris DRI driverU. Artie Eoff2020-04-171-0/+2
| | | | | | Fixes #396 Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
* VA/X11: enable driver candidate selection for DRI2U. Artie Eoff2020-04-171-14/+112
| | | | | | | Map the i965 DRI driver to iHD and i965 vaapi driver candidates. Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
* Return once the drawable is destroyedHaihao Xiang2018-03-131-0/+1
| | | | | | Otherwise it might dereference a freed pointer in the next loop Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
* Move driver context allocation to common codeMark Thompson2017-11-211-39/+35
| | | | | | | This will be required to set common options on a newly-created driver context. Signed-off-by: Mark Thompson <sw@jkqxz.net>
* build: Remove unused macroVíctor Manuel Jáquez Leal2017-11-211-1/+0
| | | | | | | Remove -DLINUX macro definition as compiler parameters because it is not used. Fixes: #147
* coverity: fix check_after_derefVictor Toso2017-11-161-2/+1
| | | | | | | | | - /va/x11/dri2_util.c: > libva-1.8.3/va/x11/dri2_util.c:218: check_after_deref: Null-checking > "device_name" suggests that it may be null, but it has already been > dereferenced on all paths leading to the check. Signed-off-by: Victor Toso <victortoso@redhat.com>
* Add reserved bytes to most structuresXiang, Haihao2017-09-271-0/+4
| | | | | | | | The reserved bytest must be set to 0, then we can add new fields to those structures in future without worrying about the API compatibility too much. Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
* Add namespace prefix to global DRI functions in libva-x11Mark Thompson2017-09-274-14/+14
| | | | Signed-off-by: Mark Thompson <sw@jkqxz.net>
* Add namespace prefix to globalsMark Thompson2017-09-271-1/+1
| | | | | | | Add "va_" prefix to trace_flag, fool_codec and fool_postp to avoid polluting the global namespace. Signed-off-by: Mark Thompson <sw@jkqxz.net>
* Move VADisplay allocation to common codeMark Thompson2017-09-271-3/+2
| | | | | | | This is slightly cleaner, and will be required to set common options on a newly-created display. Signed-off-by: Mark Thompson <sw@jkqxz.net>
* Move some common macro definitions to the new internal headerMark Thompson2017-09-271-2/+0
| | | | Signed-off-by: Mark Thompson <sw@jkqxz.net>
* configure fails if requirement can't be met for user's explicit requestXiang, Haihao2017-06-201-2/+0
| | | | | | | | | | | | | | Notify user an error if user provides --enable-x11/--enable-glx/--enable-egl/--enable-wayland however the requirement can't be met. drm has been checked mandatorily in the script v2: Remove XEXT_CFLAGS/XFIXES_CFLAGS from va/x11/Makefile.am and use $X11_PKG_ERRORS in the error message if the requirement is met for VA/X11 This fixes https://github.com/01org/libva/issues/68 Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com> Reviewed-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
* Avoid assertion fault when trying to draw a big pictureXiang, Haihao2017-06-061-1/+0
| | | | | | | | | | | The display server doesn't support the big picture, so the returned buffer is NULL. The fix returns a NULL buffer instead of assertion fault in libva-x11, the backend driver should handle this case in a right way as well. This fixes https://github.com/01org/libva/issues/51 Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
* va/x11: Require synchronisation to vblank with DRI2SwapBuffersChris Wilson2016-11-161-2/+3
| | | | | | | | | | | | | By passing divisor=0, we imply we do not care about synchronisation of this request to the vertical refresh - the spec says that if we miss the target frame, the swap will be presented as quickly as possible and may forgo waiting until the next vblank. By using divisor=1, we request that the swap be presented upon the vertical refresh immediately following recipe, enforcing the synchronisation to vblank and avoiding tearing. Reported-and-tested-by: Lukas Hejtmanek <xhejtman@ics.muni.cz> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Sean V Kelley <seanvk@posteo.de>
* gcc suggests not putting ; at end of if statementsAlan Coopersmith2016-04-251-1/+1
| | | | | | | | | | | | dri2_util.c: In function 'dri2Close': dri2_util.c:171:33: warning: suggest braces around empty body in an 'if' statement [-Wempty-body] if (dri_state->base.fd >= 0); ^ Introduced-by: commit fffeffb8a78fffbb6a May 30 2011 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
* x11_screen driver context member initialization for X11 outputAlexandr2015-11-191-0/+1
| | | | | | https://bugs.freedesktop.org/show_bug.cgi?id=61603 Signed-off-by: Alexandr <pankoAA@ya.ru>
* va/x11: Don't crash the application if it does not have access to the DRI2 ↵Francois Gouget2015-09-291-1/+0
| | | | | | | | | | device. Applications run in a different account than the logged in user will not have permission to access /dev/dri/card0 but may be able to work without it, particularly if VA-API was brought in through a general framework such as GStreamer. Signed-off-by: Francois Gouget <fgouget@free.fr>
* x11: dri2: fix double Unlocks/SyncHandleLionel Landwerlin2015-03-101-4/+0
| | | | Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
* x11: check x pixmap is still alive before DRI2DestroyDrawableLionel Landwerlin2014-12-041-20/+80
| | | | | | | | | | | | | | | | | Calling vaTerminate() after the pixmaps, given to vaPutSurface(), have been destroyed results in errors coming from the X server. These errors happens because LibVA tries to destroy the DRI2Drawables related to the XPixmaps passed to vaPutSurface(). VA_DRI2Error() has some code to catch these errors and ignore them. The problem is that LibX11 doesn't trigger the extension error handlers unless you're waiting for a response using _XReply(), and there is no defined answer to a DRI2DestroyDrawable message in the DRI2 protocol. The attached patch tries to work around that issue by checking whether the XPixmap is still alive before proceeding with DRI2DestroyDrawable. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
* Fix while loopXiang, Haihao2014-12-041-1/+2
| | | | | | | Otherwise i may be 32 after enter the loop and access dri_state->drawable_hash[32]. Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
* va_x11: hide private symbolsEmil Velikov2014-10-085-1/+6
| | | | | | | | | | The following are not part of the API thus should be hidden. - dri2Close - VA_FGLRXGetClientDriverName - VA_NVCTRLQueryDirectRenderingCapable - VA_NVCTRLGetClientDriverName Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
* va_x11: fix klockscan issue (details is bellow)Austin Yuan2013-06-191-1/+3
| | | | | | | | | | | | | | | File: va_x11.c Function: va_DisplayContextGetDriverName -> va_DRI2GetDriverName -> dri2_util.c:isDRI2Connected Line: 154 -> 84 -> dri2_util.c:184 Code: TRACEBACK va_x11.c:151: driver_name is NULL va_x11.c:154: 'driver_name' is passed to function 'va_DRI2GetDriverName'. dri2_util.c:84: 'driver_name' is passed to function 'isDRI2Connected'. dri2_util.c:184: 'driver_name' is explicitly dereferenced. Signed-off-by: Austin Yuan <shengquan.yuan@gmail.com> (cherry picked from commit c87699f32c6c79905a2fd8675cd19f22e1f4b024)
* va_trace: refine the log formatElaine Wang2013-06-191-3/+3
| | | | | Signed-off-by: Elaine Wang <elaine.wang@intel.com> (cherry picked from commit 15a0fca64456d8c7de1f7aca2cb747c4929690cd)
* Automake 1.13 fixupsArmin K2013-03-191-1/+1
| | | | | | | | | error: 'AM_CONFIG_HEADER': this macro is obsolete. You should use the 'AC_CONFIG_HEADERS' macro instead. warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS') changed NO_CONFIGURE to NOCONFIGURE to be consistent with other packages
* Sanitize build dependencies.Gwenole Beauchesne2012-09-271-0/+2
| | | | | | | Fix build dependencies for all backends (DRM, X11, GLX, EGL, Wayland), especially when they don't live in standard locations. Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
* API: backend: add VA display types.Gwenole Beauchesne2012-09-261-0/+1
| | | | | | | | Make it possible to easily find how the VA display was created. This helps implement multiple backends in VA drivers. e.g. X11, Wayland while keeping a single generated binary. Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
* API: backend: rename VADriverContext.dri_state to drm_state.Gwenole Beauchesne2012-09-263-10/+10
| | | | | | | VADriverContext.drm_state holds data structures derived from struct drm_state, thus also including struct dri_state for VA/X11 drivers. Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
* API: introduce DRM common utilities and data structures.Benjamin Franzke2012-09-262-20/+20
| | | | | | | | Add <va/va_drmcommon.h> header for DRM-based drivers to use common base utilities and data structures. So far, only the DRM state is shared so that to maintain binary compatibility. Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
* Revert Pixmap-based EGL interfaces.Gwenole Beauchesne2012-09-261-43/+0
| | | | | | | | | | | | | | | | | | | | | | This was work-in-progress and it turned out to be less efficient than a dedicated API that could allow direct texturing from YUV components. This reverts the following commits: 30b5e62: fix license template for Makefile.am d1acbc9: add the missing license header to some files fc8f1b8: include va_egl.h instead of va.h c3ab994: array bound check 7b663dc: update the VA/EGL implementation in VAAPI 0851426: move va_egl.h to va/ to avoid compile error 1cda440: VA/EGL interfaces af294d1: fix compiling error if GLESv1_CM isn't installed in the default location 2a4fcff: fix the number of the allocated elements 2f484d7: update VA/EGL test case as well 2ac9bac: a test case to use VA/EGL interfaces 731d575: new hooks to create/free native pixmap Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
* license header: add the missing license header to filesAustin Yuan2012-06-283-0/+69
| | | | Signed-off-by: Austin Yuan <shengquan.yuan@intel.com>
* Fix build with alternate X11, GLX and EGL prefixes.Gwenole Beauchesne2012-06-281-1/+7
| | | | Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
* Revert "declare vaGetDisplay in va.h instead of va_xxx.h"Gwenole Beauchesne2012-04-081-1/+1
| | | | | | | | vaGetDisplay() belongs to winsys headers. This reverts commit 52c87f898b210cddde70231021097c5a0bb6fdc3. Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
* Remove legacy DRI supportXiang, Haihao2012-01-107-1273/+0
| | | | Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
* New hooks to create/free native pixmapXiang, Haihao2011-12-141-0/+43
| | | | Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
* declare vaGetDisplay in va.h instead of va_xxx.hXiang, Haihao2011-12-141-1/+1
| | | | Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
* va_fglrx: fix driver name detection.Gwenole Beauchesne2011-10-111-11/+32
| | | | | | | | | | | VA_FGLRXGetClientDriverName() used to return success even if no valid driver name was found, thus returning a NULL driver name. Also fixed the X display name matching routine to filter out the screen number, which may not be in the string, and make sure to compare screen numbers from what ADL returns too. Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
* vatrace/vafool: refine itAustin Yuan2011-09-221-9/+4
| | | | | | | | | remove va_fool_getframe.c which looks strange correct some coding style for file va.c simplify va_fool.c for both decode and encode refine the surface dump of va_trace.c Signed-off-by: Austin Yuan <shengquan.yuan@gmail.com>
* dri2: ignore BadDrawable errors.Gwenole Beauchesne2011-07-261-1/+20
| | | | | | | | | | | | | | | | | | | Hi, This patch fixes the following error. X Error of failed request: BadDrawable (invalid Pixmap or Window parameter) Major opcode of failed request: 137 (DRI2) Minor opcode of failed request: 4 (DRI2DestroyDrawable) Resource id in failed request: 0x4800001 Serial number of failed request: 30 Current serial number in output stream: 32 The X drawable can die before we notice it in free_drawable_hashtable(), called through vaTerminate(). This patch is ported from Mesa (GLX/DRI2). Regards, Gwenole.
* Fix out-of-source builds.Gwenole Beauchesne2011-07-261-1/+1
|
* cosmetics: clean up Makefiles.Gwenole Beauchesne2011-07-261-5/+27
|
* VA/X11: drop useless casts.Gwenole Beauchesne2011-07-264-18/+18
|
* Fix vaTerminate() with non DRI-based drivers.Gwenole Beauchesne2011-06-171-1/+1
|
* libva: fix memeory leaks in libvaEdgar Hucek2011-06-132-0/+12
| | | | | Signed-off-by: Edgar Hucek <gimli@dark-green.com> Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
* Revert the change in VA_DRI2SwapBuffers: _XReply -->_XSendAustin Yuan2011-06-101-2/+2
| | | | | | | We should use _XReplay. _XSend will introduce more CPU usage Signed-off-by: Edgar Hucek <gimli@dark-green.com> Signed-off-by: Austin Yuan <shengquan.yuan@gmail.com>
* libva: several changesAustin Yuan2011-05-303-3/+21
| | | | | | | | | 1) add free_drawable 2) clean the license of Android.mk 3) define VA_ROTATION_270 to 3 instead of 4 Signed-off-by: Zhaohan Ren <zhaohan.ren@intel.com> Signed-off-by: Austin Yuan <shengquan.yuan@gmail.com>
* va: always create a new VA display on X11Xiang, Haihao2011-05-161-38/+6
| | | | | | | | Previously a VA display will be shared if a native display is shared by multiple threads, it will casue some thread safety issue in a multi-threaded program. Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
* 1) test/*: enable/refine the test/* for both X11 and AndroidAustin Yuan2011-05-051-2/+2
| | | | | | | | | 2) va_dri2.c: use _XSend instead of _XReply which is time-consuming 3) trace message for vaPutSurface/vaInitialize/vaTerminate Signed-off-by: Guoliang Ji <guoliangx.ji@intel.com> Signed-off-by: Zhaohan Ren <zhaohan.ren@intel.com> Signed-off-by: Austin Yuan <shengquan.yuan@gmail.com>
* Make VADriverContext.vtable a pointer.Gwenole Beauchesne2011-02-091-1/+1
|
* Add sysdeps.h for system-dependent definitions. e.g. Android.Gwenole Beauchesne2010-12-211-1/+1
|