aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/panfrost/pan_screen.c
Commit message (Collapse)AuthorAgeFilesLines
* panfrost: Add app blacklistAlyssa Rosenzweig2019-08-051-2/+16
| | | | | | | | | | | | In preparation for an initial 19.2 release, add a blacklist for apps known to be buggy under Panfrost to protect users. Panfrost is NOT a conformant implementation at this time. Distros: please do not revert this patch. If blacklisted apps are run using Panfrost, dragons will bite you. Thanks :) Signed-off-by: Alyssa Rosenzweig <[email protected]> Acked-by: Tomeu Vizoso <[email protected]>
* panfrost: Adjust shader CAPs to expose dEQP computeAlyssa Rosenzweig2019-08-011-2/+1
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Expose NIR as our PIPE_SHADER_CAP_SUPPORTED_IRSAlyssa Rosenzweig2019-08-011-1/+1
| | | | | | | We *could* expose TGSI as well -- we pipe it through tgsi_to_nir for Gallium-internal shaders anyway -- but we'd rather not. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Copy freedreno's panfrost_get_compute_paramAlyssa Rosenzweig2019-08-011-0/+70
| | | | | | | Values reported here aren't remotely correct, but it's a start to just get the entrypoint stubbed out. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Expose COMPUTE-related caps for GLES3.1Alyssa Rosenzweig2019-08-011-4/+8
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Implement gl_FrontFacingAlyssa Rosenzweig2019-08-011-0/+5
| | | | | | | Interestingly, this requires no compiler changes. It's just exposed as a special varying. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Move require_sfbd to screenAlyssa Rosenzweig2019-07-251-0/+1
| | | | | | We'll need it to specialize resource creation by chip. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Don't expose some atomic stuff even with dEQPAlyssa Rosenzweig2019-07-241-1/+2
| | | | | | | | Fixes dEQP crashes. Fixes: 2f93ecd654e ("panfrost: Fake CAPs for dEQP-GLES31") Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Fake CAPs for dEQP-GLES31Alyssa Rosenzweig2019-07-231-2/+14
| | | | | | | | | | | We still have some big ticket items left on GLES 3.0, but it's often helpful to be able to access higher dEQP levels for debugging features that just don't quite match a particular API. Plus, this opens up a whole slew of new features to poke at if boredom overtakes, ahem. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* gallium: switch boolean -> bool at the interface definitionsIlia Mirkin2019-07-221-9/+9
| | | | | | | | | | | | | | | | | | This is a relatively minimal change to adjust all the gallium interfaces to use bool instead of boolean. I tried to avoid making unrelated changes inside of drivers to flip boolean -> bool to reduce the risk of regressions (the compiler will much more easily allow "dirty" values inside a char-based boolean than a C99 _Bool). This has been build-tested on amd64 with: Gallium drivers: nouveau r300 r600 radeonsi freedreno swrast etnaviv v3d vc4 i915 svga virgl swr panfrost iris lima kmsro Gallium st: mesa xa xvmc xvmc vdpau va Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Acked-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Expose 4 render targetsAlyssa Rosenzweig2019-07-181-2/+2
| | | | | | Hidden behind deqp flag as usual. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Implement Z32F(_S8) supportAlyssa Rosenzweig2019-07-181-0/+2
| | | | | | | 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: Use 64-bit descriptors globallyTomeu Vizoso2019-07-161-11/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Midgard supports two modes of operation, 32-bit mode and 64-bit mode. The GPU is natively 64-bit, but job descriptors can be submitted in 32-bit mode. Among other changes, 32-bit mode shortens pointer sizes to use 32-bit pointers rather than the full 64-bit range. The blob decides which mode to use based on the CPU bitness, so an armhf system uses 32-bit descriptors and an aarch64 system uses 64-bit descriptors. For a while, we mimicked this, bu inevitably this caused the 32-bit support to lag behind as our reference platform is 64-bit. To combat the code staleness, we traced an older GPU paired with a 64-bit CPU (the Midgard T720 on-board the sunxi H64). From there, we could tell which fields were really about hardware and which fields were simply reflections of the descriptor bitness. From there, we decided to remove support for 32-bit descriptors entirely, using 64-bit descriptors unconditionally. There is minimal performance penalty for this in practice, and it allows us to unify these disparate code paths. This fixes: - T860 + armhf - T820 + armhf - T760 + aarch64 And will help bringup of 1st/2nd generation Midgard regardless of CPU. [Work done by Tomeu. Commit message written by Alyssa.] v2: Add comments preserving information about the old behaviour for future reference. Fix a compiler warning. (Alyssa) Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Implement opportunistic AFBCAlyssa Rosenzweig2019-07-161-1/+1
| | | | | | | | | | | | | | | | Rather than hardcoding a BO layout at creation-time, we implement the ability to hint layouts at various points in a BO's lifetime, potentially reallocating and switching layouts if it's heuristically deemed useful to do so. In this patch, we add a simple hinting implementation, opportunistically compressing FBOs. Support is hidden behind PAN_MESA_DEBUG=afbc as the implementation is incomplete (software access to AFBC is unimplemented at the moment) and therefore would regress significantly. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Add BO cache data structureAlyssa Rosenzweig2019-07-151-0/+3
| | | | | | Linked list of panfrost_bo* nested inside an array of buckets. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Stub out panfrost_bo_cache_evictAlyssa Rosenzweig2019-07-151-0/+1
| | | | | | | This destructor will be used to legitimately free the BOs, now that a BO free with cacheable=0 is only a "fake" free. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Allocate UBOs on the stack, not the heapAlyssa Rosenzweig2019-07-151-1/+1
| | | | | | | Saves a call to calloc (the maximum size is small and known at compile-time) and fixes a leak. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Advertise more depth/stencil formatsAlyssa Rosenzweig2019-07-151-2/+7
| | | | | | Fixes a regression in glmark's shadow/refract scenes. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Remove all old allocatorsAlyssa Rosenzweig2019-07-151-1/+0
| | | | | | With the new refactor, this all becomes dead code. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Add panfrost_transient_bo arrayAlyssa Rosenzweig2019-07-121-0/+2
| | | | | | | We would like transient allocations to occur on the screen (borrowed by the batch) rather than on the context. Add fields to track this. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Don't lie about Z/S formatsAlyssa Rosenzweig2019-07-111-0/+20
| | | | | | | | | | | 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: Clamp point sizeAlyssa Rosenzweig2019-07-101-1/+1
| | | | | | | It's not clear the hardware really has a maximum which confuses dEQP; clamp to whatever we report as our maximum. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Style main Gallium driverAlyssa Rosenzweig2019-07-101-19/+19
| | | | | | $ astyle *.c *.h --style=linux -s8 Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Don't expose OES_standard_derivativesAlyssa Rosenzweig2019-07-101-1/+0
| | | | | | This has not been implemented quite yet. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* gallium: get rid of PIPE_CAP_SM3Erik Faye-Lund2019-07-101-1/+3
| | | | | | | | | | | | | | | | | | | | | PIPE_CAP_SM3 has always been an odd one out of all our caps. While most other caps are fine-grained and single-purpose, this cap encode several features in one. And since OpenGL cares more about single features, it'd be nice to get rid of this one. As it turns, this is now relatively simple. We only really care about three features using this cap, and those already got their own caps. So we can remove it, and make sure all current drivers just give the same response to all of them. The only place we *really* care about SM3 is in nine, and there we can instead just re-construct the information based on the finer-grained caps. This avoids DX9 semantics from needlessly leaking into all of the drivers, most of who doesn't care a whole lot about DX9 specifically. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Acked-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Bikeshed pan_screen.c commentAlyssa Rosenzweig2019-07-101-25/+21
| | | | | | | The asterisks were inherited from... softpipe, maybe? Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Tomeu Vizoso <[email protected]>
* panfrost: Check GPU version before loadingAlyssa Rosenzweig2019-07-101-0/+25
| | | | | | | | | | Panfrost is known to only work on a select few CPU/GPU combinations at the moment (tested system-on-chips: RK3288, RK3399, and S912). Whitelist the combinations known to work and refuse to load on others where nothing works yet to avoid user confusion. Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Tomeu Vizoso <[email protected]>
* panfrost: Be more honest about PIPE_CAPsAlyssa Rosenzweig2019-07-101-101/+38
| | | | | | | | | | | | | | | A lot of the pan_screen.c code was cargoculted from other drivers. The upshot is that we return true for a lot of PIPE_CAPs that we don't actually support, resulting in us exposing way too many extensions that we don't actually support. Be more careful. Some CAPs we do need to fake to access higher dEQP versions (i.e. in order to debug the features we're hiding behind the CAP). For these, we hide the CAP behind a special PAN_MESA_DEBUG=deqp option to avoid apps randomly using these in-development features. Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Tomeu Vizoso <[email protected]>
* panfrost: Update supported formatsAlyssa Rosenzweig2019-07-101-40/+10
| | | | | | | | | | | | | | | | | | | | | Much of the format selection code was inherited from softpipe (!) of all places, and a lot of it is accordingly cruft. Later if-elses were added in random places to workaround missing formats at various points in history. Clean up some of this. Theoretically, any format we can texture from we can also render to. In practice, there are a few corner cases that we need to disable explicitly. For one, we do have to restrict SCANOUT formats to workaround buggy apps (in particular, dEQP which with --deqp-surface-type=window under Weston will end up with RGB10_A2 and complain about low alpha precision). Just be clearer about how/why. Also, RGB5_A1 support is still broken; let's not worry about that quite yet. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Get rid of the panfrost_driver abstraction leftoversBoris Brezillon2019-07-021-2/+0
| | | | | | | Commit 5f81669d880b ("panfrost: Remove the panfrost_driver abstraction") left a few things behind, remove them now. Signed-off-by: Boris Brezillon <[email protected]>
* panfrost: Implement instanced renderingAlyssa Rosenzweig2019-07-011-0/+4
| | | | | | | | | | | | | | | | | | We implement GLES3.0 instanced rendering with full support for instanced arrays (via instance divisors). To do so, we use the new invocation helpers to invoke a triplet of (1, vertex_count, instance_count), rather than simply (1, vertex_count, 1). We rewrite the attribute handling code into a new pan_instancing.c file which handles both the simple LINEAR case for non-instanced as well as each of the new instancing cases: MODULO (for per-vertex attributes), POT and NPOT divisors. As a side effect, we rework how vertex buffers are handled, duplicating them to be 1:1 with vertex descriptors to simplify instancing code paths dramatically. This might be a performance regression, but this remains to be seen; if so, we can always deduplicate later with some added logic in pan_instancing.c Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Allow R11G11B10 renderingAlyssa Rosenzweig2019-06-281-3/+10
| | | | | | Doesn't fully work yet, but better than crashing. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Disable DXT-style texture compressionAlyssa Rosenzweig2019-06-281-3/+1
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Update copyright identifiersAlyssa Rosenzweig2019-06-261-1/+1
| | | | | | | "Collabora, Ltd." should be listed in lieu of simply "Collabora" Signed-off-by: Alyssa Rosenzweig <[email protected]> Suggested-by: Daniel Stone <[email protected]>
* panfrost: Advertise support for other 8-bit UNORM formatsAlyssa Rosenzweig2019-06-251-26/+15
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Handle generate_mipmap ourselvesAlyssa Rosenzweig2019-06-251-0/+3
| | | | | | | | | | | | | To avoid interference with the wallpaper code, we need to do some state tracking when generating mipmaps. In particular, we need to mark the generated layers as invalid before generating the mipmap, so we don't try to backblit them if they already had content. Likewise, we need to flush both before and after generating a mipmap since our usual set_framebuffer_state flushing isn't quite there yet. Ideally better optimizations would save the flush but I digress. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Allow up to 16 UBOsAlyssa Rosenzweig2019-06-241-1/+1
| | | | | | This is the hardware max, as far as I can tell. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Remove the panfrost_driver abstractionBoris Brezillon2019-06-211-5/+3
| | | | | | | | The non-DRM backend is gone. Let's get rid of the panfrost_driver abstraction and call the panfrost_drm_xxx() functions directly. Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Remove the perf counters interfaceBoris Brezillon2019-06-211-10/+0
| | | | | | | | The DRM backend has a dummy implementation and the non-DRM backend is gone, so let's remove this perf counter interface. Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Move to use ralloc for some allocationsTomeu Vizoso2019-06-191-3/+5
| | | | | | | | | | | | | | We have some serious leaks, so plug some and also move to ralloc to limit the lifetime of some objects to that of their parent. Lots more such work to do. For some reason, this fixes: dEQP-GLES2.functional.lifetime.attach.deleted_output.texture_framebuffer Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Enable sRGBAlyssa Rosenzweig2019-06-181-4/+0
| | | | | | | Now that sRGB formats are supported for both rendering and sampling, advertise support. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Replace pantrace with direct decodingAlyssa Rosenzweig2019-06-121-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | History lesson! In the early days of a Panfrost, we had a library independent of the driver called `panwrap` which would be LD_PRELOAD'ed into a driver to decode its cmdstream in real-time. When upstreaming Panfrost, we realized that we would much rather have this decode functionality maintained in-tree to avoid divergence, but that we could not upstream panwrap because of its use with the legacy API. So we instead dumped GPU memory to the filesystem with an out-of-tree panwrap, and decoded that with the in-tree pandecode module. When we migrated to the new kernel, we just added support for doing this memory dump directly from the driver (via a module "pantrace"). This works, but dumping memory every frame is sloooooooooooooow and error-prone. I figured if we have pandecode in-tree, we might as well link to it directly in the driver, allowing us to decode Panfrost's command streams without dumping memory to the filesystem first. This cleans up the code *substantially* and improves dumping performance by a HUGE margin. I'm talking "several seconds per frame" to "dumping in real-time" kind of jump. Note to users: this removes the environmental option "PANTRACE_BASE". Instead, for equivalent functionality set "PAN_MESA_DEBUG=trace" and redirect stdout to the file of your choosing. This should be debugging Panfrost much more pleasant. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Report sRGB colorspace as not supportedBoris Brezillon2019-06-061-0/+4
| | | | | | | The driver does not support sRGB yet, so let's report it as unsupported. Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Don't flip scanoutAlyssa Rosenzweig2019-06-051-1/+5
| | | | | | | | | | | | | | | | | | | | | | 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]>
* gallium: Redefine the max texture 2d cap from _LEVELS to _SIZE.Eric Anholt2019-05-131-1/+2
| | | | | | | | The _LEVELS assumes that the max is always power of two. For V3D 4.2, we can support up to 7680 non-power-of-two MSAA textures, which will let X11 support dual 4k displays on newer hardware. Reviewed-by: Marek Olšák <[email protected]>
* panfrost: Add CAPFs for conservative rasterizationTomeu Vizoso2019-05-101-0/+5
| | | | | | | | | | | | | | Just do what everybody else but Nouveau does and return 0.0f. This prevents the repeated logging of these messages on startup: Unexpected PIPE_CAPF 6 query Unexpected PIPE_CAPF 7 query Unexpected PIPE_CAPF 8 query Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Support RGB565 FBOsAlyssa Rosenzweig2019-05-041-4/+4
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Remove shader dumpAlyssa Rosenzweig2019-05-011-1/+0
| | | | | | Redundant via the midgard shader dump. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Disable indirect outputs for nowAlyssa Rosenzweig2019-04-241-1/+2
| | | | | | | The hardware needs this lowered anyway; for now, might as well use mesa's default lowering for pure conformance reasons. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/midgard: Implement indirect loads of varyings/UBOsAlyssa Rosenzweig2019-04-241-0/+2
| | | | | | | | This adds preliminary support for indirect loads of varying arrays and uniform arrays, bringing a few new tests in shader.indexing.* to passing, although there remains a number of cases still missing. Signed-off-by: Alyssa Rosenzweig <[email protected]>