diff mbox

[DPU,13/15] drm/msm: Reduce dpu_crtc_atomic_check frame size

Message ID 20180628182906.84926-14-seanpaul@chromium.org (mailing list archive)
State Not Applicable, archived
Delegated to: Andy Gross
Headers show

Commit Message

Sean Paul June 28, 2018, 6:29 p.m. UTC
Allocate pstates from the heap to avoid the following warning when
building with an arm target.

warning: the frame size of 1080 bytes is larger than 1024 bytes [-Wframe-larger-than=]

Signed-off-by: Sean Paul <seanpaul@chromium.org>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
index c70b609aa7f2..d17128222f45 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
@@ -1737,7 +1737,7 @@  static int dpu_crtc_atomic_check(struct drm_crtc *crtc,
 		struct drm_crtc_state *state)
 {
 	struct dpu_crtc *dpu_crtc;
-	struct plane_state pstates[DPU_STAGE_MAX * 4];
+	struct plane_state *pstates;
 	struct dpu_crtc_state *cstate;
 
 	const struct drm_plane_state *pstate;
@@ -1757,6 +1757,8 @@  static int dpu_crtc_atomic_check(struct drm_crtc *crtc,
 		return -EINVAL;
 	}
 
+	pstates = kzalloc(sizeof(*pstates) * DPU_STAGE_MAX * 4, GFP_KERNEL);
+
 	dpu_crtc = to_dpu_crtc(crtc);
 	cstate = to_dpu_crtc_state(state);
 
@@ -1792,7 +1794,7 @@  static int dpu_crtc_atomic_check(struct drm_crtc *crtc,
 					dpu_crtc->name, plane->base.id, rc);
 			goto end;
 		}
-		if (cnt >= ARRAY_SIZE(pstates))
+		if (cnt >= DPU_STAGE_MAX * 4)
 			continue;
 
 		pstates[cnt].dpu_pstate = to_dpu_plane_state(pstate);
@@ -1959,6 +1961,7 @@  static int dpu_crtc_atomic_check(struct drm_crtc *crtc,
 
 end:
 	_dpu_crtc_rp_free_unused(&cstate->rp);
+	kfree(pstates);
 	return rc;
 }