summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* nir: Make nir_opt_remove_phis see through moves.Kenneth Graunke2016-08-041-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I found a shader in Tales of Maj'Eyal that contains: if ssa_21 { block block_1: /* preds: block_0 */ ...instructions that prevent the select peephole... vec1 32 ssa_23 = imov ssa_4 vec1 32 ssa_24 = imov ssa_4.y vec1 32 ssa_25 = imov ssa_4.z /* succs: block_3 */ } else { block block_2: /* preds: block_0 */ vec1 32 ssa_26 = imov ssa_4 vec1 32 ssa_27 = imov ssa_4.y vec1 32 ssa_28 = imov ssa_4.z /* succs: block_3 */ } block block_3: /* preds: block_1 block_2 */ vec1 32 ssa_29 = phi block_1: ssa_23, block_2: ssa_26 vec1 32 ssa_30 = phi block_1: ssa_24, block_2: ssa_27 vec1 32 ssa_31 = phi block_1: ssa_25, block_2: ssa_28 Here, copy propagation will bail because phis cannot perform swizzles, and CSE won't do anything because there is no dominance relationship between the imovs. By making nir_opt_remove_phis handle identical moves, we can eliminate the phis and rewrite everything to use ssa_4 directly, so all the moves become dead and get eliminated. I don't think we need to check "exact" - just the alu sources. Presumably phi sources should match in their exactness. On Broadwell: total instructions in shared programs: 11639872 -> 11638535 (-0.01%) instructions in affected programs: 134222 -> 132885 (-1.00%) helped: 338 HURT: 0 v2: Fix return value to be NULL, not false (caught by Iago). Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
* nir: Make nir_alu_srcs_equal non-static.Kenneth Graunke2016-08-042-1/+4
| | | | | Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
* nir: Turn imov/fmov of undef into undef.Kenneth Graunke2016-08-041-1/+3
| | | | | | | | | | | | | | | | | | | | | | On Broadwell: total instructions in shared programs: 11640214 -> 11639872 (-0.00%) instructions in affected programs: 17744 -> 17402 (-1.93%) helped: 78 HURT: 0 total spills in shared programs: 2924 -> 2922 (-0.07%) spills in affected programs: 104 -> 102 (-1.92%) helped: 1 HURT: 0 total fills in shared programs: 4394 -> 4389 (-0.11%) fills in affected programs: 237 -> 232 (-2.11%) helped: 1 HURT: 0 Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
* i965: Use a separate register for every access to an SSA undef.Kenneth Graunke2016-08-042-13/+11
| | | | | | | | | | | | | | | | | | | | | | Previously, we allocated a new VGRF for every undefined definition. Instead, this patch makes us allocate a new VGRF for every use of an undefined definition. This makes sure that undefined values are fully independent of one another, and have live ranges limited to their single use. This allows register coalescing to combine the source and destination of MOVs from undefined sources, eliminating the MOV altogether. On Broadwell: total instructions in shared programs: 11641187 -> 11640214 (-0.01%) instructions in affected programs: 70199 -> 69226 (-1.39%) helped: 213 HURT: 1 v2: Add a comment (based on Iago's suggested one). Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
* vl/dri3: Destroy Present event context when destroying drawable v2Michel Dänzer2016-08-041-5/+16
| | | | | | | | | | | Without this, the X server may accumulate stale Present event contexts if a client performs several video decoding sessions using the same window. v2: Based on Chris Wilson's review: * Use xcb_discard_reply() instead of free(xcb_request_check()) Reviewed-and-Tested-by: Leo Liu <[email protected]>
* loader/dri3: Destroy Present event context when destroying drawable v2Michel Dänzer2016-08-041-1/+7
| | | | | | | | | | | Without this, the X server may accumulate stale Present event contexts if a client ends up creating and destroying DRI drawables for the same window. v2: Based on Chris Wilson's review: * Use xcb_present_select_input_checked so that protocol errors generated by old X servers can be handled gracefully * Use xcb_discard_reply() instead of free(xcb_request_check())
* gbm: Correct bo_import documentation (trivial)Ben Widawsky2016-08-031-1/+1
| | | | | | | | | | | | | | Missed here: commit a43d286ef7ff65087b1f051d071b829ca7b02073 Author: Kristian Høgsberg <[email protected]> Date: Fri Mar 28 10:17:11 2014 -0700 gbm: Add import from fd Cc: Kristian Høgsberg <[email protected]> Signed-off-by: Ben Widawsky <[email protected]> Signed-off-by: Eric Anholt <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]>
* vc4: Avoid generating a custom shader per level in glGenerateMipmaps().Eric Anholt2016-08-033-7/+25
| | | | | | | | | | We were baking in the LOD of the source level to each shader. Instead, pass it in as a uniform -- this requires storing it to a temp register, but that's better than compiling a ton of separate shaders: total instructions in shared programs: 115032 -> 115036 (0.00%) instructions in affected programs: 96 -> 100 (4.17%) LOST: 572
* vc4: Tell valgrind about BO allocations from mmap time to destroy.Eric Anholt2016-08-032-0/+11
| | | | | | This helps in debugging memory pressure. It would be nice if we could tell valgrind about it all the way from allocation time to destroy, but we need a pointer to hand to VALGRIND_MALLOCLIKE_BLOCK.
* loader: fix memory leak in loader_dri3_openJan Ziak2016-08-031-0/+1
| | | | | | | | | Found via "valgrind --leak-check=full glxgears". Signed-off-by: Jan Ziak (http://atom-symbol.net) <[email protected]> Acked-by: Boyan Ding <[email protected]> Cc: "12.0 11.2" <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* vc4: Fix a leak of the src[] array of VPM reads in optimization.Eric Anholt2016-08-031-4/+5
| | | | Cc: "12.0" <[email protected]>
* vc4: Fix leak of the bo_handles table.Eric Anholt2016-08-031-0/+1
|
* vc4: Fix handling of UBO range offsets.Eric Anholt2016-08-031-2/+3
| | | | | | The ranges are in units of bytes, not dwords. This wasn't caught by piglit tests because ttn tends to make one big uniform file, so we only had one UBO range with a src and dst offset of 0.
* nir: Allow opt_peephole_select to work on empty blocks.Eric Anholt2016-08-031-7/+0
| | | | | | | | | | | | | | nir_opt_peephole_select has the job of removing IF statements with no side effects. However, if the IF statement's successor didn't have any instructions in it, we were skipping it, which occurred in mupen64 on vc4 with glsl_to_nir enabled: instructions in affected programs: 6134 -> 4120 (-32.83%) total uniforms in shared programs: 38268 -> 38219 (-0.13%) No changes on Haswell shader-db. Reviewed-by: Jason Ekstrand <[email protected]>
* vc4: Dump NIR at shader state creation time as well.Eric Anholt2016-08-031-0/+8
| | | | I keep wanting to see this version of the NIR.
* r600g: use last_gfx_fence like radeonsiMarek Olšák2016-08-031-3/+12
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* gallium/radeon: move last_gfx_fence from radeonsi to common codeMarek Olšák2016-08-035-7/+7
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* radeonsi: skip unnecessary si_update_shaders callsMarek Olšák2016-08-034-7/+27
| | | | | | Small decrease in draw call overhead. Reviewed-by: Nicolai Hähnle <[email protected]>
* radeonsi: print the command line to VM fault reports (v2)Marek Olšák2016-08-031-0/+3
| | | | | | v2: rebase on top of Brian's commit Reviewed-by: Nicolai Hähnle <[email protected]>
* ddebug: print the command line to all logs (v2)Marek Olšák2016-08-031-0/+4
| | | | | | | | for piglit with the pipelined hang detection mode v2: rebase on top of Brian's commit Reviewed-by: Nicolai Hähnle <[email protected]>
* ddebug: don't use fmemopen on non-Linux OSMarek Olšák2016-08-031-0/+5
| | | | | | Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97140 Reviewed-by: Nicolai Hähnle <[email protected]>
* radeonsi: don't set the last parameter component of llvm.AMDGPU.cubeMarek Olšák2016-08-031-2/+8
| | | | | | LLVM doesn't use it. Reviewed-by: Nicolai Hähnle <[email protected]>
* radeonsi: use llvm.amdgcn.cube* if availableMarek Olšák2016-08-031-4/+28
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* radeonsi: use llvm.amdgcn.rsq.f64 if availableMarek Olšák2016-08-031-1/+2
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* radeonsi: use v_mad_f32 for fmaMarek Olšák2016-08-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | v_fma_f32 runs at FP64 rate (= slow). Alien Isolation and F1 2015 seem to use fma for all d3d multiply-add instructions, which is silly. This tries to restore performance for those games. The main difference between v_mad_f32 and v_fma_f32 is that v_mad doesn't support denormals, which we don't enable anyway, because they are slow too. Also, there is code size reduction: Totals from affected shaders: VGPRS: 109796 -> 109808 (0.01 %) Spilled SGPRs: 29995 -> 30022 (0.09 %) Spilled VGPRs: 12 -> 13 (8.33 %) <-- it's just one shader going from 12 to 13 Code Size: 6667596 -> 6476356 (-2.87 %) bytes Max Waves: 26931 -> 26899 (-0.12 %) I've not actually tested real performance. Reviewed-by: Nicolai Hähnle <[email protected]>
* i965: use mt->offset in intel_miptree_map_movntdqa()Haixia Shi2016-08-031-0/+3
| | | | | | | | | | | We need to include mt->offset in the calculation of src pointer because its value may be non-zero, for example in a cubemap texture. Signed-off-by: Haixia Shi <[email protected]> Cc: Jason Ekstrand <[email protected]> Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Change-Id: I461ad5b204626d5a1c45611fc6b63735dcf29f63
* nir: fix validation messageTimothy Arceri2016-08-031-2/+2
| | | | | | | Looks like a copy and paste error from f752effa087 Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]>
* .mailmap: Update my addressChad Versace2016-08-021-3/+4
| | | | I left Intel, so make my personal address the canonical address.
* swr: build swr with -fno-strict-aliasingTim Rowley2016-08-021-0/+1
| | | | | | | swr rasterizer contains numerous data transfers between vectors and ordinary C types. Fixing for strict aliasing will take time. Reviewed-by: Matt Turner <[email protected]>
* ast: Updated AST_NUM_OPERATORS for coherence with ast_operatorsAndres Gomez2016-08-022-9/+10
| | | | | | | | | | | | | | | AST_NUM_OPERATORS stores the dimension of the ast_operators enumeration but was not updated after its last modification. This doesn't add any real modification for any code paths but it makes sense for coherence. v2 (Eric Engestrom): Just place the define at the end of the enumeration, not below. Signed-off-by: Andres Gomez <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* i965: Disable the unlit centroid workaround on Gen7.Matt Turner2016-08-021-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Once upon a time (commit 8313f44409) Paul added code for the unlit centroid workaround (WaCopyUnlitCentroidBarys). His commit message claims it fixed the EXT_framebuffer_multisample/interpolation {2,4} {centroid-deriv,centroid-deriv-disabled} piglit tests but does not say on which platform, though he cites the IVB PRM. "3DSTATE_WM [DevIVB, DevHSW]" says "[DevIVB]: Workaround: When Centroid Barycentric mode is required, HW may produce incorrect interpolation results when a 2X2 pixels have unlit pixels." I later disabled it for Haswell (commit f6db414f3c) with no known ill effects. The Sandybridge page does not have this text, but the workarounds database (see WaCopyUnlitCentroidBarys) says the issues applies *only* to Sandybridge, and in fact in commit 1a2de7dce8fc I note that disabling the workaround on Sandybridge causes the tests Paul originally mentioned to fail. So this is, and always has been, a huge confusing mess. Disabling the workaround indeed causes the tests Paul originally mentioned to fail on Sandybridge but not on Ivybridge/Baytrail. On Ivybridge: total instructions in shared programs: 6914901 -> 6909599 (-0.08%) instructions in affected programs: 106766 -> 101464 (-4.97%) helped: 884 total cycles in shared programs: 70874764 -> 70813774 (-0.09%) cycles in affected programs: 794144 -> 733154 (-7.68%) helped: 688 HURT: 186 LOST: 1 GAINED: 6 Reviewed-by: Kenneth Graunke <[email protected]>
* gallium/util: fix align64Marek Olšák2016-08-011-1/+1
| | | | | | | | it cut off the upper 32 bits Cc: [email protected] Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
* mesa: Drop -fno-strict-aliasing.Matt Turner2016-08-011-6/+0
| | | | | | | | | | | | Improves performance of OglBatch7 by 4.06851% +/- 1.17925% (n=169) on Haswell, and cuts ~18k of .text: text data bss dec hex filename 5824627 287816 29384 6141827 5db783 before/i965_dri.so 5806354 287816 29384 6123554 5d7022 after/i965_dri.so Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i915: Avoid aliasing violation.Matt Turner2016-08-011-1/+3
| | | | Reviewed-by: Iago Toral Quiroga <[email protected]>
* draw: Avoid aliasing violations.Matt Turner2016-08-012-3/+6
| | | | Reviewed-by: Marek Olšák <[email protected]>
* r600g: Avoid aliasing violations.Matt Turner2016-08-012-13/+9
| | | | Reviewed-by: Marek Olšák <[email protected]>
* r300g: Avoid aliasing violation.Matt Turner2016-08-011-1/+2
| | | | Reviewed-by: Marek Olšák <[email protected]>
* gallium/auxiliary: Add u_bitcast.h header.Matt Turner2016-08-012-0/+58
| | | | Reviewed-by: Marek Olšák <[email protected]>
* glsl_to_tgsi: Avoid aliasing violations.Matt Turner2016-08-011-4/+2
| | | | Reviewed-by: Dave Airlie <[email protected]>
* st/mesa: silence missing braces warning in st_program.cBrian Paul2016-08-011-1/+1
| | | | | | | | | | | Silence a gcc warning: state_tracker/st_program.c: In function 'st_create_fp_variant': state_tracker/st_program.c:957:10: warning: missing braces around initializer [-Wmissing-braces] nir_lower_drawpixels_options options = {0}; ^ state_tracker/st_program.c:957:10: warning: (near initialization for 'options.texcoord_state_tokens') [-Wmissing-braces] Reviewed-by: Marek Olšák <[email protected]>
* auxiliary/os: add new os_get_command_line() functionBrian Paul2016-08-012-0/+52
| | | | | | | | | | | This can be used by the driver to get the command line which started the process. Will be used by the VMware driver for extra logging. For now, this is only implemented for Linux via /proc/self/cmdline and Windows via GetCommandLine(). Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* svga: avoid redundant SetVertexBuffer/SetIndexBuffer commands at rebindCharmaine Lee2016-08-011-16/+19
| | | | | | | | | | | | This patch eliminates the redundant SetVertexBuffers and SetIndexBuffer commands that are emitted for rebind purpose. With this patch, the set commands will be skipped, but we will still reference the associated resources to allow the kernel to bring in the resources. Tested with Lightsmark2008, Valley, MTT glretrace, piglit, conform. Reviewed-by: Brian Paul <[email protected]>
* u_vbuf: fix potentially bogus assertRob Clark2016-08-011-2/+4
| | | | | | | | | | | | | | | There are cases where we hit u_vbuf path due to alignment or pitch- alignment restrictions, but for an output-format that u_vbuf does not support translating (yet the driver does support natively). In which case we hit the memcpy() path and don't care that u_vbuf doesn't understand it. Fixes crash with debug build of mesa in: dEQP-GLES3.functional.vertex_arrays.single_attribute.strides.fixed.user_ptr_stride17_components2_quads1 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95000 Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gbm: Removed unused function.Ben Widawsky2016-08-012-29/+0
| | | | | | | | | | | | | | AFAICT, it's never been used. It was briefly nudged in the right direction here: commit 10e5ffd4961055ebba5be4d85a93cc66cdd5a635 Author: Emil Velikov <[email protected]> Date: Sat Jan 25 17:19:10 2014 +0000 gbm: do not export _gbm_mesa_get_device Signed-off-by: Ben Widawsky <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]>
* i965: fix comparison warningTimothy Arceri2016-08-011-1/+1
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* vc4: Zero-initialize the hardware sampler view structure.Eric Anholt2016-07-311-1/+1
| | | | | Fixes failure to initialize the force_first_level flag, causing failures in piglit levelclamp.
* mesa: Remove set but not used gl_client_array::Stride.Mathias Fröhlich2016-07-318-9/+1
| | | | | | | | The field is only read for printing today and there it was probably a leftover. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Remove set but not used gl_client_array::Enabled.Mathias Fröhlich2016-07-318-10/+2
| | | | | | | | The way it is used today does not care about the Enabled flag anymore. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* vbo: Use the VAO array enabled flags in vbo_exec_array.Mathias Fröhlich2016-07-311-7/+8
| | | | | | | | | Instead of gl_client_array::Enabled inside a VAO, directly use the gl_vertex_attrib_array::Enabled value which is the origin of the above. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* vbo: Walk the VAO in check_array_data.Mathias Fröhlich2016-07-311-20/+29
| | | | | | | | | Only a debugging function, but move away from gl_client_array and use the first order information from the VAO. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Eric Anholt <[email protected]>