summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/panfrost/pan_resource.h
Commit message (Collapse)AuthorAgeFilesLines
* panfrost: clang-format the treeAlyssa Rosenzweig2022-12-241-88/+82
| | | | | | | | | | | | | | | | | | | | This switches us over to Mesa's code style [1], normalizing us within the tree. The results aren't perfect, but they bring us a hell of a lot closer to the rest of the tree. Panfrost doesn't feel so foreign relative to Mesa with this, which I think (in retrospect after a bunch of years of being "different") is the right call. I skipped PanVK because that's paused right now. find panfrost/ -type f -name '*.h' | grep -v vulkan | xargs clang-format -i; find panfrost/ -type f -name '*.c' | grep -v vulkan | xargs clang-format -i; clang-format -i gallium/drivers/panfrost/*.c gallium/drivers/panfrost/*.h ; find panfrost/ -type f -name '*.cpp' | grep -v vulkan | xargs clang-format -i [1] https://docs.mesa3d.org/codingstyle.html Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20425>
* panfrost: Remove rsrc->trackAlyssa Rosenzweig2022-12-231-11/+0
| | | | | | | | | Just check on the context instead. Usually the number of batches is small so this is still fast, and avoids all the tricky atomics and the batch->resources set which existed only for bookkeeping. Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20426>
* panfrost: Clear with a quad to avoid flushingAlyssa Rosenzweig2022-07-081-0/+3
| | | | | | | | | | | | | | | | | | | | | | | Flushing the batch midframe (splitting a renderpass) is expensive on a tiler, as it requires the GPU to flush the framebuffer contents to main memory and read them back. Clearing the framebuffer should not trigger a flush. Apps expect clears to be (almost) free, flushing for a clear is at the very least unexpected behaviour. The only reason we previously flushed is to ensure we could always use a "fast" clear. But a slow clear is a heck of a lot faster than a flush ;-) Instead of flushing, we should clear with a draw (via u_blitter) in case a fast clear isn't possible. This fixes pathological performance for applications that rely on partial clears within a frame. This issue was identified with Inochi2D, which repeatedly clears the stencil buffer midframe, in order to implement masking efficiently with the stencil buffer. In total, the all-important workload of rendering Asahi Lina is improved from 17fps to 29fps on a panfrost device. Fixes: c138ca80d23 ("panfrost: Make sure a clear does not re-use a pre-existing batch") Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17112>
* panfrost: Use a macro for checking for a shared bind typeIcecream952022-06-171-0/+3
| | | | | | | | | | | PAN_BIND_SHARED_MASK is all binding flags that mean that a resource might be shared and accessible by other contexts. Don't replace the usage of this pattern in panfrost_should_afbc and panfrost_should_tile in case a new binding is introduced that not all layouts can support. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16966>
* panfrost: Constant stencil value trackingIcecream952022-06-091-0/+6
| | | | | | | | | | | | | | | | If stencil is constant across the resource, then it can be treated as if it was cleared. Improves performance in applications which create a stencil buffer but do not use it. Originally the same was done for depth to help some 2D applications, but that gave mixed results so the patch was dropped. v2: Don't do anything if a fragment job wouldn't be needed otherwise. v3: Set stencil_value when a batch is cleared (Alyssa) v4: Handle clears when the stencil is already known (Alyssa) v5: Make sure shared resources are not used (Alyssa) Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16646>
* panfrost: Decompress for incompatible AFBC formatsAlyssa Rosenzweig2021-10-221-0/+5
| | | | | | | | | | | | AFBC is keyed to the format. Depending on the hardware, we'll get an Invalid Data Fault or a GPU timeout if we attempt to sample from an AFBC-compressed RGBA8 texture as R32F (for example). Fixes Piglit ./bin/arb_texture_view-rendering-formats_gles3 with AFBC. Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Cc: mesa-stable Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13205>
* panfrost: Remove unused functionsAlyssa Rosenzweig2021-08-251-10/+0
| | | | | | | Flagged by cppcheck. Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12530>
* panfrost: Replace writers pointer with hash tableAlyssa Rosenzweig2021-08-241-2/+5
| | | | | | | | | | | | This ensures each context can have a separate batch writing a resource and we don't race trying to flush each other's batches. Unfortunately the extra hash table operations regress draw-overhead numbers by about 8% but I'd rather eat the overhead and have an obviously correct implementation than leave known buggy code in tree. Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Cc: mesa-stable Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12528>
* panfrost: Remove rsrc->track.usersAlyssa Rosenzweig2021-08-241-1/+0
| | | | | | | | No longer needed. Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Cc: mesa-stable Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12528>
* panfrost: Cache number of users of a resourceAlyssa Rosenzweig2021-08-241-0/+4
| | | | | | | | | This can be tracked efficiently with atomics, and reduces the places we use the rsrc->track.users bitmap which has concurrency issues. Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Cc: mesa-stable Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12528>
* panfrost: Call primconvert and u_transfer_helper destroy functionsIcecream952021-08-161-0/+2
| | | | | | Fixes a couple of small memory leaks. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12376>
* panfrost: Warn on going out of AFBCAlyssa Rosenzweig2021-07-141-1/+1
| | | | | Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11830>
* panfrost: Remove unused midgard-pack.h includesAlyssa Rosenzweig2021-07-071-1/+0
| | | | | | | | Now only included from the per-gen file. Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Acked-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11745>
* panfrost: Do tracking of resources, not BOsBoris Brezillon2021-07-061-0/+6
| | | | | | | | | Squashed together with commits from Boris's original dependency tracking cleanup series. Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11077>
* panfrost: Fork pan_pool for Gallium and VulkanTomeu Vizoso2021-07-051-1/+0
| | | | | | | | | | This commit adds the actual implementations, allowing to diverge while still sharing code that depends on pool functionality. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Suggested-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11695>
* panfrost: Remove pan_image_stateAlyssa Rosenzweig2021-06-101-2/+8
| | | | | | | | | Instead just group the fields about validity into a simpler structure in panfrost_resource. Panvk can do the same. Common code shouldn't be thinking in terms of this 'larger' structure anyway. Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11123>
* panfrost: Pass a tile enable map to avoid reloading untouched tilesBoris Brezillon2021-04-131-0/+6
| | | | | | | | | | | We only do that when there are more than one damage rectangle and the number of tiles to reload is significantly lower than the total number of tiles covered by the damage extent, otherwise the overhead of the TEM read might defeat the optimization that we might get from using one. Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10033>
* panfrost: Fix partial updateBoris Brezillon2021-04-131-3/+0
| | | | | | | | | | | | | | | | | | | | | | | The KHR_partial_update spec says: " If EGL_EXT_buffer_age is supported, the contents of the buffer inside the damage region may also be relied upon to contain the same content as the last time they were defined for the current back buffer. " but we currently assume that everything inside the damage region will be overwritten by new data and that the previous content doesn't need to be reloaded. Let's get rid of the damage rect inversion logic for now and reload everything inside the damage extent. We will optimize things further down the line, using pre-frame DCDs on Bifrost, and a tile enable map on Midgard. Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10033>
* panfrost: Move out-of-band CRC info to pan_imageBoris Brezillon2021-04-131-6/+0
| | | | | | | | | | We already have the data BO stored there, let's move the out-of-band CRC BO too. We also add a CRC mode to pan_image_layout so we can easily know where the CRC resides. Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10033>
* panfrost: Split pan_image in twoBoris Brezillon2021-04-131-2/+1
| | | | | | | | | | | Move the image view bit out of pan_image and create a separate pan_image_view struct. Once this is done we can embed a pan_image object in panfrost_resource which will be referenced by the image view that we pass to panfrost_load_{midgard,bifrost}(). Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10033>
* panfrost: Add a format field to pan_image_layoutBoris Brezillon2021-04-131-2/+0
| | | | | | | | | | | We will need this information at the layout level if we want to move some of the code out of the gallium driver and share it with the Vulkan driver. Let's get rid of panfrost_resource.internal_format which basically encodes the same thing. Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10033>
* panfrost: Move image states out of pan_image_layoutBoris Brezillon2021-04-131-0/+3
| | | | | | | | | | | | | | | | | | | The layout is supposed to encode image miplevels/surfaces layout, not the state data stored in the buffers. It doesn't matter for a gallium driver, since resources are expected to hold both a layout and a state, but Vulkan is a bit different. In Vulkan, the image state is explicitly passed by the user when starting a render pass (vkCmdBeginRenderPass()), and might evolve depending on the operation done in this render pass. This state is not effective until the command buffer is queued and executed. For these reasons, keeping the image state attached to the VkImage object is not an option, but we'd still like to re-use the layout and state objects, and all common helpers acting on those objects. Let's move the state bits out of the layout to make that possible. Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10033>
* panfrost: add resource modifier conversionItalo Nicola2021-01-271-0/+4
| | | | | | | | | Adds a helper function to convert a resource to a chosen modifier. Signed-off-by: Italo Nicola <italonicola@collabora.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8066>
* panfrost: Fix typos.Vinson Lee2021-01-141-1/+1
| | | | | | Signed-off-by: Vinson Lee <vlee@freedesktop.org> Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8400>
* panfrost: Fix calculation of body/header pointers for 3D AFBCBoris Brezillon2021-01-041-0/+5
| | | | | | | | | | When using 3D AFBC, all headers are placed at the beginning instead of being interleaved with each surface body, which forces us to adjust the calculation in that case. Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8125>
* panfrost: Add a pan_image_layout objectBoris Brezillon2021-01-041-11/+5
| | | | | | | | | | | Group the slices, dimension, modifier and array stride in a an object representing the image layout. This way we shrink the number of arguments passed to various pan_texture helpers and simplifies some of the logic along the way. Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8125>
* panfrost: Move checksum_bo to panfrost_resourceBoris Brezillon2021-01-041-0/+3
| | | | | | | | | | | There's no reason to have the checksum_bo at the slice level since there can only be one external CRC BO per resource. Move this field to the panfrost_resource struct. Suggested-by: Icecream95 Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8125>
* panfrost: Get rid of the non-native wallpering bitsBoris Brezillon2020-10-231-4/+0
| | | | | | Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7206>
* panfrost: Rename gtransfer to transferAlyssa Rosenzweig2020-10-231-3/+3
| | | | | | | | Now that panfrost_transfer is renamed to panfrost_ptr. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7206>
* panfrost: XMLify Midgard texturesAlyssa Rosenzweig2020-08-131-6/+6
| | | | | | Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195>
* panfrost: Redirect cmdstream includes through GenXMLAlyssa Rosenzweig2020-08-131-1/+1
| | | | | | | | This will provide a way to incrementally upgrade. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195>
* panfrost: Import staging routines from freedrenoAlyssa Rosenzweig2020-08-121-0/+4
| | | | | | | | For software access to AFBC textures. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Tested-by: Icecream95 <ixn@keemail.me> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6159>
* panfrost: Use modifier instead of layout throughoutAlyssa Rosenzweig2020-08-121-6/+6
| | | | | | | | | | | Instead of converting back and forth we should stick with fourcc codes as the canonical layout definition. Furthermore modifiers allow all the variants of AFBC to be encoded canonically, whereas the previous enum does not (info about YTR is encoded out of band, for instance). Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Tested-by: Icecream95 <ixn@keemail.me> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6159>
* panfrost: Remove hint-based AFBC heuristicAlyssa Rosenzweig2020-08-121-7/+0
| | | | | | Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Tested-by: Icecream95 <ixn@keemail.me> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6159>
* panfrost: Use Midgard-specific reloadsAlyssa Rosenzweig2020-07-161-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | v2: Be more explicit about sampler types. Prefer the term "load" to "resolve" to match VK convention. Generate shaders for MRT 8x. Blit shader generation adds about 6ms to startup cost. We could cache thes. shaders to disk if we needed to (or indeed, ship binaries). v3: Fallback on u_blitter on Bifrost so Bifrost continues to work. KHR_partial_update support is mostly no-oped on Bifrost now, but that's okay for now - compositors are still functional. v4: Specialize on multisample state as well to enable reloads of MSAA textures. This requires 2x the shader variants, so I assume we're up to 12ms startup cost for generation. Annoying. Also fix interactions with depth- or stencil-only clears of combined depth-stencil surfaces. v5: Cache to the device (screen) instead of the context, reducing duplicated work in apps that create many contexts (e.g. Chromium) v6: Squash in KHR_partial_update cleanup to fix intermediate regressions on a few tests. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5824>
* panfrost: Move panfrost_translate_texture_typeAlyssa Rosenzweig2020-07-091-0/+27
| | | | | | | We need it in pan_job.c Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5827>
* panfrost: Move pool routines to common codeAlyssa Rosenzweig2020-07-091-1/+1
| | | | | | | | We finally have it decoupled from Galliumisms (and OpenGLisms, indeed) so we can share the file. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5794>
* panfrost: Drop Gallium-local pan_bo_create wrapperAlyssa Rosenzweig2020-07-091-4/+0
| | | | | | | | We can handle pandecode in shared code now, which will matter for tracing non-Gallium drivers. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5794>
* panfrost: Index texture by sampleAlyssa Rosenzweig2020-07-071-1/+1
| | | | | | | This will allow MSAA to route through. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5782>
* panfrost: Tiled to linear layout conversionIcecream952020-06-121-0/+8
| | | | | | | | | | | | | | | | | | Tiling is expensive, so this patch converts textures that appear to be used for streaming to a linear layout. Performance of mpv is significantly improved, with software-decoded 1080p mp4 playback on RK3288 going from 30fps to 50fps when testing with `--untimed --no-audio`. To keep things simple, conversion only happens when updating the whole texture and no mipmapping is used. v2: Make it clear that the heuristic doesn't rely on a texture being uninitialized, since layout switching code can get confusing (Alyssa). Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4628>
* panfrost: Move pan_bo to root panfrostAlyssa Rosenzweig2020-03-311-0/+4
| | | | | | | | | | | | | 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 <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4382>
* panfrost: Split panfrost_device from panfrost_screenAlyssa Rosenzweig2020-03-311-2/+2
| | | | | | | | | | 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 <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4382>
* panfrost: split index cache into shared partVasily Khoruzhick2020-03-101-23/+1
| | | | | | | | | Split it into shared part since we're going to re-use it in lima. Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4051>
* panfrost: Implement index buffer cacheAlyssa Rosenzweig2020-02-271-0/+26
| | | | | | | | | | | | | | | | | | | For index bufer resources (not user index buffers), we're able to cache results. In practice, the cache works pretty dang well. It's still important that the min/max computation is efficient (since when the cache misses it'll run at draw-time and we don't want jank), but this can eliminate a lot of computations entirely. We use a custom data structure for caching. Search is O(N) to the size but sizes are capped so it's effectively O(1). Insertion is O(1) with automatic oldest eviction, on the assumption that the oldest results are the least likely to still be useful. We might also experiment with other heuristics based on actual usage later. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3880> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3880>
* panfrost: Move pan_afbc.c to rootAlyssa Rosenzweig2020-02-211-8/+0
| | | | | | | | | | 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 <alyssa.rosenzweig@collabora.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3858>
* panfrost: Move checksum routines to root panfrostAlyssa Rosenzweig2020-02-211-18/+1
| | | | | | | | | | 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 <alyssa.rosenzweig@collabora.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3858>
* panfrost: Remove enum panfrost_memory_layoutAlyssa Rosenzweig2020-02-181-10/+2
| | | | | | | | | | It duplicates mali_texture_layout. Let's use the native hardware enum and spare a pointless translation. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3854> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3854>
* panfrost: Store internal formatTomeu Vizoso2020-01-021-0/+2
| | | | | | | | It's needed by u_transfer_helper to know when the depth+stencil buffer has been split. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
* panfrost: Map with size of first layer for 3D texturesTomeu Vizoso2020-01-021-0/+1
| | | | | | | As that's what Gallium expects in transfer.layer_stride. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
* panfrost: Make sure we reset the damage region of RTs at flush timeBoris Brezillon2019-11-291-0/+3
| | | | | | | | | | | | | | | | | We must reset the damage info of our render targets here even though a damage reset normally happens when the DRI layer swaps buffers. That's because there can be implicit flushes the GL app is not aware of, and those might impact the damage region: if part of the damaged portion is drawn during those implicit flushes, you have to reload those areas before next draws are pushed, and since the driver can't easily know what's been modified by the draws it flushed, the easiest solution is to reload everything. Reported-by: Carsten Haitzler <raster@rasterman.com> Fixes: 65ae86b85422 ("panfrost: Add support for KHR_partial_update()") Cc: <mesa-stable@lists.freedesktop.org> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>