Commit Graph

6560 Commits

Author SHA1 Message Date
Rob Clark c3c884c49c gallium/util: clean up stack frame printing
Prep work for next patch.

Ideally 'struct debug_stack_frame' would be opaque, but it is embedded
in a bunch of places.  But at least we can treat it opaquely.

Signed-off-by: Rob Clark <robdclark@gmail.com>
2017-04-03 11:32:17 -04:00
Samuel Pitoiset 8a3ef8c65d gallivm: add lp_build_emit_fetch_src() helper
lp_build_emit_fetch() is useful when the source type can be
infered from the instruction opcode.

However, for bindless samplers/images we can't do that easily
because tgsi_opcode_infer_src_type() returns TGSI_TYPE_FLOAT for
TEX instructions, while we need TGSI_TYPE_UNSIGNED64 if the
resource register is bindless.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-04-01 18:07:49 +02:00
Marek Olšák 150736b5c3 gallium: remove support for predicates from TGSI (v2)
Neved used.

v2: gallivm: rename "pred" -> "exec_mask"
    etnaviv: remove the cap
    gallium: fix tgsi_instruction::Padding

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2017-04-01 00:06:41 +02:00
Marek Olšák 322eb13f09 radeonsi: add tests verifying that VM faults don't hang
GFX9 hangs instead of writing VM faults to dmesg.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-03-31 21:41:57 +02:00
Nicolai Hähnle c22841d8d2 tgsi: fix printing of 64-bit integer immediates
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-03-31 18:15:47 +02:00
Ilia Mirkin 94ec847cb0 tgsi: add CLOCK opcode
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-03-31 07:56:26 +02:00
Marek Olšák 9f5dbbe030 gallivm: fix a maybe-uninitialized warning
/home/marek/dev/mesa-main/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c:3598:
 warning: 'level' may be used uninitialized in this function [-Wmaybe-uninitialized]
       out1 = lp_build_cmp(&leveli_bld, PIPE_FUNC_GREATER, level, last_level);
            ^
2017-03-30 17:14:47 +02:00
Marek Olšák abb25fb18e gallium/util: use const in u_index_modify helpers
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Tested-by: Edmondo Tommasina <edmondo.tommasina@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2017-03-30 16:09:29 +02:00
Marek Olšák 6e2b9fd071 gallivm: remove lp_add_attr_dereferenceable in favor of amd/common
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-03-22 17:54:40 +01:00
Marek Olšák 6c0a28084d gallium/u_upload: make the first persistent mapping unsynchronized
This is simpler for drivers.
2017-03-17 18:30:21 +01:00
Roland Scheidegger e1f9e9bafd gallivm: (trivial) remove duplicated line
pointed out by clang (stored value never read)
2017-03-16 04:03:29 +01:00
Roland Scheidegger 9d104dfd55 draw: (trivial) remove a unnecessary lp_build_alloca()
pointed out by clang (stored value never read)
2017-03-16 04:03:29 +01:00
Francisco Jerez e6469ec43b gallium/tgsi: Treat UCMP sources as floats to match the GLSL-to-TGSI pass expectations.
Currently the GLSL-to-TGSI translation pass assumes it can use
floating point source modifiers on the UCMP instruction.  See the bug
report linked below for an example where an unrelated change in the
GLSL built-in lowering code for atan2 (e9ffd12827)
caused the generation of floating-point ir_unop_neg instructions
followed by ir_triop_csel, which is translated into UCMP with a negate
modifier on back-ends with native integer support.

Allowing floating-point source modifiers on an integer instruction
seems like rather dubious design for a transport IR, since the same
semantics could be represented as a sequence of MOV+UCMP instructions
instead, but supposedly this matches the expectations of TGSI
back-ends other than tgsi_exec, and the expectations of the DX10 API.
I take no responsibility for future headaches caused by this
inconsistency.

Fixes a regression of piglit glsl-fs-tan-1 on softpipe introduced by
the above-mentioned glsl front-end commit.  Even though the commit
that triggered the regression doesn't seem to have made it to any
stable branches yet, this might be worth back-porting since I don't
see any reason why the bug couldn't have been reproduced before that
point.

Suggested-by: Roland Scheidegger <sroland@vmware.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99817
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2017-03-15 15:47:14 -07:00
Marek Olšák cca0389c72 gallium: add TGSI opcodes TEX_LZ and TXF_LZ
for better code generation in radeonsi
2017-03-15 18:17:41 +01:00
Samuel Pitoiset 74265fd03c tgsi: add missing compute shader entry in tgsi_get_processor_name()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-03-15 14:16:29 +01:00
Jason Ekstrand 762a6333f2 nir: Rework conversion opcodes
The NIR story on conversion opcodes is a mess.  We've had way too many
of them, naming is inconsistent, and which ones have explicit sizes was
sort-of random.  This commit re-organizes things and makes them all
consistent:

 - All non-bool conversion opcodes now have the explicit size in the
   destination and are named <src_type>2<dst_type><size>.

 - Integer <-> integer conversion opcodes now only come in i2i and u2u
   forms (i2u and u2i have been removed) since the only difference
   between the different integer conversions is whether or not they
   sign-extend when up-converting.

 - Boolean conversion opcodes all have the explicit size on the bool and
   are named <src_type>2<dst_type>.

Making things consistent also allows nir_type_conversion_op to be moved
to nir_opcodes.c and auto-generated using mako.  This will make adding
int8, int16, and float16 versions much easier when the time comes.

Reviewed-by: Eric Anholt <eric@anholt.net>
2017-03-14 07:36:40 -07:00
Julien Isorce 9df3f28a8b gallium/hud: check NULL return from u_upload_alloc
Fixes the following segmentation fault:

signal SIGSEGV: invalid address (fault address: 0x0)
 frame #0: 0x00007fffe718e117 radeonsi_dri.so hud_draw_background_quad hud_context.c:170
   167
   168 	   assert(hud->bg.num_vertices + 4 <= hud->bg.max_num_vertices);
   169
-> 170 	   vertices[num++] = (float) x1;
   171 	   vertices[num++] = (float) y1;
   172
   173 	   vertices[num++] = (float) x1;
(lldb) bt
  * frame #0: 0x00007fffe718e117 radeonsi_dri.so`hud_draw_background_quad
    frame #1: 0x00007fffe718f458 radeonsi_dri.so`hud_draw
    frame #2: 0x00007fffe712967f radeonsi_dri.so`dri_flush

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2017-03-13 17:20:21 +01:00
Christian König cee591a224 vl/video_buffer: add support for P016
Just simply the description of the planes.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Mark Thompson <sw@jkqxz.net>
2017-03-13 08:51:22 +01:00
Christian König 62cff79378 gallium: add P016 format
Same layout as NV12, but 16bit per channel instead of 8.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Mark Thompson <sw@jkqxz.net>
2017-03-13 08:51:07 +01:00
Timothy Arceri ca76a2ba1b gallium/util: replace pipe_thread_setname() with u_thread_setname()
They do the same thing we just moved the function to be
accessible to all of Mesa.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-03-12 17:49:04 +11:00
Timothy Arceri 14e6b86952 gallium/util: replace pipe_thread_get_time_nano() with u_thread_get_time_nano()
They do the same thing we just moved the function to be
accessible to all of Mesa.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-03-12 17:49:04 +11:00
Timothy Arceri f8cc4c25b8 gallium/util: replace pipe_thread_create() with u_thread_create()
They do the same thing we just moved the function to be
accessible to all of Mesa.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-03-12 17:49:04 +11:00
Timothy Arceri b822d9dd67 gallium/util: move u_queue.{c,h} to src/util
This will allow us to use it outside of gallium for things like
compressing shader cache entries.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-03-12 17:49:03 +11:00
Timothy Arceri 04ec4db8b5 gallium/util: make use of new u_thread.h in u_queue.{c,h}
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-03-12 17:49:03 +11:00
Timothy Arceri a3b820308b gallium/util: use standard malloc/calloc/free in u_queue.c
This will help us moving the file to the shared src/util dir.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-03-12 17:49:03 +11:00
Timothy Arceri 94a6457724 gallium/util: move u_string.h to src/util/u_string.h
This will help us move u_queue.c here eventually and also provide
string function wrappers for anyone wishing to port disk_cache.c
to windows.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-03-12 17:43:06 +11:00
Timothy Arceri d55d1e9805 gallium/util: remove unused header from u_string.h
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-03-12 17:43:06 +11:00
Timothy Arceri ff8aad66bd gallium/util: remove unused util_strbuf*
Looks like they have been unused since 2008 b8a7eef242.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-03-12 17:43:06 +11:00
Timothy Arceri b4b1dcb2c1 gallium/util: remove unused util_memmove()
This is not used anywhere and Visual Studio looks to have
supported memmove() for a long time if not always.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-03-12 17:43:06 +11:00
Emil Velikov 168d801149 gallium: remove shebang from python scripts
Analogous to earlier commit(s).

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-03-10 14:12:46 +00:00
Emil Velikov 2ea1ce2701 gallium: remove execute bit from the python script(s)
Analogous to earlier commit(s).

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-03-10 14:12:46 +00:00
Brian Paul 2f3f5728f7 util/indices: minor clean-ups
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
2017-03-08 08:50:21 -07:00
Brian Paul b0d3938430 gallium: s/uint/enum pipe_render_cond_flag/ for set_render_condition()
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
2017-03-08 08:50:20 -07:00
Brian Paul b4191b712b draw: s/unsigned/enum pipe_shader_type/
and some s/uint/enum pipe_shader_type/

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
2017-03-08 08:50:20 -07:00
Brian Paul ed66c9d7b8 cso: s/unsigned/enum pipe_shader_type/
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
2017-03-08 08:50:20 -07:00
Brian Paul 637e5719b5 gallium: s/unsigned/enum pipe_shader_type/ for pipe_screen::get_shader_param()
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
2017-03-08 08:50:20 -07:00
Timothy Arceri 7eb85b8204 gallium/util: remove unused header from u_queue.c
Reviewed-by: Plamena Manolova <plamena.manolova@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-03-07 09:12:16 +11:00
Timothy Arceri 60a2c2507d gallium/util: remove unused pipe_thread_destroy()
Reviewed-by: Plamena Manolova <plamena.manolova@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-03-07 09:12:16 +11:00
Timothy Arceri d82d8be614 gallium/util: replace pipe_thread_wait() with thrd_join()
Replace done using:
find ./src -type f -exec sed -i -- \
's:pipe_thread_wait(\([^)]*\)):thrd_join(\1, NULL):g' {} \;

