mesa.git
7 years agoanv/allocator: Support pushing multiple blocks onto a free list at once
Jason Ekstrand [Mon, 24 Apr 2017 01:57:29 +0000 (18:57 -0700)]
anv/allocator: Support pushing multiple blocks onto a free list at once

Reviewed-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoanv/allocator: Add helpers for dealing with bucket sizes
Jason Ekstrand [Mon, 24 Apr 2017 02:15:42 +0000 (19:15 -0700)]
anv/allocator: Add helpers for dealing with bucket sizes

Reviewed-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoanv/allocator: Add the capability to allocate blocks of different sizes
Jason Ekstrand [Wed, 26 Apr 2017 07:49:40 +0000 (00:49 -0700)]
anv/allocator: Add the capability to allocate blocks of different sizes

Reviewed-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoanv/allocator: Rework a comment
Jason Ekstrand [Wed, 26 Apr 2017 09:28:24 +0000 (02:28 -0700)]
anv/allocator: Rework a comment

This commit just fixes up the English a bit and re-flows the comment.

Reviewed-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoanv/allocator: Tweak the block pool growing algorithm
Jason Ekstrand [Wed, 26 Apr 2017 16:53:45 +0000 (09:53 -0700)]
anv/allocator: Tweak the block pool growing algorithm

The old algorithm worked fine assuming a constant block size.  We're
about to break that assumption so we need an algorithm that's a bit more
robust against suddenly growing by a huge amount compared to the
currently allocated quantity of memory.

Reviewed-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoanv/allocator: Embed the block_pool in the state_pool
Jason Ekstrand [Mon, 24 Apr 2017 15:50:23 +0000 (08:50 -0700)]
anv/allocator: Embed the block_pool in the state_pool

Now that the state stream is allocating off of the state pool, there's
no reason why we need the block pool to be separate.

Reviewed-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoanv/allocator: Get rid of the ability to free blocks
Jason Ekstrand [Mon, 24 Apr 2017 10:11:02 +0000 (03:11 -0700)]
anv/allocator: Get rid of the ability to free blocks

Now that everything is going through the state pools, the block pool no
longer needs to be able to handle re-use.

Reviewed-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoanv: Allocate binding table blocks through the state pool
Jason Ekstrand [Mon, 24 Apr 2017 09:40:20 +0000 (02:40 -0700)]
anv: Allocate binding table blocks through the state pool

Reviewed-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoanv/allocator: Add support for "back" allocations to state_pool
Jason Ekstrand [Mon, 24 Apr 2017 09:17:43 +0000 (02:17 -0700)]
anv/allocator: Add support for "back" allocations to state_pool

Reviewed-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoanv/allocator: Drop the block_size field from block_pool
Jason Ekstrand [Wed, 26 Apr 2017 08:27:33 +0000 (01:27 -0700)]
anv/allocator: Drop the block_size field from block_pool

Since the state_stream is now pulling from a state_pool, the only thing
pulling directly off the block pool is the state pool so we can just
move the block_size there.  The one exception is when we allocate
binding tables but we can just reference the state pool there as well.

The only functional change here is that we no longer grow the block pool
immediately upon creation so no BO gets allocated until our first state
allocation.

Reviewed-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoanv/allocator: Pull the userptr part of block_pool_grow into a helper
Jason Ekstrand [Wed, 26 Apr 2017 13:01:01 +0000 (06:01 -0700)]
anv/allocator: Pull the userptr part of block_pool_grow into a helper

Reviewed-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoanv/allocator: Roll fixed_size_state_pool into state_pool
Jason Ekstrand [Mon, 24 Apr 2017 01:48:21 +0000 (18:48 -0700)]
anv/allocator: Roll fixed_size_state_pool into state_pool

The helper functions aren't really gaining us as much as they claim and
are actually about to be in the way.

Reviewed-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoanv/allocator: Remove the state_size field from fixed_size_state_pool
Jason Ekstrand [Mon, 24 Apr 2017 01:36:33 +0000 (18:36 -0700)]
anv/allocator: Remove the state_size field from fixed_size_state_pool

Reviewed-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoanv: Get rid of a bunch of uses of size_t
Jason Ekstrand [Mon, 24 Apr 2017 01:25:17 +0000 (18:25 -0700)]
anv: Get rid of a bunch of uses of size_t

We should only use size_t when referring to sizes of bits of CPU memory.
Anything on the GPU or just a regular array length should be a type that
has the same size on both 32 and 64-bit architectures.  For state
objects, we use a uint32_t because we'll never allocate a piece of
driver-internal GPU state larger than 2GB (more like 16KB).

Reviewed-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoanv/allocator: Convert the state stream to pull from a state pool
Jason Ekstrand [Mon, 24 Apr 2017 00:22:26 +0000 (17:22 -0700)]
anv/allocator: Convert the state stream to pull from a state pool

Reviewed-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoanv/allocator: Return a null state for zero-size allocations
Jason Ekstrand [Wed, 26 Apr 2017 10:32:06 +0000 (03:32 -0700)]
anv/allocator: Return a null state for zero-size allocations

Reviewed-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoanv/allocator: Add no-valgrind versions of state_pool_alloc/free
Jason Ekstrand [Wed, 26 Apr 2017 10:28:52 +0000 (03:28 -0700)]
anv/allocator: Add no-valgrind versions of state_pool_alloc/free

Reviewed-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agoradv: enable POLARIS12 support.
Dave Airlie [Fri, 5 May 2017 00:27:33 +0000 (10:27 +1000)]
radv: enable POLARIS12 support.

This just adds the chip in the right places.

We don't set the partial_vs_wave workaround, as radeonsi
doesn't, but have to confirm it's not required.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Cc: "17.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoegl/android: Mark surface as lost when dequeueBuffer fails
Chad Versace [Fri, 5 May 2017 00:46:34 +0000 (17:46 -0700)]
egl/android: Mark surface as lost when dequeueBuffer fails

This ensures that future calls to eglSwapBuffers and eglMakeCurrent emit
an error.

This patch is part of a series for fixing
android.hardware.camera2.cts.RobustnessTest#testAbandonRepeatingRequestSurface
on Chrome OS x86 devices.

Cc: mesa-stable@lists.freedesktop.org
Cc: Tomasz Figa <tfiga@chromium.org>
Cc: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoegl/android: Cancel any outstanding ANativeBuffer in surface destructor
Chad Versace [Fri, 5 May 2017 00:46:33 +0000 (17:46 -0700)]
egl/android: Cancel any outstanding ANativeBuffer in surface destructor

That is, call ANativeWindow::cancelBuffer in droid_destroy_surface().

This should prevent application deadlock when the app destroys the
EGLSurface after EGL has acquired a buffer from SurfaceFlinger
(ANativeWindow::dequeueBuffer) but before EGL has released it
(ANativeWindow::enqueueBuffer).

This patch is part of a series for fixing
android.hardware.camera2.cts.RobustnessTest#testAbandonRepeatingRequestSurface
on Chrome OS x86 devices.

Cc: mesa-stable@lists.freedesktop.org
Cc: Tomasz Figa <tfiga@chromium.org>
Cc: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoegl: Emit error when EGLSurface is lost
Chad Versace [Fri, 5 May 2017 00:46:33 +0000 (17:46 -0700)]
egl: Emit error when EGLSurface is lost

Add a new bool, _EGLSurface::Lost, and check it in eglMakeCurrent and
eglSwapBuffers. The EGL 1.5 spec says that those functions emit errors
when the native surface is no longer valid.

This patch just updates core EGL. No driver sets _EGLSurface::Lost yet.

I discovered that Mesa failed to detect lost surfaces while debugging an
Android CTS camera test,
android.hardware.camera2.cts.RobustnessTest#testAbandonRepeatingRequestSurface.
This patch doesn't fix the test though, though, because the test expects
EGL_BAD_SURFACE when the surface becomes lost, and this patch actually
complies with the EGL spec. If I interpreted the EGL spec correctly,
EGL_BAD_NATIVE_WINDOW or EGL_BAD_CURRENT_SURFACE is the correct error.

Cc: mesa-stable@lists.freedesktop.org
Cc: Tomasz Figa <tfiga@chromium.org>
Cc: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agowinsys/amdgpu: fix Polaris12 (RX 550) breakage
Marek Olšák [Thu, 4 May 2017 23:16:57 +0000 (01:16 +0200)]
winsys/amdgpu: fix Polaris12 (RX 550) breakage

reported by Greg White.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100892
Cc: 17.1 <mesa-stable@lists.freedesktop.org>
7 years agoanv: Simplify Cherryview line handling.
Kenneth Graunke [Thu, 4 May 2017 18:11:44 +0000 (11:11 -0700)]
anv: Simplify Cherryview line handling.

We can just use the new CHVLineWidth field rather than an entirely
different generation's packing function.

v2: Inline the function (requested by Jason)

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agoi965: Fix line width on Cherryview.
Kenneth Graunke [Thu, 4 May 2017 18:03:47 +0000 (11:03 -0700)]
i965: Fix line width on Cherryview.

We just add another field to gen8.xml for the Cherryview line width,
rather than trying to replicate the gymnastics done in the Vulkan
driver to use gen9 SF pack functions.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agoradeonsi/gfx9: allow the scratch buffer in HS and GS
Marek Olšák [Thu, 27 Apr 2017 00:20:13 +0000 (02:20 +0200)]
radeonsi/gfx9: allow the scratch buffer in HS and GS

It works now.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi: prevent race conditions when doing scratch patching
Marek Olšák [Thu, 27 Apr 2017 17:12:22 +0000 (19:12 +0200)]
radeonsi: prevent race conditions when doing scratch patching

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi: separate scratch state patching code into its own function
Marek Olšák [Fri, 3 Mar 2017 23:25:27 +0000 (00:25 +0100)]
radeonsi: separate scratch state patching code into its own function

Picked from a different branch. When we stop using the scratch patching,
this function will not be called.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi/gfx9: also apply scratch relocations to the 1st shader of merged shaders
Marek Olšák [Thu, 27 Apr 2017 17:01:44 +0000 (19:01 +0200)]
radeonsi/gfx9: also apply scratch relocations to the 1st shader of merged shaders

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi/gfx9: set correct LLVM calling conventions for merged shaders
Marek Olšák [Thu, 27 Apr 2017 00:18:53 +0000 (02:18 +0200)]
radeonsi/gfx9: set correct LLVM calling conventions for merged shaders

for scratch support

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi: remove unused parameters from si_shader_apply_scratch_relocs
Marek Olšák [Thu, 27 Apr 2017 17:00:56 +0000 (19:00 +0200)]
radeonsi: remove unused parameters from si_shader_apply_scratch_relocs

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi: inline si_llvm_shader_type into si_llvm_create_func
Marek Olšák [Thu, 27 Apr 2017 00:12:48 +0000 (02:12 +0200)]
radeonsi: inline si_llvm_shader_type into si_llvm_create_func

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi: don't use util_memcpy_cpu_to_le32 for shader uploads
Marek Olšák [Thu, 27 Apr 2017 17:19:53 +0000 (19:19 +0200)]
radeonsi: don't use util_memcpy_cpu_to_le32 for shader uploads

at least I think this is correct.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi: make si_compile_llvm static
Marek Olšák [Fri, 28 Apr 2017 18:31:45 +0000 (20:31 +0200)]
radeonsi: make si_compile_llvm static

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi: fold surrounding code into si_llvm_finalize_module
Marek Olšák [Fri, 28 Apr 2017 18:23:19 +0000 (20:23 +0200)]
radeonsi: fold surrounding code into si_llvm_finalize_module

and rename to si_llvm_optimize_module.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi: don't call eliminate_const_vs_outputs in shaders without VS exports
Marek Olšák [Fri, 28 Apr 2017 14:35:13 +0000 (16:35 +0200)]
radeonsi: don't call eliminate_const_vs_outputs in shaders without VS exports

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi: drop support for LLVM 3.8
Marek Olšák [Tue, 25 Apr 2017 00:18:10 +0000 (02:18 +0200)]
radeonsi: drop support for LLVM 3.8

LLVM 3.8:
- had broken indirect resource indexing
- didn't have scratch coalescing
- was the last user of problematic v16i8
- only supported OpenGL 4.1

This leaves us with LLVM 3.9 and LLVM 4.0 support for Mesa 17.2.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi: stop using v16i8
Marek Olšák [Mon, 24 Apr 2017 22:56:44 +0000 (00:56 +0200)]
radeonsi: stop using v16i8

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi/gfx9: make some PA & DB registers match the closed Vulkan driver
Marek Olšák [Fri, 28 Apr 2017 17:28:06 +0000 (19:28 +0200)]
radeonsi/gfx9: make some PA & DB registers match the closed Vulkan driver

Cc: 17.1 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradv: don't advertise transfer props unless we can do anything else
Dave Airlie [Thu, 4 May 2017 00:51:49 +0000 (10:51 +1000)]
radv: don't advertise transfer props unless we can do anything else

There is no reason to advertise transfer ability for formats we can't
use for anything else. This stops some CTS tests hitting internal
error for 64-bit types when they see the transfer flags.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agofreedreno/a5xx: compute shader support
Rob Clark [Thu, 4 May 2017 17:26:35 +0000 (13:26 -0400)]
freedreno/a5xx: compute shader support

Signed-off-by: Rob Clark <robdclark@gmail.com>
7 years agofreedreno: core compute state support
Rob Clark [Thu, 4 May 2017 17:24:37 +0000 (13:24 -0400)]
freedreno: core compute state support

Signed-off-by: Rob Clark <robdclark@gmail.com>
7 years agofreedreno/ir3: compute shader support
Rob Clark [Mon, 17 Apr 2017 15:40:16 +0000 (11:40 -0400)]
freedreno/ir3: compute shader support

Signed-off-by: Rob Clark <robdclark@gmail.com>
7 years agofreedreno/a5xx: SSBO support
Rob Clark [Mon, 17 Apr 2017 15:25:29 +0000 (11:25 -0400)]
freedreno/a5xx: SSBO support

To simplify things for now, since all the gfx shader stages share a
single SSBO state block, only advertise SSBO support for fragment shader
(and compute when we have that).  We could possibly use a fixed-
partitioning of the SSBO index space to support SSBOs on other stages
without having to resort to shader variants.

Signed-off-by: Rob Clark <robdclark@gmail.com>
7 years agofreedreno/ir3: SSBO/atomic support
Rob Clark [Mon, 17 Apr 2017 15:04:00 +0000 (11:04 -0400)]
freedreno/ir3: SSBO/atomic support

TODO cwabbott pointed out a write-after-read hazzard, which effects both
this and arrays.  A write needs to depend on *all* reads since the last
write, not just the last read.

Signed-off-by: Rob Clark <robdclark@gmail.com>
7 years agofreedreno: core SSBO support
Rob Clark [Mon, 17 Apr 2017 14:56:20 +0000 (10:56 -0400)]
freedreno: core SSBO support

The generation-independent support for binding shader buffer objects.

Signed-off-by: Rob Clark <robdclark@gmail.com>
7 years agofreedreno/ir3: resync instr-a3xx.h/disasm-a3xx.c
Rob Clark [Mon, 3 Apr 2017 17:25:02 +0000 (13:25 -0400)]
freedreno/ir3: resync instr-a3xx.h/disasm-a3xx.c

Sync to the same files from freedreno.git to correct decoding of ldgb/
stgb instructions.

Signed-off-by: Rob Clark <robdclark@gmail.com>
7 years agomesa/st: compute support for glsl_to_nir
Rob Clark [Tue, 4 Apr 2017 19:55:25 +0000 (15:55 -0400)]
mesa/st: compute support for glsl_to_nir

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
7 years agonir: add pass to lower atomic counters to SSBO
Rob Clark [Wed, 12 Apr 2017 17:26:54 +0000 (13:26 -0400)]
nir: add pass to lower atomic counters to SSBO

This is equivalent to what mesa/st does in glsl_to_tgsi.  For most hw
there isn't a particularly good reason to treat these differently.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agonir: add a C wrapper for glsl_type::get_interface_instance()
Rob Clark [Mon, 24 Apr 2017 14:22:25 +0000 (10:22 -0400)]
nir: add a C wrapper for glsl_type::get_interface_instance()

Signed-off-by: Rob Clark <robdclark@gmail.com>
7 years agomapi_abi.py: remove no longer used --mode option
Emil Velikov [Thu, 13 Apr 2017 17:42:37 +0000 (18:42 +0100)]
mapi_abi.py: remove no longer used --mode option

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agomapy_abi.py: remove dead output_for_app generator
Emil Velikov [Thu, 13 Apr 2017 17:35:42 +0000 (18:35 +0100)]
mapy_abi.py: remove dead output_for_app generator

Used by the OpenVG codebase.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
7 years agomapi: replace mapi_table abstraction
Emil Velikov [Thu, 13 Apr 2017 17:23:50 +0000 (18:23 +0100)]
mapi: replace mapi_table abstraction

Replace all instances of mapi_table with the actual struct _glapi_table.
The former may have been needed when the OpenVG was around. But since
that one is long gone, there' no point in having the current confusing
mix of the two.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agomesa/tests: remove no longer needed HAVE_SHARED_GLAPI define
Emil Velikov [Thu, 13 Apr 2017 16:54:08 +0000 (17:54 +0100)]
mesa/tests: remove no longer needed HAVE_SHARED_GLAPI define

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agogl_table.py: always regenerate the complete struct _glapi_table
Emil Velikov [Thu, 13 Apr 2017 16:50:10 +0000 (17:50 +0100)]
gl_table.py: always regenerate the complete struct _glapi_table

Currently we would generate a partial one as we do non-shared glapi.
At the same time since it's local, we don't care that much if we have a
few extra bytes of space in the table.

Drop the guard, which allows us to simplify both build system and code.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoglx/apple: remove empty variable SHARED_GLAPI_CFLAGS
Emil Velikov [Thu, 13 Apr 2017 16:35:06 +0000 (17:35 +0100)]
glx/apple: remove empty variable SHARED_GLAPI_CFLAGS

Cc: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoglx/windows: remove empty variable SHARED_GLAPI_CFLAGS
Emil Velikov [Thu, 13 Apr 2017 16:34:04 +0000 (17:34 +0100)]
glx/windows: remove empty variable SHARED_GLAPI_CFLAGS

Cc: Jon Turney <jon.turney@dronecode.org.uk>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoglx: automake: scons: remove unneeded GLX_SHARED_GLAPI define
Emil Velikov [Thu, 13 Apr 2017 17:02:29 +0000 (18:02 +0100)]
glx: automake: scons: remove unneeded GLX_SHARED_GLAPI define

There's no users in-tree that use it.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agotargets/libgl-xlib: remove unneeded GLX_SHARED_GLAPI define
Emil Velikov [Thu, 13 Apr 2017 16:32:35 +0000 (17:32 +0100)]
targets/libgl-xlib: remove unneeded GLX_SHARED_GLAPI define

There's no users in-tree that use it.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agodrivers/x11: remove unneeded GLX_SHARED_GLAPI define
Emil Velikov [Thu, 13 Apr 2017 16:30:10 +0000 (17:30 +0100)]
drivers/x11: remove unneeded GLX_SHARED_GLAPI define

There's no users in-tree that use it.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoglx: glX_proto_send.py: use correct compile guard GLX_INDIRECT_RENDERING
Emil Velikov [Thu, 13 Apr 2017 16:17:45 +0000 (17:17 +0100)]
glx: glX_proto_send.py: use correct compile guard GLX_INDIRECT_RENDERING

The code itself has nothing to do with shared glapi, thus having it
behind GLX_SHARED_GLAPI is misleading. Use GLX_INDIRECT_RENDERING
instead.

