mirror of
				https://github.com/tiagovignatti/intel-gpu-tools.git
				synced 2025-11-04 12:07:12 +00:00 
			
		
		
		
	lib/drmtest: extract gem_aperture_size
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
		
							parent
							
								
									d749921e48
								
							
						
					
					
						commit
						7f944349ef
					
				@ -265,6 +265,15 @@ void *gem_mmap(int fd, uint32_t handle, int size, int prot)
 | 
			
		||||
	return ptr;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
uint64_t gem_aperture_size(int fd)
 | 
			
		||||
{
 | 
			
		||||
	struct drm_i915_gem_get_aperture aperture;
 | 
			
		||||
 | 
			
		||||
	aperture.aper_size = 256*1024*1024;
 | 
			
		||||
	(void)drmIoctl(fd, DRM_IOCTL_I915_GEM_GET_APERTURE, &aperture);
 | 
			
		||||
	return aperture.aper_size;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static pid_t signal_helper = -1;
 | 
			
		||||
long long int sig_stat;
 | 
			
		||||
static void signal_helper_process(pid_t pid)
 | 
			
		||||
 | 
			
		||||
@ -47,6 +47,7 @@ void gem_set_domain(int fd, uint32_t handle,
 | 
			
		||||
void gem_sync(int fd, uint32_t handle);
 | 
			
		||||
uint32_t gem_create(int fd, int size);
 | 
			
		||||
void *gem_mmap(int fd, uint32_t handle, int size, int prot);
 | 
			
		||||
uint64_t gem_aperture_size(int fd);
 | 
			
		||||
 | 
			
		||||
void drmtest_fork_signal_helper(void);
 | 
			
		||||
void drmtest_stop_signal_helper(void);
 | 
			
		||||
 | 
			
		||||
@ -43,16 +43,6 @@
 | 
			
		||||
 | 
			
		||||
unsigned char data[OBJ_SIZE];
 | 
			
		||||
 | 
			
		||||
static uint64_t
 | 
			
		||||
gem_aperture_size(int fd)
 | 
			
		||||
{
 | 
			
		||||
	struct drm_i915_gem_get_aperture aperture;
 | 
			
		||||
 | 
			
		||||
	aperture.aper_size = 512*1024*1024;
 | 
			
		||||
	(void)drmIoctl(fd, DRM_IOCTL_I915_GEM_GET_APERTURE, &aperture);
 | 
			
		||||
	return aperture.aper_size;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
test_large_object(int fd)
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
@ -54,16 +54,6 @@
 | 
			
		||||
 | 
			
		||||
static uint32_t linear[WIDTH*HEIGHT];
 | 
			
		||||
 | 
			
		||||
static uint64_t
 | 
			
		||||
gem_aperture_size(int fd)
 | 
			
		||||
{
 | 
			
		||||
	struct drm_i915_gem_get_aperture aperture;
 | 
			
		||||
 | 
			
		||||
	aperture.aper_size = 512*1024*1024;
 | 
			
		||||
	(void)drmIoctl(fd, DRM_IOCTL_I915_GEM_GET_APERTURE, &aperture);
 | 
			
		||||
	return aperture.aper_size;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
copy(int fd, uint32_t dst, uint32_t src)
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
@ -65,15 +65,6 @@
 | 
			
		||||
 *   first one (to check consistency of the kernel recovery paths)
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
static uint64_t gem_aperture_size(int fd)
 | 
			
		||||
{
 | 
			
		||||
	struct drm_i915_gem_get_aperture aperture;
 | 
			
		||||
 | 
			
		||||
	aperture.aper_size = 256*1024*1024;
 | 
			
		||||
	(void)drmIoctl(fd, DRM_IOCTL_I915_GEM_GET_APERTURE, &aperture);
 | 
			
		||||
	return aperture.aper_size;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
drm_intel_bufmgr *bufmgr;
 | 
			
		||||
struct intel_batchbuffer *batch;
 | 
			
		||||
int drm_fd;
 | 
			
		||||
 | 
			
		||||
@ -61,16 +61,6 @@ static drm_intel_bufmgr *bufmgr;
 | 
			
		||||
struct intel_batchbuffer *batch;
 | 
			
		||||
static int width = 512, height = 512;
 | 
			
		||||
 | 
			
		||||
static uint64_t
 | 
			
		||||
gem_aperture_size(int fd)
 | 
			
		||||
{
 | 
			
		||||
	struct drm_i915_gem_get_aperture aperture;
 | 
			
		||||
 | 
			
		||||
	aperture.aper_size = 512*1024*1024;
 | 
			
		||||
	(void)drmIoctl(fd, DRM_IOCTL_I915_GEM_GET_APERTURE, &aperture);
 | 
			
		||||
	return aperture.aper_size;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static drm_intel_bo *
 | 
			
		||||
create_bo(uint32_t start_val)
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
@ -62,16 +62,6 @@ struct intel_batchbuffer *batch;
 | 
			
		||||
static int width = 512, height = 512;
 | 
			
		||||
static uint32_t linear[1024*1024/4];
 | 
			
		||||
 | 
			
		||||
static uint64_t
 | 
			
		||||
gem_aperture_size(int fd)
 | 
			
		||||
{
 | 
			
		||||
	struct drm_i915_gem_get_aperture aperture;
 | 
			
		||||
 | 
			
		||||
	aperture.aper_size = 512*1024*1024;
 | 
			
		||||
	(void)drmIoctl(fd, DRM_IOCTL_I915_GEM_GET_APERTURE, &aperture);
 | 
			
		||||
	return aperture.aper_size;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static drm_intel_bo *
 | 
			
		||||
create_bo(int fd, uint32_t start_val)
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
@ -87,16 +87,6 @@ static void gem_vmap_sync(int fd, uint32_t handle)
 | 
			
		||||
	gem_set_domain(fd, handle, I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static uint64_t
 | 
			
		||||
gem_aperture_size(int fd)
 | 
			
		||||
{
 | 
			
		||||
	struct drm_i915_gem_get_aperture aperture;
 | 
			
		||||
 | 
			
		||||
	aperture.aper_size = 512*1024*1024;
 | 
			
		||||
	(void)drmIoctl(fd, DRM_IOCTL_I915_GEM_GET_APERTURE, &aperture);
 | 
			
		||||
	return aperture.aper_size;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
gem_read(int fd, uint32_t handle, int offset, int size, void *buf)
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
@ -65,16 +65,6 @@ static inline uint32_t pack_float(float f)
 | 
			
		||||
	return u.dw;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static uint64_t
 | 
			
		||||
gem_aperture_size(int fd)
 | 
			
		||||
{
 | 
			
		||||
	struct drm_i915_gem_get_aperture aperture;
 | 
			
		||||
 | 
			
		||||
	aperture.aper_size = 512*1024*1024;
 | 
			
		||||
	(void)drmIoctl(fd, DRM_IOCTL_I915_GEM_GET_APERTURE, &aperture);
 | 
			
		||||
	return aperture.aper_size;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static uint32_t fill_reloc(struct drm_i915_gem_relocation_entry *reloc,
 | 
			
		||||
			   uint32_t offset,
 | 
			
		||||
			   uint32_t handle,
 | 
			
		||||
 | 
			
		||||
@ -65,16 +65,6 @@ static inline uint32_t pack_float(float f)
 | 
			
		||||
	return u.dw;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static uint64_t
 | 
			
		||||
gem_aperture_size(int fd)
 | 
			
		||||
{
 | 
			
		||||
	struct drm_i915_gem_get_aperture aperture;
 | 
			
		||||
 | 
			
		||||
	aperture.aper_size = 512*1024*1024;
 | 
			
		||||
	(void)drmIoctl(fd, DRM_IOCTL_I915_GEM_GET_APERTURE, &aperture);
 | 
			
		||||
	return aperture.aper_size;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static uint32_t fill_reloc(struct drm_i915_gem_relocation_entry *reloc,
 | 
			
		||||
			   uint32_t offset,
 | 
			
		||||
			   uint32_t handle,
 | 
			
		||||
 | 
			
		||||
@ -65,16 +65,6 @@ static inline uint32_t pack_float(float f)
 | 
			
		||||
	return u.dw;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static uint64_t
 | 
			
		||||
gem_aperture_size(int fd)
 | 
			
		||||
{
 | 
			
		||||
	struct drm_i915_gem_get_aperture aperture;
 | 
			
		||||
 | 
			
		||||
	aperture.aper_size = 512*1024*1024;
 | 
			
		||||
	(void)drmIoctl(fd, DRM_IOCTL_I915_GEM_GET_APERTURE, &aperture);
 | 
			
		||||
	return aperture.aper_size;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static uint32_t fill_reloc(struct drm_i915_gem_relocation_entry *reloc,
 | 
			
		||||
			   uint32_t offset,
 | 
			
		||||
			   uint32_t handle,
 | 
			
		||||
 | 
			
		||||
@ -65,16 +65,6 @@ static inline uint32_t pack_float(float f)
 | 
			
		||||
	return u.dw;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static uint64_t
 | 
			
		||||
gem_aperture_size(int fd)
 | 
			
		||||
{
 | 
			
		||||
	struct drm_i915_gem_get_aperture aperture;
 | 
			
		||||
 | 
			
		||||
	aperture.aper_size = 512*1024*1024;
 | 
			
		||||
	(void)drmIoctl(fd, DRM_IOCTL_I915_GEM_GET_APERTURE, &aperture);
 | 
			
		||||
	return aperture.aper_size;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static uint32_t fill_reloc(struct drm_i915_gem_relocation_entry *reloc,
 | 
			
		||||
			   uint32_t offset,
 | 
			
		||||
			   uint32_t handle,
 | 
			
		||||
 | 
			
		||||
@ -65,16 +65,6 @@ static inline uint32_t pack_float(float f)
 | 
			
		||||
	return u.dw;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static uint64_t
 | 
			
		||||
gem_aperture_size(int fd)
 | 
			
		||||
{
 | 
			
		||||
	struct drm_i915_gem_get_aperture aperture;
 | 
			
		||||
 | 
			
		||||
	aperture.aper_size = 512*1024*1024;
 | 
			
		||||
	(void)drmIoctl(fd, DRM_IOCTL_I915_GEM_GET_APERTURE, &aperture);
 | 
			
		||||
	return aperture.aper_size;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static uint32_t fill_reloc(struct drm_i915_gem_relocation_entry *reloc,
 | 
			
		||||
			   uint32_t offset,
 | 
			
		||||
			   uint32_t handle,
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user