summaryrefslogtreecommitdiffstats
path: root/src/egl
Commit message (Collapse)AuthorAgeFilesLines
* egl/x11: Fix driver_name acquisitionBoyan Ding2015-08-081-6/+5
| | | | | | | | | | | | | We don't need to free driverName string from dri2 reply, on the other hand, the driver name acquired from loader doesn't need duplication. Fixes: 45e110bad9d (egl/x11: trust our loader over the xserver for the drivername) Reported-by: Timothy Arceri <[email protected]> Signed-off-by: Boyan Ding <[email protected]> [Emil Velikov: use brackets for both branches of conditional] Reviewed-by: Emil Velikov <[email protected]>
* egl/dri2: Fix include path of u_atomic.h introduced e7e29189Alexander von Gluck IV2015-08-073-1/+3
| | | | | | | | This was causing a failure to build on SCons due to a missing -Isrc/egl. Instead of adding in that path, lets just -Isrc/ and include "utils/u_atomic.h". Reviewed-by: Matt Turner <[email protected]>
* egl/x11: don't crash if dri2_dpy->conn is NULLEmil Velikov2015-08-071-5/+3
| | | | | | | Identical to commit 60e9c35b3a0(egl/x11: bail out if we cannot fetch the xcb connection) but for the swrast codepath. Signed-off-by: Emil Velikov <[email protected]>
* egl/x11: auth with xserver before attempting to open the dri moduleEmil Velikov2015-08-071-3/+3
| | | | | | | | | No real change, apart from keeping the calls to the underlying winsys (x11) next to each other. Just like platform_wayland. Signed-off-by: Emil Velikov <[email protected]> Acked-by: Alex Deucher <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* egl/x11: trust our loader over the xserver for the drivernameEmil Velikov2015-08-071-1/+11
| | | | | | | | | | | | | This is a port of commit 7bd95ec437a(dri2: Trust our own driver name lookup over the server's.) from glx/dri2. v2: Add newline between code and multiline comment. (Matt) Cc: Julien Isorce <[email protected]> Reported-by: Julien Isorce <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Acked-by: Alex Deucher <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* egl/x11: open the device from within dri2_x11_connect()Emil Velikov2015-08-071-13/+16
| | | | | | | | | Allows us, with the next commit, to use alternative driver_name rather than the one from xserver. Signed-off-by: Emil Velikov <[email protected]> Acked-by: Alex Deucher <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* egl/x11: fetch the device_name prior to driver_nameEmil Velikov2015-08-071-5/+5
| | | | | | | | | | With the follow up commits we're about to further reshuffle things. Thus we'll honour our our driver_name lookup (src/loader), and use the one provided by xserver as a fall-back. Signed-off-by: Emil Velikov <[email protected]> Acked-by: Alex Deucher <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* egl/x11: remove dri2_dpy->conn checksEmil Velikov2015-08-071-12/+6
| | | | | | | | If the connection is NULL we won't be able to get here. Signed-off-by: Emil Velikov <[email protected]> Acked-by: Alex Deucher <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* egl/x11: bail out if we cannot fetch the xcb connectionEmil Velikov2015-08-071-1/+1
| | | | | | | | | | | | | | | | The documentation of xcb_connection_has_error() does not mention what will happen, if NULL is fed to the function. Upon closer look (props to Matt), it seems that we'll crash as the implementation dereferences conn. This will also allow us to remove the dri2_dpy->conn checking with the next commit. v2: Reword commit message as per Matt's findings. Acked-by: Alex Deucher <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
* egl: Add eglQuerySurface surface type check for EGL_LARGEST_PBUFFER attribFrank Binns2015-08-041-1/+2
| | | | | | | | | | | | | | | | | | | Calling eglQuerySurface on a window or pixmap with the EGL_LARGEST_PBUFFER attribute resulted in the contents of the 'value' parameter being modified. This is the wrong behaviour according to the EGL spec, which states: "Querying EGL_LARGEST_PBUFFER for a pbuffer surface returns the same attribute value specified when the surface was created with eglCreatePbufferSurface. For a window or pixmap surface, the contents of value are not modified." Avoid this from happening by checking that the surface type is EGL_PBUFFER_BIT before modifying the contents of the parameter. Cc: <[email protected]> Signed-off-by: Frank Binns <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* egl/dri: Add error info needed for EGL_EXT_image_dma_buf_import extensionFrank Binns2015-08-041-0/+4
| | | | | | | | | | | | | Update the DRI image interface error codes to reflect the needs of the EGL_EXT_image_dma_buf_import extension. This means updating the existing error code documentation and adding a new __DRI_IMAGE_ERROR_BAD_ACCESS error code so that drivers can correctly reject unsupported pitches and offsets. Hook the new error code up in EGL to return EGL_BAD_ACCESS. Cc: <[email protected]> Signed-off-by: Frank Binns <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* egl/wayland: use drmGetNodeTypeFromFd helper instead of opencoding itEmil Velikov2015-08-011-18/+2
| | | | | | Cc: Axel Davy <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Acked-by: Boyan Ding <[email protected]>
* egl/wayland: use designated initializersEmil Velikov2015-08-011-13/+13
| | | | | Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Thomas Helland <[email protected]>
* egl: remove ifdef $(egl_extension) compile guardsEmil Velikov2015-08-013-65/+1
| | | | | | All of these are already defined in the headers provided. Signed-off-by: Emil Velikov <[email protected]>
* egl/wayland: libdrm is a hard requirement, treat it as suchEmil Velikov2015-08-011-2/+0
| | | | | | | | Prompt at configure time if it's missing otherwise we'll fail later on in the build. Remove ambiguous HAVE_LIBDRM guard. Cc: 10.6 <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
* egl: consolidate ifdef HAVE_LIBDRM blocksEmil Velikov2015-08-011-108/+102
| | | | | | | | Move the code around rather than having it scattered. No functional change. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Thomas Helland <[email protected]>
* egl: Add support for DRM_FORMAT_R8, RG88, and GR88Chad Versace2015-07-281-0/+19
| | | | | | | | | | | | | | | The Kodi/XBMC developers want to transcode NV12 to RGB with OpenGL shaders, importing the two source planes through EGL_EXT_image_dma_buf_import. That requires importing the Y plane as an R8 EGLImage and the UV plane as either an RG88 or GR88 EGLImage. This patch teaches the driver-independent part of EGL about the new formats. Real driver support is left for follow-up patches. The new formats landed in airlied's kernel branch 'drm-next' on July 24. Tested-by: Peter Frühberger <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* egl,dri_interface: use DRI2rendererQueryExtension to enable 3D textures & sRGBMarek Olšák2015-07-222-0/+24
| | | | Reviewed-by: Emil Velikov <[email protected]>
* egl: implement EGL_KHR_gl_colorspace (v2)Marek Olšák2015-07-229-24/+90
| | | | | | v2: add missing "break" Reviewed-by: Emil Velikov <[email protected]>
* egl: android: remove DRM_GRALLOC_TOP hackEmil Velikov2015-07-221-1/+0
| | | | | | | | | | Now that the drm_gralloc module exports the correct includes we can get rid of this hack. Cc: Chih-Wei Huang <[email protected]> Cc: Eric Anholt <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Tested-by: Varad Gautam <[email protected]>
* egl: remove old makefile.sourcesEmil Velikov2015-07-222-31/+1
| | | | | Signed-off-by: Emil Velikov <[email protected]> Acked-by: Matt Turner <[email protected]>
* android: rework the EGL buildEmil Velikov2015-07-222-74/+25
| | | | | | | | | | | | See previous two commits for details. v2: Don't forget git mv, bring back DRM_GRALLOC_TOP. Spotted by Varad. Cc: Chih-Wei Huang <[email protected]> Cc: Eric Anholt <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Acked-by: Matt Turner <[email protected]> Tested-by: Varad Gautam <[email protected]>
* scons: rework the EGL buildEmil Velikov2015-07-223-36/+11
| | | | | | | | | The scons equivalent of the previous commit - just fold the almost identical driver + main Sconscripts. Cc: Alexander von Gluck IV <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Acked-by: Matt Turner <[email protected]>
* automake: rework the EGL buildEmil Velikov2015-07-223-76/+68
| | | | | | | | | | | Simplify things by merging the two makefiles. This way we can combine the duplicated HAVE_PLATFORM_ checks, and build the library without having a separate static library. v2: use $() when referencing variables, use correct define (Matt) Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* egl: automake: remove unused HAVE_XCB_DRI2 defineEmil Velikov2015-07-221-1/+0
| | | | | Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* egl: remove unused _EGL_DRIVER_SEARCH_DIR defineEmil Velikov2015-07-223-8/+2
| | | | | Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* egl/haiku: remove unused DEFAULT_DRIVER_DIR defineEmil Velikov2015-07-221-4/+0
| | | | | | Cc: Alexander von Gluck IV <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Acked-by: Matt Turner <[email protected]>
* egl: remove final Windows specific workaroundEmil Velikov2015-07-224-10/+2
| | | | | Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* egl: remove custom string functionsEmil Velikov2015-07-226-112/+5
| | | | | | | | Support for Windows has been removed for a while now, and virtually every POSIX compliant system provides strcasecmp, strdup and snprintf. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* egl: remove _EGL_PLATFORM_WINDOWS enumEmil Velikov2015-07-222-2/+0
| | | | | Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* egl: remove final references of platform_nullEmil Velikov2015-07-223-6/+0
| | | | | Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* egl: remove flatten HAVE_SHARED_GLAPIEmil Velikov2015-07-223-13/+0
| | | | | | | | | It is simply not possible to use the dri backend without shared glapi, as the alternative provider (libGL) is not always present. We have fixed the build for a while now, so we can rip this out. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* egl: remove the non-haiku scons buildEmil Velikov2015-07-223-65/+8
| | | | | | | | | | | | | | | | It has been broken since 2011 with commit c98ea26e16b(egl: Make egl_dri2 and egl_glx built-in drivers.). When the backends got merged into the main library each entry point was guarded by a _EGL_BUILT_IN_DRIVER_* define. As the define was missing, the linker kindly removed the whole of the dri2 backend, thus we did not notice any errors due to the unresolved link to xcb and friends. Cc: Chia-I Wu <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Acked-by: Matt Turner <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* egl/dri2: load libglapi.0.dylib on osxJulien Isorce2015-07-081-0/+2
| | | | | | Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90903 Signed-off-by: Julien Isorce <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: sort extension lists alphabeticallyMarek Olšák2015-07-033-54/+51
| | | | and add the missing KHR_gl_colorspace case.
* egl: implement EGL_KHR_gl_texture_3D_imageAnatoli Antonovitch2015-07-031-3/+17
| | | | Most of the code has been in place already.
* egl/x11: handle when invalid drawable is passed in create_surfaceEmil Velikov2015-06-301-0/+4
| | | | | | | | | 0 is not used as a valid drawable id, as such there is no point in attempting to query its geometry. Just bail out early and provide the more meaningful EGL_BAD_NATIVE_WINDOW to the user. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* egl/wayland: cleanup dri2_wl_create_surface error pathEmil Velikov2015-06-301-3/+1
| | | | | Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* egl/wayland: handle NULL native_window in create_surfaceEmil Velikov2015-06-301-0/+5
| | | | | | | | | Raise EGL_BAD_NATIVE_WINDOW instead of crashing. v2: s/Rise/Raise/ (spotted by Michel) Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* egl/drm: plug memory leakEmil Velikov2015-06-301-2/+5
| | | | | | | | | Free the memory for dri2_surf in the unlikely case that one provides NULL for native_window. Also set the relevant EGL_ERROR to provide feedback to the user. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* egl/haiku: fix Mesa build under HaikuAlexander von Gluck IV2015-06-291-14/+14
| | | | | Performing a goto crosses the initialization of 'BWindow* win' breaking the build. We also fix a missing semicolon.
* egl_dri2: Remove trailing whitespacesBoyan Ding2015-06-264-13/+13
| | | | | Signed-off-by: Boyan Ding <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* egl/x11: Remove duplicate call to dri2_x11_add_configs_for_visualsBoyan Ding2015-06-231-5/+0
| | | | | | | | | | | | | The call to dri2_x11_add_configs_for_visuals (previously dri2_add_configs_for_visuals) was moved downwards in commit f8c5b8a1, but appeared again in its original position after its rename in d019cd81. Remove it. Cc: "10.5 10.6" <[email protected]> Signed-off-by: Boyan Ding <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* android: egl: do not link against libglapiEmil Velikov2015-06-231-1/+0
| | | | | | | | | | | The only reason we touch glapi is to dlopen it in order to: - make sure that the unresolved _glapi* symbols in the dri modules are provided. - fetch glFlush() and use it at various stages in the dri2 driver. Cc: Chih-Wei Huang <[email protected]> Cc: Eric Anholt <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
* egl: Use the loader_open_device() helper to do open with CLOEXECDerek Foreman2015-06-234-32/+6
| | | | | | | | | | | We've moved the open with CLOEXEC idiom into a helper function, so call it instead of duplicating the code. This also replaces a couple of opens that didn't properly do CLOEXEC. Signed-off-by: Derek Foreman <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl/drm: Duplicate fd with F_DUPFD_CLOEXEC to prevent leakDerek Foreman2015-06-231-1/+1
| | | | | | | | | | Replacing dup() with fcntl F_DUPFD_CLOEXEC creates the duplicate file descriptor with CLOEXEC so it won't be leaked to child processes if the process fork()s later. Signed-off-by: Derek Foreman <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl/x11: Set version of swrastLoader to 2Boyan Ding2015-06-181-1/+1
| | | | | | | | | | which it actually implements instead of the newest version defined in dri_interface.h Cc: "10.5 10.6" <[email protected]> Signed-off-by: Boyan Ding <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl/dri2: implement platform_surfacelessHaixia Shi2015-06-167-1/+193
| | | | | | | | | | | | | | | | | | The surfaceless platform is for off-screen rendering only. Render node support is required. Only consider the render nodes. Do not use normal nodes as they require auth hooks. v3: change platform_null to platform_surfaceless v4: make libdrm required for surfaceless v5: remove modified include guards with defined(HAVE_SURFACELESS_PLATFORM) v6: use O_CLOEXEC for drm fd Signed-off-by: Haixia Shi <[email protected]> Signed-off-by: Zach Reizner <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* egl: Drop check for driver != NULL.Eric Anholt2015-06-151-1/+1
| | | | | | | | | | | | Back in 2013, a patch was added (with 2 reviewers!) at the end of the block to early exit the loop in this case, without noticing that the loop already did. I added another early exit case, again without noticing, but Rob caught me. Just drop the loop condition that apparently surprises most of us, instead of leaving the end of the loop conspicuously not exiting on success. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Rob Clark <[email protected]>
* egl/dri2: Fix Android Lollipop build on ARM.Eric Anholt2015-06-151-0/+1
| | | | Reviewed-by: Emil Velikov <[email protected]>