summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--linux-core/i915_gem.c6
-rw-r--r--linux-core/intel_display.c27
-rw-r--r--linux-core/intel_fb.c6
-rw-r--r--shared-core/i915_drv.h3
4 files changed, 22 insertions, 20 deletions
diff --git a/linux-core/i915_gem.c b/linux-core/i915_gem.c
index 64ffa356..6966c84f 100644
--- a/linux-core/i915_gem.c
+++ b/linux-core/i915_gem.c
@@ -33,10 +33,6 @@
#include <linux/swap.h>
static int
-i915_gem_object_set_domain(struct drm_gem_object *obj,
- uint32_t read_domains,
- uint32_t write_domain);
-static int
i915_gem_object_set_domain_range(struct drm_gem_object *obj,
uint64_t offset,
uint64_t size,
@@ -1318,7 +1314,7 @@ i915_gem_clflush_object(struct drm_gem_object *obj)
* MI_FLUSH
* drm_agp_chipset_flush
*/
-static int
+int
i915_gem_object_set_domain(struct drm_gem_object *obj,
uint32_t read_domains,
uint32_t write_domain)
diff --git a/linux-core/intel_display.c b/linux-core/intel_display.c
index fbe06f7c..dfc0b502 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;
diff --git a/linux-core/intel_fb.c b/linux-core/intel_fb.c
index ce8ac3d9..c1391c0a 100644
--- a/linux-core/intel_fb.c
+++ b/linux-core/intel_fb.c
@@ -716,12 +716,18 @@ int intelfb_create(struct drm_device *dev, uint32_t fb_width, uint32_t fb_height
obj_priv = fbo->driver_private;
mutex_lock(&dev->struct_mutex);
+ /* Flush everything out, we'll be doing GTT only from now on */
+ i915_gem_object_set_domain(fbo, I915_GEM_DOMAIN_GTT,
+ I915_GEM_DOMAIN_GTT);
+
ret = i915_gem_object_pin(fbo, PAGE_SIZE);
if (ret) {
DRM_ERROR("failed to pin fb: %d\n", ret);
goto out_unref;
}
+ i915_gem_clflush_object(fbo);
+
fb = intel_user_framebuffer_create(dev, NULL, &mode_cmd);
if (!fb) {
DRM_ERROR("failed to allocate fb.\n");
diff --git a/shared-core/i915_drv.h b/shared-core/i915_drv.h
index 087c6d64..a031afd2 100644
--- a/shared-core/i915_drv.h
+++ b/shared-core/i915_drv.h
@@ -627,6 +627,9 @@ int i915_gem_init_ringbuffer(struct drm_device *dev);
void i915_gem_cleanup_ringbuffer(struct drm_device *dev);
int i915_gem_do_init(struct drm_device *dev, unsigned long start,
unsigned long end);
+int i915_gem_object_set_domain(struct drm_gem_object *obj,
+ uint32_t read_domains,
+ uint32_t write_domain);
void i915_gem_retire_work_handler(struct work_struct *work);
void i915_gem_clflush_object(struct drm_gem_object *obj);
#endif