mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	backend/drm: don't set vsync present flag if page flip was async
(cherry picked from commit 08495d2596)
			
			
This commit is contained in:
		
							parent
							
								
									b4bec0cd3a
								
							
						
					
					
						commit
						89e1ea130d
					
				
					 2 changed files with 7 additions and 2 deletions
				
			
		| 
						 | 
					@ -608,6 +608,7 @@ static bool drm_commit(struct wlr_drm_backend *drm,
 | 
				
			||||||
		if (page_flip == NULL) {
 | 
							if (page_flip == NULL) {
 | 
				
			||||||
			return false;
 | 
								return false;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
							page_flip->async = (flags & DRM_MODE_PAGE_FLIP_ASYNC);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	bool ok = drm->iface->commit(drm, state, page_flip, flags, test_only);
 | 
						bool ok = drm->iface->commit(drm, state, page_flip, flags, test_only);
 | 
				
			||||||
| 
						 | 
					@ -2039,8 +2040,10 @@ static void handle_page_flip(int fd, unsigned seq,
 | 
				
			||||||
		drm_fb_move(&layer->current_fb, &layer->queued_fb);
 | 
							drm_fb_move(&layer->current_fb, &layer->queued_fb);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	uint32_t present_flags = WLR_OUTPUT_PRESENT_VSYNC |
 | 
						uint32_t present_flags = WLR_OUTPUT_PRESENT_HW_CLOCK | WLR_OUTPUT_PRESENT_HW_COMPLETION;
 | 
				
			||||||
		WLR_OUTPUT_PRESENT_HW_CLOCK | WLR_OUTPUT_PRESENT_HW_COMPLETION;
 | 
						if (!page_flip->async) {
 | 
				
			||||||
 | 
							present_flags |= WLR_OUTPUT_PRESENT_VSYNC;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	/* Don't report ZERO_COPY in multi-gpu situations, because we had to copy
 | 
						/* Don't report ZERO_COPY in multi-gpu situations, because we had to copy
 | 
				
			||||||
	 * data between the GPUs, even if we were using the direct scanout
 | 
						 * data between the GPUs, even if we were using the direct scanout
 | 
				
			||||||
	 * interface.
 | 
						 * interface.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -164,6 +164,8 @@ struct wlr_drm_page_flip {
 | 
				
			||||||
	struct wl_list link; // wlr_drm_connector.page_flips
 | 
						struct wl_list link; // wlr_drm_connector.page_flips
 | 
				
			||||||
	struct wlr_drm_page_flip_connector *connectors;
 | 
						struct wlr_drm_page_flip_connector *connectors;
 | 
				
			||||||
	size_t connectors_len;
 | 
						size_t connectors_len;
 | 
				
			||||||
 | 
						// True if DRM_MODE_PAGE_FLIP_ASYNC was set
 | 
				
			||||||
 | 
						bool async;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct wlr_drm_page_flip_connector {
 | 
					struct wlr_drm_page_flip_connector {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue