[PATCH v2 0/2] New force-wake guard class

Michal Wajdeczko michal.wajdeczko at intel.com
Mon Nov 18 18:45:09 UTC 2024


There is support for 'classes' with constructor and destructor
semantics that can be used for any scope-based resource management,
like device force-wake management.

This should allow us to use:

	CLASS(xe_fw, var)(fw, XE_FORCEWAKE_ALL);
or
	guard(xe_fw)(fw, XE_FW_GT);
or
	scoped_guard(xe_fw, fw, XE_FW_GT)
		foo();

without any concern of leaking the force-wake references.

v1: https://patchwork.freedesktop.org/series/134958/
v2: rebased

Cc: Rodrigo Vivi <rodrigo.vivi at intel.com>
Cc: Lucas De Marchi <lucas.demarchi at intel.com>
Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray at intel.com>

Michal Wajdeczko (2):
  drm/xe: Introduce force-wake guard class
  drm/xe: Use new force-wake guard class in xe_mocs.c

 drivers/gpu/drm/xe/xe_force_wake.h       | 12 ++++++++++++
 drivers/gpu/drm/xe/xe_force_wake_types.h | 10 ++++++++++
 drivers/gpu/drm/xe/xe_mocs.c             | 10 +++-------
 3 files changed, 25 insertions(+), 7 deletions(-)

-- 
2.43.0



More information about the Intel-xe mailing list