mirror of
				https://github.com/tiagovignatti/intel-gpu-tools.git
				synced 2025-11-04 12:07:12 +00:00 
			
		
		
		
	flip_test: move output panning inside the flip_handler
Move the panning to a more logical place where the rest of the test steps are performed. As Daniel Vetter pointed it out, the proper place is _after_ the flip command is sent, so that fb_set_base correctly waits for any outstanding flip. So move the function between the flip and the dpms/modeset off calls. Signed-off-by: Imre Deak <imre.deak@intel.com>
This commit is contained in:
		
							parent
							
								
									3731fee849
								
							
						
					
					
						commit
						0699dc7259
					
				@ -250,6 +250,20 @@ static void page_flip_handler(int fd, unsigned int frame, unsigned int sec,
 | 
			
		||||
	if (o->flags & TEST_EBUSY)
 | 
			
		||||
		assert(do_page_flip(o, new_fb_id) == -EBUSY);
 | 
			
		||||
 | 
			
		||||
	/* pan before the flip completes */
 | 
			
		||||
	if (o->flags & TEST_PAN) {
 | 
			
		||||
		int x_ofs = o->count * 10 > o->mode.hdisplay ?
 | 
			
		||||
			    o->mode.hdisplay : o->count * 10;
 | 
			
		||||
 | 
			
		||||
		if (drmModeSetCrtc(drm_fd, o->crtc, o->fb_ids[o->current_fb_id],
 | 
			
		||||
				   x_ofs, 0, &o->id, 1, &o->mode)) {
 | 
			
		||||
			fprintf(stderr, "failed to pan (%dx%d@%dHz): %s\n",
 | 
			
		||||
				o->fb_width, o->fb_height,
 | 
			
		||||
				o->mode.vrefresh, strerror(errno));
 | 
			
		||||
			exit(7);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (o->flags & TEST_DPMS)
 | 
			
		||||
		do_or_die(set_dpms(o, DRM_MODE_DPMS_OFF));
 | 
			
		||||
 | 
			
		||||
@ -481,21 +495,6 @@ static void flip_mode(struct test_output *o, int crtc, int duration)
 | 
			
		||||
			break;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		/* pan before the flip completes */
 | 
			
		||||
		if (o->flags & TEST_PAN) {
 | 
			
		||||
			int x_ofs = o->count * 10 > o->mode.hdisplay ? o->mode.hdisplay :
 | 
			
		||||
				o->count * 10;
 | 
			
		||||
 | 
			
		||||
			if (drmModeSetCrtc(drm_fd, o->crtc, o->fb_ids[o->current_fb_id],
 | 
			
		||||
					   x_ofs, 0,
 | 
			
		||||
					   &o->id, 1, &o->mode)) {
 | 
			
		||||
				fprintf(stderr, "failed to pan (%dx%d@%dHz): %s\n",
 | 
			
		||||
					o->fb_width, o->fb_height,
 | 
			
		||||
					o->mode.vrefresh, strerror(errno));
 | 
			
		||||
				exit(7);
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		do_or_die(drmHandleEvent(drm_fd, &evctx));
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user