Reviewed-by: Plamena Manolova <plamena.manolova@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-03-07 09:12:16 +11:00
Timothy Arceri da40ac65c7 gallium/util: remove PIPE_THREAD_ROUTINE()
This was made unnecessary with fd33a6bcd7.

This was mostly done with:
find ./src -type f -exec sed -i -- \
's:PIPE_THREAD_ROUTINE(\([^,]*\), \([^)]*\)):int\n\1(void \*\2):g' {} \;

With some small manual tidy ups.

Reviewed-by: Plamena Manolova <plamena.manolova@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-03-07 09:12:16 +11:00
Timothy Arceri e92293a601 gallium/util: replace pipe_condvar with cnd_t
pipe_condvar was made unnecessary with fd33a6bcd7.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-03-07 09:07:33 +11:00
Timothy Arceri e5375ba028 gallium/util: replace pipe_thread with thrd_t
pipe_thread was made unnecessary with fd33a6bcd7.

V2: fix compile error in u_queue.c

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-03-07 08:53:27 +11:00
Timothy Arceri 628e84a58f gallium/util: replace pipe_mutex_unlock() with mtx_unlock()
pipe_mutex_unlock() was made unnecessary with fd33a6bcd7.

Replaced using:
find ./src -type f -exec sed -i -- \
's:pipe_mutex_unlock(\([^)]*\)):mtx_unlock(\&\1):g' {} \;

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-03-07 08:53:05 +11:00
Timothy Arceri ba72554f3e gallium/util: replace pipe_mutex_lock() with mtx_lock()
replace pipe_mutex_lock() was made unnecessary with fd33a6bcd7.

Replaced using:
find ./src -type f -exec sed -i -- \
's:pipe_mutex_lock(\([^)]*\)):mtx_lock(\&\1):g' {} \;

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-03-07 08:52:38 +11:00
Timothy Arceri be188289e1 gallium/util: replace pipe_mutex_destroy() with mtx_destroy()
pipe_mutex_destroy() was made unnecessary with fd33a6bcd7.

Replace was done with:
find ./src -type f -exec sed -i -- \
's:pipe_mutex_destroy(\([^)]*\)):mtx_destroy(\&\1):g' {} \;

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-03-07 08:52:16 +11:00
Timothy Arceri 75b47dda0c gallium/util: replace pipe_mutex_init() with mtx_init()
pipe_mutex_init() was made unnecessary with fd33a6bcd7.

Replace was done using:
find ./src -type f -exec sed -i -- \
's:pipe_mutex_init(\([^)]*\)):(void) mtx_init(\&\1, mtx_plain):g' {} \;

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-03-07 08:52:07 +11:00
Timothy Arceri acdcaf9be4 gallium/util: remove pipe_static_mutex()
This was made unnecessary with fd33a6bcd7.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-03-07 08:48:16 +11:00
Timothy Arceri 2efddc63ee gallium/util: replace pipe_mutex with mtx_t
pipe_mutex was made unnecessary with fd33a6bcd7.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-03-07 08:48:11 +11:00
Timothy Arceri 464d4806c1 gallium/util: replace pipe_condvar_broadcast() with cnd_broadcast()
pipe_condvar_broadcast() was made unnecessary with fd33a6bcd7.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-03-07 08:23:26 +11:00
Timothy Arceri 5e56c2c79d gallium/util: replace pipe_condvar_signal() with cnd_signal()
pipe_condvar_signal() was made unnecessary with fd33a6bcd7.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-03-07 08:23:26 +11:00