summaryrefslogtreecommitdiff
path: root/src/gallium/winsys
AgeCommit message (Collapse)AuthorFilesLines
2015-10-23virgl: add driver for virtio-gpu 3D (v2)Dave Airlie7-0/+1377
virgl is the 3D acceleration backend for the virtio-gpu shipping with qemu. The 3D acceleration is designed around gallium and TGSI as the virtualisation layer. The backend renderer translates the virgl interface into OpenGL currently. This is the initial import of the driver to mesa. The kernel driver portions are lined up for drm-next. Currently this driver supports up to GL3.3 and some misc extensions if the host driver exposes it. It is planned to iterate the virgl API to new GL levels as mesa host drivers gain features. v2: fix resource tracking across flushes to avoid ->bind hack in mapping. consolidate mapping and waiting code for transfers. use u_range for dirt tracking. handle larger shaders in protocol. include virtgpu_drm.h in mesa for now. add translation layer for gallium tgsi to virgl tgsi. Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-10-22svga: Condition preemptive flush on draw emissionSinclair Yeh1-5/+10
On ultra high resolution modes, the preemptive flush flag can be set midway through command submission, a condition that cannot be recovered from a flush-retry, causing rendering artifacts. This patch prevents a preemtive_flush until a draw has been emitted. Signed-off-by: Sinclair Yeh <syeh@vmware.com> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Charmaine Lee <charmainel@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com>
2015-10-03winsys/radeon: implement cs_get_buffer_listMarek Olšák3-22/+47
This is more complicated, because tracking priority_usage needed changing the relocs_bo type. Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-10-03winsys/amdgpu: add winsys function cs_get_buffer_listMarek Olšák2-0/+20
For debugging. Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-10-03gallium/radeon: stop using "reloc" in a few placesMarek Olšák4-53/+53
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-10-03gallium/radeon: tell the winsys the exact resource binding typesMarek Olšák2-9/+10
Use the priority flags and expand them. This information will be used for debugging. Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-09-16freedreno: one screen to rule them allRob Clark1-4/+113
Similar to fee0686c21c631d96d6042741267a3c218c23ffc, but in this case to ensure that drm_gralloc and libGLES_mesa are sharing a single screen. Bumps libdrm_freedreno version dependency, as it requires the new fd_device_fd() API. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2015-09-10winsys/svga: remove useless assertionBrian Paul1-1/+0
An unsigned int is always >= 0. Found with Coverity. Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2015-09-10winsys/amdgpu: calculate the maximum number of compute unitsMarek Olšák1-2/+13
Required for register spilling. Cc: 11.0 <mesa-stable@lists.freedesktop.org> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-09-03winsys/radeon: remove exported buffers from the cacheMarek Olšák1-0/+3
Cc: 11.0 <mesa-stable@lists.freedesktop.org> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-09-03winsys/amdgpu: remove exported buffers from the cacheMarek Olšák1-0/+3
Cc: 11.0 <mesa-stable@lists.freedesktop.org> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-09-02svga/winsys: Add support for VGPU10Brian Paul19-119/+362
This involves a few driver modifications to keep things building. The driver may not actually run properly at this point. Signed-off-by: Brian Paul <brianp@vmware.com>
2015-09-02winsys/svga: add new vmw_query.c[h] filesBrian Paul3-1/+214
Functions for creating, destroying, getting queries, etc. Signed-off-by: Brian Paul <brianp@vmware.com>
2015-09-01winsys/radeon: add a flag telling how gfx IBs should be paddedMarek Olšák2-6/+9
This is always false on amdgpu (set by calloc). Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Acked-by: Christian König <christian.koenig@amd.com>
2015-09-01winsys/amdgpu: remove IB padding for SIMarek Olšák1-17/+5
SI is unsupported by amdgpu Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Acked-by: Christian König <christian.koenig@amd.com>
2015-09-01winsys/amdgpu: use small IBs for better performance on VIMarek Olšák1-7/+9
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Acked-by: Christian König <christian.koenig@amd.com>
2015-08-29winsys/radeon: handle non-zero finite timeout when waiting for buffersMarek Olšák2-38/+41
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-08-26gallium/radeon: read_registers should return bool meaning success or failureMarek Olšák2-5/+7
Acked-by: Christian König <christian.koenig@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com>
2015-08-26gallium: add flags parameter to pipe_screen::context_createMarek Olšák1-1/+1
This allows creating compute-only and debug contexts. Reviewed-by: Brian Paul <brianp@vmware.com> Acked-by: Christian König <christian.koenig@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com>
2015-08-23Revert "radeon/winsys: increase the IB size for VM"Marek Olšák4-17/+6
This reverts commit 567394112d904096abff1d994ab952f475dfb444. It regressed performance. It looks like smaller IBs are better, because the GPU goes idle quicker and there is less waiting for buffers and fences. Cc: 11.0 <mesa-stable@lists.freedesktop.org>
2015-08-22winsys/sw/kms-dri: don't attempt to bundle the sconscriptEmil Velikov1-2/+0
The build/file was removed with an earlier commit while the EXTRA_DIST was forgotten. Fixes: 66d77cd71c6 (scons: don't build the kms-dri winsys) Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-08-22winsys/amdgpu: automake: remove missing headersEmil Velikov1-2/+0
The files are not referenced in any other place in whole of mesa. They are likely remnants of the early development stage. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-08-22android: fix cflags and includes for amdgpu winsysMauro Rossi1-0/+10
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-08-19winsys/amdgpu: fix the type of memory usage countersMarek Olšák1-2/+2
If the 32-bit types overflowed, the driver could submit an IB that uses much more memory than is available. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-08-14radeon/vce: disable VCE dual instance for harvest partLeo Liu1-0/+1
Signed-off-by: Leo Liu <leo.liu@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
2015-08-14radeonsi: add support for FIJI (v4)Alex Deucher1-0/+4
v2: incorporate comments from Marek v3: add missing fiji case in winsys init use tonga raster config (double check this) v4: rebase on harvest patch Reviewed-by: Marek Olšák <marek.olsak@amd.com> (v3) Reviewed-by: Christian König <christian.koenig@amd.com> (v3) Reviewed-by: David Zhang <david1.zhang@amd.com> (v3) Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-08-14winsys/amdgpu: add addrlib support for Fiji (v2)Alex Deucher3-1/+11
v2: fix tonga chip check Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: David Zhang <david1.zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-08-14winsys/amdgpu: add addrlib - texture addressing and alignment calculatorMarek Olšák27-3/+22370
This is an internal project that Catalyst uses and now open source will do too. v2: squashed these commits in: - winsys/amdgpu: fix warnings in addrlib - winsys/amdgpu: set PIPE_CONFIG and NUM_BANKS in tiling_flags
2015-08-14winsys/amdgpu: add a new winsys for the new kernel driverMarek Olšák11-1/+2342
v2: - lots of changes according to Emil Velikov's comments - implemented radeon_winsys::read_registers v3: - a lot of new work, many of them adapt to libdrm interface changes Squashed patches: winsys/amdgpu: implement radeon_winsys context support winsys/amdgpu: add reference counting for contexts winsys/amdgpu: add userptr support winsys/amdgpu: allocate IBs like normal buffers winsys/amdgpu: add IBs to the buffer list, adapt to interface changes winsys/amdgpu: don't use KMS handles as reloc hash keys winsys/amdgpu: sync buffer accesses to different rings winsys/amdgpu: use dependencies instead of waiting for last fence v2 gallium/radeon: unify buffer_wait and buffer_is_busy in the winsys interface (amdgpu part) winsys/amdgpu: track fences per ring and be thread-safe winsys/amdgpu: simplify waiting on a variable in amdgpu_fence_wait gallium/radeon: allow the winsys to choose the IB size (amdgpu part) winsys/amdgpu: switch to new amdgpu_cs_query_fence_status interface winsys/amdgpu: handle fence and dependencies merge winsys/amdgpu follow libdrm change to move user fence into UMD winsys/amdgpu: use amdgpu_bo_va_op for va map/unmap v2 winsys/amdgpu: use the new tiling flags winsys/amdgpu: switch to new GTT_USWC definition winsys/amdgpu: expose amdgpu_cs_query_reset_state to drivers winsys/amdgpu: fix valgrind warnings winsys/amdgpu: don't use VRAM with APUs that don't have much of it winsys/amdgpu: require LLVM 3.6.1 for VI because of bug fixes there winsys/amdgpu: remove amdgpu_winsys::num_cpus winsys/amdgpu: align BO size to page size winsys/amdgpu: reduce BO cache timeout winsys/amdgpu: remove useless flushing and waiting in amdgpu_bo_set_tiling winsys/amdgpu: use amdgpu_device_handle as a unique device ID instead of fd winsys/amdgpu: use safer access to amdgpu_fence_wait::signalled winsys/amdgpu: allow maximum IB size of 4 MB winsys/amdgpu: add ip_instance into amdgpu_fence gallium/radeon: add RING_COMPUTE instead of RADEON_FLUSH_COMPUTE winsys/amdgpu: set the ring type at CS initilization winsys/amdgpu: query the GART page size from the kernel winsys/amdgpu: correctly wait for shared buffers to become idle winsys/amdgpu: set the amdgpu_cs_fence structure only once at fence creation winsys/amdgpu: add a specific error message for cs_submit -> -ENOMEM winsys/amdgpu: check num_active_ioctls before calling amdgpu_bo_wait_for_idle winsys/amdgpu: clear user fence BO after allocating it winsys/amdgpu: fix user fences winsys/amdgpu: make amdgpu_winsys_create public winsys/amdgpu: remove thread offloading winsys/amdgpu: flatten the amdgpu_cs_context structure and simplify more v4: require libdrm 2.4.63
2015-08-07winsys/radeon: add a specific error message for cs_submit -> -ENOMEMMarek Olšák1-4/+8
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
2015-08-07winsys/radeon: add an interface for contextsMarek Olšák1-2/+16
Same idea as in libdrm_amdgpu. A command stream can only be created for a specific context and it's always submitted to that context. This will mainly be used by amdgpu and it's required by the GPU reset status query too. (radeon only has a basic version of the query and thus doesn't need this) Reviewed-by: Christian König <christian.koenig@amd.com>
2015-08-07gallium/radeon: unify buffer_wait and buffer_is_busy in the winsys interfaceMarek Olšák2-32/+29
The timeout parameter covers both cases. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-08-06winsys/radeon: loosen up the requirements for how much memory IBs can useMarek Olšák1-4/+9
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-08-06radeon/winsys: increase the IB size for VMMarek Olšák4-6/+17
Luckily, there is a kernel query, so use the size from that. It currently returns 256KB. It can be increased in the kernel. Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-08-06gallium/radeon: allow the winsys to choose the IB sizeMarek Olšák2-3/+4
Picked from the amdgpu branch. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-08-01winsys/radeon: don't leak the fd when it is 0Emil Velikov1-2/+2
Earlier commit added an extra dup(fd) to fix a ZaphodHeads issue. Although it did not consider the (very unlikely) case where we might end up with the valid fd == 0. Fixes: 28dda47ae4d(winsys/radeon: Use dup fd as key in drm-winsys hash table to fix ZaphodHeads.) Cc: 10.6 <mesa-stable@lists.freedesktop.org> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
2015-07-29svga: scons: remove unused HAVE_SYS_TYPES_H defineEmil Velikov1-1/+0
There isn't a single instance in mesa that mentions HAVE_SYS_TYPES_H, other than this file. Cc: Jose Fonseca <jfonseca@vmware.com> Acked-by: Brian Paul <brianp@vmware.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-07-23winsys/radeon: implement buffer_unmapMarek Olšák2-6/+24
This has been a no-op due to performance concerns. From now on, drivers should decide when they don't want to unmap, not the winsys. Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-07-22scons: don't build the kms-dri winsysEmil Velikov1-23/+0
Same as previous commit - unused (gbm is not a thing outside the autotools build). v2: Remove trailing HAVE_LIBDRM. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-07-22android: don't build the kms-dri winsysEmil Velikov1-37/+0
GBM (the only user of kms-dri) is currently not available under Android. Considering we have no way of testing/using this let's not bother building it for now. Cc: Chih-Wei Huang <cwhuang@linux.org.tw> Cc: Eric Anholt <eric@anholt.net> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-07-21gallium: replace INLINE with inlineIlia Mirkin23-45/+45
Generated by running: git grep -l INLINE src/gallium/ | xargs sed -i 's/\bINLINE\b/inline/g' git grep -l INLINE src/mesa/state_tracker/ | xargs sed -i 's/\bINLINE\b/inline/g' git checkout src/gallium/state_trackers/clover/Doxyfile and manual edits to src/gallium/include/pipe/p_compiler.h src/gallium/README.portability to remove mentions of the inline define. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Acked-by: Marek Olšák <marek.olsak@amd.com>
2015-07-21nouveau: use bool instead of booleanSamuel Pitoiset1-1/+1
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-07-05winsys/radeon: use os_wait_until_zero in radeon_bo_set_tilingMarek Olšák1-3/+1
2015-07-03winsys/radeon: Use dup fd as key in drm-winsys hash table to fix ZaphodHeads.Mario Kleiner1-3/+10
Same problem and fix as for nouveau's ZaphodHeads trouble. See patch ... "nouveau: Use dup fd as key in drm-winsys hash table to fix ZaphodHeads." ... for reference. Cc: "10.3 10.4 10.5 10.6" <mesa-stable@lists.freedesktop.org> Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2015-07-03r600g,radeonsi: implement get_device_reset_statusMarek Olšák1-0/+8
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-06-28nouveau: Use dup fd as key in drm-winsys hash table to fix ZaphodHeads.Mario Kleiner1-1/+5
The dup'ed fd owned by the nouveau_screen for a device node must also be used as key for the winsys hash table, instead of using the original fd passed in for a screen, to make multi-x-screen ZaphodHeads configurations work on nouveau. The original fd's lifetime differs from that of the nouveau_screen stored in the hash. The hash key is the fd, and in order to compare hash entries we fstat them, so the fd must be around for as long as the screen is. This is an extension of the fix in commit a59f2bb1 (nouveau: dup fd before passing it to device). Cc: "10.3 10.4 10.5 10.6" <mesa-stable@lists.freedesktop.org> Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-06-24winsys/radeon: reduce BO cache timeoutGrigori Goronzy1-1/+1
1000 ms is an extreme value for typical interactive loads. A large cache has some disadvantages. Search for reusable BOs can take a long time and memory might get exhausted. Let's be rather conservative and use half of the old value, 500ms. This is beneficial to some loads on my test system and there are no regressions. Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2015-06-24winsys/radeon: align BO size to page sizeGrigori Goronzy1-0/+6
This is the basic granularity for BO allocations. The alignment also helps with BO reuse by the cached bufmgr. This results in a huge 45% speedup in Metro 2033 Redux on my test system. The game relies on buffer orphaning with very small buffers (hundreds of bytes in size) and that did not work efficiently before. This change may also affect other applications and games. Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2015-06-24winsys/radeon: Unmap GPU VM address range when destroying BOMichel Dänzer3-4/+29
But only when doing so is safe according to the RADEON_INFO_VA_UNMAP_WORKING kernel query. This avoids kernel GPU VM address range conflicts when the BO has other references than the GEM handle being closed, e.g. when the BO is shared. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90537 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90873 Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org> Reviewed-by: Christian König <christian.koenig@amd.com>
2015-06-15gallium: Drop the gallium-specific Android sw winsys.Eric Anholt3-346/+0
This was part of gallium_egl, and we now have the normal libEGL Android winsys support to handle it. Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>