Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 65f36491 authored by Jayaprakash's avatar Jayaprakash
Browse files

disp: msm: sde: add NULL check for hw_cdm block during WB session



Add null check for hw_cdm block because it can be accessed
in WB session in commit context when input format is YUV.

Timeline of the issue:
   --> C1 commit WB check_only + modeset, RM allocated resources
   --> C2 commit WB check_only + modeset, RM has failed commit
       because curr and nxt rsvps are already allocated.
       RM has released nxt rsvps here which should not be done.
   --> C3 commit WB check_only + modeset with change in topology from
       C1 commit, RM allocated resources. hw_blks->rsvp_nxt is filled
       with reservations allocated by C3 commit.
   --> C1 commit scheduled and RM committed reservations allocated
       by C3 which caused null dereference of hw_cdm block.

Change-Id: I723e139b55d72228b763ee5e3892f7a7513dd093
Signed-off-by: default avatarJayaprakash <jmadiset@codeaurora.org>
parent 313dae2c
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -548,6 +548,13 @@ static void sde_encoder_phys_wb_setup_cdp(struct sde_encoder_phys *phys_enc,
		intf_cfg_v1->wb_count = num_wb;
		intf_cfg_v1->wb[0] = hw_wb->idx;
		if (SDE_FORMAT_IS_YUV(format)) {
			if (!phys_enc->hw_cdm) {
				SDE_ERROR("Format:YUV but no cdm allocated\n");
				SDE_EVT32(DRMID(phys_enc->parent),
							 SDE_EVTLOG_ERROR);
				return;
			}

			intf_cfg_v1->cdm_count = num_wb;
			intf_cfg_v1->cdm[0] = hw_cdm->idx;
		}