summaryrefslogtreecommitdiff
path: root/src/gallium/winsys
AgeCommit message (Collapse)AuthorFilesLines
2017-05-11Android: push driver build details to driver makefilesRob Herring2-0/+9
src/gallium/targets/dri/Android.mk contains lots of conditional for individual drivers. Let's move these details into the individual driver makefiles. In the process, align the make driver conditionals with automake (i.e. HAVE_GALLIUM_*). Signed-off-by: Rob Herring <robh@kernel.org> [Emil Velikov: add the radeon winsys for radeonsi] Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2017-05-11Android: amd: use exported include dirs instead of explicit includesRob Herring1-6/+1
Add exported include paths rather than explicitly adding the includes in each user of the common AMD libs. Signed-off-by: Rob Herring <robh@kernel.org> Reviewed-by: Chih-Wei Huang <cwhuang@linux.org.tw> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-05-05winsys/amdgpu: fix Polaris12 (RX 550) breakageMarek Olšák1-0/+1
reported by Greg White. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100892 Cc: 17.1 <mesa-stable@lists.freedesktop.org>
2017-04-26winsys/svga: fix error path when kernel is not able to create surfaceDeepak Rawat1-15/+18
If for some reason kernel is not able to create surface, when no buffer was provided the function vmw_svga_winsys_surface_create should return NULL. This patch fixes the issue where the code was not following the clean up path in case of error, which used to cause SIGSEGV. Reviewed-by: Sinclair Yeh <syeh@vmware.com>
2017-04-19winsys/sw/dri: don't use GNU void pointer arithmeticEmil Velikov1-1/+1
Resolves build issues like the following: src/gallium/winsys/sw/dri/dri_sw_winsys.c:203:31: error: pointer of type ‘void *’ used in arithmetic [-Werror=pointer-arith] data = dri_sw_dt->data + (dri_sw_dt->stride * box->y) + box->x * blsize; ^ src/gallium/winsys/sw/dri/dri_sw_winsys.c:203:62: error: pointer of type ‘void *’ used in arithmetic [-Werror=pointer-arith] data = dri_sw_dt->data + (dri_sw_dt->stride * box->y) + box->x * blsize; ^ Cc: <mesa-stable@lists.freedesktop.org> Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-04-17winsys/amdgpu: init buffer_indices_hashlist with memset()Samuel Pitoiset1-8/+2
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-04-17winsys/amdgpu: simplify amdgpu_cs_add_buffer() a bitSamuel Pitoiset1-4/+3
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-04-13svga: remove unused vmw_dri1_intersect_src_bbox()Samuel Pitoiset1-32/+0
Fixes the following Clang warning. vmw_screen_dri.c:130:1: warning: unused function 'vmw_dri1_intersect_src_bbox' [-Wunused-function] vmw_dri1_intersect_src_bbox(struct drm_clip_rect *dst, ^ 1 warning generated. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Brian Paul <brianp@vmware.com>
2017-04-10gallium/radeon: add HUD queries for GPU temperature and clocksSamuel Pitoiset1-1/+6
Only the Radeon kernel driver exposed the GPU temperature and the shader/memory clocks, this implements the same functionality for the AMDGPU kernel driver. These queries will return 0 if the DRM version is less than 3.10, I don't explicitely check the version here because the query codepath is already a bit messy. v2: - rebase on top of master Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-04-07svga: add context pointer to the invalidate surface interfaceCharmaine Lee4-16/+19
With this patch, we will specify the current context when we invalidate the surface before the surface is put back to the recycled surface pool. This allows the winsys layer to use the specified context to do the invalidation rather than using the last context that referenced the surface. This prevents race condition if the last referenced context is now made current in another thread. Tested with MTT glretrace, NobelClinicianViewer. Reviewed-by: Sinclair Yeh <syeh@vmware.com>
2017-04-07winsys/svga: use c11 thread types/functionsBrian Paul3-13/+13
Gallium no longer has wrappers for mutexes and condition variables. Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2017-04-07winsys/svga: Resolve command submission buffer contention v3Thomas Hellstrom3-2/+38
If two contexts wanted to access the same buffer at the same time, it would end up on two validation lists simultaneously, which might cause a PIPE_ERROR_RETRY when trying to validate it from one context while the other context already had it validated but not yet fenced. In that situation we could spin until the error goes away, or apply various more or less expensive locking schemes to save cpu. Here we use a scheme that briefly locks after fencing but avoids locking on validation in the non-contended case. v2: Make sure we broadcast not only on releasing buffers after fencing, but also after releasing buffers in the pb_validate_validate error path. v3: Don't broadcast on PIPE_ERROR_RETRY because that would increase the chance of starvation. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2017-04-05winsys/amdgpu: sparse buffer debugging helpersNicolai Hähnle1-0/+61
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-04-05winsys/amdgpu: take fences when freeing a backing bufferNicolai Hähnle1-3/+11
We never add fences to backing buffers during submit. When we free a backing buffer, it must inherit the sparse buffer's fences, so that it doesn't get re-used prematurely via the cache. v2: - remove pipe_mutex_* Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-04-05winsys/amdgpu: add sparse buffers to CSNicolai Hähnle2-16/+140
... and implement the corresponding fence handling. v2: - add missing bit in amdgpu_bo_is_referenced_by_cs_with_usage - remove pipe_mutex_* Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-04-05winsys/amdgpu: sparse buffer creation / destruction / commitmentNicolai Hähnle1-1/+400
This is the bulk of the buffer allocation logic. It is fairly simple and stupid. We'll probably want to use e.g. interval trees at some point to keep track of commitments, but Mesa doesn't have an implementation of those yet. v2: - remove pipe_mutex_* - fix total_backing_pages accounting - simplify by using the new VA_OP_CLEAR/REPLACE kernel interface Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-04-05winsys/amdgpu: add sparse buffer data structuresNicolai Hähnle2-1/+46
v2: - remove pipe_mutex_* - use a simple page commitment array Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-04-05winsys/amdgpu: extend amdgpu_add_fence to allow adding multiple fencesNicolai Hähnle2-11/+27
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-04-05winsys/amdgpu: build handles and flags list late on submit threadNicolai Hähnle2-17/+28
This probably has only minor performance effects, but it simplifies some subsequent code slightly. Ideally, it could also be used to simplify the handling of slab buffers in the same way, but unfortunately that's not possible as long as we need indices for relocations. Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-04-05winsys/amdgpu: share common code in amdgpu_add_fence_dependenciesNicolai Hähnle1-21/+17
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-04-05winsys/amdgpu: extract amdgpu_do_add_real_bufferNicolai Hähnle1-8/+18
We will use it for delayed adding of sparse buffers' backing buffers. Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-04-05winsys/radeon: sparse buffers will not be supportedNicolai Hähnle1-0/+2
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-03-31radeonsi/gfx9: fix and enable single-sample CMASK fast clearMarek Olšák1-0/+7
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-03-31radeonsi/gfx9: fix and enable MSAA compressionMarek Olšák1-1/+1
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-03-31radeonsi/gfx9: fix linear mipmap CPU accessMarek Olšák1-1/+1
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-03-30winsys/amdgpu: remove AMDGPU_INFO_NUM_EVICTIONSSamuel Pitoiset1-4/+0
This is now exposed with libdrm_amdgpu 2.4.76. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-03-30winsys/surface: add height pitch for gfx9Leo Liu1-0/+1
Signed-off-by: Leo Liu <leo.liu@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com>
2017-03-30winsys/amdgpu: set/get BO tiling flags for GFX9Marek Olšák1-2/+4
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-03-30radeonsi/gfx9: add radeon_surf.gfx9.surf_offsetMarek Olšák1-0/+1
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-03-30radeonsi/gfx9: add a workaround for 1D depth texturesMarek Olšák1-7/+5
The same workaround is used by Vulkan. Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-03-30gallium/radeon: move pre-GFX9 radeon_bo_metadata.* to u.legacy.*Marek Olšák2-56/+62
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-03-30winsys/amdgpu: set num_tile_pipes, pipe_interleave_bytes for GFX9Marek Olšák1-2/+11
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-03-30winsys/amdgpu: wire up new addrlib for GFX9Marek Olšák1-1/+399
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-03-30winsys/amdgpu: update amdgpu_addr_create for GFX9Marek Olšák1-17/+29
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-03-30winsys/amdgpu: rename GFX6 surface functionsMarek Olšák1-25/+29
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-03-30gallium/radeon: move pre-GFX9 radeon_surf.* members to radeon_surf.u.legacy.*Marek Olšák2-51/+52
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-03-30radeonsi/gfx9: set the LLVM processor, require LLVM 5.0Marek Olšák1-0/+7
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-03-30radeonsi/gfx9: add GFX9 and VEGA10 enumsMarek Olšák1-1/+6
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-03-30amdgpu/addrlib: Rewrite tile mode optmization codeXavi Zhang1-7/+5
Note: remove reference to degrade4Space and use opt4Space instead.
2017-03-20radeon_drm_bo: explicitly check return value of drmCommandWriteReadJulien Isorce1-2/+7
CID 1313492 Signed-off-by: Julien Isorce <jisorce@oblong.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-03-20radeon: initialize hole variable before calling container_ofJulien Isorce1-1/+1
Like in a few other places in that radeon_drm_bo.c file. CID 715739. Signed-off-by: Julien Isorce <jisorce@oblong.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-03-15winsys/amdgpu: use drmGetDevice2 APIEmil Velikov1-2/+2
Analogous to previous commit Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98502 Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> Tested-by: Mike Lothian <mike@fireburn.co.uk>
2017-03-13winsys/radeon: check null return from radeon_cs_create_fence in cs_flushJulien Isorce1-11/+13
Follow-up of patch: "radeon_cs_create_fence: check null return from radeon_winsys_bo_create" radeon_drm_cs_flush radeon_cs_create_fence radeon_winsys_bo_create Signed-off-by: Julien Isorce <jisorce@oblong.com> Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2017-03-13winsys/radeon: check null in radeon_cs_create_fenceJulien Isorce1-0/+3
Fixes the following segmentation fault: radeon_drm_cs_add_buffer (bo=0x0) at radeon_drm_cs.c -> if (!bo->handle) (gdb) bt 0 radeon_drm_cs_add_buffer (bo=0x0) at radeon_drm_cs.c 1 0x00007fffe73575de in radeon_cs_create_fence radeon_drm_cs.c 2 0x00007fffe7358c48 in radeon_drm_cs_flush radeon_drm_cs.c Signed-off-by: Julien Isorce <jisorce@oblong.com> Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2017-03-07gallium/util: replace pipe_mutex_unlock() with mtx_unlock()Timothy Arceri15-97/+97
pipe_mutex_unlock() was made unnecessary with fd33a6bcd7f12. Replaced using: find ./src -type f -exec sed -i -- \ 's:pipe_mutex_unlock(\([^)]*\)):mtx_unlock(\&\1):g' {} \; Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-03-07gallium/util: replace pipe_mutex_lock() with mtx_lock()Timothy Arceri15-65/+65
replace pipe_mutex_lock() was made unnecessary with fd33a6bcd7f12. Replaced using: find ./src -type f -exec sed -i -- \ 's:pipe_mutex_lock(\([^)]*\)):mtx_lock(\&\1):g' {} \; Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-03-07gallium/util: replace pipe_mutex_destroy() with mtx_destroy()Timothy Arceri7-13/+13
pipe_mutex_destroy() was made unnecessary with fd33a6bcd7f12. Replace was done with: find ./src -type f -exec sed -i -- \ 's:pipe_mutex_destroy(\([^)]*\)):mtx_destroy(\&\1):g' {} \; Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-03-07gallium/util: replace pipe_mutex_init() with mtx_init()Timothy Arceri8-16/+16
pipe_mutex_init() was made unnecessary with fd33a6bcd7f12. Replace was done using: find ./src -type f -exec sed -i -- \ 's:pipe_mutex_init(\([^)]*\)):(void) mtx_init(\&\1, mtx_plain):g' {} \; Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-03-07gallium/util: remove pipe_static_mutex()Timothy Arceri6-6/+6
This was made unnecessary with fd33a6bcd7f12. Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-03-07gallium/util: replace pipe_mutex with mtx_tTimothy Arceri9-15/+15
pipe_mutex was made unnecessary with fd33a6bcd7f12. Reviewed-by: Marek Olšák <marek.olsak@amd.com>