瀏覽代碼

disp: msm: sde: fix indexing for frame data

This change adds a fix to correct indexing logic while
parsing frame data buffers and resets the count correctly.

Change-Id: Ic5a20ecd7093423ea293432c9492eb920acdd6f4
Signed-off-by: Nilaan Gunabalachandran <[email protected]>
Nilaan Gunabalachandran 4 年之前
父節點
當前提交
cd77cb672d
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      msm/sde/sde_crtc.c

+ 2 - 1
msm/sde/sde_crtc.c

@@ -2407,6 +2407,7 @@ exit:
 	while (sde_crtc->frame_data.cnt--)
 		_sde_crtc_put_frame_data_buffer(
 				sde_crtc->frame_data.buf[sde_crtc->frame_data.cnt]);
+	sde_crtc->frame_data.cnt = 0;
 }
 
 static void _sde_crtc_frame_data_notify(struct drm_crtc *crtc,
@@ -2448,7 +2449,7 @@ void sde_crtc_get_frame_data(struct drm_crtc *crtc)
 	if (frame_data->cnt) {
 		struct msm_gem_object *msm_gem;
 
-		msm_gem = to_msm_bo(frame_data->buf[frame_data->cnt]->gem);
+		msm_gem = to_msm_bo(frame_data->buf[frame_data->idx]->gem);
 		data = (struct sde_drm_frame_data_packet *)
 				(((u8 *)msm_gem->vaddr) + msm_gem->offset);
 	} else {