Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1048563pxb; Thu, 4 Mar 2021 01:43:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJzSU/9XvYjZ6rwpbaeaRl/GdsRv4Y0ezaytGsUjju/fEaerB1TtOfbaDfwVA/a2X0VMI8yH X-Received: by 2002:a17:906:63c2:: with SMTP id u2mr3233562ejk.346.1614850998331; Thu, 04 Mar 2021 01:43:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614850998; cv=none; d=google.com; s=arc-20160816; b=JPuovjuieq3T48I9sViyyRoxaYrVtKVRR1qwMmjjeOK4fRNdGxBejX+RXzSZ/hAK5O 1asB4wv6/mO+7l2UkMtdMEmMXtIty5U/xJyQUMFCGecmL1JCS8IzAAQLqZ0p4VVQiJav QOfNOe16V8MY4dTd2hY75l0kxl+LDzhPEJa0EqxGrcNis9D8Oiye9ZX6T5HZbZAqwz66 9czG4JUiURQOEmuRWvAVn8+ppXYOMQacVm1aP/WLoaI4MfWgNdouYn6LO78PSGqqkece QO0MHTOn5m59dT2gX/igCHPioLg+IBbQf2UKDNkDHSTTCV4dsxvHHobIat0NQrGlGhN0 LQNg== 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=ud8XCo4zETwyBcC5uBZYedvwqDLvaKNv5XeUnTbkcFs=; b=ZE2yaUdrZFT4X6Cw7LIEp+r+/RJRnRYHQ1rAjc8/XnlJ69ecRCOMuiKl17+4P2wKkx GSxNk+npixqCCITYCESCJV4B3wtFEPjTQM4w8SnbSgbur9EYBoAD5v5jGzeFqqTetEWB TXipdvo7Z9Vq9HKwiw7o//ZqookyFg199Q/0qKS2zhtQQu37BjwT+zQa/lf49CZz/6Qx AtTJk+8pW2TB9dUEPjsoT2L7KglVQRGrz35GIubxJRhtg+exGnQ8QzHyQ51P0rBPYuJc vvUYQde5XA+8EN5KX7qzPR1oLJ5McNZTWNmrQzZ+wwZ150MjgdNOO/648yDVxTF5K51v cJuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=MUXW0BLc; 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 j23si16360199eje.581.2021.03.04.01.42.53; Thu, 04 Mar 2021 01:43:18 -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=MUXW0BLc; 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 S1448221AbhCCPYe (ORCPT + 99 others); Wed, 3 Mar 2021 10:24:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240952AbhCCKcI (ORCPT ); Wed, 3 Mar 2021 05:32:08 -0500 Received: from mail-vs1-xe2b.google.com (mail-vs1-xe2b.google.com [IPv6:2607:f8b0:4864:20::e2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88847C061756 for ; Wed, 3 Mar 2021 02:31:16 -0800 (PST) Received: by mail-vs1-xe2b.google.com with SMTP id p123so12286588vsp.6 for ; Wed, 03 Mar 2021 02:31:16 -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=ud8XCo4zETwyBcC5uBZYedvwqDLvaKNv5XeUnTbkcFs=; b=MUXW0BLcopSj2WEivWF6kbF45NTv7iE6q4bdW0n64jAOThRVEwx0mwL70/W8QAcW22 kbp43yMWDe8/wr6M408sE0OwjffCirBG9ZLdfmUcFX2sgeaA6c0HU/locnDgty4g8tBY P1x3TV2Q9JYZyg4RAnN+KCw0Zda/CC2Tbyeok= 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=ud8XCo4zETwyBcC5uBZYedvwqDLvaKNv5XeUnTbkcFs=; b=IoE8zgWOkT0I8ii34v4mcjj28PNi/cS68RhzMqPrHQVU5uXkCWMrmNLmM/KoF+dYEb 1BGOqZ/5FUrga3ENBXLCRbzP64vmm91NyMyZa/rOB9blOrh1kQyqExnUo1RH9tDFU2tM ibKHjDOM62uNOOUOKev4cj20O/EmhkXJ/4zoEa3xs6vIY30gvu25pZg7qoqLJAdn4pn1 U45Z2qovlCxkSC9X1qIoc+IH52C9oP1GD9/VoN6Q7j7WhMmq2DW69ZjdXqn21pfuulHI n2UkI+zXb/inH1vLU+JFJFBOIweqVCfJWSAaqbzspw3pOWWNukXLvafoI+kU9YKHckbh Jv4g== X-Gm-Message-State: AOAM532WXjtoVQFcbyOuygweRyvguK0Zydwivm98r+J0L8HaFE0pwWm0 bx0enCM/+s0QCSVGmUaFWCmKj6bcNwN1AgbhtYwzlQ== X-Received: by 2002:a67:1046:: with SMTP id 67mr5250935vsq.21.1614767475658; Wed, 03 Mar 2021 02:31:15 -0800 (PST) MIME-Version: 1.0 References: <20210211113309.1.I629b2366a6591410359c7fcf6d385b474b705ca2@changeid> In-Reply-To: From: Nicolas Boichat Date: Wed, 3 Mar 2021 18:31:04 +0800 Message-ID: Subject: Re: [PATCH] drm/dsi: Add _NO_ to MIPI_DSI_* flags disabling features To: Linus Walleij 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 , Laurent Pinchart , 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 , "open list:DRM PANEL DRIVERS" , freedreno , Linux ARM , MSM , "linux-kernel@vger.kernel.org" , "moderated list:ARM/Mediatek SoC support" , linux-samsung-soc Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 1, 2021 at 4:59 PM Linus Walleij wrote: > > On Thu, Feb 11, 2021 at 4:34 AM 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. > > Unless someone like me interpreted it literally... > > Like in these: > > > drivers/gpu/drm/mcde/mcde_dsi.c | 2 +- > > drivers/gpu/drm/panel/panel-novatek-nt35510.c | 2 +- > > drivers/gpu/drm/panel/panel-samsung-s6d16d0.c | 2 +- > > drivers/gpu/drm/panel/panel-sony-acx424akp.c | 2 +- > > > diff --git a/drivers/gpu/drm/mcde/mcde_dsi.c b/drivers/gpu/drm/mcde/mcde_dsi.c > > index 2314c8122992..f4cdc3cfd7d0 100644 > > --- a/drivers/gpu/drm/mcde/mcde_dsi.c > > +++ b/drivers/gpu/drm/mcde/mcde_dsi.c > > @@ -760,7 +760,7 @@ static void mcde_dsi_start(struct mcde_dsi *d) > > DSI_MCTL_MAIN_DATA_CTL_BTA_EN | > > DSI_MCTL_MAIN_DATA_CTL_READ_EN | > > DSI_MCTL_MAIN_DATA_CTL_REG_TE_EN; > > - if (d->mdsi->mode_flags & MIPI_DSI_MODE_EOT_PACKET) > > + if (d->mdsi->mode_flags & MIPI_DSI_MODE_NO_EOT_PACKET) > > val |= DSI_MCTL_MAIN_DATA_CTL_HOST_EOT_GEN; > > If you read the code you can see that this is interpreted as inserting > an EOT packet, so here you need to change the logic such: > > if (!d->mdsi->mode_flags & MIPI_DSI_MODE_NO_EOT_PACKET) > val |= DSI_MCTL_MAIN_DATA_CTL_HOST_EOT_GEN; > > This will make sure the host generates the EOT packet in HS mode > *unless* the flag is set. > > (I checked the data sheet.) > > > diff --git a/drivers/gpu/drm/panel/panel-novatek-nt35510.c b/drivers/gpu/drm/panel/panel-novatek-nt35510.c > > index b9a0e56f33e2..9d9334656803 100644 > > --- a/drivers/gpu/drm/panel/panel-novatek-nt35510.c > > +++ b/drivers/gpu/drm/panel/panel-novatek-nt35510.c > > @@ -899,7 +899,7 @@ static int nt35510_probe(struct mipi_dsi_device *dsi) > > dsi->hs_rate = 349440000; > > dsi->lp_rate = 9600000; > > dsi->mode_flags = MIPI_DSI_CLOCK_NON_CONTINUOUS | > > - MIPI_DSI_MODE_EOT_PACKET; > > + MIPI_DSI_MODE_NO_EOT_PACKET; > > Here you should just delete the MIPI_DSI_MODE_EOT_PACKET > flag because this was used with the MCDE driver which interpret the > flag literally. > > > diff --git a/drivers/gpu/drm/panel/panel-samsung-s6d16d0.c b/drivers/gpu/drm/panel/panel-samsung-s6d16d0.c > > index 4aac0d1573dd..b04b9975e9b2 100644 > > --- a/drivers/gpu/drm/panel/panel-samsung-s6d16d0.c > > +++ b/drivers/gpu/drm/panel/panel-samsung-s6d16d0.c > > @@ -186,7 +186,7 @@ static int s6d16d0_probe(struct mipi_dsi_device *dsi) > > */ > > dsi->mode_flags = > > MIPI_DSI_CLOCK_NON_CONTINUOUS | > > - MIPI_DSI_MODE_EOT_PACKET; > > + MIPI_DSI_MODE_NO_EOT_PACKET; > > Same, just delete the flag. > > > --- a/drivers/gpu/drm/panel/panel-samsung-s6e63m0-dsi.c > > +++ b/drivers/gpu/drm/panel/panel-samsung-s6e63m0-dsi.c > > @@ -97,7 +97,7 @@ static int s6e63m0_dsi_probe(struct mipi_dsi_device *dsi) > > dsi->hs_rate = 349440000; > > dsi->lp_rate = 9600000; > > dsi->mode_flags = MIPI_DSI_MODE_VIDEO | > > - MIPI_DSI_MODE_EOT_PACKET | > > + MIPI_DSI_MODE_NO_EOT_PACKET | > > MIPI_DSI_MODE_VIDEO_BURST; > > Same, just delete the flag. > > > diff --git a/drivers/gpu/drm/panel/panel-sony-acx424akp.c b/drivers/gpu/drm/panel/panel-sony-acx424akp.c > > index 065efae213f5..6b706cbf2f9c 100644 > > --- a/drivers/gpu/drm/panel/panel-sony-acx424akp.c > > +++ b/drivers/gpu/drm/panel/panel-sony-acx424akp.c > > @@ -450,7 +450,7 @@ static int acx424akp_probe(struct mipi_dsi_device *dsi) > > else > > dsi->mode_flags = > > MIPI_DSI_CLOCK_NON_CONTINUOUS | > > - MIPI_DSI_MODE_EOT_PACKET; > > + MIPI_DSI_MODE_NO_EOT_PACKET; > > Same, just delete the flag. > > These are all just semantic bugs due to the ambiguity of the flags, it is > possible to provide a Fixes: flag for each file using this flag the wrong way > but I dunno if it's worth it. Wow nice catch. I think we should fix all of those _before_ my patch is applied, with proper Fixes tags so that this can be backported to stable branches, even if it's a no-op. I can look into it but that may take a bit of time. Thanks, > > Yours, > Linus Walleij