Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp30141258rwd; Thu, 6 Jul 2023 01:14:52 -0700 (PDT) X-Google-Smtp-Source: APBJJlEmJKoy8TvJQ4/upWVPR1vHTw+MbRM9yw3C+jeowYZE/1iL8q5Gkzm5aKRDMCtrVvM9Bxiy X-Received: by 2002:a05:6870:588f:b0:1b3:e896:9c09 with SMTP id be15-20020a056870588f00b001b3e8969c09mr2106377oab.19.1688631291681; Thu, 06 Jul 2023 01:14:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688631291; cv=none; d=google.com; s=arc-20160816; b=yuKbVSQDTX6fAWtn+fp/nBsgwwdBTCYB0Zqa4SFI6jfuWxB1b7C9H3eMNxlNMMevJ2 vivDfz1WVxFs3/z2E3sYypvnkbjgVhByMt1eFxHrdhpclTUzwWGUaS59Lm26xhdlSruF e+56dHaEmALGpbsrSPD/7CQCiJ6n4DdHeepAiv0Nd9fLv8SgwoEHPA8C6h0mvPKsS9EH 5E+bgL8F4K/2L9Y6EH38JSHRwRB8Q1MFLdztWwPh5ngoyvZeSKgYRdI5f1NFyYLaHtmu DIVLsqoYaqJzdlkrNp2DL0JMxMTCoagrIYq9x/tdljiNqJ1mBtjJ5BZLdGxuYznXG/fR 2rYg== 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:dkim-signature; bh=LCgcGaV1aBhmt7V8hhiAT/HnCGUo3FaJdPB0vD8Sj1U=; fh=uxF9wmG5kzGagjNFHP/9rSXnwyzR8qGUUuZzM9DE4FM=; b=W1sH7+0YsOpQRLx2XmXQ89rRqIWP7Qv8tP7uGWVcG89SAfMlJLPBkUe0KlX3Hjv7y3 1gTAhgNmytEyjAu75KAnxHaToHHhOjme4FX16JyWPs+6U/+Z04K4zAtTsaxPmLWW7E3e ejwn1McHgawGzaOpZHyBibhQ5s3DgD4uzSEIJuiSJwp+aytDgQMVNJm2BrTWlviahcS/ ZSXsRcuX13cJ2arvkJ6iIycJdEDeOit8Fq5r7vYpZXrdmJnHJ6og0q9aXQbrHEw/ZnPf YJ0MftY85shZ+MlQGjLdzi0BfN4sGHmJlkAefL66Yt8IznixLNkA5LJE5Jzqb6oVavEB kUBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RBESkY+z; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t8-20020a17090aba8800b00263f5a29bf4si3108315pjr.20.2023.07.06.01.14.36; Thu, 06 Jul 2023 01:14:51 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RBESkY+z; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233946AbjGFH7O (ORCPT + 99 others); Thu, 6 Jul 2023 03:59:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231431AbjGFH7N (ORCPT ); Thu, 6 Jul 2023 03:59:13 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A2F3121; Thu, 6 Jul 2023 00:59:12 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2861F618B9; Thu, 6 Jul 2023 07:59:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0BB58C433C7; Thu, 6 Jul 2023 07:59:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688630351; bh=zTimcz4m7Wp96vq+YDSDJkwi80FeyVfIxn6cyWrRfJs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RBESkY+zvwyfdrR4c7z0AO0ed0WI+rvXAr5CRSnCq81U2jPZTGlvBTTMyXVnMgXqV OrefwdEtZopCjmHgBjgdqWqiOYi0EzQJR1M6i9paUGLh2IZKGu/xQ2BUxuDWbm8lHj p5JAA807/XKuJkl9dQQzagBbkXZYK5X25vVgHK9zUy91zfOpO7EDcACxuC4Xt9cpjs qFdy1aNod3QFONk4xF5efZOpLosNCtObtPWYR9EDw/EHfqkfToBWSdprhEsx+hg07L 8U7kNGFyTTxVmcWtAE0V1cV1i3z0/D/sqCpD5K23esL6DMRqXTBxqufk3PRxxPS6Q7 Z+0ej/bzjs6PQ== Date: Thu, 6 Jul 2023 09:59:08 +0200 From: Maxime Ripard To: Neil Armstrong Cc: Dmitry Baryshkov , AngeloGioacchino Del Regno , "open list:DRM DRIVER FOR MSM ADRENO GPU" , Caleb Connolly , Krzysztof Kozlowski , AngeloGioacchino Del Regno , Marijn Suijten , Sam Ravnborg , Kuogee Hsieh , Andy Gross , Jessica Zhang , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Conor Dooley , "open list:DRM DRIVER FOR MSM ADRENO GPU" , Abhinav Kumar , Rob Herring , Martin Botka , ~postmarketos/upstreaming@lists.sr.ht, Jami Kettunen , Bjorn Andersson , open list , Konrad Dybcio , freedreno Subject: Re: RFC: DSI host capabilities (was: [PATCH RFC 03/10] drm/panel: Add LGD panel driver for Sony Xperia XZ3) Message-ID: References: <47a5678c-1eb3-dfc2-a9ac-f8e497455d11@linaro.org> <6e070141-8c0e-59ed-8a08-58c3fadb17df@linaro.org> <9e071beb-9d9d-c6dc-8196-a3e23ea73713@linaro.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="tz763qdeh2jjkufg" Content-Disposition: inline In-Reply-To: <9e071beb-9d9d-c6dc-8196-a3e23ea73713@linaro.org> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 --tz763qdeh2jjkufg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 06, 2023 at 09:33:15AM +0200, Neil Armstrong wrote: > On 06/07/2023 09:24, Maxime Ripard wrote: > > On Wed, Jul 05, 2023 at 11:09:40PM +0300, Dmitry Baryshkov wrote: > > > On 05/07/2023 19:53, Maxime Ripard wrote: > > > > On Wed, Jul 05, 2023 at 06:20:13PM +0300, Dmitry Baryshkov wrote: > > > > > On Wed, 5 Jul 2023 at 17:24, Maxime Ripard w= rote: > > > > > >=20 > > > > > > On Wed, Jul 05, 2023 at 04:37:57PM +0300, Dmitry Baryshkov wrot= e: > > > > > > > > > >=20 > > > > > > > > > > Either way, I'm not really sure it's a good idea to mul= tiply the > > > > > > > > > > capabilities flags of the DSI host, and we should just = stick to the > > > > > > > > > > spec. If the spec says that we have to support DSC whil= e video is > > > > > > > > > > output, then that's what the panels should expect. > > > > > > > > >=20 > > > > > > > > > Except some panels supports DSC & non-DSC, Video and Comm= and mode, and > > > > > > > > > all that is runtime configurable. How do you handle that ? > > > > > > > >=20 > > > > > > > > In this case, most of the constraints are going to be on th= e encoder > > > > > > > > still so it should be the one driving it. The panel will on= ly care about > > > > > > > > which mode has been selected, but it shouldn't be the one d= riving it, > > > > > > > > and thus we still don't really need to expose the host capa= bilities. > > > > > > >=20 > > > > > > > This is an interesting perspective. This means that we can an= d actually have > > > > > > > to extend the drm_display_mode with the DSI data and compress= ion > > > > > > > information. > > > > > >=20 > > > > > > I wouldn't extend drm_display_mode, but extending one of the st= ate > > > > > > structures definitely. > > > > > >=20 > > > > > > We already have some extra variables in drm_connector_state for= HDMI, > > > > > > I don't think it would be a big deal to add a few for MIPI-DSI. > > > > > >=20 > > > > > > We also floated the idea for a while to create bus-specific sta= tes, with > > > > > > helpers to match. Maybe it would be a good occasion to start do= ing it? > > > > > >=20 > > > > > > > For example, the panel that supports all four types for the 1= 080p should > > > > > > > export several modes: > > > > > > >=20 > > > > > > > 1920x1080-command > > > > > > > 1920x1080-command-DSC > > > > > > > 1920x1080-video > > > > > > > 1920x1080-video-DSC > > > > > > >=20 > > > > > > > where video/command and DSC are some kinds of flags and/or in= formation in > > > > > > > the drm_display_mode? Ideally DSC also has several sub-flags,= which denote > > > > > > > what kind of configuration is supported by the DSC sink (e.g.= bpp, yuv, > > > > > > > etc). > > > > > >=20 > > > > > > So we have two things to do, right? We need to expose what the = panel can > > > > > > take (ie, EDID for HDMI), and then we need to tell it what we p= icked > > > > > > (infoframes). > > > > > >=20 > > > > > > We already express the former in mipi_dsi_device, so we could e= xtend the > > > > > > flags stored there. > > > > > >=20 > > > > > > And then, we need to tie what the DSI host chose to a given ato= mic state > > > > > > so the panel knows what was picked and how it should set everyt= hing up. > > > > >=20 > > > > > This is definitely something we need. Marijn has been stuck with = the > > > > > panels that support different models ([1]). > > > > >=20 > > > > > Would you prefer a separate API for this kind of information or > > > > > abusing atomic_enable() is fine from your point of view? > > > > >=20 > > > > > My vote would be for going with existing operations, with the sli= ght > > > > > fear of ending up with another DSI-specific hack (like > > > > > pre_enable_prev_first). > > > >=20 > > > > I don't think we can get away without getting access to the atomic_= state > > > > from the panel at least. > > > >=20 > > > > Choosing one setup over another is likely going to depend on the mo= de, > > > > and that's only available in the state. > > > >=20 > > > > We don't have to go the whole way though and create the sub-classes= of > > > > drm_connector_state, but I think we should at least provide it to t= he > > > > panel. > > > >=20 > > > > What do you think of creating a new set of atomic_* callbacks for > > > > panels, call that new set of functions from msm and start from ther= e? > > >=20 > > > We are (somewhat) bound by the panel_bridge, but yeah, it seems possi= ble. > >=20 > > Bridges have access to the atomic state already, so it's another place > > to plumb this through but I guess it would still be doable? >=20 > It's definitely doable, but I fear we won't be able to test most of the > panel drivers, should we introduce a new atomic set of panel callbacks ? That was my original intent yeah :) Creating an atomic_enable/disable/ etc. and then switch drm_panel_enable() to take the state (and fixing up all the callers), or create a drm_panel_enable_atomic() function. The latter is probably simpler, something like: int drm_panel_enable_atomic(struct drm_panel *panel, struct drm_atomic_state *state) { struct drm_panel_funcs *funcs =3D panel->funcs; if (funcs->atomic_enable) return funcs->atomic_enable(panel, state); return funcs->enable(panel); } And we should probably mention that it supersedes/deprecates drm_panel_enable. We've switched most of the other atomic hooks to take the full drm_atomic_state so I'd prefer to use it. However, for it to be somewhat useful we'd need to have access to the connector assigned to that panel. drm_panel doesn't store the drm_connector it's connected to at all, and of_drm_find_panel() doesn't take it as an argument so we can't fill it when we retrieve it either. So I guess we can go for: - Create a new set of atomic hooks - Create a new set of functions to call those hooks, that we would document as deprecating the former functions. Those functions would take a pointer to the drm_connector_state of the drm_connector it's connected to. - We add a TODO item to add a pointer to the connector in drm_panel - We add a TODO item that depend on the first one to switch the new functions and hooks to drm_atomic_state - We add a TODO item to convert callers of drm_panel_enable et al. to our new functions. It should work in all setups, paves a nice way forward and documents the trade-offs we had to take and eventually address. And without creating a dependency on 30+ patches series. Does it sound like a plan? > Or shall be simply move the "new" panel driver supporting atomic to bridge > and only use panel_bridge for basic panels ? I don't think we can expect panel_bridge to be used all the time any time soon, so I'd rather avoid to rely on it. Maxime --tz763qdeh2jjkufg Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCZKZ0TAAKCRDj7w1vZxhR xSohAPoDIUmfiZHt7PetbXTCY20gBYiDpa5re8QZstc4d38bewEAztydb7mEAxL+ oSXavXHhgNOkk2mJg9D2fD0hXIkbOAw= =MrP7 -----END PGP SIGNATURE----- --tz763qdeh2jjkufg--