From patchwork Mon Jun 12 09:01:56 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: 106392 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2468170vqr; Mon, 12 Jun 2023 02:53:12 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5wndmCk92RFISSsQu2g2uGJ/N6c2bPhLMEbM7Us9R/Zeeo67vl+bGN6WK+dWXzSAjV4qY8 X-Received: by 2002:a17:907:3f05:b0:977:d020:53d6 with SMTP id hq5-20020a1709073f0500b00977d02053d6mr7249739ejc.44.1686563592250; Mon, 12 Jun 2023 02:53:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686563592; cv=none; d=google.com; s=arc-20160816; b=p5a1RNadzmBS7khZRyPASTa8faUmUy1LofwAuai5q3iX2sxtlqZdE6vw1n/VA+NP3/ zCJ+3ht/3T5q7yzJfbAmnmcbhdV3r2ecDqB7zCneK9zJT5aG2+VkjY98C+ztR26HdXbm N+r9lGN3G+V6SW8ZvSq6rq3ja9C8TkEperhDLMsP1aH3pBiohyr+9L1jVMg0bNpkPm66 8VTcagUVaLv/4/mLGfe48ulfD9bXUfzEQ7PPyCJsKXjiEaQC7Nnmpz6kuHl0hq7rY4jt MHrjdOWRGHt40nJMYFP2BoBX1OVu+56ip2L9LLOpGxaeoKMdFsrXjot3Asap8KZgLCnj D90g== 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=; b=ghALlwtGuZlriwsTqBPLupVmL8dT9OPo9Ht8nHYDzBFCCkFNr5IGwYoe/B4RYieYHL gJzix52FBbaRAW9kD9VWBvBIujS6wU5vk+BQi8yNhw3L2vpVAvR3CP9bDRBDqklyyv9r Ylj8kubjTU/lgoujJNaXTZBzirAZ1eycBi5ZYP5n9jimQ9uqWfAd7QdMwDBKK8aUbvEj Cc/pyiaTWt1U4SoLYQ3kFqYTAnGqYWUas9fZEK/GEap/Kqw/atSuY0Mssz9iIxIGSdvt C+d7AGcVeuyVdVE38HWAJRSbDsXRAuxCdinrFRqXKqFvP0qO0witThKRwp4m3qDTFa4L XkxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=n2IiMBIx; 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 j20-20020a1709064b5400b0094f59407d46si1838446ejv.522.2023.06.12.02.52.47; Mon, 12 Jun 2023 02:53:12 -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=n2IiMBIx; 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 S229609AbjFLJGd (ORCPT + 99 others); Mon, 12 Jun 2023 05:06:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233630AbjFLJFi (ORCPT ); Mon, 12 Jun 2023 05:05:38 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30E8B49CB for ; Mon, 12 Jun 2023 02:02:13 -0700 (PDT) Received: from IcarusMOD.eternityproject.eu (unknown [IPv6:2001:b07:2ed:14ed:c5f8:7372:f042:90a2]) (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 3360F66056AA; Mon, 12 Jun 2023 10:02:11 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1686560531; bh=h6f7psRee+vgHmJfxJWJCr98AHCwupGoqyn4DcinahM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n2IiMBIxHLe63zm/clp9XFbDlNVwIDlgISj+BAW3ggFcAS700c9b+WwgifPTQVQJK 3dBAFBTf+8PBDoK8zAVCggsElh1qfxs/Z/fu5VtzY3cwplaW+OZxrmkSgalVpn4QSc 27dwhOrJTq8gschHWvEB9W/SD4GgahR3+ctvMF2wESmXGwm3SsHXGZVJzlZ4rX/Qeg LJYpJvbElaR0A2Pitk09q2kB4e5UJH03+W0H+Mi0E9MwkwgD5PpWCDuCC5hMdfxNWt Nqnl9TWBsFoU7DDLA7LhSTfpedPUAh/LRBvTv1KniW+7WrO6WSALUNsw9Lc5O4cbJR +LccmSfM94puA== 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, "Jason-JH . Lin" Subject: [PATCH v6 10/11] drm/mediatek: gamma: Make sure relay mode is disabled Date: Mon, 12 Jun 2023 11:01:56 +0200 Message-Id: <20230612090157.68205-11-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230612090157.68205-1-angelogioacchino.delregno@collabora.com> References: <20230612090157.68205-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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768490105329588382?= X-GMAIL-MSGID: =?utf-8?q?1768490105329588382?= 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 --- 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); }