From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9ED99C433DB for ; Mon, 1 Mar 2021 09:04:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4D17764E01 for ; Mon, 1 Mar 2021 09:04:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233747AbhCAJBz (ORCPT ); Mon, 1 Mar 2021 04:01:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233606AbhCAJA2 (ORCPT ); Mon, 1 Mar 2021 04:00:28 -0500 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25026C061788 for ; Mon, 1 Mar 2021 00:59:48 -0800 (PST) Received: by mail-lj1-x22b.google.com with SMTP id m11so17610858lji.10 for ; Mon, 01 Mar 2021 00:59:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=AYs79IPnRt3qtzNnShKWZ7vyowWc2VUelHvdooVHnZg=; b=kcf6kcitYZpg70CypoUp8KXILwBgfW62DpbNjWslqlp4qw62fI7tzmXjPZQCmQxMc8 y7E4AtX2Fmm4bNLcfXcEPW4KygtdDIAQoh7/Gppn2wuQW/GKYs0Umn4Wm46XccGHSmBe jy7uA45XkN8GMGoDoJDciHZsVQhSFIR5XDAoh0rW972s2s04adtjid+35nHXnoln8MA8 FxCO26S/5xLKeLnx947E7nXZn0Rnap1zKbmn2OkkQ+VOi8uxBgu0gE1sSxomW3gthjJM ufu7iyDDX3VZgWZtHNc17YGxcgin7Xk21+hnZeVkHrui+fqknKWQ+8YcQvAzXeWUB5vl a9WQ== 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=AYs79IPnRt3qtzNnShKWZ7vyowWc2VUelHvdooVHnZg=; b=WF+VLew4HH+x+ccurte62UC+BcCqVIQPMCWbDEr/wOku4O1QoTNGKQKRXtzEsuXfgj s03VcDDitQVqrioiAgZf/z5a9STz1OSN4O0QJDXLjhSPqvBvn/1N5pZKZ+mlw/mdRViD v7cYfp0idkeSfuqEf8jcJuhEhx8UzvfB0ysGWLiZlYo/5/vdvnA/7Y57QW7eHQuUz0jb /w4ytDC/PqH16S9VoZFlK+vSXjzCFvGz9sBMq1mkvErq4fTvl0taLZecZjqi2SoYRUDX GceSF6kM15Tm/inH3GlonjM0tJa15gcEjYIrX3BgrC4NRqh8bCssi5SvvvfSFy+JbxrC M2Lg== X-Gm-Message-State: AOAM530IDSfACyf1xQ8ceN9EXJUwNNKAG+JNejNoXscBLDtntZ5/Z2rm jCfWUclxh14yOPbOcJa3+H7xIcubp1/N0SlTzXm8/A== X-Google-Smtp-Source: ABdhPJyj3pw+C0NXHPjoJdDWHXn0vLK/WBMS4zWE5j9GGEZHyMLzxq+OeogebxlDuBb2zgJuFq1OMvgpJB8dxst6o6c= X-Received: by 2002:a2e:9754:: with SMTP id f20mr6463797ljj.200.1614589186573; Mon, 01 Mar 2021 00:59:46 -0800 (PST) MIME-Version: 1.0 References: <20210211113309.1.I629b2366a6591410359c7fcf6d385b474b705ca2@changeid> In-Reply-To: <20210211113309.1.I629b2366a6591410359c7fcf6d385b474b705ca2@changeid> From: Linus Walleij Date: Mon, 1 Mar 2021 09:59:35 +0100 Message-ID: Subject: Re: [PATCH] drm/dsi: Add _NO_ to MIPI_DSI_* flags disabling features To: Nicolas Boichat 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-samsung-soc@vger.kernel.org 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. Yours, Linus Walleij