Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp821315rwl; Fri, 31 Mar 2023 02:56:55 -0700 (PDT) X-Google-Smtp-Source: AKy350YMlv5gjWSUaksL5IRYsOxFam9VVtHKU214PsOajxLQ9Xmb+7Fa9Ltsi9+MXYj74KWyzLaR X-Received: by 2002:a17:902:9309:b0:1a1:956d:2281 with SMTP id bc9-20020a170902930900b001a1956d2281mr22652848plb.3.1680256615262; Fri, 31 Mar 2023 02:56:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680256615; cv=none; d=google.com; s=arc-20160816; b=H50XvNKUTK+j32nG1PJRL1fdP+vlWF2gldCOzUf55ukgZLpKYMn8zGfFbhohkVlg46 PROp5m5y6KIt8rICxjBfxavfI//+hxbcBsRCnMAmMo9o6J4pbMpm9ix42ZUni72O+xxA jGR30DEGxMiXkZQkYBEtTW/rte0UyySxV1Bhlpb4G3xEhOq5oP00D/KeeRPyEVv+QArb OMOxRXTYl0ljwfnJjs49OC+7szx4xO7W6DPm5XE/mfqazFL9yCYx91ipUyIOu2MKHFFr p4RNKTZZUhzMbAiQINRCYxlfYjMecEUKkTMfcifs8kV3FNTjObuFVYs7fks2YJvPRK4J G/kA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=3/S2Q97BVXAtzj4RZdBGz+ZAKuS86uMBEl0H1m2nwhg=; b=N7fhuKSzGHGcZ5352yqUB6B1iAyMqwiuC9kXB9/zv5QaxT6CCl1z9LlLO4vn7u/fUK Dbl8ZM+ViFbxgK881vuw2wbjcLZuRtbdPMqIJg2UkfgqEZfa1QZ5z4ZtOS/3tikK63Fh rYzYJGc/6op/sfkhW60y6Z8OqIySkHSWyBBE/74tkMOL0FdwFPwmsglSXtU5XtudU9BU EOG05h+B6a88VA/8wHa6sX0RX0YECgL9oyqkzckSKCAg9wgqMZcbyiVAGpmCa9HDH5yY JI0g7+lbp2JPyrRlTv+R05gQM4Eh6WNlje5+ZzupK3E9JanlWybVD0dN1t20mKLLLcsI MAEw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j14-20020a170903024e00b001a068523000si1883543plh.231.2023.03.31.02.56.43; Fri, 31 Mar 2023 02:56:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231966AbjCaJta (ORCPT + 99 others); Fri, 31 Mar 2023 05:49:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231177AbjCaJsu (ORCPT ); Fri, 31 Mar 2023 05:48:50 -0400 Received: from mail11.truemail.it (mail11.truemail.it [217.194.8.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9072B9026 for ; Fri, 31 Mar 2023 02:47:43 -0700 (PDT) Received: from francesco-nb.int.toradex.com (93-49-2-63.ip317.fastwebnet.it [93.49.2.63]) by mail11.truemail.it (Postfix) with ESMTPA id B45A5207CC; Fri, 31 Mar 2023 11:47:41 +0200 (CEST) Date: Fri, 31 Mar 2023 11:47:39 +0200 From: Francesco Dolcini To: Neil Armstrong Cc: Francesco Dolcini , Andrzej Hajda , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , dri-devel@lists.freedesktop.org, Marek Vasut , Francesco Dolcini , David Airlie , Daniel Vetter , linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 2/2] drm/bridge: ti-sn65dsi83: Add DSI video mode configuration Message-ID: References: <20230330101752.429804-1-francesco@dolcini.it> <20230330101752.429804-3-francesco@dolcini.it> <6a386ff3-2af6-a544-674f-7c60d4d89e4e@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6a386ff3-2af6-a544-674f-7c60d4d89e4e@linaro.org> X-Spam-Status: No, score=-0.0 required=5.0 tests=SPF_HELO_PASS,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 31, 2023 at 11:06:44AM +0200, Neil Armstrong wrote: > Hi, > > On 30/03/2023 12:17, Francesco Dolcini wrote: > > From: Francesco Dolcini > > > > Enable configuration of the DSI video mode instead of hard-coding > > MIPI_DSI_MODE_VIDEO_BURST. The bridge support any of burst-mode, > > non-burst with sync event or non-burst with sync pulse > > > > With this change is possible to use the bridge with host DSI > > that do not support burst mode. > > > > Signed-off-by: Francesco Dolcini > > --- > > drivers/gpu/drm/bridge/ti-sn65dsi83.c | 24 +++++++++++++++++++++++- > > 1 file changed, 23 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi83.c b/drivers/gpu/drm/bridge/ti-sn65dsi83.c > > index 91ecfbe45bf9..144d0de0d278 100644 > > --- a/drivers/gpu/drm/bridge/ti-sn65dsi83.c > > +++ b/drivers/gpu/drm/bridge/ti-sn65dsi83.c > > @@ -145,6 +145,7 @@ struct sn65dsi83 { > > struct drm_bridge *panel_bridge; > > struct gpio_desc *enable_gpio; > > struct regulator *vcc; > > + u32 dsi_video_mode; > > bool lvds_dual_link; > > bool lvds_dual_link_even_odd_swap; > > }; > > @@ -603,6 +604,9 @@ static int sn65dsi83_parse_dt(struct sn65dsi83 *ctx, enum sn65dsi83_model model) > > return dev_err_probe(dev, PTR_ERR(ctx->vcc), > > "Failed to get supply 'vcc'\n"); > > + ctx->dsi_video_mode = 0; > > + of_property_read_u32(dev->of_node, "dsi-video-mode", &ctx->dsi_video_mode); > > + > > return 0; > > } > > @@ -642,7 +646,25 @@ static int sn65dsi83_host_attach(struct sn65dsi83 *ctx) > > dsi->lanes = dsi_lanes; > > dsi->format = MIPI_DSI_FMT_RGB888; > > - dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST; > > + dsi->mode_flags = MIPI_DSI_MODE_VIDEO; > > + > > + switch (ctx->dsi_video_mode) { > > + case 0: > > + /* burst mode */ > > + dsi->mode_flags |= MIPI_DSI_MODE_VIDEO_BURST; > > + break; > > + case 1: > > + /* non-burst mode with sync event */ > > + break; > > + case 2: > > + /* non-burst mode with sync pulse */ > > + dsi->mode_flags |= MIPI_DSI_MODE_VIDEO_SYNC_PULSE; > > + break; > > + default: > > + dev_warn(dev, "invalid video mode %d\n", ctx->dsi_video_mode); > > + break; > > + } > > + > > ret = devm_mipi_dsi_attach(dev, dsi); > > if (ret < 0) { > > As I understand from DSI spec is that those are dynamic, so they are hardcoded in driver now > but they shouldn't be hardcoded in DT. > > The problem is larger and we should add some sort of "supported features" we can get > from the DSI controller and set the flags accordingly because the features support accross the > DSI controllers isn't linear. I need to change this since I do have a bridge that does not support DSI video burst mode, while the ti-sn65 supports really any mode. The change here is the same as what is done for the raydium,rm67191 panel, see Documentation/devicetree/bindings/display/panel/raydium,rm67191.yaml and drivers/gpu/drm/panel/panel-raydium-rm67191.c. What's wrong to have this in the dts so that a panel can explicitly tell which DSI video mode it expects? Francesco