The latter macro is set at global scope by the Autotools and Scons build
systems.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agomapi/es*api: remove unneeded HAVE_SHARED_GLAPI guard
Emil Velikov [Thu, 13 Apr 2017 15:35:12 +0000 (16:35 +0100)]
mapi/es*api: remove unneeded HAVE_SHARED_GLAPI guard

Always true, since GLES* requires shared glapi.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agomesa/dri: remove unneeded HAVE_SHARED_GLAPI guard
Emil Velikov [Thu, 13 Apr 2017 15:37:44 +0000 (16:37 +0100)]
mesa/dri: remove unneeded HAVE_SHARED_GLAPI guard

Always true, since the dri modules required shared glapi.

With earlier commit (da410e6afad "configure: explicitly require shared
glapi for enable-dri") we even made that explicit during the configure
stage.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agogallium/dri: remove unneeded HAVE_SHARED_GLAPI guard
Emil Velikov [Thu, 13 Apr 2017 15:12:02 +0000 (16:12 +0100)]
gallium/dri: remove unneeded HAVE_SHARED_GLAPI guard

Always true, since the dri modules required shared glapi.

With earlier commit (da410e6afad "configure: explicitly require shared
glapi for enable-dri") we even made that explicit during the configure
stage.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agomesa/dri: always link against shared glapi
Emil Velikov [Thu, 13 Apr 2017 18:36:56 +0000 (19:36 +0100)]
mesa/dri: always link against shared glapi

Analogous to previous commit. Check with the extensive commit
description and bug report referenced.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agogallium/dri: always link against shared glapi
Emil Velikov [Thu, 13 Apr 2017 17:54:03 +0000 (18:54 +0100)]
gallium/dri: always link against shared glapi

In the early days of Xorg and Mesa we had multiple providers of the
GLAPI. All of those were the ones responsible for dlopening the DRI
module. Hence it was perfectly fine, and actually expected, for the DRI
modules to have unresolved symbols.

Since then we've moved the API to a separate shared library and no other
libraries provide the symbols.

Here comes the picky part:
It's possible that one uses old Xorg (where libglx.so provides the
GLAPI) and new Mesa (with DRI modules linking against libglapi.so).

That should still work, since the the libglx.so symbols will take
precedence over the libglapi.so ones.

I've verified this while running 1.14 series Xorg alongside this (and
next) patch.

It may seem a bit fragile, but that's of reasonably OK since all of the
affected Xorg versions have been EOL for years.

The final one being the 1.14 series, which saw its final bug fix release
1.14.7 in June 2014.

To ensure that the binaries do not have unresolved symbols add
-no-undefined and $(LD_NO_UNDEFINED), just like we do everywhere else
throughout mesa.

Cc: mesa-stable@lists.freedesktop.org
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98428
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoanv: fix anv_gem_mmap comment to not mention NULL
Emil Velikov [Thu, 4 May 2017 14:50:27 +0000 (15:50 +0100)]
anv: fix anv_gem_mmap comment to not mention NULL

The function cannot return NULL, update the comment accordingly.

Fixes: b546c9d ("anv: anv_gem_mmap() returns MAP_FAILED as mapping error")
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
7 years agoeg: explicitly size dri2_to_egl_attribute_map[]
Emil Velikov [Mon, 1 May 2017 18:40:31 +0000 (19:40 +0100)]
eg: explicitly size dri2_to_egl_attribute_map[]

This way we'll get an implicit zero initialization of the remaining
members, as required by dri2_add_config().

Fixes: e5efaeb85c3 ("egl: polish dri2_to_egl_attribute_map[]")
Cc: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
7 years agodri_interface.h: define __DRI_ATTRIB_MAX
Emil Velikov [Mon, 1 May 2017 18:37:56 +0000 (19:37 +0100)]
dri_interface.h: define __DRI_ATTRIB_MAX

Thus we can use the value to explicitly size arrays, instead of
__DRI_ATTRIB_FRAMEBUFFER_SRGB_CAPABLE + 1.

The latter seems magical and is error prone, as we add more dri
attributes.

v2: Fix off by one error (Tomasz)

Cc: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoscons: update for LLVM 4.0
Ben Boeckel [Thu, 27 Apr 2017 20:31:48 +0000 (16:31 -0400)]
scons: update for LLVM 4.0

LLVMDemangle, LLVMGlobalISel, and LLVMDebugInfoMSF are new.

Also update the comment to add irreader to the list of components.

CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Chuck Atkins <chuck.atkins@kitware.com>
Signed-off-by: Ben Boeckel <ben.boeckel@kitware.com>
Acked-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
7 years agoc11/threads: rework Windows thrd_current() comment
Emil Velikov [Sat, 29 Apr 2017 13:46:02 +0000 (14:46 +0100)]
c11/threads: rework Windows thrd_current() comment

Drop the misleading "will not match the one returned by thread_create"
hunk and provide more clarity as to what/why GetCurrentThread() isn't
the solution we're looking for.

v2: Places brackets after function names (Eric)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com> (v1)
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agoegl/platform/drm: Don't take display ownership until gbm is initialized
Adam Jackson [Wed, 3 May 2017 15:03:34 +0000 (11:03 -0400)]
egl/platform/drm: Don't take display ownership until gbm is initialized

If the gbm_create_device() call here actually did fail, any subsequent
eglTerminate on the display would segfault.

Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
7 years agoegl/x11: Honor the EGL_PLATFORM_X11_SCREEN_EXT attribute
Adam Jackson [Tue, 2 May 2017 16:27:01 +0000 (12:27 -0400)]
egl/x11: Honor the EGL_PLATFORM_X11_SCREEN_EXT attribute

Introduce _egl_display::Options::Platforms for private storage.
For X11 platforms we can use it for the screen number as set by
EGL_PLATFORM_X11_SCREEN_EXT.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
7 years agoanv: vkBindImageMemory() should return VK_ERROR_OUT_OF_{HOST,DEVICE}_MEMORY on failure
Samuel Iglesias Gonsálvez [Thu, 4 May 2017 09:57:36 +0000 (11:57 +0200)]
anv: vkBindImageMemory() should return VK_ERROR_OUT_OF_{HOST,DEVICE}_MEMORY on failure

According to the spec we get VK_ERROR_OUT_OF_HOST_MEMORY or
VK_ERROR_OUT_OF_DEVICE_MEMORY on vkBindImageMemory failure.

Fixes returned value changed by b546c9d.

Fixes: b546c9d ("anv: anv_gem_mmap() returns MAP_FAILED as mapping error")
Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Cc: "17.0 17.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoglsl: reject memory qualifiers with uniform blocks
Samuel Pitoiset [Wed, 3 May 2017 16:37:28 +0000 (18:37 +0200)]
glsl: reject memory qualifiers with uniform blocks

The spec allows memory qualifiers to be used with image variables,
buffers variables and shader storage blocks. This patch also fixes
validate_memory_qualifier_for_type().

Fixes the following ARB_uniform_buffer_object test:

uniform-block-memory-qualifier.frag

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoglsl: reject format qualifiers with non-image types everywhere
Samuel Pitoiset [Mon, 1 May 2017 10:34:42 +0000 (12:34 +0200)]
glsl: reject format qualifiers with non-image types everywhere

Including structures, interfaces and uniform blocks.

Fixes the following ARB_shader_image_load_store test:

format-layout-with-non-image-type.frag

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoglsl: rework validate_image_qualifier_for_type()
Samuel Pitoiset [Mon, 1 May 2017 10:34:41 +0000 (12:34 +0200)]
glsl: rework validate_image_qualifier_for_type()

It makes more sense to have two separate validate functions,
mainly because memory qualifiers are allowed with members of
shader storage blocks.

validate_memory_qualifier_for_type() will be fixed in a
separate patch.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoglsl: rename image_* qualifiers to memory_*
Samuel Pitoiset [Wed, 3 May 2017 09:16:57 +0000 (11:16 +0200)]
glsl: rename image_* qualifiers to memory_*

It doesn't make sense to prefix them with 'image' because
they are called "Memory Qualifiers" and they can be applied
to members of storage buffer blocks.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
7 years agoanv: anv_gem_mmap() returns MAP_FAILED as mapping error
Samuel Iglesias Gonsálvez [Wed, 3 May 2017 06:02:21 +0000 (08:02 +0200)]
anv: anv_gem_mmap() returns MAP_FAILED as mapping error

Take it into account when checking if the mapping failed.

v2:
- Remove map == NULL and its related comment (Emil)

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Fixes: 6f3e3c715a7 ("vk/allocator: Add a BO pool")
Fixes: 9919a2d34de ("anv/image: Memset hiz surfaces to 0 when binding memory")
Cc: "17.0 17.1" <mesa-stable@lists.freedesktop.org>
7 years agonir/lower_tex: Fix minor error in YUV color conversion matrix
Johnson Lin [Thu, 4 May 2017 06:37:52 +0000 (14:37 +0800)]
nir/lower_tex: Fix minor error in YUV color conversion matrix

The matrix used for YCbCr to RGB is listed in:

    https://en.wikipedia.org/wiki/YCbCr

There was an error in converting the offsets from integers to unorm
values: 0.0625=16/256 should be 16.0/255,and 0.5=128.0/256 should be
128.0/255.  With this fix, the CSC result is bit aligned with wikipedia's
conversion result and FFMPeg's result.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100854
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
7 years agoi965: Port gen4+ state emitting code to genxml.
Rafael Antognolli [Wed, 19 Apr 2017 20:13:25 +0000 (13:13 -0700)]
i965: Port gen4+ state emitting code to genxml.

On this patch, we port:
   - brw_polygon_stipple
   - brw_polygon_stipple_offset
   - brw_line_stipple
   - brw_drawing_rect

v2:
   - Also emit states for gen4-5 with this code.
