Add connector_type to debug info to differentiate between eDP and DP
v3 cover Add connector_type to debug info to differentiate between eDP and DP
1) Add connector_type to debug info to differentiate between eDP and DP
2) add more debug info to cover dp Phy
3) repalce DRM_DEBUG_DP with drm_debug_dp
Kuogee Hsieh (3):
drm/msm/dp: add connector type to enhance debug messages drm/msm/dp: enhance debug info related to dp phy drm/msm/dp: replace DRM_DEBUG_DP marco with drm_dbg_dp
drivers/gpu/drm/msm/dp/dp_audio.c | 49 +++++++++------ drivers/gpu/drm/msm/dp/dp_catalog.c | 34 ++++++----- drivers/gpu/drm/msm/dp/dp_ctrl.c | 116 +++++++++++++++++++----------------- drivers/gpu/drm/msm/dp/dp_display.c | 103 ++++++++++++++++++++++---------- drivers/gpu/drm/msm/dp/dp_drm.c | 4 +- drivers/gpu/drm/msm/dp/dp_link.c | 99 +++++++++++++++++------------- drivers/gpu/drm/msm/dp/dp_panel.c | 43 +++++++------ drivers/gpu/drm/msm/dp/dp_parser.c | 2 +- drivers/gpu/drm/msm/dp/dp_power.c | 20 ++++--- 9 files changed, 283 insertions(+), 187 deletions(-)
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
PATCH v3 1/3 drm/msm/dp: add connector type to enhance debug messages
DP driver is a generic driver which supports both eDP and DP. For debugging purpose it is required to have capabilities to differentiate message are generated from eDP or DP. This patch add connector type into debug messages for this purpose.
Changes in v3:
-- replace original patch into 3 patches
--- drivers/gpu/drm/msm/dp/dp_display.c | 71 ++++++++++++++++++++++++++----------- 1 file changed, 50 insertions(+), 21 deletions(-)
drivers/gpu/drm/msm/dp/dp_display.c +50 -21
@@ -375,8 +375,9 @@ static int dp_display_process_hpd_high(struct dp_display_private *dp)static void dp_display_host_phy_init (struct dp_display_private *dp) { -DRM_DEBUG_DP ("core_init=%d phy_init=%d\n" , - dp->core_initialized, dp->phy_initialized); +DRM_DEBUG_DP ("type=%d core_init=%d phy_init=%d\n" , + dp->dp_display.connector_type, dp->core_initialized, + dp->phy_initialized);if (!dp->phy_initialized) {dp_ctrl_phy_init (dp->ctrl);
@@ -386,8 +387,9 @@ static void dp_display_host_phy_init(struct dp_display_private *dp)static void dp_display_host_phy_exit (struct dp_display_private *dp) { -DRM_DEBUG_DP ("core_init=%d phy_init=%d\n" , - dp->core_initialized, dp->phy_initialized); +DRM_DEBUG_DP ("type=%d core_init=%d phy_init=%d\n" , + dp->dp_display.connector_type, dp->core_initialized, + dp->phy_initialized);if (dp->phy_initialized) {dp_ctrl_phy_exit (dp->ctrl);
@@ -397,7 +399,9 @@ static void dp_display_host_phy_exit(struct dp_display_private *dp)static void dp_display_host_init (struct dp_display_private *dp) { -DRM_DEBUG_DP ("core_initialized=%d\n" , dp->core_initialized); +DRM_DEBUG_DP ("type=%d core_init=%d phy_init=%d\n" , + dp->dp_display.connector_type, dp->core_initialized, + dp->phy_initialized);dp_power_init (dp->power, false);dp_ctrl_reset_irq_ctrl (dp->ctrl, true);
@@ -407,7 +411,9 @@ static void dp_display_host_init(struct dp_display_private *dp)static void dp_display_host_deinit (struct dp_display_private *dp) { -DRM_DEBUG_DP ("core_initialized=%d\n" , dp->core_initialized); +DRM_DEBUG_DP ("type=%d core_init=%d phy_init=%d\n" , + dp->dp_display.connector_type, dp->core_initialized, + dp->phy_initialized);dp_ctrl_reset_irq_ctrl (dp->ctrl, false);dp_aux_deinit (dp->aux);
@@ -517,7 +523,9 @@ static int dp_hpd_plug_handle(struct dp_display_private *dp, u32 data)mutex_lock (&dp->event_mutex); state = dp->hpd_state; -DRM_DEBUG_DP ("hpd_state=%d\n" , state); +DRM_DEBUG_DP ("Before, type=%d hpd_state=%d\n" , + dp->dp_display.connector_type, state); +if (state ==ST_DISPLAY_OFF || state ==ST_SUSPENDED ) {mutex_unlock (&dp->event_mutex);return 0 ;
@@ -549,6 +557,8 @@ static int dp_hpd_plug_handle(struct dp_display_private *dp, u32 data)dp_catalog_hpd_config_intr (dp->catalog,DP_DP_IRQ_HPD_INT_MASK |DP_DP_HPD_REPLUG_INT_MASK , true); +DRM_DEBUG_DP ("After, type=%d hpd_state=%d\n" , + dp->dp_display.connector_type, state);mutex_unlock (&dp->event_mutex);/* uevent will complete connection part */
@@ -565,8 +575,10 @@ static int dp_connect_pending_timeout(struct dp_display_private *dp, u32 data)mutex_lock (&dp->event_mutex); state = dp->hpd_state; -if (state ==ST_CONNECT_PENDING ) +if (state ==ST_CONNECT_PENDING ) { dp->hpd_state =ST_CONNECTED ; +DRM_DEBUG_DP ("type=%d\n" , dp->dp_display.connector_type); + }mutex_unlock (&dp->event_mutex);
@@ -599,6 +611,9 @@ static int dp_hpd_unplug_handle(struct dp_display_private *dp, u32 data) state = dp->hpd_state; +DRM_DEBUG_DP ("Before, type=%d hpd_state=%d\n" , + dp->dp_display.connector_type, state); +/* disable irq_hpd/replug interrupts */ dp_catalog_hpd_config_intr (dp->catalog,DP_DP_IRQ_HPD_INT_MASK |DP_DP_HPD_REPLUG_INT_MASK , false);
@@ -641,13 +656,15 @@ static int dp_hpd_unplug_handle(struct dp_display_private *dp, u32 data)/* start sentinel checking in case of missing uevent */ dp_add_event (dp,EV_DISCONNECT_PENDING_TIMEOUT ,0 ,DP_TIMEOUT_5_SECOND ); -DRM_DEBUG_DP ("hpd_state=%d\n" , state);/* signal the disconnect event early to ensure proper teardown */ dp_display_handle_plugged_change (&dp->dp_display, false);/* enable HDP plug interrupt to prepare for next plugin */ dp_catalog_hpd_config_intr (dp->catalog,DP_DP_HPD_PLUG_INT_MASK , true); +DRM_DEBUG_DP ("After, type=%d hpd_state=%d\n" , + dp->dp_display.connector_type, state); +/* uevent will complete disconnection part */ mutex_unlock (&dp->event_mutex);return 0 ;
@@ -660,8 +677,10 @@ static int dp_disconnect_pending_timeout(struct dp_display_private *dp, u32 datamutex_lock (&dp->event_mutex); state = dp->hpd_state; -if (state ==ST_DISCONNECT_PENDING ) +if (state ==ST_DISCONNECT_PENDING ) { dp->hpd_state =ST_DISCONNECTED ; +DRM_DEBUG_DP ("type=%d\n" , dp->dp_display.connector_type); + }mutex_unlock (&dp->event_mutex);
@@ -676,6 +695,9 @@ static int dp_irq_hpd_handle(struct dp_display_private *dp, u32 data)/* irq_hpd can happen at either connected or disconnected state */ state = dp->hpd_state; +DRM_DEBUG_DP ("Before, type=%d hpd_state=%d\n" , + dp->dp_display.connector_type, state); +if (state ==ST_DISPLAY_OFF || state ==ST_SUSPENDED ) {mutex_unlock (&dp->event_mutex);return 0 ;
@@ -697,7 +719,8 @@ static int dp_irq_hpd_handle(struct dp_display_private *dp, u32 data)dp_display_usbpd_attention_cb (&dp->pdev->dev); -DRM_DEBUG_DP ("hpd_state=%d\n" , state); +DRM_DEBUG_DP ("After, type=%d hpd_state=%d\n" , + dp->dp_display.connector_type, state);mutex_unlock (&dp->event_mutex);
@@ -1147,8 +1170,9 @@ static irqreturn_t dp_display_irq_handler(int irq, void *dev_id) hpd_isr_status =dp_catalog_hpd_get_intr_status (dp->catalog); -DRM_DEBUG_DP ("hpd isr status=%#x\n" , hpd_isr_status);if (hpd_isr_status &0x0F ) { +DRM_DEBUG_DP ("type=%d isr=0x%x\n" , + dp->dp_display.connector_type, hpd_isr_status);/* hpd related interrupts */ if (hpd_isr_status &DP_DP_HPD_PLUG_INT_MASK )dp_add_event (dp,EV_HPD_PLUG_INT ,0 ,0 );
@@ -1301,8 +1325,9 @@ static int dp_pm_resume(struct device *dev)mutex_lock (&dp->event_mutex); -DRM_DEBUG_DP ("Before, core_inited=%d power_on=%d\n" , - dp->core_initialized, dp_display->power_on); +DRM_DEBUG_DP ("Before, type=%d core_inited=%d phy_inited=%d power_on=%d\n" , + dp->dp_display.connector_type, dp->core_initialized, + dp->phy_initialized, dp_display->power_on);/* start from disconnected state */ dp->hpd_state =ST_DISCONNECTED ;
@@ -1341,9 +1366,11 @@ static int dp_pm_resume(struct device *dev)dp_display_handle_plugged_change (dp_display, false); } -DRM_DEBUG_DP ("After, sink_count=%d is_connected=%d core_inited=%d power_on=%d\n" , - dp->link->sink_count, dp->dp_display.is_connected, - dp->core_initialized, dp_display->power_on); +DRM_DEBUG_DP ("After, type=%d sink_count=%d is_connected=%d \ +core_inited=%d phy_inited=%d power_on=%d\n" , + dp->dp_display.connector_type, dp->link->sink_count, + dp->dp_display.is_connected, dp->core_initialized, + dp->phy_initialized, dp_display->power_on);mutex_unlock (&dp->event_mutex);
@@ -1360,8 +1387,9 @@ static int dp_pm_suspend(struct device *dev)mutex_lock (&dp->event_mutex); -DRM_DEBUG_DP ("Before, core_inited=%d power_on=%d\n" , - dp->core_initialized, dp_display->power_on); +DRM_DEBUG_DP ("Before, type=%d core_inited=%d phy_inited=%d power_on=%d\n" , + dp->dp_display.connector_type, dp->core_initialized, + dp->phy_initialized, dp_display->power_on);/* mainlink enabled */ if (dp_power_clk_status (dp->power,DP_CTRL_PM ))
@@ -1374,8 +1402,9 @@ static int dp_pm_suspend(struct device *dev) dp->hpd_state =ST_SUSPENDED ; -DRM_DEBUG_DP ("After, core_inited=%d power_on=%d\n" , - dp->core_initialized, dp_display->power_on); +DRM_DEBUG_DP ("After, type=%d core_inited=%d phy_inited=%d power_on=%d\n" , + dp->dp_display.connector_type, dp->core_initialized, + dp->phy_initialized, dp_display->power_on);mutex_unlock (&dp->event_mutex);
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
Re: [PATCH v3 1/3] drm/msm/dp: add connector type to enhance debug messages
Quoting Kuogee Hsieh (2022-02-02 10:56:37)
Quoted 10 lines
DP driver is a generic driver which supports both eDP and DP. For debugging purpose it is required to have capabilities to differentiate message are generated from eDP or DP. This patch add connector type into debug messages for this purpose.
Changes in v3:
-- replace original patch into 3 patchesSigned-off-by Kuogee Hsieh <[email protected]>---
PATCH v3 2/3 drm/msm/dp: enhance debug info related to dp phy
In reply to Kuogee HsiehDP phy should be initialized and exited symmetrically to avoid clock being stucked at either on or off error. Add debug info to cover all DP phy to identify clock issues easily.
--- drivers/gpu/drm/msm/dp/dp_ctrl.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/gpu/drm/msm/dp/dp_ctrl.c +10 -10
@@ -1396,6 +1396,8 @@ void dp_ctrl_phy_init(struct dp_ctrl *dp_ctrl)dp_catalog_ctrl_phy_reset (ctrl->catalog);phy_init (phy); +DRM_DEBUG_DP ("phy=%p init=%d power_on=%d\n" , + phy, phy->init_count, phy->power_count); }void dp_ctrl_phy_exit (struct dp_ctrl *dp_ctrl)
@@ -1410,6 +1412,8 @@ void dp_ctrl_phy_exit(struct dp_ctrl *dp_ctrl)dp_catalog_ctrl_phy_reset (ctrl->catalog);phy_exit (phy); +DRM_DEBUG_DP ("phy=%p init=%d power_on=%d\n" , + phy, phy->init_count, phy->power_count); }static bool dp_ctrl_use_fixed_nvid (struct dp_ctrl_private *ctrl)
@@ -1484,6 +1488,8 @@ static int dp_ctrl_deinitialize_mainlink(struct dp_ctrl_private *ctrl)phy_exit (phy);phy_init (phy); +DRM_DEBUG_DP ("phy=%p init=%d power_on=%d\n" , + phy, phy->init_count, phy->power_count);return 0 ; }
@@ -1895,14 +1901,12 @@ int dp_ctrl_off_link_stream(struct dp_ctrl *dp_ctrl)phy_power_off (phy); -DRM_DEBUG_DP ("After, phy=%x init_count=%d power_on=%d\n" , - (u32 )(uintptr_t )phy, phy->init_count, phy->power_count); -/* aux channel down, reinit phy */ phy_exit (phy);phy_init (phy); -DRM_DEBUG_DP ("DP off link/stream done\n" ); +DRM_DEBUG_DP ("phy=%p init=%d power_on=%d\n" , + phy, phy->init_count, phy->power_count);return ret; }
@@ -1933,13 +1937,9 @@ int dp_ctrl_off(struct dp_ctrl *dp_ctrl)DRM_ERROR ("Failed to disable link clocks. ret=%d\n" , ret); } -DRM_DEBUG_DP ("Before, phy=%x init_count=%d power_on=%d\n" , - (u32 )(uintptr_t )phy, phy->init_count, phy->power_count); -phy_power_off (phy); - -DRM_DEBUG_DP ("After, phy=%x init_count=%d power_on=%d\n" , - (u32 )(uintptr_t )phy, phy->init_count, phy->power_count); +DRM_DEBUG_DP ("phy=%p init=%d power_on=%d\n" , + phy, phy->init_count, phy->power_count);return ret; }
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
Re: [PATCH v3 2/3] drm/msm/dp: enhance debug info related to dp phy
Quoting Kuogee Hsieh (2022-02-02 10:56:38)
Quoted 6 lines
DP phy should be initialized and exited symmetrically to avoid clock being stucked at either on or off error. Add debug info to cover all DP phy to identify clock issues easily.
Signed-off-by Kuogee Hsieh <[email protected]>---
PATCH v3 3/3 drm/msm/dp: replace DRM_DEBUG_DP marco with drm_dbg_dp
In reply to Kuogee Hsieh--- drivers/gpu/drm/msm/dp/dp_audio.c | 49 +++++++++++------ drivers/gpu/drm/msm/dp/dp_catalog.c | 34 +++++++----- drivers/gpu/drm/msm/dp/dp_ctrl.c | 106 +++++++++++++++++++----------------- drivers/gpu/drm/msm/dp/dp_display.c | 68 +++++++++++++---------- drivers/gpu/drm/msm/dp/dp_drm.c | 4 +- drivers/gpu/drm/msm/dp/dp_link.c | 99 +++++++++++++++++++-------------- drivers/gpu/drm/msm/dp/dp_panel.c | 43 +++++++++------ drivers/gpu/drm/msm/dp/dp_parser.c | 2 +- drivers/gpu/drm/msm/dp/dp_power.c | 20 ++++--- 9 files changed, 246 insertions(+), 179 deletions(-)
drivers/gpu/drm/msm/dp/dp_audio.c +32 -17
@@ -136,7 +136,8 @@ static void dp_audio_stream_sdp(struct dp_audio_private *audio) parity_byte =dp_audio_calculate_parity (new_value); value |= ((new_value <<HEADER_BYTE_1_BIT ) | (parity_byte <<PARITY_BYTE_1_BIT )); -DRM_DEBUG_DP ("Header Byte 1: value = 0x%x, parity_byte = 0x%x\n" , +drm_dbg_dp ((struct drm_device *)NULL , +"Header Byte 1: value = 0x%x, parity_byte = 0x%x\n" , value, parity_byte);dp_audio_set_header (catalog, value,DP_AUDIO_SDP_STREAM ,DP_AUDIO_SDP_HEADER_1 );
@@ -148,7 +149,8 @@ static void dp_audio_stream_sdp(struct dp_audio_private *audio) parity_byte =dp_audio_calculate_parity (new_value); value |= ((new_value <<HEADER_BYTE_2_BIT ) | (parity_byte <<PARITY_BYTE_2_BIT )); -DRM_DEBUG_DP ("Header Byte 2: value = 0x%x, parity_byte = 0x%x\n" , +drm_dbg_dp ((struct drm_device *)NULL , +"Header Byte 2: value = 0x%x, parity_byte = 0x%x\n" , value, parity_byte); dp_audio_set_header(catalog, value,
@@ -162,7 +164,8 @@ static void dp_audio_stream_sdp(struct dp_audio_private *audio) parity_byte =dp_audio_calculate_parity (new_value); value |= ((new_value <<HEADER_BYTE_3_BIT ) | (parity_byte <<PARITY_BYTE_3_BIT )); -DRM_DEBUG_DP ("Header Byte 3: value = 0x%x, parity_byte = 0x%x\n" , +drm_dbg_dp ((struct drm_device *)NULL , +"Header Byte 3: value = 0x%x, parity_byte = 0x%x\n" , value, parity_byte); dp_audio_set_header(catalog, value,
@@ -183,8 +186,9 @@ static void dp_audio_timestamp_sdp(struct dp_audio_private *audio) parity_byte =dp_audio_calculate_parity (new_value); value |= ((new_value <<HEADER_BYTE_1_BIT ) | (parity_byte <<PARITY_BYTE_1_BIT )); -DRM_DEBUG_DP ("Header Byte 1: value = 0x%x, parity_byte = 0x%x\n" , - value, parity_byte); +drm_dbg_dp ((struct drm_device *)NULL , +"Header Byte 1: value = 0x%x, parity_byte = 0x%x\n" , + value, parity_byte);dp_audio_set_header (catalog, value,DP_AUDIO_SDP_TIMESTAMP ,DP_AUDIO_SDP_HEADER_1 );
@@ -196,7 +200,8 @@ static void dp_audio_timestamp_sdp(struct dp_audio_private *audio) parity_byte =dp_audio_calculate_parity (new_value); value |= ((new_value <<HEADER_BYTE_2_BIT ) | (parity_byte <<PARITY_BYTE_2_BIT )); -DRM_DEBUG_DP ("Header Byte 2: value = 0x%x, parity_byte = 0x%x\n" , +drm_dbg_dp ((struct drm_device *)NULL , +"Header Byte 2: value = 0x%x, parity_byte = 0x%x\n" , value, parity_byte);dp_audio_set_header (catalog, value,DP_AUDIO_SDP_TIMESTAMP ,DP_AUDIO_SDP_HEADER_2 );
@@ -209,7 +214,8 @@ static void dp_audio_timestamp_sdp(struct dp_audio_private *audio) parity_byte =dp_audio_calculate_parity (new_value); value |= ((new_value <<HEADER_BYTE_3_BIT ) | (parity_byte <<PARITY_BYTE_3_BIT )); -DRM_DEBUG_DP ("Header Byte 3: value = 0x%x, parity_byte = 0x%x\n" , +drm_dbg_dp ((struct drm_device *)NULL , +"Header Byte 3: value = 0x%x, parity_byte = 0x%x\n" , value, parity_byte);dp_audio_set_header (catalog, value,DP_AUDIO_SDP_TIMESTAMP ,DP_AUDIO_SDP_HEADER_3 );
@@ -229,7 +235,8 @@ static void dp_audio_infoframe_sdp(struct dp_audio_private *audio) parity_byte =dp_audio_calculate_parity (new_value); value |= ((new_value <<HEADER_BYTE_1_BIT ) | (parity_byte <<PARITY_BYTE_1_BIT )); -DRM_DEBUG_DP ("Header Byte 1: value = 0x%x, parity_byte = 0x%x\n" , +drm_dbg_dp ((struct drm_device *)NULL , +"Header Byte 1: value = 0x%x, parity_byte = 0x%x\n" , value, parity_byte);dp_audio_set_header (catalog, value,DP_AUDIO_SDP_INFOFRAME ,DP_AUDIO_SDP_HEADER_1 );
@@ -242,7 +249,8 @@ static void dp_audio_infoframe_sdp(struct dp_audio_private *audio) parity_byte =dp_audio_calculate_parity (new_value); value |= ((new_value <<HEADER_BYTE_2_BIT ) | (parity_byte <<PARITY_BYTE_2_BIT )); -DRM_DEBUG_DP ("Header Byte 2: value = 0x%x, parity_byte = 0x%x\n" , +drm_dbg_dp ((struct drm_device *)NULL , +"Header Byte 2: value = 0x%x, parity_byte = 0x%x\n" , value, parity_byte);dp_audio_set_header (catalog, value,DP_AUDIO_SDP_INFOFRAME ,DP_AUDIO_SDP_HEADER_2 );
@@ -255,7 +263,8 @@ static void dp_audio_infoframe_sdp(struct dp_audio_private *audio) parity_byte =dp_audio_calculate_parity (new_value); value |= ((new_value <<HEADER_BYTE_3_BIT ) | (parity_byte <<PARITY_BYTE_3_BIT )); -DRM_DEBUG_DP ("Header Byte 3: value = 0x%x, parity_byte = 0x%x\n" , +drm_dbg_dp ((struct drm_device *)NULL , +"Header Byte 3: value = 0x%x, parity_byte = 0x%x\n" , new_value, parity_byte);dp_audio_set_header (catalog, value,DP_AUDIO_SDP_INFOFRAME ,DP_AUDIO_SDP_HEADER_3 );
@@ -275,7 +284,8 @@ static void dp_audio_copy_management_sdp(struct dp_audio_private *audio) parity_byte =dp_audio_calculate_parity (new_value); value |= ((new_value <<HEADER_BYTE_1_BIT ) | (parity_byte <<PARITY_BYTE_1_BIT )); -DRM_DEBUG_DP ("Header Byte 1: value = 0x%x, parity_byte = 0x%x\n" , +drm_dbg_dp ((struct drm_device *)NULL , +"Header Byte 1: value = 0x%x, parity_byte = 0x%x\n" , value, parity_byte);dp_audio_set_header (catalog, value,DP_AUDIO_SDP_COPYMANAGEMENT ,DP_AUDIO_SDP_HEADER_1 );
@@ -288,7 +298,8 @@ static void dp_audio_copy_management_sdp(struct dp_audio_private *audio) parity_byte =dp_audio_calculate_parity (new_value); value |= ((new_value <<HEADER_BYTE_2_BIT ) | (parity_byte <<PARITY_BYTE_2_BIT )); -DRM_DEBUG_DP ("Header Byte 2: value = 0x%x, parity_byte = 0x%x\n" , +drm_dbg_dp ((struct drm_device *)NULL , +"Header Byte 2: value = 0x%x, parity_byte = 0x%x\n" , value, parity_byte);dp_audio_set_header (catalog, value,DP_AUDIO_SDP_COPYMANAGEMENT ,DP_AUDIO_SDP_HEADER_2 );
@@ -301,7 +312,8 @@ static void dp_audio_copy_management_sdp(struct dp_audio_private *audio) parity_byte =dp_audio_calculate_parity (new_value); value |= ((new_value <<HEADER_BYTE_3_BIT ) | (parity_byte <<PARITY_BYTE_3_BIT )); -DRM_DEBUG_DP ("Header Byte 3: value = 0x%x, parity_byte = 0x%x\n" , +drm_dbg_dp ((struct drm_device *)NULL , +"Header Byte 3: value = 0x%x, parity_byte = 0x%x\n" , value, parity_byte);dp_audio_set_header (catalog, value,DP_AUDIO_SDP_COPYMANAGEMENT ,DP_AUDIO_SDP_HEADER_3 );
@@ -321,7 +333,8 @@ static void dp_audio_isrc_sdp(struct dp_audio_private *audio) parity_byte =dp_audio_calculate_parity (new_value); value |= ((new_value <<HEADER_BYTE_1_BIT ) | (parity_byte <<PARITY_BYTE_1_BIT )); -DRM_DEBUG_DP ("Header Byte 1: value = 0x%x, parity_byte = 0x%x\n" , +drm_dbg_dp ((struct drm_device *)NULL , +"Header Byte 1: value = 0x%x, parity_byte = 0x%x\n" , value, parity_byte);dp_audio_set_header (catalog, value,DP_AUDIO_SDP_ISRC ,DP_AUDIO_SDP_HEADER_1 );
@@ -334,7 +347,8 @@ static void dp_audio_isrc_sdp(struct dp_audio_private *audio) parity_byte =dp_audio_calculate_parity (new_value); value |= ((new_value <<HEADER_BYTE_2_BIT ) | (parity_byte <<PARITY_BYTE_2_BIT )); -DRM_DEBUG_DP ("Header Byte 2: value = 0x%x, parity_byte = 0x%x\n" , +drm_dbg_dp ((struct drm_device *)NULL , +"Header Byte 2: value = 0x%x, parity_byte = 0x%x\n" , value, parity_byte);dp_audio_set_header (catalog, value,DP_AUDIO_SDP_ISRC ,DP_AUDIO_SDP_HEADER_2 );
@@ -370,7 +384,7 @@ static void dp_audio_setup_acr(struct dp_audio_private *audio) select =3 ;break ;default : -DRM_DEBUG_DP ("Unknown link rate\n" ); +drm_dbg_dp ((struct drm_device *)NULL ,"Unknown link rate\n" ); select =0 ;break ; }
@@ -395,7 +409,8 @@ static void dp_audio_safe_to_exit_level(struct dp_audio_private *audio) safe_to_exit_level =5 ;break ;default : -DRM_DEBUG_DP ("setting the default safe_to_exit_level = %u\n" , +drm_dbg_dp ((struct drm_device *)NULL , +"setting the default safe_to_exit_level = %u\n" , safe_to_exit_level); safe_to_exit_level =14 ;break ;
drivers/gpu/drm/msm/dp/dp_catalog.c +19 -15
@@ -322,7 +322,7 @@ void dp_catalog_ctrl_config_ctrl(struct dp_catalog *dp_catalog, u32 cfg)struct dp_catalog_private *catalog =container_of (dp_catalog, struct dp_catalog_private, dp_catalog); -DRM_DEBUG_DP ("DP_CONFIGURATION_CTRL=0x%x\n" , cfg); +drm_dbg_dp ((struct drm_device *)NULL ,"DP_CONFIGURATION_CTRL=0x%x\n" , cfg);dp_write_link (catalog,REG_DP_CONFIGURATION_CTRL , cfg); }
@@ -350,7 +350,7 @@ void dp_catalog_ctrl_mainlink_ctrl(struct dp_catalog *dp_catalog,struct dp_catalog_private *catalog =container_of (dp_catalog, struct dp_catalog_private, dp_catalog); -DRM_DEBUG_DP ("enable=%d\n" , enable); +drm_dbg_dp ((struct drm_device *)NULL ,"enable=%d\n" , enable);if (enable) {/* * To make sure link reg writes happens before other operation,
@@ -395,7 +395,7 @@ void dp_catalog_ctrl_config_misc(struct dp_catalog *dp_catalog,/* Configure clock to synchronous mode */ misc_val |=DP_MISC0_SYNCHRONOUS_CLK ; -DRM_DEBUG_DP ("misc settings = 0x%x\n" , misc_val); +drm_dbg_dp ((struct drm_device *)NULL ,"misc settings = 0x%x\n" , misc_val);dp_write_link (catalog,REG_DP_MISC1_MISC0 , misc_val); }
@@ -450,7 +450,7 @@ void dp_catalog_ctrl_config_msa(struct dp_catalog *dp_catalog,if (link_rate_hbr3 == rate) nvid *=3 ; -DRM_DEBUG_DP ("mvid=0x%x, nvid=0x%x\n" , mvid, nvid); +drm_dbg_dp ((struct drm_device *)NULL ,"mvid=0x%x, nvid=0x%x\n" , mvid, nvid);dp_write_link (catalog,REG_DP_SOFTWARE_MVID , mvid);dp_write_link (catalog,REG_DP_SOFTWARE_NVID , nvid);dp_write_p0 (catalog,MMSS_DP_DSC_DTO ,0x0 );
@@ -465,7 +465,7 @@ int dp_catalog_ctrl_set_pattern_state_bit(struct dp_catalog *dp_catalog, struct dp_catalog_private, dp_catalog); bit =BIT (state_bit -1 ); -DRM_DEBUG_DP ("hw: bit=%d train=%d\n" , bit, state_bit); +drm_dbg_dp ((struct drm_device *)NULL ,"hw: bit=%d train=%d\n" , bit, state_bit);dp_catalog_ctrl_state_ctrl (dp_catalog, bit); bit =BIT (state_bit -1 ) <<DP_MAINLINK_READY_LINK_TRAINING_SHIFT ;
@@ -557,7 +557,8 @@ void dp_catalog_hpd_config_intr(struct dp_catalog *dp_catalog, config = (en ? config | intr_mask : config & ~intr_mask); -DRM_DEBUG_DP ("intr_mask=%#x config=%#x\n" , intr_mask, config); +drm_dbg_dp ((struct drm_device *)NULL ,"intr_mask=%#x config=%#x\n" , + intr_mask, config);dp_write_aux (catalog,REG_DP_DP_HPD_INT_MASK , config &DP_DP_HPD_INT_MASK ); }
@@ -588,7 +589,7 @@ u32 dp_catalog_link_is_connected(struct dp_catalog *dp_catalog)u32 status; status =dp_read_aux (catalog,REG_DP_DP_HPD_INT_STATUS ); -DRM_DEBUG_DP ("aux status: %#x\n" , status); +drm_dbg_dp ((struct drm_device *)NULL ,"aux status: %#x\n" , status); status >>=DP_DP_HPD_STATE_STATUS_BITS_SHIFT ; status &=DP_DP_HPD_STATE_STATUS_BITS_MASK ;
@@ -664,7 +665,7 @@ void dp_catalog_ctrl_send_phy_pattern(struct dp_catalog *dp_catalog,/* Make sure to clear the current pattern before starting a new one */ dp_write_link (catalog,REG_DP_STATE_CTRL ,0x0 ); -DRM_DEBUG_DP ("pattern: %#x\n" , pattern); +drm_dbg_dp ((struct drm_device *)NULL ,"pattern: %#x\n" , pattern);switch (pattern) {case DP_PHY_TEST_PATTERN_D10_2 : dp_write_link(catalog, REG_DP_STATE_CTRL,
@@ -725,7 +726,8 @@ void dp_catalog_ctrl_send_phy_pattern(struct dp_catalog *dp_catalog, DP_STATE_CTRL_LINK_TRAINING_PATTERN4);break ;default : -DRM_DEBUG_DP ("No valid test pattern requested: %#x\n" , pattern); +drm_dbg_dp ((struct drm_device *)NULL , +"No valid test pattern requested: %#x\n" , pattern);break ; } }
@@ -820,7 +822,7 @@ void dp_catalog_panel_tpg_enable(struct dp_catalog *dp_catalog, DP_BIST_ENABLE_DPBIST_EN);dp_write_p0 (catalog,MMSS_DP_TIMING_ENGINE_EN ,DP_TIMING_ENGINE_EN_EN ); -DRM_DEBUG_DP ("%s: enabled tpg\n" , __func__); +drm_dbg_dp ((struct drm_device *)NULL ,"%s: enabled tpg\n" , __func__); }void dp_catalog_panel_tpg_disable (struct dp_catalog *dp_catalog)
@@ -909,7 +911,8 @@ void dp_catalog_audio_config_acr(struct dp_catalog *dp_catalog) select = dp_catalog->audio_data; acr_ctrl = select <<4 |BIT (31 ) |BIT (8 ) |BIT (14 ); -DRM_DEBUG_DP ("select: %#x, acr_ctrl: %#x\n" , select, acr_ctrl); +drm_dbg_dp ((struct drm_device *)NULL ,"select: %#x, acr_ctrl: %#x\n" , + select, acr_ctrl);dp_write_link (catalog,MMSS_DP_AUDIO_ACR_CTRL , acr_ctrl); }
@@ -934,7 +937,7 @@ void dp_catalog_audio_enable(struct dp_catalog *dp_catalog)else audio_ctrl &= ~BIT (0 ); -DRM_DEBUG_DP ("dp_audio_cfg = 0x%x\n" , audio_ctrl); +drm_dbg_dp ((struct drm_device *)NULL ,"dp_audio_cfg = 0x%x\n" , audio_ctrl);dp_write_link (catalog,MMSS_DP_AUDIO_CFG , audio_ctrl);/* make sure audio engine is disabled */
@@ -965,7 +968,7 @@ void dp_catalog_audio_config_sdp(struct dp_catalog *dp_catalog)/* AUDIO_INFOFRAME_SDP_EN */ sdp_cfg |=BIT (20 ); -DRM_DEBUG_DP ("sdp_cfg = 0x%x\n" , sdp_cfg); +drm_dbg_dp ((struct drm_device *)NULL ,"sdp_cfg = 0x%x\n" , sdp_cfg);dp_write_link (catalog,MMSS_DP_SDP_CFG , sdp_cfg);
@@ -975,7 +978,7 @@ void dp_catalog_audio_config_sdp(struct dp_catalog *dp_catalog)/* AUDIO_STREAM_HB3_REGSRC-> Do not use reg values */ sdp_cfg2 &= ~BIT (1 ); -DRM_DEBUG_DP ("sdp_cfg2 = 0x%x\n" , sdp_cfg2); +drm_dbg_dp ((struct drm_device *)NULL ,"sdp_cfg2 = 0x%x\n" , sdp_cfg2);dp_write_link (catalog,MMSS_DP_SDP_CFG2 , sdp_cfg2); }
@@ -1037,7 +1040,8 @@ void dp_catalog_audio_sfe_level(struct dp_catalog *dp_catalog) mainlink_levels &=0xFE0 ; mainlink_levels |= safe_to_exit_level; -DRM_DEBUG_DP ("mainlink_level = 0x%x, safe_to_exit_level = 0x%x\n" , +drm_dbg_dp ((struct drm_device *)NULL , +"mainlink_level = 0x%x, safe_to_exit_level = 0x%x\n" , mainlink_levels, safe_to_exit_level);dp_write_link (catalog,REG_DP_MAINLINK_LEVELS , mainlink_levels);
drivers/gpu/drm/msm/dp/dp_ctrl.c +57 -49
301 lines not on this page · raw message
drivers/gpu/drm/msm/dp/dp_display.c +40 -28
245 lines not on this page · raw message
drivers/gpu/drm/msm/dp/dp_drm.c +2 -2
@@ -39,7 +39,7 @@ static enum drm_connector_status dp_connector_detect(struct drm_connector *conn, dp =to_dp_connector (conn)->dp_display; -DRM_DEBUG_DP ("is_connected = %s\n" , +drm_dbg_dp ((struct drm_device *)NULL ,"is_connected = %s\n" , (dp->is_connected) ?"true" :"false" ); return (dp->is_connected) ? connector_status_connected :
@@ -95,7 +95,7 @@ static int dp_connector_get_modes(struct drm_connector *connector)drm_mode_probed_add (connector, m); } }else { -DRM_DEBUG_DP ("No sink connected\n" ); +drm_dbg_dp ((struct drm_device *)NULL ,"No sink connected\n" ); }kfree (dp_mode);return rc;
drivers/gpu/drm/msm/dp/dp_link.c +57 -42
295 lines not on this page · raw message
drivers/gpu/drm/msm/dp/dp_panel.c +25 -18
97 lines not on this page · raw message
drivers/gpu/drm/msm/dp/dp_parser.c +1 -1
@@ -260,7 +260,7 @@ static int dp_parser_clock(struct dp_parser *parser) } } -DRM_DEBUG_DP ("clock parsing successful\n" ); +drm_dbg_dp ((struct drm_device *)NULL ,"clock parsing successful\n" );return 0 ; }
drivers/gpu/drm/msm/dp/dp_power.c +13 -7
@@ -208,7 +208,8 @@ static int dp_power_clk_set_rate(struct dp_power_private *power,int dp_power_clk_status (struct dp_power *dp_power,enum dp_pm_type pm_type) { -DRM_DEBUG_DP ("core_clk_on=%d link_clk_on=%d stream_clk_on=%d\n" , +drm_dbg_dp ((struct drm_device *)NULL , +"core_clk_on=%d link_clk_on=%d stream_clk_on=%d\n" , dp_power->core_clks_on, dp_power->link_clks_on, dp_power->stream_clks_on);if (pm_type ==DP_CORE_PM )
@@ -240,22 +241,26 @@ int dp_power_clk_enable(struct dp_power *dp_power,if (enable) {if (pm_type ==DP_CORE_PM && dp_power->core_clks_on) { -DRM_DEBUG_DP ("core clks already enabled\n" ); +drm_dbg_dp ((struct drm_device *)NULL , +"core clks already enabled\n" );return 0 ; }if (pm_type ==DP_CTRL_PM && dp_power->link_clks_on) { -DRM_DEBUG_DP ("links clks already enabled\n" ); +drm_dbg_dp ((struct drm_device *)NULL , +"links clks already enabled\n" );return 0 ; }if (pm_type ==DP_STREAM_PM && dp_power->stream_clks_on) { -DRM_DEBUG_DP ("pixel clks already enabled\n" ); +drm_dbg_dp ((struct drm_device *)NULL , +"pixel clks already enabled\n" );return 0 ; }if ((pm_type ==DP_CTRL_PM ) && (!dp_power->core_clks_on)) { -DRM_DEBUG_DP ("Enable core clks before link clks\n" ); +drm_dbg_dp ((struct drm_device *)NULL , +"Enable core clks before link clks\n" ); rc =dp_power_clk_set_rate (power,DP_CORE_PM , enable);if (rc) {
@@ -282,10 +287,11 @@ int dp_power_clk_enable(struct dp_power *dp_power,else dp_power->link_clks_on = enable; -DRM_DEBUG_DP ("%s clocks for %s\n" , +drm_dbg_dp ((struct drm_device *)NULL ,"%s clocks for %s\n" , enable ?"enable" :"disable" ,dp_parser_pm_name (pm_type)); -DRM_DEBUG_DP ("strem_clks:%s link_clks:%s core_clks:%s\n" , +drm_dbg_dp ((struct drm_device *)NULL , +"strem_clks:%s link_clks:%s core_clks:%s\n" , dp_power->stream_clks_on ?"on" :"off" , dp_power->link_clks_on ?"on" :"off" , dp_power->core_clks_on ?"on" :"off" );
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
Re: [PATCH v3 3/3] drm/msm/dp: replace DRM_DEBUG_DP marco with drm_dbg_dp
Quoting Kuogee Hsieh (2022-02-02 10:56:39)
Please add some commit text
Quoted 18 lines
Signed-off-by Kuogee Hsieh <[email protected]>--- drivers/gpu/drm/msm/dp/dp_audio.c | 49 +++++++++++------ drivers/gpu/drm/msm/dp/dp_catalog.c | 34 +++++++----- drivers/gpu/drm/msm/dp/dp_ctrl.c | 106 +++++++++++++++++++----------------- drivers/gpu/drm/msm/dp/dp_display.c | 68 +++++++++++++---------- drivers/gpu/drm/msm/dp/dp_drm.c | 4 +- drivers/gpu/drm/msm/dp/dp_link.c | 99 +++++++++++++++++++-------------- drivers/gpu/drm/msm/dp/dp_panel.c | 43 +++++++++------ drivers/gpu/drm/msm/dp/dp_parser.c | 2 +- drivers/gpu/drm/msm/dp/dp_power.c | 20 ++++--- 9 files changed, 246 insertions(+), 179 deletions(-)drivers/gpu/drm/msm/dp/dp_audio.c +0
-0
drivers/gpu/drm/msm/dp/dp_audio.c static void dp_audio_stream_sdp(struct dp_audio_private *audio) · line 139
Quoted 5 lines
drivers/gpu/drm/msm/dp/dp_audio.c +1
-1@@ -136,7 +136,8 @@ static void dp_audio_stream_sdp(struct dp_audio_private *audio) parity_byte =dp_audio_calculate_parity (new_value); value |= ((new_value <<HEADER_BYTE_1_BIT ) | (parity_byte <<PARITY_BYTE_1_BIT )); - DRM_DEBUG_DP("Header Byte 1: value = 0x%x, parity_byte = 0x%x\n", + drm_dbg_dp((struct drm_device *)NULL,
Why can't we pass the platform device pointer? Surely the cast is not necessary and in fact harmful.
Re: [PATCH v3 3/3] drm/msm/dp: replace DRM_DEBUG_DP marco with drm_dbg_dp
Quoted 17 lines · Stephen Boyd
Quoting Kuogee Hsieh (2022-02-02 10:56:39)
Please add some commit text
Quoted 13 lines
Signed-off-by Kuogee Hsieh <[email protected]>--- drivers/gpu/drm/msm/dp/dp_audio.c | 49 +++++++++++------ drivers/gpu/drm/msm/dp/dp_catalog.c | 34 +++++++----- drivers/gpu/drm/msm/dp/dp_ctrl.c | 106 +++++++++++++++++++----------------- drivers/gpu/drm/msm/dp/dp_display.c | 68 +++++++++++++---------- drivers/gpu/drm/msm/dp/dp_drm.c | 4 +- drivers/gpu/drm/msm/dp/dp_link.c | 99 +++++++++++++++++++-------------- drivers/gpu/drm/msm/dp/dp_panel.c | 43 +++++++++------ drivers/gpu/drm/msm/dp/dp_parser.c | 2 +- drivers/gpu/drm/msm/dp/dp_power.c | 20 ++++--- 9 files changed, 246 insertions(+), 179 deletions(-)
Quoted 12 lines
drivers/gpu/drm/msm/dp/dp_audio.c static void dp_audio_stream_sdp(struct dp_audio_private *audio) · line 139
Quoted 10 lines
drivers/gpu/drm/msm/dp/dp_audio.c +1
-1@@ -136,7 +136,8 @@ static void dp_audio_stream_sdp(struct dp_audio_private *audio) parity_byte =dp_audio_calculate_parity (new_value); value |= ((new_value <<HEADER_BYTE_1_BIT ) | (parity_byte <<PARITY_BYTE_1_BIT )); - DRM_DEBUG_DP("Header Byte 1: value = 0x%x, parity_byte = 0x%x\n", + drm_dbg_dp((struct drm_device *)NULL,Why can't we pass the platform device pointer? Surely the cast is not necessary and in fact harmful.
Platform device only available at top level (dp_display.c), other level has no access to platform device or drm_device.
I will just apss NULL, such as drm_dbg_dp(NULL, ...), if not device available.
Re: [PATCH v3 3/3] drm/msm/dp: replace DRM_DEBUG_DP marco with drm_dbg_dp
Quoted 36 lines · Kuogee Hsieh
Quoted 19 lines · Stephen Boyd
Quoting Kuogee Hsieh (2022-02-02 10:56:39)
Please add some commit text
Quoted 15 lines
Signed-off-by Kuogee Hsieh <[email protected]>---
drivers/gpu/drm/msm/dp/dp_audio.c | 49 +++++++++++------drivers/gpu/drm/msm/dp/dp_catalog.c| 34 +++++++----- drivers/gpu/drm/msm/dp/dp_ctrl.c | 106
+++++++++++++++++++-----------------
drivers/gpu/drm/msm/dp/dp_display.c| 68 +++++++++++++---------- drivers/gpu/drm/msm/dp/dp_drm.c | 4 +- drivers/gpu/drm/msm/dp/dp_link.c | 99
+++++++++++++++++++--------------
drivers/gpu/drm/msm/dp/dp_panel.c | 43 +++++++++------ drivers/gpu/drm/msm/dp/dp_parser.c | 2 +- drivers/gpu/drm/msm/dp/dp_power.c | 20 ++++---9 files changed, 246 insertions(+), 179 deletions(-)Quoted 14 lines
drivers/gpu/drm/msm/dp/dp_audio.c static void dp_audio_stream_sdp(struct · line 141
Quoted 12 lines
drivers/gpu/drm/msm/dp/dp_audio.c +1
-1@@ -136,7 +136,8 @@ static void dp_audio_stream_sdp(struct dp_audio_private *audio) parity_byte = dp_audio_calculate_parity(new_value); value |= ((new_value << HEADER_BYTE_1_BIT) | (parity_byte << PARITY_BYTE_1_BIT)); - DRM_DEBUG_DP("Header Byte 1: value = 0x%x, parity_byte = 0x%x\n", + drm_dbg_dp((struct drm_device *)NULL,Why can't we pass the platform device pointer? Surely the cast is not necessary and in fact harmful.
Quoted 1 line
Platform device only available at top level (
dp_display.c), other level has no access to platform device ordrm_device.
You can pass the platform device (or even better, drm device) to other driver blocks too. It's not something to be kept in secret in dp_display.c only.
Quoted 2 lines
I will just apss NULL, such as
drm_dbg_dp(NULL, ...), if not device available.
Signature · 2 lines
With best wishes Dmitry
Hi Stephen,
Can you please review this serial patches.
Quoted 20 lines · Kuogee Hsieh
1) Add
connector_typeto debug info to differentiate between eDP and DP
2) add more debug info to cover dp Phy
3) repalceDRM_DEBUG_DPwithdrm_debug_dpKuogee Hsieh (3):
drm/msm/dp: add connector type to enhance debug messages drm/msm/dp: enhance debug info related to dp phy drm/msm/dp: replaceDRM_DEBUG_DPmarco withdrm_dbg_dpdrivers/gpu/drm/msm/dp/dp_audio.c | 49 +++++++++------ drivers/gpu/drm/msm/dp/dp_catalog.c | 34 ++++++----- drivers/gpu/drm/msm/dp/dp_ctrl.c | 116 +++++++++++++++++++----------------- drivers/gpu/drm/msm/dp/dp_display.c | 103 ++++++++++++++++++++++---------- drivers/gpu/drm/msm/dp/dp_drm.c | 4 +- drivers/gpu/drm/msm/dp/dp_link.c | 99 +++++++++++++++++------------- drivers/gpu/drm/msm/dp/dp_panel.c | 43 +++++++------ drivers/gpu/drm/msm/dp/dp_parser.c | 2 +- drivers/gpu/drm/msm/dp/dp_power.c | 20 ++++--- 9 files changed, 283 insertions(+), 187 deletions(-)
Quoted 3 lines · Kuogee Hsieh
1) Add
connector_typeto debug info to differentiate between eDP and DP
2) add more debug info to cover dp Phy
3) repalceDRM_DEBUG_DPwithdrm_debug_dp
In the future, please include the drm/msm/dp prefix also in the cover letter. Thanks.
BR,
Jani.
Quoted 16 lines
Kuogee Hsieh (3):
drm/msm/dp: add connector type to enhance debug messages drm/msm/dp: enhance debug info related to dp phy drm/msm/dp: replaceDRM_DEBUG_DPmarco withdrm_dbg_dpdrivers/gpu/drm/msm/dp/dp_audio.c | 49 +++++++++------ drivers/gpu/drm/msm/dp/dp_catalog.c | 34 ++++++----- drivers/gpu/drm/msm/dp/dp_ctrl.c | 116 +++++++++++++++++++----------------- drivers/gpu/drm/msm/dp/dp_display.c | 103 ++++++++++++++++++++++---------- drivers/gpu/drm/msm/dp/dp_drm.c | 4 +- drivers/gpu/drm/msm/dp/dp_link.c | 99 +++++++++++++++++------------- drivers/gpu/drm/msm/dp/dp_panel.c | 43 +++++++------ drivers/gpu/drm/msm/dp/dp_parser.c | 2 +- drivers/gpu/drm/msm/dp/dp_power.c | 20 ++++--- 9 files changed, 283 insertions(+), 187 deletions(-)
Signature · 1 line
Jani Nikula, Intel Open Source Graphics Center