Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3093907pxb; Mon, 1 Mar 2021 01:08:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJynitGU0RU/xxzyZz6LlTWcQS1DKPwdH5TBs5DkokHMTfaI2rH1beUhXRbxKZ+FVaDp+7SL X-Received: by 2002:a17:906:3883:: with SMTP id q3mr14763294ejd.160.1614589716516; Mon, 01 Mar 2021 01:08:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614589716; cv=none; d=google.com; s=arc-20160816; b=IYveeBLB/SUD31smP3zikUW7Kbn0VD745Kb5/wvwklZtKWFveWqWUDIQl8PVGcvnKa QXMJV3mOTaVNbUTza4nhiP5tEGh7XuEhgO+0J8rWh2NlzhYFaaJvQs3XAKx62FdZtulg MUQq+MIjppE+N+jgCdKvctxdfn4DN2eU2RQeI8BUGyS/PtM8ihF10mXlPbKIoSLmQphs P5FyDOOaDmhM5E9xCxquU6AczoulBhUdHSwwbyzSFT3KknYQVXPe3o/HiknVQYubddp2 2frz4TJ9znE1dXFrSOvcFgxo6QPEG2F3AnZRGgv/+7tdvvxDx5r3vVprxI5m/c7DBtdx l+kA== 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=AYs79IPnRt3qtzNnShKWZ7vyowWc2VUelHvdooVHnZg=; b=wn/0b7/b5MN+xmfj4O8DTsXo2k56WrWik42wylHyVBxrx3+vyH1P0dWkbohiaDHbgk jwBuAeKLoPGEnjzlIgzq10XT2Q2ISirok9h9C6ShXMYIxjW7Ot3ZpO5M6Z/XDsIkd77z tfEsUJbcm8q8DvzlgIdKWYO7V4BcL2ULUKaLu1iaIK+K6bU+uGPMcppxYyyyDCgUjauW 9PwF9o2fGh5RbVi/BJpqgEbm9BT1H33jojVJdI9APF/fv1dDQ6croF4VH3xBHMW+Rq+V 7ZaX3+dVNqa9g6gxOJD+5AIJz3sTKnFeqmubZGtF7hg2ko5ArXWVYvkeUOe5wRSBVUPk jRsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kcf6kcit; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w22si6969570ejc.517.2021.03.01.01.08.13; Mon, 01 Mar 2021 01:08:36 -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=@linaro.org header.s=google header.b=kcf6kcit; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233590AbhCAJFa (ORCPT + 99 others); Mon, 1 Mar 2021 04:05:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233776AbhCAJA2 (ORCPT ); Mon, 1 Mar 2021 04:00:28 -0500 Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A14CC06178A for ; Mon, 1 Mar 2021 00:59:48 -0800 (PST) Received: by mail-lj1-x22f.google.com with SMTP id y12so5559297ljj.12 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=Oiyht6Sx9dFNfZGM7mgZDPRFi9rmfVk/qujc5WBcXL4p8rhilfFHKOB2MDzFgbS7zg jpIYQ7uKqStLtUA4v1IpJH6AjsITIU8kEZkDzlEuBpPykdSgkZ/5j0jXeHhS4qB9x9pf vC10ZsxxDZmPDywFxgpjI5Ya/+MwpugZ+EB29gBNbuN0PZ+BoqspCRbEFhUvNuQIihpZ goqYUIT+yNlm/A2eXvMcy0e+imUW0wMrh6i4Aud66sbitOBdHj1xlnV1G0iD1DKFSCuw W1lmnsEZoZzQuqhzbNQjWnuoAVF9gE72LntoohOBDx2HEVH6vetRb5R2P9SIQ+Ae1gjy o2Kg== X-Gm-Message-State: AOAM532L2LjR9Ed6/AfEda8EsruRKBjOZDp65s0GO0XxYpS9WUVSlGwu X7zlGwc6f2HhaFIdjDzGh2BvB9YNKQsDIiHWPMCgyg== 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-kernel@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