summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/drm_atomic.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/drm_atomic.c')
-rw-r--r--drivers/gpu/drm/drm_atomic.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index 88cd992df356..58c0283fb6b0 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -789,6 +789,8 @@ drm_atomic_private_obj_init(struct drm_device *dev,
obj->state = state;
obj->funcs = funcs;
list_add_tail(&obj->head, &dev->mode_config.privobj_list);
+
+ state->obj = obj;
}
EXPORT_SYMBOL(drm_atomic_private_obj_init);
@@ -1423,8 +1425,12 @@ EXPORT_SYMBOL(drm_atomic_check_only);
int drm_atomic_commit(struct drm_atomic_state *state)
{
struct drm_mode_config *config = &state->dev->mode_config;
+ struct drm_printer p = drm_info_printer(state->dev->dev);
int ret;
+ if (drm_debug_enabled(DRM_UT_STATE))
+ drm_atomic_print_new_state(state, &p);
+
ret = drm_atomic_check_only(state);
if (ret)
return ret;
@@ -1632,6 +1638,15 @@ commit:
}
EXPORT_SYMBOL(__drm_atomic_helper_set_config);
+static void drm_atomic_private_obj_print_state(struct drm_printer *p,
+ const struct drm_private_state *state)
+{
+ struct drm_private_obj *obj = state->obj;
+
+ if (obj->funcs->atomic_print_state)
+ obj->funcs->atomic_print_state(p, state);
+}
+
/**
* drm_atomic_print_new_state - prints drm atomic state
* @state: atomic configuration to check
@@ -1652,6 +1667,8 @@ void drm_atomic_print_new_state(const struct drm_atomic_state *state,
struct drm_crtc_state *crtc_state;
struct drm_connector *connector;
struct drm_connector_state *connector_state;
+ struct drm_private_obj *obj;
+ struct drm_private_state *obj_state;
int i;
if (!p) {
@@ -1669,6 +1686,9 @@ void drm_atomic_print_new_state(const struct drm_atomic_state *state,
for_each_new_connector_in_state(state, connector, connector_state, i)
drm_atomic_connector_print_state(p, connector_state);
+
+ for_each_new_private_obj_in_state(state, obj, obj_state, i)
+ drm_atomic_private_obj_print_state(p, obj_state);
}
EXPORT_SYMBOL(drm_atomic_print_new_state);