mirror of
				https://github.com/tiagovignatti/intel-gpu-tools.git
				synced 2025-11-04 12:07:12 +00:00 
			
		
		
		
	context: update for new execbuf2 element
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
This commit is contained in:
		
							parent
							
								
									b28a399dcd
								
							
						
					
					
						commit
						5a28ef8580
					
				@ -118,7 +118,7 @@ void gem_quiescent_gpu(int fd)
 | 
				
			|||||||
	execbuf.DR1 = 0;
 | 
						execbuf.DR1 = 0;
 | 
				
			||||||
	execbuf.DR4 = 0;
 | 
						execbuf.DR4 = 0;
 | 
				
			||||||
	execbuf.flags = 0;
 | 
						execbuf.flags = 0;
 | 
				
			||||||
	execbuf.rsvd1 = 0;
 | 
						i915_execbuffer2_set_context_id(execbuf, 0);
 | 
				
			||||||
	execbuf.rsvd2 = 0;
 | 
						execbuf.rsvd2 = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	do_ioctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf);
 | 
						do_ioctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf);
 | 
				
			||||||
 | 
				
			|||||||
@ -100,4 +100,11 @@ void intel_copy_bo(struct intel_batchbuffer *batch,
 | 
				
			|||||||
		   drm_intel_bo *dst_bo, drm_intel_bo *src_bo,
 | 
							   drm_intel_bo *dst_bo, drm_intel_bo *src_bo,
 | 
				
			||||||
		   int width, int height);
 | 
							   int width, int height);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define I915_EXEC_CONTEXT_ID_MASK      (0xffffffff)
 | 
				
			||||||
 | 
					#define i915_execbuffer2_set_context_id(eb2, context) \
 | 
				
			||||||
 | 
						(eb2).rsvd1 = context & I915_EXEC_CONTEXT_ID_MASK
 | 
				
			||||||
 | 
					#define i915_execbuffer2_get_context_id(eb2) \
 | 
				
			||||||
 | 
						((eb2).rsvd1 & I915_EXEC_CONTEXT_ID_MASK)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
				
			|||||||
@ -107,7 +107,7 @@ static void exec0(int fd)
 | 
				
			|||||||
	execbuf.DR1 = 0;
 | 
						execbuf.DR1 = 0;
 | 
				
			||||||
	execbuf.DR4 = 0;
 | 
						execbuf.DR4 = 0;
 | 
				
			||||||
	execbuf.flags = 0;
 | 
						execbuf.flags = 0;
 | 
				
			||||||
	execbuf.rsvd1 = 0;
 | 
						i915_execbuffer2_set_context_id(execbuf, 0);
 | 
				
			||||||
	execbuf.rsvd2 = 0;
 | 
						execbuf.rsvd2 = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	printf("trying to run an empty batchbuffer\n");
 | 
						printf("trying to run an empty batchbuffer\n");
 | 
				
			||||||
 | 
				
			|||||||
