diff mbox series

[12/12] drm/probe-helper: Switch to per-device debugs

Message ID 20240404203336.10454-13-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series drm/client: Use after free and debug improvements | expand

Commit Message

Ville Syrjälä April 4, 2024, 8:33 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Switch to per-device debugs so that we know which
device we're dealing with.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/drm_probe_helper.c | 35 ++++++++++++++----------------
 1 file changed, 16 insertions(+), 19 deletions(-)

Comments

Jani Nikula April 5, 2024, 8:25 a.m. UTC | #1
On Thu, 04 Apr 2024, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Switch to per-device debugs so that we know which
> device we're dealing with.

Again see the first handful of patches in the series [1]. It cleans up
the mode printing as well.

BR,
Jani.


[1] https://lore.kernel.org/r/cover.1709843865.git.jani.nikula@intel.com


>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/drm_probe_helper.c | 35 ++++++++++++++----------------
>  1 file changed, 16 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
> index 968a3ee66b1e..0860f7367511 100644
> --- a/drivers/gpu/drm/drm_probe_helper.c
> +++ b/drivers/gpu/drm/drm_probe_helper.c
> @@ -567,8 +567,8 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
>  
>  	drm_modeset_acquire_init(&ctx, 0);
>  
> -	DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", connector->base.id,
> -			connector->name);
> +	drm_dbg_kms(dev, "[CONNECTOR:%d:%s]\n",
> +		    connector->base.id, connector->name);
>  
>  retry:
>  	ret = drm_modeset_lock(&dev->mode_config.connection_mutex, &ctx);
> @@ -611,11 +611,10 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
>  	 * check here, and if anything changed start the hotplug code.
>  	 */
>  	if (old_status != connector->status) {
> -		DRM_DEBUG_KMS("[CONNECTOR:%d:%s] status updated from %s to %s\n",
> -			      connector->base.id,
> -			      connector->name,
> -			      drm_get_connector_status_name(old_status),
> -			      drm_get_connector_status_name(connector->status));
> +		drm_dbg_kms(dev, "[CONNECTOR:%d:%s] status updated from %s to %s\n",
> +			    connector->base.id, connector->name,
> +			    drm_get_connector_status_name(old_status),
> +			    drm_get_connector_status_name(connector->status));
>  
>  		/*
>  		 * The hotplug event code might call into the fb
> @@ -638,8 +637,8 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
>  		drm_kms_helper_poll_enable(dev);
>  
>  	if (connector->status == connector_status_disconnected) {
> -		DRM_DEBUG_KMS("[CONNECTOR:%d:%s] disconnected\n",
> -			connector->base.id, connector->name);
> +		drm_dbg_kms(dev, "[CONNECTOR:%d:%s] disconnected\n",
> +			    connector->base.id, connector->name);
>  		drm_connector_update_edid_property(connector, NULL);
>  		drm_mode_prune_invalid(dev, &connector->modes, false);
>  		goto exit;
> @@ -697,8 +696,8 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
>  
>  	drm_mode_sort(&connector->modes);
>  
> -	DRM_DEBUG_KMS("[CONNECTOR:%d:%s] probed modes :\n", connector->base.id,
> -			connector->name);
> +	drm_dbg_kms(dev, "[CONNECTOR:%d:%s] probed modes :\n",
> +		    connector->base.id, connector->name);
>  	list_for_each_entry(mode, &connector->modes, head) {
>  		drm_mode_set_crtcinfo(mode, CRTC_INTERLACE_HALVE_V);
>  		drm_mode_debug_printmodeline(mode);
> @@ -834,14 +833,12 @@ static void output_poll_execute(struct work_struct *work)
>  			old = drm_get_connector_status_name(old_status);
>  			new = drm_get_connector_status_name(connector->status);
>  
> -			DRM_DEBUG_KMS("[CONNECTOR:%d:%s] "
> -				      "status updated from %s to %s\n",
> -				      connector->base.id,
> -				      connector->name,
> -				      old, new);
> -			DRM_DEBUG_KMS("[CONNECTOR:%d:%s] epoch counter %llu -> %llu\n",
> -				      connector->base.id, connector->name,
> -				      old_epoch_counter, connector->epoch_counter);
> +			drm_dbg_kms(dev, "[CONNECTOR:%d:%s] status updated from %s to %s\n",
> +				    connector->base.id, connector->name,
> +				    old, new);
> +			drm_dbg_kms(dev, "[CONNECTOR:%d:%s] epoch counter %llu -> %llu\n",
> +				    connector->base.id, connector->name,
> +				    old_epoch_counter, connector->epoch_counter);
>  
>  			changed = true;
>  		}
Thomas Zimmermann April 5, 2024, 8:30 a.m. UTC | #2
Hi

Am 05.04.24 um 10:25 schrieb Jani Nikula:
> On Thu, 04 Apr 2024, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
>> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>>
>> Switch to per-device debugs so that we know which
>> device we're dealing with.
> Again see the first handful of patches in the series [1]. It cleans up
> the mode printing as well.

This apparently got lost. I'll take a look.

Best regards
Thomas

>
> BR,
> Jani.
>
>
> [1] https://lore.kernel.org/r/cover.1709843865.git.jani.nikula@intel.com
>
>
>> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>> ---
>>   drivers/gpu/drm/drm_probe_helper.c | 35 ++++++++++++++----------------
>>   1 file changed, 16 insertions(+), 19 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
>> index 968a3ee66b1e..0860f7367511 100644
>> --- a/drivers/gpu/drm/drm_probe_helper.c
>> +++ b/drivers/gpu/drm/drm_probe_helper.c
>> @@ -567,8 +567,8 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
>>   
>>   	drm_modeset_acquire_init(&ctx, 0);
>>   
>> -	DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", connector->base.id,
>> -			connector->name);
>> +	drm_dbg_kms(dev, "[CONNECTOR:%d:%s]\n",
>> +		    connector->base.id, connector->name);
>>   
>>   retry:
>>   	ret = drm_modeset_lock(&dev->mode_config.connection_mutex, &ctx);
>> @@ -611,11 +611,10 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
>>   	 * check here, and if anything changed start the hotplug code.
>>   	 */
>>   	if (old_status != connector->status) {
>> -		DRM_DEBUG_KMS("[CONNECTOR:%d:%s] status updated from %s to %s\n",
>> -			      connector->base.id,
>> -			      connector->name,
>> -			      drm_get_connector_status_name(old_status),
>> -			      drm_get_connector_status_name(connector->status));
>> +		drm_dbg_kms(dev, "[CONNECTOR:%d:%s] status updated from %s to %s\n",
>> +			    connector->base.id, connector->name,
>> +			    drm_get_connector_status_name(old_status),
>> +			    drm_get_connector_status_name(connector->status));
>>   
>>   		/*
>>   		 * The hotplug event code might call into the fb
>> @@ -638,8 +637,8 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
>>   		drm_kms_helper_poll_enable(dev);
>>   
>>   	if (connector->status == connector_status_disconnected) {
>> -		DRM_DEBUG_KMS("[CONNECTOR:%d:%s] disconnected\n",
>> -			connector->base.id, connector->name);
>> +		drm_dbg_kms(dev, "[CONNECTOR:%d:%s] disconnected\n",
>> +			    connector->base.id, connector->name);
>>   		drm_connector_update_edid_property(connector, NULL);
>>   		drm_mode_prune_invalid(dev, &connector->modes, false);
>>   		goto exit;
>> @@ -697,8 +696,8 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
>>   
>>   	drm_mode_sort(&connector->modes);
>>   
>> -	DRM_DEBUG_KMS("[CONNECTOR:%d:%s] probed modes :\n", connector->base.id,
>> -			connector->name);
>> +	drm_dbg_kms(dev, "[CONNECTOR:%d:%s] probed modes :\n",
>> +		    connector->base.id, connector->name);
>>   	list_for_each_entry(mode, &connector->modes, head) {
>>   		drm_mode_set_crtcinfo(mode, CRTC_INTERLACE_HALVE_V);
>>   		drm_mode_debug_printmodeline(mode);
>> @@ -834,14 +833,12 @@ static void output_poll_execute(struct work_struct *work)
>>   			old = drm_get_connector_status_name(old_status);
>>   			new = drm_get_connector_status_name(connector->status);
>>   
>> -			DRM_DEBUG_KMS("[CONNECTOR:%d:%s] "
>> -				      "status updated from %s to %s\n",
>> -				      connector->base.id,
>> -				      connector->name,
>> -				      old, new);
>> -			DRM_DEBUG_KMS("[CONNECTOR:%d:%s] epoch counter %llu -> %llu\n",
>> -				      connector->base.id, connector->name,
>> -				      old_epoch_counter, connector->epoch_counter);
>> +			drm_dbg_kms(dev, "[CONNECTOR:%d:%s] status updated from %s to %s\n",
>> +				    connector->base.id, connector->name,
>> +				    old, new);
>> +			drm_dbg_kms(dev, "[CONNECTOR:%d:%s] epoch counter %llu -> %llu\n",
>> +				    connector->base.id, connector->name,
>> +				    old_epoch_counter, connector->epoch_counter);
>>   
>>   			changed = true;
>>   		}
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
index 968a3ee66b1e..0860f7367511 100644
--- a/drivers/gpu/drm/drm_probe_helper.c
+++ b/drivers/gpu/drm/drm_probe_helper.c
@@ -567,8 +567,8 @@  int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
 
 	drm_modeset_acquire_init(&ctx, 0);
 
-	DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", connector->base.id,
-			connector->name);
+	drm_dbg_kms(dev, "[CONNECTOR:%d:%s]\n",
+		    connector->base.id, connector->name);
 
 retry:
 	ret = drm_modeset_lock(&dev->mode_config.connection_mutex, &ctx);
@@ -611,11 +611,10 @@  int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
 	 * check here, and if anything changed start the hotplug code.
 	 */
 	if (old_status != connector->status) {
-		DRM_DEBUG_KMS("[CONNECTOR:%d:%s] status updated from %s to %s\n",
-			      connector->base.id,
-			      connector->name,
-			      drm_get_connector_status_name(old_status),
-			      drm_get_connector_status_name(connector->status));
+		drm_dbg_kms(dev, "[CONNECTOR:%d:%s] status updated from %s to %s\n",
+			    connector->base.id, connector->name,
+			    drm_get_connector_status_name(old_status),
+			    drm_get_connector_status_name(connector->status));
 
 		/*
 		 * The hotplug event code might call into the fb
@@ -638,8 +637,8 @@  int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
 		drm_kms_helper_poll_enable(dev);
 
 	if (connector->status == connector_status_disconnected) {
-		DRM_DEBUG_KMS("[CONNECTOR:%d:%s] disconnected\n",
-			connector->base.id, connector->name);
+		drm_dbg_kms(dev, "[CONNECTOR:%d:%s] disconnected\n",
+			    connector->base.id, connector->name);
 		drm_connector_update_edid_property(connector, NULL);
 		drm_mode_prune_invalid(dev, &connector->modes, false);
 		goto exit;
@@ -697,8 +696,8 @@  int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
 
 	drm_mode_sort(&connector->modes);
 
-	DRM_DEBUG_KMS("[CONNECTOR:%d:%s] probed modes :\n", connector->base.id,
-			connector->name);
+	drm_dbg_kms(dev, "[CONNECTOR:%d:%s] probed modes :\n",
+		    connector->base.id, connector->name);
 	list_for_each_entry(mode, &connector->modes, head) {
 		drm_mode_set_crtcinfo(mode, CRTC_INTERLACE_HALVE_V);
 		drm_mode_debug_printmodeline(mode);
@@ -834,14 +833,12 @@  static void output_poll_execute(struct work_struct *work)
 			old = drm_get_connector_status_name(old_status);
 			new = drm_get_connector_status_name(connector->status);
 
-			DRM_DEBUG_KMS("[CONNECTOR:%d:%s] "
-				      "status updated from %s to %s\n",
-				      connector->base.id,
-				      connector->name,
-				      old, new);
-			DRM_DEBUG_KMS("[CONNECTOR:%d:%s] epoch counter %llu -> %llu\n",
-				      connector->base.id, connector->name,
-				      old_epoch_counter, connector->epoch_counter);
+			drm_dbg_kms(dev, "[CONNECTOR:%d:%s] status updated from %s to %s\n",
+				    connector->base.id, connector->name,
+				    old, new);
+			drm_dbg_kms(dev, "[CONNECTOR:%d:%s] epoch counter %llu -> %llu\n",
+				    connector->base.id, connector->name,
+				    old_epoch_counter, connector->epoch_counter);
 
 			changed = true;
 		}