diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2017-03-22 17:50:43 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2017-03-29 03:14:58 -0400 |
commit | 1931529448bca3e0e77fb526baad20935c9cabaf (patch) | |
tree | 2f1c8adfc89f1cafa1efb17607c433e6e15ce96d | |
parent | 5fbef3ee4a28f968e9d0ea97c6dc80388287122b (diff) |
drm: Add acquire ctx parameter to ->plane_disable
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
-rw-r--r-- | drivers/gpu/drm/armada/armada_overlay.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_atomic_helper.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_plane.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_plane_helper.c | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/dispnv04/overlay.c | 12 | ||||
-rw-r--r-- | drivers/gpu/drm/shmobile/shmob_drm_plane.c | 5 | ||||
-rw-r--r-- | include/drm/drm_atomic_helper.h | 3 | ||||
-rw-r--r-- | include/drm/drm_plane.h | 3 | ||||
-rw-r--r-- | include/drm/drm_plane_helper.h | 3 |
9 files changed, 26 insertions, 16 deletions
diff --git a/drivers/gpu/drm/armada/armada_overlay.c b/drivers/gpu/drm/armada/armada_overlay.c index b54fd8cbd3a6..424e465ff407 100644 --- a/drivers/gpu/drm/armada/armada_overlay.c +++ b/drivers/gpu/drm/armada/armada_overlay.c | |||
@@ -258,7 +258,8 @@ armada_ovl_plane_update(struct drm_plane *plane, struct drm_crtc *crtc, | |||
258 | return 0; | 258 | return 0; |
259 | } | 259 | } |
260 | 260 | ||
261 | static int armada_ovl_plane_disable(struct drm_plane *plane) | 261 | static int armada_ovl_plane_disable(struct drm_plane *plane, |
262 | struct drm_modeset_acquire_ctx *ctx) | ||
262 | { | 263 | { |
263 | struct armada_ovl_plane *dplane = drm_to_armada_ovl_plane(plane); | 264 | struct armada_ovl_plane *dplane = drm_to_armada_ovl_plane(plane); |
264 | struct drm_framebuffer *fb; | 265 | struct drm_framebuffer *fb; |
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index e552687dcac6..6096233a740c 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c | |||
@@ -2151,13 +2151,15 @@ EXPORT_SYMBOL(drm_atomic_helper_update_plane); | |||
2151 | /** | 2151 | /** |
2152 | * drm_atomic_helper_disable_plane - Helper for primary plane disable using * atomic | 2152 | * drm_atomic_helper_disable_plane - Helper for primary plane disable using * atomic |
2153 | * @plane: plane to disable | 2153 | * @plane: plane to disable |
2154 | * @ctx: lock acquire context | ||
2154 | * | 2155 | * |
2155 | * Provides a default plane disable handler using the atomic driver interface. | 2156 | * Provides a default plane disable handler using the atomic driver interface. |
2156 | * | 2157 | * |
2157 | * RETURNS: | 2158 | * RETURNS: |
2158 | * Zero on success, error code on failure | 2159 | * Zero on success, error code on failure |
2159 | */ | 2160 | */ |
2160 | int drm_atomic_helper_disable_plane(struct drm_plane *plane) | 2161 | int drm_atomic_helper_disable_plane(struct drm_plane *plane, |
2162 | struct drm_modeset_acquire_ctx *ctx) | ||
2161 | { | 2163 | { |
2162 | struct drm_atomic_state *state; | 2164 | struct drm_atomic_state *state; |
2163 | struct drm_plane_state *plane_state; | 2165 | struct drm_plane_state *plane_state; |
diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c index 67119332c441..526e74b548b2 100644 --- a/drivers/gpu/drm/drm_plane.c +++ b/drivers/gpu/drm/drm_plane.c | |||
@@ -294,7 +294,7 @@ void drm_plane_force_disable(struct drm_plane *plane) | |||
294 | WARN_ON(drm_drv_uses_atomic_modeset(plane->dev)); | 294 | WARN_ON(drm_drv_uses_atomic_modeset(plane->dev)); |
295 | 295 | ||
296 | plane->old_fb = plane->fb; | 296 | plane->old_fb = plane->fb; |
297 | ret = plane->funcs->disable_plane(plane); | 297 | ret = plane->funcs->disable_plane(plane, NULL); |
298 | if (ret) { | 298 | if (ret) { |
299 | DRM_ERROR("failed to disable plane with busy fb\n"); | 299 | DRM_ERROR("failed to disable plane with busy fb\n"); |
300 | plane->old_fb = NULL; | 300 | plane->old_fb = NULL; |
@@ -473,7 +473,7 @@ static int __setplane_internal(struct drm_plane *plane, | |||
473 | /* No fb means shut it down */ | 473 | /* No fb means shut it down */ |
474 | if (!fb) { | 474 | if (!fb) { |
475 | plane->old_fb = plane->fb; | 475 | plane->old_fb = plane->fb; |
476 | ret = plane->funcs->disable_plane(plane); | 476 | ret = plane->funcs->disable_plane(plane, ctx); |
477 | if (!ret) { | 477 | if (!ret) { |
478 | plane->crtc = NULL; | 478 | plane->crtc = NULL; |
479 | plane->fb = NULL; | 479 | plane->fb = NULL; |
diff --git a/drivers/gpu/drm/drm_plane_helper.c b/drivers/gpu/drm/drm_plane_helper.c index 2339879f775d..775e94c30368 100644 --- a/drivers/gpu/drm/drm_plane_helper.c +++ b/drivers/gpu/drm/drm_plane_helper.c | |||
@@ -349,7 +349,7 @@ int drm_primary_helper_update(struct drm_plane *plane, struct drm_crtc *crtc, | |||
349 | * provides their own disable function, this will just | 349 | * provides their own disable function, this will just |
350 | * wind up returning -EINVAL to userspace. | 350 | * wind up returning -EINVAL to userspace. |
351 | */ | 351 | */ |
352 | return plane->funcs->disable_plane(plane); | 352 | return plane->funcs->disable_plane(plane, ctx); |
353 | 353 | ||
354 | /* Find current connectors for CRTC */ | 354 | /* Find current connectors for CRTC */ |
355 | num_connectors = get_connectors_for_crtc(crtc, NULL, 0); | 355 | num_connectors = get_connectors_for_crtc(crtc, NULL, 0); |
@@ -398,7 +398,8 @@ EXPORT_SYMBOL(drm_primary_helper_update); | |||
398 | * RETURNS: | 398 | * RETURNS: |
399 | * Unconditionally returns -EINVAL. | 399 | * Unconditionally returns -EINVAL. |
400 | */ | 400 | */ |
401 | int drm_primary_helper_disable(struct drm_plane *plane) | 401 | int drm_primary_helper_disable(struct drm_plane *plane, |
402 | struct drm_modeset_acquire_ctx *ctx) | ||
402 | { | 403 | { |
403 | return -EINVAL; | 404 | return -EINVAL; |
404 | } | 405 | } |
diff --git a/drivers/gpu/drm/nouveau/dispnv04/overlay.c b/drivers/gpu/drm/nouveau/dispnv04/overlay.c index 2d90e7898ec8..e54944d23268 100644 --- a/drivers/gpu/drm/nouveau/dispnv04/overlay.c +++ b/drivers/gpu/drm/nouveau/dispnv04/overlay.c | |||
@@ -173,7 +173,8 @@ nv10_update_plane(struct drm_plane *plane, struct drm_crtc *crtc, | |||
173 | } | 173 | } |
174 | 174 | ||
175 | static int | 175 | static int |
176 | nv10_disable_plane(struct drm_plane *plane) | 176 | nv10_disable_plane(struct drm_plane *plane, |
177 | struct drm_modeset_acquire_ctx *ctx) | ||
177 | { | 178 | { |
178 | struct nvif_object *dev = &nouveau_drm(plane->dev)->client.device.object; | 179 | struct nvif_object *dev = &nouveau_drm(plane->dev)->client.device.object; |
179 | struct nouveau_plane *nv_plane = | 180 | struct nouveau_plane *nv_plane = |
@@ -191,7 +192,7 @@ nv10_disable_plane(struct drm_plane *plane) | |||
191 | static void | 192 | static void |
192 | nv_destroy_plane(struct drm_plane *plane) | 193 | nv_destroy_plane(struct drm_plane *plane) |
193 | { | 194 | { |
194 | plane->funcs->disable_plane(plane); | 195 | drm_plane_force_disable(plane); |
195 | drm_plane_cleanup(plane); | 196 | drm_plane_cleanup(plane); |
196 | kfree(plane); | 197 | kfree(plane); |
197 | } | 198 | } |
@@ -332,7 +333,7 @@ nv10_overlay_init(struct drm_device *device) | |||
332 | 333 | ||
333 | plane->set_params = nv10_set_params; | 334 | plane->set_params = nv10_set_params; |
334 | nv10_set_params(plane); | 335 | nv10_set_params(plane); |
335 | nv10_disable_plane(&plane->base); | 336 | drm_plane_force_disable(&plane->base); |
336 | return; | 337 | return; |
337 | cleanup: | 338 | cleanup: |
338 | drm_plane_cleanup(&plane->base); | 339 | drm_plane_cleanup(&plane->base); |
@@ -427,7 +428,8 @@ nv04_update_plane(struct drm_plane *plane, struct drm_crtc *crtc, | |||
427 | } | 428 | } |
428 | 429 | ||
429 | static int | 430 | static int |
430 | nv04_disable_plane(struct drm_plane *plane) | 431 | nv04_disable_plane(struct drm_plane *plane, |
432 | struct drm_modeset_acquire_ctx *ctx) | ||
431 | { | 433 | { |
432 | struct nvif_object *dev = &nouveau_drm(plane->dev)->client.device.object; | 434 | struct nvif_object *dev = &nouveau_drm(plane->dev)->client.device.object; |
433 | struct nouveau_plane *nv_plane = | 435 | struct nouveau_plane *nv_plane = |
@@ -485,7 +487,7 @@ nv04_overlay_init(struct drm_device *device) | |||
485 | drm_object_attach_property(&plane->base.base, | 487 | drm_object_attach_property(&plane->base.base, |
486 | plane->props.brightness, plane->brightness); | 488 | plane->props.brightness, plane->brightness); |
487 | 489 | ||
488 | nv04_disable_plane(&plane->base); | 490 | drm_plane_force_disable(&plane->base); |
489 | return; | 491 | return; |
490 | cleanup: | 492 | cleanup: |
491 | drm_plane_cleanup(&plane->base); | 493 | drm_plane_cleanup(&plane->base); |
diff --git a/drivers/gpu/drm/shmobile/shmob_drm_plane.c b/drivers/gpu/drm/shmobile/shmob_drm_plane.c index 9a3c8ddfe198..97f6e4a3eb0d 100644 --- a/drivers/gpu/drm/shmobile/shmob_drm_plane.c +++ b/drivers/gpu/drm/shmobile/shmob_drm_plane.c | |||
@@ -209,7 +209,8 @@ shmob_drm_plane_update(struct drm_plane *plane, struct drm_crtc *crtc, | |||
209 | return 0; | 209 | return 0; |
210 | } | 210 | } |
211 | 211 | ||
212 | static int shmob_drm_plane_disable(struct drm_plane *plane) | 212 | static int shmob_drm_plane_disable(struct drm_plane *plane, |
213 | struct drm_modeset_acquire_ctx *ctx) | ||
213 | { | 214 | { |
214 | struct shmob_drm_plane *splane = to_shmob_plane(plane); | 215 | struct shmob_drm_plane *splane = to_shmob_plane(plane); |
215 | struct shmob_drm_device *sdev = plane->dev->dev_private; | 216 | struct shmob_drm_device *sdev = plane->dev->dev_private; |
@@ -222,7 +223,7 @@ static int shmob_drm_plane_disable(struct drm_plane *plane) | |||
222 | 223 | ||
223 | static void shmob_drm_plane_destroy(struct drm_plane *plane) | 224 | static void shmob_drm_plane_destroy(struct drm_plane *plane) |
224 | { | 225 | { |
225 | shmob_drm_plane_disable(plane); | 226 | drm_plane_force_disable(plane); |
226 | drm_plane_cleanup(plane); | 227 | drm_plane_cleanup(plane); |
227 | } | 228 | } |
228 | 229 | ||
diff --git a/include/drm/drm_atomic_helper.h b/include/drm/drm_atomic_helper.h index 62ac6053721d..73554fff086a 100644 --- a/include/drm/drm_atomic_helper.h +++ b/include/drm/drm_atomic_helper.h | |||
@@ -96,7 +96,8 @@ int drm_atomic_helper_update_plane(struct drm_plane *plane, | |||
96 | uint32_t src_x, uint32_t src_y, | 96 | uint32_t src_x, uint32_t src_y, |
97 | uint32_t src_w, uint32_t src_h, | 97 | uint32_t src_w, uint32_t src_h, |
98 | struct drm_modeset_acquire_ctx *ctx); | 98 | struct drm_modeset_acquire_ctx *ctx); |
99 | int drm_atomic_helper_disable_plane(struct drm_plane *plane); | 99 | int drm_atomic_helper_disable_plane(struct drm_plane *plane, |
100 | struct drm_modeset_acquire_ctx *ctx); | ||
100 | int __drm_atomic_helper_disable_plane(struct drm_plane *plane, | 101 | int __drm_atomic_helper_disable_plane(struct drm_plane *plane, |
101 | struct drm_plane_state *plane_state); | 102 | struct drm_plane_state *plane_state); |
102 | int drm_atomic_helper_set_config(struct drm_mode_set *set); | 103 | int drm_atomic_helper_set_config(struct drm_mode_set *set); |
diff --git a/include/drm/drm_plane.h b/include/drm/drm_plane.h index ab3bdfb897c4..9ab3e7044812 100644 --- a/include/drm/drm_plane.h +++ b/include/drm/drm_plane.h | |||
@@ -203,7 +203,8 @@ struct drm_plane_funcs { | |||
203 | * | 203 | * |
204 | * 0 on success or a negative error code on failure. | 204 | * 0 on success or a negative error code on failure. |
205 | */ | 205 | */ |
206 | int (*disable_plane)(struct drm_plane *plane); | 206 | int (*disable_plane)(struct drm_plane *plane, |
207 | struct drm_modeset_acquire_ctx *ctx); | ||
207 | 208 | ||
208 | /** | 209 | /** |
209 | * @destroy: | 210 | * @destroy: |
diff --git a/include/drm/drm_plane_helper.h b/include/drm/drm_plane_helper.h index ea219423d72b..7c8a00ceadb7 100644 --- a/include/drm/drm_plane_helper.h +++ b/include/drm/drm_plane_helper.h | |||
@@ -63,7 +63,8 @@ int drm_primary_helper_update(struct drm_plane *plane, | |||
63 | uint32_t src_x, uint32_t src_y, | 63 | uint32_t src_x, uint32_t src_y, |
64 | uint32_t src_w, uint32_t src_h, | 64 | uint32_t src_w, uint32_t src_h, |
65 | struct drm_modeset_acquire_ctx *ctx); | 65 | struct drm_modeset_acquire_ctx *ctx); |
66 | int drm_primary_helper_disable(struct drm_plane *plane); | 66 | int drm_primary_helper_disable(struct drm_plane *plane, |
67 | struct drm_modeset_acquire_ctx *ctx); | ||
67 | void drm_primary_helper_destroy(struct drm_plane *plane); | 68 | void drm_primary_helper_destroy(struct drm_plane *plane); |
68 | extern const struct drm_plane_funcs drm_primary_helper_funcs; | 69 | extern const struct drm_plane_funcs drm_primary_helper_funcs; |
69 | 70 | ||