summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/panfrost/pan_screen.c
AgeCommit message (Collapse)AuthorFilesLines
37 hourspanfrost: implement a driver-specific max-miplevelErik Faye-Lund1-2/+2
The previous define was common for all panfrost code, but for Vulkan we should probably use the real hardware-limits. So let's introduce a GL-driver specific define here, and use that instead. This lets us change the other define to the real HW limitation. Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28417>
12 dayspanfrost: add tiler-heap driconfsErik Faye-Lund1-0/+7
We currently allocate 10 MB up-front for tiler heaps. That can sometimes be a lot, depending on the system. So let's add some DRIconf variables to allow tweaking these. Until we have incremental-rendering implemented, it's a bit risky to lower these too much. Be warned. Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28594>
2024-03-12panfrost: add pan_force_afbc_packing driconfErik Faye-Lund1-0/+3
This is useful for forcing AFBC-P to be used in applications where it's know to work well. This can significantly reduce memory consumption and bandwidth, leading more applications working in the first place, and also better performance. Acked-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27916>
2024-03-12panfrost: add driconf infrastructureErik Faye-Lund1-0/+4
This is the boiler-plate code needed to support driver-specific driconf variables in Panfrost. Acked-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27916>
2024-03-12panfrost: give afbc-packing its own flagErik Faye-Lund1-0/+2
There's no point in querying this over and over again for each resource, especially not when this test is about to become more complicated. So let's give this its own flag. Acked-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27916>
2024-03-01panfrost: Enable v10 in the gallium driverBoris Brezillon1-0/+2
Now that everything is in place to support v10, add it to the panfrost_versions array in meson.build and patch panfrost_create_screen() to hook up pipe_screen initialization. Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com> Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26358>
2024-03-01pan/kmod: Reject pre 1.1 panfrost kernel driversBoris Brezillon1-5/+1
Panfrost kernel driver has been around long enough to bump the minimal requirement to 1.1. This allows us to get rid of the texture_features hack we had to cope with the absence of DRM_PANFROST_PARAM_TEXTURE_FEATURES[0-3] kernel side. Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Suggested-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com> Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26358>
2024-01-23panfrost: Make the pan_blend logic panfrost_device-agnosticBoris Brezillon1-2/+3
We keep embedding a blend shader cache in panfrost_device, but now we have pan_blend source files that can be used without a panfrost_device object. Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Constantine Shablya <constantine.shablya@collabora.com> Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26698>
2024-01-23panfrost: Don't pass a panfrost_device to panfrost_afbc_can_tile()Boris Brezillon1-1/+1
Pass the arch directly. While at it, make the helper a static inline function defined in pan_texture.h. Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Constantine Shablya <constantine.shablya@collabora.com> Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26698>
2024-01-23panfrost: Don't pass a panfrost_device to panfrost_format_supports_afbc()Boris Brezillon1-1/+2
Pass the arch instead. While at it, make this helper a static inline function defined in pan_texture.h. Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Constantine Shablya <constantine.shablya@collabora.com> Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26698>
2024-01-09panfrost: expose support for EXT_copy_imageItalo Nicola1-3/+1
This was held back by the issue fixed in the previous patch. Let's enable it again! There's a bunch of failures due to a bug in Piglit, where undefined behavior gets invoked. Let's just mark them as expected failures for now and move on. Signed-off-by: Italo Nicola <italonicola@collabora.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24942>
2023-12-15panfrost: Avoid direct accesses to some panfrost_device fieldsBoris Brezillon1-5/+6
We are about to delegate some device-related operations to the pan_kmod layer, but before we can do that, we need to hide panfrost_device internals so we can redirect such accesses to pan_kmod. Provide a few panfrost_device_xxx() accessors and start using them. Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26357>
2023-10-25panfrost: Add env variable for max AFBC packing ratioLouis-Francis Ratté-Boulianne1-0/+4
Add `PAN_MAX_AFBC_PACKING_RATIO` variable. If the ratio (size of the packed resource) / (size of the sparse resource) * 100 is above that value, we don't care about packing it. Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25012>
2023-10-25panfrost: Add debug flag to force packing of AFBC textures on uploadLouis-Francis Ratté-Boulianne1-0/+1
Add `forcepack` flag that will force conversion to AFBC-packed right after a texture is uploaded when possible. We only pack 2D resources larger than 32x32 as of now. Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25012>
2023-10-24glsl: Retire dround lowering.Eric Anholt1-1/+0
We have competent lowering in NIR already available. Drivers exposing CAP_DOUBLES but not SHADER_CAP_DROUND: - d3d12 (NIR lowers ~0 if the underlying impl doesn't do floats) - svga (Now sets the NIR lowering options) - softpipe (Doesn't do GL4 so you can't use doubles anyway) - llvmpipe (Lowers dround_even in NIR and passees the rest through successfully) - zink (NIR lowers ~0 if the underlying impl doesn't do floats, otherwise passes things through successfully, except needed dround_even lowering to avoid lavapipe regression with native doubles) - r600 (sets NIR rounding lowering flags, and lowers all fsign) Reviewed-by: Marek Olšák <marek.olsak@amd.com> Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25777>
2023-10-14panfrost: Add PIPE_CAP_HAS_CONST_BW supportRob Clark1-0/+1
Signed-off-by: Rob Clark <robdclark@chromium.org> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25464>
2023-08-07panfrost: add PAN_MESA_DEBUG=yuv for debugging yuv samplerItalo Nicola1-0/+1
Signed-off-by: Italo Nicola <italonicola@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21109>
2023-07-07gallium: change PIPE_COMPUTE_CAP_SUBGROUP_SIZE to a bitfield of sizesKarol Herbst1-1/+1
This will be required for `cl_intel_required_subgroup_size`, but it already helps implementing OpenCL subgroups as this allows us to check with every subgroup size when implementing `CL_KERNEL_LOCAL_SIZE_FOR_SUB_GROUP_COUNT`. Signed-off-by: Karol Herbst <git@karolherbst.de> Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22893>
2023-07-07gallium: add PIPE_COMPUTE_CAP_MAX_SUBGROUPSKarol Herbst1-0/+3
This is required for enabling OpenCL subgroups. Signed-off-by: Karol Herbst <git@karolherbst.de> Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22893>
2023-06-12gallium: Drop PIPE_SHADER_CAP_PREFERRED_IR.Emma Anholt1-3/+0
Now everyone's saying NIR, and doing any NTT internally. The only returns of TGSI were in gallivm_get_shader_param() and tgsi_exec_get_shader_param(), but the drivers were returning NIR instead of calling down to them. Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Acked-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23114>
2023-06-10panfrost: Replace the usage of PIPE_BIND_* with PAN_BIND_*Yonggang Luo1-4/+14
PIPE_BIND_* belongs to gallium, do not use it in panvk As pan_format.h also used ban panfrost gallium driver, so static_assert it equal Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23526>
2023-06-03compiler: Rename shader_prim to mesa_prim and replace all usage of ↵Yonggang Luo1-4/+4
pipe_prim_type with mesa_prim This is a prepare step to remove depends on p_defines.h in src/util/* This is done by: replace pipe_prim_type with mesa_prim replace shader_prim with mesa_prim replace PIPE_PRIM_MAX with MESA_PRIM_COUNT replace SHADER_PRIM_ with MESA_PRIM_ replace PIPE_PRIM_ with MESA_PRIM_ This patch only replace code only Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Acked-by: Marek Olšák <marek.olsak@amd.com> Acked-by: Jesse Natalie <jenatali@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23369>
2023-05-22panfrost: expose PIPE_CAP_POLYGON_OFFSET_CLAMPErik Faye-Lund1-0/+1
This gives us ARB_polygon_offset_clamp and EXT_polygon_offset_clamp, and most of the actual state plumbing was already in place. Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23169>
2023-04-07panfrost: Unset TEXTURE_BUFFER_SAMPLERSAlyssa Rosenzweig1-1/+0
We no longer need this CAP, as we can easily synthesize our own internal sampler for this case. Gallium doesn't need to know about this quirk of our hardware. Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Reviewed-by: Italo Nicola <italonicola@collabora.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22223>
2023-04-06glsl: Drop PIPE_SHADER_CAP_DFRACEXP_DLDEXP_SUPPORTED.Emma Anholt1-1/+0
All drivers should now be using the appropriate NIR lowering, so we can drop this pile of code. Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22083>
2023-04-06glsl: Retire ldexp lowering in favor of the nir lowering flag.Emma Anholt1-1/+0
Compilers need to set the nir flag anyway for vulkan, so just pass ldexp through to NIR and let that handle it. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22083>
2023-02-17panfrost: Disable CRC by defaultAlyssa Rosenzweig1-1/+1
Known unsound code. So far I'm not convinced transaction elimination is doing us much good. Even in synthetic glmark style benchmarks this seems to be a few % hit at most. Given that transaction elimination is unsound by design, and that panfrost's implementation is buggy in several places and getting it right (up to the unsoundness of the hardware feature itself) would take actual engineering effort, and the priority is making glamor work... disabling is the obvious choice here. For now, we leave the code but gate it behind a env var flag (PAN_MESA_DEBUG=crc) rather than defaulting to enabled unless PAN_MESA_DEBUG=nocrc is set. This way, we can still experiment with it if we need that data ("what performance could we gain if we had this feature, unsoundness be damned?"). That said, I'm not really ok with having unsoundness on my devices, y'know? Back of the napkin math suggests that it's not unlikely that somebody has hit a transaction elimination collision in the wild with the DDK. Boils down to values. Closes: #8113 Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21258>
2023-02-12panfrost: use u_pipe_screen_lookup_or_create() to keep track of and reuse ↵Eric Engestrom1-1/+9
screens Signed-off-by: Eric Engestrom <eric@igalia.com> Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>
2023-01-25panfrost: fix off-by-one when exporting format modifiersItalo Nicola1-2/+1
`count` should not be incremented before the check, because it causes the modifiers array to be filled starting from position 1 instead of 0. This bug causes one less format modifier to be available than would otherwise be expected, which could then lead to a dmabuf query failing in situations where a supported modifier wouldn't be advertised. It also causes garbage data to be advertised as a modifier in position 0 of the array, although this is not very likely to cause issues. Fixes: 2a1217513 ("panfrost: Implement panfrost_query_dmabuf_modifiers") Cc: mesa-stable Signed-off-by: Italo Nicola <italonicola@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20879>
2023-01-16panfrost: Remove unused debug parameterAlyssa Rosenzweig1-1/+0
We removed this path. Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20707>
2023-01-16panfrost: Remove PAN_MESA_DEBUG=deqpAlyssa Rosenzweig1-2/+1
Now unused. Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20707>
2023-01-16panfrost: Stop testing CAP_INT16Alyssa Rosenzweig1-4/+2
This doesn't look like it'll be fixed any time soon. No point running dEQP with different flags than production, IMO. Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20707>
2023-01-16panfrost: Enable NV_primitive_restart on ValhallAlyssa Rosenzweig1-2/+3
Unlike literally every other mesa/st emulation, for some inexplicable reason we need to pretend to support the CAP and then set a different EMULATE cap instead of the emulation keying off the lack of support for the CAP. Set the CAPs accordingly so we get NV_primitive_restart (with emulation of non-fixed indices). This gets Mesa to advertise GL 3.1 on Mali-G57 as intended. Fixes: 30c14f54cf2 ("panfrost: Disable PIPE_CAP_PRIMITIVE_RESTART on v9") Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20702>
2022-12-24panfrost: clang-format the treeAlyssa Rosenzweig1-702/+702
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>
2022-12-24panfrost: Fix up some formatting for clang-formatAlyssa Rosenzweig1-16/+18
clang-format will make a mess of these otherwise. Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20425>
2022-12-23panfrost,asahi: Set vendor to MesaAlyssa Rosenzweig1-1/+1
Picked from !16064. Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20427>
2022-12-23panfrost: Remove experimental v7-only indirect draw pathAlyssa Rosenzweig1-4/+0
There are too many problems with indirect draws on v7 that we never got this code path to the finish line, and none of us have a good plan (or reason) to fix this. Proper indirect draws are only possible since v10 on Mali. There was interest in using this path to implement indexed draws in PanVK, that MR is stalled and it's not clear how much sense it makes to do Vulkan on anything older than v9 or v10 at this point. This code isn't *gone*, it'll still be in git history, but I don't see a lot of reason in keeping it in tree if it's unused and complicating e.g. the sysval upload path of the driver. Indirect dispatch remains supported on v7, as that path *is* working and flipped on for end users. Indirect dispatch on v7 is considerably less complicated than indirect draws. Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20420>
2022-12-16panfrost: Don't use texture format swizzles on v7Alyssa Rosenzweig1-0/+10
They're too restricted for AFBC. Fix up instead. There are two problems at play: 1. We can't just map the format swizzle to the pixel format ordering on v7, because the "reordered" values aren't allowed with compression. 2. We can't just compose the format swizzle with the API swizzle, because the composed swizzle is applied to the border colour, so we need to be able to apply an inverted swizzle to the border colour. That only works for bijective format swizzles. Fortunately, there's a neat solution: decompose the format's swizzle into two swizzles, the first mapping to a reordering that IS allowed for compression, and the second a bijection. Then we use the allowed reordering when texturing, apply the bijective swizzle to the API swizzle, and apply the inverse of the bijective swizzle to the border colour. When we're sampling a border colour, what's now happening mathematically is: (API swizzle o bijective swizzle)((bijective swizzle^-1)(border colour)) = (API swizzle o (bijective swizzle o bijective swizzle^-1))(border colour) = API swizzle(border colour) which is exactly what we wanted. Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20311>
2022-12-10panfrost: Implement GL_EXT_clip_controlDavid Heidelberg1-0/+1
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com> Co-authored-by: Aleksey Komarov <q4arus@ya.ru> Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Tested-by: Aleksey Komarov <q4arus@ya.ru> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20238>
2022-12-01panfrost: Add NATIVE_FENCE_FD capBoris Brezillon1-0/+4
Add support for NATIVE_FENCE_FD so panfrost can advertise support for EGL_ANDROID_native_fence_sync. Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Reviewed-by: Emma Anholt <emma@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19774>
2022-12-01panfrost: Move fence code to pan_fence.{c,h}Boris Brezillon1-89/+1
Before adding support for NATIVE_FENCE_FD, let's move the fencing logic to a dedicated file to avoid spreading the code in different places. Suggested-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/19774>
2022-11-29panfrost: add GALLIUM_HUD=draw-callsItalo Nicola1-0/+19
Signed-off-by: Italo Nicola <italonicola@collabora.com> Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20063>
2022-11-16panfrost: Use PIPE_CAP_VERTEX_ATTRIB_ELEMENT_ALIGNED_ONLYAlyssa Rosenzweig1-2/+10
..instead of 4BYTE_ALIGNED_ONLY. This is more correct and avoids needless repacking. Noticed in Firefox, which was hitting the vbuf translate path. Fixes: e03622e50fc ("panfrost: Set STRIDE_4BYTE_ALIGNED_ONLY") Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19761>
2022-11-02panfrost: Implement a disk cacheAlyssa Rosenzweig1-0/+12
Wire up the Mesa shader disk cache into Panfrost. Coupled with the precompiles from the previous patch, this should greatly reduce shader recompile jank. This is a bare bones implementation. Obvious future work includes: - Caching internal (outside of Gallium) shaders - Implement finalize_nir to reduce on disk size of shaders That doesn't need to come in this patch. This patch does shuffle some allocation patterns around to avoid extra nir_shader_clones, but the result should be pretty clean. --- Consider dEQP-GLES31.functional.ssbo.layout.basic_unsized_array.* in the CTS. With a cold cache: 44.11user 0.66system 0:45.44elapsed 98%CPU (0avgtext+0avgdata 267804maxresident) k 0inputs+0outputs (130major+74725minor)pagefaults 0swaps But with this commit and a warm cache: 4.07user 0.35system 0:04.56elapsed 96%CPU (0avgtext+0avgdata 211012maxresident) k0inputs+0outputs (1major+49489minor)pagefaults 0swaps That's an 11x improvement! Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19363>
2022-11-02panfrost: Precompile shadersAlyssa Rosenzweig1-1/+0
We have no vertex shader key, and unless legacy GL features are used, the fragment shader key is known ahead-of-time. That means we can precompile shaders at CSO create time, hopefully avoiding some draw-time jank. Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19363>
2022-10-31gallium: Default to PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENTAlyssa Rosenzweig1-1/+0
Supported in all hardware and software drivers. Only that don't support are virgl and svga, depending on host capabilities. I don't think there's anything to be done there. This does give fewer places to screw up the CAPs, though, because everyone wants ARB_buffer_storage. Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Reviewed-by: Emma Anholt <emma@anholt.net> Reviewed-by: Marek Ol<C5><A1><C3><A1>k <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19392>
2022-10-29panfrost,asahi: Support ARB_buffer_storageAlyssa Rosenzweig1-0/+1
After a great deal of spec lawyering in #dri-devel, I am convinced this is probably okay for the same reasons as v3d and freedreno. The batch reordering and flush deferral optimizations are seemingly still ok. The requirement that writes are visible "immediately" in the spec actually means "in the subsequent [OpenGL] command" for the CPU -> GPU direction, which avoids pitfalls where PERSISTENT|COHERENT could be used as a "doorbell". With that understanding, the extension doesn't actually require anything special for tilers other than coherency at GPU submit boundaries, which is true for any driver that does not use a sync ioctl. After this commit, the remaining drivers that don't set the CAP are d3d12, softpipe, etnaviv, and i915g. I am unsure about d3d12, but the latter 3 could probbaly enable it trivially for the same reason. v2: Don't use copy_resource path for persistent mappings (Emma). Emma explained on GitLab: I don't think you should have the copy_resource path taken for PIPE_RESOURCE_FLAG_MAP_PERSISTENT BOs. Imagine the user has a general-purpose BO they're streaming stuff into and doing draws that they keep persistently mapped until wrapping. They call some GL function on the same buffer that does a fallback write map on the BO (u_default_buffer_subdata, util_resource_copy_region, whatever) -- the buffer is in use, copy triggers, allocates a new BO. Whoops, the user's pointer for streaming writes is now freed. Closes: #7570 Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Reviewed-by: Emma Anholt <emma@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19351>
2022-10-29gallium/util: add a helper for get_timestampYusuf Khan1-7/+1
Signed-off-by: Yusuf Khan <yusisamerican@gmail.com> Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Eric Engestrom <eric@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19334>
2022-10-27panfrost: Lower MAX_BLOCK_SIZE on MidgardAlyssa Rosenzweig1-3/+10
To match PIPE_COMPUTE_CAP_MAX_THREADS_PER_BLOCK, having it be higher in any dimension is nonsensical and can confuse apps. Fixes tests in KHR-GLES31.core.texture_buffer.* on Mali-T860. Fixes: 9b19104a30b ("pan/mdg: Lower PIPE_COMPUTE_CAP_MAX_THREADS_PER_BLOCK on Midgard") Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19238>
2022-10-27panfrost: Don't allow VS side effects on midgardAlyssa Rosenzweig1-6/+2
So we can use the common XFB lowering, and try to reduce the differences between Midgard and Bifrost (given that Bifrost is conformant and actively maintained, and Midgard is neither, getting Midgard as close to Bifrost is in the best interests of Midgard's long term prospects upstream). Piles of KHR-GLES31 tests from Fail -> Skip. Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19238>