aboutsummaryrefslogtreecommitdiffstats
path: root/src/panfrost/encoder
Commit message (Collapse)AuthorAgeFilesLines
* pan_bo.h: add time.h include for time_tPeter Seiderer2020-06-071-0/+1
| | | | | | | | | | Fixes: ../src/gallium/drivers/panfrost/pan_bo.h:93:9: error: unknown type name ‘time_t’ Signed-off-by: Peter Seiderer <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4279>
* Revert "panfrost: Keep cached BOs mmap'd"Icecream952020-06-051-5/+17
| | | | | | | | | | This reverts commit 794c239a990e08b5a42d42607e9c5e5b0921390c. A kernel bug causes cached BOs to not be unmapped correctly, triggering "bad page cache" kernel messages and causing short hangs. Reviewed-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5355>
* panfrost: Only use AFBC YTR with RGB and RGBAIcecream952020-06-031-3/+5
| | | | | | | The "lossless colorspace transform" is lossy for R and RG formats. Reviewed-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5293>
* meson: use gnu_symbol_visibility argumentDylan Baker2020-06-011-2/+2
| | | | | | | | | | This uses a meson builtin to handle -fvisibility=hidden. This is nice because we don't need to track which languages are used, if C++ is suddenly added meson just does the right thing. Acked-by: Matt Turner <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4740>
* panfrost: Permit AFBC of RGB8Alyssa Rosenzweig2020-06-011-0/+4
| | | | | | | Ugly but hey. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5284>
* panfrost: Probe G31/G52 if PAN_MESA_DEBUG=bifrostAlyssa Rosenzweig2020-05-291-0/+1
| | | | | | | | | | | | We're not *quite* ready to open the flood gates on Bifrost (a major blocker is CI, which is itself blocked on the lockdowns - expected to be resolved in the coming months..) Nevertheless, let's add a debug option to probe on compatible Bifrost devices to avoid keeping out-of-tree patches around. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5272>
* panfrost: Add GPU IDs for G31/G52Alyssa Rosenzweig2020-05-291-0/+2
| | | | | | | Dvalin/Gondul respectively. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5272>
* panfrost: Ensure nonlinear strides are 16-alignedAlyssa Rosenzweig2020-05-271-1/+1
| | | | | | | | To match how they are encoded. Signed-off-by: Alyssa Rosenzweig <[email protected]> Fixes: bde19c0e7ba ("panfrost: Fix tiled texture "stride"s on Bifrost") Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5232>
* panfrost: Identify Bifrost texture format swizzleAlyssa Rosenzweig2020-05-271-1/+0
| | | | | | | | | | | | | We don't force w=1 for Bifrost textures. We already compose this into the swizzle as necessary, so we can just ignore this field I think. But let's identify it so we don't forget what it is. The blob uses it to force w=1 for <= 3-channel formats (0x10), as well as a flag to swap r/b for BGRA (0x4). There are probably other flags here but it doesn't.. really matter to us. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5232>
* panfrost: Fill in SCALED formats to format tableAlyssa Rosenzweig2020-05-211-0/+26
| | | | | Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5124>
* panfrost: Keep cached BOs mmap'dAlyssa Rosenzweig2020-05-211-17/+5
| | | | | | | | It doesn't make sense to munmap/mmap repeatedly; they're mapped GPU-side anyway. So just munmap on free, which will happen in low-mem regardless. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5124>
* panfrost: Guard experimental fp16 behind debug flagAlyssa Rosenzweig2020-05-211-0/+1
| | | | | Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5151>
* panfrost: Enable AFBC for Z24X8Alyssa Rosenzweig2020-05-191-5/+2
| | | | | Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5069>
* panfrost: Fix Z24 vs Z32 mixupAlyssa Rosenzweig2020-05-191-3/+2
| | | | | | | | We don't actually support Z32_UNORM; the format we've been using as such is in fact Z24X8 / Z24S8. Fix that and drop Z32_UNORM. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5069>
* panfrost: Switch formats to tableAlyssa Rosenzweig2020-05-193-196/+270
| | | | | | | | | | | | | Rather than heuristically guessing what PIPE formats correspond to what in the hardware, hardcode a table. This is more verbose, but a lot more obvious -- the previous format support code was a source of endless silent bugs. v2: Don't report RGB233 (icecream95). Allow RGB5 for texturing (icecream95). Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5069>
* gallium: change comments to remove 'state tracker'Marek Olšák2020-05-131-1/+1
| | | | | | | Acked-by: Eric Anholt <[email protected]> Acked-by: Alyssa Rosenzweig <[email protected]> Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4902>
* panfrost: Handle MALI_RGB8_UNORM in panfrost_format_to_bifrost_blendTomeu Vizoso2020-05-071-0/+1
| | | | | | Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4944>
* panfrost: GPUs newer than G-71 don't have swizzles...Tomeu Vizoso2020-05-011-0/+7
| | | | | | | | for attributes and varyings. Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4832>
* panfrost: Create additional BO for the checksum of imported BOs (Bifrost)Tomeu Vizoso2020-05-011-0/+1
| | | | | | | | | | Similar to what the blob does. My reason for doing this was mainly so traces weren't as different, which makes it more work to spot relevant differences. Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4832>
* panfrost: Fix tiled texture "stride"s on BifrostAlyssa Rosenzweig2020-05-011-6/+29
| | | | | | | | They're not real strides like linear textures but the hw does use them so we do have to get it right annoyingly. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4844>
* panfrost: Emit blend descriptors on BifrostTomeu Vizoso2020-04-302-0/+20
| | | | | | Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4724>
* panfrost: Fix BO reference countingAlyssa Rosenzweig2020-04-291-2/+2
| | | | | | | | Typo. Fixes: 3283c7f4dad ("panfrost: Inline reference counting routines") Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4792>
* panfrost: The texture descriptor has a pointer to a trampolineAlyssa Rosenzweig2020-04-242-34/+80
| | | | | | | | | | Not to the texture itself, and can have a stride right after for linear textures. Signed-off-by: Alyssa Rosenzweig <[email protected]> Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4680>
* panfrost: Identify texture layout fieldAlyssa Rosenzweig2020-04-241-1/+1
| | | | | | | Signed-off-by: Alyssa Rosenzweig <[email protected]> Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4680>
* panfrost: Emit texture descriptor on bifrostTomeu Vizoso2020-04-242-0/+56
| | | | | | Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4680>
* panfrost: Fix crashes with small BOsAlyssa Rosenzweig2020-04-221-1/+1
| | | | | | | Affects Bifrost. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4671>
* panfrost: Move device open/close to root panfrostAlyssa Rosenzweig2020-03-312-0/+59
| | | | | | | We need it for standalone testing too. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4382>
* panfrost: Move pan_bo to root panfrostAlyssa Rosenzweig2020-03-315-1/+706
| | | | | | | | | | | | | Now that its Gallium dependencies have been resolved, we can move this all out to root. The only nontrivial change here is keeping the pandecode calls in Gallium-panfrost to avoid creating a circular dependency between encoder/decoder. This could be solved with a third drm folder but this seems less intrusive for now and Roman would probably appreciate if I went longer than 8 hours without breaking the Android build. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4382>
* panfrost: Split panfrost_device from panfrost_screenAlyssa Rosenzweig2020-03-311-0/+107
| | | | | | | | | | We would like to access properties of the device in a Gallium-independent way (for out-of-Gallium testing in the short-term, and would help a theoretical Vulkan implementation in the long run). Let's split up the struct. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4382>
* panfrost: Correctly identify format 0x4cIcecream952020-03-311-3/+0
| | | | | | Reviewed-by: Alyssa Rosenzweig <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4292> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4292>
* panfrost: Add support for R3G3B2Icecream952020-03-311-0/+3
| | | | | | | Tested with texenv from mesa-demos. Reviewed-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4292>
* panfrost: Add support for B5G5R5X1Icecream952020-03-311-0/+3
| | | | | | | Tested with texenv from mesa-demos. Reviewed-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4292>
* meson: inline `inc_common`Eric Engestrom2020-03-281-1/+1
| | | | | | | | | Let's make it clear what includes are being added everywhere, so that they can be cleaned up. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4360>
* Revert "panfrost: Z24 variants should be sampled as R32UI"Boris Brezillon2020-03-101-9/+1
| | | | | | | | | | | | | Commit 0406ea485649 ("panfrost: Z24 variants should be sampled as R32UI") causes a regression when depth textures are sampled. It's still not clear how MALI_Z32 can work for for Z32 and Z24{S,X}8, but let's leave that question for later. Reported-by: Icecream95 <[email protected]> Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4101>
* panfrost: Simplify stack shift calculationAlyssa Rosenzweig2020-02-271-7/+14
| | | | | | | | I'm not sure why I never saw smaller values, but here you go. Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Tomeu Vizoso <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3950>
* panfrost: Reserve an extra page for spillingAlyssa Rosenzweig2020-02-271-3/+6
| | | | | | | | | I'm not sure what this is for, but the blob does it and I'd rather not poke farther than needed into hardware-internal details. Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Tomeu Vizoso <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3950>
* panfrost: Default to 256 threads for TLSAlyssa Rosenzweig2020-02-272-5/+11
| | | | | | | | | | | | | | I'm not sure where I got the impression 1024 was the right number. From kbase: #define THREAD_MT_DEFAULT 256 (where MT = "max threads" and the threads to allocate for TLS is <= max threads). Let's cut out memory footprint for spilling by 75% :) Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Tomeu Vizoso <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3950>
* panfrost: Fix param gettingAlyssa Rosenzweig2020-02-271-1/+1
| | | | | | | | ....Oops.... Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Tomeu Vizoso <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3950>
* panfrost: Update spilling comment framebuffer->sharedAlyssa Rosenzweig2020-02-271-1/+1
| | | | | | | | All of this should apply equally with compute shaders, as far as I know. Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Tomeu Vizoso <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3950>
* panfrost: Fix padded_vertex_count generationAlyssa Rosenzweig2020-02-271-1/+1
| | | | | | | | | | | | | | These two cases were flipped from the notes, leading to underestimates of the padded vertex count, manifesting as visual corruption (random geometry messed up). This issue was raised when noticing the corruption went away when dramaticlaly oversizing max_index on an instanced indexed draw, and then checking that padded_count >= vertex_count -- which turned out *not* to be the case on certain inputs, a clear issue. Hence looking into this routine... Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Tomeu Vizoso <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3950>
* panfrost: Remove some more prints to stdoutTomeu Vizoso2020-02-261-1/+1
| | | | | | | | They can confuse test runners. Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3876>
* panfrost: Rewrite texture descriptor creation logicAlyssa Rosenzweig2020-02-212-0/+261
| | | | | | | | | | | | | | | | | | Rather than creating partially within the Gallium create function and monkeypatching on draw time with code split across N different files with tight Gallium dependencies, let's streamline everything into a series of maintainable routines in mesa/src/panfrost with no Gallium dependencies, doing the entire texture creation in one-shot and thus adding absolutely zero draw-time overhead (since we can allocate a BO for the descriptor and upload ahead-of-time, so switching textures is as cheap as switching pointers). Was this worth it? You know, I'm not sure :| Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Boris Brezillon <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3858> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3858>
* panfrost: Move format translation to rootAlyssa Rosenzweig2020-02-213-0/+318
| | | | | | | | | | Since PIPE formats are now shared across Mesa we can do this, and the routines themselves are good enough code that I'm happy to move them here. We'll use them momentarily. Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Boris Brezillon <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3858>
* panfrost: Move pan_afbc.c to rootAlyssa Rosenzweig2020-02-213-0/+136
| | | | | | | | | | Now that PIPE formats are shared across Mesa, this well-documented piece of code is a good fit for root panfrost, let's move it and get a little closer to taming the mess of resources. Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Boris Brezillon <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3858>
* panfrost: Move checksum routines to root panfrostAlyssa Rosenzweig2020-02-214-0/+114
| | | | | | | | | | These are Gallium-independent and clean code; as is tradition, let's hoist them up out of the Gallium driver as a bit of yak shaving as we prepare to untangle the monster that is pan_resource.c Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Boris Brezillon <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3858>
* panfrost: Update comment about magic number relating to barriersAlyssa Rosenzweig2020-02-161-2/+2
| | | | | | | | | | | It's a complicated story. But from what I can tell, in GL compute without barriers, the blob is able to redistribute the workgroups in various ways (that are not yet understood), whereas with barriers it cannot redistribute anything, which accounts for erratic workgroup packing without barriers. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3835>
* panfrost: Avoid overlapping copyAlyssa Rosenzweig2020-02-041-1/+3
| | | | | | | | | | | | | CID 1457486: Memory - corruptions (OVERLAPPING_COPY) Assigning "(*attr).extra_flags = (*attr).size = 0U" to "(*attr).stride", which have overlapping memory +locations. Coverity. Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Tomeu Vizoso <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3684>
* panfrost: Remove mali_alt_funcAlyssa Rosenzweig2019-12-273-0/+51
| | | | | | | | | | There's only one way to encode comparison functions in the command stream, not two. It's just that the semantics for texture comparisons are flipped from the semantics of stencil comparison. We can factor out that flip to common Panfrost code, rather than tying it to a second Gallium routine. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Add missing #include in common headerAlyssa Rosenzweig2019-12-271-0/+1
| | | | | | Fixes way back when... Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Route gl_VertexID through cmdstreamAlyssa Rosenzweig2019-12-242-0/+43
| | | | | | | | | | | It shows up as a special (magic?) attribute. We could try to be clever and only include the extra record if gl_VertexID is actually read, but honestly that's just extra complexity for no good reason. Might as well just always include it; this won't be a real bottleneck, I don't think. Fixes dEQP-GLES3.functional.shaders.builtin_variable.vertex_id. Signed-off-by: Alyssa Rosenzweig <[email protected]>