mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	backend/drm: implement get_primary_formats
This commit is contained in:
		
							parent
							
								
									d1c931cbe8
								
							
						
					
					
						commit
						d6f0fc251e
					
				
					 1 changed files with 16 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -1004,6 +1004,21 @@ static void drm_connector_get_cursor_size(struct wlr_output *output,
 | 
			
		|||
	*height = (int)drm->cursor_height;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static const struct wlr_drm_format_set *drm_connector_get_primary_formats(
 | 
			
		||||
		struct wlr_output *output, uint32_t buffer_caps) {
 | 
			
		||||
	if (!(buffer_caps & WLR_BUFFER_CAP_DMABUF)) {
 | 
			
		||||
		return NULL;
 | 
			
		||||
	}
 | 
			
		||||
	struct wlr_drm_connector *conn = get_drm_connector_from_output(output);
 | 
			
		||||
	if (!conn->crtc) {
 | 
			
		||||
		return NULL;
 | 
			
		||||
	}
 | 
			
		||||
	if (conn->backend->parent) {
 | 
			
		||||
		return &conn->backend->mgpu_formats;
 | 
			
		||||
	}
 | 
			
		||||
	return &conn->crtc->primary->formats;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static const struct wlr_output_impl output_impl = {
 | 
			
		||||
	.set_cursor = drm_connector_set_cursor,
 | 
			
		||||
	.move_cursor = drm_connector_move_cursor,
 | 
			
		||||
| 
						 | 
				
			
			@ -1015,6 +1030,7 @@ static const struct wlr_output_impl output_impl = {
 | 
			
		|||
	.get_gamma_size = drm_connector_get_gamma_size,
 | 
			
		||||
	.get_cursor_formats = drm_connector_get_cursor_formats,
 | 
			
		||||
	.get_cursor_size = drm_connector_get_cursor_size,
 | 
			
		||||
	.get_primary_formats = drm_connector_get_primary_formats,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
bool wlr_output_is_drm(struct wlr_output *output) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue