Browse Source

disp: msm: sde: assign correct size for sspp color proc feature data

Instead of hard coding the size of the blob data, pass the exact
size retrieved from drm property framework to color processing layer.
Color processing layer has size check to make sure the blob data size
matches the expected size.

Change-Id: I277f9be1ba84e4e4707847756a9ed0ea1ed23f53
Signed-off-by: Ping Li <[email protected]>
Ping Li 4 years ago
parent
commit
1971601fbd
1 changed files with 4 additions and 4 deletions
  1. 4 4
      msm/sde/sde_plane.c

+ 4 - 4
msm/sde/sde_plane.c

@@ -1215,7 +1215,7 @@ static void sde_color_process_plane_setup(struct drm_plane *plane)
 				PLANE_PROP_VIG_GAMUT);
 				PLANE_PROP_VIG_GAMUT);
 		hw_cfg.last_feature = 0;
 		hw_cfg.last_feature = 0;
 		hw_cfg.ctl = ctl;
 		hw_cfg.ctl = ctl;
-		hw_cfg.len = sizeof(struct drm_msm_3d_gamut);
+		hw_cfg.len = size;
 		hw_cfg.payload = vig_gamut;
 		hw_cfg.payload = vig_gamut;
 		psde->pipe_hw->ops.setup_vig_gamut(psde->pipe_hw, &hw_cfg);
 		psde->pipe_hw->ops.setup_vig_gamut(psde->pipe_hw, &hw_cfg);
 	}
 	}
@@ -1228,7 +1228,7 @@ static void sde_color_process_plane_setup(struct drm_plane *plane)
 				PLANE_PROP_VIG_IGC);
 				PLANE_PROP_VIG_IGC);
 		hw_cfg.last_feature = 0;
 		hw_cfg.last_feature = 0;
 		hw_cfg.ctl = ctl;
 		hw_cfg.ctl = ctl;
-		hw_cfg.len = sizeof(struct drm_msm_igc_lut);
+		hw_cfg.len = size;
 		hw_cfg.payload = igc;
 		hw_cfg.payload = igc;
 		psde->pipe_hw->ops.setup_vig_igc(psde->pipe_hw, &hw_cfg);
 		psde->pipe_hw->ops.setup_vig_igc(psde->pipe_hw, &hw_cfg);
 	}
 	}
@@ -1241,7 +1241,7 @@ static void sde_color_process_plane_setup(struct drm_plane *plane)
 				PLANE_PROP_DMA_IGC);
 				PLANE_PROP_DMA_IGC);
 		hw_cfg.last_feature = 0;
 		hw_cfg.last_feature = 0;
 		hw_cfg.ctl = ctl;
 		hw_cfg.ctl = ctl;
-		hw_cfg.len = sizeof(struct drm_msm_igc_lut);
+		hw_cfg.len = size;
 		hw_cfg.payload = igc;
 		hw_cfg.payload = igc;
 		psde->pipe_hw->ops.setup_dma_igc(psde->pipe_hw, &hw_cfg,
 		psde->pipe_hw->ops.setup_dma_igc(psde->pipe_hw, &hw_cfg,
 				pstate->multirect_index);
 				pstate->multirect_index);
@@ -1255,7 +1255,7 @@ static void sde_color_process_plane_setup(struct drm_plane *plane)
 				PLANE_PROP_DMA_GC);
 				PLANE_PROP_DMA_GC);
 		hw_cfg.last_feature = 0;
 		hw_cfg.last_feature = 0;
 		hw_cfg.ctl = ctl;
 		hw_cfg.ctl = ctl;
-		hw_cfg.len = sizeof(struct drm_msm_pgc_lut);
+		hw_cfg.len = size;
 		hw_cfg.payload = gc;
 		hw_cfg.payload = gc;
 		psde->pipe_hw->ops.setup_dma_gc(psde->pipe_hw, &hw_cfg,
 		psde->pipe_hw->ops.setup_dma_gc(psde->pipe_hw, &hw_cfg,
 				pstate->multirect_index);
 				pstate->multirect_index);