Received: by 10.192.165.148 with SMTP id m20csp3476210imm; Mon, 23 Apr 2018 07:13:41 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/koXbkHk+9vmTaVNglO+TBwWtfYBuZiocPlilUJI6M2/2vR6bSfrPZ3gNLJ51osRWcYn3C X-Received: by 2002:a17:902:b589:: with SMTP id a9-v6mr8641004pls.351.1524492821441; Mon, 23 Apr 2018 07:13:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524492821; cv=none; d=google.com; s=arc-20160816; b=yWaPYDT6r/OHJimD58dB4ZmKmQyqGP7YL2DyXxjaj94M7lhCIvVREYv/yNMkoCivHI UNgW4BDXDnqbR27RPERP+jCh49tm+bl9k8H0yyf0JEuPp+B99S6jZL5hH8dNh4qvLwO9 bynuM6u8M/fA6Dkw+Ih559saheU0Z4Z3wC5KfmCnHSYh7bG6MIydoAKE0ZbmGW8UzYWC VWNkTH+NoumKt8ajGPxao+sB94cxk0phon5BhGwGxeTMfMWiUpFuYEL+sDj2UvS5RKeM BlZZN4ruyBRUNbTCW4csJRBaNe9Z0OSebJsJpc7PyOzNyWT/jqYZHkj3EH7EkVfj5hbA 96Pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=9iofIXPkcf4r3oWrwij5th4i90P+dQMmOvEk/u1PABA=; b=jF6uaRmGyJEjy+M66fMTlnap1Q6m95OyJSWstAUWY6ZDku3jyqpnA49XCEcNN1sd58 kl9OcML760AxEv/LiV+4py+Naxv/2HTzkdixbDfM3XiaHB+JybgiZctTacMvGiUV3OGv rWNUgYSspJt/a6lFt0d1t/BevQp5faEnQdlXB/MNUMwooWwABxwwrrEB/tpji5zKrosQ XKRspmynifrKDKq4bRnfh4Ukof/bzqyHNggcz68zNSzpGu/2J4W0SzOLNOFlRsmUDNgs qvtMxTLRGOXU84ayBLmZ+m+cQIZAUreew8I4Uw70Ae5o30+z1VHnzhguJBfLAgT5p8OE 36PQ== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n13si10903214pfg.227.2018.04.23.07.13.26; Mon, 23 Apr 2018 07:13:41 -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 S1755611AbeDWOL1 (ORCPT + 99 others); Mon, 23 Apr 2018 10:11:27 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:2775 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755494AbeDWOLR (ORCPT ); Mon, 23 Apr 2018 10:11:17 -0400 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w3NE442m004543; Mon, 23 Apr 2018 16:11:04 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2hfte8uc3b-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 23 Apr 2018 16:11:04 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 7E49831; Mon, 23 Apr 2018 14:11:03 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas22.st.com [10.75.90.92]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 692862C41; Mon, 23 Apr 2018 14:11:03 +0000 (GMT) Received: from SAFEX1HUBCAS24.st.com (10.75.90.95) by Safex1hubcas22.st.com (10.75.90.92) with Microsoft SMTP Server (TLS) id 14.3.361.1; Mon, 23 Apr 2018 16:11:03 +0200 Received: from localhost (10.201.23.32) by webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.361.1; Mon, 23 Apr 2018 16:11:02 +0200 From: Philippe Cornu To: Thierry Reding , David Airlie , , CC: Andrzej Hajda , Yannick Fertre , Philippe Cornu , "Benjamin Gaignard" , Vincent Abriou , Alexandre Torgue Subject: [PATCH 2/4] drm/panel: otm8009a: fix glitches by moving backlight enable to otm8009a_enable() Date: Mon, 23 Apr 2018 16:10:51 +0200 Message-ID: <20180423141054.13128-3-philippe.cornu@st.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180423141054.13128-1-philippe.cornu@st.com> References: <20180423141054.13128-1-philippe.cornu@st.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.201.23.32] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-04-23_05:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The backlight 1st update was in the otm8009a_prepare() function for a bad reason: backlight was not working in video mode and the otm8009a_prepare() is in command mode for the init sequence. As the backlight is now fixed (no lpm), it is good to put it back in the otm8009a_enable() function, avoiding also image glitches visible on some "slow" devices. Signed-off-by: Philippe Cornu --- drivers/gpu/drm/panel/panel-orisetech-otm8009a.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c b/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c index 0fd2e0144d2b..de4a16d5275c 100644 --- a/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c +++ b/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c @@ -330,13 +330,6 @@ static int otm8009a_prepare(struct drm_panel *panel) ctx->prepared = true; - /* - * Power on the backlight. Note: end-user still controls brightness - * Note: ctx->prepared must be true before updating the backlight. - */ - ctx->bl_dev->props.power = FB_BLANK_UNBLANK; - backlight_update_status(ctx->bl_dev); - return 0; } @@ -344,6 +337,16 @@ static int otm8009a_enable(struct drm_panel *panel) { struct otm8009a *ctx = panel_to_otm8009a(panel); + if (ctx->enabled) + return 0; + + /* + * Power on the backlight. Note: end-user still controls brightness + * Note: ctx->prepared must be true before updating the backlight. + */ + ctx->bl_dev->props.power = FB_BLANK_UNBLANK; + backlight_update_status(ctx->bl_dev); + ctx->enabled = true; return 0; -- 2.15.1