From 5f9e4a764ac7acf1311388dd693bc4f0e6c0c4e9 Mon Sep 17 00:00:00 2001 From: Jesse Barnes Date: Wed, 13 Aug 2008 16:57:42 -0700 Subject: [PATCH] i915: update cursor handling to use GEM objects --- linux-core/intel_display.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/linux-core/intel_display.c b/linux-core/intel_display.c index fbe06f7..dfc0b50 100644 --- a/linux-core/intel_display.c +++ b/linux-core/intel_display.c @@ -982,12 +982,12 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc, struct drm_device *dev = crtc->dev; struct drm_i915_private *dev_priv = dev->dev_private; struct intel_crtc *intel_crtc = to_intel_crtc(crtc); - struct drm_buffer_object *bo; + struct drm_gem_object *bo; + struct drm_i915_gem_object *obj_priv; int pipe = intel_crtc->pipe; uint32_t control = (pipe == 0) ? CURACNTR : CURBCNTR; uint32_t base = (pipe == 0) ? CURABASE : CURBBASE; uint32_t temp; - int ret; size_t addr; DRM_DEBUG("\n"); @@ -1010,25 +1010,22 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc, return -EINVAL; } - ret = drm_get_buffer_object(dev, &bo, handle); - if (ret) { - return -EINVAL; - } + bo = drm_gem_object_lookup(dev, file_priv, handle); + if (!bo) + return -ENOENT; - if ((bo->mem.flags & DRM_BO_MASK_MEM) != DRM_BO_FLAG_MEM_VRAM) { - DRM_ERROR("buffer needs to be in VRAM\n"); - return -ENOMEM; - } + obj_priv = bo->driver_private; - if (bo->mem.size < width * height * 4) { + if (bo->size < width * height * 4) { DRM_ERROR("buffer is to small\n"); return -ENOMEM; } - if (dev_priv->cursor_needs_physical) - addr = dev_priv->stolen_base + bo->offset; - else - addr = bo->offset; + if (dev_priv->cursor_needs_physical) { + addr = dev->agp->base + obj_priv->gtt_offset; + } else { + addr = obj_priv->gtt_offset; + } intel_crtc->cursor_addr = addr; temp = 0; -- 2.7.4