Commit Graph

85707 Commits

Author SHA1 Message Date
Chad Versace c177ef9d47 egl: Don't advertise unsupported platform extensions
Mesa's set of supported platform extensions depends on the autoconf
option --with-egl-platforms=foo,bar,baz. If --with-egl-platforms lacks
foo, then eglGetPlatformDisplay(EGL_PLATFORM_FOO, ...) unconditonally
fails.

So, if --with-egl-platforms lacks foo, then remove
EGL_VENDOR_platform_foo from the EGL client extension string.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2016-10-14 11:19:27 -07:00
Chad Versace 27f4e38173 docs: Add EGL_MESA_platform_surfaceless.txt (v2)
v2:
    - Assign enum values.
    - Define interactions with EGL_EXT_platform_base and EGL 1.4.

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2016-10-14 11:19:13 -07:00
Ian Romanick 4246986dec i965: Sort some extension names
Trivial.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eduardo Lima Mitev <elima@igalia.com>
2016-10-14 11:16:59 -07:00
Jose Fonseca b12606b693 scons: Fix the Python dependency scanner.
modulefinder wasn't searching for dependencies in the script dir.

It's not capable of detecting the sys.path manipulations scripts do
internally neither.

This change fixes the first issue, and hacks around the second.

Honestly, I've come to the conclusion that automatic Python dependency it will always be
too brittle.   I think we should start manually typing the dependencies
like we do in automake.  At very least it will enable any person to
eyeball and spot/fix missing dependencies, without dig into SCons internals.
2016-10-14 16:52:13 +01:00
Jose Fonseca c6d17701c8 pipe_loader_sw: Don't invoke Unix close() on Windows.
Trivial.
2016-10-14 16:29:04 +01:00
Emil Velikov ebffa7b6af Revert "egl/dri2: rework dri2_make_current code flow"
This reverts commit 675719817e.
2016-10-14 16:07:33 +01:00
Mauro Rossi 6eacd69b6f i915: store reference to the context within struct intel_fence (v2)
Porting of the corresponding patch for i965.

Here follows the original commit message by Tomasz Figa:

"As the spec allows for {server,client}_wait_sync to be called without
currently bound context, while our implementation requires context
pointer.

v2: Add a mutex and acquire it for the duration of
    brw_fence_client_wait() and brw_fence_is_completed() as suggested
    by Chad."

NOTE: in i915 all references to 'brw' are replaced by 'intel'

Marshmallow-x86 boots ok with the following results of Android CTS.

Android CTS 6.0_r7 build:2906653
Session     Pass       Fail     Not Executed
0(EGL)      1410       24       0
1(GLES2)    13832      82       0

I get the same results as per i965GM.

