mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	drm/tegra: Convert to using __drm_atomic_helper_crtc_reset() for reset.
Convert tegra to using __drm_atomic_helper_crtc_reset(), instead of writing its own version. Instead of open coding destroy_state(), call it directly for freeing the old state. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Thierry Reding <thierry.reding@gmail.com> Cc: Jonathan Hunter <jonathanh@nvidia.com> Cc: linux-tegra@vger.kernel.org [mlankhorst: Keep tegra_crtc_reset at the same place and predeclare tegra_crtc_atomic_destroy_state (tagr)] Acked-by: Thierry Reding <treding@nvidia.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190301125627.7285-15-maarten.lankhorst@linux.intel.com
This commit is contained in:
		
							parent
							
								
									01e2eaf40c
								
							
						
					
					
						commit
						b7e0b04ae4
					
				
					 1 changed files with 6 additions and 11 deletions
				
			
		| 
						 | 
					@ -26,6 +26,9 @@
 | 
				
			||||||
#include <drm/drm_atomic_helper.h>
 | 
					#include <drm/drm_atomic_helper.h>
 | 
				
			||||||
#include <drm/drm_plane_helper.h>
 | 
					#include <drm/drm_plane_helper.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static void tegra_crtc_atomic_destroy_state(struct drm_crtc *crtc,
 | 
				
			||||||
 | 
										    struct drm_crtc_state *state);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void tegra_dc_stats_reset(struct tegra_dc_stats *stats)
 | 
					static void tegra_dc_stats_reset(struct tegra_dc_stats *stats)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	stats->frames = 0;
 | 
						stats->frames = 0;
 | 
				
			||||||
| 
						 | 
					@ -1155,20 +1158,12 @@ static void tegra_dc_destroy(struct drm_crtc *crtc)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void tegra_crtc_reset(struct drm_crtc *crtc)
 | 
					static void tegra_crtc_reset(struct drm_crtc *crtc)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct tegra_dc_state *state;
 | 
						struct tegra_dc_state *state = kzalloc(sizeof(*state), GFP_KERNEL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (crtc->state)
 | 
						if (crtc->state)
 | 
				
			||||||
		__drm_atomic_helper_crtc_destroy_state(crtc->state);
 | 
							tegra_crtc_atomic_destroy_state(crtc, crtc->state);
 | 
				
			||||||
 | 
					 | 
				
			||||||
	kfree(crtc->state);
 | 
					 | 
				
			||||||
	crtc->state = NULL;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	state = kzalloc(sizeof(*state), GFP_KERNEL);
 | 
					 | 
				
			||||||
	if (state) {
 | 
					 | 
				
			||||||
		crtc->state = &state->base;
 | 
					 | 
				
			||||||
		crtc->state->crtc = crtc;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						__drm_atomic_helper_crtc_reset(crtc, &state->base);
 | 
				
			||||||
	drm_crtc_vblank_reset(crtc);
 | 
						drm_crtc_vblank_reset(crtc);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue