From 51775dd093a3b376e3aa9bdfa6f508ac799c9e53 Mon Sep 17 00:00:00 2001 From: Veera Sundaram Sankaran Date: Fri, 19 Aug 2022 12:25:26 -0700 Subject: [PATCH] disp: msm: uapi: increase SDE_FRAME_DATA_MAX_PLANES size MDSS 9.0.0 supports 10 pipes, so modify the max_planes accordingly. This is used for the frame_data transfer between user/kernel and since its a new feature added there is no backward compatibility that needs to be handled for this uapi change. Add corresponding bound check during the usage. Change-Id: I0853fcc55395855d798f2c1b03cf9bf7b4bd3c96 Signed-off-by: Veera Sundaram Sankaran --- include/uapi/display/drm/sde_drm.h | 2 +- msm/sde/sde_crtc.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/uapi/display/drm/sde_drm.h b/include/uapi/display/drm/sde_drm.h index 8cb12843..5eee6bd8 100644 --- a/include/uapi/display/drm/sde_drm.h +++ b/include/uapi/display/drm/sde_drm.h @@ -580,7 +580,7 @@ struct sde_drm_ubwc_stats_data { */ #define SDE_FRAME_DATA_BUFFER_MAX 0x3 #define SDE_FRAME_DATA_GUARD_BYTES 0xFF -#define SDE_FRAME_DATA_MAX_PLANES 0x10 +#define SDE_FRAME_DATA_MAX_PLANES 0x14 /** * struct sde_drm_frame_data_buffers_ctrl - control frame data buffers diff --git a/msm/sde/sde_crtc.c b/msm/sde/sde_crtc.c index d476bd4b..b63dc387 100644 --- a/msm/sde/sde_crtc.c +++ b/msm/sde/sde_crtc.c @@ -2778,8 +2778,10 @@ void sde_crtc_get_frame_data(struct drm_crtc *crtc) data->frame_count = sde_crtc->fps_info.frame_count; /* Collect plane specific data */ - drm_for_each_plane_mask(plane, crtc->dev, sde_crtc->plane_mask_old) - sde_plane_get_frame_data(plane, &data->plane_frame_data[i++]); + drm_for_each_plane_mask(plane, crtc->dev, sde_crtc->plane_mask_old) { + if (i < SDE_FRAME_DATA_MAX_PLANES) + sde_plane_get_frame_data(plane, &data->plane_frame_data[i++]); + } if (frame_data->cnt) _sde_crtc_frame_data_notify(crtc, data);