drm: Make the HPD status updates debug logs more readable

Instead of just printing "status updated from 1 to 2", make those enum
numbers immediately readable.

v2: Also patch output_poll_execute() (Daniel Vetter)
v3: Use drm_get_connector_status_name (Ville Syrjälä)

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> (for v1)
Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
Lespiau, Damien 2013-05-10 12:36:42 +00:00 committed by Dave Airlie
parent b9434d0f16
commit ed7951dc13
2 changed files with 7 additions and 4 deletions

View File

@ -250,6 +250,7 @@ char *drm_get_connector_status_name(enum drm_connector_status status)
else else
return "unknown"; return "unknown";
} }
EXPORT_SYMBOL(drm_get_connector_status_name);
/** /**
* drm_mode_object_get - allocate a new modeset identifier * drm_mode_object_get - allocate a new modeset identifier

View File

@ -1007,10 +1007,11 @@ static void output_poll_execute(struct work_struct *work)
continue; continue;
connector->status = connector->funcs->detect(connector, false); connector->status = connector->funcs->detect(connector, false);
DRM_DEBUG_KMS("[CONNECTOR:%d:%s] status updated from %d to %d\n", DRM_DEBUG_KMS("[CONNECTOR:%d:%s] status updated from %s to %s\n",
connector->base.id, connector->base.id,
drm_get_connector_name(connector), drm_get_connector_name(connector),
old_status, connector->status); drm_get_connector_status_name(old_status),
drm_get_connector_status_name(connector->status));
if (old_status != connector->status) if (old_status != connector->status)
changed = true; changed = true;
} }
@ -1085,10 +1086,11 @@ void drm_helper_hpd_irq_event(struct drm_device *dev)
old_status = connector->status; old_status = connector->status;
connector->status = connector->funcs->detect(connector, false); connector->status = connector->funcs->detect(connector, false);
DRM_DEBUG_KMS("[CONNECTOR:%d:%s] status updated from %d to %d\n", DRM_DEBUG_KMS("[CONNECTOR:%d:%s] status updated from %s to %s\n",
connector->base.id, connector->base.id,
drm_get_connector_name(connector), drm_get_connector_name(connector),
old_status, connector->status); drm_get_connector_status_name(old_status),
drm_get_connector_status_name(connector->status));
if (old_status != connector->status) if (old_status != connector->status)
changed = true; changed = true;
} }