v3:
   - Style fixes and remove excessive checks (Ken).

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoi965: Port gen6+ 3DSTATE_CC_STATE_POINTERS state to genxml.
Rafael Antognolli [Wed, 19 Apr 2017 23:16:24 +0000 (16:16 -0700)]
i965: Port gen6+ 3DSTATE_CC_STATE_POINTERS state to genxml.

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoi965: Port gen6+ multisample state emitting code to genxml.
Rafael Antognolli [Wed, 19 Apr 2017 16:56:36 +0000 (09:56 -0700)]
i965: Port gen6+ multisample state emitting code to genxml.

Emit 3DSTATE_MULTISAMPLE using brw_batch_emit.

v3:
   - Remove dead code (Ken)
   - Simplify #if/#endif (Ken)

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoi965: Port gen4+ emit vertices code to genxml.
Rafael Antognolli [Thu, 6 Apr 2017 23:43:49 +0000 (16:43 -0700)]
i965: Port gen4+ emit vertices code to genxml.

Some code that was placed in brw_draw_upload.c and exported to be used
by gen8+ was also moved to genX_state_upload, and the respective symbols
are not exported anymore.

v2:
   - Remove code from brw_draw_upload too
   - Emit vertices for gen4-5 too.
   - Use helper to setup brw_address (Kristian)
   - Use macros for MOCS values.
   - Do not use #ifndef NDEBUG on code that is actually used (Ken)
v3:
   - Style and code clenup (Ken)
   - Keep some of the common code inside brw_draw_upload.c (Ken)

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoi965: Port push constant code to genxml.
Rafael Antognolli [Wed, 5 Apr 2017 23:22:43 +0000 (16:22 -0700)]
i965: Port push constant code to genxml.

The following states are ported on this patch:
   - gen6_gs_push_constants
   - gen6_vs_push_constants
   - gen6_wm_push_constants
   - gen7_tes_push_constants

v2:
   - Use helper to setup brw_address (Kristian)
v3:
   - Do not use macro for upload_constant_state (Ken)
   - Do not re-declare MOCS macro (Ken)
v4: (by Ken)
   - Drop more dead code, change brw->gen checks to GEN_GEN, style nits

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoi965: Port gen6+ 3DSTATE_SCISSOR_STATE_POINTERS to use genxml.
Rafael Antognolli [Thu, 30 Mar 2017 16:52:19 +0000 (09:52 -0700)]
i965: Port gen6+ 3DSTATE_SCISSOR_STATE_POINTERS to use genxml.

Emit 3DSTATE_SCISSOR_STATE_POINTERS using brw_batch_emit, and pack the
scissor states using GENX(SCISSOR_RECT_pack), generated from genxml.

v3:
   - Remove old code (Ken)
   - Style fixes (Ken)

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoi965: Port gen7+ 3DSTATE_TE to genxml.
Rafael Antognolli [Wed, 29 Mar 2017 20:43:51 +0000 (13:43 -0700)]
i965: Port gen7+ 3DSTATE_TE to genxml.

Emit 3DSTATE_TE on Gen7+ using brw_batch_emit helper.

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoi965: Port gen6+ blend state code to genxml.
Rafael Antognolli [Mon, 27 Mar 2017 22:52:10 +0000 (15:52 -0700)]
i965: Port gen6+ blend state code to genxml.

Upload blend states using GENX(BLEND_STATE_ENTRY_pack), generated from
genxml.

v3:
   - style fixes (Ken)
   - cleanup to remove excessive #ifdef's (Ken)
   - remove memset (Ken)
   - disable blend.AlphaToCoverageDitherEnable on gen6 (Ken)

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoi965: Port gen6+ state emitting code to genxml.
Rafael Antognolli [Mon, 27 Mar 2017 15:42:45 +0000 (08:42 -0700)]
i965: Port gen6+ state emitting code to genxml.

Ported in this patch:
   - 3DSTATE_DS
   - 3DSTATE_GS
   - 3DSTATE_HS
   - 3DSTATE_VIEWPORT_STATE_POINTERS_SF_CL

v3:
   - Remove NEW_TRANSFORM blocks (Ken)
   - Bring back some comments and workaround for Ivybridge (Ken)

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoi965: Port gen6+ 3DSTATE_VS to genxml.
Rafael Antognolli [Wed, 22 Mar 2017 23:26:55 +0000 (16:26 -0700)]
i965: Port gen6+ 3DSTATE_VS to genxml.

Emit 3DSTATE_VS on Gen6+ using brw_batch_emit helper, that uses pack
structs from genxml.

v2:
   - Use render_bo helper to setup brw_address (Kristian)
v3:
   - Bring back some comments for gen6 and remove _NEW_TRANSFORM blocks
   from gen7+.

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoi965: Port gen8+ 3DSTATE_PS_EXTRA to genxml.
Rafael Antognolli [Tue, 21 Mar 2017 23:29:23 +0000 (16:29 -0700)]
i965: Port gen8+ 3DSTATE_PS_EXTRA to genxml.

Emit 3DSTATE_PS_EXTRA on Gen8+ using brw_batch_emit helper, that uses
pack structs from genxml.

