summaryrefslogtreecommitdiffstats
path: root/src/egl
Commit message (Collapse)AuthorAgeFilesLines
* glx: fix compile error in egl_glx.c.Gaetan Nadon2013-09-191-1/+1
| | | | | | | | | | | | | | | | | egl_glx.c:40:22: fatal error: X11/Xlib.h: No such file or directory The compiler cannot find the Xlib.h in the installed system headers. All supplied include directives point to inside the mesa module. The X11_CFLAGS variable is undefined (not defined in config.status). It appears the intent was to use X11_INCLUDES defined in configure.ac. The Xlib.h file is not installed on my workstation. It is supplied in the libx11-dev package. This allows an X developer control over which version of this file is used for X development. Signed-off-by: Gaetan Nadon <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* wayland-egl.pc requires wayland-client.pc.Torsten Duwe2013-09-111-0/+1
| | | | | | | | | Mesa provides the wayland-egl libs and the pkgconfig file, but the headers originate from the wayland package. Ensure everything matches, by requiring application builds to look at the wayland headers as well. Signed-off-by: Torsten Duwe <[email protected]> Signed-off-by: Johannes Obermayr <[email protected]>
* gbm: Link to libwayland-drm if Wayland EGL platform is enabledArmin K2013-08-121-4/+0
| | | | | | | | We were relying on libEGL to pull in libwayland-client symbols, but with commit 2c2e64edaba0f6aeb181ca5b51eb8dea8e9b39f9 cleaned up the symbol leak. https://bugs.freedesktop.org/show_bug.cgi?id=67962
* egl: Do not export private symbolsChad Versace2013-08-085-0/+5
| | | | | | | | | | | | | | | | | | | | | | libEGL was incorrectly exporting *all* symbols, public and private. This patch adds -fvisibility=hidden to libEGL's linker flags to ensure that only symbols annotated with __attribute__((visibility("default"))) get exported. Sanity-checked with libEGL's builtin DRI2 driver and the i965 DRI driver by running Piglit on X/EGL and by running weston-gears on Weston as an X client. Sanity-checked with libEGL's Gallium driver (which is not built-in) and the swrast Gallium driver by running es2gears_x11. Kristian reviewed the symbol diff in `nm libEGL.so`. CC: "9.2" <[email protected]> CC: Ian Romanick <[email protected]> Acked-by: Kristian Høgsberg <[email protected]> Reviewed-by: Jakob Bornecrantz <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* egl: Update to Wayland 1.2 server APIAnder Conselvan de Oliveira2013-08-076-47/+65
| | | | | | | | | | Since Wayland 1.2, struct wl_buffer and a few functions are deprecated. References to wl_buffer are replaced with wl_resource and some getter functions and calls to deprecated functions are replaced with the proper new API. The latter changes are related to resource versioning. Signed-off-by: Ander Conselvan de Oliveira <[email protected]>
* egl/dri2: support for creating images out of dma buffersTopi Pohjolainen2013-08-021-0/+262
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | v2: - upon success close the given file descriptors v3: - use specific entry for dma buffers instead of the basic for primes, and enable the extension based on the availability of the hook v4 (Chad): - use ARRAY_SIZE - improve the comment about the number of file descriptors - in case of invalid format report EGL_BAD_ATTRIBUTE instead of EGL_BAD_MATCH - take into account specific error set by the driver. v5: - fix error handling v6 (Chad): - fix invalid plane count checking v7 (Chad): - fix indentation and reset loop counter before checking for excess attributes Signed-off-by: Topi Pohjolainen <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* egl: definitions for EXT_image_dma_buf_importTopi Pohjolainen2013-08-025-0/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As specified in: http://www.khronos.org/registry/egl/extensions/EXT/EGL_EXT_image_dma_buf_import.txt Checking for the valid fourcc values is left for drivers avoiding dependency to drm header files here. v2: enforce EGL_NO_CONTEXT v3: declare the extension as EGL (not GLES) v4: do not update eglext.h manually but rely on update from Khronos instead v5: (Eric) report invalid context as EGL_BAD_PARAMETER instead of as EGL_BAD_CONTEXT v6: (Chad) fix the checking for valid hints. Before all values were rejected. v7: (Chad) comment style change from /** * Multi- * line into /* Multi- * line Signed-off-by: Topi Pohjolainen <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* egl: Restore "bogus" DRI2 invalidate event code.Eric Anholt2013-07-311-0/+14
| | | | | | | | | | | | | | | | | | | | I had removed it in commit 1e7776ca2bc59a6978d9b933d23852d47078dfa8 because it was obviously wrong -- why do we care whether the server is a version that emits events, if we're not watching for the server's events, anyway? And why would you only invalidate on a server that emits invalidate events, when the comment said to emit invalidates if the server *doesn't*? Only, I missed that we otherwise don't flag that our buffers might have changed at swap time at all, so the driver was only checking for new buffers when triggered by the Viewport hack. Of course you don't expect Viewport to be called after a swap. So, this is effectively a revert of the previous commit, except that I dropped the check for only emitting invalidates on a new server -- we *always* need to invalidate if we're doing a SwapBuffers. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=63435 Reviewed-by: Kenneth Graunke <[email protected]> Cc: "9.1 and 9.2" <[email protected]>
* egl/build: Remove unused GLAPI_LIB.Matt Turner2013-07-221-2/+0
|
* egl: Drop configs with unknown or invalide __DRI_ATTRIB_RENDER_TYPEIan Romanick2013-07-181-1/+1
| | | | | | | Some render types, such as floating-point, aren't valid with EGL. Return NULL in those cases to drop them. Signed-off-by: Ian Romanick <[email protected]>
* dri: Introduce new flags in __DRI_ATTRIB_RENDER_TYPETomasz Lis2013-07-181-1/+1
| | | | | | | | | | | | | | Mark __DRI_ATTRIB_FLOAT_MODE as deprecated, and introduce new flags to __DRI_ATTRIB_RENDER_TYPE for float modes. Both signed float (fbconfig_float) and unsigned (packed_float) are introduced. The old attribute should be set for both float modes. v2 (idr): Require that the render mode from the DRI attributes matches the render mode of the config exactly. This is the behavior of the old code. Signed-off-by: Tomasz Lis <[email protected]> Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* wayland: Handle global_remove event as wellKristian Høgsberg2013-06-181-1/+8
| | | | | | | | | | | | We need to set up a handler for the global_remove event that gets sent out when a global gets removed. Without the handler we end up calling a NULL pointer. https://bugs.freedesktop.org/show_bug.cgi?id=65910 NOTE: This is a candidate for the stable branches. Signed-off-by: Kristian Høgsberg <[email protected]>
* mesa: remove outdated version lines in commentsRico Schüller2013-06-051-1/+0
| | | | Signed-off-by: Brian Paul <[email protected]>
* egl/android: Fix error condition for EGL_ANDROID_image_native_bufferChad Versace2013-05-081-2/+14
| | | | | | | | | | | | | Emit EGL_BAD_CONTEXT if the user passes a context to eglCreateImageKHR(type=EGL_ANDROID_image_native_buffer). From the EGL_ANDROID_image_native_buffer spec: * If <target> is EGL_NATIVE_BUFFER_ANDROID and <ctx> is not EGL_NO_CONTEXT, the error EGL_BAD_CONTEXT is generated. Note: This is a candidate for the stable branches. Reviewed-by: Tapani Pälli <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* egl/wayland: Implement EGL_EXT_swap_buffers_with_damageRobert Bragg2013-05-071-3/+26
| | | | | Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]>
* egl: Add extension infrastructure for EGL_EXT_swap_buffers_with_damageRobert Bragg2013-05-074-0/+41
| | | | | Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]>
* android: libsync is needed on Android 4.2+ for any driverChia-I Wu2013-05-061-5/+3
| | | | | | | | Add libsync not only for MESA_BUILD_CLASSIC, but also for MESA_BUILD_GALLIUM. Signed-off-by: Chia-I Wu <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* android: add ilo to the build systemChia-I Wu2013-05-061-0/+6
| | | | | | | | | It can be selected with BOARD_GPU_DRIVERS := ilo Signed-off-by: Chia-I Wu <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* wayland: Make eglQueryBufferWL succeed for width and height requests tooRob Bradford2013-05-021-2/+2
| | | | | Following the addition of the EGL_WIDTH and EGL_HEIGHT this function should return EGL_TRUE for those requested attributes too.
* egl/dri2: Fix min/max swap interval of configsChad Versace2013-04-241-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The commit below exposed a bug in dri2_add_config. commit 3998f8c6b5da1a223926249755e54d8f701f81ab Author: Ralf Jung <[email protected]> Date: Tue Apr 9 14:09:50 2013 +0200 egl/x11: Fix initialisation of swap_interval This little code snippet near the bottom of dri2_add_config, if (double_buffer) { ... conf->base.MinSwapInterval = dri2_dpy->min_swap_interval; conf->base.MaxSwapInterval = dri2_dpy->max_swap_interval; } it never did what it claimed to do. The assignment never changed the value of conf->base.MaxSwapInterval, because dri2_dpy->max_swap_interval was, until the above exposing commit, unitialized here. That is, conf->base.MaxSwapInterval was 0 before and after assignment. Ditto for the min swap interval. Above the troublesome code snippet, the call to _eglFilterArray rejects the config as unmatching if its swap interval bounds differ from the base config's. Before the exposing commit, at the call to _eglFilterArray, the swap interval bounds were always [0,0], and hence no config was rejected due to swap interval. After the exposing commit, _eglFilterArray incorrectly rejected some configs, which prevented dri2_egl_config::dri_double_config from getting set for the rejected config, which resulted in a NULL pointer getting passed into dri2CreateNewDrawable, and then segfault. The solution: set the swap interval bounds before _eglFilterArray. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=63447 Tested-by: Lu Hua <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* egl/dri2: NULL check value returned by dri2_create_surfaceIan Romanick2013-04-121-8/+9
| | | | | | | | | | | | | | | dri2_create_surface can fail for a variety of reasons, including bad input data. Dereferencing the NULL pointer and crashing is not okay. Fixes issue identified by Klocwork analysis: Pointer 'surf' returned from call to function 'dri2_create_surface' at line 285 may be NULL and will be dereferenced at line 291. NOTE: This is a candidate for the stable branches. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* egl/x11: Fix initialisation of swap_intervalRalf Jung2013-04-101-2/+2
| | | | | | | | | | | | | | | | | | | | The EGLConfig attributes EGL_MIN/MAX_SWAP_INTERVAL were incorrectly set to 0 and 0. This prevented clients from setting the swap interval to a reasonable value, like 1 or 2. Swap interval worked correctly in Mesa 9.0. The commit below introduced the bug. commit 7e9bd2b2ed35a440a96362417100a7e43715d606 Author: Eric Anholt <[email protected]> Date: Tue Sep 25 14:05:30 2012 -0700 egl: Add support for driconf control of swapinterval. Note: This is a candidate for the 9.1 branch. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=63078 [chadv: Wrote commit message] Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* egl_dri2: Lower __DRI_IMAGE version requirement back to 1Kristian Høgsberg2013-03-192-2/+13
| | | | | We check the extension version manually instead and verify that we have the createImageFromFds function before enabling prime fd passing.
* wayland: Add prime fd passing as a buffer sharing mechanismKristian Høgsberg2013-03-186-34/+149
| | | | Reviewed-by: Ander Conselvan de Oliveira <[email protected]>
* wayland: allocate a __DRIimage for the color bufferKristian Høgsberg2013-03-182-23/+37
| | | | | | | No functional change here, but this will let us query the image for an fd handle later. Reviewed-by: Ander Conselvan de Oliveira <[email protected]>
* mesa,gallium,egl,mapi: One definition of C99 inline/__func__ to rule them all.José Fonseca2013-03-121-38/+6
| | | | | | | | We were in four already... NOTE: Candidate for the stable branches. Reviewed-by: Brian Paul <[email protected]>
* egl/wayland: Don't block on EGL_DEFAULT_DISPAY under waylandKristian Høgsberg2013-02-261-0/+4
| | | | | | | Normally the application will own the main event queue and be responsible for moving events. In case of EGL_DEFAULT_DISPLAY, EGL opens the display and has to own the main queue so it can move the events itself. Call wl_display_dispatch_pending() to take ownership.
* egl: Allow 24-bit visuals for 32-bit RGBA8888 configsIan Romanick2013-02-261-1/+8
| | | | | | | | | | | | | | | | | | | | | Previously only the 32-bit X visual would match the 32-bit RGBA8888 configs. This resulted in every config with alpha getting the "magic" visual whose alpha is used by the compositor. This also resulted in no multisample visuals being advertised. How many ways could we lose? This patch inverts the problem... now you can't get the visual with alpha used by the compositor even if you want it. I think we need to invent a new value for EGL_TRANSPARENT_TYPE that apps can use to get this. I'm surprised that there isn't already a choice for EGL_TRANSPARENT_ALPHA. NOTE: This is a candidate for the 9.1 branch. Signed-off-by: Ian Romanick <[email protected]> Tested-by: Tian Ye <[email protected]> Acked-by: Kristian Høgsberg <[email protected]> Reviewed-by: Chad Versace <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59783
* egl-wayland: Make sure we allocate a back buffer even if nothing was renderedKristian Høgsberg2013-02-081-0/+8
| | | | | | | | | At eglSwapBuffer time, we blindly assume we have a back buffer, but the back buffer only gets allocated when somebody tries to render something. NOTE: This is a candidate for the 9.0 and 9.1 branches. https://bugs.freedesktop.org/show_bug.cgi?id=60086
* egl/dri: Don't invoke dri2_dpy->flush if it's NULL.José Fonseca2013-02-061-1/+2
| | | | | | | I'd like to test Mesa OpenGL ES along side with NVIDIA libGL drivers. But without this change, I get a NULL pointer dereference. Reviewed-by: Brian Paul <[email protected]>
* egl/dri2: Fix memory leak.Vinson Lee2013-02-011-0/+1
| | | | | | | Fixes resource leak defect reported by Coverity. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* dri2: Create image from textureAbdiel Janulgue2013-02-011-0/+122
| | | | | | | | | | | Add create image from texture extension and bump version. v8: - Add appropriate image errors codes in DRI interface so we don't have to use internal EGL functions in driver. Suggested by Chad Versace. Reviewed-by: Eric Anholt <[email protected]> (v6) Reviewed-by: Chad Versace <[email protected]> (v8) Signed-off-by: Abdiel Janulgue <[email protected]>
* android: use gralloc_drm_get_gem_handle apiTapani Pälli2013-01-282-7/+5
| | | | | | | | Currently a gralloc internal structure is exposed to Mesa, Use a query function instead to maintain ABI compatibility. Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* egl/dri2: Fix typo in the previous commitIan Romanick2013-01-151-1/+1
| | | | | | | I didn't notice this due to a noobed piglit run. It wasn't previously noticed because the patch was only run on a driver that supported GLES3. Signed-off-by: Ian Romanick <[email protected]>
* egl/dri2: Add plumbing for EGL_OPENGL_ES3_BIT_KHRChad Versace2013-01-156-4/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes error EGL_BAD_ATTRIBUTE in the tests below on Intel Sandybridge: * piglit egl-create-context-verify-gl-flavor, testcase OpenGL ES 3.0 * gles3conform, revision 19700, when runnning GL3Tests with -fbo This plumbing is added in order to comply with the EGL_KHR_create_context spec. According to the EGL_KHR_create_context spec, it is illegal to call eglCreateContext(EGL_CONTEXT_MAJOR_VERSION_KHR=3) with a config whose EGL_RENDERABLE_TYPE does not contain the EGL_OPENGL_ES3_BIT_KHR. The pertinent portion of the spec is quoted below; the key word is "respectively". * If <config> is not a valid EGLConfig, or does not support the requested client API, then an EGL_BAD_CONFIG error is generated (this includes requesting creation of an OpenGL ES 1.x, 2.0, or 3.0 context when the EGL_RENDERABLE_TYPE attribute of <config> does not contain EGL_OPENGL_ES_BIT, EGL_OPENGL_ES2_BIT, or EGL_OPENGL_ES3_BIT_KHR respectively). To create this patch, I searched for all the ES2 bit plumbing by calling `git grep "ES2_BIT\|DRI_API_GLES2" src/egl`, and then at each location added a case for ES3. Signed-off-by: Chad Versace <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* egl/wayland: Implement EGL_EXT_buffer_ageKristian Høgsberg2013-01-141-1/+24
| | | | Reviewed-by: Ander Conselvan de Oliveira <[email protected]>
* egl/wayland: Pull color buffers from dri2_surf->color_buffers poolKristian Høgsberg2013-01-142-252/+150
| | | | | | | | | | | | | | | We used to keep the color buffers in the dri_buffers array and swap __DRI_BUFFER_BACK_LEFT and __DRI_BUFFER_FRONT_LEFT around there and swap third_buffer in in case we needed to triple buffer. That gets a little fidgety with all the swaps, so lets use the color_buffers pool like the gbm platform does. We track the color buffers, their corresponding wl_buffer and locked status here and just plug a free one into dri2_surf->buffers when we need to. This is a nice clean-up in itself, but it also sets us up to track buffer age in the color_buffers structs. Reviewed-by: Ander Conselvan de Oliveira <[email protected]>
* Clean up .gitignore filesMatt Turner2013-01-104-4/+0
|
* egl/gbm: Implement EGL_EXT_buffer_ageKristian Høgsberg2013-01-102-0/+24
| | | | | Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* egl/wayland: Remove kooky flush codeKristian Høgsberg2013-01-041-8/+0
| | | | | We used to have to jump through hoops to call glFlush at swap buffer time, but the flush extension made that unnecessary a long time ago.
* egl/wayland: Remove confusing comment about front buffer renderingKristian Høgsberg2013-01-041-10/+0
|
* egl_dri2: Remove unused struct dri2_egl_buffer from header fileKristian Høgsberg2013-01-041-5/+0
|
* egl: Add extension infrastructure for EGL_EXT_buffer_ageKristian Høgsberg2013-01-044-0/+16
|
* 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]>