summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/etnaviv
Commit message (Collapse)AuthorAgeFilesLines
* etnaviv: use correct param for etna_compatible_rs_format(..)Christian Gmeiner2017-08-261-1/+1
| | | | | | | | | Found by code inspection. Fixes: c9e8b49b885 ("etnaviv: gallium driver for Vivante GPUs") Cc: [email protected] Signed-off-by: Christian Gmeiner <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* gallium: remove TGSI opcode SCSMarek Olšák2017-08-221-23/+1
| | | | | | | use COS+SIN instead. Reviewed-by: Roland Scheidegger <[email protected]> Acked-by: Jose Fonseca <[email protected]>
* gallium: remove TGSI opcode XPDMarek Olšák2017-08-221-1/+0
| | | | | | use MUL+MAD+MOV instead. Reviewed-by: Roland Scheidegger <[email protected]>
* gallium: remove TGSI opcode DPHMarek Olšák2017-08-221-28/+0
| | | | | | use DP4 or DP3 + ADD. Reviewed-by: Roland Scheidegger <[email protected]>
* gallium: remove TGSI opcode DP2AMarek Olšák2017-08-221-1/+0
| | | | | | use DP3 instead. Reviewed-by: Roland Scheidegger <[email protected]>
* etnaviv: Add support for R8_UNORM texturesWladimir J. van der Laan2017-08-061-1/+1
| | | | | | | | R8_UNORM textures can be emulated by means of L8 and a swizzle. Signed-off-by: Wladimir J. van der Laan <[email protected]> Reviewed-by: Philipp Zabel <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]>
* etnaviv: Implement ICACHEWladimir J. van der Laan2017-08-066-18/+95
| | | | | | | | | | | | | | | This patch adds support for large shaders on GC3000. For example the "terrain" glmark benchmark with a large fragment shader will work after this. If the GPU supports ICACHE, shaders larger than the available state area will be uploaded to a bo of their own and instructed to be loaded from memory on demand. Small shaders will be uploaded in the usual way. This mimics the behavior of the blob. On GPUs that don't support ICACHE, this patch should make no difference. Signed-off-by: Wladimir J. van der Laan <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]>
* etnaviv: Unified uniforms supportWladimir J. van der Laan2017-08-063-4/+36
| | | | | | | | | | | | | | GC3000 has changed from a separate store for VS and PS uniforms to a single, unified one. There is backwards compatibilty functionalty, however this does not work correctly together with ICACHE. This patch adds explicit support, although in the simplest way possible: the PS/VS uniforms split is still fixed and hardcoded. It should make no difference on hardware that does not have unified uniform memory. Signed-off-by: Wladimir J. van der Laan <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]>
* etnaviv: Update headers from rnndbWladimir J. van der Laan2017-08-061-5/+9
| | | | | Signed-off-by: Wladimir J. van der Laan <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]>
* gallium: introduce PIPE_CAP_MEMOBJTimothy Arceri2017-08-031-0/+1
| | | | | | | | | | | | | | This can be used to guard support for EXT_memory_object and related extensions. v2: update gallium docs v3 (Timothy Arceri): - add cap to nv50 Signed-off-by: Andres Rodriguez <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* gallium: add PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE and corresponding capNicolai Hähnle2017-08-021-0/+1
| | | | | | | | v2: rename cap to PIPE_CAP_QUERY_SO_OVERFLOW and be a bit more explicit in the documentation Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gallium: add PIPE_CAP_NIR_SAMPLERS_AS_DEREFNicolai Hähnle2017-07-311-0/+1
| | | | Reviewed-by: Marek Olšák <[email protected]>
* etnaviv: Clear lbl_usage array correctlyWladimir J. van der Laan2017-07-231-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]>
* etnaviv: Avoid duplicates in formats tableWladimir J. van der Laan2017-07-211-5/+1
| | | | | | | | | | | | | | Remove the following duplicates from the formats table: - R8G8B8A8_UNORM (V_,_T) - R8G8B8X8_UNORM (_T,_T) - DXT3_RGBA (_T,_T) Only the first has an effect because the _T overrides the V_ initializer, the latter two were harmless duplications of the same. Signed-off-by: Wladimir J. van der Laan <[email protected]> Signed-off-by: Lucas Stach <[email protected]>
* etnaviv: Add support for ETC2 texture compressionWladimir J. van der Laan2017-07-212-1/+22
| | | | | | | | | | | | | | | | Add support for ETC2 compressed textures in the etnaviv driver. One step closer towards GL ES 3 support. For now, treat SRGB and RGB formats the same. It looks like these are distinguished using a different bit in sampler state, and not part of the format, but I have not yet been able to confirm this for sure. (Only enabled on GC3000+ for now, as the GC2000 ETC2 decoder implementation is buggy and we don't work around that) Signed-off-by: Wladimir J. van der Laan <[email protected]> Signed-off-by: Lucas Stach <[email protected]>
* etnaviv: advertise supported dmabuf modifiersLucas Stach2017-07-191-0/+44
| | | | | | | | | | | | Simply advertise all supported modifiers, independent of the format. Special formats, like compressed, which don't support all those modifiers are already culled from the dmabuf format list, as we don't support the render target binding for them. Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Wladimir J. van der Laan <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]> Reviewed-by: Daniel Stone <[email protected]>
* etnaviv: implement resource creation with modifierLucas Stach2017-07-194-7/+100
| | | | | | | | | | 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 <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]> Reviewed-by: Daniel Stone <[email protected]>
* etnaviv: fill in modifier in etna_resource_get_handleLucas Stach2017-07-191-0/+19
| | | | | | | | | | This allows the state trackers to know the tiling layout of the resource and pass this through the various userspace protocols. Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Wladimir J. van der Laan <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]> Reviewed-by: Daniel Stone <[email protected]>
* etnaviv: fold etna_screen_bo_get_handle into etna_resource_get_handleLucas Stach2017-07-193-28/+16
| | | | | | | | | | There is no point in keeping this indirection. Makes the code easier to follow. Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Wladimir J. van der Laan <[email protected]> (v1) Reviewed-by: Christian Gmeiner <[email protected]> Reviewed-by: Daniel Stone <[email protected]>
* etnaviv: implement resource import with modifierLucas Stach2017-07-191-32/+77
| | | | | | | | | | | | | | | | This implements resource import with modifier, deriving the correct internal layout from the modifier and constructing a render compatible base resource if needed. This removes the special cases for DDX and renderonly scanout allocated buffers, as the linear modifier is enough to trigger correct handling of those buffers. Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Philipp Zabel <[email protected]> Reviewed-by: Wladimir J. van der Laan <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]> Acked-by: Daniel Stone <[email protected]>
* etnaviv: also update textures from external resourcesLucas Stach2017-07-191-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 <[email protected]> Reviewed-by: Philipp Zabel <[email protected]> Reviewed-by: Wladimir J. van der Laan <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]>
* etnaviv: increment correct seqno for external resourcesLucas Stach2017-07-191-1/+4
| | | | | | | | | | | | If we import a dma-buf with a sampler/pixel pipe incompatible modifier, the imported buffer will end up in an external resource view. As resource_changed signals the change of the imported resource, we need to update the external view seqno, instead of the base resource seqno. Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Wladimir J. van der Laan <[email protected]> Reviewed-by: Philipp Zabel <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]>
* etnaviv: pad scanout buffer size to RS alignmentLucas Stach2017-07-191-2/+8
| | | | | | | | | | This fixes failures to import the scanout buffer with screen resolutions that don't satisfy the RS alignment restrictions, like 1680x1050. Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]> Reviewed-by: Philipp Zabel <[email protected]> Reviewed-by: Wladimir J. van der Laan <[email protected]>
* etnaviv: add helper to work out RS alignmentLucas Stach2017-07-192-9/+18
| | | | | | | | The minimum RS alignment calculation is needed in various places. Extract a helper to avoid open-coding the calcuation at every site. Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]>
* renderonly/etnaviv: stop importing resource from renderonlyLucas Stach2017-07-193-12/+35
| | | | | | | | | | | The current way of importing the resource from renderonly after allocation is opaque and is taking away control from the driver, which it needs in order to implement more advanced scenarios than the simple linear scanout with matching stride alignments. Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]> Acked-by: Daniel Stone <[email protected]>
* Revert "etnaviv: add support for snorm textures"Lucas Stach2017-07-142-7/+3
| | | | | | | | This reverts commit d8b2ccdb880f, which causes priglit regressions on GPUs with SNORM support. We'll have another try at enabling this feature after the 17.2 branchpoint. Signed-off-by: Lucas Stach <[email protected]>
* etnaviv: reset indexed rendering information when not rendering indexedWladimir J. van der Laan2017-07-141-1/+6
| | | | | | | | | | A dangling bo object would result in memory corruption while loading a level in ioquake3_opengl2. Fixes: 330d0607ed60 (gallium: remove pipe_index_buffer and set_index_buffer) Suggested-by: Lucas Stach <[email protected]> Signed-off-by: Wladimir J. van der Laan <[email protected]> Reviewed-by: Lucas Stach <[email protected]>
* etnaviv: Use the correct LOG instruction on GC3000Wladimir J. van der Laan2017-07-143-10/+59
| | | | | | | | | | | GC3000 has a new LOG instruction, similar to the new SIN and COS instructions. Generate the new instruction sequence when appropriate; there are two occasions, as part of LIT and the generator for the LG2 instruction itself. Signed-off-by: Wladimir J. van der Laan <[email protected]> Reviewed-by: Lucas Stach <[email protected]>
* etnaviv: flush source TS before resolveLucas Stach2017-07-141-0/+4
| | | | | | | | | | If we blit from a rendertarget or a depthstencil buffer there might still be dirty data in the TS buffer which needs to be flushed out. Fixes missing shadow tiles in glmark2 shadow. Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Philipp Zabel <[email protected]>
* etnaviv: flush color cache and depth cache together before resolvesPhilipp Zabel2017-07-141-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before resolving a rendertarget or a depth/stencil resource into a texture, flush both the color cache and the depth cache together. It is unclear whether this is necessary for the following stall to work properly, or whether the depth flush just adds enough time for the color cache flush to finish before the resolver is started, but this change removes artifacts that otherwise appear if a texture is sampled directly after rendering into it. The test case is a simple QML scene graph with a QtWebEngine based WebView rendered on top of a blue background: import QtQuick 2.0 import QtQuick.Window 2.2 import QtWebView 1.1 Window { Rectangle { id: background anchors.fill: parent color: "blue" } WebView { id: webView anchors.fill: parent } Component.onCompleted: { webView.url = "<some animated website>" } } If the website is animated, the WebView renders the site contents into texture tiles and immediately afterwards samples from them to draw the tiles into the Qt renderbuffer. Without this patch, a small irregular triangle in the lower right of each browser tile appears solid blue, as if the texture sampler samples zeroes instead of the website contents, and the previously rendered blue Rectangle shows through. Other attempts such as adding a pipeline stall before the color flush or a TS cache flush afterwards or flushing multiple times, with stalls before and after each flush, have shown no effect. Signed-off-by: Philipp Zabel <[email protected]>
* etnaviv: fix refcnt initialization in etna_screenAleksander Morgado2017-07-071-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]>
* etnaviv: don't dereference etna_resource pointer if allocation failsAleksander Morgado2017-07-061-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]>
* android: add etnaviv driver build supportRob Herring2017-07-051-0/+41
| | | | | | | | Add etnaviv to Android makefiles. Signed-off-by: Rob Herring <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* etnaviv: Add unreachable statement to etna_amode to fix compilation warningsTomeu Vizoso2017-06-301-0/+2
| | | | | | Signed-off-by: Robert Foss <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* etnaviv: fix memory leak when BO allocation failsLucas Stach2017-06-291-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]>
* etnaviv: fill in layer_stride for imported resourcesLucas Stach2017-06-291-0/+2
| | | | | | | | | | | The layer stride information is used in various parts of the driver, so it needs to be present regardless if the driver allocated the buffer itself or merely imported it from an external source. 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]>
* etnaviv: fix shader miscompilation with more than 16 labelsLucas Stach2017-06-281-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]>
* etnaviv: only flush resource to self if no scanout buffer existsLucas Stach2017-06-261-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]>
* etnaviv: add support for snorm texturesChristian Gmeiner2017-06-262-3/+7
| | | | | | | | | Based on a patch from Wladimir J. van der Laan and untested due to lack of hardware. Binary blob emits those formats if GPU supports HALTI1 (faked with ibvivhook). Signed-off-by: Christian Gmeiner <[email protected]> Reviewed-by: Wladimir J. van der Laan <[email protected]>
* etnaviv: add R8G8 texture supportChristian Gmeiner2017-06-261-1/+1
| | | | | | | Passes texwrap GL_ARB_texture_rg piglit (with faked full texture rg support). Signed-off-by: Christian Gmeiner <[email protected]> Reviewed-by: Wladimir J. van der Laan <[email protected]>
* etnaviv: add support for swizzled texture formatsChristian Gmeiner2017-06-264-39/+99
| | | | | | | Passes all ext_texture_swizzle piglits. Signed-off-by: Christian Gmeiner <[email protected]> Reviewed-By: Wladimir J. van der Laan <[email protected]>
* etnaviv: add support for extended texture formatsChristian Gmeiner2017-06-264-4/+10
| | | | | Signed-off-by: Christian Gmeiner <[email protected]> Reviewed-by: Wladimir J. van der Laan <[email protected]>
* etnaviv: fix blend color for RB swapped rendertargetsLucas Stach2017-06-214-14/+45
| | | | | | | | | Same as with the colormasks, the blend color needs to be swizzled according to the rendertarget format. Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Wladimir J. van der Laan <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]>
* etnaviv: add rs-operations sw queryChristian Gmeiner2017-06-165-0/+8
| | | | | | | | It could be useful to get the number of emited resolve operations when doing driver optimizations. Signed-off-by: Christian Gmeiner <[email protected]> Reviewed-by: Lucas Stach <[email protected]>
* etnaviv: advertise correct max LOD biasLucas Stach2017-06-161-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]>
* etnaviv: mask correct channel for RB swapped rendertargetsLucas Stach2017-06-163-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]>
* etnaviv: replace translate_clear_color with util_pack_colorLucas Stach2017-06-162-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]>
* etnaviv: remove bogus assertLucas Stach2017-06-161-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]>
* etnaviv: use padded width/height for resource copiesLucas Stach2017-06-161-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]>
* etnaviv: don't try RS blit if blit region is unalignedLucas Stach2017-06-161-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]>