v3:
   - Style fixes and moving code around to be cleaner (Ken)

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoi965: Port gen6+ 3DSTATE_WM to genxml.
Rafael Antognolli [Tue, 21 Mar 2017 21:55:50 +0000 (14:55 -0700)]
i965: Port gen6+ 3DSTATE_WM to genxml.

Emit 3DSTATE_WM on Gen6+ using brw_batch_emit helper, that uses pack
structs from genxml.

v2:
   - Use render_bo helper to setup brw_address (Kristian)
   - Remove TODO and use BRW_PSCDEPTH_OFF.
v3:
   - A couple of style fixes (Ken)
   - Enable RASTRULE_UPPER_RIGHT on gen6+ instead of gen8+ (Ken)

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoi965: Port gen7+ 3DSTATE_PS to genxml.
Rafael Antognolli [Tue, 21 Mar 2017 20:08:05 +0000 (13:08 -0700)]
i965: Port gen7+ 3DSTATE_PS to genxml.

Emit 3DSTATE_PS on Gen7+ using brw_batch_emit helper, that uses pack
structs from genxml.

v2:
   - Use render_bo helper to setup brw_address (Kristian)
v3:
   - Style fixes and code cleanup (Ken)
v4:
   - More style fixes and code cleanup missed in v3

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoi965: Port gen7+ 3DSTATE_SOL to genxml.
Rafael Antognolli [Tue, 21 Mar 2017 14:30:03 +0000 (07:30 -0700)]
i965: Port gen7+ 3DSTATE_SOL to genxml.

Emit 3DSTATE_SOL on Gen7+ using brw_batch_emit helper, that uses pack
structs from genxml.

v2:
   - Add helpers to assign struct brw_address (Kristian)
v3:
   - Rename MOCS -> SOBufferMOCS
   - Do not re-declare MOCS macros (Ken).
   - Style and code reorganization (Ken).

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoi965: Remove calculate_attr_overrides.
Rafael Antognolli [Mon, 20 Mar 2017 18:12:25 +0000 (11:12 -0700)]
i965: Remove calculate_attr_overrides.

This function now lives inside genX_state_upload.c.

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoi965: Port Gen7+ 3DSTATE_SBE state to genxml.
Rafael Antognolli [Mon, 20 Mar 2017 17:32:53 +0000 (10:32 -0700)]
i965: Port Gen7+ 3DSTATE_SBE state to genxml.

Emit 3DSTATE_SBE on Gen7+ using brw_batch_emit helper, that uses pack
structs from genxml.

v2: - Use ACTIVE_COMPONENT_XYZW from gen9.xml.
v3: - Style fixes (Ken)
v4: #undef unconditionally (Ken)

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoi965: Port gen6+ 3DSTATE_SF to genxml.
Rafael Antognolli [Fri, 17 Mar 2017 17:23:45 +0000 (10:23 -0700)]
i965: Port gen6+ 3DSTATE_SF to genxml.

Emit sf state on Gen6+ using brw_batch_emit helper, using pack structs
from genxml.

v3:
   - Reorganize code and reduce #if/#endif's (Ken)
   - Style fixes (Ken)
   - Always set AALINEDISTANCE_TRUE (Ken)

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoi965: Add brw_get_line_width_float.
Rafael Antognolli [Wed, 26 Apr 2017 23:27:13 +0000 (16:27 -0700)]
i965: Add brw_get_line_width_float.

That helper function returns the line width as a float, and is then used
by brw_get_line_width to return the fixed point width.

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoi965: Port Gen8+ 3DSTATE_RASTER state to genxml.
Rafael Antognolli [Thu, 16 Mar 2017 18:39:31 +0000 (11:39 -0700)]
i965: Port Gen8+ 3DSTATE_RASTER state to genxml.

Emits 3DSTATE_RASTER from genX_state_upload.c using pack structs from
genxml.

v3:
   - Style fixes (Ken)

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoi965: Port Gen6+ 3DSTATE_CLIP state to genxml.
Rafael Antognolli [Thu, 16 Mar 2017 00:08:26 +0000 (17:08 -0700)]
i965: Port Gen6+ 3DSTATE_CLIP state to genxml.

Emit clip state on Gen6+ using brw_batch_emit helper, using pack structs
from genxml.

v3:
   - Lots style fixes (Ken)
   - Do not set CullTestEnableBitMask on Gen8+ (Ken)
v4:
   - Do not include brw_defines_common.h.
v5 (Ken): s/BRW_NEW_WM_PROG_DATA/BRW_NEW_FS_PROG_DATA/

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoi965: Port Gen6+ DEPTH_STENCIL state to genxml.
Kenneth Graunke [Wed, 8 Mar 2017 05:54:24 +0000 (21:54 -0800)]
i965: Port Gen6+ DEPTH_STENCIL state to genxml.

This emits 3DSTATE_WM_DEPTH_STENCIL on Gen8+ or DEPTH_STENCIL_STATE
(and the relevant pointer packets) on Gen6-7.5 from a single function.

v3:
   - Watch for BRW_NEW_BATCH too on gen < 8 (Ken)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>