aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/panfrost
Commit message (Collapse)AuthorAgeFilesLines
* panfrost: Size tiled temp buffers correctlyAlyssa Rosenzweig2019-04-043-8/+13
| | | | | | | | This should lower transient memory usage and improve performance slightly (due to less memory to malloc/free, better cache locality, etc). Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Respect box->width in tiled storesAlyssa Rosenzweig2019-04-043-4/+6
| | | | | | | This fixes a regression uploading partial tiled textures introduced sometime during the cubemap series. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Cleanup some indirection in pan_resourceAlyssa Rosenzweig2019-04-041-24/+21
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Implement system valuesAlyssa Rosenzweig2019-04-047-188/+229
| | | | | | | | | | | | | | | | | | This patch implements system values via specially-crafted uniforms. While we previously had an ad hoc system for passing the viewport into the vertex shader, this commit generalizes the system to allow for arbitrary system values to be added to both shader stages. While we're at it, we clean up uniform handling code (which was considerably muddied to handle the ad hoc viewport uniform). This commit serves as both a cleanup of the existing codebase and the precursor to new functionality, like implementing textureSize(). Concurrent with these changes is respecting the depth transform, which was not possible with the old fixed uniform system and here serves as a proof-of-correctness test (as well as justifying the NIR changes). Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Remove support for legacy kernelsAlyssa Rosenzweig2019-04-035-25/+3
| | | | | | | | | | | | | | Previously, there was minimal support for interoperating with legacy kernels (reusing kernel modules originally designed for proprietary legacy userspaces, rather than for upstream-friendly free software stacks). Now that the Panfrost kernel is stabilising, this commit drops the legacy code path. Panfrost users need to use a modern, mainline kernel supporting the Panfrost kernel driver from this commit forward. Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Tomeu Vizoso <[email protected]>
* panfrost: Implement FIXED formatsAlyssa Rosenzweig2019-03-311-0/+9
| | | | | | Fixes crash in dEQP-GLES2.functional.draw.random.9 Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Fix index calculation types and assertsAlyssa Rosenzweig2019-03-311-5/+4
| | | | | | | Fixes crash in dEQP-GLES2.functional.draw.draw_elements.points.single_attribute. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Clean index state between indexed drawsAlyssa Rosenzweig2019-03-311-1/+3
| | | | | | | Fixes subsequent tests in dEQP-GLES2.functional.draw.draw_elements.indices.* Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/decode: Print negative_startAlyssa Rosenzweig2019-03-311-0/+2
| | | | | | This property slipped through.. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Implement missing texture formatsAlyssa Rosenzweig2019-03-312-1/+17
| | | | | | | | | | - Implements RGB565/RGBA5551 formats - Don't advertise support for flipped RGBA5551 and ETC Fixes remaining tests in dEQP-GLES2.functional.texture.format.* which is now at 36/36. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Extend tiling for cubemapsAlyssa Rosenzweig2019-03-311-14/+14
| | | | | | | transfer_unmap now tiles for any tiled resource, not just TEXTURE_2D, which should more than just cubemaps! Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Implement command stream for linear cubemapsAlyssa Rosenzweig2019-03-312-6/+8
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/midgard: Emit cubemap coordinatesAlyssa Rosenzweig2019-03-312-5/+32
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Include all cubemap faces in bitmap listAlyssa Rosenzweig2019-03-311-3/+9
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/decode: Decode all cubemap facesAlyssa Rosenzweig2019-03-311-1/+7
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Preliminary work for cubemapsAlyssa Rosenzweig2019-03-313-6/+10
| | | | | | | Again, not yet functional, but this sets up the memory management for cube maps. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/midgard: Add L/S op for writing cubemap coordinatesAlyssa Rosenzweig2019-03-311-0/+9
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/midgard: Disassemble `cube` texture opAlyssa Rosenzweig2019-03-311-0/+1
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Fix vertex buffer corruptionAlyssa Rosenzweig2019-03-311-4/+6
| | | | | | Fixes crash in dEQP-GLES2.functional.buffer.* Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Wait for last job to finish in force_flush_fragmentTomeu Vizoso2019-03-271-0/+8
| | | | | Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Pass the context BOs to the kernel so they aren't unmapped while ↵Tomeu Vizoso2019-03-271-3/+9
| | | | | | | in use Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Also tell the kernel about the checksum_slabTomeu Vizoso2019-03-271-4/+9
| | | | | Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Set the GEM handle for AFBC buffersTomeu Vizoso2019-03-271-0/+1
| | | | | Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Fix sscanf format optionsTomeu Vizoso2019-03-271-2/+2
| | | | | Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Preliminary work for mipmapsAlyssa Rosenzweig2019-03-278-207/+163
| | | | | | | | | | | | | | This patch refactors a substantial amount of code in preparation for mipmaps. In particular, we know have a correct slice abstraction based on offsets; cpu/gpu are no longer arbitrary pointers. We additionally shuffle around other code to accompany these changes and cleanup how tiled textures are handled, while drawing some attention to the blit code. Mipmaps are still disabled at this point, as autogeneration is not yet implemented; enabling as-is would cause regressions. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/midgard: fpow is a two-part operationAlyssa Rosenzweig2019-03-264-4/+4
| | | | | | | | | In fact, the native "fpow" instruction only does half of it; more work is needed for the actual instruction. For now, just lower. Fixes: 1ea42894c ("panfrost/midgard: Implement fpow") Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/midgard: Handle i2b constantAlyssa Rosenzweig2019-03-261-1/+1
| | | | | | | Fixes dEQP-GLES2.functional.shaders.conversions.scalar_to_scalar.int_to_bool_fragment Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/midgard: Expand fge lowering to more typesAlyssa Rosenzweig2019-03-263-6/+12
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/midgard: Add ult/ule opsAlyssa Rosenzweig2019-03-263-0/+7
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Stub out ES3 caps/callbacksAlyssa Rosenzweig2019-03-262-1/+54
| | | | | | | | | Although this is not functional (and the command stream side is not aiming for ES3 right now), this is enough to run dEQP-GLES3 shader tests with the version override directive; this is useful, as some ES3 shader feature can occur in ES2 class shaders due to lowering. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/midgard: Cleanup midgard_nir_algebraic.pyAlyssa Rosenzweig2019-03-261-1/+1
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/midgard: Lower source modifiers for intsAlyssa Rosenzweig2019-03-264-2/+22
| | | | | | | | | | | | | On Midgard, float ops support standard source modifiers (abs/neg) and destination modifiers (sat/pos/round). Integer ops do not support these, however. To cope, we use native NIR source modifiers for floats, but lower them away to iabs/ineg for integers, implementing those ops simultaneously to avoid regressions. Fixes the integer tests in dEQP-GLES2.functional.shaders.operator.unary_operator.minus.* Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/midgard: Implement b2i; improve b2f/f2bAlyssa Rosenzweig2019-03-261-18/+30
| | | | | | | Fixes dEQP-GLES2.functional.shaders.conversions.scalar_to_scalar.bool_to_int_fragment Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/midgard: Lower i2b32Alyssa Rosenzweig2019-03-261-0/+1
| | | | | | | Fixes dEQP-GLES2.functional.shader.conversions.scalar_to_scalar.int_to_bool_vertex Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/midgard: Lower f2b32 to fneAlyssa Rosenzweig2019-03-261-0/+7
| | | | | | | Fixes dEQP-GLES2.functional.shaders.swizzles.vector_swizzles.mediump_bvec2_x_vertex Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/midgard: Lower bool_to_int32Alyssa Rosenzweig2019-03-261-20/+23
| | | | | | | Fixes dEQP-GLES2.functional.shaders.linkage.varying_type_vec2 (among many others). Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/midgard: Map more bany/ball opcodesAlyssa Rosenzweig2019-03-261-0/+11
| | | | | | | | | | | Some of these are not yet fully functional due to related bugs, but this the correct op mapping. The native ball/bany opcodes act on vec4's unconditionally. That said, both ball and bany have the nice property that duplicating an argument does not affect their output, so the default "hanging swizzles" allow us to implement 2/3-component opcodes correctly, implicitly lowering. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/midgard: Add more ball/bany, iabs opsAlyssa Rosenzweig2019-03-261-0/+29
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/midgard: Schedule ball/bany to vectorsAlyssa Rosenzweig2019-03-261-4/+4
| | | | | | Though they output scalars, they need a vector unit to make sense. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/midgard: Add fcsel_i opcodeAlyssa Rosenzweig2019-03-262-0/+3
| | | | | | | | | Whereas a normal fcsel acts on a boolean input in r31.w, the fcsel_i variant acts on an integer input in r31.w, which can be preloaded with an instruction like imov (with the appropriate negate flag on the source). Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Implement scissor testAlyssa Rosenzweig2019-03-261-6/+16
| | | | | | | This preliminary implementation should handle some basic cases. Future work should scissor the FRAGMENT job as well for efficiency. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Fix viewportsAlyssa Rosenzweig2019-03-261-7/+16
| | | | | | | | | Our viewport code hardcoded a number of wrong assumptions, which sort of sometimes worked but was definitely wrong (and broke most of dEQP). This corrects the logic, accounting for flipped-Y framebuffers, which fixes... most of dEQP. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/midgard: Fix b2f32 swizzle for vectorsAlyssa Rosenzweig2019-03-261-6/+8
| | | | | | Fixes issues in most of dEQP-GLES2.functional.shaders.* Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Properly align strideDaniel Stone2019-03-207-25/+20
| | | | | | | | | | | | | | Handle buffers whose width is not aligned to 16px by padding the stride and storing it accordingly. This does not reject imports for images whose stride is not sufficiently aligned. v2: make sure bo->stride is set on imported buffers, and add missing variable definition. (Tomeu) Tested-by: Tomeu Vizoso <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Rewrite varying assemblyAlyssa Rosenzweig2019-03-196-217/+141
| | | | | | | | | | | | | | | | | | | | | | | There are two stages to varying assembly in the command stream: creating the varying buffers in the command stream, and creating the varying meta descriptors (also in the command stream) linked to the aforementioned buffers. The previous code for this was ad hoc and brittle, making some invalid assumptions causing unmaintainable workarounds to pile up across the driver (both compiler and command stream side). This patch completely rewrites the varying assembly code. There's a trivial performance penalty (we now memcpy the varying meta to the command stream on draw, rather than on compile). That said, the improvement in flexibility and clarity is well-worth it. The motivator for these changes was support for gl_PointCoord (and eventually point sprites for legacy GL), which was impossible to implement with the old varying assembly code. With the new refactor, it's super easy; support for gl_PointCoord is included with this patch. All in all, I'm quite happy with how this turned out. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Replay more varying buffersAlyssa Rosenzweig2019-03-191-1/+1
| | | | | | This is required for gl_PointCoord to show up on decodes. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/decode: Respect primitive size pointersAlyssa Rosenzweig2019-03-191-3/+7
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Disable PIPE_CAP_TGSI_TEXCOORDAlyssa Rosenzweig2019-03-191-3/+0
| | | | | | I don't know why this was on to begin with...? Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Fix primconvert checkAlyssa Rosenzweig2019-03-191-1/+1
| | | | | | | In addition to fixing actual primconvert bugs, this prevents an infinite loop when trying to draw POINTS. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Workaround buffer overrun with mip levelAlyssa Rosenzweig2019-03-191-1/+0
| | | | | | | Mipmaps are still broken, but at least this way we don't crash on some apps using mipmaps. Signed-off-by: Alyssa Rosenzweig <[email protected]>