Signed-off-by: Harry Wentland <[email protected]>
Cc: Ville Syrjala <[email protected]>
Cc: Pekka Paalanen <[email protected]>
Cc: Simon Ser <[email protected]>
Cc: Harry Wentland <[email protected]>
Cc: Melissa Wen <[email protected]>
Cc: Jonas Ådahl <[email protected]>
Cc: Sebastian Wick <[email protected]>
Cc: Shashank Sharma <[email protected]>
Cc: Alexander Goins <[email protected]>
Cc: Joshua Ashton <[email protected]>
Cc: Michel Dänzer <[email protected]>
Cc: Aleix Pol <[email protected]>
Cc: Xaver Hugl <[email protected]>
Cc: Victoria Brekenfeld <[email protected]>
Cc: Sima <[email protected]>
Cc: Uma Shankar <[email protected]>
Cc: Naseer Ahmed <[email protected]>
Cc: Christopher Braga <[email protected]>
Cc: Abhinav Kumar <[email protected]>
Cc: Arthur Grillo <[email protected]>
Cc: Hector Martin <[email protected]>
Cc: Liviu Dudau <[email protected]>
Cc: Sasha McIntosh <[email protected]>
---
 drivers/gpu/drm/drm_atomic.c  |  1 +
 drivers/gpu/drm/drm_colorop.c | 42 +++++++++++++++++++++++++++++++++++
 include/drm/drm_colorop.h     |  2 ++
 3 files changed, 45 insertions(+)

diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index 781bd3aa1849..cfe9199a15d2 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -803,6 +803,7 @@ static void drm_atomic_colorop_print_state(struct 
drm_printer *p,
        drm_printf(p, "\ttype=%s\n", drm_get_colorop_type_name(colorop->type));
        drm_printf(p, "\tbypass=%u\n", state->bypass);
        drm_printf(p, "\tcurve_1d_type=%s\n", 
drm_get_colorop_curve_1d_type_name(state->curve_1d_type));
+       drm_printf(p, "\tnext=%d\n", drm_colorop_get_next_property(colorop));
 }
 
 static void drm_atomic_plane_print_state(struct drm_printer *p,
diff --git a/drivers/gpu/drm/drm_colorop.c b/drivers/gpu/drm/drm_colorop.c
index 1afd5fbe8776..ff6f938cc28c 100644
--- a/drivers/gpu/drm/drm_colorop.c
+++ b/drivers/gpu/drm/drm_colorop.c
@@ -340,3 +340,45 @@ void drm_colorop_set_next_property(struct drm_colorop 
*colorop, struct drm_color
                                      next->base.id);
 }
 EXPORT_SYMBOL(drm_colorop_set_next_property);
+
+/**
+ * drm_colorop_set_next_property - gets the next colorop ID
+ * @colorop: drm colorop
+ *
+ * Returns:
+ * The DRM object ID of the next colorop
+ */
+uint32_t drm_colorop_get_next_property(struct drm_colorop *colorop)
+{
+       uint64_t next_id = 0;
+
+       if (!colorop->next_property)
+               return 0;
+
+       drm_object_property_get_value(&colorop->base,
+                                     colorop->next_property,
+                                     &next_id);
+
+       return (uint32_t) next_id;
+}
+EXPORT_SYMBOL(drm_colorop_get_next_property);
+
+
+/**
+ * drm_colorop_set_next_property - gets the next colorop ID
+ * @colorop: drm colorop
+ *
+ * Returns:
+ * The DRM object ID of the next colorop
+ */
+struct drm_colorop *drm_colorop_get_next(struct drm_colorop *colorop)
+{
+       uint64_t next_id = drm_colorop_get_next_property(colorop);
+
+       if (!next_id)
+               return NULL;
+
+       return drm_colorop_find(colorop->dev, NULL, next_id);
+
+}
+EXPORT_SYMBOL(drm_colorop_get_next);
\ No newline at end of file
diff --git a/include/drm/drm_colorop.h b/include/drm/drm_colorop.h
index 622a671d2458..2ba506a0ea4d 100644
--- a/include/drm/drm_colorop.h
+++ b/include/drm/drm_colorop.h
@@ -228,6 +228,8 @@ const char *drm_get_colorop_type_name(enum drm_colorop_type 
type);
 const char *drm_get_colorop_curve_1d_type_name(enum drm_colorop_curve_1d_type 
type);
 
 void drm_colorop_set_next_property(struct drm_colorop *colorop, struct 
drm_colorop *next);
+uint32_t drm_colorop_get_next_property(struct drm_colorop *colorop);
+struct drm_colorop *drm_colorop_get_next(struct drm_colorop *colorop);
 
 
 #endif /* __DRM_COLOROP_H__ */
-- 
2.42.0

Reply via email to