mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	backend/drm: track pending atomic state in wlr_drm_connector_state
This centralizes logic common for both the atomic and libliftoff backends. Additionally, a struct will make it easier to implement multi-connector commits (since it can be stored in an array).
This commit is contained in:
		
							parent
							
								
									d7d974ae30
								
							
						
					
					
						commit
						4636f8c407
					
				
					 6 changed files with 116 additions and 146 deletions
				
			
		| 
						 | 
				
			
			@ -131,6 +131,12 @@ struct wlr_drm_connector_state {
 | 
			
		|||
	drmModeModeInfo mode;
 | 
			
		||||
	struct wlr_drm_fb *primary_fb;
 | 
			
		||||
	struct wlr_drm_fb *cursor_fb;
 | 
			
		||||
 | 
			
		||||
	// used by atomic
 | 
			
		||||
	uint32_t mode_id;
 | 
			
		||||
	uint32_t gamma_lut;
 | 
			
		||||
	uint32_t fb_damage_clips;
 | 
			
		||||
	bool vrr_enabled;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -20,7 +20,7 @@ struct wlr_drm_interface {
 | 
			
		|||
	void (*finish)(struct wlr_drm_backend *drm);
 | 
			
		||||
	// Commit all pending changes on a CRTC.
 | 
			
		||||
	bool (*crtc_commit)(struct wlr_drm_connector *conn,
 | 
			
		||||
		const struct wlr_drm_connector_state *state,
 | 
			
		||||
		struct wlr_drm_connector_state *state,
 | 
			
		||||
		struct wlr_drm_page_flip *page_flip, uint32_t flags, bool test_only);
 | 
			
		||||
	// Turn off everything
 | 
			
		||||
	bool (*reset)(struct wlr_drm_backend *drm);
 | 
			
		||||
| 
						 | 
				
			
			@ -33,12 +33,13 @@ extern const struct wlr_drm_interface liftoff_iface;
 | 
			
		|||
bool drm_legacy_crtc_set_gamma(struct wlr_drm_backend *drm,
 | 
			
		||||
	struct wlr_drm_crtc *crtc, size_t size, uint16_t *lut);
 | 
			
		||||
 | 
			
		||||
bool create_mode_blob(struct wlr_drm_connector *conn,
 | 
			
		||||
	const struct wlr_drm_connector_state *state, uint32_t *blob_id);
 | 
			
		||||
bool create_gamma_lut_blob(struct wlr_drm_backend *drm,
 | 
			
		||||
	size_t size, const uint16_t *lut, uint32_t *blob_id);
 | 
			
		||||
bool create_fb_damage_clips_blob(struct wlr_drm_backend *drm,
 | 
			
		||||
	int width, int height, const pixman_region32_t *damage, uint32_t *blob_id);
 | 
			
		||||
bool drm_atomic_reset(struct wlr_drm_backend *drm);
 | 
			
		||||
 | 
			
		||||
bool drm_atomic_connector_prepare(struct wlr_drm_connector_state *state,
 | 
			
		||||
	bool modeset);
 | 
			
		||||
void drm_atomic_connector_apply_commit(struct wlr_drm_connector_state *state);
 | 
			
		||||
void drm_atomic_connector_rollback_commit(struct wlr_drm_connector_state *state);
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue