From patchwork Fri Jul 28 10:47:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Archit Taneja X-Patchwork-Id: 9868445 X-Patchwork-Delegate: agross@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AFCC56035E for ; Fri, 28 Jul 2017 10:47:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AD3AE288C5 for ; Fri, 28 Jul 2017 10:47:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A202D288D4; Fri, 28 Jul 2017 10:47:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4B28E288C5 for ; Fri, 28 Jul 2017 10:47:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751740AbdG1Krx (ORCPT ); Fri, 28 Jul 2017 06:47:53 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:47134 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751726AbdG1Krx (ORCPT ); Fri, 28 Jul 2017 06:47:53 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id BA6FC60A52; Fri, 28 Jul 2017 10:47:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1501238872; bh=a8QwZ5AJdB0US8RroRyd2blfNr24SV8+MuZoAfZHoCI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=natjeNiTpjHB1Fywwc+DrFgzOvieRtr/fGVtw9GbjpQIZ1T7qO0EhhIuHm5wW4x8w zhnc6o1arByBHesqNo2sXhOB7MAHVe+dwksgh8iB5hTf8llMvB26TjLLZU4GGx1ugb Lwum5oN2kHtMn34aLWvb9mlEZ7rK0qnJ0ka1vN7U= Received: from localhost (blr-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.18.19]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: architt@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 9D0A660A39; Fri, 28 Jul 2017 10:47:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1501238870; bh=a8QwZ5AJdB0US8RroRyd2blfNr24SV8+MuZoAfZHoCI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nu4T2ljYLNX9NfrE1W/54/w+Y3IHzeBfzUHqap9qOEEbxnJyP8KSCQ4ONGzoR13bg S/qCKSLZ52v6gm6L8w5sw8asYTiqgFnm9dIAeskF4FCNzboDK4znh99FMoUCv2PydR J49zfs6k4V/JYz7brbVaCFoOEZlu2MkgxtwLbhSk= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 9D0A660A39 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=architt@codeaurora.org From: Archit Taneja To: robdclark@gmail.com Cc: dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, Archit Taneja Subject: [PATCH 07/10] drm/msm/mdp5: Don't use mode_set helper funcs for encoders and CRTCs Date: Fri, 28 Jul 2017 16:17:05 +0530 Message-Id: <20170728104708.20635-8-architt@codeaurora.org> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170728104708.20635-1-architt@codeaurora.org> References: <20170728104708.20635-1-architt@codeaurora.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We shouldn't use use mode_set/mode_set_nofb helpers when we use runtime PM. The registers configured in these funcs lose their state when we eventually enable the display pipeline. Do not implement these vfuncs in the helpers, and call them in the crtc_enable/encoder_enable paths instead. Signed-off-by: Archit Taneja --- drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c | 4 +++- drivers/gpu/drm/msm/mdp/mdp5/mdp5_encoder.c | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c index fb78425db52c..0de6e3436ac8 100644 --- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c +++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c @@ -443,6 +443,9 @@ static void mdp5_crtc_enable(struct drm_crtc *crtc) return; pm_runtime_get_sync(dev); + + mdp5_crtc_mode_set_nofb(crtc); + mdp_irq_register(&mdp5_kms->base, &mdp5_crtc->err); if (mdp5_cstate->cmd_mode) @@ -951,7 +954,6 @@ static const struct drm_crtc_funcs mdp5_crtc_no_lm_cursor_funcs = { }; static const struct drm_crtc_helper_funcs mdp5_crtc_helper_funcs = { - .mode_set_nofb = mdp5_crtc_mode_set_nofb, .disable = mdp5_crtc_disable, .enable = mdp5_crtc_enable, .atomic_check = mdp5_crtc_atomic_check, diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_encoder.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_encoder.c index 0ca9e4033bb6..5b851380d3f2 100644 --- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_encoder.c +++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_encoder.c @@ -297,6 +297,10 @@ static void mdp5_encoder_enable(struct drm_encoder *encoder) { struct mdp5_encoder *mdp5_encoder = to_mdp5_encoder(encoder); struct mdp5_interface *intf = mdp5_encoder->intf; + /* this isn't right I think */ + struct drm_crtc_state *cstate = encoder->crtc->state; + + mdp5_encoder_mode_set(encoder, &cstate->mode, &cstate->adjusted_mode); if (intf->mode == MDP5_INTF_DSI_MODE_COMMAND) mdp5_cmd_encoder_enable(encoder); @@ -320,7 +324,6 @@ static int mdp5_encoder_atomic_check(struct drm_encoder *encoder, } static const struct drm_encoder_helper_funcs mdp5_encoder_helper_funcs = { - .mode_set = mdp5_encoder_mode_set, .disable = mdp5_encoder_disable, .enable = mdp5_encoder_enable, .atomic_check = mdp5_encoder_atomic_check,