mesa.git
6 years agoAdd more Coffee Lake brand strings
Anuj Phogat [Thu, 5 Apr 2018 21:19:40 +0000 (14:19 -0700)]
Add more Coffee Lake brand strings

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
6 years agoradeonsi: Reorder checks in si_check_render_feedback
Jan Vesely [Thu, 5 Apr 2018 20:34:00 +0000 (16:34 -0400)]
radeonsi: Reorder checks in si_check_render_feedback

si_get_total_colormask accesses NULL pointer on compute shaders
Fixes crashes on clover
Fixes: 0669dca9c00261849cee14d69fdea0a5e323c7f7 ("radeonsi: skip DCC render feedback checking if color writes are disabled")
CC: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
6 years agointel/tools: new intel_sanitize_gpu tool
Kevin Rogovin [Fri, 9 Feb 2018 01:11:25 +0000 (17:11 -0800)]
intel/tools: new intel_sanitize_gpu tool

Adds a new debug tool to pad each GEM BO allocated with (weak)
pseudo-random noise values which are then checked after each
batchbuffer dispatch to the kernel. This can be quite valuable to
find diffucult to track down heisenberg style bugs.

[scott.d.phillips@intel.com: split to separate tool]

v2: (by Scott D Phillips)
    - track gem handles per fd (Kevin)
    - remove handles on GEM_CLOSE (Kevin)
    - ignore prime handles
    - meson & shell script

v3: (by Scott D Phillips)
    - don't track prime bos at all (Kevin)
    - protect the hash table with a mutex (Kevin)
    - hook fds by drm_version.name, not path (Chris Wilson)

Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com>
Reviewed-by: Kevin Rogovin <kevin.rogovin@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
6 years agoprog/nir: Simplify some load/store operations
Jason Ekstrand [Mon, 19 Mar 2018 20:43:35 +0000 (13:43 -0700)]
prog/nir: Simplify some load/store operations

Reviewed-by: Eric Anholt <eric@anholt.net>
6 years agoradeonsi: fix a crash if ps_shader.cso is NULL in si_get_total_colormask
Marek Olšák [Thu, 5 Apr 2018 19:53:52 +0000 (15:53 -0400)]
radeonsi: fix a crash if ps_shader.cso is NULL in si_get_total_colormask

6 years agoradeonsi: remove more R600 references
Marek Olšák [Mon, 2 Apr 2018 02:49:58 +0000 (22:49 -0400)]
radeonsi: remove more R600 references

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: try to fix android
Marek Olšák [Mon, 2 Apr 2018 00:56:07 +0000 (20:56 -0400)]
radeonsi: try to fix android

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: try to fix meson
Marek Olšák [Mon, 2 Apr 2018 00:49:35 +0000 (20:49 -0400)]
radeonsi: try to fix meson

This is not fully tested. Meson can't link LLVM even though automake can.

PATH=/usr/llvm/x86_64-linux-gnu/bin:$PATH meson build/ -Dgallium-va=false \
    -Dplatforms=x11,drm -Dgallium-drivers=radeonsi -Ddri-drivers= \
    -Dgallium-omx=disabled -Dgallium-xvmc=false -Dgles1=false \
    -Dtexture-float=true -Dvulkan-drivers=

