summaryrefslogtreecommitdiff
path: root/src/egl/drivers
AgeCommit message (Collapse)AuthorFilesLines
2012-11-30egl/wayland: Dispatch the event queue before get_buffersAnder Conselvan de Oliveira1-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 <ander.conselvan.de.oliveira@intel.com>
2012-11-30egl/wayland: Add invalidate back in eglSwapBuffers()Kristian Høgsberg1-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 <krh@bitplanet.net>
2012-11-30egl/wayland: Don't invalidate drawable on swap buffersAnder Conselvan de Oliveira1-1/+19
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: wayland-devel@lists.freedesktop.org
2012-11-19egl/dri2: Set error code when dri2CreateContextAttribs failsChad Versace1-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 <kenneth@whitecape.org> Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-07wayland: Destroy frame callback when destroying surfaceJonas Ådahl1-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 <krh@bitplanet.net>
2012-11-07egl_dri2/x11: Fix eglPostSubBufferNV()Fredrik Höglund1-1/+1
This got broken in commit 0a523a8820e8a2549ac1c7887eb1892b228af44b. NOTE: This is a candidate for the 9.0 branch. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55856
2012-10-17wayland: Drop support for ill-defined, unused wl_egl_pixmapKristian Høgsberg1-143/+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.
2012-10-17egl/wayland: Update to Wayland 0.99 APIKristian Høgsberg2-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.
2012-10-09egl: Remove bogus invalidate code.Eric Anholt1-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 <chad.versace@linux.intel.com>
2012-10-09egl: Add support for driconf control of swapinterval.Eric Anholt3-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 <chad.versace@linux.intel.com>
2012-10-09egl: Quit checking for a bug in old xcb when we require new xcb.Eric Anholt1-4/+0
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09egl: Drop xcb ifdefs by just requiring a version from this year.Eric Anholt1-13/+0
glx and gallium's xcb_dri2 usage already require this version, so this is nothing really new. Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09egl: Unifdef dri_interface.h defines.Eric Anholt1-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 <krh@bitplanet.net> Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09egl: Cleanly cast EGLNative* pointers to X11 types.Eric Anholt1-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 <chad.versace@linux.intel.com>
2012-10-02SwapBuffersRegionNOK: invert rectangles on y axisRobert Bragg1-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 <mattst88@gmail.com>
2012-09-05Use calloc instead of malloc/memset-0Matt Turner4-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 <brianp@vmware.com>
2012-09-05Remove useless checks for NULL before freeingMatt Turner3-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 <brianp@vmware.com>
2012-09-05Remove Xcalloc/Xmalloc/Xfree callsMatt Turner1-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 <brianp@vmware.com>
2012-08-31dri: Rework planar image interfaceJakob Bornecrantz1-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 <oreaus@gmail.com> Tested-by: Pekka Paalanen <ppaalanen@gmail.com> Tested-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2012-08-31android: do not expose single buffered eglconfigsTapani Pälli1-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 <tapani.palli@intel.com> Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-31android: fix liblog API changesTapani Pälli1-3/+14
android logging macros changed their name in JellyBean. Signed-off-by: Bruce E. Robertson <bruce.e.robertson@intel.com> Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-26gbm: Use libkms to replace DRI cursor imagesJakob Bornecrantz1-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 <oreaus@gmail.com> Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2012-08-23egl_dri2: Fix segmentation faultPaulo Alcantara1-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 <pcacjr@profusion.mobi> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Signed-off-by: Brian Paul <brianp@vmware.com>
2012-08-14egl: Allow OpenGL ES 3.0 as a versionIan Romanick1-0/+1
In the DRI2 back-end this will get the same API as GLES 2.0. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14egl_dri2: Add support for EGL_KHR_create_context and ↵Ian Romanick2-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 <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14egl_dri2: Silence warnings about missing initializersIan Romanick1-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 <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14egl: Rename ClientVersion to ClientMajorVersion, add ClientMinorVersionIan Romanick1-2/+2
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14egl_dri2: Use createContextAttribs if DRI2 version >= 3Ian Romanick1-1/+17
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14egl_dri2: Require DRI2 version 2Ian Romanick1-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 <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-06egl: Replace KHR_surfaceless_* extensions with KHR_surfaceless_contextIan Romanick1-6/+2
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 <ian.d.romanick@intel.com> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-06egl_dri2: Refactor dereference of dri2_ctx_sharedIan Romanick1-6/+5
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-06egl_dri2: Remove swrast version >= 2 checksIan Romanick1-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 <ian.d.romanick@intel.com> Cc: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-19wayland: Support EGL_WIDTH and EGL_HEIGHT queries for wl_bufferKristian Høgsberg1-1/+8
We're going to make the public wl_buffer struct as small as possible. Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-07-19wayland: Use existing EGL_TEXTURE_FORMAT for querying wl_buffer texture formatKristian Høgsberg1-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 <krh@bitplanet.net>
2012-07-16egl_dri2: NULL check for EGLNativeWindowTypeElvis Lee1-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 <kwangwoong.lee@lge.com> Signed-off-by: Brian Paul <brianp@vmware.com>
2012-07-11egl: Add EGL_WAYLAND_PLANE_WL attributeKristian Høgsberg1-15/+135
This lets us specify the plane to create the image for for multiplanar wl_buffers. Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-07-11wayland-drm: Add protocol to create planar buffersKristian Høgsberg1-1/+1
2012-07-11wayland-drm: Pass struct wl_drm_buffer to the driverKristian Høgsberg1-18/+15
We're going to extend this to support multi-plane buffers, so pass this to the driver so it can access the details.
2012-07-05egl_dri2: Reorganize the EGLImage constructors to share more codeKristian Høgsberg1-78/+37
We factor out all the EGL book-keeping into dri2_create_image() and simplify the wayland case by using dupImage. Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-05-03egl_dri2: Fix out of tree builds with the wayland backend enabledRobert Hooker1-0/+1
Otherwise it fails like so: CC egl_dri2.lo In file included from egl_dri2.h:40:0, from egl_dri2.c:42: ../../../../../../src/egl/wayland/wayland-drm/wayland-drm.h:8:41: fatal error: wayland-drm-server-protocol.h: No such file or directory compilation terminated.
2012-04-30egl/android: Add support for RGBX_8888 used in Android native buffersSean V Kelley1-0/+2
Add new format __DRI_IMAGE_FORMAT_XBGR8888 to __DRI_IMAGE. HAL_PIXEL_FORMAT_RGBX_8888 now maps to __DRI_IMAGE_FORMAT_XBGR8888. Signed-off-by: Sean V Kelley <sean.v.kelley@linux.intel.com> Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-04-10egl_dri2: fix aux buffer leak in drm platformMandeep Singh Baines1-5/+4
Keep a reference to any newly allocated aux buffers to avoid re-allocating for every st_framebuffer_validate() (i.e. leaking). Signed-off-by: Mandeep Singh Baines <msb@chromium.org> Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-03-28egl_dri2: use gbm_surface as the native window type in drm platformAnder Conselvan de Oliveira2-1/+324
2012-03-27egl_dri2: make flush extension useable by drm platformAnder Conselvan de Oliveira1-0/+1
2012-03-27wayland: Stop using wl_buffer.damageKristian Høgsberg1-2/+0
2012-03-20Add Makefile.in to toplevel .gitignoreKenneth Graunke1-1/+0
To avoid redundancies, this patch also removes Makefile.in from the other .gitignore files. Acked-by: Eric Anholt <eric@anholt.net>
2012-03-11Set close on exec flag FD_CLOEXECDavid Fries2-1/+19
Set the close on exec flag when opening dri character devices, so they will be closed and free any resouces allocated in exec. Signed-off-by: David Fries <David@Fries.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-05wayland: Use new wl_display_disconnectBenjamin Franzke1-1/+1
This replaces the previously used wl_display_destroy. wl_display_destroy was povided by wayland-client.so and wayland-server.so, to resolve that conflict its renamed client-side.
2012-02-29egl/drivers: Convert to automake.Eric Anholt5-103/+95
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-29egl/main: Convert to automake.Eric Anholt4-32/+33
The drivers/ walk-through-subdirs makefile is converted as well so I didn't need to keep EGL_DRIVERS_DIRS along with the per-driver HAVE_EGL_DRIVER_WHATEVER. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>