Eric Anholt [Fri, 14 Oct 2016 23:26:25 +0000 (16:26 -0700)]
vc4: Fix fast clear color packing for 565.
Piglit didn't manage to cover this because fbo-clear-formats uses
scissors, so we don't get fast clearing.
Eric Anholt [Fri, 14 Oct 2016 22:15:13 +0000 (15:15 -0700)]
state_tracker: Fix check for scissor enabled when < 0.
DEQP's clear tests like to give us x + w < 0 or y + h < 0. Since we
were comparing to an unsigned, it would get promoted to unsigned and come
out as bignum >= width or height and we would clear the whole fb instead
of none of the fb.
Fixes 10 tests under deqp-gles2/functional/color_clear.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Chad Versace [Fri, 14 Oct 2016 22:05:19 +0000 (15:05 -0700)]
egl/surfaceless: Fix comparison between pointer and integer
Fixes GCC warning:
drivers/dri2/platform_surfaceless.c:196:18: warning: comparison
between pointer and integer
Fixes: 4b8a55809eb ("egl/surfaceless: tweak surfaceless_add_configs_for_visuals()")
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Emil Velikov [Fri, 14 Oct 2016 20:42:00 +0000 (21:42 +0100)]
egl/surfaceless: use correct index when accesing the visual
i is used for the driver_configs, while j is for the visuals.
Fixes: 4b8a55809eb ("egl/surfaceless: tweak surfaceless_add_configs_for_visuals()")
Reported-by: Chad Versace <chadversary@chromium.org>
Tested-by: Chad Versace <chadversary@chromium.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Gustaw Smolarczyk [Thu, 13 Oct 2016 20:54:12 +0000 (22:54 +0200)]
radv/winsys: Fail early on overgrown cs.
When !use_ib_bos, we can't easily chain ibs one to another. If the
required cs size grows over 1Mi - 8 dwords just fail the cs so that we
won't assert-fail in radv_amdgpu_winsys_cs_submit later on.
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Kenneth Graunke [Wed, 5 Oct 2016 23:09:54 +0000 (16:09 -0700)]
glsl: Drop the ES requirement that VS outputs must be flat qualified.
Several conformance tests violate this requirement:
ES31-CTS.core.tessellation_shader.max_patch_vertices
ES31-CTS.core.tessellation_shader.tessellation_control_to_tessellation_evaluation.data_pass_through
I submitted a merge request to fix the conformance tests, but Khronos
opted to drop this GLSL ES specific requirement in favor of making flat
qualification of VS outputs optional, matching modern desktop GL.
Note that there were 7 Piglit tests which enforce this rule:
tests/spec/glsl-es-3.00/compiler/interpolation/qualifiers/*nonflat*
but these were deleted in Piglit commit
acc0a2fabbd714bc704c16f1675e7c0.
Bugzilla: https://cvs.khronos.org/bugzilla/show_bug.cgi?id=15465#c7
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Jason Ekstrand [Sat, 15 Oct 2016 06:09:38 +0000 (23:09 -0700)]
intel/genxml: Make some PIPE_CONTROL fields booleans
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Jason Ekstrand [Sat, 15 Oct 2016 05:58:06 +0000 (22:58 -0700)]
intel/genxml: Make "Predication enable" a boolean
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Jason Ekstrand [Sat, 15 Oct 2016 05:55:21 +0000 (22:55 -0700)]
intel/genxml; Make "Use Global GTT a boolean
We also remove the redundant zero defaults since everything without an
explicit default gets zeroed automatically.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Jason Ekstrand [Sat, 15 Oct 2016 05:50:02 +0000 (22:50 -0700)]
intel/genxml; Make "Tiled Surface" a boolean
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Jason Ekstrand [Sat, 15 Oct 2016 05:46:50 +0000 (22:46 -0700)]
intel/genxml: Make "SO Buffer Enable" fields boolean
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Jason Ekstrand [Sat, 15 Oct 2016 05:37:40 +0000 (22:37 -0700)]
intel/genxml: Make "Stencil Buffer Enable" a boolean
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Jason Ekstrand [Sat, 15 Oct 2016 05:35:36 +0000 (22:35 -0700)]
intel/genxml: Make a couple of STREAMOUT fields booleans
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Jason Ekstrand [Sat, 15 Oct 2016 05:31:48 +0000 (22:31 -0700)]
intel/genxml: Make "Include Vertex Handles" and "Include Primitive ID" booleans
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Jason Ekstrand [Sat, 15 Oct 2016 05:28:24 +0000 (22:28 -0700)]
intel/genxml: Make "Vector Mask Enable" a boolean
We also get rid of the "(VME)" a few places
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Jason Ekstrand [Sat, 15 Oct 2016 05:23:16 +0000 (22:23 -0700)]
intel/genxml: Make "Single Program Flow" a boolean
We also get rid of the "(SPF)" a few places.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tobias Klausmann [Fri, 30 Sep 2016 21:50:15 +0000 (23:50 +0200)]
nv50/ir: constant fold OP_SPLIT
Split the source immediate value into new values and move them into the
original defs set by the split. Since we can only have up to 64-bit
immediates, this is largely beneficial for F64 (and, in the future, U64)
operations.
Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
[imirkin: always use U32, set newi for foldCount tracking]
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Kenneth Graunke [Fri, 14 Oct 2016 23:33:19 +0000 (16:33 -0700)]
i965: Enable OpenGL 4.5.
Everything is in place. There are still conformance issues to sort out,
but we may as well turn it on in master.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Jason Ekstrand [Sat, 8 Oct 2016 05:29:44 +0000 (22:29 -0700)]
anv/pipeline: Remove a meta hack from emit_ds_state
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Jason Ekstrand [Sat, 8 Oct 2016 05:14:03 +0000 (22:14 -0700)]
anv/image: Create views directly in VkCreate*View
Without meta, we no longer need the _init helpers and the ability to back
an image view with surface states allocated out of the command buffer.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Jason Ekstrand [Sat, 8 Oct 2016 05:07:04 +0000 (22:07 -0700)]
anv/image: Get rid of the usage hacks for meta
Now that meta is gone and we're using blorp, we don't need all of the usage
hacks. Instead, the usage provided by the app is exactly the usage that we
want because the app is the only thing creating image views.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Jason Ekstrand [Sat, 8 Oct 2016 04:55:34 +0000 (21:55 -0700)]
anv: Move Create*Pipelines into genX_cmd_buffer.c
Now that we don't have meta, we have no need for a gen-agnostic pipeline
create path. We can, instead, just generate one Create*Pipelines function
per gen and be done with it.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Jason Ekstrand [Sat, 8 Oct 2016 04:50:31 +0000 (21:50 -0700)]
anv/pipeline: Remove support for direct-from-nir shaders
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Jason Ekstrand [Fri, 7 Oct 2016 22:47:45 +0000 (15:47 -0700)]
anv: Make entrypoint resolution take a gen_device_info
In order for things such as the ANV_CALL and the ifuncs to work, we used to
have a singleton gen_device_info structure that got assigned the first time
you create a device. Given that the driver will never be used
simultaneously on two different generations of hardware, this was fairly
safe to do. However, it has caused a few hickups and isn't, in general, a
good plan. Now that the two primary reasons for this singleton are gone,
we can get rid of it and make things quite a bit safer.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Jason Ekstrand [Fri, 7 Oct 2016 22:41:17 +0000 (15:41 -0700)]
anv: Get rid of the ANV_CALL macro
This macro was needed by meta in order to make gen-specific calls from
gen-agnostic code. Now that we don't have meta, the remaining two uses are
fairly trivial to get rid of.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Jason Ekstrand [Fri, 7 Oct 2016 22:29:47 +0000 (15:29 -0700)]
anv: Get rid of graphics_pipeline_create_info_extra
Now that we no longer have meta, all pipelines get created via the normal
Vulkan pipeline creation mechanics. There is no more need for this bit of
extra magic data that we've been passing around.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Jason Ekstrand [Fri, 7 Oct 2016 22:06:47 +0000 (15:06 -0700)]
anv: Get rid of meta
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Jason Ekstrand [Sat, 8 Oct 2016 00:29:36 +0000 (17:29 -0700)]
anv: Use blorp for subpass clears
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Jason Ekstrand [Fri, 7 Oct 2016 21:43:21 +0000 (14:43 -0700)]
anv: Use blorp for ClearAttachments
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Jason Ekstrand [Sat, 8 Oct 2016 02:14:47 +0000 (19:14 -0700)]
anv/hiz: Perform HiZ resolves for all partial renders
If we don't, we can end up with corruption in the portion of the depth
buffer that lies outside the render area when we do a HiZ resolve at the
end. The only reason we weren't seeing this before was that all of the
meta-based clears such as VkCmdClearDepthStencilImage were internally using
HiZ so the HiZ buffer never truly got out-of-sync. If the CTS ever tested
a depth upload (which doesn't care about HiZ) and then a partial render we
would have seen problems. Soon, we will be using blorp to do depth clears
and it won't bother with HiZ so we would get CTS regressions without this.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Jason Ekstrand [Fri, 7 Oct 2016 06:35:22 +0000 (23:35 -0700)]
anv: Use blorp for ClearDepthStencilImage
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Jason Ekstrand [Mon, 19 Sep 2016 22:28:43 +0000 (15:28 -0700)]
anv/image: Add an isl_view to anv_image_view
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Jason Ekstrand [Mon, 19 Sep 2016 22:14:56 +0000 (15:14 -0700)]
anv/image: Rework our handling of 3-D image array ranges
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Jason Ekstrand [Fri, 7 Oct 2016 18:23:35 +0000 (11:23 -0700)]
anv/blorp: Don't hand-roll flush_pipeline_select_3d
When I initially brought up Vulkan blorp, I completely missed that this
was already factored out. There's no good reason for us to hand-roll it.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Jason Ekstrand [Sat, 8 Oct 2016 00:20:00 +0000 (17:20 -0700)]
intel/blorp: Add a flag to make blorp not re-emit dept/stencil buffers
In Vulkan, we want to be able to use blorp to perform clears inside of a
render pass. If blorp stomps the depth/stencil buffers packets then we'll
have to re-emit them. This gets tricky when secondary command buffers get
involved. Instead, we'll simply guarantee that the depth and stencil
buffers we pass to blorp (if any) match those already set in the hardware.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Jason Ekstrand [Fri, 7 Oct 2016 06:20:12 +0000 (23:20 -0700)]
intel/blorp: Add an entrypoint for clearing depth and stencil
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Jason Ekstrand [Mon, 10 Oct 2016 16:30:29 +0000 (09:30 -0700)]
intel/blorp: Emit a NULL render target for depth/stencil-only operations
This never mattered before because the only time we used blorp
depth/stencil only was to do HiZ operations on gen6-7. It may have worked
in that case (and maybe it didn't) but slow depth clears actually do depth
rendering so they need a valid render target.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Jason Ekstrand [Fri, 7 Oct 2016 06:44:57 +0000 (23:44 -0700)]
intel/blorp: Allow for running without a PS on gen8+
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Jason Ekstrand [Sat, 8 Oct 2016 00:17:05 +0000 (17:17 -0700)]
intel/blorp: Add an "enabled" bit to surface_info
This gives a slightly smarter way to check whether or not a particular
surface exists than looking at the address.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Jason Ekstrand [Fri, 7 Oct 2016 06:08:08 +0000 (23:08 -0700)]
intel/blorp: Emit more complete DEPTH_STENCIL state
This should now set the pipeline up properly for doing depth and/or stencil
clears by plumbing through depth/stencil test values. We are now also
emitting color calculator state for blorp operations without an actual
shader because that is where the stencil reference value goes pre-SKL.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Jason Ekstrand [Fri, 7 Oct 2016 05:33:32 +0000 (22:33 -0700)]
intel/blorp: Unify the DEPTH_STENCIL emit code across gens
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Jason Ekstrand [Sat, 8 Oct 2016 00:04:10 +0000 (17:04 -0700)]
intel/blorp: Simplify depth/stencil config
The newly reworked depth/stencil config code can properly handle having
depth, stencil, both, or neither. We no longer need to predicate it on
having depth or stencil.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Jason Ekstrand [Mon, 10 Oct 2016 16:29:34 +0000 (09:29 -0700)]
intel/blorp: Set QPitch for depth and HiZ on gen8+
Jason Ekstrand [Fri, 7 Oct 2016 05:10:34 +0000 (22:10 -0700)]
intel/blorp: Add support for binding an actual stencil buffer
While we're here, we also make depth without HiZ work.
v2:
- Use the correct surface type for 1-D on SKL+
- Set QPitch on BDW+
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Jason Ekstrand [Fri, 7 Oct 2016 23:58:34 +0000 (16:58 -0700)]
intel/blorp: Move CLEAR_PARAMS setup into emit_depth_stencil_config
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Jason Ekstrand [Fri, 7 Oct 2016 05:13:57 +0000 (22:13 -0700)]
intel/genxml: Add a uint MOCS field to 3DSTATE_STENCIL_BUFFER
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Jason Ekstrand [Fri, 7 Oct 2016 05:03:12 +0000 (22:03 -0700)]
intel/blorp: Make the Z component of the primitive adjustable
We want to be able to start doing slow depth clears with blorp. This
allows us to adjust the depth we're clearing to.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Emil Velikov [Fri, 14 Oct 2016 18:09:08 +0000 (19:09 +0100)]
i915: workaround multiple intelFenceExtension definitions
Due to conflicting symbol names (between i915 and i965) in the
megadriver, we use a set of defines in i915/intel_screen.h.
With a recent commit we've introduced a symbol intelFenceExtension which
has different implementation for each driver, yet we forgot to add the
define.
Fixes: d11515ff1b3 ("i915/sync: Implement DRI2_Fence extension")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98264
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Chad Versace [Thu, 13 Oct 2016 21:44:17 +0000 (14:44 -0700)]
docs/specs: Update allocated EGL enum values
Document the EGL enum ranges for Mesa and those values allocated by the
following extensions:
EGL_MESA_drm_image
EGL_MESA_platform_gbm
EGL_MESA_platform_surfaceless
EGL_WL_bind_wayland_display
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Chad Versace [Thu, 13 Oct 2016 21:32:13 +0000 (14:32 -0700)]
doc/specs: Reference the Khronos registry XML
Years ago Khronos replaced the registry's spec files with newfangled XML
files. Update the reference in doc/specs/enum.txt accordingly.
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Chad Versace [Thu, 13 Oct 2016 21:19:51 +0000 (14:19 -0700)]
egl: Move old EGL_MESA_screen_surface spec
It was the lone file in src/egl/docs. Move it to where the other specs
live, in $MESA_TOP/docs/specs.
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Chad Versace [Wed, 12 Oct 2016 22:48:15 +0000 (15:48 -0700)]
egl: Implement EGL_MESA_platform_surfaceless
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Chad Versace [Wed, 12 Oct 2016 22:52:12 +0000 (15:52 -0700)]
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>
Chad Versace [Fri, 23 Sep 2016 04:36:17 +0000 (21:36 -0700)]
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>
Ian Romanick [Thu, 1 Sep 2016 19:05:42 +0000 (12:05 -0700)]
i965: Sort some extension names
Trivial.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eduardo Lima Mitev <elima@igalia.com>
Jose Fonseca [Fri, 14 Oct 2016 15:51:56 +0000 (16:51 +0100)]
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.
Jose Fonseca [Fri, 23 Sep 2016 11:55:18 +0000 (12:55 +0100)]
pipe_loader_sw: Don't invoke Unix close() on Windows.
Trivial.
Emil Velikov [Fri, 14 Oct 2016 15:07:33 +0000 (16:07 +0100)]
Revert "egl/dri2: rework dri2_make_current code flow"
This reverts commit
675719817e7bf7c5b9da22c02252aca77a41338d.
Mauro Rossi [Sat, 16 Jul 2016 00:02:58 +0000 (02:02 +0200)]
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>
Mauro Rossi [Thu, 14 Jul 2016 03:33:16 +0000 (05:33 +0200)]
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>
Mauro Rossi [Thu, 14 Jul 2016 03:33:15 +0000 (05:33 +0200)]
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>
Emil Velikov [Thu, 25 Aug 2016 14:52:58 +0000 (15:52 +0100)]
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>
Emil Velikov [Thu, 25 Aug 2016 14:24:44 +0000 (15:24 +0100)]
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>
Emil Velikov [Thu, 25 Aug 2016 13:55:06 +0000 (14:55 +0100)]
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>
Emil Velikov [Thu, 25 Aug 2016 13:35:39 +0000 (14:35 +0100)]
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>
Emil Velikov [Thu, 25 Aug 2016 13:28:48 +0000 (14:28 +0100)]
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>
Emil Velikov [Thu, 25 Aug 2016 13:00:50 +0000 (14:00 +0100)]
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>
Emil Velikov [Thu, 25 Aug 2016 12:32:41 +0000 (13:32 +0100)]
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>
Emil Velikov [Thu, 25 Aug 2016 12:15:43 +0000 (13:15 +0100)]
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>
Emil Velikov [Thu, 25 Aug 2016 12:04:18 +0000 (13:04 +0100)]
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>
Emil Velikov [Thu, 25 Aug 2016 10:08:30 +0000 (11:08 +0100)]
loader/dri3: constify the loader_dri3_vtable
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Emil Velikov [Thu, 25 Aug 2016 08:51:54 +0000 (09:51 +0100)]
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>
Emil Velikov [Wed, 24 Aug 2016 23:52:36 +0000 (00:52 +0100)]
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>
Emil Velikov [Wed, 24 Aug 2016 23:51:05 +0000 (00:51 +0100)]
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>
Emil Velikov [Wed, 24 Aug 2016 23:42:56 +0000 (00:42 +0100)]
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>
Emil Velikov [Wed, 24 Aug 2016 23:16:01 +0000 (00:16 +0100)]
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>
Emil Velikov [Wed, 24 Aug 2016 23:12:13 +0000 (00:12 +0100)]
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>
Emil Velikov [Wed, 24 Aug 2016 22:57:16 +0000 (23:57 +0100)]
egl/x11: don't crash if dri2_dpy->conn is NULL
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>
Emil Velikov [Wed, 24 Aug 2016 22:32:27 +0000 (23:32 +0100)]
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>
Emil Velikov [Tue, 16 Aug 2016 17:47:52 +0000 (18:47 +0100)]
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>
Emil Velikov [Tue, 16 Aug 2016 17:44:19 +0000 (18:44 +0100)]
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>
Emil Velikov [Tue, 16 Aug 2016 17:39:14 +0000 (18:39 +0100)]
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>
Emil Velikov [Tue, 16 Aug 2016 17:29:34 +0000 (18:29 +0100)]
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>
Emil Velikov [Tue, 16 Aug 2016 17:21:48 +0000 (18:21 +0100)]
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>
Emil Velikov [Tue, 16 Aug 2016 17:08:13 +0000 (18:08 +0100)]
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>
Emil Velikov [Tue, 16 Aug 2016 16:56:34 +0000 (17:56 +0100)]
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>
Emil Velikov [Tue, 16 Aug 2016 16:33:41 +0000 (17:33 +0100)]
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: 63c5d5c6c46 ("Added pbuffer hooks for surfaceless platform")
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Emil Velikov [Tue, 16 Aug 2016 16:23:23 +0000 (17:23 +0100)]
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>
Emil Velikov [Tue, 16 Aug 2016 12:47:25 +0000 (13:47 +0100)]
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>
Emil Velikov [Tue, 16 Aug 2016 12:24:48 +0000 (13:24 +0100)]
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>
Emil Velikov [Thu, 18 Aug 2016 15:33:39 +0000 (16:33 +0100)]
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>
Emil Velikov [Fri, 15 Jul 2016 11:47:37 +0000 (12:47 +0100)]
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>
Emil Velikov [Thu, 18 Aug 2016 15:43:36 +0000 (16:43 +0100)]
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>
Emil Velikov [Tue, 16 Aug 2016 12:04:37 +0000 (13:04 +0100)]
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>
Emil Velikov [Tue, 16 Aug 2016 10:03:33 +0000 (11:03 +0100)]
egl/dri2: coding style fix
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Emil Velikov [Tue, 16 Aug 2016 15:33:49 +0000 (16:33 +0100)]
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>
Emil Velikov [Tue, 16 Aug 2016 13:25:19 +0000 (14:25 +0100)]
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>
Emil Velikov [Tue, 11 Oct 2016 17:26:26 +0000 (18:26 +0100)]
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>
Emil Velikov [Tue, 11 Oct 2016 17:26:25 +0000 (18:26 +0100)]
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>
Emil Velikov [Tue, 11 Oct 2016 17:26:24 +0000 (18:26 +0100)]
anv: use correct header guards
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>