Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1375813pxb; Sun, 21 Feb 2021 23:23:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJyETW/7HHx80KWx8SJzTenJpD9tC3F3nrnpUgpWWVFvUceuqW0xICDaYyH/WoV2yiZ9tb2j X-Received: by 2002:a05:6402:26c9:: with SMTP id x9mr21216421edd.365.1613978612490; Sun, 21 Feb 2021 23:23:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613978612; cv=none; d=google.com; s=arc-20160816; b=1LFhxurGy0UhS5PIKUX4QNi2s9Z3TS1yfDr0/q0pOXfdqkMg8yEMpzExcinQqPWgej qoBhOFsmk9xaS5x95DwpYDExdnCJkTg1QcS/UuUYh/muRfwM0+0BIycV7nhzkeYRKiOv v0QAvq3ojYTfWHLeyt/CVNg9+LOPlFFw7CskgHHR82J4s6Nx5pRHeZUQNkXE+8jrrvlr SJKktlmwHVngc85siAJUrlqsY1tR7TQabBnt2ZwBtYGRqtYiuDrw94Fy5M1Ce100El8D g20N+ZshsVmjyhx/9kHofPYk7bW/RBGvcGxXYKb6AkD31TWRkHpvA7rYoGTwwvfGLkwo mitA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:cms-type:content-transfer-encoding :in-reply-to:from:cc:to:content-language:subject:user-agent :mime-version:date:message-id:dkim-signature:dkim-filter; bh=UCnuqo5cfQ3YOcugfUkVi67fSmaj+kDkthEj6wfxsV8=; b=p6beOXAF5YCffwev8sjo+2BCn1xqKjsfOmJtFUttE9HmK0tM9Fj7/few9pv/trF1yU n5auXZ3yWayUMLlIqBWbE13UuAMmZTcQxpGf+1EJktzvMx12eG5+GaTHqose6BS9Wpqu QohgzwZuDUsi4vPr6C85OzZ2ykk3p4xW7p+LmhkKuAuUOJugMnUtsdQL34a2jBmUVtqn 1ImnNSQYiWPlxsV066vSwAkYFCuSfJtX/gOwG3aUCsNvg7zRLD2LTZGUnQZEGM/n29w5 3+i67uteh6k+a2REnrt1qFR5U2SH2xalDbKVSHi2YeVGvhFXUVdKsmXIQG6I2hnbPZLv 624w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=CmCfAQza; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w25si5930084eju.256.2021.02.21.23.23.09; Sun, 21 Feb 2021 23:23:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=CmCfAQza; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229947AbhBVHVr (ORCPT + 99 others); Mon, 22 Feb 2021 02:21:47 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:46585 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229999AbhBVHVn (ORCPT ); Mon, 22 Feb 2021 02:21:43 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20210222072048euoutp0198b37e72210fedd93b923ebe291630ad~mANkSQcLb0227302273euoutp01b for ; Mon, 22 Feb 2021 07:20:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20210222072048euoutp0198b37e72210fedd93b923ebe291630ad~mANkSQcLb0227302273euoutp01b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1613978448; bh=UCnuqo5cfQ3YOcugfUkVi67fSmaj+kDkthEj6wfxsV8=; h=Date:Subject:To:Cc:From:In-Reply-To:References:From; b=CmCfAQza2TIPZuhlh39qH+TjBdsF4A0RJ8u+A8G4S24QJgX5tyGvp4cnka9zhbXnj 8Jm+7w+/b5FKg0dRnbTRTp1FcqgZa2rJbPbzclJGgxV9Il5nClBdordcTOm/ke5zWh G2CZMwYUoWKqUOoq09LM6GxcJQpvbkVeUtQAGOV4= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20210222072041eucas1p2765b176e43a6439dd3d4ab44acf9ad28~mANdTZfKU0888108881eucas1p2r; Mon, 22 Feb 2021 07:20:41 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id E7.35.27958.94B53306; Mon, 22 Feb 2021 07:20:41 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20210222072040eucas1p1bb0bb4ba140d3b7029bfd89ab9efef6b~mANcwemau2085520855eucas1p1i; Mon, 22 Feb 2021 07:20:40 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20210222072040eusmtrp29717831c4563ea6283c69cd29b952dea~mANcui1783111331113eusmtrp2V; Mon, 22 Feb 2021 07:20:40 +0000 (GMT) X-AuditID: cbfec7f2-f15ff70000006d36-8c-60335b497436 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 72.26.21957.84B53306; Mon, 22 Feb 2021 07:20:40 +0000 (GMT) Received: from [106.210.131.79] (unknown [106.210.131.79]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20210222072034eusmtip229bcae4bc753ef8210a398cd916a1959~mANXD9CkH1005310053eusmtip2V; Mon, 22 Feb 2021 07:20:34 +0000 (GMT) Message-ID: Date: Mon, 22 Feb 2021 08:20:33 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:86.0) Gecko/20100101 Thunderbird/86.0 Subject: Re: [PATCH] drm/dsi: Add _NO_ to MIPI_DSI_* flags disabling features Content-Language: en-GB To: Nicolas Boichat , Laurent Pinchart Cc: Neil Armstrong , David Airlie , Viresh Kumar , dri-devel , Thierry Reding , Sam Ravnborg , Emil Velikov , linux-samsung-soc@vger.kernel.org, Joonyoung Shim , Krzysztof Kozlowski , Chun-Kuang Hu , Jonas Karlman , linux-arm-msm@vger.kernel.org, "moderated list:ARM/Mediatek SoC support" , Rikard Falkeborn , Matthias Brugger , Sean Paul , Xin Ji , linux-arm Mailing List , Jernej Skrabec , Rajendra Nayak , Thomas Zimmermann , Seung-Woo Kim , lkml , Robert Foss , Kyungmin Park , freedreno@lists.freedesktop.org From: Andrzej Hajda In-Reply-To: Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA02Se0xTVxzHOffe3pZuhUvBcIIzBrLhI1t9YPDErSBxhuseipvZMshCq960 RKimhenMCARwg44ijwWkBZwLZV1FV8tjtI7iwK3U8ZRCYFpxzk1k5TFaRBzKWloz/vv8Ht/f 7/c9ORycbyEjOGmyTEYuE6dHkVyi9ZfFvtf2pcSIttoruEjVZ8PQNyoVgezzMyS6aNcR6E/l FIlqHvQCNLzwEEc25zCBJu4MEqi/38BGvXlONioqq2cj4x8jLFTW0ctGQ+YaEg3lDwJ0rt+C obyCGNRZkoL+siWgBnsTC82pf8eRbrEFIEfFdU9TxUMSLZrrCNTsLGOhK/M0qnM8xnevo2vb zTg9M3qGTWtyBwl6qESF0W2OekCb1A5PrrCaRRv1RSTdXXoTo2+P/EjSPzy6y6LHv7RidFN9 Dm01/8am6yuHSbqkWQ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9sF2bcv Hy/Uer52+54Nvm3vWuO+T6vRtqj58ZlViaU4I9FQi7moOBEA0rROW+QDAAA= X-CMS-MailID: 20210222072040eucas1p1bb0bb4ba140d3b7029bfd89ab9efef6b X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20210222053139eucas1p2661f94e218ae4c553e031ffa2e7b0cb3 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20210222053139eucas1p2661f94e218ae4c553e031ffa2e7b0cb3 References: <20210211113309.1.I629b2366a6591410359c7fcf6d385b474b705ca2@changeid> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Nicolas, W dniu 22.02.2021 o 06:31, Nicolas Boichat pisze: > On Mon, Feb 22, 2021 at 3:08 AM Laurent Pinchart > wrote: >> Hi Nicolas, >> >> Thank you for the patch. >> >> On Thu, Feb 11, 2021 at 11:33:55AM +0800, Nicolas Boichat wrote: >>> Many of the DSI flags have names opposite to their actual effects, >>> e.g. MIPI_DSI_MODE_EOT_PACKET means that EoT packets will actually >>> be disabled. Fix this by including _NO_ in the flag names, e.g. >>> MIPI_DSI_MODE_NO_EOT_PACKET. >>> >>> Signed-off-by: Nicolas Boichat >> This looks good to me, it increases readability. >> >> Reviewed-by: Laurent Pinchart >> >> Please however see the end of the mail for a comment. Reviewed-by: Andrzej Hajda And comment at the end. >> >>> --- >>> I considered adding _DISABLE_ instead, but that'd make the >>> flag names a big too long. >>> >>> Generated with: >>> flag=MIPI_DSI_MODE_VIDEO_HFP; git grep $flag | cut -f1 -d':' | \ >>> xargs -I{} sed -i -e "s/$flag/MIPI_DSI_MODE_VIDEO_NO_HFP/" {} >>> flag=MIPI_DSI_MODE_VIDEO_HBP; git grep $flag | cut -f1 -d':' | \ >>> xargs -I{} sed -i -e "s/$flag/MIPI_DSI_MODE_VIDEO_NO_HBP/" {} >>> flag=MIPI_DSI_MODE_VIDEO_HSA; git grep $flag | cut -f1 -d':' | \ >>> xargs -I{} sed -i -e "s/$flag/MIPI_DSI_MODE_VIDEO_NO_HSA/" {} >>> flag=MIPI_DSI_MODE_EOT_PACKET; git grep $flag | cut -f1 -d':' | \ >>> xargs -I{} sed -i -e "s/$flag/MIPI_DSI_MODE_NO_EOT_PACKET/" {} >>> (then minor format changes) >> Ever tried coccinelle ? :-) > Fun project for next time ,-) > >>> drivers/gpu/drm/bridge/adv7511/adv7533.c | 2 +- >>> drivers/gpu/drm/bridge/analogix/anx7625.c | 2 +- >>> drivers/gpu/drm/bridge/cdns-dsi.c | 4 ++-- >>> drivers/gpu/drm/bridge/tc358768.c | 2 +- >>> drivers/gpu/drm/exynos/exynos_drm_dsi.c | 8 ++++---- >>> drivers/gpu/drm/mcde/mcde_dsi.c | 2 +- >>> drivers/gpu/drm/mediatek/mtk_dsi.c | 2 +- >>> drivers/gpu/drm/msm/dsi/dsi_host.c | 8 ++++---- >>> drivers/gpu/drm/panel/panel-asus-z00t-tm5p5-n35596.c | 2 +- >>> drivers/gpu/drm/panel/panel-dsi-cm.c | 2 +- >>> drivers/gpu/drm/panel/panel-elida-kd35t133.c | 2 +- >>> drivers/gpu/drm/panel/panel-khadas-ts050.c | 2 +- >>> drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c | 2 +- >>> drivers/gpu/drm/panel/panel-leadtek-ltk500hd1829.c | 2 +- >>> drivers/gpu/drm/panel/panel-novatek-nt35510.c | 2 +- >>> drivers/gpu/drm/panel/panel-osd-osd101t2587-53ts.c | 2 +- >>> drivers/gpu/drm/panel/panel-samsung-s6d16d0.c | 2 +- >>> drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c | 2 +- >>> drivers/gpu/drm/panel/panel-samsung-s6e63m0-dsi.c | 2 +- >>> drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c | 4 ++-- >>> drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c | 2 +- >>> drivers/gpu/drm/panel/panel-simple.c | 2 +- >>> drivers/gpu/drm/panel/panel-sony-acx424akp.c | 2 +- >>> drivers/gpu/drm/panel/panel-xinpeng-xpp055c272.c | 2 +- >>> include/drm/drm_mipi_dsi.h | 8 ++++---- >>> 25 files changed, 36 insertions(+), 36 deletions(-) >>> >>> [] >>> diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h >>> index 360e6377e84b..ba91cf22af51 100644 >>> --- a/include/drm/drm_mipi_dsi.h >>> +++ b/include/drm/drm_mipi_dsi.h >>> @@ -119,15 +119,15 @@ struct mipi_dsi_host *of_find_mipi_dsi_host_by_node(struct device_node *node); >>> /* enable hsync-end packets in vsync-pulse and v-porch area */ >>> #define MIPI_DSI_MODE_VIDEO_HSE BIT(4) >> We're mixing bits that enable a feature and bits that disable a feature. >> Are these bits defined in the DSI spec, or internal to DRM ? In the >> latter case, would it make sense to standardize on one "polarity" ? That >> would be a more intrusive change in drivers though. > Yes, that'd require auditing every single code path and reverse the > logic as needed. I'm not volunteering for that ,-P (hopefully the > current change is still an improvement). > > Hopefully real DSI experts can comment (Andrzej?), I think the default > are sensible settings? Hehe, "real DSI expert" :), ok I've read spec few times :) If I remember correctly the spec did not prioritizes these modes, specs are publicly available if somebody want to check it feel free. These values were taken from defaults for Exynos DSI, as nobody at the time has better idea. We could try to optimize it by looking for example in different dsi hosts defaults, or maybe dsi devices, but I am not sure if it is worth time. This solution is good for me. Regards Andrzej > > >>> /* disable hfront-porch area */ >>> -#define MIPI_DSI_MODE_VIDEO_HFP BIT(5) >>> +#define MIPI_DSI_MODE_VIDEO_NO_HFP BIT(5) >>> /* disable hback-porch area */ >>> -#define MIPI_DSI_MODE_VIDEO_HBP BIT(6) >>> +#define MIPI_DSI_MODE_VIDEO_NO_HBP BIT(6) >>> /* disable hsync-active area */ >>> -#define MIPI_DSI_MODE_VIDEO_HSA BIT(7) >>> +#define MIPI_DSI_MODE_VIDEO_NO_HSA BIT(7) >>> /* flush display FIFO on vsync pulse */ >>> #define MIPI_DSI_MODE_VSYNC_FLUSH BIT(8) >>> /* disable EoT packets in HS mode */ >>> -#define MIPI_DSI_MODE_EOT_PACKET BIT(9) >>> +#define MIPI_DSI_MODE_NO_EOT_PACKET BIT(9) >>> /* device supports non-continuous clock behavior (DSI spec 5.6.1) */ >>> #define MIPI_DSI_CLOCK_NON_CONTINUOUS BIT(10) >>> /* transmit data in low power */ >> -- >> Regards, >> >> Laurent Pinchart > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://protect2.fireeye.com/v1/url?k=e6f0d6d2-b96befef-e6f15d9d-0cc47a31309a-f4be6a0935319c2d&q=1&e=5e175166-1972-4f28-a483-e9a65c07e25f&u=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Fdri-devel >