Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 357962
b: refs/heads/master
c: dac3566
h: refs/heads/master
v: v3
  • Loading branch information
Daniel Vetter committed Jan 20, 2013
1 parent 5713002 commit 11585a0
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bfb899282f500eeb9dff2600729904aad0fd39e7
refs/heads/master: dac35663cef4ca7f572d430bb54b14be8f03cb10
10 changes: 4 additions & 6 deletions trunk/drivers/gpu/drm/drm_crtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2039,34 +2039,32 @@ int drm_mode_cursor_ioctl(struct drm_device *dev,
obj = drm_mode_object_find(dev, req->crtc_id, DRM_MODE_OBJECT_CRTC);
if (!obj) {
DRM_DEBUG_KMS("Unknown CRTC ID %d\n", req->crtc_id);
ret = -EINVAL;
goto out;
return -EINVAL;
}
crtc = obj_to_crtc(obj);

mutex_lock(&crtc->mutex);
if (req->flags & DRM_MODE_CURSOR_BO) {
if (!crtc->funcs->cursor_set) {
ret = -ENXIO;
goto out;
}
/* Turns off the cursor if handle is 0 */
mutex_lock(&crtc->mutex);
ret = crtc->funcs->cursor_set(crtc, file_priv, req->handle,
req->width, req->height);
mutex_unlock(&crtc->mutex);
}

if (req->flags & DRM_MODE_CURSOR_MOVE) {
if (crtc->funcs->cursor_move) {
drm_modeset_lock_all(dev);
ret = crtc->funcs->cursor_move(crtc, req->x, req->y);
drm_modeset_unlock_all(dev);
} else {
ret = -EFAULT;
goto out;
}
}
out:
mutex_unlock(&crtc->mutex);

return ret;
}

Expand Down
8 changes: 7 additions & 1 deletion trunk/drivers/gpu/drm/radeon/radeon_cursor.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,14 @@ int radeon_crtc_cursor_move(struct drm_crtc *crtc,
int i = 0;
struct drm_crtc *crtc_p;

/* avivo cursor image can't end on 128 pixel boundary or
/*
* avivo cursor image can't end on 128 pixel boundary or
* go past the end of the frame if both crtcs are enabled
*
* NOTE: It is safe to access crtc->enabled of other crtcs
* without holding either the mode_config lock or the other
* crtc's lock as long as write access to this flag _always_
* grabs all locks.
*/
list_for_each_entry(crtc_p, &crtc->dev->mode_config.crtc_list, head) {
if (crtc_p->enabled)
Expand Down
13 changes: 13 additions & 0 deletions trunk/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,23 @@ int vmw_du_crtc_cursor_move(struct drm_crtc *crtc, int x, int y)
du->cursor_x = x + crtc->x;
du->cursor_y = y + crtc->y;

/*
* FIXME: Unclear whether there's any global state touched by the
* cursor_set function, especially vmw_cursor_update_position looks
* suspicious. For now take the easy route and reacquire all locks. We
* can do this since the caller in the drm core doesn't check anything
* which is protected by any looks.
*/
mutex_unlock(&crtc->mutex);
drm_modeset_lock_all(dev_priv->dev);

vmw_cursor_update_position(dev_priv, shown,
du->cursor_x + du->hotspot_x,
du->cursor_y + du->hotspot_y);

drm_modeset_unlock_all(dev_priv->dev);
mutex_lock(&crtc->mutex);

return 0;
}

Expand Down

0 comments on commit 11585a0

Please sign in to comment.