mesa.git
8 years agoanv/pipeline: Set StencilBufferWriteEnable from the pipeline
Jason Ekstrand [Fri, 4 Mar 2016 18:45:24 +0000 (10:45 -0800)]
anv/pipeline: Set StencilBufferWriteEnable from the pipeline

The hardware docs say that StencilBufferWriteEnable should only be set if
StencilTestEnable is set.  It seems reasonable to set them together.

8 years agoanv/pipeline: More competent gen8 clipping
Jason Ekstrand [Tue, 1 Mar 2016 21:39:04 +0000 (13:39 -0800)]
anv/pipeline: More competent gen8 clipping

8 years agoanv/pipeline: Use the right provoking vertex for triangle fans
Jason Ekstrand [Fri, 4 Mar 2016 08:02:18 +0000 (00:02 -0800)]
anv/pipeline: Use the right provoking vertex for triangle fans

8 years agoanv/pipeline: Respect pRasterizationState->depthBiasEnable
Jason Ekstrand [Fri, 4 Mar 2016 08:01:25 +0000 (00:01 -0800)]
anv/pipeline: Respect pRasterizationState->depthBiasEnable

8 years agoanv: Fix backwards shadow comparisons
Kenneth Graunke [Fri, 4 Mar 2016 00:43:49 +0000 (16:43 -0800)]
anv: Fix backwards shadow comparisons

sample_c is backwards from what GL and Vulkan expect.

See intel_state.c in i965.

v2: Drop unused vk_to_gen_compare_op.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agohack to make dota 2 menus work
Kenneth Graunke [Fri, 4 Mar 2016 00:21:09 +0000 (16:21 -0800)]
hack to make dota 2 menus work

8 years agoisl/surface_state: Set L2 bypass disable for certain BC* formats
Jason Ekstrand [Fri, 4 Mar 2016 00:15:54 +0000 (16:15 -0800)]
isl/surface_state: Set L2 bypass disable for certain BC* formats

8 years agoanv: Compile shader stages in pipeline order.
Kenneth Graunke [Wed, 24 Feb 2016 23:41:24 +0000 (15:41 -0800)]
anv: Compile shader stages in pipeline order.

Instead of the arbitrary order modules might be specified in.

Acked-by: Jason Ekstrand <jason.ekstrand@intel.com>
8 years agoanv/meta: Delete unused functions
Nanley Chery [Mon, 29 Feb 2016 22:37:48 +0000 (14:37 -0800)]
anv/meta: Delete unused functions

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
8 years agoanv/meta: Use blitter API for state-handling in Buffer Update/Copy
Nanley Chery [Wed, 2 Mar 2016 22:33:51 +0000 (14:33 -0800)]
anv/meta: Use blitter API for state-handling in Buffer Update/Copy

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
8 years agoanv/meta: Use blitter API in do_buffer_copy()
Nanley Chery [Sun, 28 Feb 2016 01:11:55 +0000 (17:11 -0800)]
anv/meta: Use blitter API in do_buffer_copy()

v2: Keep pitch in units of bytes (Jason)

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
8 years agoanv/meta: Use blitter API in anv_CmdCopyImage()
Nanley Chery [Mon, 29 Feb 2016 20:19:51 +0000 (12:19 -0800)]
anv/meta: Use blitter API in anv_CmdCopyImage()

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
8 years agoanv/meta: Use blitter API for copies between Images and Buffers
Nanley Chery [Sun, 28 Feb 2016 01:11:55 +0000 (17:11 -0800)]
anv/meta: Use blitter API for copies between Images and Buffers

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
8 years agoanv/meta: Add function which copies between Buffers and Images
Nanley Chery [Mon, 29 Feb 2016 22:28:25 +0000 (14:28 -0800)]
anv/meta: Add function which copies between Buffers and Images

v2: Keep pitch in units of bytes (Jason)

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
8 years agoanv/meta: Add function to create anv_meta_blit2d_surf from anv_image
Nanley Chery [Wed, 2 Mar 2016 07:15:35 +0000 (23:15 -0800)]
anv/meta: Add function to create anv_meta_blit2d_surf from anv_image

v2: Keep pitch in units of bytes (Jason)

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
8 years agoanv/meta: Implement the blitter API functions
Nanley Chery [Sat, 27 Feb 2016 20:26:21 +0000 (12:26 -0800)]
anv/meta: Implement the blitter API functions

Most of the code in anv_meta_blit2d() is borrowed from do_buffer_copy().

Create an image and image view for each rectangle.
Note: For tiled RGB images, ISL will align the image's row_pitch up to
the nearest tile width.

