state->dev = dev;
 
-       DRM_DEBUG_KMS("Allocate atomic state %p\n", state);
+       DRM_DEBUG_ATOMIC("Allocate atomic state %p\n", state);
 
        return state;
 fail:
        struct drm_mode_config *config = &dev->mode_config;
        int i;
 
-       DRM_DEBUG_KMS("Clearing atomic state %p\n", state);
+       DRM_DEBUG_ATOMIC("Clearing atomic state %p\n", state);
 
        for (i = 0; i < state->num_connector; i++) {
                struct drm_connector *connector = state->connectors[i];
 {
        drm_atomic_state_clear(state);
 
-       DRM_DEBUG_KMS("Freeing atomic state %p\n", state);
+       DRM_DEBUG_ATOMIC("Freeing atomic state %p\n", state);
 
        kfree_state(state);
 }
        state->crtcs[index] = crtc;
        crtc_state->state = state;
 
-       DRM_DEBUG_KMS("Added [CRTC:%d] %p state to %p\n",
-                     crtc->base.id, crtc_state, state);
+       DRM_DEBUG_ATOMIC("Added [CRTC:%d] %p state to %p\n",
+                        crtc->base.id, crtc_state, state);
 
        return crtc_state;
 }
         */
 
        if (state->active && !state->enable) {
-               DRM_DEBUG_KMS("[CRTC:%d] active without enabled\n",
-                             crtc->base.id);
+               DRM_DEBUG_ATOMIC("[CRTC:%d] active without enabled\n",
+                                crtc->base.id);
                return -EINVAL;
        }
 
        state->planes[index] = plane;
        plane_state->state = state;
 
-       DRM_DEBUG_KMS("Added [PLANE:%d] %p state to %p\n",
-                     plane->base.id, plane_state, state);
+       DRM_DEBUG_ATOMIC("Added [PLANE:%d] %p state to %p\n",
+                        plane->base.id, plane_state, state);
 
        if (plane_state->crtc) {
                struct drm_crtc_state *crtc_state;
 
        /* either *both* CRTC and FB must be set, or neither */
        if (WARN_ON(state->crtc && !state->fb)) {
-               DRM_DEBUG_KMS("CRTC set but no FB\n");
+               DRM_DEBUG_ATOMIC("CRTC set but no FB\n");
                return -EINVAL;
        } else if (WARN_ON(state->fb && !state->crtc)) {
-               DRM_DEBUG_KMS("FB set but no CRTC\n");
+               DRM_DEBUG_ATOMIC("FB set but no CRTC\n");
                return -EINVAL;
        }
 
 
        /* Check whether this plane is usable on this CRTC */
        if (!(plane->possible_crtcs & drm_crtc_mask(state->crtc))) {
-               DRM_DEBUG_KMS("Invalid crtc for plane\n");
+               DRM_DEBUG_ATOMIC("Invalid crtc for plane\n");
                return -EINVAL;
        }
 
                if (state->fb->pixel_format == plane->format_types[i])
                        break;
        if (i == plane->format_count) {
-               DRM_DEBUG_KMS("Invalid pixel format %s\n",
-                             drm_get_format_name(state->fb->pixel_format));
+               DRM_DEBUG_ATOMIC("Invalid pixel format %s\n",
+                                drm_get_format_name(state->fb->pixel_format));
                return -EINVAL;
        }
 
            state->crtc_x > INT_MAX - (int32_t) state->crtc_w ||
            state->crtc_h > INT_MAX ||
            state->crtc_y > INT_MAX - (int32_t) state->crtc_h) {
-               DRM_DEBUG_KMS("Invalid CRTC coordinates %ux%u+%d+%d\n",
-                             state->crtc_w, state->crtc_h,
-                             state->crtc_x, state->crtc_y);
+               DRM_DEBUG_ATOMIC("Invalid CRTC coordinates %ux%u+%d+%d\n",
+                                state->crtc_w, state->crtc_h,
+                                state->crtc_x, state->crtc_y);
                return -ERANGE;
        }
 
            state->src_x > fb_width - state->src_w ||
            state->src_h > fb_height ||
            state->src_y > fb_height - state->src_h) {
-               DRM_DEBUG_KMS("Invalid source coordinates "
-                             "%u.%06ux%u.%06u+%u.%06u+%u.%06u\n",
-                             state->src_w >> 16, ((state->src_w & 0xffff) * 15625) >> 10,
-                             state->src_h >> 16, ((state->src_h & 0xffff) * 15625) >> 10,
-                             state->src_x >> 16, ((state->src_x & 0xffff) * 15625) >> 10,
-                             state->src_y >> 16, ((state->src_y & 0xffff) * 15625) >> 10);
+               DRM_DEBUG_ATOMIC("Invalid source coordinates "
+                                "%u.%06ux%u.%06u+%u.%06u+%u.%06u\n",
+                                state->src_w >> 16, ((state->src_w & 0xffff) * 15625) >> 10,
+                                state->src_h >> 16, ((state->src_h & 0xffff) * 15625) >> 10,
+                                state->src_x >> 16, ((state->src_x & 0xffff) * 15625) >> 10,
+                                state->src_y >> 16, ((state->src_y & 0xffff) * 15625) >> 10);
                return -ENOSPC;
        }
 
         * at most the array is a bit too large.
         */
        if (index >= state->num_connector) {
-               DRM_DEBUG_KMS("Hot-added connector would overflow state array, restarting\n");
+               DRM_DEBUG_ATOMIC("Hot-added connector would overflow state array, restarting\n");
                return ERR_PTR(-EAGAIN);
        }
 
        state->connectors[index] = connector;
        connector_state->state = state;
 
-       DRM_DEBUG_KMS("Added [CONNECTOR:%d] %p state to %p\n",
-                     connector->base.id, connector_state, state);
+       DRM_DEBUG_ATOMIC("Added [CONNECTOR:%d] %p state to %p\n",
+                        connector->base.id, connector_state, state);
 
        if (connector_state->crtc) {
                struct drm_crtc_state *crtc_state;
        }
 
        if (crtc)
-               DRM_DEBUG_KMS("Link plane state %p to [CRTC:%d]\n",
-                             plane_state, crtc->base.id);
+               DRM_DEBUG_ATOMIC("Link plane state %p to [CRTC:%d]\n",
+                                plane_state, crtc->base.id);
        else
-               DRM_DEBUG_KMS("Link plane state %p to [NOCRTC]\n", plane_state);
+               DRM_DEBUG_ATOMIC("Link plane state %p to [NOCRTC]\n",
+                                plane_state);
 
        return 0;
 }
        plane_state->fb = fb;
 
        if (fb)
-               DRM_DEBUG_KMS("Set [FB:%d] for plane state %p\n",
-                             fb->base.id, plane_state);
+               DRM_DEBUG_ATOMIC("Set [FB:%d] for plane state %p\n",
+                                fb->base.id, plane_state);
        else
-               DRM_DEBUG_KMS("Set [NOFB] for plane state %p\n", plane_state);
+               DRM_DEBUG_ATOMIC("Set [NOFB] for plane state %p\n",
+                                plane_state);
 }
 EXPORT_SYMBOL(drm_atomic_set_fb_for_plane);
 
        conn_state->crtc = crtc;
 
        if (crtc)
-               DRM_DEBUG_KMS("Link connector state %p to [CRTC:%d]\n",
-                             conn_state, crtc->base.id);
+               DRM_DEBUG_ATOMIC("Link connector state %p to [CRTC:%d]\n",
+                                conn_state, crtc->base.id);
        else
-               DRM_DEBUG_KMS("Link connector state %p to [NOCRTC]\n",
-                             conn_state);
+               DRM_DEBUG_ATOMIC("Link connector state %p to [NOCRTC]\n",
+                                conn_state);
 
        return 0;
 }
        if (ret)
                return ret;
 
-       DRM_DEBUG_KMS("Adding all current connectors for [CRTC:%d] to %p\n",
-                     crtc->base.id, state);
+       DRM_DEBUG_ATOMIC("Adding all current connectors for [CRTC:%d] to %p\n",
+                        crtc->base.id, state);
 
        /*
         * Changed connectors are already in @state, so only need to look at the
                        num_connected_connectors++;
        }
 
-       DRM_DEBUG_KMS("State %p has %i connectors for [CRTC:%d]\n",
-                     state, num_connected_connectors, crtc->base.id);
+       DRM_DEBUG_ATOMIC("State %p has %i connectors for [CRTC:%d]\n",
+                        state, num_connected_connectors, crtc->base.id);
 
        return num_connected_connectors;
 }
        int ncrtcs = config->num_crtc;
        int i, ret = 0;
 
-       DRM_DEBUG_KMS("checking %p\n", state);
+       DRM_DEBUG_ATOMIC("checking %p\n", state);
 
        for (i = 0; i < nplanes; i++) {
                struct drm_plane *plane = state->planes[i];
 
                ret = drm_atomic_plane_check(plane, state->plane_states[i]);
                if (ret) {
-                       DRM_DEBUG_KMS("[PLANE:%d] atomic core check failed\n",
-                                     plane->base.id);
+                       DRM_DEBUG_ATOMIC("[PLANE:%d] atomic core check failed\n",
+                                        plane->base.id);
                        return ret;
                }
        }
 
                ret = drm_atomic_crtc_check(crtc, state->crtc_states[i]);
                if (ret) {
-                       DRM_DEBUG_KMS("[CRTC:%d] atomic core check failed\n",
-                                     crtc->base.id);
+                       DRM_DEBUG_ATOMIC("[CRTC:%d] atomic core check failed\n",
+                                        crtc->base.id);
                        return ret;
                }
        }
 
                        if (crtc_state->mode_changed ||
                            crtc_state->active_changed) {
-                               DRM_DEBUG_KMS("[CRTC:%d] requires full modeset\n",
-                                             crtc->base.id);
+                               DRM_DEBUG_ATOMIC("[CRTC:%d] requires full modeset\n",
+                                                crtc->base.id);
                                return -EINVAL;
                        }
                }
        if (ret)
                return ret;
 
-       DRM_DEBUG_KMS("commiting %p\n", state);
+       DRM_DEBUG_ATOMIC("commiting %p\n", state);
 
        return config->funcs->atomic_commit(state->dev, state, false);
 }
        if (ret)
                return ret;
 
-       DRM_DEBUG_KMS("commiting %p asynchronously\n", state);
+       DRM_DEBUG_ATOMIC("commiting %p asynchronously\n", state);
 
        return config->funcs->atomic_commit(state->dev, state, true);
 }
 
         */
        WARN_ON(!drm_modeset_is_locked(&config->connection_mutex));
 
-       DRM_DEBUG_KMS("[ENCODER:%d:%s] in use on [CRTC:%d], stealing it\n",
-                     encoder->base.id, encoder->name,
-                     encoder_crtc->base.id);
+       DRM_DEBUG_ATOMIC("[ENCODER:%d:%s] in use on [CRTC:%d], stealing it\n",
+                        encoder->base.id, encoder->name,
+                        encoder_crtc->base.id);
 
        crtc_state = drm_atomic_get_crtc_state(state, encoder_crtc);
        if (IS_ERR(crtc_state))
                if (connector->state->best_encoder != encoder)
                        continue;
 
-               DRM_DEBUG_KMS("Stealing encoder from [CONNECTOR:%d:%s]\n",
-                             connector->base.id,
-                             connector->name);
+               DRM_DEBUG_ATOMIC("Stealing encoder from [CONNECTOR:%d:%s]\n",
+                                connector->base.id,
+                                connector->name);
 
                connector_state = drm_atomic_get_connector_state(state,
                                                                 connector);
        if (!connector)
                return 0;
 
-       DRM_DEBUG_KMS("Updating routing for [CONNECTOR:%d:%s]\n",
-                       connector->base.id,
-                       connector->name);
+       DRM_DEBUG_ATOMIC("Updating routing for [CONNECTOR:%d:%s]\n",
+                        connector->base.id,
+                        connector->name);
 
        if (connector->state->crtc != connector_state->crtc) {
                if (connector->state->crtc) {
        }
 
        if (!connector_state->crtc) {
-               DRM_DEBUG_KMS("Disabling [CONNECTOR:%d:%s]\n",
+               DRM_DEBUG_ATOMIC("Disabling [CONNECTOR:%d:%s]\n",
                                connector->base.id,
                                connector->name);
 
        new_encoder = funcs->best_encoder(connector);
 
        if (!new_encoder) {
-               DRM_DEBUG_KMS("No suitable encoder found for [CONNECTOR:%d:%s]\n",
-                             connector->base.id,
-                             connector->name);
+               DRM_DEBUG_ATOMIC("No suitable encoder found for [CONNECTOR:%d:%s]\n",
+                                connector->base.id,
+                                connector->name);
                return -EINVAL;
        }
 
        if (new_encoder == connector_state->best_encoder) {
-               DRM_DEBUG_KMS("[CONNECTOR:%d:%s] keeps [ENCODER:%d:%s], now on [CRTC:%d]\n",
-                             connector->base.id,
-                             connector->name,
-                             new_encoder->base.id,
-                             new_encoder->name,
-                             connector_state->crtc->base.id);
+               DRM_DEBUG_ATOMIC("[CONNECTOR:%d:%s] keeps [ENCODER:%d:%s], now on [CRTC:%d]\n",
+                                connector->base.id,
+                                connector->name,
+                                new_encoder->base.id,
+                                new_encoder->name,
+                                connector_state->crtc->base.id);
 
                return 0;
        }
        if (encoder_crtc) {
                ret = steal_encoder(state, new_encoder, encoder_crtc);
                if (ret) {
-                       DRM_DEBUG_KMS("Encoder stealing failed for [CONNECTOR:%d:%s]\n",
-                                     connector->base.id,
-                                     connector->name);
+                       DRM_DEBUG_ATOMIC("Encoder stealing failed for [CONNECTOR:%d:%s]\n",
+                                        connector->base.id,
+                                        connector->name);
                        return ret;
                }
        }
        crtc_state = state->crtc_states[idx];
        crtc_state->mode_changed = true;
 
-       DRM_DEBUG_KMS("[CONNECTOR:%d:%s] using [ENCODER:%d:%s] on [CRTC:%d]\n",
-                     connector->base.id,
-                     connector->name,
-                     new_encoder->base.id,
-                     new_encoder->name,
-                     connector_state->crtc->base.id);
+       DRM_DEBUG_ATOMIC("[CONNECTOR:%d:%s] using [ENCODER:%d:%s] on [CRTC:%d]\n",
+                        connector->base.id,
+                        connector->name,
+                        new_encoder->base.id,
+                        new_encoder->name,
+                        connector_state->crtc->base.id);
 
        return 0;
 }
                                        encoder->bridge, &crtc_state->mode,
                                        &crtc_state->adjusted_mode);
                        if (!ret) {
-                               DRM_DEBUG_KMS("Bridge fixup failed\n");
+                               DRM_DEBUG_ATOMIC("Bridge fixup failed\n");
                                return -EINVAL;
                        }
                }
                        ret = funcs->atomic_check(encoder, crtc_state,
                                                  conn_state);
                        if (ret) {
-                               DRM_DEBUG_KMS("[ENCODER:%d:%s] check failed\n",
-                                             encoder->base.id, encoder->name);
+                               DRM_DEBUG_ATOMIC("[ENCODER:%d:%s] check failed\n",
+                                                encoder->base.id, encoder->name);
                                return ret;
                        }
                } else {
                        ret = funcs->mode_fixup(encoder, &crtc_state->mode,
                                                &crtc_state->adjusted_mode);
                        if (!ret) {
-                               DRM_DEBUG_KMS("[ENCODER:%d:%s] fixup failed\n",
-                                             encoder->base.id, encoder->name);
+                               DRM_DEBUG_ATOMIC("[ENCODER:%d:%s] fixup failed\n",
+                                                encoder->base.id, encoder->name);
                                return -EINVAL;
                        }
                }
                ret = funcs->mode_fixup(crtc, &crtc_state->mode,
                                        &crtc_state->adjusted_mode);
                if (!ret) {
-                       DRM_DEBUG_KMS("[CRTC:%d] fixup failed\n",
-                                     crtc->base.id);
+                       DRM_DEBUG_ATOMIC("[CRTC:%d] fixup failed\n",
+                                        crtc->base.id);
                        return -EINVAL;
                }
        }
                        continue;
 
                if (!drm_mode_equal(&crtc->state->mode, &crtc_state->mode)) {
-                       DRM_DEBUG_KMS("[CRTC:%d] mode changed\n",
-                                     crtc->base.id);
+                       DRM_DEBUG_ATOMIC("[CRTC:%d] mode changed\n",
+                                        crtc->base.id);
                        crtc_state->mode_changed = true;
                }
 
                if (crtc->state->enable != crtc_state->enable) {
-                       DRM_DEBUG_KMS("[CRTC:%d] enable changed\n",
-                                     crtc->base.id);
+                       DRM_DEBUG_ATOMIC("[CRTC:%d] enable changed\n",
+                                        crtc->base.id);
                        crtc_state->mode_changed = true;
                }
        }
                 * a full modeset because update_connector_routing force that.
                 */
                if (crtc->state->active != crtc_state->active) {
-                       DRM_DEBUG_KMS("[CRTC:%d] active changed\n",
-                                     crtc->base.id);
+                       DRM_DEBUG_ATOMIC("[CRTC:%d] active changed\n",
+                                        crtc->base.id);
                        crtc_state->active_changed = true;
                }
 
                if (!needs_modeset(crtc_state))
                        continue;
 
