drm/connector: Make ->atomic_commit() optional
authorBoris Brezillon <boris.brezillon@bootlin.com>
Tue, 3 Jul 2018 07:50:17 +0000 (09:50 +0200)
committerBoris Brezillon <boris.brezillon@bootlin.com>
Sat, 7 Jul 2018 05:52:18 +0000 (07:52 +0200)
Not all writeback connector implementations might want to commit things
from the connector driver. Some, like the malidp driver, commit things
from their main commit_tail() function, and would rather not have to
implement a dummy hook for drm_connector_helper_funcs.atomic_commit().

Make this function optional and reflect this fact in the doc.

Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Acked-by: Liviu Dudau <liviu.dudau@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180703075022.15138-4-boris.brezillon@bootlin.com
drivers/gpu/drm/drm_atomic_helper.c
include/drm/drm_modeset_helper_vtables.h

index 47e84aa7b6e244349097f4f02cd5c7970fc08506..bab8051690bbfbe01b26ad659b66ae8bd3b40896 100644 (file)
@@ -1184,6 +1184,8 @@ static void drm_atomic_helper_commit_writebacks(struct drm_device *dev,
                const struct drm_connector_helper_funcs *funcs;
 
                funcs = connector->helper_private;
+               if (!funcs->atomic_commit)
+                       continue;
 
                if (new_conn_state->writeback_job && new_conn_state->writeback_job->fb) {
                        WARN_ON(connector->connector_type != DRM_MODE_CONNECTOR_WRITEBACK);
index fb841f44949cf7d35f29e23668aad7ef01f037bc..d0eb76c4b309a5f0fe8be2ccbfb9421143ad16f4 100644 (file)
@@ -983,6 +983,8 @@ struct drm_connector_helper_funcs {
         * The writeback_job to commit is available in
         * &drm_connector_state.writeback_job.
         *
+        * This hook is optional.
+        *
         * This callback is used by the atomic modeset helpers.
         */
        void (*atomic_commit)(struct drm_connector *connector,