v2 (Jason):
    Keep pitch in units of bytes
    Make src_format and dst_format variables
    s/dest/dst/ in every usage
v3: Fix dst_image width

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
8 years agoanv/meta: Modify blitter API fields
Nanley Chery [Thu, 25 Feb 2016 23:21:12 +0000 (15:21 -0800)]
anv/meta: Modify blitter API fields

Some fields are unnecessary. The variables "pitch" and "bs" are used
for consistency with ISL.

v2: Keep pitch in units of bytes (Jason)

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
8 years agoanv/meta: Add the beginnings of a blitter API
Jason Ekstrand [Thu, 31 Dec 2015 23:37:54 +0000 (15:37 -0800)]
anv/meta: Add the beginnings of a blitter API

This API is designed to be an abstraction that sits between the VkCmdCopy
commands and the hardware.  The idea is that it is simple enough that it
*should* be implementable using the blitter but with enough extra data that
we can implement it with the 3-D pipeline efficiently.  One design
objective is to allow the user to supply enough information that we can
handle most blit operations with a single draw call even if they require
copying multiple rectangles.

8 years agoanv/meta: Remove redundancies in do_buffer_copy()
Nanley Chery [Sat, 27 Feb 2016 21:29:04 +0000 (13:29 -0800)]
anv/meta: Remove redundancies in do_buffer_copy()

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
8 years agoanv/meta: Replace copy_format w/ block size in do_buffer_copy()
Nanley Chery [Sat, 27 Feb 2016 22:25:00 +0000 (14:25 -0800)]
anv/meta: Replace copy_format w/ block size in do_buffer_copy()

This is a preparatory commit that will simplify the future usage of
this function.

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
8 years agoanv/meta: Add missing command to exit meta in anv_CmdUpdateBuffer()
Nanley Chery [Wed, 2 Mar 2016 22:27:17 +0000 (14:27 -0800)]
anv/meta: Add missing command to exit meta in anv_CmdUpdateBuffer()

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
8 years agoanv/image: Create a linear image when requested
Nanley Chery [Wed, 2 Mar 2016 17:44:48 +0000 (09:44 -0800)]
anv/image: Create a linear image when requested

If a linear image is requested, the only possible result should be a
linearly-tiled surface.

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
8 years agoisl: Don't filter tiling flags if a specific tiling bit is set
Nanley Chery [Wed, 2 Mar 2016 01:32:14 +0000 (17:32 -0800)]
isl: Don't filter tiling flags if a specific tiling bit is set

If a specific bit is set, the intention to create a surface with a
specific tiling format should be respected.

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
8 years agoisl: Add function to get intratile offsets from x/y offsets
Nanley Chery [Fri, 26 Feb 2016 22:49:51 +0000 (14:49 -0800)]
isl: Add function to get intratile offsets from x/y offsets

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
8 years agoanv/util: Fix vector resizing
Jason Ekstrand [Thu, 3 Mar 2016 16:17:36 +0000 (08:17 -0800)]
anv/util: Fix vector resizing

It wasn't properly handling the fact that wrap-around in the source may not
translate to wrap-around in the destination.  This really needs unit tests.

8 years agoanv/gen7: Use predicated rendering for indirect compute
Jordan Justen [Wed, 2 Mar 2016 09:11:29 +0000 (01:11 -0800)]
anv/gen7: Use predicated rendering for indirect compute

For OpenGL, see commit 9a939ebb47a0d37a6b29e3dbb1b20bdc9538a721.

Fixes:
 * dEQP-VK.compute.indirect_dispatch.upload_buffer.empty_command
 * dEQP-VK.compute.indirect_dispatch.gen_in_compute.empty_command

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoanv: Save batch to local variable for indirect compute
Jordan Justen [Wed, 2 Mar 2016 09:09:16 +0000 (01:09 -0800)]
anv: Save batch to local variable for indirect compute

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoanv: Fix make check
Jason Ekstrand [Wed, 2 Mar 2016 19:31:32 +0000 (11:31 -0800)]
anv: Fix make check

8 years agoisl: Fix make check
Jason Ekstrand [Wed, 2 Mar 2016 19:31:22 +0000 (11:31 -0800)]
isl: Fix make check

8 years agogen8/cmd_buffer: Properly return flushed push constant stages
Jason Ekstrand [Wed, 2 Mar 2016 18:46:13 +0000 (10:46 -0800)]
gen8/cmd_buffer: Properly return flushed push constant stages

This is required on SKL so that we can properly re-emit binding table
pointers commands.

8 years agoanv/meta_blit: Use unorm formats for 8 and 16-bit RGB and RGBA values
Jason Ekstrand [Wed, 2 Mar 2016 01:19:43 +0000 (17:19 -0800)]
anv/meta_blit: Use unorm formats for 8 and 16-bit RGB and RGBA values

