tu/kgsl: Fix memory type support detection for unsupported flags
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

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:
Valentine Burley 2026-05-22 16:06:41 +02:00 committed by Marge Bot
parent 9ff0cd7b4d
commit 7395ae7494

View file

@ -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