Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3968584pxj; Mon, 21 Jun 2021 10:26:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvHqV9hXjAyGh5CalEIcMDSCNHCwv7FRM+f0pJykxU1zXe6FU/yaIJlD6ct4dcFoP4PTpa X-Received: by 2002:a92:c0cc:: with SMTP id t12mr8705744ilf.177.1624296409020; Mon, 21 Jun 2021 10:26:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624296409; cv=none; d=google.com; s=arc-20160816; b=J1UTva7n3yhQdey0t432DhoPpfg78JqisHQpw5nhwNFDALNCzUnDCNoPsSuMOg9f9S ITuDN5kre3zLWYpgI5lP/G3hXyirUnr9oP3ufabNBLoFApu29ebaUBTb/4L/D4eRbf74 SPnj5HkNuN4CJQNqRva106X95Crv0cVWOxu9Q5XUaUcHuKe+lhBH/xG0Md1f9qMS+JLj ZNthhuQSkKORQ7Mbr0n3mhCJtm40tOo6uXk8hvhhSAy2V5vmha+Lh+oObnm0pK/eUx56 hMvjWTWT/iOpL0ZuYM6l3WVRwSGqDTrUy+0kHEX6LewDd4pnKoKVCHYZhasZO/zEQN/O BaGA== 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=yksK4X6+8Tdxbx2WrBBGvKC5wDVLn6otjnHQDHKi3Sk=; b=rsGmrdi0k/nxtd+dmo49uslPt9j1RIR3DtnD7rotcuHljKKKRQM/FjvT1c1+W15Mgq E4WfxCeGfLgADkDgggY20lc3mz6sc4SSkuSBl+6PTjC5hrTQTVAftS4Gj2KB/QWdPtUs VNPo32lf/KUhqsZ2WkjXUFLeK4Yq4nKOGoRWe6mrmiN9sotvnp4AYEAC1mogcZfx+dR1 a+N+/zhWF4WJz40RnmUcNTPHog/4s9cuZ5WjnsQTfcfTr9uYcroLcJsLZDwoGkRHZXuB FwbZV2U87cYlmQwnUiEb21WFwaWmiSmpRlmnumMLNPZyGkTctGfgpbvSA7Y57d1J/JPC CAGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=IiEneIKm; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l16si20170056ion.65.2021.06.21.10.26.32; Mon, 21 Jun 2021 10:26:49 -0700 (PDT) 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=@amarulasolutions.com header.s=google header.b=IiEneIKm; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231279AbhFUR1Q (ORCPT + 99 others); Mon, 21 Jun 2021 13:27:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231252AbhFUR1P (ORCPT ); Mon, 21 Jun 2021 13:27:15 -0400 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BAC86C061574 for ; Mon, 21 Jun 2021 10:25:00 -0700 (PDT) Received: by mail-ed1-x529.google.com with SMTP id s6so20001088edu.10 for ; Mon, 21 Jun 2021 10:25:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yksK4X6+8Tdxbx2WrBBGvKC5wDVLn6otjnHQDHKi3Sk=; b=IiEneIKmdV6rzCyUDCUZ6Zz+Anyk4Ca/JUYBnztStiSJgUYyfNTFXU3TbPDrV0Q2lE ofxI/KyIeTZYdwiY/ko9mI9iTripS/CuqRRlfBc1B9MC7UwngZKHhu6SFMEM9w9zXA3t XxuQIoodnqnKEPvub7DzFx2zKO72bc8NoCkKU= 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=yksK4X6+8Tdxbx2WrBBGvKC5wDVLn6otjnHQDHKi3Sk=; b=Xoy7CdDnTTYtf4i8EBLquGqoaP+qQMUcQ+++Pv5Q3sX2PwMY8RaYrywShcPpMDUtar /narWviLlbm98/e47l2g21sUMUME0vuUIdHiifR2Q/Eve6BP1GHgHhBH8DAo1Kd5FIEl G5GTxftfy2SXkpOTCL/W71e7SS/d3bFM40//ajrWnfqzqnDFovp7kLrlokciKId153O4 l5F2iv0DX69SOoYAMKjgyLaJf5TSjvK9vkqUGEbX1cVTMygbEsAFLzMsK8CQ3P3XWBnE uUGmyFtjD6ttJo6FwZGjmr9/BaVZ+jWfWMTpjnbs7fkV3GJ0pd2AnUhnRUAMDWyULBZx AWnQ== X-Gm-Message-State: AOAM530oyNRgIepKoF2LTPaKt8HKpKv200WNQQE5igaP9jSE2s+Bwimx SqweT6XNftfIwFHjL4u/IGMKYeAs3IMWNNtQwjWE+Q== X-Received: by 2002:a05:6402:4408:: with SMTP id y8mr5483279eda.55.1624296299381; Mon, 21 Jun 2021 10:24:59 -0700 (PDT) MIME-Version: 1.0 References: <20200707101912.571531-1-maxime@cerno.tech> In-Reply-To: From: Jagan Teki Date: Mon, 21 Jun 2021 22:54:48 +0530 Message-ID: Subject: Re: [PATCH] drm/vc4: dsi: Only register our component once a DSI device is attached To: Laurent Pinchart Cc: Dave Stevenson , Marek Vasut , Tim Gover , Eric Anholt , linux-arm-kernel , LKML , DRI Development , Andrzej Hajda , bcm-kernel-feedback-list@broadcom.com, Maxime Ripard , Phil Elwell , Nicolas Saenz Julienne , linux-rpi-kernel@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Laurent, On Mon, Jun 21, 2021 at 7:44 PM Laurent Pinchart wrote: > > Hi Jagan, > > On Mon, Jun 21, 2021 at 07:41:07PM +0530, Jagan Teki wrote: > > On Mon, Jun 21, 2021 at 6:26 PM Laurent Pinchart wrote: > > > On Mon, Jun 21, 2021 at 12:49:14PM +0100, Dave Stevenson wrote: > > > > On Sun, 20 Jun 2021 at 23:49, Laurent Pinchart wrote: > > > > > On Sun, Jun 20, 2021 at 09:42:27PM +0300, Laurent Pinchart wrote: > > > > > > On Sun, Jun 20, 2021 at 03:29:03PM +0100, Dave Stevenson wrote: > > > > > > > On Sun, 20 Jun 2021 at 04:26, Laurent Pinchart wrote: > > > > > > > > > > > > > > > > Hi Maxime, > > > > > > > > > > > > > > > > I'm testing this, and I'm afraid it causes an issue with all the > > > > > > > > I2C-controlled bridges. I'm focussing on the newly merged ti-sn65dsi83 > > > > > > > > driver at the moment, but other are affected the same way. > > > > > > > > > > > > > > > > With this patch, the DSI component is only added when the DSI device is > > > > > > > > attached to the host with mipi_dsi_attach(). In the ti-sn65dsi83 driver, > > > > > > > > this happens in the bridge attach callback, which is called when the > > > > > > > > bridge is attached by a call to drm_bridge_attach() in vc4_dsi_bind(). > > > > > > > > This creates a circular dependency, and the DRM/KMS device is never > > > > > > > > created. > > > > > > > > > > > > > > > > How should this be solved ? Dave, I think you have shown an interest in > > > > > > > > the sn65dsi83 recently, any help would be appreciated. On a side note, > > > > > > > > I've tested the ti-sn65dsi83 driver on a v5.10 RPi kernel, without much > > > > > > > > success (on top of commit e1499baa0b0c I get a very weird frame rate - > > > > > > > > 147 fps of 99 fps instead of 60 fps - and nothing on the screen, and on > > > > > > > > top of the latest v5.10 RPi branch, I get lock-related warnings at every > > > > > > > > page flip), which is why I tried v5.12 and noticed this patch. Is it > > > > > > > > worth trying to bring up the display on the v5.10 RPi kernel in parallel > > > > > > > > to fixing the issue introduced in this patch, or is DSI known to be > > > > > > > > broken there ? > > > > > > > > > > > > > > I've been looking at SN65DSI83/4, but as I don't have any hardware > > > > > > > I've largely been suggesting things to try to those on the forums who > > > > > > > do [1]. > > > > > > > > > > > > > > My branch at https://github.com/6by9/linux/tree/rpi-5.10.y-sn65dsi8x-marek > > > > > > > is the latest one I've worked on. It's rpi-5.10.y with Marek's driver > > > > > > > cherry-picked, and an overlay and simple-panel definition by others. > > > > > > > It also has a rework for vc4_dsi to use pm_runtime, instead of > > > > > > > breaking up the DSI bridge chain (which is flawed as it never calls > > > > > > > the bridge mode_set or mode_valid functions which sn65dsi83 relies > > > > > > > on). > > > > > > > > > > > > > > I ran it on Friday in the lab and encountered an issue with vc4_dsi > > > > > > > should vc4_dsi_encoder_mode_fixup wish for a divider of 7 (required > > > > > > > for this 800x1280 panel over 4 lanes) where it resulted in an invalid > > > > > > > mode configuration. That resulted in patch [2] which then gave me > > > > > > > sensible numbers. > > > > > > > > > > > > > > That branch with dtoverlay=vc4-kms-v3d and > > > > > > > dtoverlay=vc4-kms-dsi-ti-sn65dsi83 created all the expected devices, > > > > > > > and everything came up normally. > > > > > > > It was a busy day, but I think I even stuck a scope on the clock lanes > > > > > > > at that point and confirmed that they were at the link frequency > > > > > > > expected. > > > > > > > > > > > > Thanks, I'll test your branch and will report the results. > > > > > > > > > > I had to apply the following diff to work around a crash: > > > > > > > > > > diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi83.c b/drivers/gpu/drm/bridge/ti-sn65dsi83.c > > > > > index 55b6c53207f5..647426aa793a 100644 > > > > > --- a/drivers/gpu/drm/bridge/ti-sn65dsi83.c > > > > > +++ b/drivers/gpu/drm/bridge/ti-sn65dsi83.c > > > > > @@ -525,6 +525,9 @@ static bool sn65dsi83_mode_fixup(struct drm_bridge *bridge, > > > > > > > > > > /* The DSI format is always RGB888_1X24 */ > > > > > list_for_each_entry(connector, &ddev->mode_config.connector_list, head) { > > > > > + if (!connector->display_info.bus_formats) > > > > > + continue; > > > > > + > > > > > switch (connector->display_info.bus_formats[0]) { > > > > > case MEDIA_BUS_FMT_RGB666_1X7X3_SPWG: > > > > > ctx->lvds_format_24bpp = false; > > > > > > > > > > connector->display_info.bus_formats is NULL for the HDMI connectors, as > > > > > I have nothing connected to them, as well as for the writeback > > > > > connector. > > > > > > > > I'm now confused as to what I'm doing as my branch appears NOT to have > > > > Marek's latest version of the driver as it doesn't have > > > > sn65dsi83_mode_fixup. > > > > I need to have another look at what's going on - I think I've got > > > > branches confused when switching between machines :-( Remaking that > > > > branch now. > > > > > > > > I do see that Marek has sent another patch around > > > > sn65dsi83_mode_fixup, but it'll still dereference > > > > connector->display_info.bus_formats[0] on all connectors. Shouldn't it > > > > only be switching on the one connector that is connected to this > > > > bridge, not HDMI or writeback connectors? I'm not totally clear on > > > > which connectors are in that list. > > > > https://patchwork.freedesktop.org/patch/440175/ > > > > > > The following series should fix the issue: > > > > > > [PATCH] drm/bridge: ti-sn65dsi83: Replace connector format patching with atomic_get_input_bus_fmts > > > [PATCH 0/5] ti-sn65dsi83: Finalize transition to atomic operations > > > > Look like DSI on STM32MP1 seems broken even with these on top of > > drm-misc/drm-misc-next , anything broken on the tree? > > No idea, I don't have a functional display on my RPi CM4 device yet, so > I can't tell :-) Look like FB circular dependency patch f611b1e7624c causing the issue. Maxime is also mentioned same it seems in other response. Jagan.