[3/5] drm/client: Rename _force to _locked
diff mbox series

Message ID 20200129082410.1691996-4-daniel.vetter@ffwll.ch
State New
Headers show
Series
  • disable drm_global_mutex for most drivers
Related show

Commit Message

Daniel Vetter Jan. 29, 2020, 8:24 a.m. UTC
Plus extend the kerneldoc a bit to explain how this should be used.
With the previous patch to drop the force restore the main user of
this function is not emphasis on the "I hold the internal master lock
already" aspect, so rename the function to match.

Suggested by Noralf.

Cc: Noralf Trønnes <noralf@tronnes.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/drm_client_modeset.c | 12 +++++++-----
 drivers/gpu/drm/drm_fb_helper.c      |  4 ++--
 include/drm/drm_client.h             |  2 +-
 3 files changed, 10 insertions(+), 8 deletions(-)

Comments

Noralf Trønnes Jan. 29, 2020, 1:16 p.m. UTC | #1
Den 29.01.2020 09.24, skrev Daniel Vetter:
> Plus extend the kerneldoc a bit to explain how this should be used.
> With the previous patch to drop the force restore the main user of
> this function is not emphasis on the "I hold the internal master lock

The _not_ confuses me, the emphasis is now that "I hold the lock" right?

> already" aspect, so rename the function to match.
> 
> Suggested by Noralf.
> 
> Cc: Noralf Trønnes <noralf@tronnes.org>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---

Reviewed-by: Noralf Trønnes <noralf@tronnes.org>
Daniel Vetter Jan. 29, 2020, 2:06 p.m. UTC | #2
On Wed, Jan 29, 2020 at 2:16 PM Noralf Trønnes <noralf@tronnes.org> wrote:
> Den 29.01.2020 09.24, skrev Daniel Vetter:
> > Plus extend the kerneldoc a bit to explain how this should be used.
> > With the previous patch to drop the force restore the main user of
> > this function is not emphasis on the "I hold the internal master lock
>
> The _not_ confuses me, the emphasis is now that "I hold the lock" right?

Oops, I confused myself and mixed things up between old and new
meaning and what's now important and what not. s/not/now/, I'll fix
when applying.
-Daniel

>
> > already" aspect, so rename the function to match.
> >
> > Suggested by Noralf.
> >
> > Cc: Noralf Trønnes <noralf@tronnes.org>
> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> > ---
>
> Reviewed-by: Noralf Trønnes <noralf@tronnes.org>

Patch
diff mbox series

diff --git a/drivers/gpu/drm/drm_client_modeset.c b/drivers/gpu/drm/drm_client_modeset.c
index 6d4a29e99ae2..841794e19eb6 100644
--- a/drivers/gpu/drm/drm_client_modeset.c
+++ b/drivers/gpu/drm/drm_client_modeset.c
@@ -1094,15 +1094,17 @@  static int drm_client_modeset_commit_legacy(struct drm_client_dev *client)
 }
 
 /**
- * drm_client_modeset_commit_force() - Force commit CRTC configuration
+ * drm_client_modeset_commit_locked() - Force commit CRTC configuration
  * @client: DRM client
  *
- * Commit modeset configuration to crtcs without checking if there is a DRM master.
+ * Commit modeset configuration to crtcs without checking if there is a DRM
+ * master. The assumption is that the caller already holds an internal DRM
+ * master reference acquired with drm_master_internal_acquire().
  *
  * Returns:
  * Zero on success or negative error code on failure.
  */
-int drm_client_modeset_commit_force(struct drm_client_dev *client)
+int drm_client_modeset_commit_locked(struct drm_client_dev *client)
 {
 	struct drm_device *dev = client->dev;
 	int ret;
@@ -1116,7 +1118,7 @@  int drm_client_modeset_commit_force(struct drm_client_dev *client)
 
 	return ret;
 }
-EXPORT_SYMBOL(drm_client_modeset_commit_force);
+EXPORT_SYMBOL(drm_client_modeset_commit_locked);
 
 /**
  * drm_client_modeset_commit() - Commit CRTC configuration
@@ -1135,7 +1137,7 @@  int drm_client_modeset_commit(struct drm_client_dev *client)
 	if (!drm_master_internal_acquire(dev))
 		return -EBUSY;
 
-	ret = drm_client_modeset_commit_force(client);
+	ret = drm_client_modeset_commit_locked(client);
 
 	drm_master_internal_release(dev);
 
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index 672934e0eeed..490a99de6ec1 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -284,7 +284,7 @@  static bool drm_fb_helper_force_kernel_mode(void)
 			continue;
 
 		mutex_lock(&helper->lock);
-		ret = drm_client_modeset_commit_force(&helper->client);
+		ret = drm_client_modeset_commit_locked(&helper->client);
 		if (ret)
 			error = true;
 		mutex_unlock(&helper->lock);
@@ -1347,7 +1347,7 @@  static int pan_display_atomic(struct fb_var_screeninfo *var,
 
 	pan_set(fb_helper, var->xoffset, var->yoffset);
 
-	ret = drm_client_modeset_commit_force(&fb_helper->client);
+	ret = drm_client_modeset_commit_locked(&fb_helper->client);
 	if (!ret) {
 		info->var.xoffset = var->xoffset;
 		info->var.yoffset = var->yoffset;
diff --git a/include/drm/drm_client.h b/include/drm/drm_client.h
index d01d311023ac..3ed5dee899fd 100644
--- a/include/drm/drm_client.h
+++ b/include/drm/drm_client.h
@@ -161,7 +161,7 @@  int drm_client_modeset_create(struct drm_client_dev *client);
 void drm_client_modeset_free(struct drm_client_dev *client);
 int drm_client_modeset_probe(struct drm_client_dev *client, unsigned int width, unsigned int height);
 bool drm_client_rotation(struct drm_mode_set *modeset, unsigned int *rotation);
-int drm_client_modeset_commit_force(struct drm_client_dev *client);
+int drm_client_modeset_commit_locked(struct drm_client_dev *client);
 int drm_client_modeset_commit(struct drm_client_dev *client);
 int drm_client_modeset_dpms(struct drm_client_dev *client, int mode);