aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/panfrost/pan_mfbd.c
Commit message (Collapse)AuthorAgeFilesLines
* panfrost: Fix linear depth texturesAlyssa Rosenzweig2020-01-141-13/+19
| | | | | | | | | | | | | | | | As pointed out by Boris, what we were calling PAN_LINEAR depth textures was in fact u-interleaved tiled (!), but we never noticed since we flipped the flag used for sampling, leading to all sorts of fun bugs when attempting to directly acess depth textures from the CPU. Which begs the question -- if what we called LINEAR was tiled, how do we actually render linear depth textures? It turns out the flags for AFBC form a mali_block_format 2-bit code just like their render-target counterparts, so we can render to any of the above. Signed-off-by: Alyssa Rosenzweig <[email protected]> Reported-by: Boris Brezillon <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3393> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3393>
* panfrost: Support rendering to non-zero Z/S layersAlyssa Rosenzweig2020-01-061-5/+5
| | | | | | | Fixes abort in STK's shadow implementation. Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Tomeu Vizoso <[email protected]>
* panfrost: Pass size to panfrost_batch_get_scratchpadAlyssa Rosenzweig2019-12-131-2/+8
| | | | | | We'll compute the size with the new scratchpad helpers. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Emit SFBD/MFBD after a batch, instead of beforeAlyssa Rosenzweig2019-12-131-0/+37
| | | | | | | | The size of the scratchpad (as well as some tiler details) depend on the contents of the batch, so we need to wait to defer filling out the FBD until after all draws are queued. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Fix gnu-empty-initializer build errors.Vinson Lee2019-11-281-2/+2
| | | | | | Fixes: a24d6fbae60c ("meson: Add -Werror=gnu-empty-initializer to MSVC compat args") Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* util: Move gallium's PIPE_FORMAT utils to /util/format/Eric Anholt2019-11-141-1/+1
| | | | | | | | | | | | | | | To make PIPE_FORMATs usable from non-gallium parts of Mesa, I want to move their helpers out of gallium. Since u_format used util_copy_rect(), I moved that in there, too. I've put it in a separate directory in util/ because it's a big chunk of related code, and it's not clear to me whether we might want it as a separate library from libmesa_util at some point. Closes: #1905 Acked-by: Marek Olšák <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Set depth and stencil for SFBD based on the formatTomeu Vizoso2019-11-111-14/+0
| | | | | Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Rework format encoding on SFBDTomeu Vizoso2019-11-061-27/+3
| | | | | | Signed-off-by: Alyssa Rosenzweig <[email protected]> Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Move the BO API to its own headerBoris Brezillon2019-09-181-0/+1
| | | | | | | | Right now, the BO API is spread over pan_{allocate,resource,screen}.h. Let's move all BO related definitions to a separate header file. Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Pass a batch to functions emitting FB descsBoris Brezillon2019-09-131-15/+10
| | | | | | | | So we can emit such jobs to a batch that's not currently bound to the context. Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Pass a batch to panfrost_{allocate,upload}_transient()Boris Brezillon2019-09-131-1/+2
| | | | | | | | | | | We need that if we want to upload transient buffers to a batch that's not currently bound to the context, which in turn will be needed if we want to relax the batch serialization we have right now (only flush batches when we need to: on a flush request, or when one batch depends on the result of other batches). Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Allow testing if a specific batch is targeting a scanout FBBoris Brezillon2019-09-131-2/+1
| | | | | | | | | | | Rename panfrost_is_scanout() into panfrost_batch_is_scanout(), pass it a batch instead of a context and move the code to pan_job.c. With this in place, we can now test if a batch is targeting a scanout FB even if this batch is not bound to the context. Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: s/job/batch/Boris Brezillon2019-09-081-15/+15
| | | | | | | | | | | | What we currently call a job is actually a batch containing several jobs all attached to a rendering operation targeting a specific FBO. Let's rename structs, functions, variables and fields to reflect this fact. Suggested-by: Alyssa Rosenzweig <[email protected]> Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* pan/decode: Validate MFBD tagsAlyssa Rosenzweig2019-08-221-1/+1
| | | | | | | | | 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]>
* panfrost: Clarify intention with PIPE_SWIZZLE_X checkAlyssa Rosenzweig2019-08-211-1/+2
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/mfbd: Stuff in RT countAlyssa Rosenzweig2019-08-141-8/+10
| | | | | | | | | Fixes DATA_INVALID_FAULTs with multiple render targets. We do always allocate space for 4 cbufs just to keep things sane. This may not be strictly necessary. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Note "MFBD preload disable" bitAlyssa Rosenzweig2019-08-141-2/+2
| | | | | | It's a chicken bit, as far as I can tell. Buck buck. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Set rt_countAlyssa Rosenzweig2019-07-181-6/+10
| | | | | | | | | | This doesn't quite work yet, but it illustrates how MRT is implemented in the MFBD: rt_count is set appropriately based on the number of render targets, while additional render target descriptors are appended on with an index variable in them (not quite decoded since there's some aspects we don't understand there, but conceptually this should be right). Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/mfbd: Unify depth-only with masked FBO pathAlyssa Rosenzweig2019-07-181-22/+24
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Check for NULL surface in placesAlyssa Rosenzweig2019-07-181-0/+4
| | | | | | | | | | Fixes a bunch of NULL dereferences, although it does cause GPU faults of course. This is caused by color buffers masked out in MRT, which we'll eventually have to solve the right way... one thing at a time. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Implement Z32F(_S8) supportAlyssa Rosenzweig2019-07-181-0/+14
| | | | | | | Z32F uses a dediacted float path. Z32F_S8 uses separate stencil planes in the hardware, lowered via u_transfer_helper. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/mfbd: Zero out framebuffer_strideAlyssa Rosenzweig2019-07-161-2/+3
| | | | | | We don't know what this is, so let's not pretend we do. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/mfbd: Add Z32 rendering supportAlyssa Rosenzweig2019-07-151-4/+24
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Fix build warningsAlyssa Rosenzweig2019-07-121-3/+2
| | | | | | | A bunch of these are from asserts not being compiled in 32-bit mode (once Erik's ASSERTABLE stuff is merged, we'll want to switch). Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Don't lie about Z/S formatsAlyssa Rosenzweig2019-07-111-0/+8
| | | | | | | | | | | Only Z24S8 is properly supported right now, so let's be careful. Fixes a number of issues relating to improper Z/S handling. The most obvious is depth buffers with incorrect strides, which manifests in truly bizarre ways and can happen commonly with FBOs. Fixes WebGL (Aquarium runs, etc). Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Style main Gallium driverAlyssa Rosenzweig2019-07-101-97/+97
| | | | | | $ astyle *.c *.h --style=linux -s8 Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/mfbd: Cleanup format code selectionAlyssa Rosenzweig2019-07-101-72/+90
| | | | | | | Rather than have random variables flying around and a long if-else chain, use a switch. They're literally *designed* for this. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/mfbd: Handle PIPE_FORMAT_B10G10R10A2_UNORMAlyssa Rosenzweig2019-07-101-1/+10
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Implement ES3-format writeoutAlyssa Rosenzweig2019-07-101-2/+17
| | | | | | | | | | | | We add support for writing out (via a blend shader): - RGBA4 - RGB10_A2_UNORM - RGB10_A2_UINT - RGB5_A1_UNORM - R11G11B10_FLOAT Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/mfbd: Handle pure int formatsAlyssa Rosenzweig2019-07-101-4/+16
| | | | | | | We see that the render target itself turns out to be typeless (surprise!) Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Set rt_count_2 for bpp>4 formatsAlyssa Rosenzweig2019-07-101-0/+7
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Extend clear colour packingAlyssa Rosenzweig2019-07-101-7/+11
| | | | | | | | | | | Eventually, this will allow packing clear colours for all formats, including floating-point framebuffers, pure integer buffers, and special formats. Currently, a few of these formats are supported, and many more are handled through a generic Gallium colour packing path (which is not a perfect fit for the hardware, but works for many formats and is a sane default for the moment.) Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/mfbd: Include codes for float framebuffersAlyssa Rosenzweig2019-07-101-1/+28
| | | | | | | | | We see the hardware doesn't actually support float framebuffers in the native sense -- rather, it just allows higher bpp framebuffers and lets a blend shader / additional clear_color fields sort out the formats. This will be.. interesting. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Move BO meta-data out of panfrost_boBoris Brezillon2019-07-021-12/+12
| | | | | | | | | | | | That's what most (all?) implementation seem to do, and my understanding is that a BO is just a bunch of memory that can be used for anything GPU related, not only texture/FB resources. Let's move those meta data in panfrost_resource so we can use panfrost_bo for all kind of memory allocation and make BO allocation more consistent. Signed-off-by: Boris Brezillon <[email protected]>
* panfrost: Allow R11G11B10 renderingAlyssa Rosenzweig2019-06-281-1/+5
| | | | | | Doesn't fully work yet, but better than crashing. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Invert swizzle for renderingAlyssa Rosenzweig2019-06-251-2/+30
| | | | | | Fixes rendering to e.g. alpha textures. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Merge checksum buffer with main BOAlyssa Rosenzweig2019-06-251-4/+11
| | | | | | | | This is similar to the AFBC merge; now all (non-imported) buffers use a common backing buffer. Reenables checksumming, eliminating a performance regression. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Sanity check layerAlyssa Rosenzweig2019-06-251-0/+1
| | | | | | | It doesn't make sense to try to render to multiple array elements at once. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Use get_texture_address for framebuffer computationsAlyssa Rosenzweig2019-06-251-6/+5
| | | | | | | Allows for sharing some code as well as theoretically allowing cubemap rendering. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Merge AFBC slab with BO backingAlyssa Rosenzweig2019-06-251-11/+12
| | | | | | | | | | | | | | | Rather than tracking AFBC memory "specially", just use the same codepath as linear and tiled. Less things to mess up, I figure. This allows us to use the standard setup_slices() call with AFBC resources, allowing mipmapped AFBC resources. Unfortunately, we do have to disable AFBC (and checksumming) in the meantime to avoid functional regressions, as we don't know _a priori_ if we'll need to access a resource from software (which is not yet hooked up with AFBC) and we don't yet have routines to switch the layout of a BO at runtime. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Specify sRGB in the render targetAlyssa Rosenzweig2019-06-181-1/+4
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Implement tiled renderingAlyssa Rosenzweig2019-06-181-0/+4
| | | | | | | | We already can sample from Mali's linear/tiled encoding (the one from Utgard -- AFBC is mostly unrelated); let's be able to render to it as well. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Decode rendering block typeAlyssa Rosenzweig2019-06-181-3/+5
| | | | | | | A mode for rendering tiled/uncompressed was noticed, so we reshuffle the MFBD render target definitions to explicitly include block type. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/mfbd: Handle rendering to linear mipmapAlyssa Rosenzweig2019-06-171-4/+18
| | | | | | | In anticipation of more general mipmapping support, we implemented support for rendering to linear mipmaps (a very simple case). Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Disable the tiler for clear-only jobsAlyssa Rosenzweig2019-06-171-2/+2
| | | | | | | | | To do so, we route some basic information through to the FBD creation routines (currently just a binary toggle of "has draws?"). Eventually, more refactoring will enable dynamic hierarchy mask selection, but right now we do the most basic. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Identify and decode mfbd_flagsAlyssa Rosenzweig2019-06-171-6/+6
| | | | | | Previously known as the unk3 field. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Don't flip scanoutAlyssa Rosenzweig2019-06-051-12/+4
| | | | | | | | | | | | | | | | | | | | | | The mesa/st flips the viewport, so we respect that rather than trying to flip the framebuffer itself and ignoring the viewport and using a messy heuristic. However, this brings an underlying disagreement about the interpretation of winding order to light. The blob uses a different strategy than Mesa for handling viewport Y flipping, so the meanings of the winding order bit are flipped for it. To keep things clean on our end, we rename to explicitly use Gallium (rather than flipped OpenGL) conventions. Fixes upside-down Xwayland/egl windows. v2: Adjust lowering configuration to correctly flip gl_PointCoord.y and gl_FragCoord.y. v1 was R-b'd by Tomeu, but then retracted due to these regressions which are not fixed. Suggested-by: Rob Clark <[email protected]> Signed-off-by: Alyssa Rosenzweig <[email protected]> Sort-of-reviewed-by: Tomeu Vizoso <[email protected]>
* panfrost: Support RGB565 FBOsAlyssa Rosenzweig2019-05-041-2/+9
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Preliminary work for mipmapsAlyssa Rosenzweig2019-03-271-5/+5
| | | | | | | | | | | | | | 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: Properly align strideDaniel Stone2019-03-201-8/+3
| | | | | | | | | | | | | | 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]>