Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4839682ybl; Tue, 4 Feb 2020 03:00:01 -0800 (PST) X-Google-Smtp-Source: APXvYqzv0W7IZXQ0GhQe2dA2+mvpWLLgJ9JJKTNfjxr724nHMo5Hd2jsbl4WY2iK2c9j3OEKuRU+ X-Received: by 2002:aca:f44a:: with SMTP id s71mr3025971oih.7.1580814001751; Tue, 04 Feb 2020 03:00:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580814001; cv=none; d=google.com; s=arc-20160816; b=gcvi0vEWJJeY9aSVeO5epmiwP8lI9Id+fvLSEVL1ybANtO1NjHKJMn/WXJUss8Jjoa 85RPAsRXdh1vk9kzTVtcqkzAhJubqo3DpijwlV/Uefa4sOeuxM6bYQHnxtpVQmVJvZMM ni++S410pHJYXHRqxNVIAJFqmQhrZQC30u6w5j9OLuE94o6dyEal0teIUB5r0yC4nF7M +1XpieCueG6G835U6UlX7C6LhyhjYO9w82ThHKcFmV8Gu5Ue4Q+Pus0xFSWEO1ejthSR B8SPVqpNG3SHm+P+M1GhbFeeIIB1yWulCOUBAb4a7Ql0PwfiUkBzVWYkObdE9fifxxqn oPQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=/oUsrvLxDIg2kRTkRIDa+3f0CNVdXlRSCLiuyEtYa9c=; b=kLx/RZTujjaD5QoLBYzEuklDOObclLXVtGlc9zhFmvRaQlEMsdJnSO2xrvyXXU+et1 XABB/+8FpfWhKHQC5YnZXR0Phs7/4lYa1JM9/0S4UH8P8lAXgxBcn8046oxsGE5rfgFp lIfGn4xE/UAwT1sDzdbchN8jwPIR6684thXqc0J0FQRPZm+AWyh0k97wZOLIIGjECRE9 jgDnKd+xakBP8F6bDMur4NneLIVAslqTwZA7xsOGkK1wmQJW5UnKhbRQHtQ1tDydGMXf pnE8i2tXV7lm1k6o50vDghMj6x/sFGfVpnHFtuTj35t6Ucd/TtDpQDGwcCtia588Qrro F0cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QBN3hZRq; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b18si4588581otp.17.2020.02.04.02.59.50; Tue, 04 Feb 2020 03:00:01 -0800 (PST) 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; dkim=pass header.i=@linaro.org header.s=google header.b=QBN3hZRq; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727072AbgBDK46 (ORCPT + 99 others); Tue, 4 Feb 2020 05:56:58 -0500 Received: from mail-qv1-f68.google.com ([209.85.219.68]:33410 "EHLO mail-qv1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726631AbgBDK46 (ORCPT ); Tue, 4 Feb 2020 05:56:58 -0500 Received: by mail-qv1-f68.google.com with SMTP id z3so8342758qvn.0 for ; Tue, 04 Feb 2020 02:56:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=/oUsrvLxDIg2kRTkRIDa+3f0CNVdXlRSCLiuyEtYa9c=; b=QBN3hZRqRJfvXM7KsldzN/Y7UB9nRf6fT56y9YAkEYDPA55hGUnbTbep8I6bfTbsdW m9Pwoqx4QhXDeO4XtwYSVmDPrWsWQOAo19+2PH+U9Ib5ANtLC8DwrcskFIYSaLHRm45h wLNqkjMwYOrCgjqSaai4YcdjOhwatJxCFjhvu8E89Kxo754pXUvKWDfKHhQxIbcwKFzj h/dQt17+28/5KKynnLEiKf8IZ/OdCSCJJKD1FhhadNOwhLKCLtBsQjUOMyr5LS94Be9/ jR+tIGVKEm8A36MijR7kSUYjISnBxK4tA4/iPgmJoWnNId1zmePgSeO4W49pCkgbszTL EAtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=/oUsrvLxDIg2kRTkRIDa+3f0CNVdXlRSCLiuyEtYa9c=; b=QDddND6p4lvPj3+fTr4i2Sm7/ei3teiqBEvmMSMu4Kk4LCo9LQ7pANXFGbcwXQ7o52 pNeaxCP5AnT153Sh0pLyJvBiDsPkNHT6uvG12LTtLyIA/e+wJC9lUoYmaS9jgPkJvpcR L5L1uTaDaMUr69Uj7WLRgm82LHR95uZ753d7pvCINRXNAyZMklKdsqmbQOumkGR/bRzr cbCjp+4QarVPaYo6oMG0ZI1uWKX+bXSlMiHgkdf0Sa89FTP6qz4a6hbBDYde18N33krj lx2697PRbaxdZi5VH2Uu0HTBSpI+lWf6KyHSXz2bKtTfCsBqBDxYX6oyaKrCaG0Uqx5E OHRA== X-Gm-Message-State: APjAAAWD1onhSKoqF1izULNa7xfKjMScMA/wc5scr8zRob3a+ro6IdzI /5PFOoCFWXLUzufgoTKV1FzBB5VeE+UYDqarMFonaA== X-Received: by 2002:a0c:ead1:: with SMTP id y17mr25795609qvp.210.1580813815924; Tue, 04 Feb 2020 02:56:55 -0800 (PST) MIME-Version: 1.0 References: <1579528013-28445-1-git-send-email-yannick.fertre@st.com> <69cced11-c30a-da6c-0465-79b632901b62@st.com> In-Reply-To: <69cced11-c30a-da6c-0465-79b632901b62@st.com> From: Benjamin Gaignard Date: Tue, 4 Feb 2020 11:56:45 +0100 Message-ID: Subject: Re: [PATCH] drm/stm: ltdc: enable/disable depends on encoder To: Philippe CORNU Cc: Yannick FERTRE , Benjamin GAIGNARD , David Airlie , Daniel Vetter , Maxime Coquelin , Alexandre TORGUE , "dri-devel@lists.freedesktop.org" , "linux-stm32@st-md-mailman.stormreply.com" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le jeu. 23 janv. 2020 =C3=A0 10:47, Philippe CORNU = a =C3=A9crit : > > Dear Yannick, > Thank you for your patch, > > Acked-by: Philippe Cornu > > Philippe :-) > > On 1/20/20 2:46 PM, Yannick Fertre wrote: > > From: Yannick Fertr=C3=A9 > > > > When connected to a dsi host, the ltdc display controller > > must send frames only after the end of the dsi panel > > initialization to avoid errors when the dsi host sends > > commands to the dsi panel (dsi px fifo full). > > To avoid this issue, the display controller must be > > enabled/disabled when the encoder is enabled/disabled. > > Applied on drm-misc-next. Thanks Benjamin > > Signed-off-by: Yannick Fertr=C3=A9 > > --- > > drivers/gpu/drm/stm/ltdc.c | 14 ++++++++------ > > 1 file changed, 8 insertions(+), 6 deletions(-) > > > > diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c > > index 719dfc5..9ef125d 100644 > > --- a/drivers/gpu/drm/stm/ltdc.c > > +++ b/drivers/gpu/drm/stm/ltdc.c > > @@ -437,9 +437,6 @@ static void ltdc_crtc_atomic_enable(struct drm_crtc= *crtc, > > /* Commit shadow registers =3D update planes at next vblank */ > > reg_set(ldev->regs, LTDC_SRCR, SRCR_VBR); > > > > - /* Enable LTDC */ > > - reg_set(ldev->regs, LTDC_GCR, GCR_LTDCEN); > > - > > drm_crtc_vblank_on(crtc); > > } > > > > @@ -453,9 +450,6 @@ static void ltdc_crtc_atomic_disable(struct drm_crt= c *crtc, > > > > drm_crtc_vblank_off(crtc); > > > > - /* disable LTDC */ > > - reg_clear(ldev->regs, LTDC_GCR, GCR_LTDCEN); > > - > > /* disable IRQ */ > > reg_clear(ldev->regs, LTDC_IER, IER_RRIE | IER_FUIE | IER_TERRIE)= ; > > > > @@ -1058,9 +1052,13 @@ static const struct drm_encoder_funcs ltdc_encod= er_funcs =3D { > > static void ltdc_encoder_disable(struct drm_encoder *encoder) > > { > > struct drm_device *ddev =3D encoder->dev; > > + struct ltdc_device *ldev =3D ddev->dev_private; > > > > DRM_DEBUG_DRIVER("\n"); > > > > + /* Disable LTDC */ > > + reg_clear(ldev->regs, LTDC_GCR, GCR_LTDCEN); > > + > > /* Set to sleep state the pinctrl whatever type of encoder */ > > pinctrl_pm_select_sleep_state(ddev->dev); > > } > > @@ -1068,6 +1066,7 @@ static void ltdc_encoder_disable(struct drm_encod= er *encoder) > > static void ltdc_encoder_enable(struct drm_encoder *encoder) > > { > > struct drm_device *ddev =3D encoder->dev; > > + struct ltdc_device *ldev =3D ddev->dev_private; > > > > DRM_DEBUG_DRIVER("\n"); > > > > @@ -1078,6 +1077,9 @@ static void ltdc_encoder_enable(struct drm_encode= r *encoder) > > */ > > if (encoder->encoder_type =3D=3D DRM_MODE_ENCODER_DPI) > > pinctrl_pm_select_default_state(ddev->dev); > > + > > + /* Enable LTDC */ > > + reg_set(ldev->regs, LTDC_GCR, GCR_LTDCEN); > > } > > > > static const struct drm_encoder_helper_funcs ltdc_encoder_helper_func= s =3D { > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel