summaryrefslogtreecommitdiffstats
path: root/src/egl
Commit message (Collapse)AuthorAgeFilesLines
* wayland: Don't cancel a roundtrip when any event is receivedJonas Ådahl2013-01-031-0/+3
| | | | | | | | | | | Since wl_display_dispatch_queue() returns the number of processed events or -1 on error, only cancel the roundtrip if an -1 is returned. This also fixes a potential memory corruption bug happening when the roundtrip does an early return and the callback later writes to the then out of scope stack allocated `done' parameter. Reviewed-by: Kristian Høgsberg <[email protected]>
* egl/android: Fix build for Jelly Bean (v2)Chad Versace2013-01-022-0/+64
| | | | | | | | | | | | | In Jelly Bean, the interface to ANativeWindow changed. The change included adding a new parameter the queueBuffer and dequeueBuffer methods, removing the lockBuffer method, and requiring libsync. v2: - s/fence_fd == -1/fence_fd != -1/ - Fix leak. Close the fence_fd. Reviewed-by: Tapani Pälli <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* egl/wayland: Dispatch the event queue before get_buffersAnder Conselvan de Oliveira2012-11-301-0/+3
| | | | | | | | | | | | | | | | | When a client frame callback is executed and the client starts rendering again, the egl event queue might not have been dispatched so that the buffer release event for the previous frame hasn't been processed. In that case a third buffer is allocated, even though it would be possible to reuse the buffer that was just released. The wl_display_dispatch_queue_pending() entry point is available from wayland-client 1.0.2, so require that in configure.ac. Also, just let the pkg-config macro throw its own error, which will show what version we were looking for and failed to find. Note: This is a candidate for stable branches. Signed-off-by: Ander Conselvan de Oliveira <[email protected]>
* egl/wayland: Add invalidate back in eglSwapBuffers()Kristian Høgsberg2012-11-301-0/+1
| | | | | | | | | | | | | Commit ca3ed3e024864e91ca3cccc59fb96950e1d079b5 fixed the problem where eglMakeCurrent would trigger a getbuffer callback that then breaks the following wl_egl_window_resize() call. However, we still need to invalidate buffers in eglSwapBuffers, since in wayland we always swap buffers, so the dri driver needs to come out and ask us for the next buffer after each swapbuffer. Note: this is a candidate for stable branches. Signed-off-by: Kristian Høgsberg <[email protected]>
* egl/wayland: Don't invalidate drawable on swap buffersAnder Conselvan de Oliveira2012-11-303-1/+27
| | | | | | | | | | | | | | | | | | | We used to invalidate the drawable after a call to eglSwapBuffers(), so that a wl_egl_window_resize() would take effect for the next frame. However, that leads to calling dri2_get_buffers() when eglMakeCurrent() is called with the current context and surface, and a later call to wl_egl_window_resize() would not take effect until the next buffer swap. Instead, add a callback from wl_egl_window_resize() back to the wayland egl platform, and invalidate the drawable only when it is resized. This solves a bug on wayland clients when going back to windowed mode from fullscreen when clicking a pop up menu, where the window size after this would be the fullscreen size. Note: this is a candidate for stable branches. CC: [email protected]
* egl/dri2: Set error code when dri2CreateContextAttribs failsChad Versace2012-11-191-0/+64
| | | | | | | | | | | When dri2CreateContextContextAttribs failed, eglCreateContext returned NULL yet set the error code to EGL_SUCCESS! The problem was that eglCreateContext ignored the error code returned by driCreateContextAttribs. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56706 Reviewed-by: Kenneth Graunke <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* Remove OpenVMS supportMatt Turner2012-11-161-3/+1
| | | | | | | | | | Not maintained since 2008. Doubtful that it's worked in quite a while. Also see commit 32ac8cb05 which removed VMS stuff from Makefile in 2009. Cc: Jouk Jansen <[email protected]> Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Andreas Boll <[email protected]>
* wayland: Destroy frame callback when destroying surfaceJonas Ådahl2012-11-071-0/+3
| | | | | | | | | | | | | | If a frame callback is not destroyed when destroying a surface, its handler function will be invoked if the surface was destroyed after the callback was requested but before it was invoked, causing a write on free:ed memory. This can happen if eglDestroySurface() is called shortly after eglSwapBuffers(). Note: This is a candidate for stable branches. Reviewed-by: Kristian Høgsberg <[email protected]>
* egl_dri2/x11: Fix eglPostSubBufferNV()Fredrik Höglund2012-11-071-1/+1
| | | | | | | | | This got broken in commit 0a523a8820e8a2549ac1c7887eb1892b228af44b. NOTE: This is a candidate for the 9.0 branch. Reviewed-by: Ian Romanick <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55856
* wayland: Drop support for ill-defined, unused wl_egl_pixmapKristian Høgsberg2012-10-173-187/+4
| | | | | | It doesn't provide the cross-process buffer sharing that a window system pixmap could otherwise support and we don't have anything left that uses this type of surface.
* wayland: Remove 0.85 compatibility #ifdefsKristian Høgsberg2012-10-171-26/+0
|
* egl/wayland: Update to Wayland 0.99 APIKristian Høgsberg2012-10-172-28/+78
| | | | | | | | | The 0.99.0 Wayland release changes the event API to provide a thread-safe mechanism for receiving events specific to a subsystem (such as EGL) and we need to use it in the EGL platform. The Wayland protocol now also requires a commit request to make changes take effect, issue that from eglSwapBuffers.
* egl: Return EGL_BAD_MATCH for invalid profile attributesMatt Turner2012-10-101-10/+7
| | | | | | | Version 12 of the EGL_KHR_create_context spec changed this behavior. NOTE: This is a candidate for the 9.0 branch Reviewed-by: Chad Versace <[email protected]>
* egl: Remove bogus invalidate code.Eric Anholt2012-10-091-5/+0
| | | | | | | | | | | | | | | The invalidate event support is a careful dance between driver and loader, where both have to say they can handle it, and then the loader reports invalidate events for the driver so the driver can do the optimization. The EGL code doesn't report __DRIuseInvalidateExtension to the driver, so it has no responsibility to call the driver's invalidate function, and the driver is doing the glViewport hack because it assume. This is not the only time invalidate would need to be called (we need it *any* time an invalidate event comes down the pipe, but we don't watch for them), so just stop calling the driver's function. Acked-by: Chad Versace <[email protected]>
* egl: Add support for driconf control of swapinterval.Eric Anholt2012-10-093-8/+77
| | | | | | | | | | This behavior mostly matches glx_dri2. It's slightly complicated in comparison because EGL exposes the implementation limits in the EGL config. Note that platform_x11 was the only one setting swap_available, so the move of the MaxSwapInterval into it is appropriate. Acked-by: Chad Versace <[email protected]>
* egl: Quit checking for a bug in old xcb when we require new xcb.Eric Anholt2012-10-091-4/+0
| | | | Reviewed-by: Chad Versace <[email protected]>
* egl: Drop xcb ifdefs by just requiring a version from this year.Eric Anholt2012-10-091-13/+0
| | | | | | | glx and gallium's xcb_dri2 usage already require this version, so this is nothing really new. Reviewed-by: Chad Versace <[email protected]>
* egl: Unifdef dri_interface.h defines.Eric Anholt2012-10-091-6/+0
| | | | | | | | dri_interface.h comes from our tree, so why litter our tree with ifdefs for older versions of it? Reviewed-by: Kristian Høgsberg <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* egl: Cleanly cast EGLNative* pointers to X11 types.Eric Anholt2012-10-091-2/+4
| | | | | | | | The EGLNative* types are all defined to be pointers across all our EGL implementations, but in the X11 platform they're actually just XIDs (32-bit integers). Reviewed-by: Chad Versace <[email protected]>
* SwapBuffersRegionNOK: invert rectangles on y axisRobert Bragg2012-10-021-2/+1
| | | | | | | | | | | The EGL_NOK_swap_region2 spec states that the rectangles are specified with a bottom-left origin within a surface coordinate space also with a bottom left origin, so this patch ensures the rectangles are flipped before passing them on to dri2_copy_region. Fixes piglit's egl-nok-swap-region test. Tested-by: Matt Turner <[email protected]>
* build: Use AX_PTHREAD's HAVE_PTHREAD preprocessor definitionMatt Turner2012-10-012-4/+4
|
* Use calloc instead of malloc/memset-0Matt Turner2012-09-054-17/+6
| | | | | | | | | | | | | | | | This patch has been generated by the following Coccinelle semantic patch: @@ expression E; identifier I; @@ - I = malloc(E); + I = calloc(1, E); ... - memset(I, 0, sizeof *I); Reviewed-by: Brian Paul <[email protected]>
* Remove useless checks for NULL before freeingMatt Turner2012-09-053-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch has been generated by the following Coccinelle semantic patch: // Remove useless checks for NULL before freeing // // free (NULL) is a no-op, so there is no need to avoid it @@ expression E; @@ + free (E); + E = NULL; - if (unlikely (E != NULL)) { - free(E); ( - E = NULL; | - E = 0; ) ... - } @@ expression E; type T; @@ + free ((T) E); + E = NULL; - if (unlikely (E != NULL)) { - free((T) E); ( - E = NULL; | - E = 0; ) ... - } @@ expression E; @@ + free (E); - if (unlikely (E != NULL)) { - free (E); - } @@ expression E; type T; @@ + free ((T) E); - if (unlikely (E != NULL)) { - free ((T) E); - } Reviewed-by: Brian Paul <[email protected]>
* Don't cast the return value of malloc/reallocMatt Turner2012-09-054-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch has been generated by the following Coccinelle semantic patch: // Don't cast the return value of malloc/realloc. // // Casting the return value of malloc/realloc only stands to hide // errors. @@ type T; expression E1, E2; @@ - (T) ( _mesa_align_calloc(E1, E2) | _mesa_align_malloc(E1, E2) | calloc(E1, E2) | malloc(E1) | realloc(E1, E2) )
* Remove Xcalloc/Xmalloc/Xfree callsMatt Turner2012-09-051-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These calls allowed Xlib to use a custom memory allocator, but Xlib has used the standard C library functions since at least its initial import into git in 2003. It seems unlikely that it will grow a custom memory allocator. The functions now just add extra overhead. Replacing them will make future Coccinelle patches simpler. This patch has been generated by the following Coccinelle semantic patch: // Remove Xcalloc/Xmalloc/Xfree calls @@ expression E1, E2; @@ - Xcalloc (E1, E2) + calloc (E1, E2) @@ expression E; @@ - Xmalloc (E) + malloc (E) @@ expression E; @@ - Xfree (E) + free (E) @@ expression E; @@ - XFree (E) + free (E) Reviewed-by: Brian Paul <[email protected]>
* dri: Rework planar image interfaceJakob Bornecrantz2012-08-311-90/+38
| | | | | | | | | | | | | | | | | | | | | | As discussed with Kristian on #wayland. Pushes the decision of components into the dri driver giving it greater freedom to allow t to implement YUV samplers in hardware, and which mode to use. This interface will also allow drivers like SVGA to implement YUV surfaces without the need to sub-allocate and instead send 3 seperate buffers for each channel, currently not implemented. I have tested these changes on Gallium Svga. Scott tested them on both intel and Gallium Radeon. Kristan and Pekka tested them on intel. v2: Fix typo in dri2_from_planar. v3: Merge in intel changes. Tested-by: Scott Moreau <[email protected]> Tested-by: Pekka Paalanen <[email protected]> Tested-by: Kristian Høgsberg <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]> Signed-off-by: Jakob Bornecrantz <[email protected]>
* android: do not expose single buffered eglconfigsTapani Pälli2012-08-311-11/+8
| | | | | | | | | | | | On Android we want to add only double buffered configs for visuals. Earlier implementation set the SurfaceType as 0 for single buffered configs but driver still exposed these configs that were not compatible with any egl surface type. This caused Khronos conformance test runs to fail on Android. This patch fixes the issue by skipping single buffered configs earlier and not exposing them. Signed-off-by: Tapani Pälli <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* android: fix liblog API changesTapani Pälli2012-08-311-3/+14
| | | | | | | | android logging macros changed their name in JellyBean. Signed-off-by: Bruce E. Robertson <[email protected]> Signed-off-by: Tapani Pälli <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* egl: fix invalid flag detection for EGL_KHR_create_contextMatt Turner2012-08-271-1/+1
| | | | | | | | We want to check whether there are bits set outside of the valid flags. Fixes piglit test egl-create-context-invalid-flag-gl Reviewed-by: Ian Romanick <[email protected]>
* gbm: Use libkms to replace DRI cursor imagesJakob Bornecrantz2012-08-261-0/+1
| | | | | | | | | | | | | | Uses libkms instead of dri image cursor. Since this is the only user of the DRI cursor and write interface we can remove cursor surfaces entirely from the DRI interface and as a consequence also from the Gallium interface as well. Tho to make everybody happy with this it would probably should add a kms_bo_write function, but that is probably wise in anyways. The only downside is that it adds a dependancy on libkms, this could how ever be replaced with the dumb_bo drm ioctl interface. Tested-by: Scott Moreau <[email protected]> Signed-off-by: Jakob Bornecrantz <[email protected]>
* egl_dri2: Fix segmentation faultPaulo Alcantara2012-08-231-1/+1
| | | | | | | | | | | | | The segmentation fault occurs when DRI2 is not loaded up and dri2_setup_screen() function deferences dri2_dpy->dri2 (since it's NULL at this point). This patch fixes the segmentation fault by checking if dri2 pointer is not NULL before deferencing it. Signed-off-by: Paulo Alcantara <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Brian Paul <[email protected]>
* egl: Allow OpenGL ES 3.0 as a versionIan Romanick2012-08-142-1/+8
| | | | | | | In the DRI2 back-end this will get the same API as GLES 2.0. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* egl_dri2: Add support for EGL_KHR_create_context and ↵Ian Romanick2012-08-142-6/+62
| | | | | | | | | | | EGL_EXT_create_context_robustness Just like in GLX, EGL_KHR_create_context requires DRI2 version >= 3, and EGL_EXT_create_context_robustness requires both DRI2 version >= 3 and the __DRI2_ROBUSTNESS extension. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* egl: Implement front-end support for EGL_EXT_create_context_robustnessIan Romanick2012-08-143-0/+29
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* egl: Implement front-end support for EGL_KHR_create_contextIan Romanick2012-08-144-5/+217
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* egl_dri2: Silence warnings about missing initializersIan Romanick2012-08-141-2/+2
| | | | | | | | | | | egl_dri2.c: At top level: egl_dri2.c:325:4: warning: missing initializer [-Wmissing-field-initializers] egl_dri2.c:325:4: warning: (near initialization for 'swrast_driver_extensions[2].version') [-Wmissing-field-initializers] egl_dri2.c:330:4: warning: missing initializer [-Wmissing-field-initializers] egl_dri2.c:330:4: warning: (near initialization for 'swrast_core_extensions[1].version') [-Wmissing-field-initializers] Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* egl: Rename ClientVersion to ClientMajorVersion, add ClientMinorVersionIan Romanick2012-08-143-7/+9
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* egl_dri2: Use createContextAttribs if DRI2 version >= 3Ian Romanick2012-08-141-1/+17
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* egl_dri2: Require DRI2 version 2Ian Romanick2012-08-141-22/+5
| | | | | | | | The extra block in dri2_create_context is to prevent extra white space noise in the next patch. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* egl: Replace KHR_surfaceless_* extensions with KHR_surfaceless_contextIan Romanick2012-08-065-35/+8
| | | | | | | | | | | | KHR extension name is reserved for Khronos ratified extensions, and there is no such thing as EGL_KHR_surfaceless_{gles1,gles2,opengl}. Replace these three extensions with EGL_KHR_surfaceless_context since that extension actually exists. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* egl_dri2: Refactor dereference of dri2_ctx_sharedIan Romanick2012-08-061-6/+5
| | | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* egl_dri2: Remove swrast version >= 2 checksIan Romanick2012-08-061-27/+11
| | | | | | | | | | | Since support for swrast version 2 was added (f55d027a), it has also been required. In swrast_driver_extensions, version 2 is set for __DRI_SWRAST extension. Remove the spurious version checks sprinked through the code. Signed-off-by: Ian Romanick <[email protected]> Cc: Kristian Høgsberg <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* wayland: Support EGL_WIDTH and EGL_HEIGHT queries for wl_bufferKristian Høgsberg2012-07-191-1/+8
| | | | | | We're going to make the public wl_buffer struct as small as possible. Signed-off-by: Kristian Høgsberg <[email protected]>
* wayland: Use existing EGL_TEXTURE_FORMAT for querying wl_buffer texture formatKristian Høgsberg2012-07-191-11/+11
| | | | | | | | We also reuse EGL_TEXTURE_RGBA and EGL_TEXTURE_RGB, adding only the new planar YUV texture formats: EGL_TEXTURE_Y_U_V_WL, EGL_TEXTURE_Y_UV_WL and EGL_TEXTURE_Y_XUXV_WL. Signed-off-by: Kristian Høgsberg <[email protected]>
* wayland: Include wl_drm format enum in wayland-drm.hKristian Høgsberg2012-07-171-1/+64
| | | | | This gets referenced before we get to generate the header files, so just include the enum that we need and don't include the generated header.
* egl_dri2: NULL check for EGLNativeWindowTypeElvis Lee2012-07-161-0/+2
| | | | | | | | | Some application calls eglCreateWindowSurface with EGLNativeWindowType parameter having zero value. It causes SEGV and disturbs error handling like EGL_NO_SURFACE. Signed-off-by: Elvis Lee <[email protected]> Signed-off-by: Brian Paul <[email protected]>
* gbm: Add new gbm_bo_import entry pointKristian Høgsberg2012-07-161-3/+0
| | | | | This generalizes and replaces gbm_bo_create_for_egl_image. gbm_bo_import will create a gbm_bo from either an EGLImage or a struct wl_buffer.
* wayland: Stop trying to use make rules from aclocal, just copy and pasteKristian Høgsberg2012-07-132-1/+8
| | | | | | | | | Defeated by autotool, copy and paste to the rescue. https://bugs.freedesktop.org/show_bug.cgi?id=51997 https://bugs.freedesktop.org/show_bug.cgi?id=51531 Signed-off-by: Kristian Høgsberg <[email protected]>
* automake: convert libglapiJon TURNEY2012-07-131-1/+1
| | | | | | | | | | | | | | | | | | | * "configure substitutions are not allowed in _SOURCES variables" in automake, so remove the AC_SUBST'ed GLAPI_ASM_SOURCES and instead use some AM_CONDITIONALS to choose which asm sources are used * Change GLAPI_LIB to point to the .la file in other Makefile.am files, and make a link to the .a file for the convenience of other Makefiles which have not yet been converted to automake v2: - Use AM_CPPFLAGS for cleaner build output - EXTRA_SOURCES is not needed - Remove libglapi.a compatibility link on clean Signed-off-by: Jon TURNEY <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Tested-by: Matt Turner <[email protected]>
* egl: Add EGL_WAYLAND_PLANE_WL attributeKristian Høgsberg2012-07-116-16/+166
| | | | | | | This lets us specify the plane to create the image for for multiplanar wl_buffers. Signed-off-by: Kristian Høgsberg <[email protected]>