]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/colorop: Add destroy helper for colorop objects
authorChaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Mon, 2 Feb 2026 09:41:54 +0000 (15:11 +0530)
committerSuraj Kandpal <suraj.kandpal@intel.com>
Tue, 10 Feb 2026 05:33:00 +0000 (11:03 +0530)
Add a helper that performs common cleanup and frees the
associated object. This can be used by drivers if they do not
require any driver-specific teardown.

v2:
- Add function documentation only before definition (Jani)

Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Reviewed-by: Alex Hung <alex.hung@amd.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://patch.msgid.link/20260202094202.2871478-2-chaitanya.kumar.borah@intel.com
drivers/gpu/drm/drm_colorop.c
include/drm/drm_colorop.h

index 44eb823585d2e88b1e606c3b435ba30a88d4cfcb..c226870fde9eaf04b16a04dc3be3ba3b19e61111 100644 (file)
@@ -178,6 +178,21 @@ void drm_colorop_cleanup(struct drm_colorop *colorop)
 }
 EXPORT_SYMBOL(drm_colorop_cleanup);
 
+/**
+ * drm_colorop_destroy - destroy colorop
+ * @colorop: drm colorop
+ *
+ * Destroys @colorop by performing common DRM cleanup and freeing the
+ * colorop object. This can be used by drivers if they do not
+ * require any driver-specific teardown.
+ */
+void drm_colorop_destroy(struct drm_colorop *colorop)
+{
+       drm_colorop_cleanup(colorop);
+       kfree(colorop);
+}
+EXPORT_SYMBOL(drm_colorop_destroy);
+
 /**
  * drm_colorop_pipeline_destroy - Helper for color pipeline destruction
  *
index a3a32f9f918c73cc2ea9c6d6967d92eca4eff8b8..3056f3f02597b54340c067ef154cbced161b4d8d 100644 (file)
@@ -420,6 +420,8 @@ void drm_colorop_atomic_destroy_state(struct drm_colorop *colorop,
  */
 void drm_colorop_reset(struct drm_colorop *colorop);
 
+void drm_colorop_destroy(struct drm_colorop *colorop);
+
 /**
  * drm_colorop_index - find the index of a registered colorop
  * @colorop: colorop to find index for