summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary
Commit message (Collapse)AuthorAgeFilesLines
* gallium/util: fix nondeterministic avx512 detectionTim Rowley2017-08-031-1/+1
| | | | | | | | | | | cpuid.7 requires cx=0 to select the extended feature leaf. avx512 detection was using the non-indexed cpuid resulting in random non-detection of avx512. Cc: [email protected] Reviewed-by: Roland Scheidegger <[email protected]> (cherry picked from commit 131b9f644cbe70728ba02878483e22459400bcb4)
* st/va: Fix scaling list ordering for H.265Mark Thompson2017-08-032-0/+23
| | | | | | | | | | | | | | Mesa here requires the scaling lists in diagonal scan order, but VAAPI passes them in raster scan order. Therefore, rearrange the elements when copying. v2: Move scan tables to vl_zscan.c. Fix type in size assertion. Cc: [email protected] Signed-off-by: Mark Thompson <[email protected]> Reviewed-by: Christian König <[email protected]> (cherry picked from commit 63dcfed81f011dae5ca68af3369433be28135415)
* draw: check for line_width != 1.0f in validate_pipeline()Brian Paul2017-07-081-3/+4
| | | | | | | | | | We shouldn't use the wide line stage if the line width is 1. This check isn't strictly needed because all drivers are (now) specifying a line wide threshold of at least 1.0 pixels, but let's play it safe. Reviewed-by: Charmaine Lee <[email protected]> (cherry picked from commit c8f344ed2d471f0e012205aecfae4aa765d9fffb)
* gallium/util: Break recursion in pipe_resource_referenceMichel Dänzer2017-06-281-2/+8
| | | | | | | | | | | | | | | | | | | | | It calling itself recursively prevented it from being inlined, resulting in a copy being generated in every compilation unit referencing it. This bloated the text segment of the Gallium mega-driver *_dri.so by ~4%, and might also have impacted performance. Fixes: ecd6fce2611e ("mesa/st: support lowering multi-planar YUV") v2: * Add comment above pipe_resource_next_reference [Samuel Pitoiset] v3: * Use loop to unreference the full chain of resources referenced via the next members [Timothy Arceri] v4: * Stop chasing ->next chain at the first sub-resource which isn't destroyed [Nicolai Hähnle] Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Marek Olšák <[email protected]> (cherry picked from commit 176e761513f9f9502248c0c8dad133d2d9f28d2d)
* gallium/vbuf: avoid segfault when we get invalid glDrawRangeElements()Brian Paul2017-06-281-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | A common user error is to call glDrawRangeElements() with the 'end' argument being one too large. If we use the vbuf module to translate some vertex attributes this error can cause us to read past the end of the mapped hardware buffer, resulting in a crash. This patch adjusts the vertex count to avoid that issue. Typically, the vertex_count gets decremented by one. This fixes crashes with the Unigine Tropics and Sanctuary demos with older VMware hardware versions. The issue isn't hit with VGPU10 because we don't hit this fallback. No piglit changes. CC: [email protected] Reviewed-by: Marek Olšák <[email protected]> (cherry picked from commit d8148ed10ae5faea6f88f2f964797f4b0590c083) [Andres Gomez: pipe_vertex_buffer hadn't shrunk yet] Signed-off-by: Andres Gomez <[email protected]> Conflicts: src/gallium/auxiliary/util/u_vbuf.c
* auxiliary/vl: use vl_*_screen_create stubs when building w/o platformEmil Velikov2017-05-313-15/+35
| | | | | | | | | | | | | | | | | | | | | | Provide a dummy stub when the user has opted w/o said platform, thus we can build the binaries without unnecessarily requiring X11/other headers. In order to avoid build and link-time issues, we remove the HAVE_DRI3 guards in the VA and VDPAU state-trackers. With this change st/va will return VA_STATUS_ERROR_ALLOCATION_FAILED instead of VA_STATUS_ERROR_UNIMPLEMENTED. That is fine since upstream users of libva such as vlc and mpv do little error checking, let alone distinguish between the two. Cc: Leo Liu <[email protected]> Cc: Guttula, Suresh <[email protected]> Cc: [email protected] Cc: Christian König <[email protected]> Signed-off-by: Emil Velikov <[email protected]> (cherry picked from commit 369e5dd939b4af6c653d6cbbe9be257a9c2c950e) Signed-off-by: Juan A. Suarez Romero <[email protected]>
* configure: check once for DRI3 dependenciesEmil Velikov2017-05-311-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently we are having the XCB_DRI3 dependencies duplicated, partially. Just do a once-off check and add all of the respective CFLAGS/LIBS where needed. As a nice side effect this helps us solve a couple of FIXMEs. DRI3 is not a thing w/o X11 so disable it in such cases. Cc: [email protected] Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> (cherry picked from commit acf3d2afab0571b74c0c0d1aee0f631b33fdc7da) Signed-off-by: Juan A. Suarez Romero <[email protected]> squashed with: configure.ac: add xcb-fixes to the XCB DRI3 list The XCB module is used by the VL targets. Thus omitting it can lead to link-time errors due to unresolved symbols. Other DRI3 users such as the Vulkan WSI and the dri3 loader helper do not use an update region in their xcb_present_pixmap() call. We will look into that at a later stage. Fixes: acf3d2afab0 ("configure: check once for DRI3 dependencies") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101110 Signed-off-by: Emil Velikov <[email protected]> (cherry picked from commit 9a90d6a9d4ee1632aa357a2ac9be150e058e2c10) Signed-off-by: Juan A. Suarez Romero <[email protected]> squashed with: configure.ac: s/xcb-fixes/xcb-xfixes/ Former is not a thing, even if I have a hacked xcb-fixes.pc on my system. Thanks for spotting it Mark! Fixes: 9a90d6a9d4e ("configure.ac: add xcb-fixes to the XCB DRI3 list") Signed-off-by: Emil Velikov <[email protected]> (cherry picked from commit 48cd1919ff1584c211ec7958864cac2e1cb347cf) Signed-off-by: Juan A. Suarez Romero <[email protected]>
* gallivm: Make sure module has the correct data layout when pass manager runsTom Stellard2017-05-191-16/+18
| | | | | | | | | | | | | | | | | | | | The datalayout for modules was purposely not being set in order to work around the fact that the ExecutionEngine requires that the module's datalayout matches the datalayout of the TargetMachine that the ExecutionEngine is using. When the pass manager runs on a module with no datalayout, it uses the default datalayout which is little-endian. This causes problems on big-endian targets, because some optimizations that are legal on little-endian or illegal on big-endian. To resolve this, we set the datalayout prior to running the pass manager, and then clear it before creating the ExectionEngine. This patch fixes a lot of piglit tests on big-endian ppc64. Cc: [email protected] (cherry picked from commit 14e525a4d70649eb10185bebd2aef9dc339fb5e6)
* renderonly: Initialize fields of struct winsys_handle.Eric Anholt2017-05-181-0/+1
| | | | | | | | | | | vc4 was rejecting renderonly's import, because the offset field was nonzero. Fixes: 848b49b288f ("gallium: add renderonly library") Cc: [email protected] Signed-off-by: Eric Anholt <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]> (cherry picked from commit c98f03c6ebaca82c265b2f3242aed5c6a3c5dcd8)
* renderonly: use drmIoctlPhilipp Zabel2017-05-051-4/+3
| | | | | | | | | | | | To restart interrupted system calls, use drmIoctl. Fixes: 848b49b288f ("gallium: add renderonly library") CC: <[email protected]> Suggested-by: Emil Velikov <[email protected]> Signed-off-by: Philipp Zabel <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]> (cherry picked from commit b539335e50b355854202c4b1b42aa4ddbe9289fa)
* renderonly: drop resources on destroyPhilipp Zabel2017-05-052-2/+12
| | | | | | | | | | | | | | The renderonly_scanout holds a reference on its prime pipe resource, which should be released when it is destroyed. If it was created by renderonly_create_kms_dumb_buffer_for_resource, the dumb BO also has to be destroyed. Fixes: 848b49b288f ("gallium: add renderonly library") CC: <[email protected]> Signed-off-by: Philipp Zabel <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]> (cherry picked from commit cd8ee259c8e9b1c16b5c3214595b91eb31e7de19)
* renderonly: close transfer prime_fdPhilipp Zabel2017-05-051-0/+2
| | | | | | | | | | | | | prime_fd is only used to transfer the scanout buffer to the GPU inside renderonly_create_kms_dumb_buffer_for_resource. It should be closed immediately to avoid leaking the DMA-BUF file handle. Fixes: 848b49b288f ("gallium: add renderonly library") CC: <[email protected]> Signed-off-by: Philipp Zabel <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]> (cherry picked from commit ab51cd2f26496500d52f6b2847291d884f711bc2)
* gallium/targets: fix bool setting on BE architecturesIlia Mirkin2017-04-301-4/+4
| | | | | | | | | | | | | | val_bool and val_int are in a union. val_bool gets the first byte, which happens to work on LE when setting via the int, but breaks on BE. By setting the value properly, we are able to use DRI3 on BE architectures. Tested by running glxgears with a NV34 in a G5 PPC. Signed-off-by: Ilia Mirkin <[email protected]> Cc: [email protected] [Emil Velikov: squash the vmwgfx hunk] Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Michel Dänzer <[email protected]> (cherry picked from commit 6af14778a3f68030c4ad6426c75fe25d726235d5)
* gallium/ddebug: dump missing members of pipe_draw_infoNicolai Hähnle2017-04-141-0/+5
| | | | Reviewed-by: Marek Olšák <[email protected]>
* gallium/hud: set the dump file streams to line bufferedEdmondo Tommasina2017-04-131-0/+2
| | | | | | | | Flush the HUD value streams to the dump files after every newline. v2: check that fopen succeeded (Julien) Reviewed-and-Tested-by: Julien Isorce <[email protected]>
* draw: remove unused wideline_stage()Samuel Pitoiset2017-04-131-11/+0
| | | | | | | | | | | | | | | Fixes the following Clang warning. draw/draw_pipe_wide_line.c:48:38: warning: unused function 'wideline_stage' [-Wunused-function] static inline struct wideline_stage *wideline_stage( struct draw_stage *stage ) ^ 1 warning generated. v2: - remove commented code (Roland Scheidegger) v3: - remove half_line_width in the struct Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* draw: remove unused overflow()Samuel Pitoiset2017-04-131-8/+0
| | | | | | | | | | | | | Fixes the following Clang warning. draw/draw_pipe_vbuf.c:102:1: warning: unused function 'overflow' [-Wunused-function] overflow( void *map, void *ptr, unsigned bytes, unsigned bufsz ) ^ 1 warning generated. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* util: fix swizzle of INSTANCEID system valueNicolai Hähnle2017-04-081-1/+1
| | | | | | | | radeonsi added stricter checking for correct swizzles in debug builds. Reported-by: Michel Dänzer <[email protected]> Fixes: 4cf29427770f ("radeonsi: support 64-bit system values") Reviewed-by: Marek Olšák <[email protected]>
* gallivm: init vars to silence gcc warningsBrian Paul2017-04-071-2/+2
| | | | | | Silence warnings about using possibly uninitialized values. Signed-off-by: Brian Paul <[email protected]>
* gallium/util: tweak backtrace format with libunwindRob Clark2017-04-071-10/+16
| | | | | | | To work with addr2line.sh we also need the relative offset within the DSO. And addr2line.sh gets confused by the leading stackframe number. Signed-off-by: Rob Clark <[email protected]>
* gallium/util: cache symbol lookup with libunwindRob Clark2017-04-072-27/+94
| | | | Signed-off-by: Rob Clark <[email protected]>
* gallium/util: fix missing limit check in libunwind backtraceRob Clark2017-04-071-1/+1
| | | | | Fixes: 70c272004f ("gallium/util: libunwind support") Signed-off-by: Rob Clark <[email protected]>
* gallium/util: honour LIBUNWIND_CFLAGSEmil Velikov2017-04-051-0/+1
| | | | | Fixes: 70c272004f72 ("gallium/util: libunwind support") Signed-off-by: Emil Velikov <[email protected]>
* tgsi: add SUBGROUP_* semanticsIlia Mirkin2017-04-051-0/+7
| | | | | | | | v2: add documentation (Nicolai) Signed-off-by: Ilia Mirkin <[email protected]> Signed-off-by: Nicolai Hähnle <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* tgsi: add BALLOT/READ_* opcodesIlia Mirkin2017-04-051-3/+3
| | | | | | | | | | | | | | | | | | | | v2 (Nicolai): - BALLOT isn't per-channel - expand the documentation (also for VOTE_*) v3: - only BALLOT returns a 64-bit lanemask (Boyan) - relax the requirement on READ_INVOC: the invocation number to read from must be uniform within a sub-group. This matches the GL_ARB_shader_ballot spect (and the v_readlane instruction of AMD GCN) v4: - hopefully really fix the doc of VOTE_* returns (Ilia) Signed-off-by: Ilia Mirkin <[email protected]> Signed-off-by: Nicolai Hähnle <[email protected]> Reviewed-by: Marek Olšák <[email protected]> (v2)
* gallium: decrease the size of pipe_draw_info - 88 -> 80 bytesMarek Olšák2017-04-041-2/+8
| | | | | Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium: decrease the size of pipe_resource - 64 -> 48 bytesMarek Olšák2017-04-043-6/+8
| | | | | | | Some other changes needed here. Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium/util: libunwind supportRob Clark2017-04-032-2/+104
| | | | | | | | | | | It's kinda sad that (a) we don't have debug_backtrace support on !X86 and that (b) we re-invent our own crude backtrace support in the first place. If available, use libunwind instead. The backtrace format is based on what xserver and weston use, since it is nice not to have to figure out a different format. Signed-off-by: Rob Clark <[email protected]> Acked-by: Nicolai Hähnle <[email protected]>
* gallium/util: clean up stack frame printingRob Clark2017-04-033-23/+26
| | | | | | | | | 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 <[email protected]>
* gallivm: add lp_build_emit_fetch_src() helperSamuel Pitoiset2017-04-012-5/+24
| | | | | | | | | | | | | | 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 <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* gallium: remove support for predicates from TGSI (v2)Marek Olšák2017-04-0117-613/+22
| | | | | | | | | | | Neved used. v2: gallivm: rename "pred" -> "exec_mask" etnaviv: remove the cap gallium: fix tgsi_instruction::Padding Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* radeonsi: add tests verifying that VM faults don't hangMarek Olšák2017-03-312-4/+9
| | | | | | GFX9 hangs instead of writing VM faults to dmesg. Reviewed-by: Nicolai Hähnle <[email protected]>
* tgsi: fix printing of 64-bit integer immediatesNicolai Hähnle2017-03-313-5/+11
| | | | Reviewed-by: Marek Olšák <[email protected]>
* tgsi: add CLOCK opcodeIlia Mirkin2017-03-311-1/+1
| | | | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gallivm: fix a maybe-uninitialized warningMarek Olšák2017-03-301-1/+1
| | | | | | | /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); ^
* gallium/util: use const in u_index_modify helpersMarek Olšák2017-03-302-6/+6
| | | | | | Reviewed-by: Nicolai Hähnle <[email protected]> Tested-by: Edmondo Tommasina <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* gallivm: remove lp_add_attr_dereferenceable in favor of amd/commonMarek Olšák2017-03-222-14/+0
| | | | | Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* gallium/u_upload: make the first persistent mapping unsynchronizedMarek Olšák2017-03-171-0/+1
| | | | This is simpler for drivers.
* gallivm: (trivial) remove duplicated lineRoland Scheidegger2017-03-161-1/+0
| | | | pointed out by clang (stored value never read)
* draw: (trivial) remove a unnecessary lp_build_alloca()Roland Scheidegger2017-03-161-2/+0
| | | | pointed out by clang (stored value never read)
* gallium/tgsi: Treat UCMP sources as floats to match the GLSL-to-TGSI pass ↵Francisco Jerez2017-03-151-13/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 (e9ffd12827ac11a2d2002a42fa8eb1) 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 <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99817 Reviewed-by: Roland Scheidegger <[email protected]>
* gallium: add TGSI opcodes TEX_LZ and TXF_LZMarek Olšák2017-03-152-2/+5
| | | | for better code generation in radeonsi
* tgsi: add missing compute shader entry in tgsi_get_processor_name()Samuel Pitoiset2017-03-151-0/+2
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* nir: Rework conversion opcodesJason Ekstrand2017-03-141-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | 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 <[email protected]>
* gallium/hud: check NULL return from u_upload_allocJulien Isorce2017-03-131-0/+5
| | | | | | | | | | | | | | | | | | | | 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 <[email protected]>
* vl/video_buffer: add support for P016Christian König2017-03-131-0/+10
| | | | | | | Just simply the description of the planes. Signed-off-by: Christian König <[email protected]> Reviewed-by: Mark Thompson <[email protected]>
* gallium: add P016 formatChristian König2017-03-133-0/+40
| | | | | | | Same layout as NV12, but 16bit per channel instead of 8. Signed-off-by: Christian König <[email protected]> Reviewed-by: Mark Thompson <[email protected]>
* gallium/util: replace pipe_thread_setname() with u_thread_setname()Timothy Arceri2017-03-121-12/+0
| | | | | | | They do the same thing we just moved the function to be accessible to all of Mesa. Reviewed-by: Marek Olšák <[email protected]>
* gallium/util: replace pipe_thread_get_time_nano() with u_thread_get_time_nano()Timothy Arceri2017-03-121-17/+1
| | | | | | | They do the same thing we just moved the function to be accessible to all of Mesa. Reviewed-by: Marek Olšák <[email protected]>
* gallium/util: replace pipe_thread_create() with u_thread_create()Timothy Arceri2017-03-121-27/+1
| | | | | | | They do the same thing we just moved the function to be accessible to all of Mesa. Reviewed-by: Marek Olšák <[email protected]>