Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp331829pxm; Fri, 25 Feb 2022 08:50:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJwgZ9ZdNEvlvV6ozMhu/qQrxVkD/jvaHWp66bNp3m7zFmq6V4Od9UY+nrqo+jJ14ba1MDm/ X-Received: by 2002:a05:6402:281:b0:40a:ad5d:217c with SMTP id l1-20020a056402028100b0040aad5d217cmr8032748edv.385.1645807806850; Fri, 25 Feb 2022 08:50:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645807806; cv=none; d=google.com; s=arc-20160816; b=VN6jYm1jF6Y4qGvnB8GEnX3gtbCARMLVTh7zyUNCMXSjIV2zXfvGWKvbYZOgsWYb9W Ct+em/vvUhdX99PHiVcnnh3vtUYB2DgH2CBkMhFsnq/CGSHolYJeRKJ4iDryd5qT4m/x 7hikRs59SCFAfBkAhYvDKBYxSl9e1sVcwR2aSv15KH0vtxqmEE72Vc3dL8CkkXOVDuUV CnR7S5Axvm/l0PJ21pY7jVq7X5zrxJiLDYDAznBhRMq457xxGP5mSjtL/JERkWFqez5H CjLjCdFRYLLBEjqiNDBXjOxxl2yUcrQ9P2S+iYYzVRXWy5iVVlxWW0wbXKq/uIcABZRJ KoJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:user-agent:from:references:in-reply-to:mime-version :dkim-signature; bh=kysMFOh8+xcDGXHPPVRwQiPaslPV5k2XuSftAh0IGXM=; b=fFxorssgwXllES2vrRrZ2Qy+j89duJYuDXEnnMKnsrih2JuVbnXM1o9H9gSxTmagbw 43rPFI8S4n2PkVt1QTYajJdccHXY0zry5kkGx/5I/6yiN4YGZPLhJ1znJWPx/YPRplNv QEYdvKyuEIubbJ5gdapZP+zCQpNp8Q5d4ksU8HYmAZUCrmK1NKnbMRVPDmDkNHtKCtuL SX6nFqf2yGaAS5twdi1okiEDU84u8fgMZrHrhJ6yb4W+vAXLbbXwV02sbNCzEiL4KO7O Wjje7lnkDM01I93cJ6ZVH1WEybHTqhbqC+jhtn6V0CqUsyE9VgUYEaOn8q9mGgz1Rf9n OEkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=PfiEhsRz; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e2-20020a170906044200b006cf72045cdbsi1825166eja.82.2022.02.25.08.49.43; Fri, 25 Feb 2022 08:50:06 -0800 (PST) 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=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=PfiEhsRz; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239867AbiBYK4Q (ORCPT + 99 others); Fri, 25 Feb 2022 05:56:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239773AbiBYK4P (ORCPT ); Fri, 25 Feb 2022 05:56:15 -0500 Received: from mail-oo1-xc35.google.com (mail-oo1-xc35.google.com [IPv6:2607:f8b0:4864:20::c35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB4E71DAC57 for ; Fri, 25 Feb 2022 02:55:42 -0800 (PST) Received: by mail-oo1-xc35.google.com with SMTP id k13-20020a4a948d000000b003172f2f6bdfso5778356ooi.1 for ; Fri, 25 Feb 2022 02:55:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=mime-version:in-reply-to:references:from:user-agent:date:message-id :subject:to:cc:content-transfer-encoding; bh=kysMFOh8+xcDGXHPPVRwQiPaslPV5k2XuSftAh0IGXM=; b=PfiEhsRzmUlc1wRl7CP4cP59K9Lm7uNP+Beg+DIjXFCoCXFJ6hYi3zhDk33axm8PI7 OX61MA/O4DZS/HoW6kOxIWkvBiMuwlsca/oj02T1KYHGmh7HU8j8l2wGRgmnrZyMrQLS kXxVXXDFw3y+zQ+iN14/BLSQrgMsQfSFvHpmNWi95tMVAQyK7aoxcrrPGVyot4GcrsHL HqOYh5V6/opTiE2A3eCCw6smo2gMJjIk+78lXh+jd0q4r6SgMWNjwP3t9C0e2BnAVkbd NezHGnBxkQSrkIL3dcWMZI3u7OAGkRKDtJNnWZ8R9MWQw71qfg1N3irCviYM2WYS1oUs FWuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:in-reply-to:references:from :user-agent:date:message-id:subject:to:cc:content-transfer-encoding; bh=kysMFOh8+xcDGXHPPVRwQiPaslPV5k2XuSftAh0IGXM=; b=DqMnsyhT6K9XZNtU/KdHT4gaBCIALzd9QNhYuELjjiIIDNHNEMAGuJD7nJ1dGKfumI v2RA09HV6i6jY9yt+dlngSf/DFdxnhTK7jLguwD4Su7gNpFS6u/UPT033yI3/gEyz2dO ueefn4pQPqm/k3NQDalpbh1GKEkIaNvid2Q16Zf/s7xv69cq3XU6HxoWWDMMMzTXZwrU lMhhV2IAxOgka244dED/P5IwYSfAiVZFkexx9wcTGWoBx5+uCdllmiLgjZ1rn4EniNKE LKewioUzlK7lQrbRCLp7vLiLhh/GTCvHYoeYeQCKdWVLd/YEi29G1WXrf5T5HQtigF0k Nn9g== X-Gm-Message-State: AOAM532dBAWkUw3dxjrNUSGeIBeIhEZXC+PbWkiryXnH0PlfsvfYz4Lq pRorYOhSzLlDTSBERE0PZIV+TRw7Tw2PXnKHDX+Lzjag9T8= X-Received: by 2002:a4a:4112:0:b0:319:3eb2:11b with SMTP id x18-20020a4a4112000000b003193eb2011bmr2462193ooa.40.1645786542268; Fri, 25 Feb 2022 02:55:42 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Fri, 25 Feb 2022 02:55:41 -0800 MIME-Version: 1.0 In-Reply-To: References: <20220218145437.18563-1-granquet@baylibre.com> <20220218145437.18563-8-granquet@baylibre.com> From: Guillaume Ranquet User-Agent: alot/0.10 Date: Fri, 25 Feb 2022 02:55:41 -0800 Message-ID: Subject: Re: [PATCH v8 07/19] drm/mediatek: dpi: implement a swap_input toggle in board config To: Chun-Kuang Hu Cc: Philipp Zabel , David Airlie , Daniel Vetter , Rob Herring , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Matthias Brugger , Chunfeng Yun , Kishon Vijay Abraham I , Vinod Koul , deller@gmx.de, CK Hu , Jitao Shi , AngeloGioacchino Del Regno , DRI Development , "ARM/Mediatek SoC support" , DTML , linux-kernel , Linux ARM , linux-phy@lists.infradead.org, linux-fbdev@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,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 Quoting Chun-Kuang Hu (2022-02-21 03:32:32) > Hi, Guillaume: > > Guillaume Ranquet =E6=96=BC 2022=E5=B9=B42=E6=9C= =8818=E6=97=A5 =E9=80=B1=E4=BA=94 =E4=B8=8B=E5=8D=8810:56=E5=AF=AB=E9=81=93= =EF=BC=9A > > > > Adds a bit of flexibility to support boards without swap_input support > > > > Signed-off-by: Guillaume Ranquet > > --- > > drivers/gpu/drm/mediatek/mtk_dpi.c | 14 +++++++++++--- > > 1 file changed, 11 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/gpu/drm/mediatek/mtk_dpi.c b/drivers/gpu/drm/media= tek/mtk_dpi.c > > index 545a1337cc899..454f8563efae4 100644 > > --- a/drivers/gpu/drm/mediatek/mtk_dpi.c > > +++ b/drivers/gpu/drm/mediatek/mtk_dpi.c > > @@ -126,6 +126,7 @@ struct mtk_dpi_conf { > > const u32 *output_fmts; > > u32 num_output_fmts; > > bool is_ck_de_pol; > > + bool swap_input_support; > > const struct mtk_dpi_yc_limit *limit; > > }; > > > > @@ -378,18 +379,21 @@ static void mtk_dpi_config_color_format(struct mt= k_dpi *dpi, > > (format =3D=3D MTK_DPI_COLOR_FORMAT_YCBCR_444_FULL)) { > > mtk_dpi_config_yuv422_enable(dpi, false); > > mtk_dpi_config_csc_enable(dpi, true); > > - mtk_dpi_config_swap_input(dpi, false); > > + if (dpi->conf->swap_input_support) > > + mtk_dpi_config_swap_input(dpi, false); > > mtk_dpi_config_channel_swap(dpi, MTK_DPI_OUT_CHANNEL_SW= AP_BGR); > > } else if ((format =3D=3D MTK_DPI_COLOR_FORMAT_YCBCR_422) || > > (format =3D=3D MTK_DPI_COLOR_FORMAT_YCBCR_422_FULL))= { > > mtk_dpi_config_yuv422_enable(dpi, true); > > mtk_dpi_config_csc_enable(dpi, true); > > - mtk_dpi_config_swap_input(dpi, true); > > + if (dpi->conf->swap_input_support) > > + mtk_dpi_config_swap_input(dpi, true); > > In MT8173, MT2701, MT8183, MT8192, YCBCR_444 would not swap but > YCBCR_422 would swap. But In MT8195, both YCBCR_444 and YCBCR_422 > would not swap, So I think one of these format would be abnormal in > MT8195, right? Or would you provide more information about how this > swap work? > > Regards, > Chun-Kuang. > I'm not sure I have access to that level of information... and my knowledge on mediatek SoC is rather limited, I will circle back with mediatek engineers to have a definite answer. Thx, Guillaume > > mtk_dpi_config_channel_swap(dpi, MTK_DPI_OUT_CHANNEL_SW= AP_RGB); > > } else { > > mtk_dpi_config_yuv422_enable(dpi, false); > > mtk_dpi_config_csc_enable(dpi, false); > > - mtk_dpi_config_swap_input(dpi, false); > > + if (dpi->conf->swap_input_support) > > + mtk_dpi_config_swap_input(dpi, false); > > mtk_dpi_config_channel_swap(dpi, MTK_DPI_OUT_CHANNEL_SW= AP_RGB); > > } > > } > > @@ -808,6 +812,7 @@ static const struct mtk_dpi_conf mt8173_conf =3D { > > .output_fmts =3D mt8173_output_fmts, > > .num_output_fmts =3D ARRAY_SIZE(mt8173_output_fmts), > > .is_ck_de_pol =3D true, > > + .swap_input_support =3D true, > > .limit =3D &mtk_dpi_limit, > > }; > > > > @@ -819,6 +824,7 @@ static const struct mtk_dpi_conf mt2701_conf =3D { > > .output_fmts =3D mt8173_output_fmts, > > .num_output_fmts =3D ARRAY_SIZE(mt8173_output_fmts), > > .is_ck_de_pol =3D true, > > + .swap_input_support =3D true, > > .limit =3D &mtk_dpi_limit, > > }; > > > > @@ -829,6 +835,7 @@ static const struct mtk_dpi_conf mt8183_conf =3D { > > .output_fmts =3D mt8183_output_fmts, > > .num_output_fmts =3D ARRAY_SIZE(mt8183_output_fmts), > > .is_ck_de_pol =3D true, > > + .swap_input_support =3D true, > > .limit =3D &mtk_dpi_limit, > > }; > > > > @@ -839,6 +846,7 @@ static const struct mtk_dpi_conf mt8192_conf =3D { > > .output_fmts =3D mt8173_output_fmts, > > .num_output_fmts =3D ARRAY_SIZE(mt8173_output_fmts), > > .is_ck_de_pol =3D true, > > + .swap_input_support =3D true, > > .limit =3D &mtk_dpi_limit, > > }; > > > > -- > > 2.34.1 > >