drm: Add acquire ctx parameter to ->plane_disable
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 22 Mar 2017 21:50:43 +0000 (22:50 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 29 Mar 2017 07:14:58 +0000 (09:14 +0200)
Nouveau had a few direct calls to ->disable_plane, I replaced those
with drm_plane_force_disable. Same story for shmob.

Otherwise no code changes.

Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170322215058.8671-5-daniel.vetter@ffwll.ch
drivers/gpu/drm/armada/armada_overlay.c
drivers/gpu/drm/drm_atomic_helper.c
drivers/gpu/drm/drm_plane.c
drivers/gpu/drm/drm_plane_helper.c
drivers/gpu/drm/nouveau/dispnv04/overlay.c
drivers/gpu/drm/shmobile/shmob_drm_plane.c
include/drm/drm_atomic_helper.h
include/drm/drm_plane.h
include/drm/drm_plane_helper.h

index b54fd8cbd3a6b59ab4dbced5307eae0022ce2d4a..424e465ff407e5cc3e131b0f9e08efa94807c2f9 100644 (file)
@@ -258,7 +258,8 @@ armada_ovl_plane_update(struct drm_plane *plane, struct drm_crtc *crtc,
        return 0;
 }
 
-static int armada_ovl_plane_disable(struct drm_plane *plane)
+static int armada_ovl_plane_disable(struct drm_plane *plane,
+                                   struct drm_modeset_acquire_ctx *ctx)
 {
        struct armada_ovl_plane *dplane = drm_to_armada_ovl_plane(plane);
        struct drm_framebuffer *fb;
index e552687dcac659317d6521c72f33e2933a8472b5..6096233a740cd56e252f02834f320880c2a405e0 100644 (file)
@@ -2151,13 +2151,15 @@ EXPORT_SYMBOL(drm_atomic_helper_update_plane);
 /**
  * drm_atomic_helper_disable_plane - Helper for primary plane disable using * atomic
  * @plane: plane to disable
+ * @ctx: lock acquire context
  *
  * Provides a default plane disable handler using the atomic driver interface.
  *
  * RETURNS:
  * Zero on success, error code on failure
  */
-int drm_atomic_helper_disable_plane(struct drm_plane *plane)
+int drm_atomic_helper_disable_plane(struct drm_plane *plane,
+                                   struct drm_modeset_acquire_ctx *ctx)
 {
        struct drm_atomic_state *state;
        struct drm_plane_state *plane_state;
index 67119332c4413526a85280cb0510effeb090a8fc..526e74b548b2e3691a189fffafe01c5249808996 100644 (file)
@@ -294,7 +294,7 @@ void drm_plane_force_disable(struct drm_plane *plane)
        WARN_ON(drm_drv_uses_atomic_modeset(plane->dev));
 
        plane->old_fb = plane->fb;
-       ret = plane->funcs->disable_plane(plane);
+       ret = plane->funcs->disable_plane(plane, NULL);
        if (ret) {
                DRM_ERROR("failed to disable plane with busy fb\n");
                plane->old_fb = NULL;
@@ -473,7 +473,7 @@ static int __setplane_internal(struct drm_plane *plane,
        /* No fb means shut it down */
        if (!fb) {
                plane->old_fb = plane->fb;
-               ret = plane->funcs->disable_plane(plane);
+               ret = plane->funcs->disable_plane(plane, ctx);
                if (!ret) {
                        plane->crtc = NULL;
                        plane->fb = NULL;
index 2339879f775d7f3b6436903c25563ab4e88f51b9..775e94c30368add267a28a3e316031829aa3e69e 100644 (file)
@@ -349,7 +349,7 @@ int drm_primary_helper_update(struct drm_plane *plane, struct drm_crtc *crtc,
                 * provides their own disable function, this will just
                 * wind up returning -EINVAL to userspace.
                 */
-               return plane->funcs->disable_plane(plane);
+               return plane->funcs->disable_plane(plane, ctx);
 
        /* Find current connectors for CRTC */
        num_connectors = get_connectors_for_crtc(crtc, NULL, 0);
@@ -398,7 +398,8 @@ EXPORT_SYMBOL(drm_primary_helper_update);
  * RETURNS:
  * Unconditionally returns -EINVAL.
  */
-int drm_primary_helper_disable(struct drm_plane *plane)
+int drm_primary_helper_disable(struct drm_plane *plane,
+                              struct drm_modeset_acquire_ctx *ctx)
 {
        return -EINVAL;
 }
index 2d90e7898ec841dc882051160b5b386313c557b8..e54944d2326863f8260314c0dd0fcfc019d04003 100644 (file)
@@ -173,7 +173,8 @@ nv10_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
 }
 
 static int
-nv10_disable_plane(struct drm_plane *plane)
+nv10_disable_plane(struct drm_plane *plane,
+                  struct drm_modeset_acquire_ctx *ctx)
 {
        struct nvif_object *dev = &nouveau_drm(plane->dev)->client.device.object;
        struct nouveau_plane *nv_plane =
@@ -191,7 +192,7 @@ nv10_disable_plane(struct drm_plane *plane)
 static void
 nv_destroy_plane(struct drm_plane *plane)
 {
-       plane->funcs->disable_plane(plane);
+       drm_plane_force_disable(plane);
        drm_plane_cleanup(plane);
        kfree(plane);
 }
@@ -332,7 +333,7 @@ nv10_overlay_init(struct drm_device *device)
 
        plane->set_params = nv10_set_params;
        nv10_set_params(plane);
-       nv10_disable_plane(&plane->base);
+       drm_plane_force_disable(&plane->base);
        return;
 cleanup:
        drm_plane_cleanup(&plane->base);
@@ -427,7 +428,8 @@ nv04_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
 }
 
 static int
-nv04_disable_plane(struct drm_plane *plane)
+nv04_disable_plane(struct drm_plane *plane,
+                  struct drm_modeset_acquire_ctx *ctx)
 {
        struct nvif_object *dev = &nouveau_drm(plane->dev)->client.device.object;
        struct nouveau_plane *nv_plane =
@@ -485,7 +487,7 @@ nv04_overlay_init(struct drm_device *device)
        drm_object_attach_property(&plane->base.base,
                                   plane->props.brightness, plane->brightness);
 
-       nv04_disable_plane(&plane->base);
+       drm_plane_force_disable(&plane->base);
        return;
 cleanup:
        drm_plane_cleanup(&plane->base);
index 9a3c8ddfe198e56ce242bf7c1ee53bc37e6bceaf..97f6e4a3eb0de0e86634cb4c4d9d3c2501b5dfab 100644 (file)
@@ -209,7 +209,8 @@ shmob_drm_plane_update(struct drm_plane *plane, struct drm_crtc *crtc,
        return 0;
 }
 
-static int shmob_drm_plane_disable(struct drm_plane *plane)
+static int shmob_drm_plane_disable(struct drm_plane *plane,
+                                  struct drm_modeset_acquire_ctx *ctx)
 {
        struct shmob_drm_plane *splane = to_shmob_plane(plane);
        struct shmob_drm_device *sdev = plane->dev->dev_private;
@@ -222,7 +223,7 @@ static int shmob_drm_plane_disable(struct drm_plane *plane)
 
 static void shmob_drm_plane_destroy(struct drm_plane *plane)
 {
-       shmob_drm_plane_disable(plane);
+       drm_plane_force_disable(plane);
        drm_plane_cleanup(plane);
 }
 
index 62ac6053721d264f32cc14bfec332bd01d83c75b..73554fff086aa9b393ae59c18ec9a1b1ac29e155 100644 (file)
@@ -96,7 +96,8 @@ int drm_atomic_helper_update_plane(struct drm_plane *plane,
                                   uint32_t src_x, uint32_t src_y,
                                   uint32_t src_w, uint32_t src_h,
                                   struct drm_modeset_acquire_ctx *ctx);
-int drm_atomic_helper_disable_plane(struct drm_plane *plane);
+int drm_atomic_helper_disable_plane(struct drm_plane *plane,
+                                   struct drm_modeset_acquire_ctx *ctx);
 int __drm_atomic_helper_disable_plane(struct drm_plane *plane,
                struct drm_plane_state *plane_state);
 int drm_atomic_helper_set_config(struct drm_mode_set *set);
index ab3bdfb897c43057044352bcf58692b255abf6c5..9ab3e70448127902aad5414f7fe1e109ed298e21 100644 (file)
@@ -203,7 +203,8 @@ struct drm_plane_funcs {
         *
         * 0 on success or a negative error code on failure.
         */
-       int (*disable_plane)(struct drm_plane *plane);
+       int (*disable_plane)(struct drm_plane *plane,
+                            struct drm_modeset_acquire_ctx *ctx);
 
        /**
         * @destroy:
index ea219423d72ba76e311165822ef3bd3904fb5dd2..7c8a00ceadb742f1895d2e442397b0d1e44a4ef2 100644 (file)
@@ -63,7 +63,8 @@ int drm_primary_helper_update(struct drm_plane *plane,
                              uint32_t src_x, uint32_t src_y,
                              uint32_t src_w, uint32_t src_h,
                              struct drm_modeset_acquire_ctx *ctx);
-int drm_primary_helper_disable(struct drm_plane *plane);
+int drm_primary_helper_disable(struct drm_plane *plane,
+                              struct drm_modeset_acquire_ctx *ctx);
 void drm_primary_helper_destroy(struct drm_plane *plane);
 extern const struct drm_plane_funcs drm_primary_helper_funcs;