Subversion Repositories Kolibri OS

Rev

Rev 3769 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3769 Rev 4245
Line 73... Line 73...
73
 
73
 
74
#ifndef DEBUG_SYNC
74
#ifndef DEBUG_SYNC
75
#define DEBUG_SYNC 0
75
#define DEBUG_SYNC 0
Line 76... Line 76...
76
#endif
76
#endif
Line 77... Line 77...
77
 
77
 
78
#define SHOW_BATCH 0
78
#define SHOW_BATCH 1
79
 
79
 
80
#if 0
80
#if 0
Line 134... Line 134...
134
struct local_i915_gem_cacheing {
134
struct local_i915_gem_cacheing {
135
	uint32_t handle;
135
	uint32_t handle;
136
	uint32_t cacheing;
136
	uint32_t cacheing;
137
};
137
};
Line 138... Line 138...
138
 
138
 
Line 139... Line 139...
139
#define LOCAL_IOCTL_I915_GEM_SET_CACHEING SRV_I915_GEM_SET_CACHEING
139
#define LOCAL_IOCTL_I915_GEM_SET_CACHEING SRV_I915_GEM_SET_CACHING
140
 
140
 
141
struct local_fbinfo {
141
struct local_fbinfo {
142
	int width;
142
	int width;
Line 3911... Line 3911...
3911
				kgem_bo_free(kgem, bo);
3911
				kgem_bo_free(kgem, bo);
3912
			}
3912
			}
3913
	}
3913
	}
3914
}
3914
}
Line -... Line 3915...
-
 
3915
 
-
 
3916
void *kgem_bo_map__async(struct kgem *kgem, struct kgem_bo *bo)
-
 
3917
{
-
 
3918
	void *ptr;
-
 
3919
 
-
 
3920
	DBG(("%s: handle=%d, offset=%d, tiling=%d, map=%p, domain=%d\n", __FUNCTION__,
-
 
3921
	     bo->handle, bo->presumed_offset, bo->tiling, bo->map, bo->domain));
-
 
3922
 
-
 
3923
	assert(!bo->purged);
-
 
3924
	assert(bo->proxy == NULL);
-
 
3925
	assert(list_is_empty(&bo->list));
-
 
3926
 
-
 
3927
	if (bo->tiling == I915_TILING_NONE && !bo->scanout && kgem->has_llc) {
-
 
3928
		DBG(("%s: converting request for GTT map into CPU map\n",
-
 
3929
		     __FUNCTION__));
-
 
3930
		return kgem_bo_map__cpu(kgem, bo);
-
 
3931
	}
-
 
3932
 
-
 
3933
	if (IS_CPU_MAP(bo->map))
-
 
3934
		kgem_bo_release_map(kgem, bo);
-
 
3935
 
-
 
3936
	ptr = bo->map;
-
 
3937
	if (ptr == NULL) {
-
 
3938
		assert(kgem_bo_size(bo) <= kgem->aperture_mappable / 2);
-
 
3939
 
-
 
3940
		kgem_trim_vma_cache(kgem, MAP_GTT, bucket(bo));
-
 
3941
 
-
 
3942
		ptr = __kgem_bo_map__gtt(kgem, bo);
-
 
3943
		if (ptr == NULL)
-
 
3944
			return NULL;
-
 
3945
 
-
 
3946
		/* Cache this mapping to avoid the overhead of an
-
 
3947
		 * excruciatingly slow GTT pagefault. This is more an
-
 
3948
		 * issue with compositing managers which need to frequently
-
 
3949
		 * flush CPU damage to their GPU bo.
-
 
3950
		 */
-
 
3951
		bo->map = ptr;
-
 
3952
		DBG(("%s: caching GTT vma for %d\n", __FUNCTION__, bo->handle));
-
 
3953
	}
-
 
3954
 
-
 
3955
	return ptr;
-
 
3956
}
Line 3915... Line 3957...
3915
 
3957
 
3916
 
3958
 
3917
void *kgem_bo_map(struct kgem *kgem, struct kgem_bo *bo)
3959
void *kgem_bo_map(struct kgem *kgem, struct kgem_bo *bo)
Line 4013... Line 4055...
4013
	}
4055
	}
Line 4014... Line 4056...
4014
 
4056
 
4015
	return ptr;
4057
	return ptr;
Line -... Line 4058...
-
 
4058
}
-
 
4059
 
-
 
4060
void *kgem_bo_map__debug(struct kgem *kgem, struct kgem_bo *bo)
-
 
4061
{
Line 4016... Line 4062...
4016
}
4062
	return kgem_bo_map__async(kgem, bo);
4017
 
4063
}
4018
 
4064