Commit Graph

84630 Commits

Author SHA1 Message Date
Jason Ekstrand 71dc2e0106 i965/blorp: Make blorp_addres::buffer a void*
The Vulkan driver doesn't use libdrm so we don't want to bake that in.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2016-08-29 12:17:34 -07:00
Jason Ekstrand 2191f5cb7e i965/blorp: Get rid of brw_context
This commit switches all of blorp from taking a brw_context to taking a
blorp_context and, where useful, a void *batch.  In the GL driver, we only
have one active batch at a time so the brw_context *is* the batch but in
Vulkan, batch will point to the anv_cmd_buffer in which we are building
instructions.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2016-08-29 12:17:34 -07:00
Jason Ekstrand 99b9e9b86e i965/blorp: Take a blorp_context in compile_nir_shader
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2016-08-29 12:17:34 -07:00
Jason Ekstrand a818a32244 i965/meta_util: Take an isl_device in get_fast_clear_rect
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2016-08-29 12:17:34 -07:00
Jason Ekstrand bc159ff0f7 i965/blorp: Add an "exec" function pointer to blorp_context
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2016-08-29 12:17:34 -07:00
Jason Ekstrand cea360a708 i965/blorp: Remove some i965-isms from genX_blorp_exec.h
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2016-08-29 12:17:34 -07:00
Jason Ekstrand cf14b52478 i965/blorp: Move the guts of brw_blorp_exec into genX_blorp_exec.c
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2016-08-29 12:17:34 -07:00
Jason Ekstrand 28ae664e3b i965/blorp: Pull the guts of blorp_exec into a driver-agnostic header
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2016-08-29 12:17:34 -07:00
Jason Ekstrand 9a842c61fe i965/blorp/exec: Refactor to use a new blorp_batch struct
This gets rid of brw_context throughout the core of the state setup code.
Instead, it is replaced with blorp_batch which contains a pointer to the
blorp_context and a void* that the driver can use for its own blorp data.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2016-08-29 12:17:34 -07:00
Jason Ekstrand 4e7bddf8a3 i965/blorp: Add a helper for allocating binding tables and surface states
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2016-08-29 12:17:34 -07:00
Jason Ekstrand 8a39069dfe i965/blorp: Use BT_INDEX enums for setting up the binding table
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2016-08-29 12:17:34 -07:00
Jason Ekstrand 1367af159e i965/blorp: Shorten binding table index enum names
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2016-08-29 12:17:34 -07:00
Jason Ekstrand da2a078deb i965/blorp/genX: Add a blorp_surface_reloc helper
Previously, we passed the buffer address (as per the latest offset from the
kernel) to ISL to use when it filled out the surface state.  We then called
drm_intel_bo_emit_reloc() to add the relocation to the list.  The newly
added blorp_surface_reloc helper adds the relocation to the list and then
writes the buffer address directly into the surface state.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2016-08-29 12:17:34 -07:00
Jason Ekstrand ac08bc8ac2 i965/blorp: Use blorp_address in brw_blorp_surface instead of bo+offset
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2016-08-29 12:17:34 -07:00
Jason Ekstrand 33cc1f6bb4 i965/blorp: Pull emit_surface_state into genX_blorp_exec.c
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2016-08-29 12:17:34 -07:00
Jason Ekstrand 6d2f8f8f5f i965/blorp: Add driver mocs settings to the context
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2016-08-29 12:17:34 -07:00
Jason Ekstrand 9c380b639f i965/blorp/genX: Move emit_urb_config into another helper
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2016-08-29 12:17:34 -07:00
Jason Ekstrand 28991c9601 i965/blorp: Use gen6_upload_urb
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2016-08-29 12:17:34 -07:00
Jason Ekstrand 7ecbb9bada i965/gen6: Refactor gen6_upload_urb
This splits it into two functions very similar to gen7_upload_urb.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2016-08-29 12:17:34 -07:00
Jason Ekstrand 3e4b43d11d i965/blorp/genX: Pull emit_3dstate_multisample into a helper
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2016-08-29 12:17:34 -07:00
Jason Ekstrand becd434d14 i965/blorp/genX: Add helpers for allocating various bits of state
This pulls most of the brw-specific bits into helpers with generic names.
Later, those will become the driver hooks for generic code.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2016-08-29 12:17:34 -07:00
Jason Ekstrand 600446ccc7 i965/blorp: Expose the shader cache through function pointers
This sanitizes blorp's access to the i965 driver's shader cache by patching
it through the blorp_context.  When we start using blorp in Vulkan, we will
simply have to implement such a caching interface in the Vulkan driver.

Note: In my first attempt at this, I simplified it down to a single
upload_shader entrypoint and implemented the caching inside of blorp.  This
doesn't work, however, because the i965 driver will, on occation, dump its
entire cache and start over.  When this happens, blorp needs to be able to
recompile its shaders and re-upload them.  It's easiest to just expose the
caching interface.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2016-08-29 12:17:34 -07:00
Jason Ekstrand a14d1b63ce i965/blorp: Add a blorp_context struct and init/finish funcs
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2016-08-29 12:17:34 -07:00
Mauro Rossi cd18bbeef3 android: intel: Flatten the makefile structure
Android porting of commit bebc1a1 "intel: Flatten the makefile structure"

Automake approach was followed, by moving makefiles a level up,
naming them Android.genxml.mk and Android.isl.mk,
performing the necessary adjustments to the paths,
adding src/intel/Android.mk and fixing mesa top level makefile.

Acked-by: Jason Ekstrand <jason@jlekstrand.net>
2016-08-29 12:17:34 -07:00
Jan Vesely 083746bc48 clover: Use device cap to query pointer size instead of hardcoded 32bits
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97513
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2016-08-29 14:40:15 -04:00
Jan Vesely c7af84968d gallium: add cap to export device pointer size
v2: document the new cap
v3: fix 80 char limit in screen.rst

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
2016-08-29 14:40:15 -04:00
Brian Paul f5602c27ec svga: s/unsigned/enum pipe_shader_type/
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2016-08-29 12:40:45 -06:00
Jordan Justen 5e76baa2ad i965/hsw: Enable ARB_ES3_1_compatibility extension
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
2016-08-29 11:23:08 -07:00
Rhys Kidd b1b7e921f8 r600g: Clean up defined magic numbers for TGSI opcodes
Small code clean up that removes magic numbers where a TGSI
opcode has been defined.

No functional change expected as each opcode is unsupported on
the respective hardware.

Signed-off-by: Rhys Kidd <rhyskidd@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: James Harvey <lothmordor@gmail.com>
2016-08-29 11:03:20 -07:00
Rhys Kidd d4cb3ee95c r600g: Avoid duplicated initialization of TGSI_OPCODE_DFMA
As reported by Clang, TGSI_OPCODE_DFMA (defined magic number 118) is
currently initialized twice for Cayman and Evergreen.

When Jan Vesely added double precision FMA opcode it did make sense
to locate it immediately after TGSI_OPCODE_DMAD, although this is
out of order.

This change cleans up the prior magic number definition and ensures
any later reordering of this struct will not create problems.

Prior change was:

  commit 015e2e0fce
  Author: Jan Vesely <jan.vesely@rutgers.edu>
  Date:   Sat Jul 2 16:14:54 2016 -0400

      r600g: Add double precision FMA ops

      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96782
      Fixes: 54c4d525da ("r600g: Enable FMA on chips that support it")

      Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
      Tested-by: James Harvey <lothmordor@gmail.com>
      Signed-off-by: Marek Olšák <marek.olsak@amd.com>

Signed-off-by: Rhys Kidd <rhyskidd@gmail.com>
Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: James Harvey <lothmordor@gmail.com>
2016-08-29 11:03:20 -07:00
Rhys Kidd 8ba1fd339c i915g: Fix typo in i915_translate_instruction()
Noticed this error in a debug message whilst reviewing
https://bugs.freedesktop.org/show_bug.cgi?id=97477

This patch doesn't go towards fixing that bug, but at
least may clarify future debug output.