-               DRM_DEBUG_KMS("[CRTC:%d] needs all connectors, enable: %c, active: %c\n",
-                             crtc->base.id,
-                             crtc_state->enable ? 'y' : 'n',
+               DRM_DEBUG_ATOMIC("[CRTC:%d] needs all connectors, enable: %c, active: %c\n",
+                                crtc->base.id,
+                                crtc_state->enable ? 'y' : 'n',
                              crtc_state->active ? 'y' : 'n');
 
                ret = drm_atomic_add_affected_connectors(state, crtc);
                                                                crtc);
 
                if (crtc_state->enable != !!num_connectors) {
-                       DRM_DEBUG_KMS("[CRTC:%d] enabled/connectors mismatch\n",
-                                     crtc->base.id);
+                       DRM_DEBUG_ATOMIC("[CRTC:%d] enabled/connectors mismatch\n",
+                                        crtc->base.id);
 
                        return -EINVAL;
                }
 
                ret = funcs->atomic_check(plane, plane_state);
                if (ret) {
-                       DRM_DEBUG_KMS("[PLANE:%d] atomic driver check failed\n",
-                                     plane->base.id);
+                       DRM_DEBUG_ATOMIC("[PLANE:%d] atomic driver check failed\n",
+                                        plane->base.id);
                        return ret;
                }
        }
 
                ret = funcs->atomic_check(crtc, state->crtc_states[i]);
                if (ret) {
-                       DRM_DEBUG_KMS("[CRTC:%d] atomic driver check failed\n",
-                                     crtc->base.id);
+                       DRM_DEBUG_ATOMIC("[CRTC:%d] atomic driver check failed\n",
+                                        crtc->base.id);
                        return ret;
                }
        }
 
                funcs = encoder->helper_private;
 
-               DRM_DEBUG_KMS("disabling [ENCODER:%d:%s]\n",
-                             encoder->base.id, encoder->name);
+               DRM_DEBUG_ATOMIC("disabling [ENCODER:%d:%s]\n",
+                                encoder->base.id, encoder->name);
 
                /*
                 * Each encoder has at most one connector (since we always steal
 
                funcs = crtc->helper_private;
 
-               DRM_DEBUG_KMS("disabling [CRTC:%d]\n",
-                             crtc->base.id);
+               DRM_DEBUG_ATOMIC("disabling [CRTC:%d]\n",
+                                crtc->base.id);
 
 
                /* Right function depends upon target state. */
                funcs = crtc->helper_private;
 
                if (crtc->state->enable) {
-                       DRM_DEBUG_KMS("modeset on [CRTC:%d]\n",
-                                     crtc->base.id);
+                       DRM_DEBUG_ATOMIC("modeset on [CRTC:%d]\n",
+                                        crtc->base.id);
 
                        funcs->mode_set_nofb(crtc);
                }
                if (!new_crtc_state->mode_changed)
                        continue;
 
-               DRM_DEBUG_KMS("modeset on [ENCODER:%d:%s]\n",
-                             encoder->base.id, encoder->name);
+               DRM_DEBUG_ATOMIC("modeset on [ENCODER:%d:%s]\n",
+                                encoder->base.id, encoder->name);
 
                /*
                 * Each encoder has at most one connector (since we always steal
                funcs = crtc->helper_private;
 
                if (crtc->state->enable) {
-                       DRM_DEBUG_KMS("enabling [CRTC:%d]\n",
-                                     crtc->base.id);
+                       DRM_DEBUG_ATOMIC("enabling [CRTC:%d]\n",
+                                        crtc->base.id);
 
                        if (funcs->enable)
                                funcs->enable(crtc);
                encoder = connector->state->best_encoder;
                funcs = encoder->helper_private;
 
-               DRM_DEBUG_KMS("enabling [ENCODER:%d:%s]\n",
-                             encoder->base.id, encoder->name);
+               DRM_DEBUG_ATOMIC("enabling [ENCODER:%d:%s]\n",
+                                encoder->base.id, encoder->name);
 
                /*
                 * Each encoder has at most one connector (since we always steal