Commit e3aae683 authored by Simon Ser's avatar Simon Ser

drm: convert drm_atomic_uapi.c to new debug helpers

Migrate from DRM_DEBUG_ATOMIC to drm_dbg_atomic.
Signed-off-by: default avatarSimon Ser <contact@emersion.fr>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
Reviewed-by: default avatarSam Ravnborg <sam@ravnborg.org>
Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/FpVdsmqIh7IkH7YIwBjmp5ict1qi4NZlwHrIps@cp4-web-034.plabs.ch
parent e3e04399
...@@ -85,12 +85,14 @@ int drm_atomic_set_mode_for_crtc(struct drm_crtc_state *state, ...@@ -85,12 +85,14 @@ int drm_atomic_set_mode_for_crtc(struct drm_crtc_state *state,
drm_mode_copy(&state->mode, mode); drm_mode_copy(&state->mode, mode);
state->enable = true; state->enable = true;
DRM_DEBUG_ATOMIC("Set [MODE:%s] for [CRTC:%d:%s] state %p\n", drm_dbg_atomic(crtc->dev,
"Set [MODE:%s] for [CRTC:%d:%s] state %p\n",
mode->name, crtc->base.id, crtc->name, state); mode->name, crtc->base.id, crtc->name, state);
} else { } else {
memset(&state->mode, 0, sizeof(state->mode)); memset(&state->mode, 0, sizeof(state->mode));
state->enable = false; state->enable = false;
DRM_DEBUG_ATOMIC("Set [NOMODE] for [CRTC:%d:%s] state %p\n", drm_dbg_atomic(crtc->dev,
"Set [NOMODE] for [CRTC:%d:%s] state %p\n",
crtc->base.id, crtc->name, state); crtc->base.id, crtc->name, state);
} }
...@@ -128,7 +130,8 @@ int drm_atomic_set_mode_prop_for_crtc(struct drm_crtc_state *state, ...@@ -128,7 +130,8 @@ int drm_atomic_set_mode_prop_for_crtc(struct drm_crtc_state *state,
int ret; int ret;
if (blob->length != sizeof(struct drm_mode_modeinfo)) { if (blob->length != sizeof(struct drm_mode_modeinfo)) {
DRM_DEBUG_ATOMIC("[CRTC:%d:%s] bad mode blob length: %zu\n", drm_dbg_atomic(crtc->dev,
"[CRTC:%d:%s] bad mode blob length: %zu\n",
crtc->base.id, crtc->name, crtc->base.id, crtc->name,
blob->length); blob->length);
return -EINVAL; return -EINVAL;
...@@ -137,7 +140,8 @@ int drm_atomic_set_mode_prop_for_crtc(struct drm_crtc_state *state, ...@@ -137,7 +140,8 @@ int drm_atomic_set_mode_prop_for_crtc(struct drm_crtc_state *state,
ret = drm_mode_convert_umode(crtc->dev, ret = drm_mode_convert_umode(crtc->dev,
&state->mode, blob->data); &state->mode, blob->data);
if (ret) { if (ret) {
DRM_DEBUG_ATOMIC("[CRTC:%d:%s] invalid mode (ret=%d, status=%s):\n", drm_dbg_atomic(crtc->dev,
"[CRTC:%d:%s] invalid mode (ret=%d, status=%s):\n",
crtc->base.id, crtc->name, crtc->base.id, crtc->name,
ret, drm_get_mode_status_name(state->mode.status)); ret, drm_get_mode_status_name(state->mode.status));
drm_mode_debug_printmodeline(&state->mode); drm_mode_debug_printmodeline(&state->mode);
...@@ -146,12 +150,14 @@ int drm_atomic_set_mode_prop_for_crtc(struct drm_crtc_state *state, ...@@ -146,12 +150,14 @@ int drm_atomic_set_mode_prop_for_crtc(struct drm_crtc_state *state,
state->mode_blob = drm_property_blob_get(blob); state->mode_blob = drm_property_blob_get(blob);
state->enable = true; state->enable = true;
DRM_DEBUG_ATOMIC("Set [MODE:%s] for [CRTC:%d:%s] state %p\n", drm_dbg_atomic(crtc->dev,
"Set [MODE:%s] for [CRTC:%d:%s] state %p\n",
state->mode.name, crtc->base.id, crtc->name, state->mode.name, crtc->base.id, crtc->name,
state); state);
} else { } else {
state->enable = false; state->enable = false;
DRM_DEBUG_ATOMIC("Set [NOMODE] for [CRTC:%d:%s] state %p\n", drm_dbg_atomic(crtc->dev,
"Set [NOMODE] for [CRTC:%d:%s] state %p\n",
crtc->base.id, crtc->name, state); crtc->base.id, crtc->name, state);
} }
...@@ -202,11 +208,13 @@ drm_atomic_set_crtc_for_plane(struct drm_plane_state *plane_state, ...@@ -202,11 +208,13 @@ drm_atomic_set_crtc_for_plane(struct drm_plane_state *plane_state,
} }
if (crtc) if (crtc)
DRM_DEBUG_ATOMIC("Link [PLANE:%d:%s] state %p to [CRTC:%d:%s]\n", drm_dbg_atomic(plane->dev,
"Link [PLANE:%d:%s] state %p to [CRTC:%d:%s]\n",
plane->base.id, plane->name, plane_state, plane->base.id, plane->name, plane_state,
crtc->base.id, crtc->name); crtc->base.id, crtc->name);
else else
DRM_DEBUG_ATOMIC("Link [PLANE:%d:%s] state %p to [NOCRTC]\n", drm_dbg_atomic(plane->dev,
"Link [PLANE:%d:%s] state %p to [NOCRTC]\n",
plane->base.id, plane->name, plane_state); plane->base.id, plane->name, plane_state);
return 0; return 0;
...@@ -230,11 +238,13 @@ drm_atomic_set_fb_for_plane(struct drm_plane_state *plane_state, ...@@ -230,11 +238,13 @@ drm_atomic_set_fb_for_plane(struct drm_plane_state *plane_state,
struct drm_plane *plane = plane_state->plane; struct drm_plane *plane = plane_state->plane;
if (fb) if (fb)
DRM_DEBUG_ATOMIC("Set [FB:%d] for [PLANE:%d:%s] state %p\n", drm_dbg_atomic(plane->dev,
"Set [FB:%d] for [PLANE:%d:%s] state %p\n",
fb->base.id, plane->base.id, plane->name, fb->base.id, plane->base.id, plane->name,
plane_state); plane_state);
else else
DRM_DEBUG_ATOMIC("Set [NOFB] for [PLANE:%d:%s] state %p\n", drm_dbg_atomic(plane->dev,
"Set [NOFB] for [PLANE:%d:%s] state %p\n",
plane->base.id, plane->name, plane_state); plane->base.id, plane->name, plane_state);
drm_framebuffer_assign(&plane_state->fb, fb); drm_framebuffer_assign(&plane_state->fb, fb);
...@@ -324,11 +334,13 @@ drm_atomic_set_crtc_for_connector(struct drm_connector_state *conn_state, ...@@ -324,11 +334,13 @@ drm_atomic_set_crtc_for_connector(struct drm_connector_state *conn_state,
drm_connector_get(conn_state->connector); drm_connector_get(conn_state->connector);
conn_state->crtc = crtc; conn_state->crtc = crtc;
DRM_DEBUG_ATOMIC("Link [CONNECTOR:%d:%s] state %p to [CRTC:%d:%s]\n", drm_dbg_atomic(crtc->dev,
"Link [CONNECTOR:%d:%s] state %p to [CRTC:%d:%s]\n",
connector->base.id, connector->name, connector->base.id, connector->name,
conn_state, crtc->base.id, crtc->name); conn_state, crtc->base.id, crtc->name);
} else { } else {
DRM_DEBUG_ATOMIC("Link [CONNECTOR:%d:%s] state %p to [NOCRTC]\n", drm_dbg_atomic(crtc->dev,
"Link [CONNECTOR:%d:%s] state %p to [NOCRTC]\n",
connector->base.id, connector->name, connector->base.id, connector->name,
conn_state); conn_state);
} }
...@@ -474,7 +486,8 @@ static int drm_atomic_crtc_set_property(struct drm_crtc *crtc, ...@@ -474,7 +486,8 @@ static int drm_atomic_crtc_set_property(struct drm_crtc *crtc,
} else if (crtc->funcs->atomic_set_property) { } else if (crtc->funcs->atomic_set_property) {
return crtc->funcs->atomic_set_property(crtc, state, property, val); return crtc->funcs->atomic_set_property(crtc, state, property, val);
} else { } else {
DRM_DEBUG_ATOMIC("[CRTC:%d:%s] unknown property [PROP:%d:%s]]\n", drm_dbg_atomic(crtc->dev,
"[CRTC:%d:%s] unknown property [PROP:%d:%s]]\n",
crtc->base.id, crtc->name, crtc->base.id, crtc->name,
property->base.id, property->name); property->base.id, property->name);
return -EINVAL; return -EINVAL;
...@@ -570,7 +583,8 @@ static int drm_atomic_plane_set_property(struct drm_plane *plane, ...@@ -570,7 +583,8 @@ static int drm_atomic_plane_set_property(struct drm_plane *plane,
state->pixel_blend_mode = val; state->pixel_blend_mode = val;
} else if (property == plane->rotation_property) { } else if (property == plane->rotation_property) {
if (!is_power_of_2(val & DRM_MODE_ROTATE_MASK)) { if (!is_power_of_2(val & DRM_MODE_ROTATE_MASK)) {
DRM_DEBUG_ATOMIC("[PLANE:%d:%s] bad rotation bitmask: 0x%llx\n", drm_dbg_atomic(plane->dev,
"[PLANE:%d:%s] bad rotation bitmask: 0x%llx\n",
plane->base.id, plane->name, val); plane->base.id, plane->name, val);
return -EINVAL; return -EINVAL;
} }
...@@ -595,7 +609,8 @@ static int drm_atomic_plane_set_property(struct drm_plane *plane, ...@@ -595,7 +609,8 @@ static int drm_atomic_plane_set_property(struct drm_plane *plane,
return plane->funcs->atomic_set_property(plane, state, return plane->funcs->atomic_set_property(plane, state,
property, val); property, val);
} else { } else {
DRM_DEBUG_ATOMIC("[PLANE:%d:%s] unknown property [PROP:%d:%s]]\n", drm_dbg_atomic(plane->dev,
"[PLANE:%d:%s] unknown property [PROP:%d:%s]]\n",
plane->base.id, plane->name, plane->base.id, plane->name,
property->base.id, property->name); property->base.id, property->name);
return -EINVAL; return -EINVAL;
...@@ -665,16 +680,19 @@ static int drm_atomic_set_writeback_fb_for_connector( ...@@ -665,16 +680,19 @@ static int drm_atomic_set_writeback_fb_for_connector(
struct drm_framebuffer *fb) struct drm_framebuffer *fb)
{ {
int ret; int ret;
struct drm_connector *conn = conn_state->connector;
ret = drm_writeback_set_fb(conn_state, fb); ret = drm_writeback_set_fb(conn_state, fb);
if (ret < 0) if (ret < 0)
return ret; return ret;
if (fb) if (fb)
DRM_DEBUG_ATOMIC("Set [FB:%d] for connector state %p\n", drm_dbg_atomic(conn->dev,
"Set [FB:%d] for connector state %p\n",
fb->base.id, conn_state); fb->base.id, conn_state);
else else
DRM_DEBUG_ATOMIC("Set [NOFB] for connector state %p\n", drm_dbg_atomic(conn->dev,
"Set [NOFB] for connector state %p\n",
conn_state); conn_state);
return 0; return 0;
...@@ -782,7 +800,8 @@ static int drm_atomic_connector_set_property(struct drm_connector *connector, ...@@ -782,7 +800,8 @@ static int drm_atomic_connector_set_property(struct drm_connector *connector,
return connector->funcs->atomic_set_property(connector, return connector->funcs->atomic_set_property(connector,
state, property, val); state, property, val);
} else { } else {
DRM_DEBUG_ATOMIC("[CONNECTOR:%d:%s] unknown property [PROP:%d:%s]]\n", drm_dbg_atomic(connector->dev,
"[CONNECTOR:%d:%s] unknown property [PROP:%d:%s]]\n",
connector->base.id, connector->name, connector->base.id, connector->name,
property->base.id, property->name); property->base.id, property->name);
return -EINVAL; return -EINVAL;
...@@ -1282,7 +1301,7 @@ static void complete_signaling(struct drm_device *dev, ...@@ -1282,7 +1301,7 @@ static void complete_signaling(struct drm_device *dev,
/* If this fails log error to the user */ /* If this fails log error to the user */
if (fence_state[i].out_fence_ptr && if (fence_state[i].out_fence_ptr &&
put_user(-1, fence_state[i].out_fence_ptr)) put_user(-1, fence_state[i].out_fence_ptr))
DRM_DEBUG_ATOMIC("Couldn't clear out_fence_ptr\n"); drm_dbg_atomic(dev, "Couldn't clear out_fence_ptr\n");
} }
kfree(fence_state); kfree(fence_state);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment