aboutsummaryrefslogtreecommitdiffstats
path: root/src/panfrost
Commit message (Collapse)AuthorAgeFilesLines
* panfrost: Describe thread local storage sizing rulesAlyssa Rosenzweig2019-12-123-1/+82
| | | | | | Deeply nested powers-of-two, basically :-) Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Fix shift for TLS accessAlyssa Rosenzweig2019-12-121-2/+18
| | | | | | | Due to this issue we were using 4x the memory we should have for TLS, which was messing up the size calculations. Oops! Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Simplify and fix vector copypropAlyssa Rosenzweig2019-12-121-14/+5
| | | | | | | | | | | Fixes a regression in QuakeSpasm. See https://gitlab.freedesktop.org/mesa/mesa/issues/2169 for apitrace. Closes #2169 Fixes: f72873e6aa0 ("pan/midgard: Copypropagate vector creation") Signed-off-by: Alyssa Rosenzweig <[email protected]> Reported-by: Icecream95
* pan/midgard: Don't try to free NULL in LCRAAlyssa Rosenzweig2019-12-121-0/+3
| | | | | Signed-off-by: Alyssa Rosenzweig <[email protected]> Fixes: 12e393bacf0 ("panfrost: add lcra_free() to free lcra state")
* pan/midgard: Force alignment for csel_vAlyssa Rosenzweig2019-12-121-0/+8
| | | | | | | | | | | | The swizzle on the conditional gets lost. Fixes "horizontal mirroring" in godot. See https://gitlab.freedesktop.org/mesa/mesa/issues/2108 which has attached apitrace. Signed-off-by: Alyssa Rosenzweig <[email protected]> Fixes: d3b3daa9d3f ("pan/midgard: Use new scheduler") Reported-by: Icecream95
* pan/midgard: Don't use no_spill for memory spill srcAlyssa Rosenzweig2019-12-121-2/+4
| | | | | | | | I'm not totally sure why this would *break* things, but it's certainly not necessary and it does break things. Somehow this gives the RA more freedom, fixing some spill issues. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Use no_spill bitmaskAlyssa Rosenzweig2019-12-122-15/+16
| | | | | | | | We would like no_spill decisions to be class-specific -- spilling from special register to a work register doesn't preclude also spilling that work register to stack. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Dynamically allocate r26/27 for spillsAlyssa Rosenzweig2019-12-122-5/+10
| | | | | | | | | | This allows us to spill two 128-bit values in the same bundle, since we have two registers we can spill with. This improves the register allocation flexibility in programs with heavy spilling, though unfortunately it isn't sufficient (theoretically, 3.5 128-bit values can be spilled from 3 vector units and 2 scalar units). Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Remove code marked "TODO: remove me"Alyssa Rosenzweig2019-12-121-5/+0
| | | | | | It's a fossil, how cute :-) Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Remove consecutive_skip codeAlyssa Rosenzweig2019-12-121-18/+8
| | | | | | | This has been unused since the beginning since it's broken. Let's toss it so it doesn't get in the way of further fixes. Bigger to fish to fry. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Move bounds checking into LCRAAlyssa Rosenzweig2019-12-122-9/+5
| | | | | | This simplifies the cost calculation code a bit. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Remove spill cost heuristicAlyssa Rosenzweig2019-12-121-21/+0
| | | | | | | | | | We do need some sort of a cost heuristic, but this one is just causing spilling to behave worse on shaders I'm looking at, and I don't need more noise in the spill implementation right now. Get it working first. We can optimize this later. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Simplify spillability testAlyssa Rosenzweig2019-12-121-27/+9
| | | | | | | | Let's not worry about spilling twice in a bundle; that's too restrictive. We'll need to change the schedule itself -- unfortunately, this can have second-order effects due to pipeline registers. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Split spill node selection/spillingAlyssa Rosenzweig2019-12-121-20/+30
| | | | | | | Instead of having a giant function for both, split into the two subtasks so we can handle errors better. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Move spilling code out of schedulerAlyssa Rosenzweig2019-12-127-339/+380
| | | | | | | We move it to the register allocator itself. It doesn't belong in midgard_schedule.c! Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Remove undefined behaviorTomeu Vizoso2019-12-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | As found by UBSAN, it should be harmless but it's good to remove any UB so the tool's output is useful. ../src/panfrost/midgard/midgard_schedule.c:1094:9: runtime error: index -1 out of bounds for type 'midgard_instruction *[6]'"} #0 0xad047872 in schedule_block ../src/panfrost/midgard/midgard_schedule.c:1094"} #1 0xad04d41a in schedule_program ../src/panfrost/midgard/midgard_schedule.c:1116"} #2 0xad031f98 in midgard_compile_shader_nir ../src/panfrost/midgard/midgard_compile.c:2588"} #3 0xacf9874e in panfrost_shader_compile ../src/gallium/drivers/panfrost/pan_assemble.c:68"} #4 0xacf6b268 in panfrost_bind_shader_state ../src/gallium/drivers/panfrost/pan_context.c:1960"} #5 0xaae2596e in st_update_fp ../src/mesa/state_tracker/st_atom_shader.c:168"} #6 0xaae12316 in st_validate_state ../src/mesa/state_tracker/st_atom.c:261"} #7 0xaadc58c2 in prepare_draw ../src/mesa/state_tracker/st_draw.c:132"} #8 0xaadc58c2 in st_draw_vbo ../src/mesa/state_tracker/st_draw.c:184"} #9 0xabc4f924 in _mesa_validated_drawrangeelements ../src/mesa/main/draw.c:816"} #10 0xabc50240 in _mesa_DrawElements ../src/mesa/main/draw.c:970"} #11 0x73ebd2 in glu::CallLogWrapper::glDrawElements(unsigned int, int, unsigned int, void const*) (/deqp/modules/gles2/deqp-gles2+0x2d4bd2)"} #12 0x6d86b2 in deqp::gls::FragOpInteractionCase::iterate() (/deqp/modules/gles2/deqp-gles2+0x26e6b2)"} #13 0x494d16 in deqp::gles2::TestCaseWrapper::iterate(tcu::TestCase*) (/deqp/modules/gles2/deqp-gles2+0x2ad16)"} #14 0x7f9cf2 in tcu::TestSessionExecutor::iterateTestCase(tcu::TestCase*) (/deqp/modules/gles2/deqp-gles2+0x38fcf2)"} #15 0x7fa5f0 in tcu::TestSessionExecutor::iterate() (/deqp/modules/gles2/deqp-gles2+0x3905f0)"} #16 0x7e1aac in tcu::App::iterate() (/deqp/modules/gles2/deqp-gles2+0x377aac)"} #17 0x492d4c in main (/deqp/modules/gles2/deqp-gles2+0x28d4c)"} #18 0xb64b9aa8 in __libc_start_main (/lib/arm-linux-gnueabihf/libc.so.6+0x1aaa8)"} Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Add PAN_MESA_DEBUG=syncTomeu Vizoso2019-12-112-1/+5
| | | | | | | | | | | Sometimes it's useful to get information about GPU faults in the console, so it's synchronized with other messages. This commit will cause Mesa to wait for completion and check if there are any faults raised by the GPU. Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: free spill cost table in mir_spill_registerUrja Rannikko2019-12-061-0/+2
| | | | | Signed-off-by: Urja Rannikko <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: add lcra_free() to free lcra stateUrja Rannikko2019-12-063-1/+25
| | | | | Signed-off-by: Urja Rannikko <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: free allocations in schedule_blockUrja Rannikko2019-12-061-0/+3
| | | | | Signed-off-by: Urja Rannikko <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: free last_read/write tables in mir_create_dependency_graphUrja Rannikko2019-12-061-0/+3
| | | | | Signed-off-by: Urja Rannikko <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Rename SET_VALUE to WRITE_VALUEAlyssa Rosenzweig2019-12-062-9/+9
| | | | | | | | | See https://lists.freedesktop.org/archives/dri-devel/2019-December/247601.html Write value emphasises that it's just a generic write primitive. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Update SET_VALUE with information from igtAlyssa Rosenzweig2019-12-062-4/+22
| | | | | | | It's not a tiler specific initialization; it's a generic GPU-side write primitive that may be used for tiler reset on midgard. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Remove blend shader hackAlyssa Rosenzweig2019-12-031-2/+1
| | | | | | This is no longer used. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Splatter on fragment outAlyssa Rosenzweig2019-12-031-1/+20
| | | | | | | Make sure that the fragment is complete when writing it out. Signed-off-by: Alyssa Rosenzweig <[email protected]> Signed-off-by: Tomeu Vizoso <[email protected]>
* panfrost: Implement pan_tiler for non-hierarchy GPUsAlyssa Rosenzweig2019-12-034-126/+93
| | | | | | | | | | | | | | | | The algorithm is as described. Nothing fancy here, just need to add some new code paths depending on which model we're running on. Tomeu: - Also disable tiling when !hierarchy and !vertex_count - Avoid creating polygon lists smaller than the minimum when vertex_count > 0 but tile size smaller than 16 byte - Take into account tile size when calculating polygon list size for !hierarchy - Allow 0-sized tiles in a single dimension Signed-off-by: Alyssa Rosenzweig <[email protected]> Signed-off-by: Tomeu Vizoso <[email protected]>
* panfrost: Add information about T720 tilingAlyssa Rosenzweig2019-12-031-1/+46
| | | | | | | We've figured out most of the big pieces, and though it looks faintly like other Midgards, it's much simpler. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Add quirks system to cmdstreamTomeu Vizoso2019-12-031-0/+67
| | | | | | | | Similarly to how it's already done in the compiler, add a way to express differences between GPU models that need to be taken into account when assembling the cmdstream. Signed-off-by: Tomeu Vizoso <[email protected]>
* pan/midgard: Use lower_tex_without_implicit_lodAlyssa Rosenzweig2019-11-221-10/+3
| | | | | | | | | | | Just a bit of cleanup. lower_tex can do this lowering for us, which should also eliminate some special cases (one less thing to fix if we ever need texturing in tess/geom/etc, perhaps?) Closes #2133 Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Tomeu Vizoso <[email protected]>
* panfrost: Add lcra.c to Android.mkAlyssa Rosenzweig2019-11-221-1/+2
| | | | | | | This was forgotten. Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Tomeu Vizoso <[email protected]>
* pan/midgard: Enable LOD lowering only on buggy chipsAlyssa Rosenzweig2019-11-221-2/+7
| | | | | | | | T720 and earlier need this workaround, so check the quirk before lowering. Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Tomeu Vizoso <[email protected]>
* pan/midgard: Describe quirk MIDGARD_BROKEN_LODAlyssa Rosenzweig2019-11-221-2/+13
| | | | | | | Corresponds to errata #10471, applies to T6xx and T720. Fixed in T760. Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Tomeu Vizoso <[email protected]>
* pan/midgard: Add LOD bias/clamp loweringAlyssa Rosenzweig2019-11-224-1/+103
| | | | | | | | | We fetch the info with the new intrinsic and lower with ALU ops for txl instructions, which seemingly correspond to "TEXGRD" instructions (what we call textureLod). Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Tomeu Vizoso <[email protected]>
* pan/midgard: Implement load_sampler_lod_paramaters_panAlyssa Rosenzweig2019-11-222-0/+15
| | | | | | | | We can stuff this information in as parametrized system values, like we currently do texture size and SSBO addresses. Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Tomeu Vizoso <[email protected]>
* panfrost: Add the lod_bias fieldAlyssa Rosenzweig2019-11-212-1/+5
| | | | | | | Enough trial and error ... just think even *more* Midgard about where this field might be! Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Don't print the midgard_blend_rt structs on SFBDTomeu Vizoso2019-11-201-1/+1
| | | | | Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Just print tiler fields as-is for Tx20Tomeu Vizoso2019-11-201-6/+48
| | | | | | | | The tiler unit in these GPUs is quite different and we haven't reverse engineered enough of it yet to validate and pretty print it. Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Introduce quirks checksAlyssa Rosenzweig2019-11-205-10/+92
| | | | | | | | | | | | | Rather than open-coding checks on gpu_id in the compiler, let's track quirks applying to whatever we're compiling for, to allow us to manage the complexity of many heterogenous GPUs in the compiler. It was discovered that a workaround used on T720 is also required on T820 (and presumably T830), so let's fix this. This will also decrease friction as we continue improving T720 support. Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Tomeu Vizoso <[email protected]>
* pan/midgard: Use shader stage in mir_op_computes_derivativeAlyssa Rosenzweig2019-11-183-3/+10
| | | | | | | A 'normal' texture op may be emitted in a vertex shader on T720 but it still doesn't take any derivatives. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Represent ld/st offset unpackedAlyssa Rosenzweig2019-11-176-47/+14
| | | | | | | This simplifies manipulation of the offsets dramatically, fixing some UBO access related bugs. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Fix masks/alignment for 64-bit loadsAlyssa Rosenzweig2019-11-174-13/+37
| | | | | | | | These need to be handled with special care. Oh, Midgard, you're *extra* special. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Expose more typesize helpersAlyssa Rosenzweig2019-11-172-1/+21
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Implement non-aligned UBOsAlyssa Rosenzweig2019-11-171-5/+2
| | | | | | The field is more fine-grained than we had assumed. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Use generic constant packing for 8/64-bitAlyssa Rosenzweig2019-11-151-1/+1
| | | | | | | Eventually, we will want to combine constants across types, but for now let's not break the world. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Pack 64-bit swizzlesAlyssa Rosenzweig2019-11-151-21/+63
| | | | | | | 64-bit ops have their own funky swizzles. Let's pack them, both for native 64-bit sources as well as extended 32-bit sources. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Fix mir_round_bytemask_down for !32bAlyssa Rosenzweig2019-11-151-2/+2
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Implement i2i64 and u2u64Alyssa Rosenzweig2019-11-151-1/+3
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Expand 64-bit writemasksAlyssa Rosenzweig2019-11-152-7/+11
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Prioritize texture registersAlyssa Rosenzweig2019-11-151-2/+13
| | | | | | | | | | On newer GPUs, this is a no-op. On older GPUs, this prevents needless spilling since texture registers are shared with a subset of work registers. Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Tomeu Vizoso <[email protected]> Tested-by: Andre Heider <[email protected]>
* pan/midgard: Disassemble with old pipeline always on T720Alyssa Rosenzweig2019-11-151-2/+2
| | | | | | Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Tomeu Vizoso <[email protected]> Tested-by: Andre Heider <[email protected]>