mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	backend/drm: destroy output immediately
Instead of waiting for the next pageflip, destroy the output immediately since we can now handle flips for outputs which no longer exist. Also demote the missing crtc on flip to debug. Fixes #1739
This commit is contained in:
		
							parent
							
								
									6396710976
								
							
						
					
					
						commit
						4d36cc86eb
					
				
					 2 changed files with 2 additions and 15 deletions
				
			
		| 
						 | 
					@ -1364,12 +1364,8 @@ void scan_drm_connectors(struct wlr_drm_backend *drm) {
 | 
				
			||||||
		wlr_log(WLR_INFO, "'%s' disappeared", conn->output.name);
 | 
							wlr_log(WLR_INFO, "'%s' disappeared", conn->output.name);
 | 
				
			||||||
		drm_connector_cleanup(conn);
 | 
							drm_connector_cleanup(conn);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (conn->pageflip_pending) {
 | 
					 | 
				
			||||||
			conn->state = WLR_DRM_CONN_DISAPPEARED;
 | 
					 | 
				
			||||||
		} else {
 | 
					 | 
				
			||||||
		wlr_output_destroy(&conn->output);
 | 
							wlr_output_destroy(&conn->output);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	realloc_crtcs(drm);
 | 
						realloc_crtcs(drm);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1402,17 +1398,12 @@ static void page_flip_handler(int fd, unsigned seq,
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!conn) {
 | 
						if (!conn) {
 | 
				
			||||||
		wlr_log(WLR_ERROR, "No connector for crtc_id %u", crtc_id);
 | 
							wlr_log(WLR_DEBUG, "No connector for crtc_id %u", crtc_id);
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	conn->pageflip_pending = false;
 | 
						conn->pageflip_pending = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (conn->state == WLR_DRM_CONN_DISAPPEARED) {
 | 
					 | 
				
			||||||
		wlr_output_destroy(&conn->output);
 | 
					 | 
				
			||||||
		return;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if (conn->state != WLR_DRM_CONN_CONNECTED || conn->crtc == NULL) {
 | 
						if (conn->state != WLR_DRM_CONN_CONNECTED || conn->crtc == NULL) {
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					@ -1546,8 +1537,6 @@ static void drm_connector_cleanup(struct wlr_drm_connector *conn) {
 | 
				
			||||||
		break;
 | 
							break;
 | 
				
			||||||
	case WLR_DRM_CONN_DISCONNECTED:
 | 
						case WLR_DRM_CONN_DISCONNECTED:
 | 
				
			||||||
		break;
 | 
							break;
 | 
				
			||||||
	case WLR_DRM_CONN_DISAPPEARED:
 | 
					 | 
				
			||||||
		return; // don't change state
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	conn->state = WLR_DRM_CONN_DISCONNECTED;
 | 
						conn->state = WLR_DRM_CONN_DISCONNECTED;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -98,8 +98,6 @@ enum wlr_drm_connector_state {
 | 
				
			||||||
	WLR_DRM_CONN_NEEDS_MODESET,
 | 
						WLR_DRM_CONN_NEEDS_MODESET,
 | 
				
			||||||
	WLR_DRM_CONN_CLEANUP,
 | 
						WLR_DRM_CONN_CLEANUP,
 | 
				
			||||||
	WLR_DRM_CONN_CONNECTED,
 | 
						WLR_DRM_CONN_CONNECTED,
 | 
				
			||||||
	// Connector disappeared, waiting for being destroyed on next page-flip
 | 
					 | 
				
			||||||
	WLR_DRM_CONN_DISAPPEARED,
 | 
					 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct wlr_drm_mode {
 | 
					struct wlr_drm_mode {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue