Commit 399190e7 authored by Fernando Ramos's avatar Fernando Ramos Committed by Sean Paul
Browse files

drm/i915: cleanup: drm_modeset_lock_all_ctx() --> DRM_MODESET_LOCK_ALL_BEGIN()



As requested in Documentation/gpu/todo.rst, replace the boilerplate code
surrounding drm_modeset_lock_all_ctx() with DRM_MODESET_LOCK_ALL_BEGIN()
and DRM_MODESET_LOCK_ALL_END()

Signed-off-by: default avatarFernando Ramos <greenfoo@u92.eu>
Reviewed-by: default avatarSean Paul <sean@poorly.run>
Signed-off-by: default avatarSean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20210924064324.229457-3-greenfoo@u92.eu
parent 21dde409
Loading
Loading
Loading
Loading
+5 −13
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@
#include <drm/drm_plane_helper.h>
#include <drm/drm_probe_helper.h>
#include <drm/drm_rect.h>
#include <drm/drm_drv.h>

#include "display/intel_audio.h"
#include "display/intel_crt.h"
@@ -13476,22 +13477,13 @@ void intel_display_resume(struct drm_device *dev)
	if (state)
		state->acquire_ctx = &ctx;

	drm_modeset_acquire_init(&ctx, 0);

	while (1) {
		ret = drm_modeset_lock_all_ctx(dev, &ctx);
		if (ret != -EDEADLK)
			break;

		drm_modeset_backoff(&ctx);
	}
	DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret);

	if (!ret)
	ret = __intel_display_resume(dev, state, &ctx);

	intel_enable_ipc(dev_priv);
	drm_modeset_drop_locks(&ctx);
	drm_modeset_acquire_fini(&ctx);

	DRM_MODESET_LOCK_ALL_END(dev, ctx, ret);

	if (ret)
		drm_err(&dev_priv->drm,