rusticl/mesa: only use resource_from_user_memory if the cap is advertised

Fixes some buffer tests on some iris configurations.

Cc: mesa-stable
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Tested-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
(cherry picked from commit 240bae6b23)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39828>
This commit is contained in:
Karol Herbst 2026-02-09 17:01:43 +01:00 committed by Marge Bot
parent cf716d4586
commit c0e5d821e1
2 changed files with 9 additions and 1 deletions

View file

@ -994,7 +994,7 @@
"description": "rusticl/mesa: only use resource_from_user_memory if the cap is advertised",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -243,6 +243,10 @@ impl PipeScreen {
tmpl: &pipe_resource,
mem: *mut c_void,
) -> Option<PipeResourceOwned> {
if !self.has_resource_from_user() {
return None;
}
PipeResourceOwned::new(
unsafe { self.screen().resource_from_user_memory?(self.pipe(), tmpl, mem) },
true,
@ -560,6 +564,10 @@ impl PipeScreen {
pub fn has_semaphore_create(&self) -> bool {
self.screen().semaphore_create.is_some()
}
pub fn has_resource_from_user(&self) -> bool {
self.caps().resource_from_user_memory || self.caps().resource_from_user_memory_compute_only
}
}
impl ToOwned for PipeScreen {