mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-28 07:48:20 +02:00
tu/kgsl: Fix memory type support detection for unsupported flags
Stops incorrectly assuming cached-coherent memory is supported on
hardware that does not support it, such as a610 and a619-holi.
Fixes: 5a59410962 ("turnip: add cached and cached-coherent memory types")
Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41761>
This commit is contained in:
parent
9ff0cd7b4d
commit
7395ae7494
1 changed files with 8 additions and 1 deletions
|
|
@ -561,11 +561,18 @@ kgsl_is_memory_type_supported(int fd, uint32_t flags)
|
|||
return false;
|
||||
}
|
||||
|
||||
/* The kernel echoes back the *actual* flags it used. Some KGSL
|
||||
* versions silently strip unsupported flags (e.g. IOCOHERENT on
|
||||
* GPUs that lack IO-coherence) instead of failing the ioctl.
|
||||
* Detect this by checking the requested bits are still present.
|
||||
*/
|
||||
bool supported = (req_alloc.flags & flags) == flags;
|
||||
|
||||
struct kgsl_gpumem_free_id req_free = { .id = req_alloc.id };
|
||||
|
||||
safe_ioctl(fd, IOCTL_KGSL_GPUMEM_FREE_ID, &req_free);
|
||||
|
||||
return true;
|
||||
return supported;
|
||||
}
|
||||
|
||||
static bool
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue