Message ID | 20230804072850.89365-13-angelogioacchino.delregno@collabora.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:44a:b0:3f2:4152:657d with SMTP id ez10csp97068vqb; Fri, 4 Aug 2023 00:54:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFBeDxBzkueMEKJxxrPyuqs4ok5+MWRzyiBvws13boYBXJS/L87WdtltS+ABF9Yz0Q4hqku X-Received: by 2002:a17:90a:a792:b0:268:1f0a:9f12 with SMTP id f18-20020a17090aa79200b002681f0a9f12mr1014309pjq.29.1691135652946; Fri, 04 Aug 2023 00:54:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691135652; cv=none; d=google.com; s=arc-20160816; b=0dZpcQeCyoJvHrBfEW3nErrjYCqMtlEqju1wNEuJxiqZXTKHYGE6piJQW8CVJ2dc7m hUL1UHkefy8Cqm9A16EFbCsM+9LSL+RgGaHETkJGPeIwm/eeO7ho79y1Luu+aOC2KDvq /2gIx3GPyj5wTnKktw3W07Qi//2FdxixeFWrFjKqm517Ero1ENOMhio5pVCRaAtliC8L raYsYjrH1JfTgPHBJ2w/pD3/7FY/IT9FA1mP8WYGxfc35go6SdQyN6mnom9aPF4eiZNj tlKcV9QaeT38YuTV5z/Lag44kxdBr4j1XjFWjK1H/ZK5Vc71sWaPGWnYSGeDm8OoC1rt kq1A== 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=obwngE3wNtQILTpmWXSVVqRGgxdeMgYi2Erw2ZajQS0=; fh=wVZEQimxp/UyE4Mf0Sn+nsZcfrBLHvkvU7kacOC/59o=; b=HFcjL5w6GTb1I03G+FOS7wO3WnXoHDU6MYTWv6AAZpP2LuVyPUmO5DNsIZTisqYU0T OTBfIPWOHlUs6g+2w9uzWPk+jHqAnTOopgDuWxQXas7qKM1O527Oyc3YrAREIYXR9pzJ cWRmlU+46dSKDt9sJAXR8q+7WaJZlkXmRT9Yc0HxbUipsO31iiRMl5PPb64F5zh9rWec YVwfqCicfhIvX+O+VJLYT74T+IBJ28PXJKzpPvS5sqS2/eEQUygqwJEFk5QQ/R7sgF8E +mX0n6Thbm4c1J0Q1fJRWjKU+6CPB9FlohG5lJ8yYoj5KUF5EIHr16y+RWe5iy/f3CKl UAkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=hvxcP51+; 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 t21-20020a17090aae1500b00268296ca620si4737909pjq.78.2023.08.04.00.53.59; Fri, 04 Aug 2023 00:54: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=hvxcP51+; 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 S234264AbjHDH3u (ORCPT <rfc822;sukrut.bellary@gmail.com> + 99 others); Fri, 4 Aug 2023 03:29:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234179AbjHDH3J (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 4 Aug 2023 03:29:09 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8B763AAF for <linux-kernel@vger.kernel.org>; Fri, 4 Aug 2023 00:29:08 -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 E5E2266071C7; Fri, 4 Aug 2023 08:29:06 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1691134147; bh=zIuIzaHEwa0qol/Hd+tCNwDoAKXf8h/2l/cB7d8v3GQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hvxcP51+E6KU48mDz3WemTuKtEFWyRMb80buz/pC49Ri3BrIzOfmeZBg9NCOPUDVg mbe0juxsBbgGptTm6BwGka6pFrJIKdMfkM/VJiIE4dyr6CjJ7um6GszMM6MjTw/cp7 KtIfPGzAI14DkZAhymaz1dz1wDQ+pXs6DWy5LWs6zD8MUPddHxPIhmAQsUe6MIXjzG ZMfvcUYoha5yaKHdgCqpym9zYw72tCJKAtA7oVGXfbBPFrFTvWrh4Qq/Kugx3xsh3i uQMzKuWqhZsxBD4e7ZueJbozbqNOf1BIXe3BU8E5+jmrPFW99YNvTJL1XEtKHct3N1 4n+K0vPRrGLRA== From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> 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" <jason-jh.lin@mediatek.com>, Alexandre Mergnat <amergnat@baylibre.com> Subject: [PATCH v10 12/16] drm/mediatek: gamma: Make sure relay mode is disabled Date: Fri, 4 Aug 2023 09:28:46 +0200 Message-ID: <20230804072850.89365-13-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230804072850.89365-1-angelogioacchino.delregno@collabora.com> References: <20230804072850.89365-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773284258693236179 X-GMAIL-MSGID: 1773284258693236179 |
Series |
MediaTek DDP GAMMA - 12-bit LUT support
|
|
Commit Message
AngeloGioacchino Del Regno
Aug. 4, 2023, 7:28 a.m. UTC
Disable relay mode at the end of LUT programming to make sure that the processed image goes through in both DISP_GAMMA and DISP_AAL for gamma setting. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Reviewed-by: Jason-JH.Lin <jason-jh.lin@mediatek.com> Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com> --- drivers/gpu/drm/mediatek/mtk_disp_aal.c | 3 +++ drivers/gpu/drm/mediatek/mtk_disp_gamma.c | 4 ++++ 2 files changed, 7 insertions(+)
Comments
Hi, Angelo: On Fri, 2023-08-04 at 09:28 +0200, AngeloGioacchino Del Regno wrote: > Disable relay mode at the end of LUT programming to make sure that > the > processed image goes through in both DISP_GAMMA and DISP_AAL for > gamma > setting. > > Signed-off-by: AngeloGioacchino Del Regno < > angelogioacchino.delregno@collabora.com> > Reviewed-by: Jason-JH.Lin <jason-jh.lin@mediatek.com> > Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com> > --- > drivers/gpu/drm/mediatek/mtk_disp_aal.c | 3 +++ > drivers/gpu/drm/mediatek/mtk_disp_gamma.c | 4 ++++ > 2 files changed, 7 insertions(+) > > diff --git a/drivers/gpu/drm/mediatek/mtk_disp_aal.c > b/drivers/gpu/drm/mediatek/mtk_disp_aal.c > index 21b25470e9b7..992dc1424c91 100644 > --- a/drivers/gpu/drm/mediatek/mtk_disp_aal.c > +++ b/drivers/gpu/drm/mediatek/mtk_disp_aal.c > @@ -122,6 +122,9 @@ void mtk_aal_gamma_set(struct device *dev, struct > drm_crtc_state *state) > writel(word, (aal->regs + DISP_AAL_GAMMA_LUT) + (i * > 4)); > } > > + /* Disable RELAY mode to pass the processed image */ > + cfg_val &= ~AAL_RELAY_MODE; It seems that the relay mode is default turned off. But explicitly setting it is good to me. After adding AAL_RELAY_MODE definition in this patch, Reviewed-by: CK Hu <ck.hu@mediatek.com> > + > writel(cfg_val, aal->regs + DISP_AAL_CFG); > } > > diff --git a/drivers/gpu/drm/mediatek/mtk_disp_gamma.c > b/drivers/gpu/drm/mediatek/mtk_disp_gamma.c > index 7d2f8042ace0..fbff9f97b737 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 > @@ -177,6 +178,9 @@ void mtk_gamma_set(struct device *dev, struct > drm_crtc_state *state) > /* 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, gamma->regs + DISP_GAMMA_CFG); > } >
diff --git a/drivers/gpu/drm/mediatek/mtk_disp_aal.c b/drivers/gpu/drm/mediatek/mtk_disp_aal.c index 21b25470e9b7..992dc1424c91 100644 --- a/drivers/gpu/drm/mediatek/mtk_disp_aal.c +++ b/drivers/gpu/drm/mediatek/mtk_disp_aal.c @@ -122,6 +122,9 @@ void mtk_aal_gamma_set(struct device *dev, struct drm_crtc_state *state) writel(word, (aal->regs + DISP_AAL_GAMMA_LUT) + (i * 4)); } + /* Disable RELAY mode to pass the processed image */ + cfg_val &= ~AAL_RELAY_MODE; + writel(cfg_val, aal->regs + DISP_AAL_CFG); } diff --git a/drivers/gpu/drm/mediatek/mtk_disp_gamma.c b/drivers/gpu/drm/mediatek/mtk_disp_gamma.c index 7d2f8042ace0..fbff9f97b737 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 @@ -177,6 +178,9 @@ void mtk_gamma_set(struct device *dev, struct drm_crtc_state *state) /* 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, gamma->regs + DISP_GAMMA_CFG); }