summaryrefslogtreecommitdiffstats
path: root/src/panfrost
Commit message (Collapse)AuthorAgeFilesLines
* pan/midgard: Fix invert fusing with r26Alyssa Rosenzweig2019-08-262-2/+19
| | | | | | The invert wasn't applying (correctly) due to the issues addressed here. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Fold ssa_args into midgard_instructionAlyssa Rosenzweig2019-08-2616-249/+210
| | | | | | This is just a bit of refactoring to simplify MIR. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Add imov->fmov optimizationAlyssa Rosenzweig2019-08-264-0/+85
| | | | | | | | | | | | | | | | | | When moving constants, if switching to a floating-point representation doesn't break anything, we'd rather have an fmov than an imov, permitting inlining the constant in many circumstances. total quadwords in shared programs: 3408 -> 3366 (-1.23%) quadwords in affected programs: 1188 -> 1146 (-3.54%) helped: 41 HURT: 0 helped stats (abs) min: 1 max: 2 x̄: 1.02 x̃: 1 helped stats (rel) min: 0.19% max: 25.00% x̄: 9.65% x̃: 11.11% 95% mean confidence interval for quadwords value: -1.07 -0.98 95% mean confidence interval for quadwords %-change: -11.38% -7.93% Quadwords are helped. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Switch constants to uint32Alyssa Rosenzweig2019-08-263-10/+17
| | | | | | | | Storing constants as float doesn't make sense when we have integer instructions; better to switch to be integer natively and coerce to/from float rather than the opposite. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard, bifrost: Set lower_fdph = trueAlyssa Rosenzweig2019-08-262-0/+2
| | | | | | fdph instructions show up in some desktop GL shaders. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/decode: Validate and quiet helper invocation flagAlyssa Rosenzweig2019-08-231-1/+8
| | | | | | | | We can statically determine from the disassembly if helper invocations will be needed, so we can validate the corresponding bit in the cmdstream and thus avoid printing the bit itself in the decode. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Analyze helper invocationsAlyssa Rosenzweig2019-08-232-0/+22
| | | | | | | | We check for texture ops which calculate derivatives (either explicitly via dFd* or implicitly) and mark the shader as requiring helper invocations. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Fix writeout combiningAlyssa Rosenzweig2019-08-221-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | shader-db regression in the scheduler. Fixes: dff4986b1aa ("pan/midgard: Emit store_output branch just-in-time") total bundles in shared programs: 2055 -> 2019 (-1.75%) bundles in affected programs: 1055 -> 1019 (-3.41%) helped: 36 HURT: 0 helped stats (abs) min: 1 max: 1 x̄: 1.00 x̃: 1 helped stats (rel) min: 0.35% max: 20.00% x̄: 6.71% x̃: 5.16% 95% mean confidence interval for bundles value: -1.00 -1.00 95% mean confidence interval for bundles %-change: -8.45% -4.97% Bundles are helped. total quadwords in shared programs: 3444 -> 3408 (-1.05%) quadwords in affected programs: 1897 -> 1861 (-1.90%) helped: 36 HURT: 0 helped stats (abs) min: 1 max: 1 x̄: 1.00 x̃: 1 helped stats (rel) min: 0.19% max: 14.29% x̄: 3.97% x̃: 2.99% 95% mean confidence interval for quadwords value: -1.00 -1.00 95% mean confidence interval for quadwords %-change: -5.08% -2.86% Quadwords are helped. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Implement gl_FragCoord correctlyAlyssa Rosenzweig2019-08-221-6/+13
| | | | | | | | Rather than passing through the transformed gl_Position, we can use the hardware-level varying for this, which will correctly handle gl_FragCoord.w Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/decode: Handle special varyingsAlyssa Rosenzweig2019-08-221-5/+41
| | | | | | | We need a special path for special varyings so we parse them correctly instead of throwing an error when they inevitably point to bad memory. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/decode: Remove size/stride divisibility checkAlyssa Rosenzweig2019-08-221-7/+3
| | | | | | | | | The hardware doesn't care, and a lot of Panfrost code relies on an oversized buffer. The important part is that (stride * padded_num_vertices) is no greater than size, which we'll need to check once we validate instancing. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/decode: Decouple attribute/meta printingAlyssa Rosenzweig2019-08-221-4/+8
| | | | | | They are independent fields, so the parser should reflect that. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/decode: Print stub for uniformsAlyssa Rosenzweig2019-08-221-1/+11
| | | | | | | We don't need to dump the contents necessary, but having the stub with the address is useful. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/decode: Decode actual varying_meta addressAlyssa Rosenzweig2019-08-221-1/+1
| | | | | | | I don't know who thought this mask was a good idea but unfortunately it must have been me. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/decode: Downgrade shader property mismatch to warningAlyssa Rosenzweig2019-08-221-1/+2
| | | | | | | If we permit more $whatever through than the shader needs, that's a bit of a waste, but it isn't an error. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/decode: Validate, but do not print, index bufferAlyssa Rosenzweig2019-08-222-30/+29
| | | | | | | We don't actually care about the *contents* of the index buffer, but we would rather like to ensure it is present and of the correct size. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/decode: Validate mali_shader_meta statsAlyssa Rosenzweig2019-08-221-35/+78
| | | | | | | | | We can infer these stats in many cases from the disassembly, so we should try to sanity check where we can. We may need to be fuzzy about analysis, since analysis gives us a bound but we don't mind if it's not used fully by the shader. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/decode: Disassemble before printing shader descriptorAlyssa Rosenzweig2019-08-221-10/+8
| | | | | | This allows the shader descriptor to access the disassembled stats. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/decode: Promote <no shader> to an errorAlyssa Rosenzweig2019-08-221-1/+1
| | | | | | | There is no reason this should happen to an in-spec program, as far as I know. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/decode: Fix uniform printingAlyssa Rosenzweig2019-08-221-3/+3
| | | | | | Lazypasting from UBOs. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/decode: Validate blend shaders don't access I/OAlyssa Rosenzweig2019-08-221-2/+21
| | | | | | | | We could do better by forcing the checks to *equal* zero (right now, an indeterminate answer will pass the checks), but this is a start to guard against some egregious cases. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/decode: Validate and simplify FRAGMENT payloadsAlyssa Rosenzweig2019-08-221-12/+38
| | | | | | | | There are a number of conditions we need to test for to statically check for TILE_RANGE_FAULTs, but once these checks are in order, we can print as-is. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/decode: Validate MFBD tagsAlyssa Rosenzweig2019-08-222-38/+79
| | | | | | | | | These tags need to match up with what's actually described by the MFBD, so check this. Once this is checked, since the type and contents of the FBD are obvious from printing above, there's no need to explicitly mark off the framebuffer line. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/decode: Eliminate non-FBD dumped caseAlyssa Rosenzweig2019-08-221-29/+7
| | | | | | We don't need *more* cases to deal with. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/decode: Removing uniform buffer framingAlyssa Rosenzweig2019-08-221-13/+2
| | | | | | | | We can do single line prints: ubuf_0[192] = memory_161f5000 + 896; Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/decode: Remove mali_attr(_meta) framingAlyssa Rosenzweig2019-08-221-13/+2
| | | | | | It doesn't give any real added value. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Disassemble integer constants in hexAlyssa Rosenzweig2019-08-221-2/+2
| | | | | | It's usually easier to parse mentally. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Explain ffmaAlyssa Rosenzweig2019-08-221-0/+3
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Analyze simple loads/storeAlyssa Rosenzweig2019-08-221-5/+50
| | | | | | | | | | | | | | For shaders using exclusively direct attribute/varyings, we can work this out statically. For shaders with indirect access, we just set an upper bound of 16 (the max attributes/varyings we support) and the actual count will be reported regardless. We proceed similarly for textures/samplers, as well as for UBOs. While UBOs can be *indexed* indirectly, the *UBO itself* -- which is what we count in the shader descriptor (rather than the UBO descriptors) -- is statically determinable. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Compute work_count via writesAlyssa Rosenzweig2019-08-221-1/+25
| | | | | | This is exact. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Sketch static analysis to uniform countAlyssa Rosenzweig2019-08-221-0/+27
| | | | | | | | | | | | | | | This one is a little tricky, but the idea is that: r16-r23 are always uniforms r8-r15 are sometimes work, sometimes uniforms... ...but as work, they are always written before use ...and as uniforms, they are never written before use So we use that heuristic to determine the count to feed the machine. We'll record work register use in the next commit. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/decode: Hoist shader-db stats to shared decodeAlyssa Rosenzweig2019-08-224-38/+70
| | | | | | We'll want all this information to validate the shader descriptor. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard,bifrost: Expand nir_const_load_to_arrAlyssa Rosenzweig2019-08-222-2/+2
| | | | | | | | Panfrost is the only user of the macro; we are better off expanding than having random stuff in nir.h. Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
* pan/midgard: Identify and disassemble indirect texture/samplerAlyssa Rosenzweig2019-08-212-6/+28
| | | | | | | | | | | | | A pair of special flags can turn the texture/sampler handle fields into register selects. This means code like: texture(uTextures[hr28.w], ...) can be compiled to something like: texture ..., fsampler[hr28.w], texture[hr28.w] Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Breakout texture reg select printerAlyssa Rosenzweig2019-08-211-9/+26
| | | | | | | This data structure is shared in other parts of the texture word, so let's streamline printing. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/bifrost: Correct file size signednessAlyssa Rosenzweig2019-08-211-2/+2
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Mark fallthrough explicitlyAlyssa Rosenzweig2019-08-211-0/+1
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Simplify contradictory check.Alyssa Rosenzweig2019-08-211-4/+1
| | | | | | Coverity. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Reorder bits check to fix 8-bit masksAlyssa Rosenzweig2019-08-211-5/+5
| | | | | | Coverity. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Represent unused nodes by ~0Alyssa Rosenzweig2019-08-2111-58/+56
| | | | | | | This allows nodes to be unsigned and prevents a class of weird signedness bugs identified by Coverity. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/bifrost: Avoid buffer overflow in disassemblerAlyssa Rosenzweig2019-08-211-1/+4
| | | | | | | This path shouldn't be possible for in-spec shaders, but let's be defensive. (Because security, right? Mostly because Coverity.) Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/decode: Remove all_zeroAlyssa Rosenzweig2019-08-211-13/+7
| | | | | | The checks confuse Coverity, so let's make it explicit what's going on. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/decode: Don't leak FBD pointerAlyssa Rosenzweig2019-08-211-3/+5
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Allocate `dependencies` on stackAlyssa Rosenzweig2019-08-211-1/+4
| | | | | | It's small; this way we don't leak memory. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Free liveness infoAlyssa Rosenzweig2019-08-211-0/+2
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/decode: Cleanup mali_attr printingAlyssa Rosenzweig2019-08-211-20/+44
| | | | | | | | We can smush this into one-line per record as per usual. We still need more validation and cleaning this up, especially around instancing. But for LINEAR records, it works okay already. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/decode: Validate attribute/varying buffer pointerAlyssa Rosenzweig2019-08-211-0/+3
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/decode: Include address in union mali_attrAlyssa Rosenzweig2019-08-211-19/+7
| | | | | | No need to break it out into extra lines. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/decode: Use concise texture printingAlyssa Rosenzweig2019-08-211-33/+35
| | | | | | | | This consolidates texture format and dimensionality into something simple: tiled rgba8_unorm.rgb1: 512x512 Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Break up usage2 fieldAlyssa Rosenzweig2019-08-212-9/+32
| | | | | | This is another bit field describing layout. Signed-off-by: Alyssa Rosenzweig <[email protected]>