diff options
Diffstat (limited to 'sys/dev/pci/drm')
-rw-r--r-- | sys/dev/pci/drm/i915/i915_drv.c | 4 | ||||
-rw-r--r-- | sys/dev/pci/drm/i915/i915_drv.h | 4 | ||||
-rw-r--r-- | sys/dev/pci/drm/i915/i915_gem.c | 34 | ||||
-rw-r--r-- | sys/dev/pci/drm/i915/i915_gem_execbuffer.c | 4 | ||||
-rw-r--r-- | sys/dev/pci/drm/i915/intel_overlay.c | 5 | ||||
-rw-r--r-- | sys/dev/pci/drm/i915/intel_pm.c | 4 | ||||
-rw-r--r-- | sys/dev/pci/drm/i915/intel_ringbuffer.c | 10 |
7 files changed, 34 insertions, 31 deletions
diff --git a/sys/dev/pci/drm/i915/i915_drv.c b/sys/dev/pci/drm/i915/i915_drv.c index e51da6c63e0..a33c0505ed5 100644 --- a/sys/dev/pci/drm/i915/i915_drv.c +++ b/sys/dev/pci/drm/i915/i915_drv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: i915_drv.c,v 1.26 2013/05/05 13:02:45 kettenis Exp $ */ +/* $OpenBSD: i915_drv.c,v 1.27 2013/05/05 13:55:36 kettenis Exp $ */ /* * Copyright (c) 2008-2009 Owain G. Ainsworth <oga@openbsd.org> * @@ -1342,7 +1342,7 @@ i915_gem_object_pin_and_relocate(struct drm_obj *obj, /* Choose the GTT offset for our buffer and put it there. */ ret = i915_gem_object_pin(obj_priv, (u_int32_t)entry->alignment, - needs_fence); + needs_fence, false); if (ret) return ret; diff --git a/sys/dev/pci/drm/i915/i915_drv.h b/sys/dev/pci/drm/i915/i915_drv.h index 62496fecf85..bc938450ca8 100644 --- a/sys/dev/pci/drm/i915/i915_drv.h +++ b/sys/dev/pci/drm/i915/i915_drv.h @@ -1,4 +1,4 @@ -/* $OpenBSD: i915_drv.h,v 1.16 2013/05/05 13:02:46 kettenis Exp $ */ +/* $OpenBSD: i915_drv.h,v 1.17 2013/05/05 13:55:36 kettenis Exp $ */ /* i915_drv.h -- Private header for the I915 driver -*- linux-c -*- */ /* @@ -1059,7 +1059,7 @@ int i915_gem_set_caching_ioctl(struct drm_device *, void *, /* GEM memory manager functions */ int i915_gem_init_object(struct drm_obj *); void i915_gem_free_object(struct drm_obj *); -int i915_gem_object_pin(struct drm_i915_gem_object *, uint32_t, bool); +int i915_gem_object_pin(struct drm_i915_gem_object *, uint32_t, bool, bool); void i915_gem_object_unpin(struct drm_i915_gem_object *); void i915_gem_retire_requests(struct drm_device *); void i915_gem_retire_requests_ring(struct intel_ring_buffer *); diff --git a/sys/dev/pci/drm/i915/i915_gem.c b/sys/dev/pci/drm/i915/i915_gem.c index edf1f16642e..c3c23a5804d 100644 --- a/sys/dev/pci/drm/i915/i915_gem.c +++ b/sys/dev/pci/drm/i915/i915_gem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: i915_gem.c,v 1.14 2013/05/05 13:19:00 kettenis Exp $ */ +/* $OpenBSD: i915_gem.c,v 1.15 2013/05/05 13:55:36 kettenis Exp $ */ /* * Copyright (c) 2008-2009 Owain G. Ainsworth <oga@openbsd.org> * @@ -78,7 +78,8 @@ int i915_gem_object_flush_active(struct drm_i915_gem_object *); int i915_gem_check_olr(struct intel_ring_buffer *, u32); void i915_gem_object_truncate(struct drm_i915_gem_object *obj); int i915_gem_object_bind_to_gtt(struct drm_i915_gem_object *obj, - unsigned alignment, bool map_and_fenceable); + unsigned alignment, bool map_and_fenceable, + bool nonblocking); int i915_gem_wait_for_error(struct drm_device *); int __wait_seqno(struct intel_ring_buffer *, uint32_t, bool, struct timespec *); @@ -347,10 +348,10 @@ i915_gem_pread_ioctl(struct drm_device *dev, void *data, goto out; } - ret = i915_gem_object_pin(obj, 0, 1); - if (ret) { + ret = i915_gem_object_pin(obj, 0, true, true); + if (ret) goto out; - } + ret = i915_gem_object_set_to_gtt_domain(obj, false); if (ret) goto unpin; @@ -417,10 +418,10 @@ i915_gem_pwrite_ioctl(struct drm_device *dev, void *data, goto out; } - ret = i915_gem_object_pin(obj, 0, 1); - if (ret) { + ret = i915_gem_object_pin(obj, 0, true, true); + if (ret) goto out; - } + ret = i915_gem_object_set_to_gtt_domain(obj, true); if (ret) goto unpin; @@ -778,7 +779,7 @@ i915_gem_fault(struct drm_obj *gem_obj, struct uvm_faultinfo *ufi, } if (obj->dmamap == NULL) { - ret = i915_gem_object_bind_to_gtt(obj, 0, true); + ret = i915_gem_object_bind_to_gtt(obj, 0, true, false); if (ret) goto error; @@ -990,7 +991,7 @@ i915_gem_mmap_gtt(struct drm_file *file, struct drm_device *dev, goto done; } - ret = i915_gem_object_bind_to_gtt(obj, 0, true); + ret = i915_gem_object_bind_to_gtt(obj, 0, true, false); if (ret) { printf("%s: failed to bind\n", __func__); goto done; @@ -2030,7 +2031,8 @@ i915_gem_object_get_fence(struct drm_i915_gem_object *obj) int i915_gem_object_bind_to_gtt(struct drm_i915_gem_object *obj, unsigned alignment, - bool map_and_fenceable) + bool map_and_fenceable, + bool nonblocking) { struct drm_device *dev = obj->base.dev; drm_i915_private_t *dev_priv = dev->dev_private; @@ -2464,7 +2466,7 @@ i915_gem_object_pin_to_display_plane(struct drm_i915_gem_object *obj, * (e.g. libkms for the bootup splash), we have to ensure that we * always use map_and_fenceable for all scanout buffers. */ - ret = i915_gem_object_pin(obj, alignment, true); + ret = i915_gem_object_pin(obj, alignment, true, false); if (ret) return ret; @@ -2603,7 +2605,8 @@ i915_gem_ring_throttle(struct drm_device *dev, struct drm_file *file) int i915_gem_object_pin(struct drm_i915_gem_object *obj, uint32_t alignment, - bool map_and_fenceable) + bool map_and_fenceable, + bool nonblocking) { struct drm_device *dev = obj->base.dev; int ret; @@ -2629,7 +2632,8 @@ i915_gem_object_pin(struct drm_i915_gem_object *obj, if (obj->dmamap == NULL) { ret = i915_gem_object_bind_to_gtt(obj, alignment, - map_and_fenceable); + map_and_fenceable, + nonblocking); if (ret) return ret; } @@ -2695,7 +2699,7 @@ i915_gem_pin_ioctl(struct drm_device *dev, void *data, } if (obj->user_pin_count == 0) { - ret = i915_gem_object_pin(obj, args->alignment, 1); + ret = i915_gem_object_pin(obj, args->alignment, true, false); if (ret) goto out; inteldrm_set_max_obj_size(dev_priv); diff --git a/sys/dev/pci/drm/i915/i915_gem_execbuffer.c b/sys/dev/pci/drm/i915/i915_gem_execbuffer.c index d4a9c3a37cd..a96d3cb9ec4 100644 --- a/sys/dev/pci/drm/i915/i915_gem_execbuffer.c +++ b/sys/dev/pci/drm/i915/i915_gem_execbuffer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: i915_gem_execbuffer.c,v 1.6 2013/04/17 20:04:04 kettenis Exp $ */ +/* $OpenBSD: i915_gem_execbuffer.c,v 1.7 2013/05/05 13:55:36 kettenis Exp $ */ /* * Copyright (c) 2008-2009 Owain G. Ainsworth <oga@openbsd.org> * @@ -113,7 +113,7 @@ i915_gem_execbuffer_reserve_object(struct drm_i915_gem_object *obj, obj->tiling_mode != I915_TILING_NONE; need_mappable = need_fence || need_reloc_mappable(obj); - ret = i915_gem_object_pin(obj, entry->alignment, need_mappable); + ret = i915_gem_object_pin(obj, entry->alignment, need_mappable, false); if (ret) return ret; diff --git a/sys/dev/pci/drm/i915/intel_overlay.c b/sys/dev/pci/drm/i915/intel_overlay.c index 8751c68fdca..6b916482537 100644 --- a/sys/dev/pci/drm/i915/intel_overlay.c +++ b/sys/dev/pci/drm/i915/intel_overlay.c @@ -1,4 +1,4 @@ -/* $OpenBSD: intel_overlay.c,v 1.3 2013/04/17 20:04:04 kettenis Exp $ */ +/* $OpenBSD: intel_overlay.c,v 1.4 2013/05/05 13:55:36 kettenis Exp $ */ /* * Copyright © 2009 * @@ -1439,8 +1439,7 @@ intel_setup_overlay(struct drm_device *dev) } overlay->flip_addr = reg_bo->phys_obj->handle->segs[0].ds_addr; } else { -// ret = i915_gem_object_pin(reg_bo, PAGE_SIZE, true, false); - ret = i915_gem_object_pin(reg_bo, PAGE_SIZE, true); + ret = i915_gem_object_pin(reg_bo, PAGE_SIZE, true, false); if (ret) { DRM_ERROR("failed to pin overlay register bo\n"); goto out_free_bo; diff --git a/sys/dev/pci/drm/i915/intel_pm.c b/sys/dev/pci/drm/i915/intel_pm.c index 905a2dba2f9..c013eb2e48b 100644 --- a/sys/dev/pci/drm/i915/intel_pm.c +++ b/sys/dev/pci/drm/i915/intel_pm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: intel_pm.c,v 1.4 2013/04/17 20:04:05 kettenis Exp $ */ +/* $OpenBSD: intel_pm.c,v 1.5 2013/05/05 13:55:36 kettenis Exp $ */ /* * Copyright © 2012 Intel Corporation * @@ -2443,7 +2443,7 @@ intel_alloc_context_page(struct drm_device *dev) return NULL; } - ret = i915_gem_object_pin(ctx, 4096, true /*, false */); + ret = i915_gem_object_pin(ctx, 4096, true, false); if (ret) { DRM_ERROR("failed to pin power context: %d\n", ret); goto err_unref; diff --git a/sys/dev/pci/drm/i915/intel_ringbuffer.c b/sys/dev/pci/drm/i915/intel_ringbuffer.c index 8f00b626e6e..b57048535fc 100644 --- a/sys/dev/pci/drm/i915/intel_ringbuffer.c +++ b/sys/dev/pci/drm/i915/intel_ringbuffer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: intel_ringbuffer.c,v 1.2 2013/04/17 20:04:05 kettenis Exp $ */ +/* $OpenBSD: intel_ringbuffer.c,v 1.3 2013/05/05 13:55:36 kettenis Exp $ */ /* * Copyright © 2008-2010 Intel Corporation * @@ -529,7 +529,7 @@ init_pipe_control(struct intel_ring_buffer *ring) */ obj->dma_flags = BUS_DMA_COHERENT | BUS_DMA_READ; - ret = i915_gem_object_pin(obj, 4096, true); + ret = i915_gem_object_pin(obj, 4096, true, false); if (ret) goto err_unref; @@ -1173,7 +1173,7 @@ init_status_page(struct intel_ring_buffer *ring) */ obj->dma_flags = BUS_DMA_COHERENT | BUS_DMA_READ; - ret = i915_gem_object_pin(obj, 4096, true); + ret = i915_gem_object_pin(obj, 4096, true, false); if (ret != 0) { goto err_unref; } @@ -1294,7 +1294,7 @@ intel_init_ring_buffer(struct drm_device *dev, ring->obj = obj; - ret = i915_gem_object_pin(obj, PAGE_SIZE, true); + ret = i915_gem_object_pin(obj, PAGE_SIZE, true, false); if (ret) goto err_unref; @@ -1800,7 +1800,7 @@ intel_init_render_ring_buffer(struct drm_device *dev) return -ENOMEM; } - ret = i915_gem_object_pin(obj, 0, true); + ret = i915_gem_object_pin(obj, 0, true, false); if (ret != 0) { drm_gem_object_unreference(&obj->base); DRM_ERROR("Failed to ping batch bo\n"); |