]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/xe/uc: Use managed bo for HuC and GSC objects
authorDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Thu, 15 Aug 2024 23:05:39 +0000 (16:05 -0700)
committerLucas De Marchi <lucas.demarchi@intel.com>
Fri, 16 Aug 2024 16:15:04 +0000 (09:15 -0700)
commit2e5d47fe7839298fa096970e184aac9bf82c3bd3
tree2b6528633322bc4e90782f518040c8a2b8b96c1a
parent3396900aa273903639a1792afa4d23dc09bec291
drm/xe/uc: Use managed bo for HuC and GSC objects

Drmm actions are not the right ones to clean up BOs and we should use
devm instead. However, we can also instead just allocate the objects
using the managed_bo function, which will internally register the
correct cleanup call and therefore allows us to simplify the code.

While at it, switch to drmm_kzalloc for the GSC proxy allocation to
further simplify the cleanup.

Cc: John Harrison <John.C.Harrison@Intel.com>
Cc: Alan Previn <alan.previn.teres.alexis@intel.com>
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240815230541.3828206-1-lucas.demarchi@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
drivers/gpu/drm/xe/xe_gsc.c
drivers/gpu/drm/xe/xe_gsc_proxy.c
drivers/gpu/drm/xe/xe_huc.c