Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp28947416rwd; Wed, 5 Jul 2023 05:13:16 -0700 (PDT) X-Google-Smtp-Source: APBJJlE5TR+/bXNJqx0qLO+3X0dQMBHYhOSgOY7BBde+jRA2/lXgdaD5Nbc1RkOcFpuvoAO11l7a X-Received: by 2002:a17:90a:d781:b0:263:f39:496d with SMTP id z1-20020a17090ad78100b002630f39496dmr16230245pju.44.1688559195466; Wed, 05 Jul 2023 05:13:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688559195; cv=none; d=google.com; s=arc-20160816; b=alBvymZ4do/O6gfHr85H5Nepm3ysMmQ/TrGxiGcrdJZNueYRfQlfCwH9AordPTW7Of GahHa/WKRvym6zYh4Z63RZWOyrmP5x3ncUQ3WTRx4T9OI3NqPDyZcTAZviIBr4CAuHE8 H7K5sYNyye5hxyWBVAG57c9sH9M0FEk91k1AvUHc+kcM7NamLgZSe4I6Q2yYWD+wd1TC COpsR3apXBf/1wctqN2b2pXtS6Xx+VWWNU2Ryiyj8sy8gjQqP6bm70TIKUOh572grY0N m0jKi4xQruJk7+GW+pO3Ckd9HntSsdzIzk2OJahOABB30ZpDd52EY4+JeH/Jzq1Jh3w+ rYaA== 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=zpQHiah5pU5ivi5QnyiHH3I+kbG+Eq4swtcEgTjXUaA=; fh=/rnZwahU+mL8u/l+O+BDtL0H0HKQOJs1kiz1mZMLNi0=; b=vrBXXYSYZiSFyv/S1XuGfIYLSSfa4N/JZ0d+ytn+ditL+xrbB/lfCFkKfa0iqsC/hH Iry0V4yUf3z0Cppd/PG7nk7/4XEWxzd2DUPO+0gme8LLrqIeybzggKwSnJ6cvlFg+vqW Gi2HXDcRmD7YrimhSGlL2xZSsT3Xm0qlodxIGl1Is+B0xaopFUoGH43eCtLjBm6fS/Rx SmpSjGQz6PJceCGPQWFGU8tLWjUsLmzlUFl6oEgLw+OK+9oX9r7q3BuHrl2eP9AG2qvP qnBc85U0rdRx/KNc8BGAfwnVmEx3TgOrW2dhYVF665G2PyGa3+2D+BGqpOjRoD92oTeM eEUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZsPAFsMv; 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 ck12-20020a17090afe0c00b0024e2afd72a3si1472415pjb.182.2023.07.05.05.13.03; Wed, 05 Jul 2023 05:13:15 -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=ZsPAFsMv; 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 S231931AbjGEMEH (ORCPT + 99 others); Wed, 5 Jul 2023 08:04:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230242AbjGEMEG (ORCPT ); Wed, 5 Jul 2023 08:04:06 -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 DA6061706; Wed, 5 Jul 2023 05:04:04 -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 68D2261516; Wed, 5 Jul 2023 12:04:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 48C41C433C8; Wed, 5 Jul 2023 12:04:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688558643; bh=zpQHiah5pU5ivi5QnyiHH3I+kbG+Eq4swtcEgTjXUaA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZsPAFsMvzkFtlDcZtJDpGIX2qQVVvXrwaEzMc7YGvKZhROXNuKvg722OlAweWXL/Z j/jjr5q2t1u9HoihkQya58R90kZ8PdgAnd8yduFaPMAyXzRdjHcwUMfWJeFXrfIJ3G EjC2RAZc6dMyu2vTUkhLFprfZWTXvfJ96Wi2veiK2ujOoYv4keYHeszKrCwk5uXp9Z fDKdRi4Mtl+hulGM3htJArlZxOiz07hCizRGXwqFm6LXkHSfc7u8w8yTPDRbRer9RX 3mpjgitDz4YcBfN48skVFGVMqzApFLpaGUrl/wa9xzf94H/A7MXMOVghnRJEJfUUkP HfXztUJE8FJPA== Date: Wed, 5 Jul 2023 14:04:00 +0200 From: Maxime Ripard To: Dmitry Baryshkov Cc: AngeloGioacchino Del Regno , Neil Armstrong , "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> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="vjd4hy6ibnmkekav" Content-Disposition: inline In-Reply-To: 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 --vjd4hy6ibnmkekav Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, 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 DSC (= 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 p= anel > > > > > documentation: probably one of the magic commands sent in this dr= iver > > > > > controls it but we don't know which. > > > >=20 > > > > I'd like to investigate if DSC should perhaps only be enabled if 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 like : > > > >=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", , .data = =3D &dsc_params_qcom }, > > > > =A0=A0=A0=A0=A0=A0=A0=A0 { .compatible =3D "qcom,sm8250", , .data = =3D &dsc_params_qcom }, > > > > =A0=A0=A0=A0=A0=A0=A0=A0 { .compatible =3D "qcom,sm8350", , .data = =3D &dsc_params_qcom }, > > > > =A0=A0=A0=A0=A0=A0=A0=A0 { .compatible =3D "qcom,sm8450", , .data = =3D &dsc_params_qcom }, > > > > }; > > >=20 > > > I think this would damage the reusability of the drivers. The panel > > > driver does not actually care if the SoC is SM8350, sunxi-something 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 and > > > (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. I just came across that discussion, and couldn't find those patches, did you ever send them? 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. If a host isn't able to provide that, it's a bug and we should fix the controller driver instead of creating a workaround in the core for broken drivers. Another concern I have is that, those broken drivers are usually the undocumented ones that already have trouble supporting the most trivial setup. Creating more combinations both at the controller and panel level will just make it harder for those drivers. Maxime --vjd4hy6ibnmkekav Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCZKVcMAAKCRDj7w1vZxhR xeVgAQDMoWfOkJ4iYKGDevKKuJrt/Yox11zWBcNz3kO+JHvKCgEA1xY50FGJLaT2 cS39fgkgt4dP5e/C3mtQGra1z+NhNgM= =LKUp -----END PGP SIGNATURE----- --vjd4hy6ibnmkekav--