Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1328961pxb; Sun, 21 Feb 2021 21:33:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJwVEDkuTTVhkcQD/hNJZs2TPUPT3Yj7MWPD83ZLe7hi60So1AJAw58vFlQ6IpfvSkYU2mpD X-Received: by 2002:a17:906:4142:: with SMTP id l2mr3160664ejk.444.1613972033007; Sun, 21 Feb 2021 21:33:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613972033; cv=none; d=google.com; s=arc-20160816; b=BNQkmeY9u2naCAR25v6qP7QjL0fKYGc9I6Iehzqf7X5XCEfFhoF+Juk2Lczttf4f+F eSpqDIFytQwjB/4sEldD8rdLi/3PgUeWzHIn/c8RlHRNpPaQJxPOlR1TSz5c+rZUqdPm 97WaSSmMDyu4aBLN0w52C5Hq80ZytzuNKR3guEdpvv+kIlmIN2EsGuJFsGICkVQRXzw2 I157smRG4x9lF2NAtBWA2IxQddqIYp+QERbXd36W80/ffOnwDslSMM2614S9HguvZSBi JWBdGciafMo1Qarm9AM/MsOfGc0YT68BkSV+s8XU8TuBUyUDQZeEwACCtSxK6Vk8VWtT T6kQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Gu/fKr3GRAQ+ErLkQJBUlVQcwe14YTdgKKhXg0Cv4l4=; b=LEbMrBuc2Can97sJi9c6FVl0F2DZapveHX4da+U7u23hghyV1ajc4divGOpRyLQ2Lx x00isfteoKHim82V/2EKV5G3RUGt3MyJaP4xzlqPexqINb6DGe9+Fh23njDTI1Htq6pB tj4T3KSVOlZGGc1qPntefVmwtroKCux99s3++umopogkO45SO6lsph5u1TZQiUi74Htt Pyy35n3bivTi5ozRk0bt+zj8rRwilkCtZiccdsJ4SSuVoxFP/tH0OdszEPem/VbyQQiu OEe3RJIsDc0XCpSIoqm8AnEPOCoY1beXOCu0GDToi5OxSfIkSuIDdSYI9phZ5iNaghCj UO0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=nKDy+b2+; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y13si11957106edd.436.2021.02.21.21.33.30; Sun, 21 Feb 2021 21:33:52 -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=@chromium.org header.s=google header.b=nKDy+b2+; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229967AbhBVFcR (ORCPT + 99 others); Mon, 22 Feb 2021 00:32:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229966AbhBVFcK (ORCPT ); Mon, 22 Feb 2021 00:32:10 -0500 Received: from mail-ua1-x92d.google.com (mail-ua1-x92d.google.com [IPv6:2607:f8b0:4864:20::92d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 897E8C061574 for ; Sun, 21 Feb 2021 21:31:29 -0800 (PST) Received: by mail-ua1-x92d.google.com with SMTP id i3so3944380uai.3 for ; Sun, 21 Feb 2021 21:31:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Gu/fKr3GRAQ+ErLkQJBUlVQcwe14YTdgKKhXg0Cv4l4=; b=nKDy+b2+V7fS2f7mnoG/Ss5+uvRYBQnercKoIeTycpfWKJxx6kOPPx2ZeMe5ucP5Iv 50sS1bwNYdUpsm04AudIWrPnD+CNDRIBtKgv/9JUPjkbQlh1RAybhdP7pPk7uV3lZTxy I4/U2OZz5f4aafI7BWCv88whwJWIfvn83D3IM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Gu/fKr3GRAQ+ErLkQJBUlVQcwe14YTdgKKhXg0Cv4l4=; b=odgWhdfRvIycZV/csUr8rcylfOk2nHy+YC52Gg8FxPw/zyQMvkCzhAXp2jyHcO0HGz 1q0JfhDkYl0eO+oi2bkeohkVvQ1hQDRctyvqorZ5daTtS8joC9QxdmsdiYX8p3sioMqk tBL6fZ4nTFqFMVVcX1/ytwOwitWaaJfgeLVCEnMQpC+YMB9kxids1ZxfSJG5pXQNWy8Z d6oiQc+t/xrXMfmriz6I0ZmRJIGS1HG2npb6qE0iR/btUUe36rRp4ZQZ6OKDmZ6Bvr5y Wvl9XGjT46qyla0QoZsAXk+IGGbWmFqDbAey6bBxxahrd2Hcp9vKDfEz1x5D/dc9Qdyr VDUQ== X-Gm-Message-State: AOAM5323zTNT6nOqaEPNyVx6pVoM6tpoxWaCyjv/WcYrHuNWTycTe8+j N1K2ovwH6r6JS49M5tXS4o2JXt/eyRGMpF4twKe5zQ== X-Received: by 2002:ab0:1052:: with SMTP id g18mr3262401uab.74.1613971888653; Sun, 21 Feb 2021 21:31:28 -0800 (PST) MIME-Version: 1.0 References: <20210211113309.1.I629b2366a6591410359c7fcf6d385b474b705ca2@changeid> In-Reply-To: From: Nicolas Boichat Date: Mon, 22 Feb 2021 13:31:17 +0800 Message-ID: Subject: Re: [PATCH] drm/dsi: Add _NO_ to MIPI_DSI_* flags disabling features To: Laurent Pinchart Cc: Andrzej Hajda , Robert Foss , Chun-Kuang Hu , Daniel Vetter , David Airlie , Emil Velikov , Inki Dae , Jernej Skrabec , Jonas Karlman , Joonyoung Shim , Jordan Crouse , Krzysztof Kozlowski , Kyungmin Park , Linus Walleij , Maarten Lankhorst , Matthias Brugger , Maxime Ripard , Neil Armstrong , Philipp Zabel , Rajendra Nayak , Rikard Falkeborn , Rob Clark , Sam Ravnborg , Sean Paul , Seung-Woo Kim , Thierry Reding , Thomas Zimmermann , Viresh Kumar , Xin Ji , dri-devel , freedreno@lists.freedesktop.org, linux-arm Mailing List , linux-arm-msm@vger.kernel.org, lkml , "moderated list:ARM/Mediatek SoC support" , linux-samsung-soc@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > > > --- > > 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? > > > /* 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