Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm: convert drm_atomic_uapi.c to new debug helpers

Migrate from DRM_DEBUG_ATOMIC to drm_dbg_atomic.

Signed-off-by: Simon 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: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/FpVdsmqIh7IkH7YIwBjmp5ict1qi4NZlwHrIps@cp4-web-034.plabs.ch

+66 -47
+66 -47
drivers/gpu/drm/drm_atomic_uapi.c
··· 85 85 86 86 drm_mode_copy(&state->mode, mode); 87 87 state->enable = true; 88 - DRM_DEBUG_ATOMIC("Set [MODE:%s] for [CRTC:%d:%s] state %p\n", 89 - mode->name, crtc->base.id, crtc->name, state); 88 + drm_dbg_atomic(crtc->dev, 89 + "Set [MODE:%s] for [CRTC:%d:%s] state %p\n", 90 + mode->name, crtc->base.id, crtc->name, state); 90 91 } else { 91 92 memset(&state->mode, 0, sizeof(state->mode)); 92 93 state->enable = false; 93 - DRM_DEBUG_ATOMIC("Set [NOMODE] for [CRTC:%d:%s] state %p\n", 94 - crtc->base.id, crtc->name, state); 94 + drm_dbg_atomic(crtc->dev, 95 + "Set [NOMODE] for [CRTC:%d:%s] state %p\n", 96 + crtc->base.id, crtc->name, state); 95 97 } 96 98 97 99 return 0; ··· 130 128 int ret; 131 129 132 130 if (blob->length != sizeof(struct drm_mode_modeinfo)) { 133 - DRM_DEBUG_ATOMIC("[CRTC:%d:%s] bad mode blob length: %zu\n", 134 - crtc->base.id, crtc->name, 135 - blob->length); 131 + drm_dbg_atomic(crtc->dev, 132 + "[CRTC:%d:%s] bad mode blob length: %zu\n", 133 + crtc->base.id, crtc->name, 134 + blob->length); 136 135 return -EINVAL; 137 136 } 138 137 139 138 ret = drm_mode_convert_umode(crtc->dev, 140 139 &state->mode, blob->data); 141 140 if (ret) { 142 - DRM_DEBUG_ATOMIC("[CRTC:%d:%s] invalid mode (ret=%d, status=%s):\n", 143 - crtc->base.id, crtc->name, 144 - ret, drm_get_mode_status_name(state->mode.status)); 141 + drm_dbg_atomic(crtc->dev, 142 + "[CRTC:%d:%s] invalid mode (ret=%d, status=%s):\n", 143 + crtc->base.id, crtc->name, 144 + ret, drm_get_mode_status_name(state->mode.status)); 145 145 drm_mode_debug_printmodeline(&state->mode); 146 146 return -EINVAL; 147 147 } 148 148 149 149 state->mode_blob = drm_property_blob_get(blob); 150 150 state->enable = true; 151 - DRM_DEBUG_ATOMIC("Set [MODE:%s] for [CRTC:%d:%s] state %p\n", 152 - state->mode.name, crtc->base.id, crtc->name, 153 - state); 151 + drm_dbg_atomic(crtc->dev, 152 + "Set [MODE:%s] for [CRTC:%d:%s] state %p\n", 153 + state->mode.name, crtc->base.id, crtc->name, 154 + state); 154 155 } else { 155 156 state->enable = false; 156 - DRM_DEBUG_ATOMIC("Set [NOMODE] for [CRTC:%d:%s] state %p\n", 157 - crtc->base.id, crtc->name, state); 157 + drm_dbg_atomic(crtc->dev, 158 + "Set [NOMODE] for [CRTC:%d:%s] state %p\n", 159 + crtc->base.id, crtc->name, state); 158 160 } 159 161 160 162 return 0; ··· 208 202 } 209 203 210 204 if (crtc) 211 - DRM_DEBUG_ATOMIC("Link [PLANE:%d:%s] state %p to [CRTC:%d:%s]\n", 212 - plane->base.id, plane->name, plane_state, 213 - crtc->base.id, crtc->name); 205 + drm_dbg_atomic(plane->dev, 206 + "Link [PLANE:%d:%s] state %p to [CRTC:%d:%s]\n", 207 + plane->base.id, plane->name, plane_state, 208 + crtc->base.id, crtc->name); 214 209 else 215 - DRM_DEBUG_ATOMIC("Link [PLANE:%d:%s] state %p to [NOCRTC]\n", 216 - plane->base.id, plane->name, plane_state); 210 + drm_dbg_atomic(plane->dev, 211 + "Link [PLANE:%d:%s] state %p to [NOCRTC]\n", 212 + plane->base.id, plane->name, plane_state); 217 213 218 214 return 0; 219 215 } ··· 238 230 struct drm_plane *plane = plane_state->plane; 239 231 240 232 if (fb) 241 - DRM_DEBUG_ATOMIC("Set [FB:%d] for [PLANE:%d:%s] state %p\n", 242 - fb->base.id, plane->base.id, plane->name, 243 - plane_state); 233 + drm_dbg_atomic(plane->dev, 234 + "Set [FB:%d] for [PLANE:%d:%s] state %p\n", 235 + fb->base.id, plane->base.id, plane->name, 236 + plane_state); 244 237 else 245 - DRM_DEBUG_ATOMIC("Set [NOFB] for [PLANE:%d:%s] state %p\n", 246 - plane->base.id, plane->name, plane_state); 238 + drm_dbg_atomic(plane->dev, 239 + "Set [NOFB] for [PLANE:%d:%s] state %p\n", 240 + plane->base.id, plane->name, plane_state); 247 241 248 242 drm_framebuffer_assign(&plane_state->fb, fb); 249 243 } ··· 334 324 drm_connector_get(conn_state->connector); 335 325 conn_state->crtc = crtc; 336 326 337 - DRM_DEBUG_ATOMIC("Link [CONNECTOR:%d:%s] state %p to [CRTC:%d:%s]\n", 338 - connector->base.id, connector->name, 339 - conn_state, crtc->base.id, crtc->name); 327 + drm_dbg_atomic(crtc->dev, 328 + "Link [CONNECTOR:%d:%s] state %p to [CRTC:%d:%s]\n", 329 + connector->base.id, connector->name, 330 + conn_state, crtc->base.id, crtc->name); 340 331 } else { 341 - DRM_DEBUG_ATOMIC("Link [CONNECTOR:%d:%s] state %p to [NOCRTC]\n", 342 - connector->base.id, connector->name, 343 - conn_state); 332 + drm_dbg_atomic(crtc->dev, 333 + "Link [CONNECTOR:%d:%s] state %p to [NOCRTC]\n", 334 + connector->base.id, connector->name, 335 + conn_state); 344 336 } 345 337 346 338 return 0; ··· 486 474 } else if (crtc->funcs->atomic_set_property) { 487 475 return crtc->funcs->atomic_set_property(crtc, state, property, val); 488 476 } else { 489 - DRM_DEBUG_ATOMIC("[CRTC:%d:%s] unknown property [PROP:%d:%s]]\n", 490 - crtc->base.id, crtc->name, 491 - property->base.id, property->name); 477 + drm_dbg_atomic(crtc->dev, 478 + "[CRTC:%d:%s] unknown property [PROP:%d:%s]]\n", 479 + crtc->base.id, crtc->name, 480 + property->base.id, property->name); 492 481 return -EINVAL; 493 482 } 494 483 ··· 583 570 state->pixel_blend_mode = val; 584 571 } else if (property == plane->rotation_property) { 585 572 if (!is_power_of_2(val & DRM_MODE_ROTATE_MASK)) { 586 - DRM_DEBUG_ATOMIC("[PLANE:%d:%s] bad rotation bitmask: 0x%llx\n", 587 - plane->base.id, plane->name, val); 573 + drm_dbg_atomic(plane->dev, 574 + "[PLANE:%d:%s] bad rotation bitmask: 0x%llx\n", 575 + plane->base.id, plane->name, val); 588 576 return -EINVAL; 589 577 } 590 578 state->rotation = val; ··· 609 595 return plane->funcs->atomic_set_property(plane, state, 610 596 property, val); 611 597 } else { 612 - DRM_DEBUG_ATOMIC("[PLANE:%d:%s] unknown property [PROP:%d:%s]]\n", 613 - plane->base.id, plane->name, 614 - property->base.id, property->name); 598 + drm_dbg_atomic(plane->dev, 599 + "[PLANE:%d:%s] unknown property [PROP:%d:%s]]\n", 600 + plane->base.id, plane->name, 601 + property->base.id, property->name); 615 602 return -EINVAL; 616 603 } 617 604 ··· 680 665 struct drm_framebuffer *fb) 681 666 { 682 667 int ret; 668 + struct drm_connector *conn = conn_state->connector; 683 669 684 670 ret = drm_writeback_set_fb(conn_state, fb); 685 671 if (ret < 0) 686 672 return ret; 687 673 688 674 if (fb) 689 - DRM_DEBUG_ATOMIC("Set [FB:%d] for connector state %p\n", 690 - fb->base.id, conn_state); 675 + drm_dbg_atomic(conn->dev, 676 + "Set [FB:%d] for connector state %p\n", 677 + fb->base.id, conn_state); 691 678 else 692 - DRM_DEBUG_ATOMIC("Set [NOFB] for connector state %p\n", 693 - conn_state); 679 + drm_dbg_atomic(conn->dev, 680 + "Set [NOFB] for connector state %p\n", 681 + conn_state); 694 682 695 683 return 0; 696 684 } ··· 800 782 return connector->funcs->atomic_set_property(connector, 801 783 state, property, val); 802 784 } else { 803 - DRM_DEBUG_ATOMIC("[CONNECTOR:%d:%s] unknown property [PROP:%d:%s]]\n", 804 - connector->base.id, connector->name, 805 - property->base.id, property->name); 785 + drm_dbg_atomic(connector->dev, 786 + "[CONNECTOR:%d:%s] unknown property [PROP:%d:%s]]\n", 787 + connector->base.id, connector->name, 788 + property->base.id, property->name); 806 789 return -EINVAL; 807 790 } 808 791 ··· 1301 1282 /* If this fails log error to the user */ 1302 1283 if (fence_state[i].out_fence_ptr && 1303 1284 put_user(-1, fence_state[i].out_fence_ptr)) 1304 - DRM_DEBUG_ATOMIC("Couldn't clear out_fence_ptr\n"); 1285 + drm_dbg_atomic(dev, "Couldn't clear out_fence_ptr\n"); 1305 1286 } 1306 1287 1307 1288 kfree(fence_state);