Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 19315294 authored by Daniel Vetter's avatar Daniel Vetter
Browse files

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: default avatarHarry Wentland <harry.wentland@amd.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170322215058.8671-5-daniel.vetter@ffwll.ch
parent 5fbef3ee
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;
+3 −1
Original line number Diff line number Diff line
@@ -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;
+2 −2
Original line number Diff line number Diff line
@@ -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;
+3 −2
Original line number Diff line number Diff line
@@ -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;
}
+7 −5
Original line number Diff line number Diff line
@@ -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);
Loading