Signed-off-by: Harry Wentland <harry.wentl...@amd.com>
Cc: Ville Syrjala <ville.syrj...@linux.intel.com>
Cc: Pekka Paalanen <pekka.paala...@collabora.com>
Cc: Simon Ser <cont...@emersion.fr>
Cc: Harry Wentland <harry.wentl...@amd.com>
Cc: Melissa Wen <m...@igalia.com>
Cc: Jonas Ådahl <jad...@redhat.com>
Cc: Sebastian Wick <sebastian.w...@redhat.com>
Cc: Shashank Sharma <shashank.sha...@amd.com>
Cc: Alexander Goins <ago...@nvidia.com>
Cc: Joshua Ashton <jos...@froggi.es>
Cc: Michel Dänzer <mdaen...@redhat.com>
Cc: Aleix Pol <aleix...@kde.org>
Cc: Xaver Hugl <xaver.h...@gmail.com>
Cc: Victoria Brekenfeld <victo...@system76.com>
Cc: Sima <dan...@ffwll.ch>
Cc: Uma Shankar <uma.shan...@intel.com>
Cc: Naseer Ahmed <quic_nas...@quicinc.com>
Cc: Christopher Braga <quic_cbr...@quicinc.com>
Cc: Abhinav Kumar <quic_abhin...@quicinc.com>
Cc: Arthur Grillo <arthurgri...@riseup.net>
Cc: Hector Martin <mar...@marcan.st>
Cc: Liviu Dudau <liviu.du...@arm.com>
Cc: Sasha McIntosh <sashamcint...@google.com>
---
 drivers/gpu/drm/drm_atomic.c | 29 +++++++++++++++++++++++++++++
 include/drm/drm_colorop.h    |  5 +++++
 2 files changed, 34 insertions(+)

diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index 524bec520287..15bd18c9e2be 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -792,6 +792,19 @@ static int drm_atomic_plane_check(const struct 
drm_plane_state *old_plane_state,
        return 0;
 }
 
+
+
+static void drm_atomic_colorop_print_state(struct drm_printer *p,
+               const struct drm_colorop_state *state)
+{
+       struct drm_colorop *colorop = state->colorop;
+
+       drm_printf(p, "colorop[%u]:\n", colorop->base.id);
+       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));
+}
+
 static void drm_atomic_plane_print_state(struct drm_printer *p,
                const struct drm_plane_state *state)
 {
@@ -812,6 +825,13 @@ static void drm_atomic_plane_print_state(struct 
drm_printer *p,
                   drm_get_color_encoding_name(state->color_encoding));
        drm_printf(p, "\tcolor-range=%s\n",
                   drm_get_color_range_name(state->color_range));
+#if 0
+       drm_printf(p, "\tcolor-pipeline=%s\n",
+                  drm_get_color_pipeline_name(state->color_pipeline));
+#else
+       drm_printf(p, "\tcolor-pipeline=%d\n",
+                  state->color_pipeline ? state->color_pipeline->base.id : 0);
+#endif
 
        if (plane->funcs->atomic_print_state)
                plane->funcs->atomic_print_state(p, state);
@@ -1848,6 +1868,7 @@ static void __drm_state_dump(struct drm_device *dev, 
struct drm_printer *p,
                             bool take_locks)
 {
        struct drm_mode_config *config = &dev->mode_config;
+       struct drm_colorop *colorop;
        struct drm_plane *plane;
        struct drm_crtc *crtc;
        struct drm_connector *connector;
@@ -1856,6 +1877,14 @@ static void __drm_state_dump(struct drm_device *dev, 
struct drm_printer *p,
        if (!drm_drv_uses_atomic_modeset(dev))
                return;
 
+       list_for_each_entry(colorop, &config->colorop_list, head) {
+               if (take_locks)
+                       drm_modeset_lock(&colorop->plane->mutex, NULL);
+               drm_atomic_colorop_print_state(p, colorop->state);
+               if (take_locks)
+                       drm_modeset_unlock(&colorop->plane->mutex);
+       }
+
        list_for_each_entry(plane, &config->plane_list, head) {
                if (take_locks)
                        drm_modeset_lock(&plane->mutex, NULL);
diff --git a/include/drm/drm_colorop.h b/include/drm/drm_colorop.h
index 1ddd0e65fe36..622a671d2458 100644
--- a/include/drm/drm_colorop.h
+++ b/include/drm/drm_colorop.h
@@ -222,6 +222,11 @@ static inline unsigned int drm_colorop_index(const struct 
drm_colorop *colorop)
 #define drm_for_each_colorop(colorop, dev) \
        list_for_each_entry(colorop, &(dev)->mode_config.colorop_list, head)
 
+const char *drm_get_color_pipeline_name(struct drm_colorop *colorop);
+
+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);
 
 
-- 
2.42.0

Reply via email to