@ -224,7 +224,7 @@ static void run(int object_size)
 | 
				
			|||||||
	execbuf.DR1 = 0;
 | 
						execbuf.DR1 = 0;
 | 
				
			||||||
	execbuf.DR4 = 0;
 | 
						execbuf.DR4 = 0;
 | 
				
			||||||
	execbuf.flags = ring;
 | 
						execbuf.flags = ring;
 | 
				
			||||||
	execbuf.rsvd1 = 0;
 | 
						i915_execbuffer2_set_context_id(execbuf, 0);
 | 
				
			||||||
	execbuf.rsvd2 = 0;
 | 
						execbuf.rsvd2 = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for (count = 1; count <= 1<<17; count <<= 1) {
 | 
						for (count = 1; count <= 1<<17; count <<= 1) {
 | 
				
			||||||
 | 
				
			|||||||
@ -207,7 +207,7 @@ static void run(int object_size)
 | 
				
			|||||||
	execbuf.DR1 = 0;
 | 
						execbuf.DR1 = 0;
 | 
				
			||||||
	execbuf.DR4 = 0;
 | 
						execbuf.DR4 = 0;
 | 
				
			||||||
	execbuf.flags = ring;
 | 
						execbuf.flags = ring;
 | 
				
			||||||
	execbuf.rsvd1 = 0;
 | 
						i915_execbuffer2_set_context_id(execbuf, 0);
 | 
				
			||||||
	execbuf.rsvd2 = 0;
 | 
						execbuf.rsvd2 = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	gem_exec(fd, &execbuf);
 | 
						gem_exec(fd, &execbuf);
 | 
				
			||||||
 | 
				
			|||||||
@ -75,7 +75,7 @@ static int exec(int fd, uint32_t handle, int loops)
 | 
				
			|||||||
	execbuf.DR1 = 0;
 | 
						execbuf.DR1 = 0;
 | 
				
			||||||
	execbuf.DR4 = 0;
 | 
						execbuf.DR4 = 0;
 | 
				
			||||||
	execbuf.flags = 0;
 | 
						execbuf.flags = 0;
 | 
				
			||||||
	execbuf.rsvd1 = 0;
 | 
						i915_execbuffer2_set_context_id(execbuf, 0);
 | 
				
			||||||
	execbuf.rsvd2 = 0;
 | 
						execbuf.rsvd2 = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	while (loops-- && ret == 0) {
 | 
						while (loops-- && ret == 0) {
 | 
				
			||||||
 | 
				
			|||||||
@ -130,7 +130,8 @@ copy(int fd, uint32_t dst, uint32_t src)
 | 
				
			|||||||
	exec.num_cliprects = 0;
 | 
						exec.num_cliprects = 0;
 | 
				
			||||||
	exec.cliprects_ptr = 0;
 | 
						exec.cliprects_ptr = 0;
 | 
				
			||||||
	exec.flags = HAS_BLT_RING(intel_get_drm_devid(fd)) ? I915_EXEC_BLT : 0;
 | 
						exec.flags = HAS_BLT_RING(intel_get_drm_devid(fd)) ? I915_EXEC_BLT : 0;
 | 
				
			||||||
	exec.rsvd1 = exec.rsvd2 = 0;
 | 
						i915_execbuffer2_set_context_id(exec, 0);
 | 
				
			||||||
 | 
						exec.rsvd2 = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &exec);
 | 
						ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &exec);
 | 
				
			||||||
	while (ret && errno == EBUSY) {
 | 
						while (ret && errno == EBUSY) {
 | 
				
			||||||
 | 
				
			|||||||
@ -312,7 +312,8 @@ render_copy(int fd,
 | 
				
			|||||||
	exec.num_cliprects = 0;
 | 
						exec.num_cliprects = 0;
 | 
				
			||||||
	exec.cliprects_ptr = 0;
 | 
						exec.cliprects_ptr = 0;
 | 
				
			||||||
	exec.flags = 0;
 | 
						exec.flags = 0;
 | 
				
			||||||
	exec.rsvd1 = exec.rsvd2 = 0;
 | 
						i915_execbuffer2_set_context_id(exec, 0);
 | 
				
			||||||
 | 
						exec.rsvd2 = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &exec);
 | 
						ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &exec);
 | 
				
			||||||
	while (ret && errno == EBUSY) {
 | 
						while (ret && errno == EBUSY) {
 | 
				
			||||||
@ -389,7 +390,8 @@ static void blt_copy(int fd, uint32_t dst, uint32_t src)
 | 
				
			|||||||
	exec.num_cliprects = 0;
 | 
						exec.num_cliprects = 0;
 | 
				
			||||||
	exec.cliprects_ptr = 0;
 | 
						exec.cliprects_ptr = 0;
 | 
				
			||||||
	exec.flags = 0;
 | 
						exec.flags = 0;
 | 
				
			||||||
	exec.rsvd1 = exec.rsvd2 = 0;
 | 
						i915_execbuffer2_set_context_id(exec, 0);
 | 
				
			||||||
 | 
						exec.rsvd2 = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &exec);
 | 
						ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &exec);
 | 
				
			||||||
	while (ret && errno == EBUSY) {
 | 
						while (ret && errno == EBUSY) {
 | 
				
			||||||
 | 
				
			|||||||
@ -281,7 +281,8 @@ copy(int fd, uint32_t dst, uint32_t src)
 | 
				
			|||||||
	exec.num_cliprects = 0;
 | 
						exec.num_cliprects = 0;
 | 
				
			||||||
	exec.cliprects_ptr = 0;
 | 
						exec.cliprects_ptr = 0;
 | 
				
			||||||
	exec.flags = 0;
 | 
						exec.flags = 0;
 | 
				
			||||||
	exec.rsvd1 = exec.rsvd2 = 0;
 | 
						i915_execbuffer2_set_context_id(exec, 0);
 | 
				
			||||||
 | 
						exec.rsvd2 = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &exec);
 | 
						ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &exec);
 | 
				
			||||||
	while (ret && errno == EBUSY) {
 | 
						while (ret && errno == EBUSY) {
 | 
				
			||||||
 | 
				
			|||||||
@ -295,7 +295,8 @@ copy(int fd,
 | 
				
			|||||||
	exec.num_cliprects = 0;
 | 
						exec.num_cliprects = 0;
 | 
				
			||||||
	exec.cliprects_ptr = 0;
 | 
						exec.cliprects_ptr = 0;
 | 
				
			||||||
	exec.flags = 0;
 | 
						exec.flags = 0;
 | 
				
			||||||
	exec.rsvd1 = exec.rsvd2 = 0;
 | 
						i915_execbuffer2_set_context_id(exec, 0);
 | 
				
			||||||
 | 
						exec.rsvd2 = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &exec);
 | 
						ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &exec);
 | 
				
			||||||
	while (ret && errno == EBUSY) {
 | 
						while (ret && errno == EBUSY) {
 | 
				
			||||||
 | 
				
			|||||||
@ -282,7 +282,8 @@ copy(int fd, uint32_t dst, uint32_t src)
 | 
				
			|||||||
	exec.num_cliprects = 0;
 | 
						exec.num_cliprects = 0;
 | 
				
			||||||
	exec.cliprects_ptr = 0;
 | 
						exec.cliprects_ptr = 0;
 | 
				
			||||||
	exec.flags = 0;
 | 
						exec.flags = 0;
 | 
				
			||||||
	exec.rsvd1 = exec.rsvd2 = 0;
 | 
						i915_execbuffer2_set_context_id(exec, 0);
 | 
				
			||||||
 | 
						exec.rsvd2 = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &exec);
 | 
						ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &exec);
 | 
				
			||||||
	while (ret && errno == EBUSY) {
 | 
						while (ret && errno == EBUSY) {
 | 
				
			||||||
 | 
				
			|||||||
@ -282,7 +282,8 @@ copy(int fd, uint32_t dst, uint32_t src)
 | 
				
			|||||||
	exec.num_cliprects = 0;
 | 
						exec.num_cliprects = 0;
 | 
				
			||||||
	exec.cliprects_ptr = 0;
 | 
						exec.cliprects_ptr = 0;
 | 
				
			||||||
	exec.flags = 0;
 | 
						exec.flags = 0;
 | 
				
			||||||
	exec.rsvd1 = exec.rsvd2 = 0;
 | 
						i915_execbuffer2_set_context_id(exec, 0);
 | 
				
			||||||
 | 
						exec.rsvd2 = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &exec);
 | 
						ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &exec);
 | 
				
			||||||
	while (ret && errno == EBUSY) {
 | 
						while (ret && errno == EBUSY) {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user