mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	backend/drm: add drm_connector_status_str()
Helper to stringify a connector status.
This commit is contained in:
		
							parent
							
								
									f12cdc53f3
								
							
						
					
					
						commit
						f361efe965
					
				
					 2 changed files with 13 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -119,6 +119,18 @@ void parse_edid(struct wlr_drm_connector *conn, size_t len, const uint8_t *data)
 | 
			
		|||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const char *drm_connector_status_str(drmModeConnection status) {
 | 
			
		||||
	switch (status) {
 | 
			
		||||
	case DRM_MODE_CONNECTED:
 | 
			
		||||
		return "connected";
 | 
			
		||||
	case DRM_MODE_DISCONNECTED:
 | 
			
		||||
		return "disconnected";
 | 
			
		||||
	case DRM_MODE_UNKNOWNCONNECTION:
 | 
			
		||||
		return "unknown";
 | 
			
		||||
	}
 | 
			
		||||
	return "<unsupported>";
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static bool is_taken(size_t n, const uint32_t arr[static n], uint32_t key) {
 | 
			
		||||
	for (size_t i = 0; i < n; ++i) {
 | 
			
		||||
		if (arr[i] == key) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -14,6 +14,7 @@ enum wlr_output_mode_aspect_ratio get_picture_aspect_ratio(const drmModeModeInfo
 | 
			
		|||
const char *get_pnp_manufacturer(uint16_t code);
 | 
			
		||||
// Populates the make/model/phys_{width,height} of output from the edid data
 | 
			
		||||
void parse_edid(struct wlr_drm_connector *conn, size_t len, const uint8_t *data);
 | 
			
		||||
const char *drm_connector_status_str(drmModeConnection status);
 | 
			
		||||
 | 
			
		||||
// Part of match_obj
 | 
			
		||||
enum {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue