Thread (43 messages) 43 messages, 3 authors, 2021-09-18

Re: [PATCH 12/15] drm/i915: cleanup: drm_modeset_lock_all() --> DRM_MODESET_LOCK_ALL_BEGIN()

From: Fernando Ramos <hidden>
Date: 2021-09-17 22:57:42
Also in: amd-gfx, dri-devel, intel-gfx, linux-arm-msm, linux-doc, linux-renesas-soc, lkml, nouveau

quoted
 	int i;
+	int ret;
Please move up with i
Done!

quoted
+	DRM_MODESET_LOCK_ALL_END((&dev_priv->drm), ctx, ret);
 
 	return 0;
Return ret here
Done!

quoted
+	struct drm_modeset_acquire_ctx ctx;
 	int i;
+	int ret;
Please move up with i
Done!

quoted
-	drm_modeset_unlock_all(dev);
+	DRM_MODESET_LOCK_ALL_END(dev, ctx, ret);
 
 	return 0;
Return ret
Done!

quoted
-	drm_modeset_unlock_all(dev);
+	DRM_MODESET_LOCK_ALL_END(dev, ctx, ret);
 
 	return 0;
Return ret
Done!

quoted
-	drm_modeset_unlock_all(dev);
+	DRM_MODESET_LOCK_ALL_END(dev, ctx, ret);
 
Check ret here and return an error if it's != 0
Done!

quoted
@@ -1194,14 +1195,11 @@ int intel_overlay_put_image_ioctl(struct drm_device *dev, void *data,
 	if (ret != 0)
 		goto out_unlock;
 
-	drm_modeset_unlock_all(dev);
-	i915_gem_object_put(new_bo);
-
-	return 0;
-
 out_unlock:
-	drm_modeset_unlock_all(dev);
-	i915_gem_object_put(new_bo);
+	DRM_MODESET_LOCK_ALL_END(dev, ctx, ret);
+
+	if (params->flags & I915_OVERLAY_ENABLE)
+		i915_gem_object_put(new_bo);
This function refactor is a bit more involved than the
s/drm_modeset_lock_all/DRM_MODESET_LOCK_ALL_*/ changes in the rest of the patch.
Could you split it out into a separate patch so it's not hidden away?
Sure, no problem.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help