From patchwork Thu Jul 27 09:46:32 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: 126893 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a985:0:b0:3e4:2afc:c1 with SMTP id t5csp1004761vqo; Thu, 27 Jul 2023 03:43:13 -0700 (PDT) X-Google-Smtp-Source: APBJJlG+41uRIeeYZGi0O1onSTXtLNgL9qvMpnSwMXwwOuxfZkopgsecbnODM7sAp5ebxHtmNLG1 X-Received: by 2002:a05:6a21:3d8b:b0:135:2b01:3739 with SMTP id bj11-20020a056a213d8b00b001352b013739mr4189440pzc.56.1690454593168; Thu, 27 Jul 2023 03:43:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690454593; cv=none; d=google.com; s=arc-20160816; b=vy1P++PJPCt7p4mpl8C1bZ72dSJ06eSLn+ALlcQetle7t68B4kPnhLhJxeC9aIG42Y B8Vzrjdwq/OZsrPIf0rf9wrUW2H6RSqHUdsFFxRMK8JA7/qFVx2LBV6kWLNwB2hktipG Zir+EtCN/T1jSGlgw/PrFRmEeMO18COYhL0xIVkSHHJMBrHTgCOdbYLzr9HHEY4vDl9W aHG+SH0u7zxn9hNZc2gT9hv8mwik3amE8ifEh1LiNSiQ/f4GoYf3CFhFBWej01VCrV6W 3szYBZ07iNcyJFYPecHcuADHaeaZOzz40tJBaON3weaXvs5g04CMDtbHTW+rx0HMXDJO uBxA== 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=GUl62F0yXmRhO/8nxFkuhQdVGSkdKVrP24aIAVxWSpg=; fh=djell8ixvcyqU/mJ6veJqcbgRwD4nTeRiXMTlgu2sHI=; b=A388EmLrL+08pqTOgMMOlHK9qiC8h0j2P8MZdwXh+dAsyBa2uC+Cvv6dbeDY4/kBpe 425QcJBkEk680DNPf31M3A7qcpswuQ2hx2URz4YI9zl00QFxl8D15J6UUDsND41VgqSg b9FWBOt5OnOKXF62Tq1uaIudTXvaIbN66cwrUbWU3oPohy6F/B4A25hbWgmIhPfqCYSq nY0TcFxud8fZyuui1eIo6gppPIHdccgolsMW5bYuSgks/jTPhUoi/H93BjjDn/mcuXej lbIEjhKZXBR0QxUvXRnq0IOtpHrxSG1QJANufLxx0T4kJE1aAtpfc2iL59St+6p8Or5K 6AUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=BvKeA0w2; 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 kj12-20020a17090306cc00b001bbacfdad2fsi1043932plb.291.2023.07.27.03.43.00; Thu, 27 Jul 2023 03:43:13 -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=BvKeA0w2; 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 S234079AbjG0Jrc (ORCPT + 99 others); Thu, 27 Jul 2023 05:47:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233064AbjG0Jqy (ORCPT ); Thu, 27 Jul 2023 05:46:54 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2875FE for ; Thu, 27 Jul 2023 02:46:48 -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 B12B6660716B; Thu, 27 Jul 2023 10:46:46 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1690451207; bh=h6f7psRee+vgHmJfxJWJCr98AHCwupGoqyn4DcinahM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BvKeA0w2LcQvp7rzcZH1qY5qVCXAbNiN6rLLKiEh1pgOYiG18AE/8hJyMaNPLuk2C gY6Yc4PbG3ZYwU3NAqaDTW/LYWjN1DeRTh0i/KS+UiWkZbwJvW+WAmzgout94J0pi7 OXpW9Sn1Jkb2y6G4GIOPaP+P81jQvGlc55aLgBapPc+1NCDKTHmAtIw8SbJUsvObXL pjANphnRTdVQd9E9QaydaRMJS/uR0U1fM/yKCnSXo3iPy+HhwANIuUUdcfSSxilV1j hj2PbBTnOXj1O1BbrMhdfbEuWm6Q/4oRvbRkJKT2MnBnce9qS0xP3y0/TOL3pvQafa eXOVY5dxZbRFA== 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" Subject: [PATCH RESEND v6 10/11] drm/mediatek: gamma: Make sure relay mode is disabled Date: Thu, 27 Jul 2023 11:46:32 +0200 Message-ID: <20230727094633.22505-11-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230727094633.22505-1-angelogioacchino.delregno@collabora.com> References: <20230727094633.22505-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,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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: 1772570115582236970 X-GMAIL-MSGID: 1772570115582236970 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 e0e2d2bdbf59..e9655b661364 100644 --- a/drivers/gpu/drm/mediatek/mtk_disp_gamma.c +++ b/drivers/gpu/drm/mediatek/mtk_disp_gamma.c @@ -20,6 +20,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 @@ -180,6 +181,9 @@ void mtk_gamma_set_common(struct device *dev, void __iomem *regs, struct drm_crt /* 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); }