drm/xe: Combine destroy_cb and destroy_work in xe_vma into union
authorMatthew Brost <matthew.brost@intel.com>
Thu, 20 Jul 2023 04:04:01 +0000 (21:04 -0700)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Thu, 21 Dec 2023 16:37:53 +0000 (11:37 -0500)
The callback kicks the worker thus mutually exclusive execution,
combining saves a bit of space in xe_vma.

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/xe_vm_types.h

index 4783a460d671fbbcf247b2781b0dc7f2e00c0607..b6657b6feb3c67689d98ce29f236c3d9430ada53 100644 (file)
@@ -61,11 +61,12 @@ struct xe_vma {
                struct list_head destroy;
        } combined_links;
 
-       /** @destroy_cb: callback to destroy VMA when unbind job is done */
-       struct dma_fence_cb destroy_cb;
-
-       /** @destroy_work: worker to destroy this BO */
-       struct work_struct destroy_work;
+       union {
+               /** @destroy_cb: callback to destroy VMA when unbind job is done */
+               struct dma_fence_cb destroy_cb;
+               /** @destroy_work: worker to destroy this BO */
+               struct work_struct destroy_work;
+       };
 
        /** @userptr: user pointer state */
        struct {