mirror of
				https://github.com/Ysurac/openmptcprouter.git
				synced 2025-03-09 15:40:20 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			29 lines
		
	
	
	
		
			1.3 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
	
		
			1.3 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
| From 61cdd8f4f24116cf877a3b865fb3c01b74d018f4 Mon Sep 17 00:00:00 2001
 | |
| From: Dave Stevenson <dave.stevenson@raspberrypi.com>
 | |
| Date: Tue, 2 Nov 2021 16:01:36 +0000
 | |
| Subject: [PATCH] drm: Check whether the gamma lut has changed before updating
 | |
| 
 | |
| drm_crtc_legacy_gamma_set updates the gamma_lut blob unconditionally,
 | |
| which leads to unnecessary reprogramming of hardware.
 | |
| 
 | |
| Check whether the blob contents has actually changed before
 | |
| signalling that it has been updated.
 | |
| 
 | |
| Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
 | |
| ---
 | |
|  drivers/gpu/drm/drm_color_mgmt.c | 4 +++-
 | |
|  1 file changed, 3 insertions(+), 1 deletion(-)
 | |
| 
 | |
| --- a/drivers/gpu/drm/drm_color_mgmt.c
 | |
| +++ b/drivers/gpu/drm/drm_color_mgmt.c
 | |
| @@ -330,7 +330,9 @@ static int drm_crtc_legacy_gamma_set(str
 | |
|  	replaced = drm_property_replace_blob(&crtc_state->degamma_lut,
 | |
|  					     use_gamma_lut ? NULL : blob);
 | |
|  	replaced |= drm_property_replace_blob(&crtc_state->ctm, NULL);
 | |
| -	replaced |= drm_property_replace_blob(&crtc_state->gamma_lut,
 | |
| +	if (!crtc_state->gamma_lut || !crtc_state->gamma_lut->data ||
 | |
| +	    memcmp(crtc_state->gamma_lut->data, blob_data, blob->length))
 | |
| +		replaced |= drm_property_replace_blob(&crtc_state->gamma_lut,
 | |
|  					      use_gamma_lut ? blob : NULL);
 | |
|  	crtc_state->color_mgmt_changed |= replaced;
 | |
|  
 |