summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/panfrost
Commit message (Collapse)AuthorAgeFilesLines
* panfrost: Select format-specific blending intrinsicsAlyssa Rosenzweig2019-11-113-9/+41
| | | | | | | | | | | If we have an accelerated path for a particular framebuffer format, let's use it to save a bunch of instructions in a blend shader. [Tomeu: Only use the faster intrinsic on >T760] Signed-off-by: Alyssa Rosenzweig <[email protected]> Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Tomeu Vizoso <[email protected]>
* panfrost: Set depth and stencil for SFBD based on the formatTomeu Vizoso2019-11-114-21/+36
| | | | | Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Try to evict unused BOs from the cacheBoris Brezillon2019-11-084-6/+61
| | | | | | | | | | | | | | | | | | | | | | The panfrost BO cache can only grow since all newly allocated BOs are returned to the cache (unless they've been exported). With the MADVISE ioctl that's not a big issue because the kernel can come and reclaim this memory, but MADVISE will only be available on 5.4 kernels. This means an app can currently allocate a lot memory without ever releasing it, leading to some situations where the OOM-killer kicks in and kills the app (or even worse, kills another process consuming more memory than the GL app) to get some of this memory back. Let's try to limit the amount of BOs we keep in the cache by evicting entries that have not been used for more than one second (if the app stopped allocating BOs of this size, it's likely to not allocate similar BOs in a near future). This solution is based on the VC4/V3D implementation. Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Move BO cache related fields to a sub-structBoris Brezillon2019-11-083-18/+21
| | | | | | | | | We will soon introduce an LRU list to evict BOs that have been unused for more than 1 second. Let's first move all BO cache fields to a sub-struct to clarify which fields are used by the BO caching logic. Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Pipe the GPU ID into compiler and disassemblerTomeu Vizoso2019-11-073-3/+4
| | | | Signed-off-by: Tomeu Vizoso <[email protected]>
* panfrost: Release the ctx->pipe_framebuffer refBoris Brezillon2019-11-071-0/+1
| | | | | | | | ctx->pipe_framebuffer contains the last bound FB state, let's release resources pointed by this FB state when the context is destroyed. Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Destroy the upload manager allocated in panfrost_create_context()Boris Brezillon2019-11-071-0/+2
| | | | | | | | | pipe->stream_uploader has been allocated with u_upload_create_default() in panfrost_create_context(), let's destroy it in the context destroy path. Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Generate polygon list manually for SFBDTomeu Vizoso2019-11-062-1/+18
| | | | | | | | On clears without draws, the SFBD GPUs need for userspace to generate the trivial polygon list. Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Decode blend shaders for SFBDTomeu Vizoso2019-11-061-1/+3
| | | | | | | Also set MALI_HAS_BLEND_SHADER as needed. Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Take into account texture layers in SFBDTomeu Vizoso2019-11-061-5/+6
| | | | | Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Rework format encoding on SFBDTomeu Vizoso2019-11-066-46/+104
| | | | | | Signed-off-by: Alyssa Rosenzweig <[email protected]> Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Set 0x10 bit on mali_shader_meta.unknown2_4 on T720Tomeu Vizoso2019-11-062-7/+3
| | | | | | | | | Testing shows that it's needed. Also remove ctx->is_t6xx as it was the last use of it. Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Add checksum fields to SFBD descriptorTomeu Vizoso2019-11-061-0/+12
| | | | | | | During tests on T720, these fields were discovered. Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: MALI_DEPTH_TEST is actually MALI_DEPTH_WRITEMASKBoris Brezillon2019-11-041-1/+2
| | | | | | | | | MALI_DEPTH_TEST should only be set when depth->writemask is true, not when the depth test is enabled. Let's rename the flag and patch panfrost_bind_depth_stencil_state() to do the right thing. Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Use fp32 blend shadersAlyssa Rosenzweig2019-11-012-10/+10
| | | | | | | | | Clearly we do want to have fp16 at some point ... but I kind of give up debugging and it turns out the issues with fp16 support in 'frost are so deeply rooted that I might as well disable this non-opt and land LCRA now. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* android: Add panfrost support to build scriptsRobert Foss2019-10-312-0/+97
| | | | | | | | | | | | Currently the Android build system doesn't expose the panfrost driver. This patch enables the panfrost driver to be build on for the Android platform. Signed-off-by: Robert Foss <[email protected]> Reviewed-By: Rohan Garg <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Cleanup _shader_upper -> shaderAlyssa Rosenzweig2019-10-291-4/+4
| | | | | | I don't believe this is actually a tagged pointer; warn if it is. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Disable precise occlusion queriesAlyssa Rosenzweig2019-10-261-1/+1
| | | | | | | I thought there was hardware support for this, but it seems to broken, or at least more complex than I believed. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: allocate bo for occlusion query resultsUrja Rannikko2019-10-262-14/+25
| | | | | | | | | This memory needs to still be available after all the drawing is done and forgotten about, so cannot be transient. Also clear the result so that no rendering returns a zero. Signed-off-by: Urja Rannikko <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Expose serialized NIR supportAlyssa Rosenzweig2019-10-262-4/+13
| | | | | | | | | | | Serialized NIR is required for clover with the SPIR-V pipeline. With this change and PAN_MESA_DEBUG=deqp, clinfo is able to successfully probe panfrost. Code from Nouveau (commit 7955fabcf89c7265f7f4244e46c5bcb83b9687fa by Karol Herbst). Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Fix the DISCARD_WHOLE_RES case in transfer_map()Boris Brezillon2019-10-213-2/+63
| | | | | | | | | | | | | | | | | The current implementation does not synchronize on BO readiness when DISCARD_WHOLE_RES flag is set, which can lead to misbehaviours when the resource being updated is being used by one of the pending or already flushed batches. Adding unconditional BO synchronization would do the trick, but we can sometimes optimize this path by re-allocating a new BO instead of waiting for the existing one to be ready. Reported-by: Daniel Stone <[email protected]> Reported-by: Heinrich Fink <[email protected]> Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Daniel Stone <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Respect offset for imported resourcesDaniel Stone2019-10-181-0/+3
| | | | | | | | | | | | | | | | When we import a resource through Gallium, we need to take account of the offset parameter passed. Fixes a failure seen with the VIVID V4L2 driver, which would create NV12 resources within the same BO, with an offset. Sample pipeline to reproduce (replace videoN with your actual VIVID device node): gst-launch-1.0 v4l2src device=/dev/videoN ! video/x-raw,format=NV12 ! glimagesink Signed-off-by: Daniel Stone <[email protected]> Reviewed-by: Tomeu Vizoso <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]> Reported-by: Nicolas Dufresne <[email protected]> Tested-by: Nicolas Dufresne <[email protected]>
* panfrost: Keep track of active BOsTomeu Vizoso2019-10-173-21/+87
| | | | | | | | | | | | | | | If two jobs use the same GEM object at the same time, the job that finishes first will (previous to this commit) close the GEM object, even if there's a job still referencing it. To prevent this, have all jobs use the same panfrost_bo for a given GEM object, so it's only closed once the last job is done with it. Signed-off-by: Tomeu Vizoso <[email protected]> Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Daniel Stone <[email protected]> Reviewed-by: Rohan Garg <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: do not report alpha-test as supportedErik Faye-Lund2019-10-172-9/+3
| | | | | | | This triggers lowering in the state-tracker, which makes things a bit simpler. Reviewed-by: Marek Olšák <[email protected]>
* nir: allow passing alpha-ref state to lowering-codeErik Faye-Lund2019-10-171-1/+2
| | | | Reviewed-by: Marek Olšák <[email protected]>
* pan/midgard: Allow COMPUTE jobs in panfrost_bo_access_for_stageAlyssa Rosenzweig2019-10-161-1/+7
| | | | | Fixes: ada752afe40 ("panfrost: Extend the panfrost_batch_add_bo() API to pass access flags") Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Disable frame throttlingAlyssa Rosenzweig2019-10-161-0/+3
| | | | | | | | | | | | | | The new frame throttling implemention interacts unfortunately with pipelining, leading to fence fds leaking like crazy and ultimately apps crashing quickly. With this patch, apps still crash but not as quickly. We need to either figure out the real cause or revert the core changes. Nevertheless, we don't want frame throttling in the first place, so. Fixes: a65e29ccb26 ("gallium: simplify throttle implementation") Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Fix support for packed 24-bit formatsBoris Brezillon2019-10-131-1/+1
| | | | | | | | | pan_pack_color() color was missing the 24-bit packed format case. Looks like putting the clear color in a 32-bit slot does the trick. Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* gallium: remove PIPE_SHADER_CAP_SCALAR_ISAMarek Olšák2019-10-101-3/+0
| | | | | | Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* panfrost: Draw the wallpaper when only depth/stencil bufs are clearedBoris Brezillon2019-10-082-3/+15
| | | | | | | | | When only the depth/stencil bufs are cleared, we should make sure the color content is reloaded into the tile buffers if we want to preserve their content. Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Make sure a clear does not re-use a pre-existing batchBoris Brezillon2019-10-083-1/+32
| | | | | | | | | | | | | | glClear()s are expected to be the first thing GL apps do before drawing new things. If there's already an existing batch targetting the same FBO that has draws attached to it, we should make sure the new clear gets a new batch assigned to guaranteed that the FB content is actually cleared with the requested color/depth/stencil values. We create a panfrost_get_fresh_batch_for_fbo() helper for that and call it from panfrost_clear(). Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* gallium: add PIPE_RESOURCE_FLAG_SINGLE_THREAD_USE to skip util_range lockMarek Olšák2019-10-071-2/+2
| | | | | | | | | u_upload_mgr sets it, so that util_range_add can skip the lock. The time spent in tc_transfer_flush_region decreases from 0.8% to 0.2% in torcs on radeonsi. Reviewed-by: Kenneth Graunke <[email protected]>
* Revert "Revert "st/dri2: Implement DRI2bufferDamageExtension""Boris Brezillon2019-10-071-0/+1
| | | | | | | This reverts commit 19546108d3dd5541a189e36df4ea83b3f519e48f. This commit breaks the build because lima implements ->set_damage_region(). I guess we'll need more discussion before removing the ->set_damage_region() hook.
* Revert "st/dri2: Implement DRI2bufferDamageExtension"Boris Brezillon2019-10-071-1/+0
| | | | | | | | | | | | | | This reverts commit 492ffbed63a2a62759224b1c7d45aa7923d8f542. BACK_LEFT attachment can be outdated when the user calls KHR_partial_update(), leading to a damage region update on the wrong pipe_resource object. Let's not expose the ->set_damage_region() method until the core is fixed to handle that properly. Cc: [email protected] Signed-off-by: Boris Brezillon <[email protected]> Acked-by: Daniel Stone <[email protected]>
* gitlab-ci: Move LAVA-related files into top-level ci dirTomeu Vizoso2019-10-069-1741/+0
| | | | | | | In preparation for testing drivers other than Panfrost in LAVA labs. Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* gitlab-ci: Run dEQP on devices with PanfrostTomeu Vizoso2019-10-063-53/+40
| | | | | | | | | | | Include Panfrost's gitlab.ci.yml file from Mesa's main .gitlab-ci.yml so we test on devices with Panfrost. This uses LAVA to schedule jobs in the devices and will be the base for testing Etnaviv, Lima, etc. Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* panfrost: Get rid of the flush in panfrost_set_framebuffer_state()Boris Brezillon2019-10-031-43/+3
| | | | | | | | | Now that we have track inter-batch dependencies, the flush done in panfrost_set_framebuffer_state() is no longer needed. Let's get rid of it. Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Kill the explicit serialization in panfrost_batch_submit()Boris Brezillon2019-10-031-12/+0
| | | | | | | | | Now that we have all the pieces in place to support pipelining batches we can get rid of the drmSyncobjWait() at the end of panfrost_batch_submit(). Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Do fine-grained flushing when preparing BO for CPU accessesBoris Brezillon2019-10-032-19/+12
| | | | | | | | | | | | | We don't have to flush all batches when we're only interested in reading/writing a specific BO. Thanks to the panfrost_flush_batches_accessing_bo() and panfrost_bo_wait() helpers we can now flush only the batches touching the BO we want to access from the CPU. This fixes the dEQP-GLES2.functional.fbo.render.texsubimage.* tests. Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Make sure the BO is 'ready' when picked from the cacheBoris Brezillon2019-10-033-24/+110
| | | | | | | | This is needed if we want to free the panfrost_batch object at submit time in order to not have to GC the batch on the next job submission. Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Add flags to reflect the BO imported/exported stateBoris Brezillon2019-10-032-2/+8
| | | | | | | | | Will be useful to make the ioctl(WAIT_BO) call conditional on BOs that are not exported/imported (meaning that all GPU accesses are known by the context). Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Add a panfrost_flush_batches_accessing_bo() helperBoris Brezillon2019-10-032-0/+35
| | | | | | | | This will allow us to only flush batches touching a specific resource, which is particularly useful when the CPU needs to access a BO. Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Add a panfrost_flush_all_batches() helperBoris Brezillon2019-10-035-15/+64
| | | | | | | | | | | And use it in panfrost_flush() to flush all batches, and not only the one currently bound to the context. We also replace all internal calls to panfrost_flush() by panfrost_flush_all_batches() ones. Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Prepare panfrost_fence for batch pipeliningBoris Brezillon2019-10-035-58/+59
| | | | | | | | | | | | | | The panfrost_fence logic currently waits on the last submitted batch, but the batch serialization that was enforced in panfrost_batch_submit() is about to go away, allowing for several batches to be pipelined, and the last submitted one is not necessarily the one that will finish last. We need to make sure the fence logic waits on all flushed batches, not only the last one. Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Start tracking inter-batch dependenciesBoris Brezillon2019-10-033-5/+356
| | | | | | | | | | The idea is to track which BO are being accessed and the type of access to determine when a dependency exists. Thanks to that we can build a dependency graph that will allow us to flush batches in the correct order. Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Add a panfrost_freeze_batch() helperBoris Brezillon2019-10-031-18/+44
| | | | | | | | | We'll soon need to freeze a batch not only when it's flushed, but also when another batch depends on us, so let's add a helper to avoid duplicating the logic. Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Use the per-batch fences to wait on the last submitted batchBoris Brezillon2019-10-034-15/+47
| | | | | | | | | We just replace the per-context out_sync object by a pointer to the the fence of the last last submitted batch. Pipelining of batches will come later. Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Add a batch fenceBoris Brezillon2019-10-032-1/+94
| | | | | | | So we can implement fine-grained dependency tracking between batches. Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Make panfrost_batch->bos a hash tableBoris Brezillon2019-10-032-12/+23
| | | | | | | | So we can store the flags as data and keep the BO as a key. This way we keep track of the type of access done on BOs. Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Extend the panfrost_batch_add_bo() API to pass access flagsBoris Brezillon2019-10-038-23/+114
| | | | | | | | | | | | | | | | | The type of access being done on a BO has impacts on job scheduling (shared resources being written enforce serialization while those being read only allow for job parallelization) and BO lifetime (the fragment job might last longer than the vertex/tiler ones, if we can, it's good to release BOs earlier so that others can re-use them through the BO re-use cache). Let's pass extra access flags to panfrost_batch_add_bo() and panfrost_batch_create_bo() so the batch submission logic can take the appropriate when submitting batches. Note that this information is not used yet, we're just patching callers to pass the correct flags here. Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>