While Broadwell is very good about UINT formats, HSW is more restrictive.
Neither R8G8B8_UINT nor R16G16B16_UINT really exist on HSW.  It should be
safe to just use the unorm formats.

8 years agoMerge remote-tracking branch 'origin/master' into vulkan
Kenneth Graunke [Wed, 2 Mar 2016 00:26:09 +0000 (16:26 -0800)]
Merge remote-tracking branch 'origin/master' into vulkan

8 years agogenxml: Make the border color pointer consistent across gens
Jason Ekstrand [Tue, 1 Mar 2016 22:43:05 +0000 (14:43 -0800)]
genxml: Make the border color pointer consistent across gens

8 years agogen7/pipeline: Add competent blending
Jason Ekstrand [Tue, 1 Mar 2016 21:51:50 +0000 (13:51 -0800)]
gen7/pipeline: Add competent blending

This is mostly a copy-and-paste from gen8.  Blending still isn't 100% but
it fixes about 1100 CTS blend tests on HSW.

8 years agoanv: Unify gen7 and gen8 state
Jason Ekstrand [Tue, 1 Mar 2016 19:38:11 +0000 (11:38 -0800)]
anv: Unify gen7 and gen8 state

Now that we've pulled surface state setup into ISL, there's not much to do
here.

8 years agomesa: Remove NV_fragment_program remnants from dlist.c.
Matt Turner [Sat, 27 Feb 2016 23:30:09 +0000 (15:30 -0800)]
mesa: Remove NV_fragment_program remnants from dlist.c.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Brian Paul <brianp@vmware.com>
8 years agomesa: Remove NV_fragment_program_option enable bit.
Matt Turner [Sat, 27 Feb 2016 22:24:58 +0000 (14:24 -0800)]
mesa: Remove NV_fragment_program_option enable bit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Brian Paul <brianp@vmware.com>
8 years agoprogram: Remove NV_fragment_program opcode parsing.
Matt Turner [Sat, 27 Feb 2016 22:05:17 +0000 (14:05 -0800)]
program: Remove NV_fragment_program opcode parsing.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Brian Paul <brianp@vmware.com>
8 years agoprogram: Remove NV_fragment_program scalar suffix parsing.
Matt Turner [Mon, 29 Feb 2016 22:47:43 +0000 (14:47 -0800)]
program: Remove NV_fragment_program scalar suffix parsing.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Brian Paul <brianp@vmware.com>
8 years agoprogram: Remove NV_fragment_program_option parsing support.
Matt Turner [Sat, 27 Feb 2016 22:05:42 +0000 (14:05 -0800)]
program: Remove NV_fragment_program_option parsing support.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Brian Paul <brianp@vmware.com>
8 years agoprogram: Remove NV_fragment_program Abs support.
Matt Turner [Sat, 27 Feb 2016 22:04:30 +0000 (14:04 -0800)]
program: Remove NV_fragment_program Abs support.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Brian Paul <brianp@vmware.com>
8 years agoprogram: Remove incorrect comment about OPCODE_TXD.
Matt Turner [Sat, 27 Feb 2016 21:55:27 +0000 (13:55 -0800)]
program: Remove incorrect comment about OPCODE_TXD.

The table in prog_instruction.h is correct.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Brian Paul <brianp@vmware.com>
8 years agoprogram: Remove OPCODE_TXP_NV.
Matt Turner [Sat, 27 Feb 2016 21:53:50 +0000 (13:53 -0800)]
program: Remove OPCODE_TXP_NV.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Brian Paul <brianp@vmware.com>
8 years agoprogram: Clean up after previous commit.
Matt Turner [Sat, 27 Feb 2016 21:29:32 +0000 (13:29 -0800)]
program: Clean up after previous commit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Brian Paul <brianp@vmware.com>
8 years agoprogram: Remove condition-code and precision support.
Matt Turner [Sat, 27 Feb 2016 19:06:25 +0000 (11:06 -0800)]
program: Remove condition-code and precision support.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Brian Paul <brianp@vmware.com>
8 years agoprogram: Remove OPCODE_KIL_NV.
Matt Turner [Sat, 27 Feb 2016 21:19:50 +0000 (13:19 -0800)]
program: Remove OPCODE_KIL_NV.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Brian Paul <brianp@vmware.com>
8 years agoprogram: Remove RelAddr2 support.
Matt Turner [Sat, 27 Feb 2016 21:44:50 +0000 (13:44 -0800)]
program: Remove RelAddr2 support.

