summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/etnaviv/etnaviv_texture.c
AgeCommit message (Collapse)AuthorFilesLines
2020-10-30etnaviv: tex_desc: fix TS compression enableLucas Stach1-0/+1
The TX_CTRL register has a bit to enable TS compression, the setting in TS_SAMPLER_CONFIG is ignored for descriptor based textures. Apparently 256B tile mode already implies enabled compression to the HW, as with the larger tile mode with compression was working fine, only the 128B tile mode needs this change to work correctly. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7367>
2020-03-13etnaviv: get rid of etna_spec in etna_contextChristian Gmeiner1-5/+9
There is no need to have a complete copy of etna_spec - just reference the one and only from etna_screen. Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Reviewed-by: Lucas Stach <l.stach@pengutronix.de> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4095>
2019-11-25etnaviv: implement 64bpp clearJonathan Marek1-1/+1
At the same time, update etna_clear_blit_pack_rgba to work with integer formats. Signed-off-by: Jonathan Marek <jonathan@marek.ca> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2019-10-18etnaviv: GC7000: Texture descriptorsWladimir J. van der Laan1-1/+8
Create a separate implementation file with texture-descriptor-based sampler views and sampler states. Initialize the one or the other based on the GPU. There is so little in common that this seemed more appropriate that keeping them as one type of state object would only be confusing. This commit is actually a combiation of the original commit by Wladimir, fixes and TS implementation from Jonathan and changed to use softpin by Lucas. Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com> Signed-off-by: Jonathan Marek <jonathan@marek.ca> Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Guido Günther <agx@sigxcpu.org> Reviewed-by: Jonathan Marek <jonathan@marek.ca>
2019-10-18etnaviv: Rework lockingMarek Vasut1-0/+2
Replace the per-screen locking of flushing with per-context one and add per-context lock around command stream buffer accesses, to prevent cross-context flushing from corrupting these command stream buffers. Signed-off-by: Marek Vasut <marex@denx.de>
2019-10-11etnaviv: rework compatible render baseJonathan Marek1-2/+2
For PE-incompatible layouts, use a mechanism similar to what texture does to create a compatible base resource. Signed-off-by: Jonathan Marek <jonathan@marek.ca> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2019-10-11etnaviv: get addressing mode from tiling layoutJonathan Marek1-1/+0
Remove the "addressing_mode" state, which is currently set incorrectly, and instead deduce the addressing mode from the tiling layout. Signed-off-by: Jonathan Marek <jonathan@marek.ca> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2019-10-11etnaviv: clear texture cache and flush ts when texture is modifiedJonathan Marek1-26/+38
Signed-off-by: Jonathan Marek <jonathan@marek.ca> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2019-07-04etnaviv: implement buffer compressionJonathan Marek1-2/+3
Vivante GPUs have lossless buffer compression using the tile-status bits, which can reduce memory access and thus improve performance. This patch only enables compression for "V4" compression GPUs, but the implementation is tested on GC2000(V1) and GC3000(V2). V1/V2 compresssion looks absolutely useless, so it is not enabled. I couldn't test if this patch breaks MSAA, because it looks like MSAA is already broken. Signed-off-by: Jonathan Marek <jonathan@marek.ca> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2019-07-04etnaviv: combine translate_ts_sampler_format/translate_msaa_formatJonathan Marek1-2/+2
Both translate the same thing, so just add the missing cases into one. Signed-off-by: Jonathan Marek <jonathan@marek.ca> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2019-07-04etnaviv: implement TS_MODE for GC7000LJonathan Marek1-0/+1
GC7000L has a TS mode with larger tiles, which improves performance. Signed-off-by: Jonathan Marek <jonathan@marek.ca> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2019-07-04etnaviv: update headers from rnndbJonathan Marek1-2/+2
Update to etna_viv commit 8a8b13a and use new names in the code. Signed-off-by: Jonathan Marek <jonathan@marek.ca> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2019-02-14drm-uapi: use local files, not system libdrmEric Engestrom1-1/+1
There was an issue recently caused by the system header being included by mistake, so let's just get rid of this include path and always explicitly #include "drm-uapi/FOO.h" Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org>
2019-01-28etnaviv: add linear sampling supportChristian Gmeiner1-1/+3
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
2019-01-28etnaviv: extend etna_resource with an addressing modeChristian Gmeiner1-0/+1
Defines how sampler (and pixel pipes) needs to access the data represented with a resource. The used default is mode is ETNA_ADDRESSING_MODE_TILED. Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
2017-11-30etnaviv: GC7000: Factor out state based texture functionalityWladimir J. van der Laan1-166/+28
Prepare for two texture handling paths, the descriptor-based path will be added in a future commit. These are structured so that the texture implementation handles its own state emission. Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2017-11-30etnaviv: GC7000: Move active_samplers_bits to textureWladimir J. van der Laan1-0/+6
This needs to be shared between texture_plain and texture_desc. Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2017-11-30etnaviv: GC7000: Factor out incompatible texture handling logicWladimir J. van der Laan1-16/+26
This will be shared with the texture descriptor path. Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2017-11-30etnaviv: GC7000: Track dirty sampler viewsWladimir J. van der Laan1-2/+7
Need this to efficiently emit texture descriptor invalidations. Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2017-11-15etnaviv: Add sampler TS supportWladimir J. van der Laan1-6/+68
Sampler TS is an hardware optimization that can be used when rendering to textures. After rendering to a resource with TS enabled, the texture unit can use this to bypass lookups to empty tiles. This also means a resolve-in-place can be avoided to flush the TS. This commit is also an optimization when not using sampler TS, as resolve-in-place will now be skipped if a resource has no (valid) TS. Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2017-11-06etnaviv: ASTC texture supportWladimir J. van der Laan1-2/+9
Add ASTC texture support for hardware that supports this (currently only GC3000 on i.MX6qp is known to have this). Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2017-10-28etnaviv: add ext_texture_srgb supportChristian Gmeiner1-1/+2
Following piglits are passing: - glean@texture_srgb - spec@ext_texture_srgb@fbo-srgb - spec@ext_texture_srgb@tex-srgb - spec@ext_texture_srgb@texwrap formats - spec@ext_texture_srgb@texwrap formats-s3tc Btw. this enables GL 2.1 :-) Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Reviewed-by: Wladimir J. van der Laan <laanwj@gmail.com>
2017-07-19etnaviv: implement resource creation with modifierLucas Stach1-1/+4
This allows to create buffers with a specific tiling layout, which is primarily used by GBM to allocate the EGL back buffers with the correct tiling/modifier for use with the scanout engines. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-07-19etnaviv: also update textures from external resourcesLucas Stach1-8/+16
This reworks the logic in etna_update_sampler_source to select the newest resource view for updating the texture view. This should make the logic easier to follow and fixes texture updates from imported dma-bufs. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Reviewed-by: Wladimir J. van der Laan <laanwj@gmail.com> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2017-06-26etnaviv: add support for swizzled texture formatsChristian Gmeiner1-5/+4
Passes all ext_texture_swizzle piglits. Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Reviewed-By: Wladimir J. van der Laan <laanwj@gmail.com>
2017-06-26etnaviv: add support for extended texture formatsChristian Gmeiner1-3/+5
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Reviewed-by: Wladimir J. van der Laan <laanwj@gmail.com>
2017-06-08etnaviv: flush resource when binding as sampler viewLucas Stach1-0/+3
As TS is also allowed on sampler resources, we need to make sure to resolve to self when binding the resource as a texture, to avoid stale content being sampled. Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
2017-05-16etnaviv: clean up sampler view reference countingLucas Stach1-3/+3
Use the proper pipe_resource_reference function instead of rolling our own. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2017-04-22etnaviv: Supertiled texture support on gc3000Wladimir J. van der Laan1-2/+8
Support supertiled textures on hardware that has the appropriate feature flag SUPERTILED_TEXTURE. Most of the scaffolding was already in place in etna_layout_multiple: case ETNA_LAYOUT_SUPER_TILED: *paddingX = 64; *paddingY = 64; *halign = TEXTURE_HALIGN_SUPER_TILED; So this is just a matter of allowing it. Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2017-03-08etnaviv: s/unsigned/enum pipe_shader_type/Brian Paul1-2/+2
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
2017-02-21etnaviv: add missing fallthrough annotationChristian Gmeiner1-0/+1
Caught by Coverity, reported to me by imirkin. Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-01-18etnaviv: add flags parameter to texture barrierChristian Gmeiner1-1/+1
Fixes compile warning introduced by commit a1c848. Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2017-01-12etnaviv: gallium driver for Vivante GPUsThe etnaviv authors1-0/+338
This driver supports a wide range of Vivante IP cores like GC880, GC1000, GC2000 and GC3000. Changes from V1 -> V2: - added missing files to actually integrate the driver into build system. - adapted driver to new renderonly API Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: Russell King <rmk@arm.linux.org.uk> Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com> Acked-by: Emil Velikov <emil.velikov@collabora.com>