From patchwork Fri Mar 24 14:27:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liviu Dudau X-Patchwork-Id: 95955 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp76381obz; Fri, 24 Mar 2017 07:27:41 -0700 (PDT) X-Received: by 10.84.129.131 with SMTP id b3mr5790346plb.160.1490365660981; Fri, 24 Mar 2017 07:27:40 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l1si2172743pfg.366.2017.03.24.07.27.40; Fri, 24 Mar 2017 07:27:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965767AbdCXO1k (ORCPT + 18 others); Fri, 24 Mar 2017 10:27:40 -0400 Received: from fw-tnat.cambridge.arm.com ([217.140.96.140]:59375 "EHLO cam-smtp0.cambridge.arm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934911AbdCXO1b (ORCPT ); Fri, 24 Mar 2017 10:27:31 -0400 Received: from e110455-lin.cambridge.arm.com (e110455-lin.cambridge.arm.com [10.2.131.175]) by cam-smtp0.cambridge.arm.com (8.13.8/8.13.8) with ESMTP id v2OERKmv011042; Fri, 24 Mar 2017 14:27:20 GMT From: Liviu Dudau To: Brian Starkey Cc: Mali DP Maintainers , Daniel Vetter , DRI devel , LKML Subject: [PATCH] drm: mali-dp: Update the state of all planes before re-enabling active CRTCs. Date: Fri, 24 Mar 2017 14:27:20 +0000 Message-Id: <20170324142720.31950-1-Liviu.Dudau@arm.com> X-Mailer: git-send-email 2.12.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Mali DP needs to have all the planes that are becoming inactive in the new state disabled before re-enabling the active CRTC, otherwise we start streaming out data from old pointers in memory. Signed-off-by: Liviu Dudau Reviewed-by: Brian Starkey --- drivers/gpu/drm/arm/malidp_drv.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) -- 2.12.0 diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c index ea2546f766c2..f5cecdc3f14a 100644 --- a/drivers/gpu/drm/arm/malidp_drv.c +++ b/drivers/gpu/drm/arm/malidp_drv.c @@ -66,10 +66,12 @@ static void malidp_atomic_commit_hw_done(struct drm_atomic_state *state) struct drm_pending_vblank_event *event; struct drm_device *drm = state->dev; struct malidp_drm *malidp = drm->dev_private; - int ret = malidp_set_and_wait_config_valid(drm); - if (ret) - DRM_DEBUG_DRIVER("timed out waiting for updated configuration\n"); + if (malidp->crtc.enabled) { + /* only set config_valid if the CRTC is enabled */ + if (malidp_set_and_wait_config_valid(drm)) + DRM_DEBUG_DRIVER("timed out waiting for updated configuration\n"); + } event = malidp->crtc.state->event; if (event) { @@ -90,9 +92,11 @@ static void malidp_atomic_commit_tail(struct drm_atomic_state *state) struct drm_device *drm = state->dev; drm_atomic_helper_commit_modeset_disables(drm, state); - drm_atomic_helper_commit_modeset_enables(drm, state); + drm_atomic_helper_commit_planes(drm, state, 0); + drm_atomic_helper_commit_modeset_enables(drm, state); + malidp_atomic_commit_hw_done(state); drm_atomic_helper_wait_for_vblanks(drm, state);