Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp1739114lqt; Sun, 21 Apr 2024 07:37:06 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX7HZPjcL0VdVMWQ2kYVLHH7lFR4ELIA0XyD3oYXjqeEH0i1c/bQNcCGiMwZyVh4kQpkbyj66nnwuvd9YgXqkXGKzr30bnJba+iwazdWw== X-Google-Smtp-Source: AGHT+IHvu6R0Zp6ozgO1LIa87QM32CQwIELR7rUk/GWjBYYATAwf+hzi43Gz4x3sBPWmWb9IF1WL X-Received: by 2002:a54:4118:0:b0:3c5:fc77:5a1b with SMTP id l24-20020a544118000000b003c5fc775a1bmr8962283oic.55.1713710226234; Sun, 21 Apr 2024 07:37:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713710226; cv=pass; d=google.com; s=arc-20160816; b=uMuhq+M45YoJEGtuPNWWAAK0OuOW1wzYheqd24rwcYRcrt1iokW3cKvoHEx8ChFJGi 33Dmrj+OTGJTG2o9yj2x3GW/YscK2ozWnBcnBmVN+4uj56sbqx9tB8t6+6fjcl1xU7kt W2IxKjibQt90Wma2VbL7Yh++7bOiQMZWq2xqshFomx3ImeuW7rOiWFLbkHK9l6x5OwTC vzdZJj9t3Y/uNA8hsCDIpCLZhnzGVR4Lvt3vsDImd5WupoZ01ZxR7YXEHLM+ZeDmiWLa FN03mVP1IBsZbkrNKSMYSN6E5UN0Suli0BY0P7KG5UdloR/J7ngW9xlDVqHyd0t3jQdD dbYw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=qN/AyrbP3w0CH/0SM3qG6WDHoGfkio3UiZLbi7y6Udc=; fh=jrZfFAtdJK4VMNsGj78qW1OPip5sDemUP8q146GJ4uI=; b=WDIjTa2sgrYDHqSwdty6BvIclNpPjQAghyBJUxRG2i//6Ge000X+fbkU4fNNVlbuFc PVgs47U6hWsYkkSkvkrn4J1fi4W05ahu+I7ju1d/uGlSY6Bp8IUiMb1X6gQV9eqPu7nq mtGAKBY41uo+1F2Dc8jAZVQzPhpLX8Ws1Ce5qn/4omHV3DJgThLMy9dVwdJVcmDtNS89 Qpqkg+MZuGnNJrxNyFZFevOFGM2NkRvMQ/sA+SLNy3gF699XhjYzgScKkhWzEU+MnOgS OmA/T6ivrF5/0ENEQ52q+ryEuYGY24Jr31laSu2bJyuQ9lu+2d1VqxsLnBJPcMVdM1Jl kBmw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@denx.de header.s=phobos-20191101 header.b=VnQuc3mi; arc=pass (i=1 spf=pass spfdomain=denx.de dkim=pass dkdomain=denx.de dmarc=pass fromdomain=denx.de); spf=pass (google.com: domain of linux-kernel+bounces-152517-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152517-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=denx.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id jl8-20020ad45e88000000b006a043e8cecbsi8248926qvb.6.2024.04.21.07.37.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Apr 2024 07:37:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-152517-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@denx.de header.s=phobos-20191101 header.b=VnQuc3mi; arc=pass (i=1 spf=pass spfdomain=denx.de dkim=pass dkdomain=denx.de dmarc=pass fromdomain=denx.de); spf=pass (google.com: domain of linux-kernel+bounces-152517-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152517-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=denx.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id ECF931C20C15 for ; Sun, 21 Apr 2024 14:37:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 655F51BC37; Sun, 21 Apr 2024 14:36:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=denx.de header.i=@denx.de header.b="VnQuc3mi" Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EBFFF18044 for ; Sun, 21 Apr 2024 14:36:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=85.214.62.61 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713710200; cv=none; b=FPnoMnR8pSHW/hYZmledOhkn3o1kX85b7Wgg1x4vS/aIjA63j6C6X6kuC38xj6L0TRw1+smsDt1Ec5s8LzSV8ZW3s7njVKBaXlJEBEXqK/jjc1tHk6vVuj2nbCn/UzuCqbLUQv/9IQEFhKRq2E7h8PJ2uO5/fOJKmH/PSqFXBVQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713710200; c=relaxed/simple; bh=QWTbZqy5lTrwfWMVMScZBHUEFIHVdDptRtsd0agUg80=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=ZDhTJTcVt+jl03mYF7r2p7BLiQFcjBQx+yrisA03/DRumDH5MANcVzRwgw3uZocC+sb7bMebjRijp8Sjr5iRWuQJpbvy1/4eXrZJ9zh36/GWqydm7H/r94Bmp7XUR9Vr4JccXz9dJm5IYxVf48m3Y5hRAjE3WLSGzi58qZHq3oA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=denx.de; spf=pass smtp.mailfrom=denx.de; dkim=pass (2048-bit key) header.d=denx.de header.i=@denx.de header.b=VnQuc3mi; arc=none smtp.client-ip=85.214.62.61 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=denx.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=denx.de Received: from [127.0.0.1] (p578adb1c.dip0.t-ipconnect.de [87.138.219.28]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 7166888276; Sun, 21 Apr 2024 16:36:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1713710197; bh=qN/AyrbP3w0CH/0SM3qG6WDHoGfkio3UiZLbi7y6Udc=; h=Date:Subject:To:References:From:In-Reply-To:From; b=VnQuc3miSCXSguOH/iRYdeYU0fsDvh4xLPXcewr4tSaojRZco3vySrGQnGtVameHV b94pYJPd7NaXk4l3npnPH765JZmXBZY1Vsk+3vT3d0XcvsvE6j1954A1bQleR8O3Ac YQK+yIn4rwMVy73fkJ/y13X9WXAXCtSaPUjDkcZekTQnvs6KO0/bGQLH1Pil+Vr5n4 y/BSaAs3j2pb6IZvKhdcjbToTKA8tAoryxnD60vTDlt+LnVxk2auCJCcS1vZCrhzvc faUjIjAsYMv/WKRWHfxYfS/+3vqHh69l3MpPLqlY/Qr4JA18tiWfIddM6zmQmqM/FB /Hmi1kPgerL6w== Message-ID: <4da75f3b-16a7-46f4-97d9-6f51a54fbe7e@denx.de> Date: Sun, 21 Apr 2024 16:25:34 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC][PATCH] drm: bridge: dw-mipi-dsi: Call modeset in modeset callback To: =?UTF-8?Q?Ond=C5=99ej_Jirman?= , dri-devel@lists.freedesktop.org, Andrzej Hajda , Biju Das , Daniel Vetter , David Airlie , Douglas Anderson , Jernej Skrabec , Jonas Karlman , Laurent Pinchart , Liu Ying , Maarten Lankhorst , Maxime Ripard , Neil Armstrong , Rob Herring , Robert Foss , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org References: <20240421002330.172723-1-marex@denx.de> Content-Language: en-US From: Marek Vasut In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean On 4/21/24 1:09 PM, Ondřej Jirman wrote: > Hi, Hi, > On Sun, Apr 21, 2024 at 02:22:35AM GMT, Marek Vasut wrote: >> Doing modeset in .atomic_pre_enable callback instead of dedicated .mode_set >> callback does not seem right. Undo this change, which was added as part of > > Actually no. If anything, mode_set callback should be dropped entirely: > > See https://elixir.bootlin.com/linux/latest/source/include/drm/drm_bridge.h#L231 > > It's deprecated, and enable callback should just use adjusted_mode: > > This is deprecated, do not use! New drivers shall set their mode in the > &drm_bridge_funcs.atomic_enable operation. This mentions new drivers ? >> commit 05aa61334592 ("drm: bridge: dw-mipi-dsi: Fix enable/disable of DSI >> controller") as it breaks STM32MP15xx LTDC scanout (DSI)->TC358762 DSI-to-DPI >> bridge->PT800480 DPI panel pipeline. The original fix for HX8394 panel likely >> requires HX8394 panel side fix instead. > > There's nothing wrong with the panel driver. And that commit is not fixing issue > with the panel driver, just like the subject hints at. Look at the referenced > commit, at "Before:" sequence specifically. > > dw_mipi_dsi_mode_set may be named *_mode_set or whatever, but it's basically > an enable function that turns on clocks, initalizes phy, etc. etc. > > https://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c#L998 > > And if you check "Before:" sequence, you'll see that .mode_set callback is just > called once at boot and never again. And it's atomic(_pre)_enable/atomic(_post)_disable > callbacks that actually are called in ballanced way to enable/disable the > controller repeatedly ever after. > > Function dw_mipi_dsi_bridge_post_atomic_disable is the inverse of > dw_mipi_dsi_mode_set, it undoes everything that dw_mipi_dsi_mode_set does. > > You need to find root cause for your issue on STM32MP15xx instead of reverting > fixes for resource use bugs in this driver. Actually, reverting commit 05aa61334592 ("drm: bridge: dw-mipi-dsi: Fix enable/disable of DSI controller") makes the STM32MP15xx work again like it used to since Linux 5.10 or so, so that commit breaks existing working use case. It seems it is sufficient to revert only this part of the commit to make the STM32MP15xx work as it used to, do you have any idea why ?