summaryrefslogtreecommitdiffstats
path: root/src/egl
Commit message (Collapse)AuthorAgeFilesLines
* egl: check the correct function pointerEric Engestrom2017-08-022-1/+3
| | | | | | | | | | `.swap_interval` != `.SwapInterval`... Fixes: 991ec1b81a76de24fd01 "egl: make platform's SwapInterval() optional" Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102015 Cc: Cedric Sodhi <[email protected]> Signed-off-by: Eric Engestrom <[email protected]> Tested-by: Cedric Sodhi <[email protected]>
* egl/drm: Fix misused x and y offsets in swrast_get_image()Gwan-gyeong Mun2017-08-011-4/+19
| | | | | | | | | | | | | It fixes misused x and y variables on the calculation of the memory copy regions. Cc: Giovanni Campagna <[email protected]> Fixes: 8430af5ebe1ee8119e14 "Add support for swrast to the DRM EGL platform" Signed-off-by: Mun Gwan-gyeong <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]> [Eric: use gbm_bo_get_bpp() instead of local function, split clamp patch] Signed-off-by: Eric Engestrom <[email protected]>
* egl/drm: Fix misused x and y offsets in swrast_put_image2()Gwan-gyeong Mun2017-08-011-2/+17
| | | | | | | | | | | | | It fixes misused x and y variables on the calculation of the memory copy regions. Cc: Giovanni Campagna <[email protected]> Fixes: 8430af5ebe1ee8119e14 "Add support for swrast to the DRM EGL platform" Signed-off-by: Mun Gwan-gyeong <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]> [Eric: use gbm_bo_get_bpp() instead of local function, split clamp patch] Signed-off-by: Eric Engestrom <[email protected]>
* egl: remove unnecessary empty array elementEric Engestrom2017-08-011-3/+2
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: split enums to make use of -WswitchEric Engestrom2017-08-011-10/+8
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: use designated initaliser for _eglGlobalEric Engestrom2017-08-011-9/+9
| | | | | | | | Turn comments into actual code, that the compiler can check for us :) (Speaking of, one of the comments had a typo. Challenge: find it) Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: make platform's SwapInterval() optionalEric Engestrom2017-08-012-12/+1
| | | | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Daniel Stone <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* loader: remove clamp_swap_interval()Eric Engestrom2017-08-011-14/+0
| | | | | | | | | | As of last commit, no invalid swap interval can be stored, so there's no need to sanitize the values when reading them anymore. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Daniel Stone <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* egl: deduplicate swap interval clamping logicEric Engestrom2017-08-014-40/+14
| | | | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Daniel Stone <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* Android: fix compile error for DRI2 loader getCapabilityRob Herring2017-07-311-1/+1
| | | | | | | | | | Fix compile failure from commit 1bf703e4ea5c ("dri_interface,egl,gallium: only expose RGBA visuals on Android"). Fixes: 1bf703e4ea5c ("dri_interface,egl,gallium: only expose RGBA visuals on Android") Cc: 17.2 <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Rob Herring <[email protected]>
* dri_interface,egl,gallium: only expose RGBA visuals on AndroidMarek Olšák2017-07-311-2/+16
| | | | | | | | | | | | | | X/GLX can't handle them. This removes almost 500 GLX visuals that were incorrectly exposed. Add an optional getCapability callback for querying what the loader can do. I'm not splitting this patch, because it's already too small. v2: also add the callback to __DRIimageLoaderExtension Reviewed-by: Nicolai Hähnle <[email protected]> Cc: 17.2 <[email protected]>
* egl: move KHR_no_error vs debug/robustness check further downGrigori Goronzy2017-07-261-11/+10
| | | | | | | | | | | | We'll fail to flag an error if the context flags appear after the no-error attribute in the context attribute list. Delay the check to after attribute parsing to fix this. Fixes: 4909519a665 ("egl: Add EGL_KHR_create_context_no_error support") Cc: [email protected] [Emil Velikov: add fixes/stable tags, commit message polish] Reviewed-by: Emil Velikov <[email protected]>
* egl: fix whitespace issues from eglimage codeTapani Pälli2017-07-251-10/+10
| | | | | Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl/wayland: Ignore invalid modifiersDaniel Stone2017-07-241-0/+4
| | | | | | | | | | | If the underlying driver does not support modifiers, dmabuf will still advertise formats through the 'modifier' event, but send them with an invalid modifier. Ignore them if this is the case, rather than passing them through to the driver. Signed-off-by: Daniel Stone <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Fixes: 02cc35937277 ("egl/wayland: Use linux-dmabuf interface for buffers")
* egl: guard wayland header dep. tracking behind HAVE_PLATFORM_WAYLAND17.2-branchpointEmil Velikov2017-07-241-1/+1
| | | | | | | | | Otherwise we'll attemt to generate the header even we don't need to. In that case the dependencies may not be met, leading to build failure. Fixes: 166852e "configure.ac: rework wayland-protocols handling" Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* wayland-egl: update the SHA1 of the commit introducing v3Emil Velikov2017-07-241-1/+1
| | | | Signed-off-by: Emil Velikov <[email protected]>
* wayland-egl: Update ABI checkerMiguel A. Vico2017-07-241-15/+75
| | | | | | | | | | This change updates wayland-egl-abi-check.c with the latest changes to wl_egl_window. Signed-off-by: Miguel A. Vico <[email protected]> Reviewed-by: James Jones <[email protected]> Acked-by: Daniel Stone <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* wayland-egl: Make wl_egl_window a versioned structMiguel A. Vico2017-07-243-2/+24
| | | | | | | | | | | | | | | | | | | | | | We need wl_egl_window to be a versioned struct in order to keep track of ABI changes. This change makes the first member of wl_egl_window the version number. An heuristic in the wayland driver is added so that we don't break backwards compatibility: - If the first field (version) is an actual pointer, it is an old implementation of wl_egl_window, and version points to the wl_surface proxy. - Else, the first field is the version number, and we have wl_egl_window::surface pointing to the wl_surface proxy. Signed-off-by: Miguel A. Vico <[email protected]> Reviewed-by: James Jones <[email protected]> Acked-by: Daniel Stone <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: Fix _eglPointerIsDereferencable() to ignore page residencyMiguel A. Vico2017-07-241-1/+12
| | | | | | | | | | | | | | | | | mincore() returns 0 on success, and -1 on failure. The last parameter is a vector of bytes with one entry for each page queried. mincore returns page residency information in the first bit of each byte in the vector. Residency doesn't actually matter when determining whether a pointer is dereferenceable, so the output vector can be ignored. What matters is whether mincore succeeds. See: http://man7.org/linux/man-pages/man2/mincore.2.html Signed-off-by: Miguel A. Vico <[email protected]> Acked-by: Daniel Stone <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: Move _eglPointerIsDereferencable() to eglglobals.[ch]Miguel A. Vico2017-07-243-33/+37
| | | | | | | | | | Move _eglPointerIsDereferencable() to eglglobals.[ch] and make it a non-static function so it can be used out of egldisplay.c Signed-off-by: Miguel A. Vico <[email protected]> Reviewed-by: James Jones <[email protected]> Acked-by: Daniel Stone <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* wayland-egl: Add wl_egl_window ABI checkerMiguel A. Vico2017-07-242-1/+180
| | | | | | | | | | Add a small ABI checker for wl_egl_window so that we can check for backwards incompatible changes at 'make check' time. Signed-off-by: Miguel A. Vico <[email protected]> Reviewed-by: James Jones <[email protected]> Acked-by: Daniel Stone <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* configure.ac: rework wayland-protocols handlingEmil Velikov2017-07-241-6/+7
| | | | | | | | | | | | | | | | | | At dist/distcheck time we need to ensure that all the files and their respective dependencies are handled. At the moment we'll bail out as the linux-dmabuf rules are guarded in a conditional. Move them outside of it and drop the sources from BUILT_SOURCES. Thus the files will be generated only as needed, which will happen only after the wayland-protocols dependency is enforced in configure.ac. v2: add dependency tracking for the header Cc: Andres Gomez <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Andres Gomez <[email protected]>
* egl: fix line continuationEric Engestrom2017-07-191-1/+1
| | | | | | | | | | | | Trailing space after the backslash meant the rest of the AM_CFLAGS lines were no longer included. This has been silently ignored because of the next line starting with a `-` dash, instructing make to be silent about that line. Fixes: 02cc359372773800de81 "egl/wayland: Use linux-dmabuf interface for buffers" Cc: Daniel Stone <[email protected]> Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Daniel Stone <[email protected]>
* egl: propagate EGL_BAD_ATTRIBUTE during EGLImage attr parsingEmil Velikov2017-07-191-0/+7
| | | | | | | | | | | | | | Earlier commit refactored/split the parsing into separate hunks. While no functional change was intended, it did not attribute that different error is set when the attrib. value is incorrect. Fixes: 3ee2be4113d ("egl: split _eglParseImageAttribList into per extension functions") Cc: Michel Dänzer <[email protected]> Reported-by: Michel Dänzer <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Tested-by: Michel Dänzer <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl/dri2: remove unused buffer_count variableGwan-gyeong Mun2017-07-194-8/+2
| | | | | | | | | It removes unused buffer_count variable from dri2_egl_surface. And it polishes the assert of dri2_drm_get_buffers_with_format(). Signed-off-by: Mun Gwan-gyeong <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl/drm: Format code in platform_drm.c according to style guide.Gwan-gyeong Mun2017-07-191-1/+2
| | | | | | | | | This is a tiny housekeeping patch which does the following: * Limit lines to 78 or fewer characters. According to the mesa coding style guidelines. Signed-off-by: Mun Gwan-gyeong <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl/drm: add going out of the loop when the designated buffer is foundGwan-gyeong Mun2017-07-191-0/+1
| | | | | | | | Because the color_buffers have a each unique bo, if the designated buffer is found, release_buffer() can go out the loop which seaches the buffer. Signed-off-by: Mun Gwan-gyeong <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: Add MKDIR_GEN definitionDaniel Stone2017-07-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | Adding linux-dmabuf Wayland protocol files as generated did the right thing, by prepending $(MKDIR_GEN) so autotools didn't try to write into a build directory which didn't yet exist. Unfortunately MKDIR_GEN needs to be defined in every Makefile it's used in (which we do now), or alternately defined and substituted in configure.ac (which we don't do), and src/egl/ didn't actually have it from either method. As unset variables expand to nothing, it was silently being skipped. Copy & paste the defintion to make sure drivers/dri2/ exists before we try to generate files into it. Signed-off-by: Daniel Stone <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reported-by: Nick Sarnie <[email protected]> Reported-by: Mike Lothian <[email protected]> Fixes: 02cc35937277 ("egl/wayland: Use linux-dmabuf interface for buffers")
* egl/wayland: Use linux-dmabuf interface for buffersDaniel Stone2017-07-185-20/+217
| | | | | | | When available, use the zwp_linux_dambuf_v1 interface to create buffers, which allows multiple planes and buffer modifiers to be used. Reviewed-by: Emil Velikov <[email protected]>
* egl/wayland: Remove duplicate wl_buffer creation codeDaniel Stone2017-07-181-42/+12
| | | | | | | Now create_wl_buffer is generic enough, we can use it for the EGL_WL_create_wayland_buffer_from_image extension. Reviewed-by: Emil Velikov <[email protected]>
* egl/wayland: Remove more surface specifics from create_wl_bufferDaniel Stone2017-07-181-15/+12
| | | | Reviewed-by: Emil Velikov <[email protected]>
* egl/wayland: Make create_wl_buffer more genericDaniel Stone2017-07-181-32/+34
| | | | | | | | Remove surface-specific code from create_wl_buffer, so it's now just a generic translation from DRIimage to wl_buffer. Reviewed-by: Lucas Stach <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* gbm: Axe buffer import format conversion tableDaniel Stone2017-07-181-1/+2
| | | | | | | | | | | | | Wayland buffers coming from wl_drm use the WL_DRM_FORMAT_* enums, which are identical to GBM_FORMAT_*. Similarly, FD imports do not need to convert between GBM and DRI FourCC, since they are (almost) completely compatible. This widens the formats accepted by gbm_bo_import() when importing wl_buffers; previously, only XRGB8888, ARGB8888, RGB565 and YUYV were supported. Reviewed-by: Emil Velikov <[email protected]>
* egl: Fix predecence problem when setting __DRI_CTX_FLAG_NO_ERRORKenneth Graunke2017-07-141-1/+1
| | | | | | | | | | This accidentally set __DRI_CTX_FLAG_NO_ERROR whenever any flags were present. Just needs extra parenthesis. Fixes: 4909519a6655 (egl: Add EGL_KHR_create_context_no_error support) Reviewed-by: Grigori Goronzy <[email protected]> Tested-by: Mark Janes <[email protected]>
* egl: Add EGL_KHR_create_context_no_error supportGrigori Goronzy2017-07-146-2/+53
| | | | | | | | This only adds the EGL side, needs to be plumbed into Mesa frontend. v2: Add check for extension availability. Reviewed-by: Marek Olšák <[email protected]>
* egl/wayland: Use MIN2 for wl_drm versionDaniel Stone2017-07-141-3/+1
| | | | | | | | Use a slightly more explicit version cap for binding wl_drm, so we can add other interfaces with different versioning schemes later. Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl/wayland: Fix whitespace damageDaniel Stone2017-07-141-18/+20
| | | | | | | Convert tabs to spaces, fix misalignments. Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: remove unused err variableAlejandro Piñeiro2017-07-131-1/+1
| | | | | | Fixes: 81e95924ea1 ("egl: call _eglError within _eglParseImageAttribList") Reviewed-by: Daniel Stone <[email protected]>
* egl: set KHR_gl_texture_3D_image only when the requirements are met.Emil Velikov2017-07-121-3/+4
| | | | | | | | DRI_IMAGE's createImageFromTexture is used to implement the extension, so we should check for it prior to advertising. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl: enhance KHR_gl_image extensions checksEmil Velikov2017-07-121-15/+21
| | | | | | | | | | Drop the (duplicate) top-level check in dri2_create_image_khr() and add the respective checks in dri2_create_image_khr_{texture,renderbuffer} v2: use unreachable instead of assert in dri2_create_image_khr_texture Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl: don't set modifier if no modifiers are availableEmil Velikov2017-07-121-2/+0
| | | | | | | | | If no modifiers are available, the variable will never be used. Thus there's no point in initialising it. Cc: Varad Gautam <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl: check for extensions' presence during attr parsingEmil Velikov2017-07-121-4/+18
| | | | | | | | If the respective extension is not supported, one should return EGL_BAD_PARAMETER as mentioned in earlier commits. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl: add width/height as EXT_image_dma_buf_import attrsEmil Velikov2017-07-121-0/+6
| | | | | | | | | | | | | | | | | Although not listed amongst the initial EGL_LINUX_DRM_FOURCC_EXT and friends list, the spec reads ... Required attributes and their values are as follows: * EGL_WIDTH & EGL_HEIGHT: The logical dimensions of the buffer in pixels * EGL_LINUX_DRM_FOURCC_EXT: The pixel format of the buffer, as specified by drm_fourcc.h and used as the pixel_format parameter of the drm_mode_fb_cmd2 ioctl. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl: polish EXT_image_dma_buf_import attr parsingEmil Velikov2017-07-121-29/+22
| | | | | | | | Simplify the existing if/else + temporary variable into if (foo) return X. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl: simplify EXT_image_dma_buf_import_modifiers attr parsingEmil Velikov2017-07-121-26/+4
| | | | | | | Move the common extension check at the top. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl: split _eglParseImageAttribList into per extension functionsEmil Velikov2017-07-121-186/+260
| | | | | | | | | | Will allow us to simplify existing code and make further improvements short and simple. No functional change intended. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl: call _eglError within _eglParseImageAttribListEmil Velikov2017-07-123-30/+18
| | | | | | | | | | | | | | | | | | | | | | | As per EGL_KHR_image_base: If an attribute specified in <attrib_list> is not one of the attributes listed in Table bbb, the error EGL_BAD_PARAMETER is generated. We should set the error as opposed to simply log it. Currently we have a partial solution, whereby only some of the callers call _eglError(). Since that has proven to be less robust, simply set the error by the function itself and change the return type to EGLBoolean, updating the callers. So now the code is slightly simpler. Plus the follow-up fixes will be easier to manage. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl: move eglCreateDRMImageMESA's malloc laterEmil Velikov2017-07-121-29/+23
| | | | | | | | | | | | | | | | Don't bother allocating any memory until we're finished parsing and sanitising all the attributes. As a nice side effect we now consistently set eglError when any of the attrib/values are not correct. Strangely enough the spec does not mention _anything_ about what error should be set where, even if the implementation already sets the odd one. Cc: Kristian Høgsberg <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl: android: Fix potential use of unitialized variableTomasz Figa2017-07-051-1/+3
| | | | | | | | | | | If dri2_setup_extensions() fails, the "err" variable would not be assigned causing the error path to access an unitialized variable. Fix it by assigning an error message. Fixes: 2c341f2bda4 ("egl: refactor dri2_create_screen() into three separate functions") Signed-off-by: Tomasz Figa <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* Android: use symlinks for driver loadingRob Herring2017-06-291-9/+0
| | | | | | | | | Instead of having special driver loading logic for Android, create symlinks to gallium_dri.so so we can use the standard loading logic. Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Signed-off-by: Rob Herring <[email protected]>