]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/gpu/drm/drm_atomic_helper.c
drm: writeback: Add job prepare and cleanup operations
[linux.git] / drivers / gpu / drm / drm_atomic_helper.c
index 40ac1984803459b7a0e8f67e09f81b61820035ef..f89641216a449c3d7bb36b24411d6243c5ce524e 100644 (file)
@@ -2261,10 +2261,21 @@ EXPORT_SYMBOL(drm_atomic_helper_commit_cleanup_done);
 int drm_atomic_helper_prepare_planes(struct drm_device *dev,
                                     struct drm_atomic_state *state)
 {
+       struct drm_connector *connector;
+       struct drm_connector_state *new_conn_state;
        struct drm_plane *plane;
        struct drm_plane_state *new_plane_state;
        int ret, i, j;
 
+       for_each_new_connector_in_state(state, connector, new_conn_state, i) {
+               if (!new_conn_state->writeback_job)
+                       continue;
+
+               ret = drm_writeback_prepare_job(new_conn_state->writeback_job);
+               if (ret < 0)
+                       return ret;
+       }
+
        for_each_new_plane_in_state(state, plane, new_plane_state, i) {
                const struct drm_plane_helper_funcs *funcs;