src/gallium/auxiliary/libgallium.a(gallivm_lp_bld_misc.cpp.o):
(.data.rel.ro._ZTI26DelegatingJITMemoryManager[_ZTI26DelegatingJITMemoryManager]+0x10):
undefined reference to `typeinfo for llvm::RTDyldMemoryManager'

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: don't build libradeon.la separately
Marek Olšák [Mon, 2 Apr 2018 00:34:40 +0000 (20:34 -0400)]
radeonsi: don't build libradeon.la separately

for better parallelism

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: clean up GET_MAX_VIEWPORT_RANGE definition
Marek Olšák [Sun, 1 Apr 2018 23:58:22 +0000 (19:58 -0400)]
radeonsi: clean up GET_MAX_VIEWPORT_RANGE definition

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: remove r600_common_context
Marek Olšák [Sun, 1 Apr 2018 23:44:25 +0000 (19:44 -0400)]
radeonsi: remove r600_common_context

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: remove r600_pipe_common::screen
Marek Olšák [Sun, 1 Apr 2018 23:03:10 +0000 (19:03 -0400)]
radeonsi: remove r600_pipe_common::screen

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: move r600_buffer_common.c and r600_texture.c into radeonsi
Marek Olšák [Sun, 1 Apr 2018 23:01:32 +0000 (19:01 -0400)]
radeonsi: move r600_buffer_common.c and r600_texture.c into radeonsi

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: move r600_gpu_load.c to si_gpu_load.c
Marek Olšák [Sun, 1 Apr 2018 22:51:44 +0000 (18:51 -0400)]
radeonsi: move r600_gpu_load.c to si_gpu_load.c

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: move r600_query.c/h files to si_query.c/h
Marek Olšák [Sun, 1 Apr 2018 22:47:05 +0000 (18:47 -0400)]
radeonsi: move r600_query.c/h files to si_query.c/h

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: move r600_cs.h contents into si_pipe.h, si_build_pm4.h
Marek Olšák [Sun, 1 Apr 2018 22:42:33 +0000 (18:42 -0400)]
radeonsi: move r600_cs.h contents into si_pipe.h, si_build_pm4.h

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: rename query definitions R600_ -> SI_
Marek Olšák [Sun, 1 Apr 2018 22:32:54 +0000 (18:32 -0400)]
radeonsi: rename query definitions R600_ -> SI_

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: move and rename R600_ERR out of r600_pipe_common.h
Marek Olšák [Sun, 1 Apr 2018 22:30:47 +0000 (18:30 -0400)]
radeonsi: move and rename R600_ERR out of r600_pipe_common.h

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: rename a few R600/r600_ -> SI_/si_
Marek Olšák [Sun, 1 Apr 2018 22:28:20 +0000 (18:28 -0400)]
radeonsi: rename a few R600/r600_ -> SI_/si_

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: move definitions out of r600_pipe_common.h
Marek Olšák [Sun, 1 Apr 2018 22:24:21 +0000 (18:24 -0400)]
radeonsi: move definitions out of r600_pipe_common.h

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: move functions out of and remove r600_pipe_common.c
Marek Olšák [Sun, 1 Apr 2018 22:12:34 +0000 (18:12 -0400)]
radeonsi: move functions out of and remove r600_pipe_common.c

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: rename r600 -> si in some places
Marek Olšák [Sun, 1 Apr 2018 21:52:55 +0000 (17:52 -0400)]
radeonsi: rename r600 -> si in some places

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: use si_context instead of pipe_context in parameters pt3
Marek Olšák [Sun, 1 Apr 2018 21:08:35 +0000 (17:08 -0400)]
radeonsi: use si_context instead of pipe_context in parameters pt3

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: use si_context instead of pipe_context in parameters pt2
Marek Olšák [Sun, 1 Apr 2018 21:08:35 +0000 (17:08 -0400)]
radeonsi: use si_context instead of pipe_context in parameters pt2

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: use si_context instead of pipe_context in parameters pt1
Marek Olšák [Sun, 1 Apr 2018 21:08:35 +0000 (17:08 -0400)]
radeonsi: use si_context instead of pipe_context in parameters pt1

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: pass sctx to si_rebind_buffer and clean up
Marek Olšák [Sun, 1 Apr 2018 21:02:01 +0000 (17:02 -0400)]
radeonsi: pass sctx to si_rebind_buffer and clean up

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: use r600_common_context less pt7
Marek Olšák [Sun, 1 Apr 2018 19:37:11 +0000 (15:37 -0400)]
radeonsi: use r600_common_context less pt7

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: use r600_common_context less pt6
Marek Olšák [Sun, 1 Apr 2018 19:37:11 +0000 (15:37 -0400)]
radeonsi: use r600_common_context less pt6

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: update copyrights
Marek Olšák [Sun, 1 Apr 2018 20:49:48 +0000 (16:49 -0400)]
radeonsi: update copyrights

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: switch radeon_add_to_buffer_list parameter to si_context
Marek Olšák [Sun, 1 Apr 2018 20:40:30 +0000 (16:40 -0400)]
radeonsi: switch radeon_add_to_buffer_list parameter to si_context

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: use r600_common_context less pt5
Marek Olšák [Sun, 1 Apr 2018 19:37:11 +0000 (15:37 -0400)]
radeonsi: use r600_common_context less pt5

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: use r600_common_context less pt4
Marek Olšák [Sun, 1 Apr 2018 19:37:11 +0000 (15:37 -0400)]
radeonsi: use r600_common_context less pt4

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: use r600_common_context less pt3
Marek Olšák [Sun, 1 Apr 2018 19:37:11 +0000 (15:37 -0400)]
radeonsi: use r600_common_context less pt3

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: use r600_common_context less pt2
Marek Olšák [Sun, 1 Apr 2018 19:37:11 +0000 (15:37 -0400)]
radeonsi: use r600_common_context less pt2

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: use r600_common_context less pt1
Marek Olšák [Sun, 1 Apr 2018 19:37:11 +0000 (15:37 -0400)]
radeonsi: use r600_common_context less pt1

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: don't use r600_common_context in si_emit_cache_flush
Marek Olšák [Sun, 1 Apr 2018 19:24:07 +0000 (15:24 -0400)]
radeonsi: don't use r600_common_context in si_emit_cache_flush

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: switch r600_atom::emit parameter to si_context
Marek Olšák [Sun, 1 Apr 2018 19:16:26 +0000 (15:16 -0400)]
radeonsi: switch r600_atom::emit parameter to si_context

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: flatten / remove struct r600_ring
Marek Olšák [Sun, 1 Apr 2018 19:07:58 +0000 (15:07 -0400)]
radeonsi: flatten / remove struct r600_ring

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: remove r600_ring::flush callback
Marek Olšák [Sun, 1 Apr 2018 19:03:23 +0000 (15:03 -0400)]
radeonsi: remove r600_ring::flush callback

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: make radeon_add_to_buffer_list_check_mem be gfx-only
Marek Olšák [Sun, 1 Apr 2018 18:59:44 +0000 (14:59 -0400)]
radeonsi: make radeon_add_to_buffer_list_check_mem be gfx-only

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: add_to_buffer_list functions can return void
Marek Olšák [Sun, 1 Apr 2018 18:52:42 +0000 (14:52 -0400)]
radeonsi: add_to_buffer_list functions can return void

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: move saved_cs functions from r600_pipe_common.c to si_debug.c
Marek Olšák [Sun, 1 Apr 2018 18:46:05 +0000 (14:46 -0400)]
radeonsi: move saved_cs functions from r600_pipe_common.c to si_debug.c

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: move DMA CS functions from r600_pipe_common.c to si_dma_cs.c
Marek Olšák [Sun, 1 Apr 2018 18:40:34 +0000 (14:40 -0400)]
radeonsi: move DMA CS functions from r600_pipe_common.c to si_dma_cs.c

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: move EOP event code from r600_pipe_common.c to si_fence.c
Marek Olšák [Sun, 1 Apr 2018 18:31:02 +0000 (14:31 -0400)]
radeonsi: move EOP event code from r600_pipe_common.c to si_fence.c

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: rename si_hw_context.c -> si_gfx_cs.c
Marek Olšák [Sun, 1 Apr 2018 18:24:53 +0000 (14:24 -0400)]
radeonsi: rename si_hw_context.c -> si_gfx_cs.c

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: move si_destroy_saved_cs to si_debug.c
Marek Olšák [Sun, 1 Apr 2018 18:22:54 +0000 (14:22 -0400)]
radeonsi: move si_destroy_saved_cs to si_debug.c

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: rename si_begin_new_cs -> si_begin_new_gfx_cs
Marek Olšák [Sun, 1 Apr 2018 18:18:17 +0000 (14:18 -0400)]
radeonsi: rename si_begin_new_cs -> si_begin_new_gfx_cs

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: rename si_need_cs_space -> si_need_gfx_cs_space
Marek Olšák [Sun, 1 Apr 2018 18:17:23 +0000 (14:17 -0400)]
radeonsi: rename si_need_cs_space -> si_need_gfx_cs_space

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: remove r600_pipe_common::blit_decompress_depth
Marek Olšák [Sun, 1 Apr 2018 18:15:34 +0000 (14:15 -0400)]
radeonsi: remove r600_pipe_common::blit_decompress_depth

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: remove r600_pipe_common::decompress_dcc
Marek Olšák [Sun, 1 Apr 2018 18:13:22 +0000 (14:13 -0400)]
radeonsi: remove r600_pipe_common::decompress_dcc

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: remove r600_pipe_common::invalidate_buffer
Marek Olšák [Sun, 1 Apr 2018 18:06:06 +0000 (14:06 -0400)]
radeonsi: remove r600_pipe_common::invalidate_buffer

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: remove r600_pipe_common::rebind_buffer
Marek Olšák [Sun, 1 Apr 2018 18:04:04 +0000 (14:04 -0400)]
radeonsi: remove r600_pipe_common::rebind_buffer

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: remove r600_common_context::set_occlusion_query_state
Marek Olšák [Sun, 1 Apr 2018 18:00:14 +0000 (14:00 -0400)]
radeonsi: remove r600_common_context::set_occlusion_query_state

and remove unused old_enable parameter.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: remove r600_pipe_common::save_qbo_state
Marek Olšák [Sun, 1 Apr 2018 17:55:34 +0000 (13:55 -0400)]
radeonsi: remove r600_pipe_common::save_qbo_state

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: remove unused query code
Marek Olšák [Sun, 1 Apr 2018 17:51:09 +0000 (13:51 -0400)]
radeonsi: remove unused query code

The get_size perf counter callback is also inlined and removed.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: use num_cs_dw_queries_suspend
Marek Olšák [Sun, 1 Apr 2018 17:40:41 +0000 (13:40 -0400)]
radeonsi: use num_cs_dw_queries_suspend

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: remove r600_pipe_common::need_gfx_cs_space
Marek Olšák [Sun, 1 Apr 2018 17:32:47 +0000 (13:32 -0400)]
radeonsi: remove r600_pipe_common::need_gfx_cs_space

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: remove r600_pipe_common::set_atom_dirty
Marek Olšák [Sun, 1 Apr 2018 17:30:02 +0000 (13:30 -0400)]
radeonsi: remove r600_pipe_common::set_atom_dirty

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: remove r600_pipe_common::check_vm_faults
Marek Olšák [Sun, 1 Apr 2018 17:29:04 +0000 (13:29 -0400)]
radeonsi: remove r600_pipe_common::check_vm_faults

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: call CS flush functions directly whenever possible
Marek Olšák [Sun, 1 Apr 2018 17:24:43 +0000 (13:24 -0400)]
radeonsi: call CS flush functions directly whenever possible

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agoradeonsi: skip DCC render feedback checking if color writes are disabled
Marek Olšák [Sat, 31 Mar 2018 02:15:52 +0000 (22:15 -0400)]
radeonsi: skip DCC render feedback checking if color writes are disabled

6 years agomeson: fix megadriver symlinking
Dylan Baker [Wed, 4 Apr 2018 17:23:02 +0000 (10:23 -0700)]
meson: fix megadriver symlinking

Which should be relative instead of absolute.

Fixes: f7f1b30f81e842db6057591470ce3cb6d4fb2795
       ("meson: extend install_megadrivers script to handle symmlinking")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105567
Signed-off-by: Dylan Baker <dylan.c.baker@intel.com>
Reviewed-and-Tested-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
6 years agomeson: Set .so version for xa like autotools does
Dylan Baker [Wed, 4 Apr 2018 17:53:16 +0000 (10:53 -0700)]
meson: Set .so version for xa like autotools does

Fixes: 0ba909f0f111824223bc38563d1a6bc73e69c2cc
       ("meson: build gallium xa state tracker")
Signed-off-by: Dylan Baker <dylan.c.baker@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
6 years agoanv: Make blorp update the clear color.
Rafael Antognolli [Tue, 6 Mar 2018 17:21:40 +0000 (09:21 -0800)]
anv: Make blorp update the clear color.

Instead of updating the clear color in anv before a resolve, just let
blorp handle that for us during fast clears.

v5: Update comment about HiZ clear color (Jordan).

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
6 years agoanv: Use clear address for HiZ fast clears too.
Rafael Antognolli [Fri, 19 Jan 2018 01:19:30 +0000 (17:19 -0800)]
anv: Use clear address for HiZ fast clears too.

Store the default clear address for HiZ fast clears on a global bo, and
point to it when needed.

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
6 years agoanv: Emit the fast clear color address, instead of value.
Rafael Antognolli [Thu, 18 Jan 2018 17:50:48 +0000 (09:50 -0800)]
anv: Emit the fast clear color address, instead of value.

On Gen10+, instead of copying the clear color from the state buffer to
the surface state, just use the address of the state buffer in the
surface state directly. This way we can avoid the copy from state buffer
to surface state.

v4:
 - Remove use_clear_address from anv code. (Jason)
 - Use the helper to extract clear color from attachment (Jason)

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
6 years agoanv: Add a helper to extract clear color from the attachment.
Rafael Antognolli [Wed, 28 Feb 2018 01:06:13 +0000 (17:06 -0800)]
anv: Add a helper to extract clear color from the attachment.

Extract the code from color_attachment_compute_aux_usage, so we can
later reuse it to update the clear color state buffer.

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
6 years agoi965/surface_state: Emit the clear color address instead of value.
Rafael Antognolli [Tue, 29 Aug 2017 23:30:26 +0000 (16:30 -0700)]
i965/surface_state: Emit the clear color address instead of value.

On Gen10, when emitting the surface state, use the value stored in the
clear color entry buffer by using a clear color address in the surface
state.

v4: Use the clear color offset from the clear_color_bo, when available.

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
6 years agoi965/blorp: Update the fast clear value buffer.
Rafael Antognolli [Tue, 29 Aug 2017 23:25:30 +0000 (16:25 -0700)]
i965/blorp: Update the fast clear value buffer.

On Gen10, whenever we do a fast clear, blorp will update the clear color
state buffer for us, as long as we set the clear color address
correctly.

However, on a hiz clear, if the surface is already on the fast clear
state we skip the actual fast clear operation and, before gen10, only
updated the miptree. On gen10+ we need to update the clear value state
buffer too, since blorp will not be doing a fast clear and updating it
for us.

v4:
 - do not use clear_value_size in the for loop
 - Get the address of the clear color from the aux buffer or the
 clear_color_bo, depending on which one is available.
 - let core blorp update the clear color, but also update it when we
 skip a fast clear depth.

v5: Better subject (Jordan).
v6: Remove outdated comment (Jason).

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoi965: Add aux_buf variable to simplify code.
Rafael Antognolli [Mon, 5 Mar 2018 19:25:12 +0000 (11:25 -0800)]
i965: Add aux_buf variable to simplify code.

In a follow up patch, we make use of clear_color_bo, which is in
mt->mcs_buf or mt->hiz_buf. To avoid duplicating more code that does the
same thing on both aux buffers, just use aux_buf already.

v5: Add aux_buf to brw_wm_surface_state too.
v6: Drop aux_surf and use aux_buf->surf instead (Jason).

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoi965/miptree: Add new clear color BO for winsys aux buffers
Rafael Antognolli [Thu, 1 Mar 2018 00:11:34 +0000 (16:11 -0800)]
i965/miptree: Add new clear color BO for winsys aux buffers

Add an extra BO to store clear color when we receive the aux buffer from
the window system. Since we have no control over the aux buffer size in
this case, we need the new BO to store only the clear color.

v5:
 - Better subject (Jordan).
 - Drop alignment from brw_bo_alloc().

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoi965/miptree: Add space to store the clear value in the aux surface.
Rafael Antognolli [Thu, 10 Aug 2017 16:36:28 +0000 (09:36 -0700)]
i965/miptree: Add space to store the clear value in the aux surface.

Similarly to vulkan where we store the clear value in the aux surface,
we can do the same in GL.

v2: Remove unneeded extra function.
v3: Use clear_value_state_size instead of clear_value_size.
v4:
 - rename to clear_color_state_size
 - store clear_color_bo and clear_color_offset in the aux buf struct
v5: Unreference clear color bo (Jordan)

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
6 years agointel/blorp: Update clear color state buffer during fast clears.
Rafael Antognolli [Mon, 5 Mar 2018 16:52:35 +0000 (08:52 -0800)]
intel/blorp: Update clear color state buffer during fast clears.

We always want to update the fast clear color during a fast clear on
i965. On anv, we are doing that before a resolve, but by adding support
to blorp, we can do a similar thing and update it during a fast clear
instead.

The goal is to remove some code from anv that does such update, and
centralize everything in blorp, hopefully removing a lot of code
duplication. It also allows us to have a similar behavior on gen < 9 and
gen >= 10.

v5: s/we/we are/ (Jordan)

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
6 years agointel/blorp: Only copy clear color when doing a resolve.
Rafael Antognolli [Wed, 7 Mar 2018 18:49:03 +0000 (10:49 -0800)]
intel/blorp: Only copy clear color when doing a resolve.

We only need to copy the clear color from the state buffer to the
inlined surface state when doing a resolve.

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
6 years agointel/blorp: Add support for fast clear address.
Rafael Antognolli [Thu, 7 Dec 2017 16:47:38 +0000 (08:47 -0800)]
intel/blorp: Add support for fast clear address.

On gen10+, if surface->clear_color_addr is present, use it directly
intead of copying it to the surface state.

v4: Remove redundant #if clause for GEN <= 10 (Jason)
v5: Move flush after the reloc, and keep lower bits (Topi).

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
6 years agointel/isl: Add support to emit clear value address.
Rafael Antognolli [Thu, 10 Aug 2017 16:29:51 +0000 (09:29 -0700)]
intel/isl: Add support to emit clear value address.

gen10 can emit the clear color by setting it on a buffer somewhere, and
then adding only the address to the surface state.

This commit add support for that on isl_surf_fill_state, and if that is
requested, skip setting the clear value itself.

v2: Add assert to make sure we are at least on gen10.

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agointel: Use Clear Color struct size.
Rafael Antognolli [Tue, 27 Mar 2018 22:51:21 +0000 (15:51 -0700)]
intel: Use Clear Color struct size.

The size of the clear color struct (expected by the hardware) is 8
dwords (isl_dev.ss.clear_value_state_size here). But we still need to
track the size of the clear color, used when memcopying it to/from the
state buffer. For that we keep isl_dev.ss.clear_value_size.

v4:
 - Add struct to gen11 too (Jason, Jordan)
 - Add field for Converted Clear Color to gen11 (Jason)
 - Add clear_color_state_offset to differentiate from
   clear_value_offset.
 - Fix all the places where clear_value_size was used.

v5 (Jason):
 - Split genxml changes to another commit.
 - Remove unnecessary gen checks.
 - Bring back missing offset increment to init_fast_clear_color().

v6 (Jason):
 - On init_fast_clear_color, change:
   addr.offset += 4 => sdi.Address.offset += i * 4
 - Use GEN_GEN instead of GEN_VERSIONx10.

[jordan.l.justen@intel.com: isl_device_init changes]
Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agointel/genxml: Add Clear Color struct to gen10+.
Rafael Antognolli [Tue, 27 Mar 2018 22:48:44 +0000 (15:48 -0700)]
intel/genxml: Add Clear Color struct to gen10+.

v5: Split genxml changes into its own commit (Jason).

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agointel/genxml: Use a single field for clear color address on gen10.
Rafael Antognolli [Mon, 7 Aug 2017 19:14:04 +0000 (12:14 -0700)]
intel/genxml: Use a single field for clear color address on gen10.

genxml does not support having two address fields with different names
but same position in the state struct. Both "Clear Color Address"
and "Clear Depth Address Low" mean the same thing, only for different
surface types.

To workaround this genxml limitation, rename "Clear Color Address"
to "Clear Value Address" and use it for both color and depth. Do the
same for the high bits.

TODO: add support for multiple addresses at the same position in the
xml.

v2: Combine high and low order bits into a single address field.

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
6 years agogenxml: Preserve fields that share dword space with addresses.
Rafael Antognolli [Thu, 18 Jan 2018 00:19:41 +0000 (16:19 -0800)]
genxml: Preserve fields that share dword space with addresses.

Some instructions contain fields that are either an address or a value
of some type based on the content of other fields, such as clear color
values vs address. That works fine if these fields are in the less
significant dword, the lower 32 bits of the address, because they get
OR'ed with the address. But if they are in the higher 32 bits, they get
discarded.

On Gen10 we have fields that share space with the higher 16 bits of the
address too. This commit makes sure those fields don't get discarded.

v5: Remove spurious whitespace (Jason).

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoanv/image: Do not override lower bits of dword.
Rafael Antognolli [Thu, 18 Jan 2018 22:12:08 +0000 (14:12 -0800)]
anv/image: Do not override lower bits of dword.

The lower bits seem to have extra fields in every platform but gen8
(even though we don't use them in gen9). So just go ahead and avoid
using them for the address.

v4: Use Jason's suggestion for comment explaining the change.
v5: Fix aux_address comment in anv_private.h (Jason)

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
6 years agoradv: implement a fast prefetch path for the vertex stage
Samuel Pitoiset [Wed, 4 Apr 2018 10:12:04 +0000 (12:12 +0200)]
radv: implement a fast prefetch path for the vertex stage

This allows to start draws as soon as possible.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
6 years agoradv: rename radv_emit_prefetch() to radv_emit_prefetch_L2()
Samuel Pitoiset [Wed, 4 Apr 2018 10:12:03 +0000 (12:12 +0200)]
radv: rename radv_emit_prefetch() to radv_emit_prefetch_L2()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
6 years agoradv: use a mask for VBOs and shaders prefetching
Samuel Pitoiset [Wed, 4 Apr 2018 10:12:02 +0000 (12:12 +0200)]
radv: use a mask for VBOs and shaders prefetching

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
6 years agogallium/pp: fix MLAA shaders
Marek Olšák [Wed, 4 Apr 2018 20:11:03 +0000 (16:11 -0400)]
gallium/pp: fix MLAA shaders

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99549

6 years agogallium/pp: use user constant buffers
Marek Olšák [Wed, 4 Apr 2018 20:04:30 +0000 (16:04 -0400)]
gallium/pp: use user constant buffers

This fixes a radeonsi crash.

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

6 years agost/mesa: set stencil border color the same as intensity
Marek Olšák [Mon, 2 Apr 2018 21:58:30 +0000 (17:58 -0400)]
st/mesa: set stencil border color the same as intensity

This fixes some stencil border color tests on Vega and Raven chips.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
6 years agoFix use of alloca() without #include <c99_alloca.h>
Jon Turney [Tue, 3 Apr 2018 16:52:56 +0000 (17:52 +0100)]
Fix use of alloca() without #include <c99_alloca.h>

Fix use of alloca() without #include <c99_alloca.h> in 1da345e5

vbo/vbo_context.c: In function '_vbo_draw_indirect':
vbo/vbo_context.c:284:34: error: implicit declaration of function 'alloca' [-Werror=implicit-function-declaration]
       struct _mesa_prim *space = alloca(draw_count*sizeof(struct _mesa_prim));
                                  ^~~~~~
vbo/vbo_context.c:284:34: warning: initialization makes pointer from integer without a cast [-Wint-conversion]

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
6 years agoradv: implement out-of-order rasterization when it's safe on VI+
Samuel Pitoiset [Wed, 28 Mar 2018 17:03:00 +0000 (19:03 +0200)]
radv: implement out-of-order rasterization when it's safe on VI+

Disabled by default for now, it can be enabled with
RADV_PERFTEST=outoforder.

No CTS regressions on Polaris, and all Vulkan games I tested
look good as well.

Expect small performance improvements for applications where
out-of-order rasterization can be enabled by the driver.

Loosely based on RadeonSI.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: change blend_enable field to use four bits per CB
Samuel Pitoiset [Thu, 29 Mar 2018 08:54:29 +0000 (10:54 +0200)]
radv: change blend_enable field to use four bits per CB

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: scan which color blend attachments are enabled
Samuel Pitoiset [Thu, 29 Mar 2018 08:49:33 +0000 (10:49 +0200)]
radv: scan which color blend attachments are enabled

With cb_target_enabled_4bit in order to have four bits per CB.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: put more fields in radv_blend_state
Samuel Pitoiset [Thu, 29 Mar 2018 08:01:41 +0000 (10:01 +0200)]
radv: put more fields in radv_blend_state

Some will be used for further optimizations (ie. out-of-order rast).

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: do not always disable dual quad mode when chip has RbPlus
Samuel Pitoiset [Thu, 29 Mar 2018 12:51:20 +0000 (14:51 +0200)]
radv: do not always disable dual quad mode when chip has RbPlus

For GFX9+ only, RadeonSI does this too.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: don't use the SPI barrier management bug workaround
Samuel Pitoiset [Wed, 4 Apr 2018 08:55:43 +0000 (10:55 +0200)]
radv: don't use the SPI barrier management bug workaround

Ported from RadeonSI.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: mask out high VM address bits in registers where needed
Samuel Pitoiset [Wed, 4 Apr 2018 08:55:42 +0000 (10:55 +0200)]
radv: mask out high VM address bits in registers where needed

Ported from RadeonSI.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agointel: compiler: silence compiler warning
Lionel Landwerlin [Tue, 3 Apr 2018 13:41:18 +0000 (14:41 +0100)]
intel: compiler: silence compiler warning

../src/intel/compiler/brw_reg.h: In function ‘bool brw_regs_negative_equal(const brw_reg*, const brw_reg*)’:
../src/intel/compiler/brw_reg.h:305:1: warning: control reaches end of non-void function [-Wreturn-type]

Introduced by 8f83eea71e233 ("i965: Add negative_equals methods").

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
6 years agocompiler/spirv: set is_shadow for depth comparitor sampling opcodes
Iago Toral Quiroga [Mon, 2 Apr 2018 09:39:41 +0000 (11:39 +0200)]
compiler/spirv: set is_shadow for depth comparitor sampling opcodes

From the SPIR-V spec, OpTypeImage:

"Depth is whether or not this image is a depth image. (Note that
 whether or not depth comparisons are actually done is a property of
 the sampling opcode, not of this type declaration.)"

The sampling opcodes that specify depth comparisons are
OpImageSample{Proj}Dref{Explicit,Implicit}Lod, so we should set
is_shadow only for these (we were using the deph property of the
image until now).

v2:
 - Do the same for OpImageDrefGather.
 - Set is_shadow to false if the sampling opcode is not one of these (Jason)
 - Reuse an existing switch statement instead of adding a new one (Jason)

Fixes crashes in:
dEQP-VK.spirv_assembly.instruction.graphics.image_sampler.depth_property.*

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Cc: mesa-stable@lists.freedesktop.org
6 years agoi965: Extend the negative 32-bit deltas to 64-bits
Sergii Romantsov [Mon, 2 Apr 2018 06:59:06 +0000 (09:59 +0300)]
i965: Extend the negative 32-bit deltas to 64-bits

Gen8+ use 48-bit address relocations so need to extend the sign
to 64-bit return value. Without it we have higher bits zeroed
and missing the negavive values.
Haswell and older use 32-bit deltas so are unaffected by this issue.

v2:
  used int32_t fucntion parameter instead of explicit type conversion.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101408
Signed-off-by: Sergii Romantsov <sergii.romantsov@globallogic.com>
Tested-by: Andriy Khulap <andriy.khulap@globallogic.com>
Tested-by: Stuart Young <cefiar@gmail.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "18.0 17.3" <mesa-stable@lists.freedesktop.org>
6 years agonir/lower_vec_to_movs: Only coalesce if the vec had a SSA destination
Jason Ekstrand [Fri, 23 Mar 2018 18:05:04 +0000 (11:05 -0700)]
nir/lower_vec_to_movs: Only coalesce if the vec had a SSA destination

Otherwise we may end up trying to coalesce in a case such as

ssa_1 = fadd r1, r2
r3.x = fneg(r2);
r3 = vec4(ssa_1, ssa_1.y, ...)

and that would cause us to move the writes to r3 from the vec to the
fadd which would re-order them with respect to the write from the fneg.
In order to solve this, we just don't coalesce if the destination of the
vec is not SSA.  We could try to get clever and still coalesce if there
are no writes to the destination of the vec between the vec and the ALU
source.  However, since registers only come from phi webs and indirects,
the chances of having a vec with a register destination that is actually
coalescable into its source is very slim.

Shader-db results on Haswell:

    total instructions in shared programs: 13657906 -> 13659101 (<.01%)
    instructions in affected programs: 149291 -> 150486 (0.80%)
    helped: 0
    HURT: 592

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105440
Fixes: 2458ea95c56 "nir/lower_vec_to_movs: Coalesce movs on-the-fly when possible"
Reported-by: Vadym Shovkoplias <vadym.shovkoplias@globallogic.com>
Tested-by: Vadym Shovkoplias <vadym.shovkoplias@globallogic.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
6 years agoanv: Fix close(fd) before import issue in vkCreateDmaBufImageINTEL
Kevin Strasser [Tue, 3 Apr 2018 21:21:34 +0000 (14:21 -0700)]
anv: Fix close(fd) before import issue in vkCreateDmaBufImageINTEL

If we close the fd before calling DRM_IOCTL_PRIME_FD_TO_HANDLE the kernel
will hit a -EBADF error. Move the close(fd) call to the end of
anv_CreateDmaBufImageINTEL().

Signed-off-by: Kevin Strasser <kevin.strasser@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>