summaryrefslogtreecommitdiffstats
path: root/src/egl/drivers/dri2/platform_x11.c
Commit message (Collapse)AuthorAgeFilesLines
* loader: remove loader_get_driver_for_fd() driver_typeEmil Velikov2016-10-181-1/+1
| | | | | | | | | | | | | | Reminiscent from the pre-loader days, were we had multiple instances of the loader logic in separate places and one could build a "GALLIUM_ONLY" version. Since that is no longer the case and the loaders (glx/egl/gbm) do not (and should not) require to know any classic/gallium specific we can drop the argument and the related code. Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Axel Davy <axel.davy@ens.fr> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
* egl/x11: attribute for dri2_add_config failureEmil Velikov2016-10-141-7/+14
| | | | | | | | | | | | | | ... in dri2_x11_add_configs_for_visuals(). Currently the latter does not consider that, thus in such cases it adds "empty" configs in the list. Properly account for things and as we do that we can reuse count, instead of calling _eglGetArraySize to determine if we've added any configs. Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Eric Engestrom <eric@engestrom.ch>
* egl/dri2: set WL_bind_wayland_display in a consistent wayEmil Velikov2016-10-141-7/+2
| | | | | | | | | | | | | | Introduce a helper and use it throughout the platform code. This allows us to reduce the amount of ifdef(s) and (potentially) use kms_swrast_dri.so for !drm platforms (namely wayland and x11). Note: in the future as other platforms (android, surfaceless) support the extension they can reuse the helper. v2: Rebase, check for device_name. Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Eric Engestrom <eric@engestrom.ch>
* egl/x11: don't crash if dri2_dpy->conn is NULLEmil Velikov2016-10-141-9/+5
| | | | | | | | | | | The dri3 version of commits 60e9c35b3a0 and 6de9a03bed4. While using xcb_connect() guarantees that we always get a non NULL return value, XGetXCBConnection() does/can not. CC: <mesa-stable@lists.freedesktop.org> Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Eric Engestrom <eric@engestrom.ch>
* egl/dri2: rework dri2_egl_display::extensions storageEmil Velikov2016-10-141-11/+29
| | | | | | | | | | | Remove the error prone fixed size array. While we're here also rename to loader_extensions like in the GLX code. v2: Rebase. Keep image_loader_extension within the wayland_drm dri2_loader_extensions list. Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Eric Engestrom <eric@engestrom.ch>
* egl/x11: don't populate dri2_dpy->swrast_loader_extensionEmil Velikov2016-10-141-8/+9
| | | | | | | | | | Analogous to earlier commits. Note: the actual version of the extension is 1, since it does not implement .putImage2. Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Eric Engestrom <eric@engestrom.ch>
* egl/x11: don't populate dri2_dpy->dri2_loader_extensionEmil Velikov2016-10-141-16/+21
| | | | | | | | | | | | | | | Analogous to the earlier android and wayland patches. As we're here we can drop exposing the old version of the extension. Any dri loader/driver interface use lower bound checking thus exposing dri2 loader v3 to a v2 capable driver is perfectly normal. v2: Preserve compat with dri2_minor < 1. The driver does not know if there is a protocol to manage getBuffersWithFormat(). It's up-to the loader to expose the vfunc if there is one. (Kristian) Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Eric Engestrom <eric@engestrom.ch>
* egl/dri2: move surface refcounting out of the platform codeEmil Velikov2016-10-141-3/+0
| | | | | | | | All the platforms are duplicating what should be a driver/dri2 thing - refcounting. Just fold it accordingly. Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
* egl: only store device name when Wayland support is builtFrank Binns2016-09-011-11/+10
| | | | | | | | The device name is only needed for WL_bind_wayland_display so make this clear by only storing the device name when Wayland support is built. Signed-off-by: Frank Binns <frank.binns@imgtec.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* egl/x11_dri3: disable WL_bind_wayland_display for devices without render nodesFrank Binns2016-08-311-1/+2
| | | | | | | | | | | | | | | | | Up until now, DRI3 was only used for devices that have render nodes, unless overridden via an environment variable, with it falling back to DRI2 otherwise. This limitation was there in order to support WL_bind_wayland_display as it requires client opened device node fds to be authenticated, which isn't possible when using DRI3. This is an unfortunate compromise as DRI3 provides security benefits over DRI2. Instead, allow DRI3 to be used for devices without render nodes but don't advertise WL_bind_wayland_display in this case. Applications that need this extension can still be run by disabling DRI3 support via the LIBGL_DRI3_DISABLE environment variable. Signed-off-by: Frank Binns <frank.binns@imgtec.com> Reviewed-by: Axel Davy <axel.davy@ens.fr>
* egl/x11: avoid using freed memory if dri2 init failsJan Ziak2016-08-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Found with valgrind: ==4841== Invalid read of size 4 ==4841== at 0x56BDC80: dri2_initialize (egl_dri2.c:783) ==4841== by 0x56BAFE5: _eglMatchAndInitialize (egldriver.c:261) ==4841== by 0x56BB15E: _eglMatchDriver (egldriver.c:295) ==4841== by 0x56B58C9: eglInitialize (eglapi.c:480) ==4841== by 0x4F537DC: _glfwInitEGL (in /usr/lib64/libglfw.so.3.2) ==4841== by 0x4F4BEFB: _glfwPlatformInit (in /usr/lib64/libglfw.so.3.2) ==4841== by 0x4F46F40: glfwInit (in /usr/lib64/libglfw.so.3.2) ==4841== by 0x402E59: main ==4841== Address 0x6a05824 is 148 bytes inside a block of size 480 free'd ==4841== at 0x4C2B680: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==4841== by 0x56C2AAE: dri2_initialize_x11_swrast (platform_x11.c:1233) ==4841== by 0x56C2AAE: dri2_initialize_x11 (platform_x11.c:1493) ==4841== by 0x56BDCEB: dri2_initialize (egl_dri2.c:805) ==4841== by 0x56BAFAF: _eglMatchAndInitialize (egldriver.c:261) ==4841== by 0x56BB0C9: _eglMatchDriver (egldriver.c:292) ==4841== by 0x56B58C9: eglInitialize (eglapi.c:480) ==4841== by 0x4F537DC: _glfwInitEGL (in /usr/lib64/libglfw.so.3.2) ==4841== by 0x4F4BEFB: _glfwPlatformInit (in /usr/lib64/libglfw.so.3.2) ==4841== by 0x4F46F40: glfwInit (in /usr/lib64/libglfw.so.3.2) ==4841== by 0x402E59: main ==4841== Block was alloc'd at ==4841== at 0x4C2A868: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==4841== by 0x56C2A47: dri2_initialize_x11_swrast (platform_x11.c:1171) ==4841== by 0x56C2A47: dri2_initialize_x11 (platform_x11.c:1493) ==4841== by 0x56BDCEB: dri2_initialize (egl_dri2.c:805) ==4841== by 0x56BAFAF: _eglMatchAndInitialize (egldriver.c:261) ==4841== by 0x56BB0C9: _eglMatchDriver (egldriver.c:292) ==4841== by 0x56B58C9: eglInitialize (eglapi.c:480) ==4841== by 0x4F537DC: _glfwInitEGL (in /usr/lib64/libglfw.so.3.2) ==4841== by 0x4F4BEFB: _glfwPlatformInit (in /usr/lib64/libglfw.so.3.2) ==4841== by 0x4F46F40: glfwInit (in /usr/lib64/libglfw.so.3.2) ==4841== by 0x402E59: main Signed-off-by: Jan Ziak (http://atom-symbol.net) <0xe2.0x9a.0x9b@gmail.com> Fixes: 9ee683f877 (egl/dri2: Add reference count for dri2_egl_display) Cc: "12.0" <mesa-stable@lists.freedesktop.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* egl/x11: resolve "initialization from incompatible pointer type" warningMark Kettenis2016-05-011-2/+10
| | | | | | | | | | | | | | | | | With earlier commit we've moved a few functions and changing the argument type from _EGLDisplay * to struct dri2_egl_display *. The latter is effectively a wrapper around the former, thus functionality was preserved, although GCC rightfully warned us about the misuse. Add a simple wrapper that casts and propagates the correct type. Fixes: 9bbf3737f9c ("egl/x11: authenticate before doing chipset id ioctls") Cc: "11.2 11.1" <mesa-stable@lists.freedesktop.org> Reported-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
* egl/x11: authenticate before doing chipset id ioctlsJonathan Gray2016-04-211-54/+56
| | | | | | | | | | | | | | For systems without udev or sysfs that use drm ioctls in the loader drm authentication must take place earlier or the loader will fail "MESA-LOADER: failed to get param for i915". Patch from Mark Kettenis. Cc: "11.2 11.1" <mesa-stable@lists.freedesktop.org> Signed-off-by: Mark Kettenis <kettenis@openbsd.org> Signed-off-by: Jonathan Gray <jsg@jsg.id.au> [Emil Velikov: remove gratuitous white-space] Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* egl/x11: check the return value of xcb_dri2_get_buffers_reply()Emil Velikov2016-03-091-0/+3
| | | | | | | | | | | ... before using it. The function can return NULL, which we should check prior to refererencing it in the next function(s). Cc: Fabian Vogt <fvogt@suse.com> Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93667 Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Eduardo Lima Mitev <elima@igalia.com>
* egl_dri2: set correct error code if swapbuffers failsDaniel Czarnowski2016-02-191-1/+6
| | | | | | | | | | | A return value of '-1' means that there was error during swap with a window drawable, in this case we set error as EGL_BAD_NATIVE_WINDOW. v2: coding style cleanup, better commit message Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Cc: "11.0 11.1" <mesa-stable@lists.freedesktop.org Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* egl_dri2: NULL check for xcb_dri2_get_buffers_reply()Daniel Czarnowski2016-02-151-0/+2
| | | | | | | | | Without the check, unsuccessful xcb_dri2_get_buffers_reply(...) causes segmentation fault in dri2_get_buffers. Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Cc: "11.0 11.1" <mesa-stable@lists.freedesktop.org
* egl: make it clear which platform x11 backend is being used (dri2 or 3)Martin Peres2015-11-171-1/+5
| | | | | | | Signed-off-by: Martin Peres <martin.peres@linux.intel.com> Reviewed-by: Boyan Ding <boyan.j.ding@gmail.com> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Emil Velikov <emil.velikov@collabora.co.uk>
* egl/x11_dri3: Implement EGL_KHR_image_pixmapBoyan Ding2015-11-171-0/+2
| | | | | | | | | | | | | v2: from Martin Peres - Replace a tab with spaces v3: from Martin Peres - disable EGL_KHR_image_pixmap when is_different_gpu is set (Axel Davy) Signed-off-by: Boyan Ding <boyan.j.ding@gmail.com> Reviewed-by: Martin Peres <martin.peres@linux.intel.com> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Emil Velikov <emil.velikov@collabora.co.uk>
* egl/x11: Implement dri3 support with loader's dri3 helperBoyan Ding2015-11-171-7/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | v2: From Martin Peres - Tell we are compiling the dri3 backend in configure.ac - Update the Makefile.am - get rid of the LIBDRM_HAS_RENDERNODE_SUPPORT macro - fix some warnings related to EGLuint64KHR to int64_t conversions - use dri2_get_dri_config to get the __DRIconfig instead of open-coding it - replace the occasional tabs with spaces v3: From Martin Peres - fix and indent problem (Matt Turner) - drop the authenticate function, use NULL in the vtable instead (Emil) - drop some useless includes (Emil Velikov) - mandate libdrm (Emil Velikov) - link to xcb-dri3 (Kristian Høgsberg) - convert to the new loader interface for drwable (Kristian) - remove some dead code after the dropping of some vfuncs (Kristian) - add a comment on the topic of rendering to the frontbuffer v4: From Martin Peres - do not expose the preserved swap behavior (Acked by Eric Anholt) Signed-off-by: Boyan Ding <boyan.j.ding@gmail.com> Signed-off-by: Martin Peres <martin.peres@linux.intel.com> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Emil Velikov <emil.velikov@collabora.co.uk>
* egl_dri2: Add a function to let platform code return dri drawable from ↵Boyan Ding2015-11-171-0/+2
| | | | | | | | | | | | | | | | | | _EGLSurface dri3 for EGL will use different struct other than dri2_egl_surface for an EGL surface, the common code only uses __DRIdrawable from that struct, so instead of converting _EGLSurface to dri2_egl_surface, let the platform code return the __DRIdrawable by its own (although the current platforms use the same function). v2: From Martin Peres - convert to the new drawable interface (Kristian) Signed-off-by: Boyan Ding <boyan.j.ding@gmail.com> Signed-off-by: Martin Peres <martin.peres@linux.intel.com> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Emil Velikov <emil.velikov@collabora.co.uk>
* egl/dri2: enable EGL_KHR_gl_colorspace for swrastEmil Velikov2015-10-071-6/+6
| | | | | | | | | | No driver changes needed for softpipe/llvmpipe - things just work. v2: Whitespace fixes. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Boyan Ding <boyan.j.ding@gmail.com> Acked-by: Alex Deucher <alexander.deucher@amd.com>
* egl/dri2: don't leak the fd on dri2_terminateEmil Velikov2015-09-151-0/+1
| | | | | | | | | | Currently the check was incorrect as it did not consider the (unlikely) case of fd == 0. In order to fix this we should first correctly initialize it to -1, as the swrast implementations leave it set to zero (props to calloc()). Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Boyan Ding <boyan.j.ding@gmail.com>
* egl/x11: don't abort when creating a DRI2 drawable failsFrank Binns2015-08-131-1/+19
| | | | | | | | | | | | | When calling either eglCreateWindowSurface or eglCreatePixmapSurface it was possible for an application to be aborted as a result of it failing to create a DRI2 drawable on the server. This could happen due to an application passing in an invalid native drawable handle, for example. v2: Handle the case where an error has been set on the connection Cc: <mesa-stable@lists.freedesktop.org> Signed-off-by: Frank Binns <frank.binns@imgtec.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
* egl/x11: set EGL_BAD_NATIVE_(PIXMAP|WINDOW) for invalid pixmaps/windowsFrank Binns2015-08-131-4/+12
| | | | | | | | | | | | | | | | | | | | Both eglCreatePixmapSurface and eglCreateWindowSurface were incorrectly setting the EGL error to be EGL_BAD_ALLOC when an invalid native drawable handle was being passed in. The EGL spec states the following for eglCreatePixmapSurface: "If pixmap is not a valid native pixmap handle, then an EGL_BAD_- NATIVE_PIXMAP error should be generated." (eglCreateWindowSurface has similar text) Correctly set the EGL error value based on xcb_get_geometry_reply returning an error structure containing something other than BadAlloc. v2: Check for BadAlloc error and update commit message to reflect this Signed-off-by: Frank Binns <frank.binns@imgtec.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
* egl/x11: fix use of EGL_BAD_NATIVE_WINDOWFrank Binns2015-08-131-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 4ed23fd590 introduced some calls to _eglError inappropriately passing it EGL_BAD_NATIVE_WINDOW. This was actually harmless in two of the cases as _eglError gets called later on with a more appropriate error code but (just to be safe) switch these to _eglLog calls instead. The final case is a little trickier as it actually needs to set an error of which the following are available (according to the EGL spec): EGL_BAD_MATCH, EGL_BAD_CONFIG, EGL_BAD_NATIVE_(PIXMAP|WINDOW) and EGL_BAD_ALLOC. Of these, EGL_BAD_ALLOC seems to be the most appropriate given that failure can occur either as a result of xcb_get_setup failing due to an earlier error on the connection (where the most commonly occurring error code is XCB_CONN_CLOSED_MEM_INSUFFICIENT) or as a result of the xcb_screen_iterator_t 'rem' field being 0. In addition to this, commit af2aea40d2 unconditionally set the error to EGL_BAD_NATIVE_WINDOW when creating a window or pixmap surface with a NULL native handle. Change this to correctly set the error based on surface type. v2: Updated patch description (Emil Velikov) Return EGL_BAD_NATIVE_PIXMAP when eglCreatePixmapSurface is called with a NULL native pixmap handle Signed-off-by: Frank Binns <frank.binns@imgtec.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
* 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 <t_arceri@yahoo.com.au> Signed-off-by: Boyan Ding <boyan.j.ding@gmail.com> [Emil Velikov: use brackets for both branches of conditional] Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
* 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 <emil.l.velikov@gmail.com>
* 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 <emil.l.velikov@gmail.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Eric Anholt <eric@anholt.net>
* 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 <julien.isorce@gmail.com> Reported-by: Julien Isorce <julien.isorce@gmail.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Eric Anholt <eric@anholt.net>
* 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 <emil.l.velikov@gmail.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Eric Anholt <eric@anholt.net>
* 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 <emil.l.velikov@gmail.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Eric Anholt <eric@anholt.net>
* 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 <emil.l.velikov@gmail.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Eric Anholt <eric@anholt.net>
* 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 <alexander.deucher@amd.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
* egl: implement EGL_KHR_gl_colorspace (v2)Marek Olšák2015-07-221-6/+6
| | | | | | v2: add missing "break" Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
* 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 <emil.l.velikov@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
* egl_dri2: Remove trailing whitespacesBoyan Ding2015-06-261-1/+1
| | | | | Signed-off-by: Boyan Ding <boyan.j.ding@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
* 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" <mesa-stable@lists.freedesktop.org> Signed-off-by: Boyan Ding <boyan.j.ding@gmail.com> Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Chad Versace <chad.versace@intel.com>
* egl: Use the loader_open_device() helper to do open with CLOEXECDerek Foreman2015-06-231-10/+2
| | | | | | | | | | | 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 <derekf@osg.samsung.com> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
* 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" <mesa-stable@lists.freedesktop.org> Signed-off-by: Boyan Ding <boyan.j.ding@gmail.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
* egl: set the EGL version in common codeMarek Olšák2015-06-051-8/+0
| | | | | Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Chad Versace <chad.versace@intel.com>
* egl/x11: move dri2_x11_swrast_create_image_khr to egl_dri2_fallback.hAxel Davy2015-05-111-10/+1
| | | | | | | Reviewed-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Signed-off-by: Axel Davy <axel.davy@ens.fr>
* egl/drivers: include stdint.h where neededEmil Velikov2015-03-051-0/+1
| | | | | | | | | Currently these files are including it indirectly via eglcompiler.h The latter of which will be removed with follow up commits. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Brian Paul <brianp@vmware.com>
* egl: Pass the correct X visual depth to xcb_put_image().José Fonseca2015-01-311-11/+13
| | | | | | | | | | The dri2_x11_add_configs_for_visuals() function happily matches a 32 bits EGLconfig with a 24 bits X visual. However it was passing 32bits depth to xcb_put_image(), making X server unhappy: https://github.com/apitrace/apitrace/issues/313#issuecomment-70571911 Cc: "10.4" <mesa-stable@lists.freedesktop.org>
* egl: Inform the client API when ancillary buffers may become undefined.Eric Anholt2015-01-061-2/+1
| | | | | | | This is part of the EGL spec, and is useful for a tiled renderer to avoid the memory bandwidth cost of storing the depth/stencil buffers. Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
* egl: setup screen iterator before using itTapani Pälli2014-09-291-1/+1
| | | | | | | | commit 4ed23fd broke creation of pbuffer surfaces, patch fixes the failure, noticed when running chrome with '--use-gl=egl'. Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
* egl: extra null checks for get_xcb_screen() return valuesJuha-Pekka Heikkila2014-09-231-6/+24
| | | | | | | verify get_xcb_screen() returned pointer before using it. Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
* egl/dri2: use the correct screen indexMarek Olšák2014-09-011-10/+29
| | | | Required for multi-GPU configuration where each GPU has its own X screen.
* egl/dri2: do not leak dri2_dpy->driver_nameEmil Velikov2014-06-091-0/+6
| | | | | | | | | | | | | | Originally all hardware drivers duplicate the driver_name string from an external source, while for the software rasterizer we set it to "swrast". Follow the example set by hw drivers this way we can free the string at dri2_terminate(). v2: Use strdup over strndup. Suggested by Ilia Mirkin. v3: Handle platform_drm in a similar manner. Cleanup swrast driver_name in error path. Cc: Chia-I Wu <olv@lunarg.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
* egl/dri2/x11: use standard strndup functionEmil Velikov2014-06-091-19/+4
| | | | | | | Using a custom version of the function brings no benefit. Cc: Chad Versace <chad.versace@linux.intel.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
* egl: Add EGL_CHROMIUM_sync_control extension.Sarah Sharp2014-05-201-0/+29
| | | | | | | | | | | | | | | | | | | | | Chromium defined a new GL extension (that isn't registered with Khronos). We need to add an EGL extension for it, so we can migrate ChromeOS on Intel systems to use EGL instead of GLX. http://git.chromium.org/gitweb/?p=chromium/src/third_party/khronos.git;a=commitdiff;h=27cbfdab35c601f70aa150581ad1448d0401f447 The EGL_CHROMIUM_sync_control extension is similar to the GLX extension OML_sync_control, but only defines one function, eglGetSyncValuesCHROMIUM, which is equivalent to glXGetSyncValuesOML. http://www.opengl.org/registry/specs/OML/glx_sync_control.txt Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Reviewed-by: Chad Versace <chad.versace@linux.intel.com> Reviewed-by: Eric Anholt <eric@anholt.net> Cc: Jamey Sharp <jamey@minilop.net> Cc: Ian Romanick <idr@freedesktop.org> Cc: Stéphane Marchesin <stephane.marchesin@gmail.com>