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

Sean Paul seanpaul at chromium.org
Thu Jun 28 18:29:04 UTC 2018


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 at chromium.org>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

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;
 }
 
-- 
Sean Paul, Software Engineer, Google / Chromium OS



More information about the Freedreno mailing list