Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp29060991rwd; Wed, 5 Jul 2023 06:44:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6VjAjWw8wDtQjKXVIEBjU0B4e8O/mJmsEbiKhr847/issz4GvFFv4+xuuJQ/vActYehvsO X-Received: by 2002:a05:6808:1296:b0:3a3:6f20:39b4 with SMTP id a22-20020a056808129600b003a36f2039b4mr17106560oiw.29.1688564643988; Wed, 05 Jul 2023 06:44:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688564643; cv=none; d=google.com; s=arc-20160816; b=ckEKk82BX0PD3Qx3hhv0XP2r1b6cf08CSsGyHHiS77fbz3SQnO8O9Sho2g/dUnwQGi hWjT8s7wblK1FW+H+aE5zV3mVyLKIJJ5zY6ORx63940ugpmuMjiS8PDyCdl+4xlVtrsZ 1jnoA0TfPFsw5KJ3oLXjpay1+CMAZHtzD7QSx7PQffA0I58uNf4wV49PujBvrDL8v3J+ zRWewOVWoRHKz0bqQJHae3y7xfcpZ43anop5XqgFzDjkXfbMI7lh3Xm5eMU8/q9SfXL3 nkxiBYRFbWgl9htGuloNJJJK8v1H2hRwyZa8C/kp9lz85sGEuuYtAAPOD0ntjXog9xBY /wGA== 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=IGBADA/v6+UTrucj238aitijhnSWqPGJ7pxpoQfw2x0=; fh=E47BdjsC7m0K/3XFArY2XgoMnZuQzcjd2cRx+7FG+Po=; b=v/BFmY6DuObm+6LLdAs2aOINtoCX0qF4I9f9ta8qyuFlcsbzqWDRxjSFo/schgK0G7 bWaRkkeePbu/QRRHdBCxvbp7A+B0PNnB0K4ZBgWWR+ByVHepJAYHH7p1jAnvtkkOHgh4 9XnlpW3mNAlMMws7nfclGtiRvNGwHGiake6Ce3YWB8Pnb3Zxxltilz4SgGRtX8N//Lh9 jjYKjmmKIuPjLZ51eroGZCDUGc17PzA0UJURr+b15gtEuD8b34qhpA6YCvxP8S2CT9Go gx6hIZ2eg0pvXRGdY0aa/fe719PmaKZMOiclD1rC0z1jrstlQFicPPuoGx1sEXRHIlnc rPcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=l8VI+kvc; 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 c4-20020a634e04000000b005577eec6c6csi22074219pgb.160.2023.07.05.06.43.50; Wed, 05 Jul 2023 06:44:03 -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=l8VI+kvc; 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 S232214AbjGEN3j (ORCPT + 99 others); Wed, 5 Jul 2023 09:29:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231937AbjGEN3h (ORCPT ); Wed, 5 Jul 2023 09:29:37 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D73961719; Wed, 5 Jul 2023 06:29:35 -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 64DB661552; Wed, 5 Jul 2023 13:29:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F190C433C8; Wed, 5 Jul 2023 13:29:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688563774; bh=E9F4liiB8PmsaYkzpF61IqGQLdVz5mRe/B8Y4yuj/rE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=l8VI+kvcq+IaHbcDzdIXjCgNsY1rQuHEMCq9CvZ90HSnqWeO1Fb/gfZYakXt9O9kb hKO4KO3sPLZMfoJ9GMcAebA2UPEkbmg0zAVidfQzvrI8xPaWoDen6EEVeddye/I+kk BUi4XwYypgQESBLg/z3SApTRNh4osJEsVswLskiBf/xIOGOCMiUBg5xI6ByxiIR0yt +dDpsn24R00A3o9cTOEVkQrXtvjiCLb2W/q+3Q8ITqmuzP9wh0bjhyM/0NV41/Mfwh TSLF3m8RkZnq3VJCA4YE6g9VOmFVigXNICQj4av3KkbGI0laEvjV7xhnLs5ipjJthu GT+2sk5dVR1dA== Date: Wed, 5 Jul 2023 15:29:32 +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: <20230521-drm-panels-sony-v1-0-541c341d6bee@somainline.org> <20230521-drm-panels-sony-v1-3-541c341d6bee@somainline.org> <617c8f8a-1fc7-c6a0-eaa5-ce75ff2adc1b@linaro.org> <739a8bd9-9ff0-5072-fdae-b64efdf86842@collabora.com> <47a5678c-1eb3-dfc2-a9ac-f8e497455d11@linaro.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="clzl4rrz3426fhln" Content-Disposition: inline In-Reply-To: <47a5678c-1eb3-dfc2-a9ac-f8e497455d11@linaro.org> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 --clzl4rrz3426fhln Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 05, 2023 at 03:05:33PM +0200, Neil Armstrong wrote: > On 05/07/2023 14:04, Maxime Ripard wrote: > > Hi, > >=20 > > On Tue, May 30, 2023 at 03:36:04PM +0300, Dmitry Baryshkov wrote: > > > On 30/05/2023 15:15, AngeloGioacchino Del Regno wrote: > > > > Il 30/05/23 13:44, Dmitry Baryshkov ha scritto: > > > > > On Tue, 30 May 2023 at 10:24, Neil Armstrong > > > > > wrote: > > > > > >=20 > > > > > > Hi Marijn, Dmitry, Caleb, Jessica, > > > > > >=20 > > > > > > On 29/05/2023 23:11, Marijn Suijten wrote: > > > > > > > On 2023-05-22 04:16:20, Dmitry Baryshkov wrote: > > > > > > > > > > > > > > > > +=A0=A0 if (ctx->dsi->dsc) { > > > > > > > >=20 > > > > > > > > dsi->dsc is always set, thus this condition can be dropped. > > > > > > >=20 > > > > > > > I want to leave room for possibly running the panel without D= SC (at a > > > > > > > lower resolution/refresh rate, or at higher power consumption= if there > > > > > > > is enough BW) by not assigning the pointer, if we get access = to panel > > > > > > > documentation: probably one of the magic commands sent in thi= s driver > > > > > > > controls it but we don't know which. > > > > > >=20 > > > > > > I'd like to investigate if DSC should perhaps only be enabled i= f we > > > > > > run non certain platforms/socs ? > > > > > >=20 > > > > > > I mean, we don't know if the controller supports DSC and those > > > > > > particular > > > > > > DSC parameters so we should probably start adding something lik= e : > > > > > >=20 > > > > > > static drm_dsc_config dsc_params_qcom =3D {} > > > > > >=20 > > > > > > static const struct of_device_id panel_of_dsc_params[] =3D { > > > > > > =A0=A0=A0=A0=A0=A0=A0=A0 { .compatible =3D "qcom,sm8150", , .d= ata =3D &dsc_params_qcom }, > > > > > > =A0=A0=A0=A0=A0=A0=A0=A0 { .compatible =3D "qcom,sm8250", , .d= ata =3D &dsc_params_qcom }, > > > > > > =A0=A0=A0=A0=A0=A0=A0=A0 { .compatible =3D "qcom,sm8350", , .d= ata =3D &dsc_params_qcom }, > > > > > > =A0=A0=A0=A0=A0=A0=A0=A0 { .compatible =3D "qcom,sm8450", , .d= ata =3D &dsc_params_qcom }, > > > > > > }; > > > > >=20 > > > > > I think this would damage the reusability of the drivers. The pan= el > > > > > driver does not actually care if the SoC is SM8350, sunxi-somethi= ng or > > > > > RCar. > > > > > Instead it cares about host capabilities. > > > > >=20 > > > > > I think instead we should extend mipi_dsi_host: > > > > >=20 > > > > > #define MIPI_DSI_HOST_MODE_VIDEO BIT(0) > > > > > #define MIPI_DSI_HOST_MODE_CMD=A0 BIT(1) > > > > > #define MIPI_DSI_HOST_VIDEO_SUPPORTS_COMMANDS BIT(2) > > > > > // FIXME: do we need to provide additional caps here ? > > > > >=20 > > > > > #define MIPI_DSI_DSC_1_1 BIT(0) > > > > > #define MIPI_DSI_DSC_1_2 BIT(1) > > > > > #define MIPI_DSI_DSC_NATIVE_422 BIT(2) > > > > > #define MIPI_DSI_DSC_NATIVE_420 BIT(3) > > > > > #define MIPI_DSI_DSC_FRAC_BPP BIT(4) > > > > > // etc. > > > > >=20 > > > > > struct mipi_dsi_host { > > > > > =A0 // new fields only > > > > > =A0=A0 unsigned long mode_flags; > > > > > =A0=A0 unsigned long dsc_flags; > > > > > }; > > > > >=20 > > > > > Then the panel driver can adapt itself to the host capabilities a= nd > > > > > (possibly) select one of the internally supported DSC profiles. > > > > >=20 > > > >=20 > > > > I completely agree about extending mipi_dsi_host, other SoCs could = reuse > > > > that and > > > > support for DSC panels would become a lot cleaner. > > >=20 > > > Sounds good. I will wait for one or two more days (to get the possible > > > feedback on fields/flags/etc) and post an RFC patch to dri-devel. > >=20 > > I just came across that discussion, and couldn't find those patches, did > > you ever send them? > >=20 > > Either way, I'm not really sure it's a good idea to multiply 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 while video is > > output, then that's what the panels should expect. >=20 > Except some panels supports DSC & non-DSC, Video and Command mode, and > all that is runtime configurable. How do you handle that ? In this case, most of the constraints are going to be on the encoder still so it should be the one driving it. The panel will only care about which mode has been selected, but it shouldn't be the one driving it, and thus we still don't really need to expose the host capabilities. This is very much like HDMI: the encoder knows what the monitor is capable of, will take a decision based on its capabilities and the monitor's and will then let the monitor know. But the monitor never knows what the encoder is truly capable of, nor will it enforce something. Maxime --clzl4rrz3426fhln Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCZKVwPAAKCRDj7w1vZxhR xU1aAP0ZPPGjtfbd5LeNowVSsVrKP9rzqfsnK4d7K+Mf/Stl9wD+NIKEIu2BPgSP zyEIbEEjC5KJN9bnZLDxQXByRgpSPAY= =w/p2 -----END PGP SIGNATURE----- --clzl4rrz3426fhln--