Re: [RESEND PATCH v6 13/14] drm/atomic: Use debug category printer for atomic state printer

2021-09-17 Thread abhinavk

On 2021-07-21 10:55, Sean Paul wrote:

From: Sean Paul 

The atomic state is printed if the DRM_UT_STATE is active, but it's
printed at INFO level. This patch converts it to use the debug
category printer so:

a- it's consistent with other DRM_UT_STATE logging
b- it's properly routed through drm_trace when introduced

Signed-off-by: Sean Paul 

Reviewed-by: Abhinav Kumar 


Changes in v6:
-Added to the set
---
 drivers/gpu/drm/drm_atomic_uapi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_atomic_uapi.c
b/drivers/gpu/drm/drm_atomic_uapi.c
index 7e48d40600ff..7615ded60195 100644
--- a/drivers/gpu/drm/drm_atomic_uapi.c
+++ b/drivers/gpu/drm/drm_atomic_uapi.c
@@ -1322,7 +1322,7 @@ int drm_mode_atomic_ioctl(struct drm_device *dev,
struct drm_out_fence_state *fence_state;
int ret = 0;
unsigned int i, j, num_fences;
-   struct drm_printer p = drm_info_printer(dev->dev);
+   struct drm_printer p = drm_debug_category_printer(DRM_UT_STATE,
"commit_state");

/* disallow for drivers not supporting atomic: */
if (!drm_core_check_feature(dev, DRIVER_ATOMIC))


[RESEND PATCH v6 13/14] drm/atomic: Use debug category printer for atomic state printer

2021-07-21 Thread Sean Paul
From: Sean Paul 

The atomic state is printed if the DRM_UT_STATE is active, but it's
printed at INFO level. This patch converts it to use the debug
category printer so:

a- it's consistent with other DRM_UT_STATE logging
b- it's properly routed through drm_trace when introduced

Signed-off-by: Sean Paul 

Changes in v6:
-Added to the set
---
 drivers/gpu/drm/drm_atomic_uapi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_atomic_uapi.c 
b/drivers/gpu/drm/drm_atomic_uapi.c
index 7e48d40600ff..7615ded60195 100644
--- a/drivers/gpu/drm/drm_atomic_uapi.c
+++ b/drivers/gpu/drm/drm_atomic_uapi.c
@@ -1322,7 +1322,7 @@ int drm_mode_atomic_ioctl(struct drm_device *dev,
struct drm_out_fence_state *fence_state;
int ret = 0;
unsigned int i, j, num_fences;
-   struct drm_printer p = drm_info_printer(dev->dev);
+   struct drm_printer p = drm_debug_category_printer(DRM_UT_STATE, 
"commit_state");
 
/* disallow for drivers not supporting atomic: */
if (!drm_core_check_feature(dev, DRIVER_ATOMIC))
-- 
Sean Paul, Software Engineer, Google / Chromium OS



[PATCH v6 13/14] drm/atomic: Use debug category printer for atomic state printer

2020-08-18 Thread Sean Paul
From: Sean Paul 

The atomic state is printed if the DRM_UT_STATE is active, but it's
printed at INFO level. This patch converts it to use the debug
category printer so:

a- it's consistent with other DRM_UT_STATE logging
b- it's properly routed through drm_trace when introduced

Signed-off-by: Sean Paul 

Changes in v6:
-Added to the set
---
 drivers/gpu/drm/drm_atomic.c| 5 +++--
 drivers/gpu/drm/drm_atomic_uapi.c   | 2 +-
 drivers/gpu/drm/drm_crtc_internal.h | 3 ++-
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index 58527f151984..96b804e85903 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -1543,9 +1543,10 @@ int __drm_atomic_helper_set_config(struct drm_mode_set 
*set,
 }
 EXPORT_SYMBOL(__drm_atomic_helper_set_config);
 
-void drm_atomic_print_state(const struct drm_atomic_state *state)
+void drm_atomic_print_state(const struct drm_atomic_state *state,
+   const char *prefix)
 {
-   struct drm_printer p = drm_info_printer(state->dev->dev);
+   struct drm_printer p = drm_debug_category_printer(DRM_UT_STATE, prefix);
struct drm_plane *plane;
struct drm_plane_state *plane_state;
struct drm_crtc *crtc;
diff --git a/drivers/gpu/drm/drm_atomic_uapi.c 
b/drivers/gpu/drm/drm_atomic_uapi.c
index 25c269bc4681..c6f3c652f47c 100644
--- a/drivers/gpu/drm/drm_atomic_uapi.c
+++ b/drivers/gpu/drm/drm_atomic_uapi.c
@@ -1413,7 +1413,7 @@ int drm_mode_atomic_ioctl(struct drm_device *dev,
ret = drm_atomic_nonblocking_commit(state);
} else {
if (drm_debug_enabled(DRM_UT_STATE))
-   drm_atomic_print_state(state);
+   drm_atomic_print_state(state, "commit_state");
 
ret = drm_atomic_commit(state);
}
diff --git a/drivers/gpu/drm/drm_crtc_internal.h 
b/drivers/gpu/drm/drm_crtc_internal.h
index da96b2f64d7e..077ea92fb12a 100644
--- a/drivers/gpu/drm/drm_crtc_internal.h
+++ b/drivers/gpu/drm/drm_crtc_internal.h
@@ -233,7 +233,8 @@ int __drm_atomic_helper_disable_plane(struct drm_plane 
*plane,
 int __drm_atomic_helper_set_config(struct drm_mode_set *set,
   struct drm_atomic_state *state);
 
-void drm_atomic_print_state(const struct drm_atomic_state *state);
+void drm_atomic_print_state(const struct drm_atomic_state *state,
+   const char *prefix);
 
 /* drm_atomic_uapi.c */
 int drm_atomic_connector_commit_dpms(struct drm_atomic_state *state,
-- 
Sean Paul, Software Engineer, Google / Chromium OS

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel