Ver código fonte

disp: msm: sde: add check for max encoder limit during allocation

This change checks max limit while allocating encoders
during display init.

Change-Id: I48736667c2b83f916f09f9e81cb1b24a9fef215a
Signed-off-by: Yashwanth <[email protected]>
Yashwanth 5 anos atrás
pai
commit
5792eb97d1
1 arquivos alterados com 3 adições e 1 exclusões
  1. 3 1
      msm/sde/sde_kms.c

+ 3 - 1
msm/sde/sde_kms.c

@@ -1489,7 +1489,9 @@ static int _sde_kms_setup_displays(struct drm_device *dev,
 
 		/* update display cap to MST_MODE for DP MST encoders */
 		info.capabilities |= MSM_DISPLAY_CAP_MST_MODE;
-		for (idx = 0; idx < sde_kms->dp_stream_count; idx++) {
+
+		for (idx = 0; idx < sde_kms->dp_stream_count &&
+				priv->num_encoders < max_encoders; idx++) {
 			info.h_tile_instance[0] = idx;
 			encoder = sde_encoder_init(dev, &info);
 			if (IS_ERR_OR_NULL(encoder)) {