[Emil Velikov: Include Mauro's test results]
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2016-10-14 15:43:57 +01:00
Mauro Rossi d11515ff1b i915/sync: Implement DRI2_Fence extension
Here is the porting of corresponding patch for i965,
i.e. commit c636284 i965/sync: Implement DRI2_Fence extension

Here follows part of original commit message by Chad Versace:

"This enables EGL_KHR_fence_sync and EGL_KHR_wait_sync."

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2016-10-14 15:43:53 +01:00
Mauro Rossi 19fa29a592 i915/sync: Replace prefix 'intel_sync' -> 'intel_gl_sync'
This is the porting of corresponding patch for i965,
i.e. commit 2516d83 i965/sync: Replace prefix 'intel_sync' -> 'intel_gl_sync'

The only difference compared to i965 one is that intel_check_sync() was renamed
to intel_gl_check_sync() here, as it is more appropriate.

Here follows original commit message by Chad Versace:

"I'm about to implement DRI2_Fenc in intel_syncobj.c.  To prevent
madness, we need to prefix functions for GL_ARB_sync with 'gl' and
functions for DRI2_Fence with 'dri'. Otherwise, the file will become
a jumble of similiarly named functions.

For example:
    old-name:      intel_client_wait_sync()
    new-name:      intel_gl_client_wait_sync()
    soon-to-come:  intel_dri_client_wait_sync()

I wrote this renaming commit separately from the commit that implements
DRI2_Fence because I wanted the latter diff to be reviewable."

[Emil Velikov: rename the outstanding intel_sync instances]
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2016-10-14 15:43:22 +01:00
Emil Velikov 284795616a egl/drm: set eglError and provide an error message on failure
v2: Remove gratuitous newline/semicolon (Eric)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
2016-10-14 12:53:39 +01:00
Emil Velikov d81ba763e3 egl/x11: attribute for dri2_add_config failure
... 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>
2016-10-14 12:53:39 +01:00
Emil Velikov 0b2b719121 egl/wayland: introduce dri2_wl_add_configs_for_visuals() helper
Analogous to previous commits - with an extra bonus.

Current code, apart from not attributing the lack of 'per visual'
and overall configs also overwrites the newly added config.

Namely if the dpy supports two or more of the supported formats
(XRGB8888, ARGB8888 and RGB565) earlier configs will be overwritten
and the the final one will be stored, since the we use the same index
for all three in our dri2_add_config call.

v2: Use correct comparison in loop conditional (Eric)
    Use valid C initializer (Gurchetan)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
2016-10-14 12:53:39 +01:00
Emil Velikov 4b8a55809e egl/surfaceless: tweak surfaceless_add_configs_for_visuals()
Analogous to previous commit.

v2: Use correct comparison in loop conditional (Eric)
    Use valid C initializer (Gurchetan)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
2016-10-14 12:53:39 +01:00
Emil Velikov acd35c8758 egl/android: tweak droid_add_configs_for_visuals()
Iterate over the driver_configs first in order to cut down the number of
getConfigAttrib() calls by a factor of 5.

While we're here, also drop the sentinel of the visuals array. We
already know its size so we can use that and save a few bytes.

v2: Use correct comparison in loop conditional (Eric)
    Use valid C initializer (Gurchetan)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
2016-10-14 12:53:39 +01:00
Emil Velikov 36fe5900a4 egl/drm: introduce drm_add_configs_for_visuals() helper
Factor out and rework the existing code so that it prints a debug
message if we have zero configs for any visual.

As a nice side effect we now provide a correct (sequential ID) when
creating a config (via dri2_add_config).

v2: Use correct comparison in loop conditional (Eric)
    Use valid C initializer (Gurchetan)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
2016-10-14 12:53:39 +01:00
Emil Velikov 23ed073aa4 egl/surfaceless: print out a message on zero configs for given format
Currently we print a debug message if the total configs is non-zero only
to do the same (at an error level) as we return from the function.

Rework the message to print if we're missing a config for the given
format.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
2016-10-14 12:53:39 +01:00
Emil Velikov 98f5d0106a egl/dri2: set WL_bind_wayland_display in a consistent way
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>
2016-10-14 12:53:39 +01:00
Emil Velikov 637d001a97 egl/android: remove duplicate KHR_image_base set
The core egl/dri2 already sets the extension bit _only_ when possible -
which in Android's case is always.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2016-10-14 12:53:38 +01:00
Emil Velikov 9caacb39b9 loader/dri3: constify the loader_dri3_vtable
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
2016-10-14 12:53:35 +01:00
Emil Velikov fdd373acca egl/dri2: micro optimise dri2_bind_extensions()
Do not loop over all matches if we've already found one.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
2016-10-14 12:46:09 +01:00
Emil Velikov 665cad1658 egl/dri2: annotate dri2_extension_match instances as const data
v2: Rebase.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
2016-10-14 12:46:05 +01:00
Emil Velikov 3948ad82ce egl/dri2: use dri2_bind_extensions to manage the optional extensions
v2: dri2_bind_extensions() now takes optional as an argument.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
2016-10-14 12:46:03 +01:00
Emil Velikov d5342c6ff2 gbm: rename gbm_dri_device::{,loader_}extensions
To align with the name used in the EGL and GLX loaders.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
2016-10-14 12:45:54 +01:00
Emil Velikov 38526bd468 egl/dri2: add support for optional extensions in dri2_bind_extensions()
Will allow us to reuse the function for optional extensions and fold a
bit of code.

v2: Make dri2_bind_extensions::optional flag an argument to
dri2_bind_extensions (Kristian).

Cc: Rob Clark <robdclark@gmail.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2016-10-14 12:45:24 +01:00
Emil Velikov ebc68e3849 egl/dri2: coding style cleanup
Consistently indent with space rather than a mix of tab and
spaces.

v2: Keep the structs properly aligned (Eric).

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2016-10-14 12:43:57 +01:00
Emil Velikov b10c05d4ff egl/x11: don't crash if dri2_dpy->conn is NULL
The dri3 version of commits 60e9c35b3a and 6de9a03bed.

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>
2016-10-14 12:42:37 +01:00
Emil Velikov f871946594 egl/dri2: rework dri2_egl_display::extensions storage
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>
2016-10-14 12:42:22 +01:00
Emil Velikov f7b8108289 egl/dri2: remove unused dri2_egl_display::{dri2,swrast}_loader_extension
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
2016-10-14 12:42:18 +01:00
Emil Velikov e7fcf1b09b egl/x11: don't populate dri2_dpy->swrast_loader_extension
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>
2016-10-14 12:42:02 +01:00
Emil Velikov 2dbe14af1e egl/wayland: don't populate dri2_dpy->swrast_loader_extension
Similar to the dri2 one - the extension stored in struct
dri2_egl_display is unused.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
2016-10-14 12:42:00 +01:00
Emil Velikov 3963a5fc94 egl/x11: don't populate dri2_dpy->dri2_loader_extension
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>
2016-10-14 12:41:56 +01:00
Emil Velikov d2d579da7e egl/wayland: don't populate dri2_dpy->dri2_loader_extension
Analogous to the earlier android patch.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
2016-10-14 12:41:51 +01:00
Emil Velikov 31ef5d4452 egl/surfaceless: trivial coding style fixes
Remove a few gratious blank lines and use the correct level of
indentation.

Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
2016-10-14 12:41:48 +01:00
Emil Velikov d0155bcbe8 egl/surfaceless: don't check the mask(s) prior to calling dri2_add_config
The latter already does it for us.

As we're here annotate the masks as const and use unsigned for the
index(es).

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
2016-10-14 12:41:43 +01:00
Emil Velikov ff700f8c22 egl/surfaceless: remove unused dri2_loader_extension implementation
Earlier commit introduced support for image_loader and left the
dri2_loader code dangling/unused. Let's remove it.

Fixes: 63c5d5c6c4 ("Added pbuffer hooks for surfaceless platform")
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
2016-10-14 12:17:18 +01:00
Emil Velikov 6a8fe32430 egl/android: don't populate dri2_dpy->dri2_loader_extension
The extension stored in struct dri2_egl_display isn't used, thus we can
create a static const instance of the extension and point extensions[]
to it.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2016-10-14 12:17:18 +01:00
Emil Velikov 675719817e egl/dri2: rework dri2_make_current code flow
Fold duplicate conditional blocks and add a few extra comments ;-)

v2: Bring back the explicit "unbind" logic (Eric), remove NULL derefs.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2016-10-14 12:17:18 +01:00
Emil Velikov 07690a289a egl/dri2: drop NULL checks prior to dri2_destroy_surface
The function already have the respective check within.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2016-10-14 12:17:18 +01:00
Emil Velikov 8cf83f9c08 egl/dri2: call static functions directly, not via _EGLDriver::API
The indirection is meant to be used by the core EGL implementation in
main. Not in the drivers themselves.

Move the dri2_destroy_surface definition to avoid forward declaration of
the static function.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2016-10-14 12:16:08 +01:00
Emil Velikov 532ec2edd8 egl/dri2: use dri2_egl_display inline wrapper where possible
This way the only places that reference DriverData are the ones that
manipulate it.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2016-10-14 12:16:07 +01:00
Emil Velikov d6dcf3b4ca egl/dri2: bail out on NULL dpy in dri2_display_release()
Currently all callers are careful enough not to do that, yet that will
not be the case in the future.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2016-10-14 12:16:06 +01:00
Emil Velikov 8fb9ea413d egl/dri2: move surface refcounting out of the platform code
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>
2016-10-14 12:16:05 +01:00
Emil Velikov 02f1158746 egl/dri2: coding style fix
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2016-10-14 12:16:04 +01:00
Emil Velikov 7a9c92d071 egl/dri2: non-shared glapi cleanups
For a while now we require shared glapi for EGL, thus we can drop a
few bits from the olden days. Namely - dlopen(NULL...) is not possible,
error out at build stage if so and drop the guard around dlclose().

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2016-10-14 12:16:03 +01:00
Emil Velikov b349c11098 egl/dri2: glFlush is not optional, treat it as such
The documentation is clear - one must glFlush the old context on
eglMakeCurrent. Thus keeping it optional is not something we should be
doing. Furthermore if we cannot get the entry point we're likely having
a broken setup/stack.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2016-10-14 12:16:00 +01:00
Emil Velikov 13bf390657 aubinator: replace pragma once with ifndef guard
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Sirisha Gandikota<sirisha.gandikota@intel.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>
2016-10-14 11:53:45 +01:00
Emil Velikov ae6fb9c922 anv: error out if anv_genX.h is included by !anv_private.h
Update the comment to reflect the correct filename and add a guard to
catch incorrect inclusion of the header.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>
2016-10-14 11:53:43 +01:00
Emil Velikov 08efa6a19f anv: use correct header guards
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>
2016-10-14 11:53:41 +01:00
Emil Velikov 76ae842366 intel/genxml: use correct header guards
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>
2016-10-14 11:53:39 +01:00
Emil Velikov 72e70c00f3 intel/common: use correct header guards
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>
2016-10-14 11:53:37 +01:00