Signed-off-by: Rhys Kidd <rhyskidd@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2016-08-29 11:03:20 -07:00
Eric Anholt 60bed14d0f vc4: Handle discards while in control flow.
I missed this while adding loop support because the discard test inside a
loop was crashing before, anyway.  Fixes piglit glsl-fs-discard-04.
2016-08-29 11:03:11 -07:00
Eric Anholt b9a74fbec7 vc4: Mark when we add discards while lowering blend state. 2016-08-29 10:57:04 -07:00
Eric Anholt a99d70d105 nir: Update shader info when adding discards
vc4 is about to start using the shader info field to set up discard
handling.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-08-29 10:56:59 -07:00
Tim Rowley fa8f87132a swr: [rasterier core] fix GetRasterizerFunc selection
Only rasterize scissor edges if one or more scissor/viewport
rects are not hottile aligned.

Signed-off-by: Tim Rowley <timothy.o.rowley@intel.com>
2016-08-29 12:42:36 -05:00
Tim Rowley 8e41a65fc5 swr: [rasterizer core] whitespace cleanup
Signed-off-by: Tim Rowley <timothy.o.rowley@intel.com>
2016-08-29 12:42:30 -05:00
Tim Rowley cc7f655177 swr: [rasterizer jitter] reimplement SCATTERPS
Implement SCATTERPS as a dynamic loop based on mask set bits
instead of a static compile time loop.

Signed-off-by: Tim Rowley <timothy.o.rowley@intel.com>
2016-08-29 12:42:23 -05:00
Tim Rowley c7e21183a1 swr: [rasterizer core] upper left rule for scissors
Fixes upper left rule for scissors and viewport/scissor macrotile alignment.

Signed-off-by: Tim Rowley <timothy.o.rowley@intel.com>
2016-08-29 12:42:15 -05:00
Tim Rowley e54df2c7e4 swr: [rasterizer scripts] undef DEFINE_KNOB after usage
Signed-off-by: Tim Rowley <timothy.o.rowley@intel.com>
2016-08-29 12:42:10 -05:00
Tim Rowley a4efbd14d3 swr: [rasterizer core] minor cleanup to thread initialization
Signed-off-by: Tim Rowley <timothy.o.rowley@intel.com>
2016-08-29 12:42:04 -05:00
Tim Rowley 7472a8ee75 swr: [rasterizer core] remove KNOB_MAX_THREADS
Use dynamic memory allocation for per-thread data

Signed-off-by: Tim Rowley <timothy.o.rowley@intel.com>
2016-08-29 12:41:58 -05:00
Tim Rowley 9e4a482d46 swr: [rasterizer core] track guardbands per viewport rect
Signed-off-by: Tim Rowley <timothy.o.rowley@intel.com>
2016-08-29 12:41:51 -05:00
Tim Rowley b473bec878 swr: [rasterizer core] per-primitive viewports/scissors
- use per-primitive viewports throughout the pipeline.
- track whether all available scissor rects are tile aligned.
  Causes failures, so not taken into account when choosing rasterizer yet.

Signed-off-by: Tim Rowley <timothy.o.rowley@intel.com>
2016-08-29 12:41:16 -05:00
Tom Stellard 63ed11cde9 radeonsi: Don't use global variables for tess lds
We were allocating global variables for the maximum LDS size
which made the compiler think we were using all of LDS, which
isn't the case.

Reviewed-By: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-08-29 16:36:46 +00:00
Roland Scheidegger f48ccb8c07 softpipe: (trivial) honor render_condition_enabled for clear_rt/clear_ds 2016-08-29 18:15:08 +02:00
Roland Scheidegger c5d7624e1d llvmpipe: (trivial) honor render_condition_enabled for clear_rt/clear_ds 2016-08-29 18:14:49 +02:00
Kai Wasserbäch 4c53267b8f gallium: Use enum pipe_shader_type in set_shader_images()
Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2016-08-29 09:07:37 -06:00
Kai Wasserbäch 15fe288dea gallium: Use enum pipe_shader_type in set_shader_buffers()
Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2016-08-29 09:07:33 -06:00
Kai Wasserbäch 532db3b788 gallium: Use enum pipe_shader_type in set_sampler_views()
Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2016-08-29 09:07:25 -06:00
Kai Wasserbäch 7413625ad3 gallium: Use enum pipe_shader_type in bind_sampler_states() (v2)
v1 → v2:
 - Fixed indentation (noted by Brian Paul)
 - Removed second assert from nouveau's switch statements (suggested by
   Brian Paul)

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2016-08-29 08:45:48 -06:00