mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	drm/sun4i: engine: Create an atomic_begin callback
We have to implement some display engine specific behaviours in atomic_begin. Let's add a function for that. Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Link: https://patchwork.freedesktop.org/patch/msgid/44110951ae0cc13767fefc7fc1d9e2ec782d0a40.1516613040.git-series.maxime.ripard@free-electrons.com
This commit is contained in:
		
							parent
							
								
									3004f75fd4
								
							
						
					
					
						commit
						6b8562c86e
					
				
					 2 changed files with 18 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -64,6 +64,7 @@ static void sun4i_crtc_atomic_begin(struct drm_crtc *crtc,
 | 
			
		|||
{
 | 
			
		||||
	struct sun4i_crtc *scrtc = drm_crtc_to_sun4i_crtc(crtc);
 | 
			
		||||
	struct drm_device *dev = crtc->dev;
 | 
			
		||||
	struct sunxi_engine *engine = scrtc->engine;
 | 
			
		||||
	unsigned long flags;
 | 
			
		||||
 | 
			
		||||
	if (crtc->state->event) {
 | 
			
		||||
| 
						 | 
				
			
			@ -74,6 +75,9 @@ static void sun4i_crtc_atomic_begin(struct drm_crtc *crtc,
 | 
			
		|||
		spin_unlock_irqrestore(&dev->event_lock, flags);
 | 
			
		||||
		crtc->state->event = NULL;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (engine->ops->atomic_begin)
 | 
			
		||||
		engine->ops->atomic_begin(engine, old_state);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void sun4i_crtc_atomic_flush(struct drm_crtc *crtc,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -22,6 +22,19 @@ struct sunxi_engine;
 | 
			
		|||
 * implement the proper behaviour.
 | 
			
		||||
 */
 | 
			
		||||
struct sunxi_engine_ops {
 | 
			
		||||
	/**
 | 
			
		||||
	 * @atomic_begin:
 | 
			
		||||
	 *
 | 
			
		||||
	 * This callback allows to prepare our engine for an atomic
 | 
			
		||||
	 * update. This is mirroring the
 | 
			
		||||
	 * &drm_crtc_helper_funcs.atomic_begin callback, so any
 | 
			
		||||
	 * documentation there applies.
 | 
			
		||||
	 *
 | 
			
		||||
	 * This function is optional.
 | 
			
		||||
	 */
 | 
			
		||||
	void (*atomic_begin)(struct sunxi_engine *engine,
 | 
			
		||||
			     struct drm_crtc_state *old_state);
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * @atomic_check:
 | 
			
		||||
	 *
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue