diff mbox series

[03/28] drm: handle NULL next colorop in drm_colorop_set_next_property

Message ID 20240213064835.139464-4-uma.shankar@intel.com (mailing list archive)
State New, archived
Headers show
Series Plane Color Pipeline support for Intel platforms | expand

Commit Message

Shankar, Uma Feb. 13, 2024, 6:48 a.m. UTC
From: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>

In scenarios, where there is only one colorop in a colorpipeline,
the user of the helper drm_colorop_set_next_property could use it
to set the next colorop as NULL explicitly. Make the helper handle
this case.

Note: This patch can be squashed with following patch

("drm/colorop: Add NEXT property") [1]

[1] https://patchwork.freedesktop.org/patch/566588/?series=123446&rev=3

Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
---
 drivers/gpu/drm/drm_colorop.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_colorop.c b/drivers/gpu/drm/drm_colorop.c
index 67e6efc90803..462ffec42cdf 100644
--- a/drivers/gpu/drm/drm_colorop.c
+++ b/drivers/gpu/drm/drm_colorop.c
@@ -286,7 +286,7 @@  void drm_colorop_set_next_property(struct drm_colorop *colorop, struct drm_color
 
 	drm_object_property_set_value(&colorop->base,
 				      colorop->next_property,
-				      next->base.id);
+				      next ? next->base.id : 0);
 	colorop->next = next;
 }
 EXPORT_SYMBOL(drm_colorop_set_next_property);