Hi

Am 27.02.26 um 15:59 schrieb Tvrtko Ursulin:

On 27/02/2026 13:31, Thomas Zimmermann wrote:
Instead of testing import_attach for imported GEM buffers, invoke
drm_gem_is_imported() to do the test. The test itself does not change.

Signed-off-by: Thomas Zimmermann <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Joonas Lahtinen <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Tvrtko Ursulin <[email protected]>
Cc: [email protected]
---
  drivers/gpu/drm/i915/gem/i915_gem_object.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object.c b/drivers/gpu/drm/i915/gem/i915_gem_object.c
index 3f6f040c359d..798c920160cf 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_object.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_object.c
@@ -372,12 +372,12 @@ void __i915_gem_object_pages_fini(struct drm_i915_gem_object *obj)
       * and ttm_bo_cleanup_memtype_use() shouldn't be invoked for
       * dma-buf, so it's safe to take the lock.
       */
-    if (obj->base.import_attach)
+    if (drm_gem_is_imported(&obj->base))
          i915_gem_object_lock(obj, NULL);
        __i915_gem_object_put_pages(obj);
  -    if (obj->base.import_attach)
+    if (drm_gem_is_imported(&obj->base))
          i915_gem_object_unlock(obj);
        GEM_BUG_ON(i915_gem_object_has_pages(obj));
@@ -391,7 +391,7 @@ void __i915_gem_free_object(struct drm_i915_gem_object *obj)
        bitmap_free(obj->bit_17);
  -    if (obj->base.import_attach)
+    if (drm_gem_is_imported(&obj->base))
          drm_prime_gem_destroy(&obj->base, NULL);
        drm_gem_free_mmap_offset(&obj->base);

LGTM. Want us to merge it via i915 or you want to take the group via drm-misc?

Please merge it via i915 trees.


What is the end goal btw, just cleanup or you plan to remove/rename the member? If latter there are some other places which access it directly.

There's no further goal. It's just about making the code easier to understand. I had these changes here for some time already and finally wanted to get them merged..

Best regards
Thomas



Regards,

Tvrtko


--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)


Reply via email to