aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/panfrost/pan_blend_cso.c
Commit message (Collapse)AuthorAgeFilesLines
* panfrost: Ensure final.no_colour is initialized.Vinson Lee2020-05-231-0/+1
| | | | | | | | | | | | | Fix warning reported by Coverity Scan. Uninitialized scalar variable (UNINIT) uninit_use: Using uninitialized value final. Field final.no_colour is uninitialized. Fixes: 3e4e849e6a96 ("panfrost: Disable tib read/write when colourmask = 0x0") Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5183>
* panfrost: Disable tib read/write when colourmask = 0x0Alyssa Rosenzweig2020-05-211-0/+2
| | | | | | | | There might still be Z/S updates so we can't drop the whole shader but we can shortcircuit the colour pipeline. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5124>
* panfrost: Prepare shader_meta descriptors at emission timeBoris Brezillon2020-03-101-5/+0
| | | | | | | | | | | | | | | | | This way we avoid potential state leaks and keep the shader_meta initialization in once place. The time spent preparing the shader descriptors should be negligible compared to the time spent pushing those descriptors to the transient buffer (remember we are writing to non-cacheable memory here). Note that we might get back to some sort of shader_meta descriptor caching at some point if that proves necessary, but now we have those panfrost_frag_meta_xxx_update() helpers now where xxx maps directly to a CSO bind, which should ease desc template updates. Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4083>
* panfrost: LogicOp supportIcecream952020-02-201-9/+10
| | | | | | | | | | | | | | The generated shaders are definitely not optimal, but for a feature hardly anyone uses, it's probably good enough. The XScreensaver demos quasicrystal, blitspin, bouboule, crystal and munch now seem to work, with no obvious problems. Currently this only works for 8-bit textures. Reviewed-by: Alyssa Rosenzweig <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3887> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3887>
* panfrost: Remove dirty trackingAlyssa Rosenzweig2020-02-191-3/+0
| | | | | | | | | | We never really respected it and it doesn't quite make sense for Mali the way it was previously setup. The correct solution is to do push as much code into CSO creation as possible. Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Boris Brezillon <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3855>
* panfrost: Pack MRT blend shaders into a single BOAlyssa Rosenzweig2020-01-021-10/+19
| | | | | | | | | | Blend shader size and location in memory is considerably constrained, probably to facilitate optimizations (my guess is that blend shaders are run strictly out of i-cache). We need to pack the blend shaders for each RT of a single framebuffer together. The easiest way to do this is at draw time which is not terribly efficient but will hold us over for now. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Pass blend RT number throughAlyssa Rosenzweig2019-12-161-4/+5
| | | | | | | | We have to key the blend shader for the render target number due to writeout silliness. Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Tomeu Visoso <[email protected]>
* panfrost: Add quirks system to cmdstreamTomeu Vizoso2019-12-031-1/+2
| | | | | | | | Similarly to how it's already done in the compiler, add a way to express differences between GPU models that need to be taken into account when assembling the cmdstream. Signed-off-by: Tomeu Vizoso <[email protected]>
* panfrost: Extend the panfrost_batch_add_bo() API to pass access flagsBoris Brezillon2019-10-031-1/+5
| | | | | | | | | | | | | | | | | 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]>
* panfrost: Add the panfrost_batch_create_bo() helperBoris Brezillon2019-09-181-6/+2
| | | | | | | | This helper automates the panfrost_bo_create()+panfrost_batch_add_bo()+ panfrost_bo_unreference() sequence that's done for all per-batch BOs. Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Stop passing screen around for BO operationsBoris Brezillon2019-09-181-1/+1
| | | | | | | | Store a screen pointer in panfrost_bo so we don't have to pass a screen object to all functions manipulating the BO. Signed-off-by: Boris Brezillon <[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: s/PAN_ALLOCATE_/PAN_BO_/Boris Brezillon2019-09-181-1/+1
| | | | | | | | Change the prefix for BO allocation flags to make it consistent with the rest of the BO API. Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Get rid of pan_drm.cBoris Brezillon2019-09-181-1/+1
| | | | | | | | | | | | | | | | pan_drm.c was only meaningful when we were supporting 2 kernel drivers (mali_kbase, and the drm one). Now that there's now kernel-driver abstraction we're better off moving those functions were they belong: * BO related functions in pan_bo.c * fence related functions + query_gpu_version() in pan_screen.c * submit related functions in pan_job.c While at it, we rename the functions according to the place they're being moved to. Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: s/job/batch/Boris Brezillon2019-09-081-2/+2
| | | | | | | | | | | | 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]>
* panfrost: Extend blending to MRTAlyssa Rosenzweig2019-08-141-3/+15
| | | | | | | Our hardware supports independent (per-RT) blending, but we need to route those settings through from Gallium. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Allocate shaders in their own BOsTomeu Vizoso2019-08-081-12/+29
| | | | | | | | | | | | | | | | | | | | | Instead of all shaders being stored in a single BO, have each shader in its own. This removes the need for a 16MB allocation per context, and allows us to place transient blend shaders in BOs marked as executable (before they were allocated in the transient pool, which shouldn't be executable). v2: - Store compiled blend shaders in a malloc'ed buffer, to avoid reading from GPU-accessible memory when patching (Alyssa). - Free struct panfrost_blend_shader (Alyssa). - Give the job a reference to regular shaders when emitting (Alyssa). v3: - Split out the allocation flags change (Rob). Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Move require_sfbd to screenAlyssa Rosenzweig2019-07-251-1/+2
| | | | | | We'll need it to specialize resource creation by chip. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Check for NULL surface in placesAlyssa Rosenzweig2019-07-181-1/+1
| | | | | | | | | | 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: Use correct NO_DITHER field on MFBDAlyssa Rosenzweig2019-07-181-1/+3
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Don't leak the blend CSO hash tableAlyssa Rosenzweig2019-07-151-3/+2
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Fix blend_cso if nr_cbufs == 0Alyssa Rosenzweig2019-07-151-3/+6
| | | | | | Fixes: 46396af1ec4b69ca4a ("panfrost: Refactor blend infrastructure") Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Style main Gallium driverAlyssa Rosenzweig2019-07-101-14/+13
| | | | | | $ astyle *.c *.h --style=linux -s8 Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Fix copyright identifier in a few placesAlyssa Rosenzweig2019-07-101-1/+1
| | | | | | | Oops. Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Tomeu Vizoso <[email protected]>
* panfrost: Refactor blend infrastructureAlyssa Rosenzweig2019-07-101-0/+268
We would like to permit keying blend shaders against the framebuffer format, which requires some new blending abstractions. Signed-off-by: Alyssa Rosenzweig <[email protected]>