Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+26 -16
+2 -1
drivers/gpu/drm/armada/armada_overlay.c
··· 258 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 264 struct armada_ovl_plane *dplane = drm_to_armada_ovl_plane(plane); 264 265 struct drm_framebuffer *fb;
+3 -1
drivers/gpu/drm/drm_atomic_helper.c
··· 2151 2151 /** 2152 2152 * drm_atomic_helper_disable_plane - Helper for primary plane disable using * atomic 2153 2153 * @plane: plane to disable 2154 + * @ctx: lock acquire context 2154 2155 * 2155 2156 * Provides a default plane disable handler using the atomic driver interface. 2156 2157 * 2157 2158 * RETURNS: 2158 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 2164 struct drm_atomic_state *state; 2163 2165 struct drm_plane_state *plane_state;
+2 -2
drivers/gpu/drm/drm_plane.c
··· 294 294 WARN_ON(drm_drv_uses_atomic_modeset(plane->dev)); 295 295 296 296 plane->old_fb = plane->fb; 297 - ret = plane->funcs->disable_plane(plane); 297 + ret = plane->funcs->disable_plane(plane, NULL); 298 298 if (ret) { 299 299 DRM_ERROR("failed to disable plane with busy fb\n"); 300 300 plane->old_fb = NULL; ··· 473 473 /* No fb means shut it down */ 474 474 if (!fb) { 475 475 plane->old_fb = plane->fb; 476 - ret = plane->funcs->disable_plane(plane); 476 + ret = plane->funcs->disable_plane(plane, ctx); 477 477 if (!ret) { 478 478 plane->crtc = NULL; 479 479 plane->fb = NULL;
+3 -2
drivers/gpu/drm/drm_plane_helper.c
··· 349 349 * provides their own disable function, this will just 350 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 354 /* Find current connectors for CRTC */ 355 355 num_connectors = get_connectors_for_crtc(crtc, NULL, 0); ··· 398 398 * RETURNS: 399 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 404 return -EINVAL; 404 405 }
+7 -5
drivers/gpu/drm/nouveau/dispnv04/overlay.c
··· 173 173 } 174 174 175 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 179 struct nvif_object *dev = &nouveau_drm(plane->dev)->client.device.object; 179 180 struct nouveau_plane *nv_plane = ··· 192 191 static void 193 192 nv_destroy_plane(struct drm_plane *plane) 194 193 { 195 - plane->funcs->disable_plane(plane); 194 + drm_plane_force_disable(plane); 196 195 drm_plane_cleanup(plane); 197 196 kfree(plane); 198 197 } ··· 333 332 334 333 plane->set_params = nv10_set_params; 335 334 nv10_set_params(plane); 336 - nv10_disable_plane(&plane->base); 335 + drm_plane_force_disable(&plane->base); 337 336 return; 338 337 cleanup: 339 338 drm_plane_cleanup(&plane->base); ··· 428 427 } 429 428 430 429 static int 431 - nv04_disable_plane(struct drm_plane *plane) 430 + nv04_disable_plane(struct drm_plane *plane, 431 + struct drm_modeset_acquire_ctx *ctx) 432 432 { 433 433 struct nvif_object *dev = &nouveau_drm(plane->dev)->client.device.object; 434 434 struct nouveau_plane *nv_plane = ··· 487 485 drm_object_attach_property(&plane->base.base, 488 486 plane->props.brightness, plane->brightness); 489 487 490 - nv04_disable_plane(&plane->base); 488 + drm_plane_force_disable(&plane->base); 491 489 return; 492 490 cleanup: 493 491 drm_plane_cleanup(&plane->base);
+3 -2
drivers/gpu/drm/shmobile/shmob_drm_plane.c
··· 209 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 215 struct shmob_drm_plane *splane = to_shmob_plane(plane); 215 216 struct shmob_drm_device *sdev = plane->dev->dev_private; ··· 223 222 224 223 static void shmob_drm_plane_destroy(struct drm_plane *plane) 225 224 { 226 - shmob_drm_plane_disable(plane); 225 + drm_plane_force_disable(plane); 227 226 drm_plane_cleanup(plane); 228 227 } 229 228
+2 -1
include/drm/drm_atomic_helper.h
··· 96 96 uint32_t src_x, uint32_t src_y, 97 97 uint32_t src_w, uint32_t src_h, 98 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 101 int __drm_atomic_helper_disable_plane(struct drm_plane *plane, 101 102 struct drm_plane_state *plane_state); 102 103 int drm_atomic_helper_set_config(struct drm_mode_set *set);
+2 -1
include/drm/drm_plane.h
··· 203 203 * 204 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 210 * @destroy:
+2 -1
include/drm/drm_plane_helper.h
··· 63 63 uint32_t src_x, uint32_t src_y, 64 64 uint32_t src_w, uint32_t src_h, 65 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 68 void drm_primary_helper_destroy(struct drm_plane *plane); 68 69 extern const struct drm_plane_funcs drm_primary_helper_funcs; 69 70