From 0f15e9ec100fcbe911f49fc13f49417028b6d081 Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Tue, 6 Aug 2024 11:06:16 +0200 Subject: [PATCH] rusticl/image: properly sync mappings content for 1Dbuffer images This fixes clFillImage 1Dbuffer use_pitches CL CTS tests. Fixes: 7b22bc617bf ("rusticl/memory: complete rework on how mapping is implemented") Part-of: (cherry picked from commit 012323a1d196b89cdc289270a16b3f3d0df49379) --- .pick_status.json | 2 +- src/gallium/frontends/rusticl/core/memory.rs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 9cef3f985a7..323600cc510 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -3624,7 +3624,7 @@ "description": "rusticl/image: properly sync mappings content for 1Dbuffer images", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "7b22bc617bf2db4120a438c1ad5e45992f638d82", "notes": null diff --git a/src/gallium/frontends/rusticl/core/memory.rs b/src/gallium/frontends/rusticl/core/memory.rs index 75eeba42994..6e9cdf8b5d6 100644 --- a/src/gallium/frontends/rusticl/core/memory.rs +++ b/src/gallium/frontends/rusticl/core/memory.rs @@ -706,7 +706,9 @@ impl MemBase { fn is_pure_user_memory(&self, d: &Device) -> CLResult { let r = self.get_res_of_dev(d)?; - Ok(r.is_user) + // 1Dbuffer objects are weird. The parent memory object can be a host_ptr thing, but we are + // not allowed to actually return a pointer based on the host_ptr when mapping. + Ok(r.is_user && !self.host_ptr().is_null()) } fn map(