Looks like more never-used crap from the first geometry shader attempt.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Brian Paul <brianp@vmware.com>
8 years agoprogram: Mark table const.
Matt Turner [Sat, 27 Feb 2016 22:15:26 +0000 (14:15 -0800)]
program: Mark table const.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Brian Paul <brianp@vmware.com>
8 years agomesa: Remove EmitCondCodes.
Matt Turner [Sat, 27 Feb 2016 19:23:32 +0000 (11:23 -0800)]
mesa: Remove EmitCondCodes.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Brian Paul <brianp@vmware.com>
8 years agodocs: Remove descriptions of long dead Emit* fields.
Matt Turner [Sat, 27 Feb 2016 19:19:41 +0000 (11:19 -0800)]
docs: Remove descriptions of long dead Emit* fields.

Dead since commit d8a366200 in 2010.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Brian Paul <brianp@vmware.com>
8 years agoglsl: Initialize gl_shader_program::EmptyUniformLocations.
Matt Turner [Sun, 28 Feb 2016 00:38:26 +0000 (16:38 -0800)]
glsl: Initialize gl_shader_program::EmptyUniformLocations.

Commit 65dfb30 added exec_list EmptyUniformLocations, but only
initialized the list if ARB_explicit_uniform_location was enabled,
leading to crashes if the extension was not available.

Cc: "11.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
8 years agoi965/meta: Don't pollute the framebuffer namespace
Ian Romanick [Sat, 14 Nov 2015 01:57:18 +0000 (17:57 -0800)]
i965/meta: Don't pollute the framebuffer namespace

tl;dr: For many types of GL object, we can *NEVER* use the Gen function.

In OpenGL ES (all versions!) and OpenGL compatibility profile,
applications don't have to call Gen functions.  The GL spec is very
clear about how you can mix-and-match generated names and non-generated
names: you can use any name you want for a particular object type until
you call the Gen function for that object type.

Here's the problem scenario:

 - Application calls a meta function that generates a name.  The first
   Gen will probably return 1.

 - Application decides to use the same name for an object of the same
   type without calling Gen.  Many demo programs use names 1, 2, 3,
   etc. without calling Gen.

 - Application calls the meta function again, and the meta function
   replaces the data.  The application's data is lost, and the app
   fails.  Have fun debugging that.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92363
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
8 years agoi965/meta: Use _mesa_bind_framebuffers instead of _mesa_BindFramebuffer
Ian Romanick [Sat, 14 Nov 2015 01:35:30 +0000 (17:35 -0800)]
i965/meta: Use _mesa_bind_framebuffers instead of _mesa_BindFramebuffer

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
8 years agometa: Don't pollute the framebuffer namespace
Ian Romanick [Sat, 14 Nov 2015 00:51:27 +0000 (16:51 -0800)]
meta: Don't pollute the framebuffer namespace

tl;dr: For many types of GL object, we can *NEVER* use the Gen function.

In OpenGL ES (all versions!) and OpenGL compatibility profile,
applications don't have to call Gen functions.  The GL spec is very
clear about how you can mix-and-match generated names and non-generated
names: you can use any name you want for a particular object type until
you call the Gen function for that object type.

Here's the problem scenario:

 - Application calls a meta function that generates a name.  The first
   Gen will probably return 1.

 - Application decides to use the same name for an object of the same
   type without calling Gen.  Many demo programs use names 1, 2, 3,
   etc. without calling Gen.

 - Application calls the meta function again, and the meta function
   replaces the data.  The application's data is lost, and the app
   fails.  Have fun debugging that.

Fixes piglit tests:
    - object-namespace-pollution glGetTexImage-compressed framebuffer
    - object-namespace-pollution glGenerateMipmap framebuffer

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92363
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
8 years agometa/decompress: Track framebuffer using gl_framebuffer instead of GL API object...
Ian Romanick [Sat, 14 Nov 2015 01:21:38 +0000 (17:21 -0800)]
meta/decompress: Track framebuffer using gl_framebuffer instead of GL API object handle

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
8 years agometa/generate_mipmap: Track framebuffer using gl_framebuffer instead of GL API object...
Ian Romanick [Sat, 14 Nov 2015 01:14:00 +0000 (17:14 -0800)]
meta/generate_mipmap: Track framebuffer using gl_framebuffer instead of GL API object handle

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
8 years agometa: Use _mesa_bind_framebuffers instead of _mesa_BindFramebuffer
Ian Romanick [Fri, 13 Nov 2015 19:12:57 +0000 (11:12 -0800)]
meta: Use _mesa_bind_framebuffers instead of _mesa_BindFramebuffer

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
8 years agometa: Use _mesa_CreateFramebuffers instead of _mesa_GenFramebuffers
Ian Romanick [Fri, 13 Nov 2015 19:06:51 +0000 (11:06 -0800)]
meta: Use _mesa_CreateFramebuffers instead of _mesa_GenFramebuffers

