drm/rockchip: Test for imported buffers with drm_gem_is_imported()
Subsystems (4)
Thomas Zimmermann
maintainerPATCH 5/11 drm/rockchip: Test for imported buffers with drm_gem_is_imported()
Instead of testing import_attach for imported GEM buffers, invoke drm_gem_is_imported() to do the test. The helper tests the dma_buf itself while import_attach is just an artifact of the import. Prepares to make import_attach optional.
--- drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/rockchip/rockchip_drm_gem.c +1 -1
@@ -332,7 +332,7 @@ void rockchip_gem_free_object(struct drm_gem_object *obj)struct rockchip_drm_private *private = drm->dev_private;struct rockchip_gem_object *rk_obj =to_rockchip_obj (obj); -if (obj->import_attach) { +if (drm_gem_is_imported (obj)) {if (private->domain) {rockchip_gem_iommu_unmap (rk_obj); }else {
Signature · 1 line
2.49.0
Andy Yan
maintainerHi Thomas,
Quoted 18 lines · Thomas Zimmermann
Instead of testing
import_attachfor imported GEM buffers, invokedrm_gem_is_imported()to do the test. The helper tests thedma_bufitself whileimport_attachis just an artifact of the import. Prepares to makeimport_attachoptional.Signed-off-by Thomas Zimmermann <[email protected]>Cc Sandy Huang <[email protected]>Cc "Heiko Stübner" <[email protected]>Cc Andy Yan <[email protected]>---
drivers/gpu/drm/rockchip/rockchip_drm_gem.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/rockchip/rockchip_drm_gem.c +0
-0
drivers/gpu/drm/rockchip/rockchip_drm_gem.c void rockchip_gem_free_object(struct drm_gem_object *obj) · line 335
Quoted 5 lines
drivers/gpu/drm/rockchip/rockchip_drm_gem.c +1
-1@@ -332,7 +332,7 @@ void rockchip_gem_free_object(struct drm_gem_object *obj)struct rockchip_drm_private *private = drm->dev_private;struct rockchip_gem_object *rk_obj =to_rockchip_obj (obj); -if (obj->import_attach) { +if (drm_gem_is_imported (obj)) {
After applying this patch, when I tested glmark2-es2-wayland under Weston, the weston would freeze. It seems it goto the else path.
I'm still conducting further analysis to figure out the exact cause.
Quoted 5 lines
drivers/gpu/drm/rockchip/rockchip_drm_gem.c +0
-0if (private->domain) {rockchip_gem_iommu_unmap (rk_obj); }else {Signature · 1 line
2.49.0
Thomas Zimmermann
maintainerHi
Am 15.04.25 um 06:00 schrieb Andy Yan:
Quoted 25 lines
Hi Thomas,
Quoted 21 lines · Thomas Zimmermann
Instead of testing
import_attachfor imported GEM buffers, invokedrm_gem_is_imported()to do the test. The helper tests thedma_bufitself whileimport_attachis just an artifact of the import. Prepares to makeimport_attachoptional.Signed-off-by Thomas Zimmermann <[email protected]>Cc Sandy Huang <[email protected]>Cc "Heiko Stübner" <[email protected]>Cc Andy Yan <[email protected]>---
drivers/gpu/drm/rockchip/rockchip_drm_gem.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/rockchip/rockchip_drm_gem.c +0
-0@@ -332,7 +332,7 @@ void rockchip_gem_free_object(struct drm_gem_object *obj)struct rockchip_drm_private *private = drm->dev_private;struct rockchip_gem_object *rk_obj =to_rockchip_obj (obj);
Quoted 7 lines
drivers/gpu/drm/rockchip/rockchip_drm_gem.c void rockchip_gem_free_object(struct drm_gem_object *obj) · line 335
Quoted 2 lines
drivers/gpu/drm/rockchip/rockchip_drm_gem.c +1
-1-if (obj->import_attach) { +if (drm_gem_is_imported (obj)) {After applying this patch, when I tested glmark2-es2-wayland under Weston, the weston would freeze. It seems it goto the else path.
I'm still conducting further analysis to figure out the exact cause.
Thanks for testing. We test if obj->dma_buf is set and refers back to obj. One of these fields has likely been cleared already to NULL during the object cleanup. Other drivers also call drm_gem_is_imported() in their object cleanup and I've not heard about any regressions.
Best regards
Thomas
Quoted 6 lines
Quoted 6 lines
drivers/gpu/drm/rockchip/rockchip_drm_gem.c +0
-0if (private->domain) {rockchip_gem_iommu_unmap (rk_obj); }else {Signature · 1 line
2.49.0
Signature · 7 lines
-- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstrasse 146, 90461 Nuernberg, Germany GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman HRB 36809 (AG Nuernberg)
Andy Yan
maintainerHi Thomas,
Quoted 34 lines · 在 2025-04-15 14:54:21,"Thomas Zimmermann" <[email protected]> 写道:
Hi
Am 15.04.25 um 06:00 schrieb Andy Yan:
Quoted 31 lines
Hi Thomas,
Quoted 18 lines · Thomas Zimmermann
Instead of testing
import_attachfor imported GEM buffers, invokedrm_gem_is_imported()to do the test. The helper tests thedma_bufitself whileimport_attachis just an artifact of the import. Prepares to makeimport_attachoptional.Signed-off-by Thomas Zimmermann <[email protected]>Cc Sandy Huang <[email protected]>Cc "Heiko Stübner" <[email protected]>Cc Andy Yan <[email protected]>---
drivers/gpu/drm/rockchip/rockchip_drm_gem.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/rockchip/rockchip_drm_gem.c +0
-0drivers/gpu/drm/rockchip/rockchip_drm_gem.c void rockchip_gem_free_object(struct drm_gem_object *obj) · line 335
Quoted 5 lines
drivers/gpu/drm/rockchip/rockchip_drm_gem.c +1
-1@@ -332,7 +332,7 @@ void rockchip_gem_free_object(struct drm_gem_object *obj)struct rockchip_drm_private *private = drm->dev_private;struct rockchip_gem_object *rk_obj =to_rockchip_obj (obj); -if (obj->import_attach) { +if (drm_gem_is_imported (obj)) {After applying this patch, when I tested glmark2-es2-wayland under Weston, the weston would freeze. It seems it goto the else path.
Quoted 6 lines
Quoted 1 line
I'm still conducting further analysis to figure out the exact cause.
Thanks for testing. We test if
obj->dma_bufis set and refers back to obj. One of these fields has likely been cleared already to NULL during the object cleanup. Other drivers also calldrm_gem_is_imported()in their object cleanup and I've not heard about any regressions.
From my test, it seems that a dumb buffer may export then import:
and the obj->dma_buf will be cleared at drm_mode_destroy_dumb_ioctl-->drm_gem_handle_delete
then test with obj->dma_buf && (obj->dma_buf->priv != obj) will be false.
[ 12.028941] [drm] Initialized panthor 1.3.0 for fb000000.gpu on minor 1 [ 14.606114] rockchip_gem_dumb_create weston obj: ffff00010149b000 handle: 1 [ 14.606170] drm_gem_prime_handle_to_dmabuf weston obj: ffff00010149b000 dma_buf: 0xffff000101454800 handle: 1 [ 14.606217] drm_gem_prime_fd_to_handle weston obj: ffff0001023cdc00 dma_buf: 0xffff000101454800 dma_buf->priv ffff00010149b000 [ 14.685517] rockchip_gem_dumb_create weston obj: ffff00010149b400 handle: 2 [ 14.685569] drm_gem_prime_handle_to_dmabuf weston obj: ffff00010149b400 dma_buf: 0xffff000101454400 handle: 2 [ 14.685691] drm_gem_prime_fd_to_handle weston obj: ffff0001023ce600 dma_buf: 0xffff000101454400 dma_buf->priv ffff00010149b400 [ 15.255277] rockchip_gem_dumb_create weston obj: ffff00010759f800 handle: 3 [ 15.255298] drm_gem_prime_handle_to_dmabuf weston obj: ffff00010759f800 dma_buf: 0xffff0001030cbc00 handle: 3 [ 15.255317] drm_gem_prime_fd_to_handle weston obj: ffff0001037a3200 dma_buf: 0xffff0001030cbc00 dma_buf->priv ffff00010759f800 [ 15.316336] rockchip_gem_dumb_create weston obj: ffff00010759f000 handle: 4 [ 15.316360] drm_gem_prime_handle_to_dmabuf weston obj: ffff00010759f000 dma_buf: 0xffff0001030cba00 handle: 4 [ 15.316404] drm_gem_prime_fd_to_handle weston obj: ffff0001037a1000 dma_buf: 0xffff0001030cba00 dma_buf->priv ffff00010759f000 [ 20.209006] rockchip_gem_dumb_create weston obj: ffff000106584000 handle: 1 [ 20.209031] drm_gem_prime_handle_to_dmabuf weston obj: ffff000106584000 dma_buf: 0xffff0001017a7600 handle: 1 [ 20.209049] drm_gem_prime_fd_to_handle weston obj: ffff00010182fc00 dma_buf: 0xffff0001017a7600 dma_buf->priv ffff000106584000 [ 20.228008] rockchip_gem_dumb_create weston obj: ffff000106584c00 handle: 2 [ 20.228029] drm_gem_prime_handle_to_dmabuf weston obj: ffff000106584c00 dma_buf: 0xffff0001017a7a00 handle: 2 [ 20.228081] drm_gem_prime_fd_to_handle weston obj: ffff000105eec000 dma_buf: 0xffff0001017a7a00 dma_buf->priv ffff000106584c00
[ 27.073265] drm_gem_prime_handle_to_dmabuf glmark2-es2-way obj: ffff0001035f0a00 dma_buf: 0xffff00010a24d500 handle: 10 [ 27.073377] drm_gem_prime_fd_to_handle weston obj: ffff0001035f0a00 dma_buf: 0xffff00010a24d500 dma_buf->priv ffff0001035f0a00 [ 27.073718] drm_gem_prime_fd_to_handle weston obj: ffff00010759e000 dma_buf: 0xffff00010a24d500 dma_buf->priv ffff0001035f0a00
[ 27.075363] drm_gem_handle_delete glmark2-es2-way obj: ffff0001035f0a00 handle: 10 [ 27.075718] drm_gem_prime_handle_to_dmabuf glmark2-es2-way obj: ffff00012946e000 dma_buf: 0xffff00010a24d100 handle: 25 [ 27.075799] drm_gem_prime_fd_to_handle weston obj: ffff00012946e000 dma_buf: 0xffff00010a24d100 dma_buf->priv ffff00012946e000 [ 27.076613] drm_gem_prime_fd_to_handle weston obj: ffff00010759dc00 dma_buf: 0xffff00010a24d100 dma_buf->priv ffff00012946e000 [ 27.079195] drm_gem_prime_handle_to_dmabuf glmark2-es2-way obj: ffff00012946e400 dma_buf: 0xffff00010a24d000 handle: 10 [ 27.079262] drm_gem_handle_delete weston obj: ffff00010759e000 handle: 5 [ 27.079271] CPU: 7 UID: 0 PID: 308 Comm: weston Not tainted 6.15.0-rc1+ #613 PREEMPT [ 27.079276] Hardware name: Radxa ROCK 5B (DT) [ 27.079278] Call trace: [ 27.079280] show_stack+0x18/0x24 (C) [ 27.079289] dump_stack_lvl+0x74/0x8c [ 27.079296] dump_stack+0x18/0x24 [ 27.079301] drm_gem_object_handle_put_unlocked+0x58/0x128 [ 27.079309] drm_gem_handle_delete+0xbc/0x110 [ 27.079314] drm_mode_destroy_dumb_ioctl+0x24/0x3c [ 27.079318] drm_ioctl_kernel+0xc0/0x12c [ 27.079324] drm_ioctl+0x25c/0x55c [ 27.079330] __arm64_sys_ioctl+0xb4/0xe8 [ 27.079335] invoke_syscall+0x48/0x10c [ 27.079340] el0_svc_common.constprop.0+0x40/0xe0 [ 27.079346] do_el0_svc+0x1c/0x28 [ 27.079351] el0_svc+0x30/0xcc [ 27.079355] el0t_64_sync_handler+0x10c/0x138 [ 27.079358] el0t_64_sync+0x198/0x19c [ 27.079362] drm_gem_object_exported_dma_buf_free weston obj: ffff00010759e000 dma_buf: 0xffff00010a24d500 dma_buf->priv: ffff0001035f0a00 [ 27.085797] rockchip_gem_free_object weston obj: ffff00010759e000 import dma_buf: 0x0000000000000000 dma_buf->priv: 0000000000000000 [ 27.086093] drm_gem_handle_delete weston obj: ffff0001035f0a00 handle: 35 [ 27.086099] CPU: 7 UID: 0 PID: 308 Comm: weston Not tainted 6.15.0-rc1+ #613 PREEMPT [ 27.086102] Hardware name: Radxa ROCK 5B (DT)
Quoted 19 lines
Best regards
ThomasQuoted 6 lines
Quoted 6 lines
drivers/gpu/drm/rockchip/rockchip_drm_gem.c +0
-0if (private->domain) {rockchip_gem_iommu_unmap (rk_obj); }else {Signature · 1 line
2.49.0Signature · 7 lines
-- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstrasse 146, 90461 Nuernberg, Germany GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman HRB 36809 (AG Nuernberg)
Thomas Zimmermann
maintainerHi
Am 15.04.25 um 09:15 schrieb Andy Yan:
Quoted 36 lines
Hi Thomas,
Quoted 33 lines · 在 2025-04-15 14:54:21,"Thomas Zimmermann" <[email protected]> 写道:
Hi
Am 15.04.25 um 06:00 schrieb Andy Yan:
Quoted 30 lines
Hi Thomas,
Quoted 18 lines · Thomas Zimmermann
Instead of testing
import_attachfor imported GEM buffers, invokedrm_gem_is_imported()to do the test. The helper tests thedma_bufitself whileimport_attachis just an artifact of the import. Prepares to makeimport_attachoptional.Signed-off-by Thomas Zimmermann <[email protected]>Cc Sandy Huang <[email protected]>Cc "Heiko Stübner" <[email protected]>Cc Andy Yan <[email protected]>---
drivers/gpu/drm/rockchip/rockchip_drm_gem.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/rockchip/rockchip_drm_gem.c +0
-0drivers/gpu/drm/rockchip/rockchip_drm_gem.c void rockchip_gem_free_object(struct drm_gem_object *obj) · line 335
Quoted 5 lines
drivers/gpu/drm/rockchip/rockchip_drm_gem.c +1
-1@@ -332,7 +332,7 @@ void rockchip_gem_free_object(struct drm_gem_object *obj)struct rockchip_drm_private *private = drm->dev_private;struct rockchip_gem_object *rk_obj =to_rockchip_obj (obj); -if (obj->import_attach) { +if (drm_gem_is_imported (obj)) {After applying this patch, when I tested glmark2-es2-wayland under Weston, the weston would freeze. It seems it goto the else path.
I'm still conducting further analysis to figure out the exact cause.
Quoted 8 lines
Quoted 4 lines
Thanks for testing. We test if
obj->dma_bufis set and refers back to obj. One of these fields has likely been cleared already to NULL during the object cleanup. Other drivers also calldrm_gem_is_imported()in their object cleanup and I've not heard about any regressions.From my test, it seems that a dumb buffer may export then import:
and theobj->dma_bufwill be cleared at drm_mode_destroy_dumb_ioctl-->drm_gem_handle_deletethen test with
obj->dma_buf&& (obj->dma_buf->priv!= obj) will be false.
Thanks for investigating. It looks like we end up at
https://elixir.bootlin.com/linux/v6.13.7/source/drivers/gpu/drm/drm_gem.c#L236
and release the dma-buf. For now, that needs a fixup in the is_imported helper. I'll send out something quickly.
Best regards
Thomas
Quoted 74 lines
[ 12.028941] [drm] Initialized panthor 1.3.0 for fb000000.gpu on minor 1 [ 14.606114] rockchip_gem_dumb_create weston obj: ffff00010149b000 handle: 1 [ 14.606170] drm_gem_prime_handle_to_dmabuf weston obj: ffff00010149b000 dma_buf: 0xffff000101454800 handle: 1 [ 14.606217] drm_gem_prime_fd_to_handle weston obj: ffff0001023cdc00 dma_buf: 0xffff000101454800 dma_buf->priv ffff00010149b000 [ 14.685517] rockchip_gem_dumb_create weston obj: ffff00010149b400 handle: 2 [ 14.685569] drm_gem_prime_handle_to_dmabuf weston obj: ffff00010149b400 dma_buf: 0xffff000101454400 handle: 2 [ 14.685691] drm_gem_prime_fd_to_handle weston obj: ffff0001023ce600 dma_buf: 0xffff000101454400 dma_buf->priv ffff00010149b400 [ 15.255277] rockchip_gem_dumb_create weston obj: ffff00010759f800 handle: 3 [ 15.255298] drm_gem_prime_handle_to_dmabuf weston obj: ffff00010759f800 dma_buf: 0xffff0001030cbc00 handle: 3 [ 15.255317] drm_gem_prime_fd_to_handle weston obj: ffff0001037a3200 dma_buf: 0xffff0001030cbc00 dma_buf->priv ffff00010759f800 [ 15.316336] rockchip_gem_dumb_create weston obj: ffff00010759f000 handle: 4 [ 15.316360] drm_gem_prime_handle_to_dmabuf weston obj: ffff00010759f000 dma_buf: 0xffff0001030cba00 handle: 4 [ 15.316404] drm_gem_prime_fd_to_handle weston obj: ffff0001037a1000 dma_buf: 0xffff0001030cba00 dma_buf->priv ffff00010759f000 [ 20.209006] rockchip_gem_dumb_create weston obj: ffff000106584000 handle: 1 [ 20.209031] drm_gem_prime_handle_to_dmabuf weston obj: ffff000106584000 dma_buf: 0xffff0001017a7600 handle: 1 [ 20.209049] drm_gem_prime_fd_to_handle weston obj: ffff00010182fc00 dma_buf: 0xffff0001017a7600 dma_buf->priv ffff000106584000 [ 20.228008] rockchip_gem_dumb_create weston obj: ffff000106584c00 handle: 2 [ 20.228029] drm_gem_prime_handle_to_dmabuf weston obj: ffff000106584c00 dma_buf: 0xffff0001017a7a00 handle: 2 [ 20.228081] drm_gem_prime_fd_to_handle weston obj: ffff000105eec000 dma_buf: 0xffff0001017a7a00 dma_buf->priv ffff000106584c00[ 27.073265] drm_gem_prime_handle_to_dmabuf glmark2-es2-way obj: ffff0001035f0a00 dma_buf: 0xffff00010a24d500 handle: 10 [ 27.073377] drm_gem_prime_fd_to_handle weston obj: ffff0001035f0a00 dma_buf: 0xffff00010a24d500 dma_buf->priv ffff0001035f0a00 [ 27.073718] drm_gem_prime_fd_to_handle weston obj: ffff00010759e000 dma_buf: 0xffff00010a24d500 dma_buf->priv ffff0001035f0a00[ 27.075363] drm_gem_handle_delete glmark2-es2-way obj: ffff0001035f0a00 handle: 10 [ 27.075718] drm_gem_prime_handle_to_dmabuf glmark2-es2-way obj: ffff00012946e000 dma_buf: 0xffff00010a24d100 handle: 25 [ 27.075799] drm_gem_prime_fd_to_handle weston obj: ffff00012946e000 dma_buf: 0xffff00010a24d100 dma_buf->priv ffff00012946e000 [ 27.076613] drm_gem_prime_fd_to_handle weston obj: ffff00010759dc00 dma_buf: 0xffff00010a24d100 dma_buf->priv ffff00012946e000 [ 27.079195] drm_gem_prime_handle_to_dmabuf glmark2-es2-way obj: ffff00012946e400 dma_buf: 0xffff00010a24d000 handle: 10 [ 27.079262] drm_gem_handle_delete weston obj: ffff00010759e000 handle: 5 [ 27.079271] CPU: 7 UID: 0 PID: 308 Comm: weston Not tainted 6.15.0-rc1+ #613 PREEMPT [ 27.079276] Hardware name: Radxa ROCK 5B (DT) [ 27.079278] Call trace: [ 27.079280] show_stack+0x18/0x24 (C) [ 27.079289] dump_stack_lvl+0x74/0x8c [ 27.079296] dump_stack+0x18/0x24 [ 27.079301] drm_gem_object_handle_put_unlocked+0x58/0x128 [ 27.079309] drm_gem_handle_delete+0xbc/0x110 [ 27.079314] drm_mode_destroy_dumb_ioctl+0x24/0x3c [ 27.079318] drm_ioctl_kernel+0xc0/0x12c [ 27.079324] drm_ioctl+0x25c/0x55c [ 27.079330] __arm64_sys_ioctl+0xb4/0xe8 [ 27.079335] invoke_syscall+0x48/0x10c [ 27.079340] el0_svc_common.constprop.0+0x40/0xe0 [ 27.079346] do_el0_svc+0x1c/0x28 [ 27.079351] el0_svc+0x30/0xcc [ 27.079355] el0t_64_sync_handler+0x10c/0x138 [ 27.079358] el0t_64_sync+0x198/0x19c [ 27.079362] drm_gem_object_exported_dma_buf_free weston obj: ffff00010759e000 dma_buf: 0xffff00010a24d500 dma_buf->priv: ffff0001035f0a00 [ 27.085797] rockchip_gem_free_object weston obj: ffff00010759e000 import dma_buf: 0x0000000000000000 dma_buf->priv: 0000000000000000 [ 27.086093] drm_gem_handle_delete weston obj: ffff0001035f0a00 handle: 35 [ 27.086099] CPU: 7 UID: 0 PID: 308 Comm: weston Not tainted 6.15.0-rc1+ #613 PREEMPT [ 27.086102] Hardware name: Radxa ROCK 5B (DT)Quoted 16 lines
Best regards
ThomasQuoted 5 lines
Quoted 5 lines
drivers/gpu/drm/rockchip/rockchip_drm_gem.c +0
-0if (private->domain) {rockchip_gem_iommu_unmap (rk_obj); }else {Signature · 1 line
2.49.0Signature · 7 lines
-- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstrasse 146, 90461 Nuernberg, Germany GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman HRB 36809 (AG Nuernberg)
Signature · 7 lines
-- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstrasse 146, 90461 Nuernberg, Germany GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman HRB 36809 (AG Nuernberg)
Thomas Zimmermann
maintainerHi
Am 15.04.25 um 09:15 schrieb Andy Yan:
Quoted 36 lines
Hi Thomas,
Quoted 33 lines · 在 2025-04-15 14:54:21,"Thomas Zimmermann" <[email protected]> 写道:
Hi
Am 15.04.25 um 06:00 schrieb Andy Yan:
Quoted 30 lines
Hi Thomas,
Quoted 18 lines · Thomas Zimmermann
Instead of testing
import_attachfor imported GEM buffers, invokedrm_gem_is_imported()to do the test. The helper tests thedma_bufitself whileimport_attachis just an artifact of the import. Prepares to makeimport_attachoptional.Signed-off-by Thomas Zimmermann <[email protected]>Cc Sandy Huang <[email protected]>Cc "Heiko Stübner" <[email protected]>Cc Andy Yan <[email protected]>---
drivers/gpu/drm/rockchip/rockchip_drm_gem.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/rockchip/rockchip_drm_gem.c +0
-0drivers/gpu/drm/rockchip/rockchip_drm_gem.c void rockchip_gem_free_object(struct drm_gem_object *obj) · line 335
Quoted 5 lines
drivers/gpu/drm/rockchip/rockchip_drm_gem.c +1
-1@@ -332,7 +332,7 @@ void rockchip_gem_free_object(struct drm_gem_object *obj)struct rockchip_drm_private *private = drm->dev_private;struct rockchip_gem_object *rk_obj =to_rockchip_obj (obj); -if (obj->import_attach) { +if (drm_gem_is_imported (obj)) {After applying this patch, when I tested glmark2-es2-wayland under Weston, the weston would freeze. It seems it goto the else path.
I'm still conducting further analysis to figure out the exact cause.
Quoted 8 lines
Quoted 4 lines
Thanks for testing. We test if
obj->dma_bufis set and refers back to obj. One of these fields has likely been cleared already to NULL during the object cleanup. Other drivers also calldrm_gem_is_imported()in their object cleanup and I've not heard about any regressions.From my test, it seems that a dumb buffer may export then import:
and theobj->dma_bufwill be cleared at drm_mode_destroy_dumb_ioctl-->drm_gem_handle_deletethen test with
obj->dma_buf&& (obj->dma_buf->priv!= obj) will be false.
Here's a patch for the problem. Could you please test and report back with the results? Thanks a lot.
Best regards
Thomas
Quoted 74 lines
[ 12.028941] [drm] Initialized panthor 1.3.0 for fb000000.gpu on minor 1 [ 14.606114] rockchip_gem_dumb_create weston obj: ffff00010149b000 handle: 1 [ 14.606170] drm_gem_prime_handle_to_dmabuf weston obj: ffff00010149b000 dma_buf: 0xffff000101454800 handle: 1 [ 14.606217] drm_gem_prime_fd_to_handle weston obj: ffff0001023cdc00 dma_buf: 0xffff000101454800 dma_buf->priv ffff00010149b000 [ 14.685517] rockchip_gem_dumb_create weston obj: ffff00010149b400 handle: 2 [ 14.685569] drm_gem_prime_handle_to_dmabuf weston obj: ffff00010149b400 dma_buf: 0xffff000101454400 handle: 2 [ 14.685691] drm_gem_prime_fd_to_handle weston obj: ffff0001023ce600 dma_buf: 0xffff000101454400 dma_buf->priv ffff00010149b400 [ 15.255277] rockchip_gem_dumb_create weston obj: ffff00010759f800 handle: 3 [ 15.255298] drm_gem_prime_handle_to_dmabuf weston obj: ffff00010759f800 dma_buf: 0xffff0001030cbc00 handle: 3 [ 15.255317] drm_gem_prime_fd_to_handle weston obj: ffff0001037a3200 dma_buf: 0xffff0001030cbc00 dma_buf->priv ffff00010759f800 [ 15.316336] rockchip_gem_dumb_create weston obj: ffff00010759f000 handle: 4 [ 15.316360] drm_gem_prime_handle_to_dmabuf weston obj: ffff00010759f000 dma_buf: 0xffff0001030cba00 handle: 4 [ 15.316404] drm_gem_prime_fd_to_handle weston obj: ffff0001037a1000 dma_buf: 0xffff0001030cba00 dma_buf->priv ffff00010759f000 [ 20.209006] rockchip_gem_dumb_create weston obj: ffff000106584000 handle: 1 [ 20.209031] drm_gem_prime_handle_to_dmabuf weston obj: ffff000106584000 dma_buf: 0xffff0001017a7600 handle: 1 [ 20.209049] drm_gem_prime_fd_to_handle weston obj: ffff00010182fc00 dma_buf: 0xffff0001017a7600 dma_buf->priv ffff000106584000 [ 20.228008] rockchip_gem_dumb_create weston obj: ffff000106584c00 handle: 2 [ 20.228029] drm_gem_prime_handle_to_dmabuf weston obj: ffff000106584c00 dma_buf: 0xffff0001017a7a00 handle: 2 [ 20.228081] drm_gem_prime_fd_to_handle weston obj: ffff000105eec000 dma_buf: 0xffff0001017a7a00 dma_buf->priv ffff000106584c00[ 27.073265] drm_gem_prime_handle_to_dmabuf glmark2-es2-way obj: ffff0001035f0a00 dma_buf: 0xffff00010a24d500 handle: 10 [ 27.073377] drm_gem_prime_fd_to_handle weston obj: ffff0001035f0a00 dma_buf: 0xffff00010a24d500 dma_buf->priv ffff0001035f0a00 [ 27.073718] drm_gem_prime_fd_to_handle weston obj: ffff00010759e000 dma_buf: 0xffff00010a24d500 dma_buf->priv ffff0001035f0a00[ 27.075363] drm_gem_handle_delete glmark2-es2-way obj: ffff0001035f0a00 handle: 10 [ 27.075718] drm_gem_prime_handle_to_dmabuf glmark2-es2-way obj: ffff00012946e000 dma_buf: 0xffff00010a24d100 handle: 25 [ 27.075799] drm_gem_prime_fd_to_handle weston obj: ffff00012946e000 dma_buf: 0xffff00010a24d100 dma_buf->priv ffff00012946e000 [ 27.076613] drm_gem_prime_fd_to_handle weston obj: ffff00010759dc00 dma_buf: 0xffff00010a24d100 dma_buf->priv ffff00012946e000 [ 27.079195] drm_gem_prime_handle_to_dmabuf glmark2-es2-way obj: ffff00012946e400 dma_buf: 0xffff00010a24d000 handle: 10 [ 27.079262] drm_gem_handle_delete weston obj: ffff00010759e000 handle: 5 [ 27.079271] CPU: 7 UID: 0 PID: 308 Comm: weston Not tainted 6.15.0-rc1+ #613 PREEMPT [ 27.079276] Hardware name: Radxa ROCK 5B (DT) [ 27.079278] Call trace: [ 27.079280] show_stack+0x18/0x24 (C) [ 27.079289] dump_stack_lvl+0x74/0x8c [ 27.079296] dump_stack+0x18/0x24 [ 27.079301] drm_gem_object_handle_put_unlocked+0x58/0x128 [ 27.079309] drm_gem_handle_delete+0xbc/0x110 [ 27.079314] drm_mode_destroy_dumb_ioctl+0x24/0x3c [ 27.079318] drm_ioctl_kernel+0xc0/0x12c [ 27.079324] drm_ioctl+0x25c/0x55c [ 27.079330] __arm64_sys_ioctl+0xb4/0xe8 [ 27.079335] invoke_syscall+0x48/0x10c [ 27.079340] el0_svc_common.constprop.0+0x40/0xe0 [ 27.079346] do_el0_svc+0x1c/0x28 [ 27.079351] el0_svc+0x30/0xcc [ 27.079355] el0t_64_sync_handler+0x10c/0x138 [ 27.079358] el0t_64_sync+0x198/0x19c [ 27.079362] drm_gem_object_exported_dma_buf_free weston obj: ffff00010759e000 dma_buf: 0xffff00010a24d500 dma_buf->priv: ffff0001035f0a00 [ 27.085797] rockchip_gem_free_object weston obj: ffff00010759e000 import dma_buf: 0x0000000000000000 dma_buf->priv: 0000000000000000 [ 27.086093] drm_gem_handle_delete weston obj: ffff0001035f0a00 handle: 35 [ 27.086099] CPU: 7 UID: 0 PID: 308 Comm: weston Not tainted 6.15.0-rc1+ #613 PREEMPT [ 27.086102] Hardware name: Radxa ROCK 5B (DT)Quoted 16 lines
Best regards
ThomasQuoted 5 lines
Quoted 5 lines
drivers/gpu/drm/rockchip/rockchip_drm_gem.c +0
-0if (private->domain) {rockchip_gem_iommu_unmap (rk_obj); }else {Signature · 1 line
2.49.0Signature · 7 lines
-- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstrasse 146, 90461 Nuernberg, Germany GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman HRB 36809 (AG Nuernberg)
Signature · 7 lines
-- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstrasse 146, 90461 Nuernberg, Germany GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman HRB 36809 (AG Nuernberg)
From 7c46e63274d3199ebedeac3f1eb540a2bb6b9cfb Mon Sep 17 00:00:00 2001
From: Thomas Zimmermann <[email protected]>
Date: Tue, 15 Apr 2025 09:42:55 +0200
Subject: [PATCH] drm/gem: Internally test import_attach for imported objects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Test struct drm_gem_object.import_attach to detect imported objects during cleanup. At that point, the imported DMA buffer might have already been released and the dma_buf field is NULL. The object's free callback then does a cleanup as for native objects.
Happens for calls to drm_mode_destroy_dumb_ioctl() that eventually clear the dma_buf field in drm_gem_object_exported_dma_buf_free().
--- include/drm/drm_gem.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
include/drm/drm_gem.h +7 -1
@@ -589,7 +589,13 @@ static inline bool drm_gem_object_is_shared_for_memory_stats(struct drm_gem_objestatic inline bool drm_gem_is_imported (const struct drm_gem_object *obj) {/* The dma-buf's priv field points to the original GEM object. */ -return obj->dma_buf && (obj->dma_buf->priv != obj); +return (obj->dma_buf && (obj->dma_buf->priv != obj)) || +/* +* TODO: During object release, the dma-buf might already +* be gone. For now keep testing import_attach, but +* this should be removed at some point. +*/ + obj->import_attach; }#ifdef CONFIG_LOCKDEP
Signature · 1 line
2.49.0
Andy Yan
maintainerHi,
Quoted 43 lines · 在 2025-04-15 15:51:31,"Thomas Zimmermann" <[email protected]> 写道:
Hi
Am 15.04.25 um 09:15 schrieb Andy Yan:
Quoted 40 lines
Hi Thomas,
Quoted 37 lines · 在 2025-04-15 14:54:21,"Thomas Zimmermann" <[email protected]> 写道:
Hi
Am 15.04.25 um 06:00 schrieb Andy Yan:
Quoted 24 lines
Hi Thomas,
Quoted 21 lines · Thomas Zimmermann
Instead of testing
import_attachfor imported GEM buffers, invokedrm_gem_is_imported()to do the test. The helper tests thedma_bufitself whileimport_attachis just an artifact of the import. Prepares to makeimport_attachoptional.Signed-off-by Thomas Zimmermann <[email protected]>Cc Sandy Huang <[email protected]>Cc "Heiko Stübner" <[email protected]>Cc Andy Yan <[email protected]>---
drivers/gpu/drm/rockchip/rockchip_drm_gem.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/rockchip/rockchip_drm_gem.c +0
-0@@ -332,7 +332,7 @@ void rockchip_gem_free_object(struct drm_gem_object *obj)struct rockchip_drm_private *private = drm->dev_private;struct rockchip_gem_object *rk_obj =to_rockchip_obj (obj);Quoted 6 lines
drivers/gpu/drm/rockchip/rockchip_drm_gem.c void rockchip_gem_free_object(struct drm_gem_object *obj) · line 335
Quoted 2 lines
drivers/gpu/drm/rockchip/rockchip_drm_gem.c +1
-1-if (obj->import_attach) { +if (drm_gem_is_imported (obj)) {After applying this patch, when I tested glmark2-es2-wayland under Weston, the weston would freeze. It seems it goto the else path.
I'm still conducting further analysis to figure out the exact cause.
Thanks for testing. We test if
obj->dma_bufis set and refers back to obj. One of these fields has likely been cleared already to NULL during the object cleanup. Other drivers also calldrm_gem_is_imported()in their object cleanup and I've not heard about any regressions.
Quoted 7 lines
Quoted 4 lines
From my test, it seems that a dumb buffer may export then import:
and theobj->dma_bufwill be cleared at drm_mode_destroy_dumb_ioctl-->drm_gem_handle_deletethen test with
obj->dma_buf&& (obj->dma_buf->priv!= obj) will be false.Here's a patch for the problem. Could you please test and report back with the results? Thanks a lot.
Yes, this patch can make patch 05/11 work right.
Quoted 89 lines
Best regards
ThomasQuoted 74 lines
[ 12.028941] [drm] Initialized panthor 1.3.0 for fb000000.gpu on minor 1 [ 14.606114] rockchip_gem_dumb_create weston obj: ffff00010149b000 handle: 1 [ 14.606170] drm_gem_prime_handle_to_dmabuf weston obj: ffff00010149b000 dma_buf: 0xffff000101454800 handle: 1 [ 14.606217] drm_gem_prime_fd_to_handle weston obj: ffff0001023cdc00 dma_buf: 0xffff000101454800 dma_buf->priv ffff00010149b000 [ 14.685517] rockchip_gem_dumb_create weston obj: ffff00010149b400 handle: 2 [ 14.685569] drm_gem_prime_handle_to_dmabuf weston obj: ffff00010149b400 dma_buf: 0xffff000101454400 handle: 2 [ 14.685691] drm_gem_prime_fd_to_handle weston obj: ffff0001023ce600 dma_buf: 0xffff000101454400 dma_buf->priv ffff00010149b400 [ 15.255277] rockchip_gem_dumb_create weston obj: ffff00010759f800 handle: 3 [ 15.255298] drm_gem_prime_handle_to_dmabuf weston obj: ffff00010759f800 dma_buf: 0xffff0001030cbc00 handle: 3 [ 15.255317] drm_gem_prime_fd_to_handle weston obj: ffff0001037a3200 dma_buf: 0xffff0001030cbc00 dma_buf->priv ffff00010759f800 [ 15.316336] rockchip_gem_dumb_create weston obj: ffff00010759f000 handle: 4 [ 15.316360] drm_gem_prime_handle_to_dmabuf weston obj: ffff00010759f000 dma_buf: 0xffff0001030cba00 handle: 4 [ 15.316404] drm_gem_prime_fd_to_handle weston obj: ffff0001037a1000 dma_buf: 0xffff0001030cba00 dma_buf->priv ffff00010759f000 [ 20.209006] rockchip_gem_dumb_create weston obj: ffff000106584000 handle: 1 [ 20.209031] drm_gem_prime_handle_to_dmabuf weston obj: ffff000106584000 dma_buf: 0xffff0001017a7600 handle: 1 [ 20.209049] drm_gem_prime_fd_to_handle weston obj: ffff00010182fc00 dma_buf: 0xffff0001017a7600 dma_buf->priv ffff000106584000 [ 20.228008] rockchip_gem_dumb_create weston obj: ffff000106584c00 handle: 2 [ 20.228029] drm_gem_prime_handle_to_dmabuf weston obj: ffff000106584c00 dma_buf: 0xffff0001017a7a00 handle: 2 [ 20.228081] drm_gem_prime_fd_to_handle weston obj: ffff000105eec000 dma_buf: 0xffff0001017a7a00 dma_buf->priv ffff000106584c00[ 27.073265] drm_gem_prime_handle_to_dmabuf glmark2-es2-way obj: ffff0001035f0a00 dma_buf: 0xffff00010a24d500 handle: 10 [ 27.073377] drm_gem_prime_fd_to_handle weston obj: ffff0001035f0a00 dma_buf: 0xffff00010a24d500 dma_buf->priv ffff0001035f0a00 [ 27.073718] drm_gem_prime_fd_to_handle weston obj: ffff00010759e000 dma_buf: 0xffff00010a24d500 dma_buf->priv ffff0001035f0a00[ 27.075363] drm_gem_handle_delete glmark2-es2-way obj: ffff0001035f0a00 handle: 10 [ 27.075718] drm_gem_prime_handle_to_dmabuf glmark2-es2-way obj: ffff00012946e000 dma_buf: 0xffff00010a24d100 handle: 25 [ 27.075799] drm_gem_prime_fd_to_handle weston obj: ffff00012946e000 dma_buf: 0xffff00010a24d100 dma_buf->priv ffff00012946e000 [ 27.076613] drm_gem_prime_fd_to_handle weston obj: ffff00010759dc00 dma_buf: 0xffff00010a24d100 dma_buf->priv ffff00012946e000 [ 27.079195] drm_gem_prime_handle_to_dmabuf glmark2-es2-way obj: ffff00012946e400 dma_buf: 0xffff00010a24d000 handle: 10 [ 27.079262] drm_gem_handle_delete weston obj: ffff00010759e000 handle: 5 [ 27.079271] CPU: 7 UID: 0 PID: 308 Comm: weston Not tainted 6.15.0-rc1+ #613 PREEMPT [ 27.079276] Hardware name: Radxa ROCK 5B (DT) [ 27.079278] Call trace: [ 27.079280] show_stack+0x18/0x24 (C) [ 27.079289] dump_stack_lvl+0x74/0x8c [ 27.079296] dump_stack+0x18/0x24 [ 27.079301] drm_gem_object_handle_put_unlocked+0x58/0x128 [ 27.079309] drm_gem_handle_delete+0xbc/0x110 [ 27.079314] drm_mode_destroy_dumb_ioctl+0x24/0x3c [ 27.079318] drm_ioctl_kernel+0xc0/0x12c [ 27.079324] drm_ioctl+0x25c/0x55c [ 27.079330] __arm64_sys_ioctl+0xb4/0xe8 [ 27.079335] invoke_syscall+0x48/0x10c [ 27.079340] el0_svc_common.constprop.0+0x40/0xe0 [ 27.079346] do_el0_svc+0x1c/0x28 [ 27.079351] el0_svc+0x30/0xcc [ 27.079355] el0t_64_sync_handler+0x10c/0x138 [ 27.079358] el0t_64_sync+0x198/0x19c [ 27.079362] drm_gem_object_exported_dma_buf_free weston obj: ffff00010759e000 dma_buf: 0xffff00010a24d500 dma_buf->priv: ffff0001035f0a00 [ 27.085797] rockchip_gem_free_object weston obj: ffff00010759e000 import dma_buf: 0x0000000000000000 dma_buf->priv: 0000000000000000 [ 27.086093] drm_gem_handle_delete weston obj: ffff0001035f0a00 handle: 35 [ 27.086099] CPU: 7 UID: 0 PID: 308 Comm: weston Not tainted 6.15.0-rc1+ #613 PREEMPT [ 27.086102] Hardware name: Radxa ROCK 5B (DT)Quoted 16 lines
Best regards
ThomasQuoted 5 lines
Quoted 5 lines
drivers/gpu/drm/rockchip/rockchip_drm_gem.c +0
-0if (private->domain) {rockchip_gem_iommu_unmap (rk_obj); }else {Signature · 1 line
2.49.0Signature · 7 lines
-- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstrasse 146, 90461 Nuernberg, Germany GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman HRB 36809 (AG Nuernberg)Signature · 7 lines
-- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstrasse 146, 90461 Nuernberg, Germany GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman HRB 36809 (AG Nuernberg)
Thomas Zimmermann
maintainerHi
Am 15.04.25 um 10:46 schrieb Andy Yan:
Quoted 47 lines
Hi,
Quoted 43 lines · 在 2025-04-15 15:51:31,"Thomas Zimmermann" <[email protected]> 写道:
Hi
Am 15.04.25 um 09:15 schrieb Andy Yan:
Quoted 40 lines
Hi Thomas,
Quoted 37 lines · 在 2025-04-15 14:54:21,"Thomas Zimmermann" <[email protected]> 写道:
Hi
Am 15.04.25 um 06:00 schrieb Andy Yan:
Quoted 24 lines
Hi Thomas,
Quoted 21 lines · Thomas Zimmermann
Instead of testing
import_attachfor imported GEM buffers, invokedrm_gem_is_imported()to do the test. The helper tests thedma_bufitself whileimport_attachis just an artifact of the import. Prepares to makeimport_attachoptional.Signed-off-by Thomas Zimmermann <[email protected]>Cc Sandy Huang <[email protected]>Cc "Heiko Stübner" <[email protected]>Cc Andy Yan <[email protected]>---
drivers/gpu/drm/rockchip/rockchip_drm_gem.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/rockchip/rockchip_drm_gem.c +0
-0@@ -332,7 +332,7 @@ void rockchip_gem_free_object(struct drm_gem_object *obj)struct rockchip_drm_private *private = drm->dev_private;struct rockchip_gem_object *rk_obj =to_rockchip_obj (obj);Quoted 6 lines
drivers/gpu/drm/rockchip/rockchip_drm_gem.c void rockchip_gem_free_object(struct drm_gem_object *obj) · line 335
Quoted 2 lines
drivers/gpu/drm/rockchip/rockchip_drm_gem.c +1
-1-if (obj->import_attach) { +if (drm_gem_is_imported (obj)) {After applying this patch, when I tested glmark2-es2-wayland under Weston, the weston would freeze. It seems it goto the else path.
I'm still conducting further analysis to figure out the exact cause.
Thanks for testing. We test if
obj->dma_bufis set and refers back to obj. One of these fields has likely been cleared already to NULL during the object cleanup. Other drivers also calldrm_gem_is_imported()in their object cleanup and I've not heard about any regressions.
Quoted 7 lines
Quoted 6 lines
Quoted 4 lines
From my test, it seems that a dumb buffer may export then import:
and theobj->dma_bufwill be cleared at drm_mode_destroy_dumb_ioctl-->drm_gem_handle_deletethen test with
obj->dma_buf&& (obj->dma_buf->priv!= obj) will be false.Here's a patch for the problem. Could you please test and report back with the results? Thanks a lot.
Yes, this patch can make patch 05/11 work right.
Thanks for testing. I've send the fix out for review.
Best regards
Thomas
Quoted 88 lines
Quoted 88 lines
Best regards
ThomasQuoted 73 lines
[ 12.028941] [drm] Initialized panthor 1.3.0 for fb000000.gpu on minor 1 [ 14.606114] rockchip_gem_dumb_create weston obj: ffff00010149b000 handle: 1 [ 14.606170] drm_gem_prime_handle_to_dmabuf weston obj: ffff00010149b000 dma_buf: 0xffff000101454800 handle: 1 [ 14.606217] drm_gem_prime_fd_to_handle weston obj: ffff0001023cdc00 dma_buf: 0xffff000101454800 dma_buf->priv ffff00010149b000 [ 14.685517] rockchip_gem_dumb_create weston obj: ffff00010149b400 handle: 2 [ 14.685569] drm_gem_prime_handle_to_dmabuf weston obj: ffff00010149b400 dma_buf: 0xffff000101454400 handle: 2 [ 14.685691] drm_gem_prime_fd_to_handle weston obj: ffff0001023ce600 dma_buf: 0xffff000101454400 dma_buf->priv ffff00010149b400 [ 15.255277] rockchip_gem_dumb_create weston obj: ffff00010759f800 handle: 3 [ 15.255298] drm_gem_prime_handle_to_dmabuf weston obj: ffff00010759f800 dma_buf: 0xffff0001030cbc00 handle: 3 [ 15.255317] drm_gem_prime_fd_to_handle weston obj: ffff0001037a3200 dma_buf: 0xffff0001030cbc00 dma_buf->priv ffff00010759f800 [ 15.316336] rockchip_gem_dumb_create weston obj: ffff00010759f000 handle: 4 [ 15.316360] drm_gem_prime_handle_to_dmabuf weston obj: ffff00010759f000 dma_buf: 0xffff0001030cba00 handle: 4 [ 15.316404] drm_gem_prime_fd_to_handle weston obj: ffff0001037a1000 dma_buf: 0xffff0001030cba00 dma_buf->priv ffff00010759f000 [ 20.209006] rockchip_gem_dumb_create weston obj: ffff000106584000 handle: 1 [ 20.209031] drm_gem_prime_handle_to_dmabuf weston obj: ffff000106584000 dma_buf: 0xffff0001017a7600 handle: 1 [ 20.209049] drm_gem_prime_fd_to_handle weston obj: ffff00010182fc00 dma_buf: 0xffff0001017a7600 dma_buf->priv ffff000106584000 [ 20.228008] rockchip_gem_dumb_create weston obj: ffff000106584c00 handle: 2 [ 20.228029] drm_gem_prime_handle_to_dmabuf weston obj: ffff000106584c00 dma_buf: 0xffff0001017a7a00 handle: 2 [ 20.228081] drm_gem_prime_fd_to_handle weston obj: ffff000105eec000 dma_buf: 0xffff0001017a7a00 dma_buf->priv ffff000106584c00[ 27.073265] drm_gem_prime_handle_to_dmabuf glmark2-es2-way obj: ffff0001035f0a00 dma_buf: 0xffff00010a24d500 handle: 10 [ 27.073377] drm_gem_prime_fd_to_handle weston obj: ffff0001035f0a00 dma_buf: 0xffff00010a24d500 dma_buf->priv ffff0001035f0a00 [ 27.073718] drm_gem_prime_fd_to_handle weston obj: ffff00010759e000 dma_buf: 0xffff00010a24d500 dma_buf->priv ffff0001035f0a00[ 27.075363] drm_gem_handle_delete glmark2-es2-way obj: ffff0001035f0a00 handle: 10 [ 27.075718] drm_gem_prime_handle_to_dmabuf glmark2-es2-way obj: ffff00012946e000 dma_buf: 0xffff00010a24d100 handle: 25 [ 27.075799] drm_gem_prime_fd_to_handle weston obj: ffff00012946e000 dma_buf: 0xffff00010a24d100 dma_buf->priv ffff00012946e000 [ 27.076613] drm_gem_prime_fd_to_handle weston obj: ffff00010759dc00 dma_buf: 0xffff00010a24d100 dma_buf->priv ffff00012946e000 [ 27.079195] drm_gem_prime_handle_to_dmabuf glmark2-es2-way obj: ffff00012946e400 dma_buf: 0xffff00010a24d000 handle: 10 [ 27.079262] drm_gem_handle_delete weston obj: ffff00010759e000 handle: 5 [ 27.079271] CPU: 7 UID: 0 PID: 308 Comm: weston Not tainted 6.15.0-rc1+ #613 PREEMPT [ 27.079276] Hardware name: Radxa ROCK 5B (DT) [ 27.079278] Call trace: [ 27.079280] show_stack+0x18/0x24 (C) [ 27.079289] dump_stack_lvl+0x74/0x8c [ 27.079296] dump_stack+0x18/0x24 [ 27.079301] drm_gem_object_handle_put_unlocked+0x58/0x128 [ 27.079309] drm_gem_handle_delete+0xbc/0x110 [ 27.079314] drm_mode_destroy_dumb_ioctl+0x24/0x3c [ 27.079318] drm_ioctl_kernel+0xc0/0x12c [ 27.079324] drm_ioctl+0x25c/0x55c [ 27.079330] __arm64_sys_ioctl+0xb4/0xe8 [ 27.079335] invoke_syscall+0x48/0x10c [ 27.079340] el0_svc_common.constprop.0+0x40/0xe0 [ 27.079346] do_el0_svc+0x1c/0x28 [ 27.079351] el0_svc+0x30/0xcc [ 27.079355] el0t_64_sync_handler+0x10c/0x138 [ 27.079358] el0t_64_sync+0x198/0x19c [ 27.079362] drm_gem_object_exported_dma_buf_free weston obj: ffff00010759e000 dma_buf: 0xffff00010a24d500 dma_buf->priv: ffff0001035f0a00 [ 27.085797] rockchip_gem_free_object weston obj: ffff00010759e000 import dma_buf: 0x0000000000000000 dma_buf->priv: 0000000000000000 [ 27.086093] drm_gem_handle_delete weston obj: ffff0001035f0a00 handle: 35 [ 27.086099] CPU: 7 UID: 0 PID: 308 Comm: weston Not tainted 6.15.0-rc1+ #613 PREEMPT [ 27.086102] Hardware name: Radxa ROCK 5B (DT)Quoted 16 lines
Best regards
ThomasQuoted 5 lines
Quoted 5 lines
drivers/gpu/drm/rockchip/rockchip_drm_gem.c +0
-0if (private->domain) {rockchip_gem_iommu_unmap (rk_obj); }else {Signature · 1 line
2.49.0Signature · 7 lines
-- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstrasse 146, 90461 Nuernberg, Germany GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman HRB 36809 (AG Nuernberg)Signature · 7 lines
-- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstrasse 146, 90461 Nuernberg, Germany GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman HRB 36809 (AG Nuernberg)
Signature · 7 lines
-- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstrasse 146, 90461 Nuernberg, Germany GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman HRB 36809 (AG Nuernberg)