summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
Commit message (Collapse)AuthorAgeFilesLines
* winsys/amdgpu: Make KMS handles valid for original DRM file descriptorMichel Dänzer2019-07-034-6/+8
| | | | | | | | | | | | | | | | | | Getting a DMA-buf fd and converting that to a handle using our duplicate of that file descriptor (getting at which requires passing a radeon_winsys pointer to the buffer_get_handle hook) makes sure of this, since duplicated file descriptors reference the same file description and therefore the same GEM handle namespace. This is necessary because libdrm_amdgpu may use a different DRM file descriptor with a separate handle namespace internally, e.g. because it always reuses any existing amdgpu_device_handle for the same device. amdgpu_bo_export returns a handle which is valid for that internal file descriptor. Bugzilla: https://bugs.freedesktop.org/110903 Reviewed-by: Marek Olšák <[email protected]> Tested-by: Pierre-Eric Pelloux-Prayer <[email protected]>
* iris: assert isl_surf_init success in resource_from_handleMike Blumenkrantz2019-07-021-14/+15
| | | | | | | | this can fail unexpectedly due to bugs, so it's good to provide feedback when this occurs Reviewed-by: Sagar Ghuge <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* nouveau: handle new CAPSKarol Herbst2019-07-022-0/+26
| | | | | Signed-off-by: Karol Herbst <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* panfrost: Pass referenced BOs to the SUBMIT ioctlsBoris Brezillon2019-07-021-19/+27
| | | | | | | | | | | Instead of manually adding the BOs from the various SLAB pools plus the one backing the color FB, we insert them in the BO set attached to the job and let panfrost_drm_submit_job() pass all BOs from this set to the SUBMIT ioctl. This means we are now passing all referenced BOs and let the scheduler wait on referenced BO fences if needed. Signed-off-by: Boris Brezillon <[email protected]>
* panfrost: Make SLAB pool creation rely on BO helpersBoris Brezillon2019-07-027-110/+56
| | | | | | | There's no point duplicating the code, and it will help us simplify the bo_handles[] filling logic in panfrost_drm_submit_job(). Signed-off-by: Boris Brezillon <[email protected]>
* panfrost: Add the panfrost_drm_{create,release}_bo() helpersBoris Brezillon2019-07-023-29/+70
| | | | | | | To avoid the panfrost_memory <-> panfrost_bo dance done in panfrost_resource_create_bo() and panfrost_bo_unreference(). Signed-off-by: Boris Brezillon <[email protected]>
* panfrost: Move the mmap BO logic out of panfrost_drm_import_bo()Boris Brezillon2019-07-021-21/+30
| | | | | | | So we can re-use it for the panfrost_drm_create_bo() function we are about to introduce. Signed-off-by: Boris Brezillon <[email protected]>
* panfrost: Avoid passing winsys handles to import/export BO funcsBoris Brezillon2019-07-023-19/+20
| | | | | | | | | | Let's keep a clear split between ioctl wrappers and the rest of the driver. All the import BO function need is a dmabuf FD and the screen object, and the export one should only take care of generating a dmabuf FD out of a BO object. Winsys handle manipulation should stay in the resource.c file. Signed-off-by: Boris Brezillon <[email protected]>
* panfrost: Move BO meta-data out of panfrost_boBoris Brezillon2019-07-026-94/+98
| | | | | | | | | | | | That's what most (all?) implementation seem to do, and my understanding is that a BO is just a bunch of memory that can be used for anything GPU related, not only texture/FB resources. Let's move those meta data in panfrost_resource so we can use panfrost_bo for all kind of memory allocation and make BO allocation more consistent. Signed-off-by: Boris Brezillon <[email protected]>
* panfrost: Stop exposing internal panfrost_drm_*() functionsBoris Brezillon2019-07-022-7/+2
| | | | | | | panfrost_drm_submit_job() and panfrost_fence_create() are not used outside of pan_drm.c. Signed-off-by: Boris Brezillon <[email protected]>
* panfrost: Get rid of the "free imported BO" logicBoris Brezillon2019-07-024-37/+8
| | | | | | | | | | bo->imported was never set to true which means this path was never taken. Moreover, panfrost_drm_free_imported_bo() is doing missing the munmap() call which seems wrong because the import BO function calls mmap(). Let's just kill this function along with the ->imported field. Signed-off-by: Boris Brezillon <[email protected]>
* panfrost: Get rid of the panfrost_driver abstraction leftoversBoris Brezillon2019-07-023-35/+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: Move scanout res creation out of panfrost_resource_create()Boris Brezillon2019-07-021-32/+41
| | | | | | Which improves readability and help us avoid a memory leak. Signed-off-by: Boris Brezillon <[email protected]>
* panfrost: Add the sampled texture BO to the jobBoris Brezillon2019-07-021-0/+4
| | | | | | | | | Otherwise we get random use-after-{free,unmap} errors. Signed-off-by: Boris Brezillon <[email protected]> --- Changes in v2: - Move the panfrost_job_add_bo() call out of the loop
* iris: Defer closing and freeing VMA until buffers are idle.Kenneth Graunke2019-07-021-10/+51
| | | | | | | | | | | | There will unfortunately be circumstances where we cannot re-use a virtual memory address until it's no longer active on the GPU. To facilitate this, we instead move BOs to a "dead" list, and defer closing them and returning their VMA until they are idle. We periodically sweep these away in cleanup_bo_cache, which triggers every time a new object's refcount hits zero. Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]> Tested-by: Jordan Justen <[email protected]>
* iris: Add an explicit alignment parameter to iris_bo_alloc_tiled().Kenneth Graunke2019-07-023-12/+19
| | | | | | | | | | | | In the future, some images will need to be aligned to a larger value than 4096. Most buffers, however, don't have any such requirement, so for now we only add the parameter to iris_bo_alloc_tiled() and leave the others with the simpler interface. v2: Fix missing alignment in vma_alloc, caught by Caio! Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]> Tested-by: Jordan Justen <[email protected]>
* v3d: do not flush jobs that are synced with 'Wait for transform feedback'Iago Toral Quiroga2019-07-025-20/+61
| | | | | | | | | | | | | Generally, we achieve this by skipping the flush on calls to v3d_flush_jobs_writing_resource() when we detect that the resource is written in the current job from a transform feedback write. The exception to this is the case where the caller is about to map the resource, in which case we need to flush immediately since we can only emit 'Wait for transform feedback' commands on rendering jobs. We add a parameter to the function so the caller can identify that scenario. Reviewed-by: Eric Anholt <[email protected]>
* v3d: emit 'Wait for transform feedback' commands when neededIago Toral Quiroga2019-07-021-0/+120
| | | | | | | | | | | | | | | | | | | | | | The hardware can flush transform feedback writes before reads in the same job by inserting this command. This patch detects when the rendering state for the current draw call reads resources that had been previously written by transform feedback in the same job and inserts the 'Wait for transform feedback' command before emitting the new draw. v2 (Eric): - this was intended to look at job->tf_write_prscs for TF jobs. - clear job->tf_write_prscs after we emit the TF flush. - can skip flushes for fragment shader reads from TF. v3 (Eric): - all resources in job->tf_write_prscs are resources written by TF so we don't need to check if they are bound to PIPE_BIND_STREAM_OUTPUT. - documented optimization opportunity for geometry stages. Reviewed-by: Eric Anholt <[email protected]>
* v3d: keep track of resources written by transform feedbackIago Toral Quiroga2019-07-023-2/+15
| | | | | | | | | | | | | The hardware provides a feature to sync reads from previous transform feedback writes in the same job so if we use this mechanism we no longer have to flush the job. In order to identify this scenario we need a mechanism to identify resources that are written by transform feedback. v2: use _mesa_pointer_set_create (Eric) Reviewed-by: Eric Anholt <[email protected]>
* iris: Use MI_COPY_MEM_MEM for tiny resource_copy_region calls.Kenneth Graunke2019-07-011-0/+27
| | | | | | | | | | | | | | | If our resource_copy_region size is a small number of DWords, then instead of firing up BLORP, we can simply use MI_COPY_MEM_MEM (after a CS stall). We also try and select the optimal batch. Improves performance in Shadow of Mordor on Low settings at 1920x1080 on Skylake GT4e by 0.689096% +/- 0.473968% (n=4). It tries to copy 4 bytes of data to a buffer which was most recently used as a writable compute shader SSBO. Previously we were switching from compute to the render pipeline, then firing up all of blorp_buffer_copy...for 4 bytes. I arbitrarily decided to support 4/8/12/16 bytes. Jason thinks this is about the right threshold where it's cheaper to use MI_COPY_MEM_MEM.
* nir: Add lower_rotate flag and set to true in all driversSagar Ghuge2019-07-016-0/+7
| | | | | | Signed-off-by: Sagar Ghuge <[email protected]> Suggested-by: Matt Turner <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* panfrost: Implement instanced renderingAlyssa Rosenzweig2019-07-019-60/+568
| | | | | | | | | | | | | | | | | | 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/decode: Compute padded_num_vertices for MODULOAlyssa Rosenzweig2019-07-011-2/+12
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/midgard: Emit type appropriate ld_varyAlyssa Rosenzweig2019-07-011-2/+19
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/midgard: Add unsigned ld/st opsAlyssa Rosenzweig2019-07-013-1/+11
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/midgard: Use the appropriate ld_attr typeAlyssa Rosenzweig2019-07-011-0/+20
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Implement dispatch helpersAlyssa Rosenzweig2019-07-014-13/+165
| | | | | | | | Rather than open-coding workgroups_shift_* type fields, we include a general routine for packing the vertex/tiler/compute descriptor based on the provided dispatch parameters. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Remove ancient commentAlyssa Rosenzweig2019-07-011-3/+0
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* gallium: Add CAP for opcode DIVGert Wollny2019-06-307-0/+8
| | | | | | | | Not all drivers support TGSI_OPCODE_DIV, so we should have a cap to be able to check this. Signed-off-by: Gert Wollny <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* etnaviv: blt: blit with the original format when possibleJonathan Marek2019-06-291-7/+11
| | | | | | | | | | | | | This fixes BGR565 blit: currently BGRA444 is used for the blit, but with swizzles from the original BGR565 format, so the 4 alpha bits are set to 1. We can't just use the swizzle from the 'compatible' format, since there are cases where BGR<->RGB swap needs to happen. We can avoid all this trouble by using the original formats and only falling back to the 'compatible' format when we need to. Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]>
* etnaviv: clear all bits for 24bpp depth without stencilJonathan Marek2019-06-291-1/+1
| | | | | | | | | For fast clear to happen, all bits must be cleared. This allows using fast clear for 24bpp depth without stencil. Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]>
* android: virgl: fix generated virgl_driinfo.h building rulesMauro Rossi2019-06-291-2/+8
| | | | | | | | | | | | | | | | | | | | Changelog in Android makefile: - Add LOCAL_MODULE_CLASS, intermediates and LOCAL_GENERATED_SOURCES - Use LOCAL_EXPORT_C_INCLUDE_DIRS to export $(intermediates) path - Move generated header rules before 'include $(BUILD_STATIC_LIBRARY)' Fixes the following building error: In file included from external/mesa/src/gallium/targets/dri/target.c:1: external/mesa/src/gallium/auxiliary/target-helpers/drm_helper.h:257:16: fatal error: 'virgl/virgl_driinfo.h' file not found #include "virgl/virgl_driinfo.h" ^~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. Fixes: cf800998a ("virgl: Add driinfo file and tie it into the build") Signed-off-by: Mauro Rossi <[email protected]> Review-by: Chih-Wei Huang <[email protected]>
* panfrost: Allow R11G11B10 renderingAlyssa Rosenzweig2019-06-282-4/+15
| | | | | | Doesn't fully work yet, but better than crashing. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Default to util_pack_color for clearsAlyssa Rosenzweig2019-06-281-2/+7
| | | | | | This might help as we bringup more render-target formats. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* Revert "meson: Add support for using cmake for finding LLVM"Dylan Baker2019-06-281-8/+5
| | | | | | | | This reverts commit 5157a4276500c77e2210e853b262be1d1b30aedf. There is a meson bug that causes llvm to always be statically linked, which is obviously not what we want. I haven't had time to look into it yet, but for now let's just revert it.
* panfrost: Disable DXT-style texture compressionAlyssa Rosenzweig2019-06-281-3/+1
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Dump unknown formats before abortingAlyssa Rosenzweig2019-06-281-0/+1
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/midgard: Fix 3D texture regressionAlyssa Rosenzweig2019-06-281-1/+2
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Add some special formatsAlyssa Rosenzweig2019-06-283-0/+7
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/midgard: Implement integer samplerAlyssa Rosenzweig2019-06-283-8/+42
| | | | | | | Turns out one of the magic bits in the texture instruction meant 'float'. Different magic bits mean int and uint then :) Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Remove dubious assertAlyssa Rosenzweig2019-06-281-3/+0
| | | | | | We already *can* support texture formats with bpp > 4, so.. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Implement primitive restartAlyssa Rosenzweig2019-06-281-0/+13
| | | | | | For GLES3, just pass the flag through. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* Revert "iris/icl: Add WA_2204188704 to disable pixel shader panic dispatch"Anuj Phogat2019-06-281-8/+0
| | | | | | | | | | | | | | SLICE_COMMON_CHICKEN3 is a privileged register not accesible from userspace. This patch silences a simulator warning about it. We don't need to add this workaround in linux kernel as the WA description says it's fixed on latest stepping. This reverts commit 9c421d6b47e0c5f206959acd68814b63232946be. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* freedreno/a6xx: wire up dither stateRob Clark2019-06-283-2/+14
| | | | | | | | | | | | | | | Fixes: dEQP-GLES2.functional.fbo.render.recreate_colorbuffer.rebind_rbo_rgba4 dEQP-GLES2.functional.fbo.render.recreate_colorbuffer.no_rebind_rbo_rgba4 dEQP-GLES2.functional.fbo.render.recreate_colorbuffer.no_rebind_rbo_rgba4_stencil_index8 dEQP-GLES2.functional.fbo.render.recreate_depthbuffer.rebind_rbo_rgba4_depth_component16 dEQP-GLES2.functional.fbo.render.recreate_depthbuffer.no_rebind_rbo_rgba4_depth_component16 dEQP-GLES2.functional.fbo.render.recreate_stencilbuffer.rebind_rbo_rgba4_stencil_index8 dEQP-GLES2.functional.fbo.render.recreate_stencilbuffer.no_rebind_rbo_rgba4_stencil_index8 Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]>
* radeon/uvd: fix calc_ctx_size_h265_main10Pierre-Eric Pelloux-Prayer2019-06-283-9/+9
| | | | | | | | | | | Left shift was applied twice. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110702 Reviewed-by: Leo Liu <[email protected]> Tested-by: <[email protected]> Signed-off-by: Marek Olšák <[email protected]> Cc: <[email protected]>
* panfrost: Only tag AFBC addresses when samplingTomeu Vizoso2019-06-282-7/+8
| | | | | | | | | Rendering to AFBC was broken, as the HW will complaint loudly if we pass a tagged pointer in bifrost_render_target. Signed-off-by: Tomeu Vizoso <[email protected]> Fixes: 3609b50a6443 ("panfrost: Merge AFBC slab with BO backing") Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost/ci: Don't error out on RK3288Tomeu Vizoso2019-06-281-1/+3
| | | | | | | | | | | At the moment we don't have enough people to ensure that RK3288 is regression-free, so don't fail the CI in that case. For now we'll focus on not regressing on RK3399 and we can expand to other SoCs as more people join the effort. Signed-off-by: Tomeu Vizoso <[email protected]> Suggested-by: Alyssa Rosenzweig <[email protected]>
* panfrost/ci: Don't print every kernel fileTomeu Vizoso2019-06-282-2/+2
| | | | | | | | As there's lots of them and Gitlab struggles rendering logs with so many lines. Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost/ci: Fix the image nameTomeu Vizoso2019-06-281-5/+5
| | | | | | | | These changes will make sure we get the right image from the container registry. Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost/ci: Remove batchingTomeu Vizoso2019-06-281-7/+2
| | | | | | | Panfrost has grown and doesn't leak as much as before. Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>