Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 129826
b: refs/heads/master
c: 34b8686
h: refs/heads/master
v: v3
  • Loading branch information
Dave Airlie committed Jan 16, 2009
1 parent 798320c commit 232ce4b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 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: 71acb5eb8d95b371f4cdd88a47f3c83c870d1c8f
refs/heads/master: 34b8686e12eaf9878aaab89e92222060c3e7cc48
17 changes: 11 additions & 6 deletions trunk/drivers/gpu/drm/i915/intel_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -1016,25 +1016,23 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc,

if (bo->size < width * height * 4) {
DRM_ERROR("buffer is to small\n");
drm_gem_object_unreference(bo);
return -ENOMEM;
ret = -ENOMEM;
goto fail;
}

/* we only need to pin inside GTT if cursor is non-phy */
if (!dev_priv->cursor_needs_physical) {
ret = i915_gem_object_pin(bo, PAGE_SIZE);
if (ret) {
DRM_ERROR("failed to pin cursor bo\n");
drm_gem_object_unreference(bo);
return ret;
goto fail;
}
addr = obj_priv->gtt_offset;
} else {
ret = i915_gem_attach_phys_object(dev, bo, (pipe == 0) ? I915_GEM_PHYS_CURSOR_0 : I915_GEM_PHYS_CURSOR_1);
if (ret) {
DRM_ERROR("failed to attach phys object\n");
drm_gem_object_unreference(bo);
return ret;
goto fail;
}
addr = obj_priv->phys_obj->handle->busaddr;
}
Expand All @@ -1054,13 +1052,20 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc,
i915_gem_detach_phys_object(dev, intel_crtc->cursor_bo);
} else
i915_gem_object_unpin(intel_crtc->cursor_bo);
mutex_lock(&dev->struct_mutex);
drm_gem_object_unreference(intel_crtc->cursor_bo);
mutex_unlock(&dev->struct_mutex);
}

intel_crtc->cursor_addr = addr;
intel_crtc->cursor_bo = bo;

return 0;
fail:
mutex_lock(&dev->struct_mutex);
drm_gem_object_unreference(bo);
mutex_unlock(&dev->struct_mutex);
return ret;
}

static int intel_crtc_cursor_move(struct drm_crtc *crtc, int x, int y)
Expand Down

0 comments on commit 232ce4b

Please sign in to comment.