From patchwork Tue Aug 1 11:58:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 129277 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp2644071vqg; Tue, 1 Aug 2023 05:50:29 -0700 (PDT) X-Google-Smtp-Source: APBJJlEpnTXPfDalOBY/4o/mO1dswrC2U26+M8c49a6T3uQmEJrgX8VrulpWdCqkP64zMmx8HRT2 X-Received: by 2002:a17:906:328b:b0:974:1e0e:91ee with SMTP id 11-20020a170906328b00b009741e0e91eemr2182477ejw.13.1690894229518; Tue, 01 Aug 2023 05:50:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690894229; cv=none; d=google.com; s=arc-20160816; b=W3JhL+56YT7ysgG/hjr8RR8qAxr3MkLH3/Xsr3H7Zecf7+UukEFMwtOXIVB9AX3BRd l4s0YA0L/W7ff85CvNem2Au3xEtLA1K+oWPL4htFqRK4X2RqxixeQHKrUMnZ0CWdUxBp OHXfKKCqrOi14FBLWwRoKFXW/9m27gtM30Ja4i6vqyw10GtILsGRedg8sNi8Rg2FdwPv WAHhoQ1DDq3XR4DaeR+8R6zPN7eJubzjvLsA7uXYfz8yxdqyN1BeO5vAArkj1N/yOE2b YFMo+lYFt1AgrR4q5wceHYsbCBPbWnqCGDmHOrvgPBqrAuaHvjVRJkRUclJ5A2gG3RP+ 3AxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Nv+89oQd7Z0HRw8NKZs6XNq2l8fWoiDIINb3yOL5GFA=; fh=wVZEQimxp/UyE4Mf0Sn+nsZcfrBLHvkvU7kacOC/59o=; b=tUV4FeBeC674Qumm/eg1EBQuefhVJTUxzaG9SVUanTWmRro/BPk98wOklgPcSwTBO2 NC9L8zByMvZGLPa1zjCMKLgYlyMR8jXDueU3ocuNyJGnEb7GQB9OqgX70Vdz0PnPTDyn IofOlS03JFiNSYHXjseZFy/jidVBbcNDJHycfVQrtGlO9Rr7lOjTsMemOgzAnKarufzj X94+fjfk3sQyHS/SQSFXX9y5KKRDkW6lZ/MqLuAFcWgKubIGCTlid2A3DtEFJMa5YByX iLJSk9QwmGWD2qyNl3Zi0vD5xwgKNpYtOhObJCLXmHMDHpi8W2IRetbSLMozPy39FpXF +1Lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=l8L3xSkh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dk20-20020a170906f0d400b00997c7157a03si8659369ejb.642.2023.08.01.05.50.06; Tue, 01 Aug 2023 05:50:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=l8L3xSkh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234453AbjHAL7f (ORCPT + 99 others); Tue, 1 Aug 2023 07:59:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234154AbjHAL7P (ORCPT ); Tue, 1 Aug 2023 07:59:15 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C78019AD for ; Tue, 1 Aug 2023 04:59:11 -0700 (PDT) Received: from IcarusMOD.eternityproject.eu (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 30348660719D; Tue, 1 Aug 2023 12:59:09 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1690891149; bh=bIIKYPpYUW37n4evWOm2DHgCvgnXkZJWa85NMhhI5KA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l8L3xSkhM43WY2zCAVf4lrFLzu0YDc4g8Rvuvsws+5WWL2Dsg6KEitCIF42I7IAu7 hHepBpPfvYvfGjcEJSju1h1pMBubK4y7+isthEAX9vQvSFRE3QKekb43FZj+n2YV90 IYd8Uo3r672x0TTsf6rr2xxSmCz3kHCLewi/JKxgdOqq4BBijppuht0VodxK/p4i08 gAm4Wn/2yrAYuCJYZyY+0cLN1DHiO9Q0JM4n2LUrStTNEzEDfOv99lZj4Vj9inuAFn SYBwIbk0SKuhFQKWm+d8Ga8usVC6838e5cpqlxfIRetgJxTdQVWduylSi4o/wgC5wL tsJBAEPJzgppw== From: AngeloGioacchino Del Regno To: chunkuang.hu@kernel.org Cc: p.zabel@pengutronix.de, airlied@gmail.com, daniel@ffwll.ch, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, wenst@chromium.org, kernel@collabora.com, ehristev@collabora.com, "Jason-JH . Lin" , Alexandre Mergnat Subject: [PATCH v8 10/13] drm/mediatek: gamma: Make sure relay mode is disabled Date: Tue, 1 Aug 2023 13:58:51 +0200 Message-ID: <20230801115854.150346-11-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230801115854.150346-1-angelogioacchino.delregno@collabora.com> References: <20230801115854.150346-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773031107545473914 X-GMAIL-MSGID: 1773031107545473914 Disable relay mode at the end of LUT programming to make sure that the processed image goes through. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Jason-JH.Lin Reviewed-by: Alexandre Mergnat --- drivers/gpu/drm/mediatek/mtk_disp_gamma.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/mediatek/mtk_disp_gamma.c b/drivers/gpu/drm/mediatek/mtk_disp_gamma.c index 12614cc26bf8..6591797ed10c 100644 --- a/drivers/gpu/drm/mediatek/mtk_disp_gamma.c +++ b/drivers/gpu/drm/mediatek/mtk_disp_gamma.c @@ -19,6 +19,7 @@ #define DISP_GAMMA_EN 0x0000 #define GAMMA_EN BIT(0) #define DISP_GAMMA_CFG 0x0020 +#define GAMMA_RELAY_MODE BIT(0) #define GAMMA_LUT_EN BIT(1) #define GAMMA_DITHERING BIT(2) #define DISP_GAMMA_SIZE 0x0030 @@ -192,6 +193,9 @@ void mtk_gamma_set_common(struct device *dev, void __iomem *regs, /* Enable the gamma table */ cfg_val |= FIELD_PREP(GAMMA_LUT_EN, 1); + /* Disable RELAY mode to pass the processed image */ + cfg_val &= ~GAMMA_RELAY_MODE; + writel(cfg_val, regs + DISP_GAMMA_CFG); }