summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/etnaviv
Commit message (Collapse)AuthorAgeFilesLines
* etnaviv: fix memory leak when BO allocation failsLucas Stach2017-08-031-1/+5
| | | | | | | | | | | The resource struct is already allocated at this point and should be freed properly. Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Philipp Zabel <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]> Reviewed-by: Wladimir J. van der Laan <[email protected]> (cherry picked from commit 4fb9f97047eb1e43c47cb7cacba27ccd20383eff)
* etnaviv: Clear lbl_usage array correctlyWladimir J. van der Laan2017-08-031-1/+1
| | | | | | | | | | | | | | Fill the entire array instead of just a quarter. This avoids crashes with large shaders. (currently this never causes a problem because shaders larger than 2048/4 instructions are not supported by this driver on any hardware, but it will cause problems in the future) Fixes: ec436051899 ("etnaviv: fix shader miscompilation with more than 16 labels") Cc: [email protected] Signed-off-by: Wladimir J. van der Laan <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]> (cherry picked from commit 15a1ceb127b70ac98b03cae051927f75fb7ee204)
* etnaviv: don't dereference etna_resource pointer if allocation failsAleksander Morgado2017-07-121-3/+7
| | | | | | | | The check for the pointer being non-NULL was being done too late. Signed-off-by: Aleksander Morgado <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]> (cherry picked from commit a6893a50c8ae5b68e4175366dac718ee9f6fa9d1)
* etnaviv: fix refcnt initialization in etna_screenAleksander Morgado2017-07-121-0/+1
| | | | | | | | | | | | | | | | | | Despite being a member of the etna_screen struct, 'refcnt' is used by the winsys-specific logic to track the reference count of the object managed in a hash table. When the count reaches zero, the pipe screen is removed from the table and destroyed. Fix the logic by initializing the refcnt to 1 when screen created. This initialization is done in etna_screen_create(), to follow the same logic as in freedreno and virgl. Fixes: c9e8b49b885 ("etnaviv: gallium driver for Vivante GPUs") Cc: [email protected] Signed-off-by: Aleksander Morgado <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]> Reviewed-by: Lucas Stach <[email protected]> (cherry picked from commit 5d8514de14bd27170293bb373e06f5ff43c708ad)
* etnaviv: fix shader miscompilation with more than 16 labelsLucas Stach2017-07-081-28/+32
| | | | | | | | | | | | | | The labels array may change its virtual address on a reallocation, so it is invalid to cache pointers into the array. Rather than using the pointer directly, remember the array index. Fixes miscompilation of shaders in glmark2 ideas, leading to GPU hangs. Fixes: c9e8b49b (etnaviv: gallium driver for Vivante GPUs) Cc: [email protected] Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]> (cherry picked from commit ec43605189907fa327a4a7f457aa3c822cfdea5d)
* etnaviv: only flush resource to self if no scanout buffer existsLucas Stach2017-06-281-4/+5
| | | | | | | | | | | | | Currently a resource flush may trigger a self resolve, even if a scanout buffer exists, but is up to date. If a scanout buffer exists we only ever want to flush the resource to the scanout buffer. This fixes a performance regression. Fixes: dda956340ce9 (etnaviv: resolve tile status when flushing resource) Cc: [email protected] Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Philipp Zabel <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]> (cherry picked from commit 28550c787595f04453d2a39f46f570a891368fcf)
* etnaviv: advertise correct max LOD biasLucas Stach2017-06-281-1/+3
| | | | | | | | | | | | | The maximum LOD bias supported is the same as the max texture level supported. Fixes piglit: ext_texture_lod_bias Fixes: c9e8b49b ("etnaviv: gallium driver for Vivante GPUs") Cc: [email protected] Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]> (cherry picked from commit 5065549e2a75e2a56cd3bc8b0fbb6c9013e86cb4)
* etnaviv: mask correct channel for RB swapped rendertargetsLucas Stach2017-06-283-13/+46
| | | | | | | | | | | | | | Now that we support RB swapped targets by using a shader variant, we must derive the color mask from both the blend state and the bound framebuffer. Fixes piglit: fbo-colormask-formats Fixes: 7f62ffb68ad ("etnaviv: add support for rb swap") Cc: [email protected] Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]> (cherry picked from commit 8644b59b5d98cf58deaecc583f68edd8be23bfca)
* etnaviv: replace translate_clear_color with util_pack_colorLucas Stach2017-06-282-48/+12
| | | | | | | | | | | | | | | | This replaces the open coded etnaviv version of the color pack with the common util_pack_color. Fixes piglits: arb_color_buffer_float-clear fcc-front-buffer-distraction fbo-clearmipmap Fixes: c9e8b49b ("etnaviv: gallium driver for Vivante GPUs") Cc: [email protected] Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]> (cherry picked from commit d6aa2ba2b293f78d9c28922ed3af9077100f3480)
* etnaviv: remove bogus assertLucas Stach2017-06-281-2/+0
| | | | | | | | | | | | etna_resource_copy_region handles resources with multiple samples by falling back to the software path. There is no need to kill the application there. Fixes: c9e8b49b ("etnaviv: gallium driver for Vivante GPUs") Cc: [email protected] Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]> (cherry picked from commit 6633880e7e0557b3dc4e89e62857bd7b548c93fd)
* etnaviv: use padded width/height for resource copiesLucas Stach2017-06-281-2/+2
| | | | | | | | | | | | | When copying a resource fully we can just blit the whole level. This allows to use the RS even for level sizes not aligned to the RS min alignment. This is especially useful, as etna_copy_resource is part of the software fallback paths (used in etna_transfer), that are used for doing unaligned copies. Fixes: c9e8b49b ("etnaviv: gallium driver for Vivante GPUs") Cc: [email protected] Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]> (cherry picked from commit ff490eb8fd3a1edee1b3aec3f8122f7d6f90a80f)
* etnaviv: don't try RS blit if blit region is unalignedLucas Stach2017-06-281-1/+2
| | | | | | | | | | | If the blit region is not aligned to the RS min alignment don't try to execute the blit, but fall back to the software path. Fixes: c9e8b49b ("etnaviv: gallium driver for Vivante GPUs") Cc: [email protected] Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]> (cherry picked from commit 2a6183d416395ca4659e4b6fed9d0918c74cb469)
* etnaviv: always do cpu_fini in transfer_unmapLucas Stach2017-06-141-3/+6
| | | | | | | | | | | | | | | | | | The cpu_fini() call pushes the buffer back into the GPU domain, which needs to be done for all buffers, not just the ones with CPU written content. The etnaviv kernel driver currently doesn't validate this, but may start to do so at a later point in time. If there is a temporary resource the fini needs to happen before the RS uses this one as the source for the upload. Also remove an invalid comment about flushing CPU caches, cpu_fini takes care of everything involved in this. Fixes: c9e8b49b885 ("etnaviv: gallium driver for Vivante GPUs") Cc: [email protected] Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Philipp Zabel <[email protected]> Reviewed-By: Wladimir J. van der Laan <[email protected]> (cherry picked from commit cab5996c2637c31a78a0196e42ec6de9eb61f270)
* etnaviv: allow R/B swapped surfaces to be clearedLucas Stach2017-05-181-0/+2
| | | | | | | | Fixes: 7f62ffb68ad ("etnaviv: add support for rb swap") Cc: [email protected] Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]> (cherry picked from commit 20ce6f136188c24a019153e78c87872fb0a03060)
* etnaviv: stop oversizing buffer resourcesLucas Stach2017-05-181-1/+1
| | | | | | | | | | | | | | | PIPE_BUFFER is a target enum, not a binding. This caused the driver to up-align the height of buffer resources, leading to largely oversizing those resources. This is especially bad, as the buffer resources used by the upload manager are already 1MB in size. Height alignment meant that those would result in 4 to 8MB big BOs. Fixes: c9e8b49b885 ("etnaviv: gallium driver for Vivante GPUs") Cc: [email protected] Signed-off-by: Lucas Stach <[email protected]> Reviewed-By: Wladimir J. van der Laan <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]> (cherry picked from commit 8173d7d9e8b40cc9415811ad13924daa04a73646)
* etnaviv: add L8A8_UNORM texture formatChristian Gmeiner2017-05-051-0/+2
| | | | | | | | | No piglit regressions. CC: <[email protected]> Signed-off-by: Christian Gmeiner <[email protected]> Reviewed-by: Philipp Zabel <[email protected]> (cherry picked from commit a8007ed6872ce1e2cce7145585a4dd1cfd1cec62)
* renderonly: drop resources on destroyPhilipp Zabel2017-05-051-1/+1
| | | | | | | | | | | | | | The renderonly_scanout holds a reference on its prime pipe resource, which should be released when it is destroyed. If it was created by renderonly_create_kms_dumb_buffer_for_resource, the dumb BO also has to be destroyed. Fixes: 848b49b288f ("gallium: add renderonly library") CC: <[email protected]> Signed-off-by: Philipp Zabel <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]> (cherry picked from commit cd8ee259c8e9b1c16b5c3214595b91eb31e7de19)
* etnaviv: native fence fd supportPhilipp Zabel2017-04-156-6/+82
| | | | | | | | | | This adds native fence fd support to etnaviv, similarly to commit 0b98e84e9ba0 ("freedreno: native fence fd"), enabled for kernel driver version 1.1 or later. Signed-off-by: Philipp Zabel <[email protected]> Reviewed-By: Wladimir J. van der Laan <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]>
* etnaviv: SINGLE_BUFFER support on GC3000Wladimir J. van der Laan2017-04-158-28/+63
| | | | | | | | | | | | | | | | | | | | This patch adds support for the SINGLE_BUFFER feature on GC3000 GPUs, which allows rendering to a single buffer using multiple pixel pipes. This feature is always used when it is available, which means that multi-tiled formats are no longer being used in that case, and all buffers will be normal (super)tiled. This mimics the behavior of the blob on GC3000. - Because the same format can be used to render to and texture from, this avoids an extra resolve pass when rendering to texture. - i.MX6qp includes a PRE which can scan-out directly from tiled formats, avoiding untiling overhead. Signed-off-by: Wladimir J. van der Laan <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]>
* etnaviv: Update includes from rnndbWladimir J. van der Laan2017-04-155-20/+91
| | | | | | | | | Update to etna_viv commit 8486a97. austriancoder: changed patch to include isa redefinition fix. Signed-off-by: Wladimir J. van der Laan <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]>
* etnaviv: Add chipMinorFeatures4 and 5Wladimir J. van der Laan2017-04-152-1/+15
| | | | | | | | Request chipMinorFeatures bitfields 4 and 5 from the drm driver. Signed-off-by: Wladimir J. van der Laan <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]>
* etnaviv: resolve tile status when flushing resourcePhilipp Zabel2017-04-152-0/+11
| | | | | | | | | | | | | | | | When passing render buffers from EGL clients to a wayland compositor, the resource tile status must be resolved because otherwise the tile status is lost in the transfer and cleared parts of the buffer will contain old contents. The same applies when sampling directly from a renderable resource. lst: Add seqno tracking, to skip flush when not needed. Fixes: aadcb5e94b35 ("etnaviv: enable TS, but disable autodisable") Signed-off-by: Philipp Zabel <[email protected]> Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]>
* etnaviv: stop repeatedly resolving an unchanged resource into its scanout ↵Philipp Zabel2017-04-151-1/+4
| | | | | | | | | | | prime buffer Before resolving a resource into its scanout prime buffer, check that the prime resource is actually older. If it is not, the resolve is an expensive no-op, and we better skip it. Signed-off-by: Philipp Zabel <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]>
* gallium: add PIPE_CAP_TGSI_TES_LAYER_VIEWPORTNicolai Hähnle2017-04-141-0/+1
| | | | | Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
* etnaviv: enable TS, but disable autodisableLucas Stach2017-04-111-2/+2
| | | | | | | | Autodisable seems to cause missed rendering in some cases, but otherwise TS seems to work properly. Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Wladimir J. van der Laan <[email protected]>
* etnaviv: enable TS also on sampler resourcesLucas Stach2017-04-111-3/+0
| | | | | | | | | | | Fixes a performance issue with imported winsys buffers as those are marked with binding sampler view. This might require a TS flush on single pipe chips that directly sample from the rendered buffer, but otherwise seems to work fine. Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Wladimir J. van der Laan <[email protected]>
* etnaviv: align TS surface size to number of pixel pipesLucas Stach2017-04-111-1/+2
| | | | | | | | | | The TS surface gets cleared by a tiled RS fill. If the chip has more than 1 pixel pipe the size of the TS surface needs to be aligned so that each pipe address matches a tile start, otherwise the RS will hang. Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Wladimir J. van der Laan <[email protected]>
* etnaviv: avoid using invalid TSLucas Stach2017-04-113-1/+7
| | | | | | | | | | | The TS is only valid after it has been initialized by a fast clear, so it should not be taken into account when blitting resources that haven't been cleared. Also the blit itself invalidates the destination TS, as it's not updated and will retain data from the previous rendering after the blit. Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Wladimir J. van der Laan <[email protected]>
* Revert "etnaviv: Cannot render to rb-swapped formats"Christian Gmeiner2017-04-051-5/+2
| | | | | | | | | This reverts commit 658568941d5e232d690e1ffbcddbd6ea9685693a. With the help of shader variants we can render to rb-swapped formats now. Fixes about 60 piglits. Signed-off-by: Christian Gmeiner <[email protected]>
* etnaviv: add support for rb swapChristian Gmeiner2017-04-054-0/+38
| | | | | | | If we render to rb swapped format we will create a shader variant doing the involved swizzing in the pixel shader. Signed-off-by: Christian Gmeiner <[email protected]>
* etnaviv: adapt shader-db output for variant supportChristian Gmeiner2017-04-051-15/+15
| | | | | Signed-off-by: Christian Gmeiner <[email protected]> Reviewed-by: Lucas Stach <[email protected]>
* etnaviv: bring back shader-db tracesChristian Gmeiner2017-04-051-0/+9
| | | | | | | | | If shader-db run, create a standard variant immediately (as otherwise nothing will trigger the shader to be actually compiled). Signed-off-by: Christian Gmeiner <[email protected]> Reviewed-by: Lucas Stach <[email protected]>
* etnaviv: add etna_shader_key and generate variants if neededChristian Gmeiner2017-04-058-29/+97
| | | | Signed-off-by: Christian Gmeiner <[email protected]>
* etnaviv: pass a preallocated variant to compilerChristian Gmeiner2017-04-054-38/+62
| | | | | | | | | | | In the long run the compiler needs to know the specifc variant 'key' in order to compile appropriate assembly. With this commit the variant knows its shader and we are able pass the preallocated variant into etna_compile_shader(..). This saves us from passing extra ptrs everywhere. Signed-off-by: Christian Gmeiner <[email protected]> Reviewed-by: Lucas Stach <[email protected]>
* etnaviv: make specs constChristian Gmeiner2017-04-051-1/+1
| | | | Signed-off-by: Christian Gmeiner <[email protected]>
* etnaviv: add struct etna_shader_stateChristian Gmeiner2017-04-055-23/+24
| | | | | Signed-off-by: Christian Gmeiner <[email protected]> Reviewed-by: Lucas Stach <[email protected]>
* etnaviv: add basic shader variant supportChristian Gmeiner2017-04-053-4/+60
| | | | | | | | | This commit adds some basic infrastructure to handle shader variants. We are still creating exactly one shader variant for each shader. Signed-off-by: Christian Gmeiner <[email protected]> Reviewed-by: Lucas Stach <[email protected]>
* etnaviv: s/etna_shader/etna_shader_variantChristian Gmeiner2017-04-057-34/+34
| | | | | | Prep work to add shader variant support. Signed-off-by: Christian Gmeiner <[email protected]>
* etnaviv: remove not needed forward declarationsChristian Gmeiner2017-04-051-2/+0
| | | | Signed-off-by: Christian Gmeiner <[email protected]>
* gallium: add PIPE_CAP_TGSI_BALLOTNicolai Hähnle2017-04-051-0/+1
| | | | Reviewed-by: Marek Olšák <[email protected]>
* gallium: add sparse buffer interface and capabilityNicolai Hähnle2017-04-051-0/+1
| | | | | | | v2: - explain the resource_commit interface in more detail Reviewed-by: Marek Olšák <[email protected]>
* gallium: Add a cap to check if the driver supports fill_rectangleLyude2017-03-311-0/+1
| | | | | | | | Changes since v1: - Add pipe caps for etnaviv, freedreno, swr and virgl Signed-off-by: Lyude <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* gallium: remove support for predicates from TGSI (v2)Marek Olšák2017-04-011-2/+0
| | | | | | | | | | | Neved used. v2: gallivm: rename "pred" -> "exec_mask" etnaviv: remove the cap gallium: fix tgsi_instruction::Padding Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* gallium: add PIPE_CAP_TGSI CLOCKNicolai Hähnle2017-03-311-0/+1
| | | | | Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gallium: add PIPE_CAP_TGSI_TEX_TXF_LZMarek Olšák2017-03-151-0/+1
|
* gallium: s/uint/enum pipe_shader_type/ for set_constant_buffer()Brian Paul2017-03-081-1/+2
| | | | Reviewed-by: Edward O'Callaghan <[email protected]>
* etnaviv: s/unsigned/enum pipe_shader_type/Brian Paul2017-03-081-2/+2
| | | | Reviewed-by: Edward O'Callaghan <[email protected]>
* gallium: s/unsigned/enum pipe_shader_type/ for pipe_screen::get_shader_param()Brian Paul2017-03-081-1/+2
| | | | Reviewed-by: Edward O'Callaghan <[email protected]>
* gallium: remove PIPE_CAP_USER_INDEX_BUFFERSMarek Olšák2017-02-251-1/+0
| | | | | | | | all drivers support it Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]> Tested-by: Brian Paul <[email protected]> (VMware driver only)
* etnaviv: add support for user index buffersMarek Olšák2017-02-252-1/+13
| | | | Reviewed-by: Brian Paul <[email protected]>