Skip to content

Commit

Permalink
drm/client: Rename _force to _locked
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Noralf Trønnes <[email protected]>
Tested-by: Thomas Zimmermann <[email protected]>
Acked-by: Thomas Zimmermann <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
  • Loading branch information
danvet committed Feb 11, 2020
1 parent 64914da commit c368ec1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
12 changes: 7 additions & 5 deletions drivers/gpu/drm/drm_client_modeset.c
Original file line number Diff line number Diff line change
Expand Up @@ -1022,15 +1022,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;
Expand All @@ -1044,7 +1046,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
Expand All @@ -1063,7 +1065,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);

Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/drm_fb_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -1342,7 +1342,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;
Expand Down
2 changes: 1 addition & 1 deletion include/drm/drm_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit c368ec1

Please sign in to comment.