aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys
Commit message (Collapse)AuthorAgeFilesLines
* gallium/hash_table: remove some function wrappersMarek Olšák2020-02-2611-62/+52
| | | | | | Reviewed-by: Kristian H. Kristensen <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3722> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3722>
* gallium/hash_table: turn it into a wrapper around util/hash_tableMarek Olšák2020-02-2612-16/+16
| | | | | Reviewed-by: Kristian H. Kristensen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3722>
* gallium/hash_table: use the same callback signatures as util/hash_tableMarek Olšák2020-02-261-3/+3
| | | | | Reviewed-by: Kristian H. Kristensen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3722>
* gallium/hash_table: consolidate hash tables with FD keysMarek Olšák2020-02-266-142/+6
| | | | | Reviewed-by: Kristian H. Kristensen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3722>
* gallium/hash_table: consolidate hash tables with pointer keysMarek Olšák2020-02-264-53/+8
| | | | | Reviewed-by: Kristian H. Kristensen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3722>
* util: Change os_same_file_description return type from bool to intMichel Dänzer2020-02-211-1/+14
| | | | | | | | | | | | | | | This allows communicating that it wasn't possible to determine whether the two file descriptors reference the same file description. When that's the case, log a warning in the amdgpu winsys. In turn, remove the corresponding debugging output from the fallback os_same_file_description implementation. It depends on the caller if false negatives are problematic or not. Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3879> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3879>
* winsys/amdgpu: Make local variable r signedMichel Dänzer2020-02-211-1/+2
| | | | | | | | | | | This is consistent with the return type of the functions whose return values we assign to it. No functional change intended. Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3879>
* virgl: Use align_free for align_malloc allocated bufferSzymon Andrzejuk2020-02-011-1/+1
| | | | | Signed-off-by: Szymon Andrzejuk <[email protected]> Reviewed-by: Gurchetan Singh <[email protected]>
* winsys/amdgpu: Close KMS handles for other DRM file descriptionsMichel Dänzer2020-01-292-3/+21
| | | | | | | | | | | | | | | | | | | | | | | | When a BO or amdgpu_screen_winsys is destroyed. Should fix leaking such BOs in other DRM file descriptions. v2: * Pass the correct file descriptor to drmIoctl (Pierre-Eric Pelloux-Prayer) * Use _mesa_hash_table_remove v3: * Close handles in amdgpu_winsys_unref as well v4: * Adapt to amdgpu_winsys::sws_list_lock. Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2270 Fixes: 11a3679e3aba "winsys/amdgpu: Make KMS handles valid for original DRM file descriptor" Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3582> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3582>
* winsys/amdgpu: Re-use amdgpu_screen_winsys when possibleMichel Dänzer2020-01-292-24/+48
| | | | | | | | | | | | | | | | | Namely, if os_same_file_description determined that the DRM file descriptor references the same file description. v2: * Adapt to amdgpu_winsys::sws_list_lock. v3: * Fix comparison of amdgpu_screen_winsys file descriptions, see https://gitlab.freedesktop.org/mesa/mesa/issues/2413 . * Lock amdgpu_winsys::sws_list_lock for traversing the sws_list in amdgpu_winsys_create. Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3582>
* winsys/svga: Enable transhuge pages for buffer objectsThomas Hellstrom2020-01-291-0/+1
| | | | | | | | | | If the kernel supports it, enable transhuge pages for graphics buffer objects. Except for the syscall itself, this is never expected to cause any negative performance implications. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3614>
* winsys/svga: use new ioctl for loggingRoland Scheidegger2020-01-294-6/+42
| | | | | | | | | | Use the new ioctl for logging (rather than duplicating what the kernel is doing). This way it's also independent from the actual guest/host mechanism to do the logging. Signed-off-by: Roland Scheidegger <[email protected]> Reviewed-by: Thomas Hellstrom <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3614>
* radeonsi: stop using the VM_ALWAYS_VALID flagPierre-Eric Pelloux-Prayer2020-01-293-16/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Allocation all the bo as ALWAYS_VALID means they must all fit in memory (vram + gtt) at each command submission. This causes some trouble when the total allocated memory is greater than the available memory. Possible solutions: - being able to tag/untag a bo as ALWAYS_VALID: would require kernel changes - disable VM_ALWAYS_VALID when memory usage is more than a percentage of the available memory - disable VM_ALWAYS_VALID entirely v1 of this patch implemented option 2. v2 (this version) implements option 3. Related issues: - https://gitlab.freedesktop.org/drm/amd/issues/607 - https://gitlab.freedesktop.org/mesa/mesa/issues/1257 It also helps with some piglit tests (-t maxsize -t "max[_-].*size" -t maxuniformblocksize): instead of crashing the machine, the tests fail cleanly. Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2190 Reviewed-by: Marek Olšák <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3430> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3430>
* Revert "winsys/amdgpu: Re-use amdgpu_screen_winsys when possible"Marek Olšák2020-01-272-45/+24
| | | | | | | | This reverts commit b60f5cbc15a99ddd9251bce40eae7d84c3a1c373. This fixes dmesg errors and X freezes: [ 29.543096] amdgpu 0000:0c:00.0: No GEM object associated to handle 0x00000009, can't create framebuffer [ 29.543103] amdgpu 0000:0c:00.0: No GEM object associated to handle 0x00000009, can't create framebuffer
* Revert "winsys/amdgpu: Close KMS handles for other DRM file descriptions"Marek Olšák2020-01-272-21/+3
| | | | | | This reverts commit 552028c013cc1d49a2b61ebe0fc3a3781a9ba826. Required by the next reverted commit.
* etnaviv: update Android build filesMartin Fuzzey2020-01-241-1/+1
| | | | | | | | | etnaviv no longer builds on Android, fix this. Signed-off-by: Martin Fuzzey <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3447> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3447>
* winsys/amdgpu: Close KMS handles for other DRM file descriptionsMichel Dänzer2020-01-232-3/+21
| | | | | | | | | | | | | | | | | | | | | | | When a BO or amdgpu_screen_winsys is destroyed. Should fix leaking such BOs in other DRM file descriptions. v2: * Pass the correct file descriptor to drmIoctl (Pierre-Eric Pelloux-Prayer) * Use _mesa_hash_table_remove v3: * Close handles in amdgpu_winsys_unref as well v4: * Adapt to amdgpu_winsys::sws_list_lock. Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2270 Fixes: 11a3679e3aba "winsys/amdgpu: Make KMS handles valid for original DRM file descriptor" Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3202> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3202>
* winsys/amdgpu: Re-use amdgpu_screen_winsys when possibleMichel Dänzer2020-01-232-24/+45
| | | | | | | | | | | Namely, if os_same_file_description determined that the DRM file descriptor references the same file description. v2: * Adapt to amdgpu_winsys::sws_list_lock. Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3202>
* winsys/amdgpu: Only re-export KMS handles for different DRM FDsMichel Dänzer2020-01-233-11/+32
| | | | | | | | | | | | | When the amdgpu_screen_winsys uses the same FD as the amdgpu_winsys (which is always the case for the first amdgpu_screen_winsys), we can just use bo->u.real.kms_handle. v2: * Also only create the kms_handles hash table if the amdgpu_screen_winsys fd is different from the amdgpu_winsys one. Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3202>
* winsys/amdgpu: Keep track of retrieved KMS handles using hash tablesMichel Dänzer2020-01-233-0/+47
| | | | | | | | | | | | | | | | | | | | The assumption being that KMS handles are only retrieved for relatively few BOs, so hash tables should be efficient both in terms of performance and memory consumption. We use the address of struct amdgpu_winsys_bo as the key and its kms_handle field (the KMS handle valid for the DRM file descriptor passed to amdgpu_device_initialize) as the hash value. v2: * Add comment above amdgpu_screen_winsys::kms_handles (Pierre-Eric Pelloux-Prayer) v3: * Protect kms_handles hash table with amdgpu_winsys::sws_list_lock mutex. Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3202>
* winsys/amdgpu: Keep a list of amdgpu_screen_winsyses in amdgpu_winsysMichel Dänzer2020-01-232-1/+28
| | | | | | | | v2: * Add dedicated mutex for the list. Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3202>
* virgl/drm: update UAPIGurchetan Singh2020-01-102-175/+1
| | | | | | | This seems to compile. Header copied over from drm-misc-next 7da5492739db. Acked-by: Eric Engestrom <[email protected]>
* radeonsi: preserve the scanout flag for shared resources on gfx9 and gfx10Marek Olšák2020-01-031-0/+5
| | | | | | | Closes: #2195 Closes: #2294 Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]>
* winsys/radeon: initialize pte_fragment_sizeMarek Olšák2019-12-301-0/+1
| | | | | | | | Cc: 19.2 19.3 <[email protected]> Closes: #2179 Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* winsys/amdgpu: avoid double simple_mtx_unlock()Jonathan Gray2019-11-281-1/+0
| | | | | | | | | | | | | | pthread_mutex_unlock() when unlocked is documented by posix as being undefined behaviour. On OpenBSD pthread_mutex_unlock() will call abort(3) if this happens. This occurs in amdgpu_winsys_create() after cb446dc0fa5c68f681108f4613560543aa4cf553 winsys/amdgpu: Add amdgpu_screen_winsys Signed-off-by: Jonathan Gray <[email protected]> Cc: 19.2 19.3 <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* winsys/amdgpu: detect noop dependencies on the same ring correctlyMarek Olšák2019-11-191-6/+9
| | | | Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]>
* ac: fill num_rings for remaining IPsMarek Olšák2019-11-191-2/+7
| | | | Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]>
* ac: add radeon_info::num_rings and move ring_type to amd_family.hMarek Olšák2019-11-191-2/+2
| | | | Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]>
* Call shmget() with permission 0600 instead of 0777Brian Paul2019-11-182-2/+4
| | | | | | | | | | | | | | A security advisory (TALOS-2019-0857/CVE-2019-5068) found that creating shared memory regions with permission mode 0777 could allow any user to access that memory. Several Mesa drivers use shared- memory XImages to implement back buffers for improved performance. This path changes the shmget() calls to use 0600 (user r/w). Tested with legacy Xlib driver and llvmpipe. Cc: [email protected] Reviewed-by: Kristian H. Kristensen <[email protected]>
* util: Move gallium's PIPE_FORMAT utils to /util/format/Eric Anholt2019-11-1413-13/+13
| | | | | | | | | | | | | | | To make PIPE_FORMATs usable from non-gallium parts of Mesa, I want to move their helpers out of gallium. Since u_format used util_copy_rect(), I moved that in there, too. I've put it in a separate directory in util/ because it's a big chunk of related code, and it's not clear to me whether we might want it as a separate library from libmesa_util at some point. Closes: #1905 Acked-by: Marek Olšák <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* radeonsi: sdma misc fixesPierre-Eric Pelloux-Prayer2019-10-301-3/+0
| | | | | | SDMA IB doesn't need to be padded for SDMA. Reviewed-by: Marek Olšák <[email protected]>
* winsys/amdgpu: use the new GPU reset queryMarek Olšák2019-10-281-20/+37
|
* util: remove LIST_IS_EMPTY macroTimothy Arceri2019-10-281-1/+1
| | | | | | | Just use the inlined function directly. The new function was introduced in addcf410. Reviewed-by: Eric Engestrom <[email protected]>
* util: rename list_empty() to list_is_empty()Timothy Arceri2019-10-281-1/+1
| | | | | | | This makes it clear that it's a boolean test and not an action (eg. "empty the list"). Reviewed-by: Eric Engestrom <[email protected]>
* util: remove LIST_DEL macroTimothy Arceri2019-10-283-6/+6
| | | | | | | Just use the inlined function directly. The macro was replaced with the function in ebe304fa540f. Reviewed-by: Eric Engestrom <[email protected]>
* util: remove LIST_DELINIT macroTimothy Arceri2019-10-281-3/+3
| | | | | | | Just use the inlined function directly. The macro was replaced with the function in ebe304fa540f. Reviewed-by: Eric Engestrom <[email protected]>
* util: remove LIST_ADDTAIL macroTimothy Arceri2019-10-285-8/+8
| | | | | | | Just use the inlined function directly. The macro was replaced with the function in ebe304fa540f. Reviewed-by: Eric Engestrom <[email protected]>
* util: remove LIST_INITHEAD macroTimothy Arceri2019-10-286-9/+9
| | | | | | | Just use the inlined function directly. The macro was replaced with the function in ebe304fa540f. Reviewed-by: Eric Engestrom <[email protected]>
* winsys/svga: Limit the maximum DMA hardware buffer sizeThomas Hellstrom2019-10-241-1/+4
| | | | | | | | | | | | | | | | | | | The kernel total GMR/DMA size is limited, but it's definitely possible for the kernel to allow a larger buffer allocation to succeed, but command submission using that buffer as a GMR would fail typically causing an application crash. So have the winsys limit the size of GMR/DMA buffers. The pipe driver will then resort to allocating smaller buffers and perform the DMA transfer in multiple bands, also allowing for the pre-flush mechanism to kick in. This avoids the related application crashes. Fixes: e7843273fae ("winsys/svga: Update to vmwgfx kernel module 2.1") Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* meson: build gallium gdi winsysDylan Baker2019-10-101-0/+27
| | | | | | | v6: - use null_dep instead of [] Reviewed-by: Eric Anholt <[email protected]> (v5) Acked-by: Kristian H. Kristensen <[email protected]>
* amd: Move all amd/common code that depends on LLVM to amd/llvm.Timur Kristóf2019-10-082-2/+3
| | | | | | | | | | | | | This commit is a step towards the goal of being able to build RADV without LLVM. In the future we would like to offer the option to use RADV solely with ACO. There is still a need for the common AMD code located in amd/common but the LLVM specific parts need to be separated. Signed-off-by: Timur Kristóf <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Acked-by: Marek Olšák <[email protected]> Acked-by: Samuel Pitoiset <[email protected]>
* winsys/radeon: initialize SIMD properties in radeon_infoMarek Olšák2019-10-071-0/+3
| | | | | | | | | This was missed when I added them. Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1839 Fixes: 0692ae34e93 ("ac: move ac_get_num_physical_sgprs into radeon_info") Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]>
* virgl: honor winsys supplied metadataGurchetan Singh2019-10-021-1/+6
| | | | | | | | | | | To truly to do this correctly, we'll have to fix the discrepancy between drm_virtgpu_3d_transfer_to_host and virtio_gpu_transfer_host_3d. However, this is a good starting point. Since virtio-gpu only supports self-import and export, this should be fine. Let's only do WINSYS_HANDLE_TYPE_FD for this currently. Reviewed by: Robert Tarasov <[email protected]>
* virgl: modify resource_create_from_handle(..) callbackGurchetan Singh2019-10-021-1/+5
| | | | | | | This commit makes no functional changes, just adds the revelant plumbing. Reviewed by: Robert Tarasov <[email protected]>
* virgl: remove stride from virgl_hw_resGurchetan Singh2019-10-022-3/+0
| | | | | | | It's not used anywhere, and stride isn't really an intrinsic property of a GEM buffer. Reviewed by: Robert Tarasov <[email protected]>
* util/u_queue: track job size and limit the size of queue growthTimothy Arceri2019-09-192-2/+2
| | | | | | | | | | | | | | | | | | | | | When both UTIL_QUEUE_INIT_RESIZE_IF_FULL and UTIL_QUEUE_INIT_USE_MINIMUM_PRIORITY are set, we can get into a situation where the queue never executes and grows to a huge size due to all other threads being busy. This is the case with the shader cache when attempting to compile a huge number of shaders up front. If all threads are busy compiling shaders the cache queues memory use can climb into the many GBs very fast. The use of these two flags with the shader cache is intended to allow shaders compiled at runtime to be compiled as fast as possible. To avoid huge memory use but still allow the queue to perform optimally in the run time compilation case, we now add the ability to track memory consumed by the jobs in the queue and limit it to a hardcoded 256MB which should be more than enough. Reviewed-by: Marek Olšák <[email protected]>
* virgl: Remove wrong EAGAIN handling for drmIoctlLepton Wu2019-09-181-3/+3
| | | | | | | | | | | drmIoctl handles EAGAIN itself and actually it always return -1 on errors. Remove the wrong handling of its return value. Also, print a warning when it fails. v2: - use _debug_printf instead of fprintf (Gurchetan Singh) Signed-off-by: Lepton Wu <[email protected]> Reviewed-by: Eric Anholt <[email protected]> (v1)
* virgl: replace fprintf with _debug_printfLepton Wu2019-09-141-5/+5
| | | | | Signed-off-by: Lepton Wu <[email protected]> Reviewed-by: Gurchetan Singh <[email protected]>
* radeonsi: move texture storage allocation outside of radeonsiMarek Olšák2019-09-091-1/+22
| | | | | | possible code sharing with radv Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]>
* radeonsi: move HTILE allocation outside of radeonsiMarek Olšák2019-09-091-0/+70
| | | | | | | ac_surface computes it for amdgpu. radeon_drm_surface computes it for radeon. Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]>