i915_gem.c (254138) | i915_gem.c (254141) |
---|---|
1/*- 2 * Copyright �� 2008 Intel Corporation 3 * 4 * Permission is hereby granted, free of charge, to any person obtaining a 5 * copy of this software and associated documentation files (the "Software"), 6 * to deal in the Software without restriction, including without limitation 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 * and/or sell copies of the Software, and to permit persons to whom the --- 38 unchanged lines hidden (view full) --- 47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 * SUCH DAMAGE. 52 */ 53 54#include <sys/cdefs.h> | 1/*- 2 * Copyright �� 2008 Intel Corporation 3 * 4 * Permission is hereby granted, free of charge, to any person obtaining a 5 * copy of this software and associated documentation files (the "Software"), 6 * to deal in the Software without restriction, including without limitation 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 * and/or sell copies of the Software, and to permit persons to whom the --- 38 unchanged lines hidden (view full) --- 47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 * SUCH DAMAGE. 52 */ 53 54#include <sys/cdefs.h> |
55__FBSDID("$FreeBSD: head/sys/dev/drm2/i915/i915_gem.c 254138 2013-08-09 11:11:11Z attilio $"); | 55__FBSDID("$FreeBSD: head/sys/dev/drm2/i915/i915_gem.c 254141 2013-08-09 11:28:55Z attilio $"); |
56 57#include <dev/drm2/drmP.h> 58#include <dev/drm2/drm.h> 59#include <dev/drm2/i915/i915_drm.h> 60#include <dev/drm2/i915/i915_drv.h> 61#include <dev/drm2/i915/intel_drv.h> 62#include <dev/drm2/i915/intel_ringbuffer.h> 63#include <sys/resourcevar.h> 64#include <sys/sched.h> 65#include <sys/sf_buf.h> 66 | 56 57#include <dev/drm2/drmP.h> 58#include <dev/drm2/drm.h> 59#include <dev/drm2/i915/i915_drm.h> 60#include <dev/drm2/i915/i915_drv.h> 61#include <dev/drm2/i915/intel_drv.h> 62#include <dev/drm2/i915/intel_ringbuffer.h> 63#include <sys/resourcevar.h> 64#include <sys/sched.h> 65#include <sys/sf_buf.h> 66 |
67#include <vm/vm.h> 68#include <vm/vm_pageout.h> 69 |
|
67static void i915_gem_object_flush_cpu_write_domain( 68 struct drm_i915_gem_object *obj); 69static uint32_t i915_gem_get_gtt_size(struct drm_device *dev, uint32_t size, 70 int tiling_mode); 71static uint32_t i915_gem_get_gtt_alignment(struct drm_device *dev, 72 uint32_t size, int tiling_mode); 73static int i915_gem_object_bind_to_gtt(struct drm_i915_gem_object *obj, 74 unsigned alignment, bool map_and_fenceable); --- 1363 unchanged lines hidden (view full) --- 1438 1439 if (vm_page_busied(m)) { 1440 DRM_UNLOCK(dev); 1441 vm_page_lock(m); 1442 VM_OBJECT_WUNLOCK(vm_obj); 1443 vm_page_busy_sleep(m, "915pbs"); 1444 goto retry; 1445 } | 70static void i915_gem_object_flush_cpu_write_domain( 71 struct drm_i915_gem_object *obj); 72static uint32_t i915_gem_get_gtt_size(struct drm_device *dev, uint32_t size, 73 int tiling_mode); 74static uint32_t i915_gem_get_gtt_alignment(struct drm_device *dev, 75 uint32_t size, int tiling_mode); 76static int i915_gem_object_bind_to_gtt(struct drm_i915_gem_object *obj, 77 unsigned alignment, bool map_and_fenceable); --- 1363 unchanged lines hidden (view full) --- 1441 1442 if (vm_page_busied(m)) { 1443 DRM_UNLOCK(dev); 1444 vm_page_lock(m); 1445 VM_OBJECT_WUNLOCK(vm_obj); 1446 vm_page_busy_sleep(m, "915pbs"); 1447 goto retry; 1448 } |
1449 if (vm_page_insert(m, vm_obj, OFF_TO_IDX(offset))) { 1450 DRM_UNLOCK(dev); 1451 VM_OBJECT_WUNLOCK(vm_obj); 1452 VM_WAIT; 1453 VM_OBJECT_WLOCK(vm_obj); 1454 goto retry; 1455 } |
|
1446 m->valid = VM_PAGE_BITS_ALL; | 1456 m->valid = VM_PAGE_BITS_ALL; |
1447 vm_page_insert(m, vm_obj, OFF_TO_IDX(offset)); | |
1448have_page: 1449 *mres = m; 1450 vm_page_xbusy(m); 1451 1452 CTR4(KTR_DRM, "fault %p %jx %x phys %x", gem_obj, offset, prot, 1453 m->phys_addr); 1454 DRM_UNLOCK(dev); 1455 if (oldm != NULL) { --- 2323 unchanged lines hidden --- | 1457have_page: 1458 *mres = m; 1459 vm_page_xbusy(m); 1460 1461 CTR4(KTR_DRM, "fault %p %jx %x phys %x", gem_obj, offset, prot, 1462 m->phys_addr); 1463 DRM_UNLOCK(dev); 1464 if (oldm != NULL) { --- 2323 unchanged lines hidden --- |