This enables later patches that will stop calling _mesa_GenFramebuffers
or _mesa_CreateFramebuffers which pollute the framebuffer namespace.

For framebuffers, the Bind call is still necessary.

sed -i -e 's/_mesa_GenFramebuffers/_mesa_CreateFramebuffers/' \
    src/mesa/drivers/common/*.c

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
8 years agoi965/meta: Use _mesa_CreateFramebuffers instead of _mesa_GenFramebuffers
Ian Romanick [Fri, 13 Nov 2015 19:04:25 +0000 (11:04 -0800)]
i965/meta: Use _mesa_CreateFramebuffers instead of _mesa_GenFramebuffers

This enables later patches that will stop calling _mesa_GenFramebuffers
or _mesa_CreateFramebuffers which pollute the framebuffer namespace.

For framebuffers, the Bind call is still necessary.

sed -i -e 's/_mesa_GenFramebuffers/_mesa_CreateFramebuffers/' \
    src/mesa/drivers/dri/i965/*.c

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
8 years agometa: Save and restore the framebuffer using gl_framebuffer instead of GL API object...
Ian Romanick [Fri, 13 Nov 2015 18:51:01 +0000 (10:51 -0800)]
meta: Save and restore the framebuffer using gl_framebuffer instead of GL API object handle

Some meta operations can be called recursively.  Future changes (the
"Don't pollute the ... namespace" changes) will cause objects with
invalid names to be used.  If a nested meta operation tries to restore
an object named 0xDEADBEEF, it will fail.

This also fixes another latent bug in meta.  In a multithreaded,
multicontext application, one thread can delete an object that is bound
in another thread.  That object continues to exist until it is unbound
(i.e., its refcount drops to zero).  Meta unbinds objects all over the
place.  As a result, the rebind in _mesa_meta_end could fail because the
object vanished!

See https://bugs.freedesktop.org/show_bug.cgi?id=92363#c8.

Using _mesa_reference_<object type> to save and restore the objects
prevents the refcount from going to zero.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92363
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
8 years agomesa: Refactor bind_framebuffer to make _mesa_bind_framebuffers
Ian Romanick [Fri, 13 Nov 2015 18:46:40 +0000 (10:46 -0800)]
mesa: Refactor bind_framebuffer to make _mesa_bind_framebuffers

Fixing dd_function_table::BindFramebuffer will come later because that
change is probably not suitable for stable.

v2: Fix whitespace issue noticed by Topi.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
8 years agometa: Use _mesa_check_framebuffer_status instead of _mesa_CheckFramebufferStatus
Ian Romanick [Fri, 13 Nov 2015 01:18:53 +0000 (17:18 -0800)]
meta: Use _mesa_check_framebuffer_status instead of _mesa_CheckFramebufferStatus

sed -i -e 's/_mesa_CheckFramebufferStatus(GL_DRAW_FRAMEBUFFER/_mesa_check_framebuffer_status(ctx, ctx->DrawBuffer/' \
    -e 's/_mesa_CheckFramebufferStatus(GL_FRAMEBUFFER[^)]*/_mesa_check_framebuffer_status(ctx, ctx->DrawBuffer/' \
    -e 's/_mesa_CheckFramebufferStatus(GL_READ_FRAMEBUFFER/_mesa_check_framebuffer_status(ctx, ctx->ReadBuffer/' \
    $(grep -rl _mesa_CheckFramebufferStatus src/mesa/drivers)

The second expression catches both GL_FRAMEBUFFER and GL_FRAMEBUFFER_EXT.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
8 years agometa: Obvious refactor of _mesa_meta_framebuffer_texture_image
Ian Romanick [Fri, 13 Nov 2015 01:11:30 +0000 (17:11 -0800)]
meta: Obvious refactor of _mesa_meta_framebuffer_texture_image

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
8 years agometa: Convert _mesa_meta_bind_fbo_image to take a gl_framebuffer instead of a GL...
Ian Romanick [Fri, 13 Nov 2015 01:05:27 +0000 (17:05 -0800)]
meta: Convert _mesa_meta_bind_fbo_image to take a gl_framebuffer instead of a GL API handle

Also change the name of the function to
_mesa_meta_framebuffer_texture_image.  The function is basically a
wrapper around _mesa_framebuffer_texture (which is used to implement
glFramebufferTexture1D and friends), so it makes sense for it's name to
be similar to that.

The next patch will clean _mesa_meta_framebuffer_texture_image up
considerably.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
8 years agoanv/cmd_buffer: Look at both sides for stencil enable
Jason Ekstrand [Tue, 1 Mar 2016 18:59:21 +0000 (10:59 -0800)]
anv/cmd_buffer: Look at both sides for stencil enable

Now it's all consistent with gen9

8 years agoanv/cmd_buffer: Clean up stencil state setup on gen7
Jason Ekstrand [Tue, 1 Mar 2016 19:02:12 +0000 (11:02 -0800)]
anv/cmd_buffer: Clean up stencil state setup on gen7

8 years agoanv/cmd_buffer: Clean up stencil state setup on gen8
Jason Ekstrand [Tue, 1 Mar 2016 18:56:46 +0000 (10:56 -0800)]
anv/cmd_buffer: Clean up stencil state setup on gen8

8 years agoanv: Add in image->offset when setting up depth buffer
Kristian Høgsberg Kristensen [Tue, 1 Mar 2016 17:17:16 +0000 (09:17 -0800)]
anv: Add in image->offset when setting up depth buffer

Fix from Neil Roberts.

https://bugs.freedesktop.org/show_bug.cgi?id=94348

8 years agoanv/pipeline: Pull 3DSTATE_SBE into a shared helper
Jason Ekstrand [Tue, 1 Mar 2016 01:27:11 +0000 (17:27 -0800)]
anv/pipeline: Pull 3DSTATE_SBE into a shared helper

8 years agovirgl: add support for passing render condition flags to host.
Dave Airlie [Tue, 1 Mar 2016 05:48:44 +0000 (15:48 +1000)]
virgl: add support for passing render condition flags to host.

This just passes the extra blit info to fix the render condition
tests.

Cc: "11.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agogenxml: Break output detail of 3DSTATE_SBE on gen7 into a struct
Jason Ekstrand [Tue, 1 Mar 2016 00:47:39 +0000 (16:47 -0800)]
genxml: Break output detail of 3DSTATE_SBE on gen7 into a struct

This makes it work like 3DSTATE_SBE_SWIZ on gen8+ which is much more
convenient.

8 years agoi965: Push most TES inputs in vec4 mode.
Kenneth Graunke [Wed, 17 Feb 2016 08:37:04 +0000 (00:37 -0800)]
i965: Push most TES inputs in vec4 mode.

(This is commit 4a1c8a3037cd29938b2a6e2c680c341e9903cfbe for vec4 mode.)

Using the push model for inputs is much more efficient than pulling
inputs - the hardware can simply copy a large chunk into URB registers
at thread creation time, rather than having the thread send messages to
request data from the L3 cache.  Unfortunately, it's possible to have
more TES inputs than fit in registers, so we have to fall back to the
pull model in some cases.

However, it turns out that most tessellation evaluation shaders are
fairly simple, and don't use many inputs.  An arbitrary cut-off of
24 vec4 slots (12 registers) should suffice.  (I chose this instead of
the 32 vec4 slots used in the scalar backend to avoid regressing a few
Piglit tests due to the vec4 register allocator being too stupid to
figure out what to do.  We probably ought to fix that, but it's a
separate issue.)

Improves performance in GPUTest's tessmark_x64 microbenchmark by
41.5394% +/- 0.288519% (n = 115) at 1024x768 on my Clevo W740SU
(with Iris Pro 5200).

Improves performance in Synmark's Gl40TerrainFlyTess microbenchmark by
38.3576% +/- 0.759748% (n = 42).

v2: Simplify abs/negate handling, as requested by Matt.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
8 years agor600g: remove support for DRM < 2.12.0
Marek Olšák [Tue, 23 Feb 2016 22:32:44 +0000 (23:32 +0100)]
r600g: remove support for DRM < 2.12.0

8 years agor300g: remove support for DRM < 2.12.0
Marek Olšák [Tue, 23 Feb 2016 22:32:44 +0000 (23:32 +0100)]
r300g: remove support for DRM < 2.12.0

8 years agowinsys/radeon: drop support for DRM 2.12.0 (kernel < 3.2)
Marek Olšák [Tue, 23 Feb 2016 22:24:12 +0000 (23:24 +0100)]
winsys/radeon: drop support for DRM 2.12.0 (kernel < 3.2)

in order to make some winsys interface changes easier

This distros should use new DRM if they want to use new Mesa:
  Distro    kernel  mesa    eol
  SLES 10   2.6.16  6.4.2   2016-07
  SLED 11   3.0     9.0.3   2022-03
  RHEL 5    2.6.18  6.5.1   2017-03
  RHEL 6    2.6.32  10.4.3  2020-11
  Debian 6  2.6.32  7.7.1   2016-02

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
8 years agoradeonsi: also dump shaders on a VM fault
Marek Olšák [Thu, 25 Feb 2016 16:54:01 +0000 (17:54 +0100)]
radeonsi: also dump shaders on a VM fault

Reviewed-by: Christian König <christian.koenig@amd.com>
8 years agoradeonsi: dump full shader disassemblies into ddebug logs
Marek Olšák [Thu, 25 Feb 2016 16:12:15 +0000 (17:12 +0100)]
radeonsi: dump full shader disassemblies into ddebug logs

including prolog and epilog disassemblies

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
8 years agoradeonsi: allow dumping shader disassemblies to a file
Marek Olšák [Thu, 25 Feb 2016 16:11:20 +0000 (17:11 +0100)]
radeonsi: allow dumping shader disassemblies to a file

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
8 years agoradeonsi: use re-Z
Marek Olšák [Sun, 21 Feb 2016 23:40:04 +0000 (00:40 +0100)]
radeonsi: use re-Z

This can increase perf for shaders that kill pixels (kill, alpha-test,
alpha-to-coverage).

v2: add comments

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
8 years agotgsi/scan: count memory instructions
Marek Olšák [Sun, 21 Feb 2016 23:23:10 +0000 (00:23 +0100)]
tgsi/scan: count memory instructions

for radeonsi

Reviewed-by: Brian Paul <brianp@vmware.com>
8 years agoanv/cmd_buffer: Dirty push constants when changing pipelines.
Jason Ekstrand [Mon, 29 Feb 2016 22:27:34 +0000 (14:27 -0800)]
anv/cmd_buffer: Dirty push constants when changing pipelines.

8 years agoanv/cmd_buffer: Re-emit push constants packets for all stages
Jason Ekstrand [Mon, 29 Feb 2016 22:27:10 +0000 (14:27 -0800)]
anv/cmd_buffer: Re-emit push constants packets for all stages

8 years agoanv/pipeline: Follow push constant alignment restrictions on BDW+ and HSW gt3
Jason Ekstrand [Mon, 29 Feb 2016 22:13:56 +0000 (14:13 -0800)]
anv/pipeline: Follow push constant alignment restrictions on BDW+ and HSW gt3

8 years agoanv/pipeline: Avoid a division by zero
Jason Ekstrand [Mon, 29 Feb 2016 22:13:07 +0000 (14:13 -0800)]
anv/pipeline: Avoid a division by zero

8 years agoanv/pipeline: Use dynamic checks for max push constants
Jason Ekstrand [Sat, 27 Feb 2016 06:47:59 +0000 (22:47 -0800)]
anv/pipeline: Use dynamic checks for max push constants

The GEN_GEN macros aren't available in anv_pipeline since it only gets
compiled once for the whold driver.

8 years agomesa/fbobject: propogate Layered when reusing attachments.
Dave Airlie [Mon, 29 Feb 2016 07:16:10 +0000 (17:16 +1000)]
mesa/fbobject: propogate Layered when reusing attachments.

When reusing a depth attachment as a stencil, we need to propogate
the layered bit, otherwise we fail to complete the framebuffer.

discovered running ./bin/fbo-depth-array depth-layered-clear
on virgl on haswell.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agoisl/surface_state: Fix array spacing on Gen7
Nanley Chery [Mon, 29 Feb 2016 19:24:34 +0000 (11:24 -0800)]
isl/surface_state: Fix array spacing on Gen7

v2: Don't cast the enum to a boolean (Jason)

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
8 years agoanv: Don't advertise pipelineStatisticsQuery
Kristian Høgsberg Kristensen [Mon, 29 Feb 2016 18:55:39 +0000 (10:55 -0800)]
anv: Don't advertise pipelineStatisticsQuery

We don't support that just yet.

Reported-by: Jacek Konieczny <jajcus@jajcus.net>
8 years agost/nine: Fix second Multithreading issue with MANAGED buffers
Axel Davy [Sat, 27 Feb 2016 10:02:21 +0000 (11:02 +0100)]
st/nine: Fix second Multithreading issue with MANAGED buffers

Here is another threading issue with MANAGED buffers:

Thread 1: buffer creation
Thread 1: buffer lock
Thread 2: Draw call
Thread 1: writes data
Thread 1: Unlock

Without this patch, the buffer is initially dirty
and in the list of things to upload after its creation.
The draw call will then upload the data and unset the dirty flag,
and the Unlock won't trigger a second upload.

Fixes regression introduced by cc0114f30b587a10766ec212afb3ad356099ef23:
"st/nine: Implement Managed vertex/index buffers"

Cc: "11.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
8 years agost/nine: Fix Multithreading issue with MANAGED buffers
Axel Davy [Thu, 25 Feb 2016 18:07:37 +0000 (19:07 +0100)]
st/nine: Fix Multithreading issue with MANAGED buffers

d3d calls are protected by mutexes, however if app is doing in
two threads:

Thread 1: buffer Lock
Thread 2: Draw call
Thread 1: writes data
Thread 1: Unlock

Then before this patch, the Draw call would begin to upload
the buffer.

Solves this by moving the moment we add the buffer to the queue
of things to upload (We move it from Lock time to Unlock time).

Cc: "11.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
8 years agost/nine: Handle READONLY for buffer MANAGED pool
Axel Davy [Wed, 24 Feb 2016 22:44:40 +0000 (23:44 +0100)]
st/nine: Handle READONLY for buffer MANAGED pool

READONLY won't trigger an upload.

Cc: "11.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
8 years agost/nine: Use Position input helper for ps3 declared inputs
Axel Davy [Sun, 21 Feb 2016 15:35:31 +0000 (16:35 +0100)]
st/nine: Use Position input helper for ps3 declared inputs

When the semantic is Position (which can happen with index 0 only),
use the helper to get Position input.

Cc: "11.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
8 years agost/nine: Introduce helper for Position shader input
Axel Davy [Sun, 21 Feb 2016 15:30:15 +0000 (16:30 +0100)]
st/nine: Introduce helper for Position shader input

Cc: "11.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
8 years agovirtio_gpu: Add virtio 1.0 PCI ID to driver map
Marc-André Lureau [Fri, 12 Feb 2016 21:11:05 +0000 (22:11 +0100)]
virtio_gpu: Add virtio 1.0 PCI ID to driver map

Add the virtio-gpu PCI ID for virtio 1.0 (according to the
specification, "the PCI Device ID is calculated by adding 0x1040 to the
Virtio Device ID")

Support for virtio 1.0 was added in qemu 2.4 (same time virtio-gpu
landed).

Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
8 years agost/clover: Add libelf cflags to the build
Koop Mast [Mon, 28 Dec 2015 19:26:48 +0000 (20:26 +0100)]
st/clover: Add libelf cflags to the build

Otherwise the build will fail, when the library is in a non default
location.

v2 [Emil Velikov]
 - drop the unneeded cflags from targets/opencl.

Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
Fixes: 7f585a6a98d "configure.ac: use pkg-config for libelf"
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93524
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agomesa; add get-extra-pick-list.sh script into bin/
Emil Velikov [Wed, 2 Sep 2015 16:36:22 +0000 (17:36 +0100)]
mesa; add get-extra-pick-list.sh script into bin/

This is a very rudimentary script that checks if any of the applied
cherry-picks have been referenced (fixed?) by another patch. With the
latter either missing the stable tag or hasn't yet been picked.

Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agoautomake: explicitly set distcheck configure flags
Emil Velikov [Thu, 25 Feb 2016 15:48:41 +0000 (15:48 +0000)]
automake: explicitly set distcheck configure flags

Pretty much all of these are enabled by default. Considering the recent
updates (see previous commits) one might as well list most/all of these
here.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoautomake: add more missing options for make distcheck
Emil Velikov [Thu, 25 Feb 2016 15:20:04 +0000 (15:20 +0000)]
automake: add more missing options for make distcheck

Namely - opencl, osmesa (only the gallium flavour as it conflicts with
the classic one), surfaceless egl platform and a couple gallium drivers
(virgl and vc4).

Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoinstall-gallium-links: port changes from install-lib-links
Emil Velikov [Thu, 25 Feb 2016 16:53:06 +0000 (16:53 +0000)]
install-gallium-links: port changes from install-lib-links

Namely:
b662d5282f7 mesa: Add clean-local rule to remove .lib links.
5c1aac17adf install-lib-links: don't depend on .libs directory
fece147be53 install-lib-links: remove the .install-lib-links file

With these in place, make distcheck now passes and a race condition has
been avoided.

Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agor600: Make enum alu_op_flags unsigned
Rob Herring [Wed, 24 Feb 2016 18:56:31 +0000 (12:56 -0600)]
r600: Make enum alu_op_flags unsigned

In builds with clang, there are several errors related to the enum
alu_op_flags like this:

src/gallium/drivers/r600/sb/sb_expr.cpp:887:8:
error: case value evaluates to -1610612736, which cannot be narrowed to
type 'unsigned int' [-Wc++11-narrowing]

These are due to the MSB being set in the enum. Fix these errors by
making the enum values unsigned as needed. The flags field that stores
this enum also needs to be unsigned.

Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
Cc: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>