Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: AngeloGioacchino Del Regno  <angelogioacchino.delregno@collabora.com>
To: neil.armstrong@linaro.org,
	Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Marijn Suijten <marijn.suijten@somainline.org>,
	Caleb Connolly <caleb@connolly.tech>,
	Jessica Zhang <quic_jesszhan@quicinc.com>,
	Sam Ravnborg <sam@ravnborg.org>, David Airlie <airlied@gmail.com>,
	Daniel Vetter <daniel@ffwll.ch>, Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Andy Gross <agross@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	~postmarketos/upstreaming@lists.sr.ht,
	AngeloGioacchino Del Regno 
	<angelogioacchino.delregno@somainline.org>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	Martin Botka <martin.botka@somainline.org>,
	Jami Kettunen <jami.kettunen@somainline.org>,
	"open list:DRM DRIVER FOR MSM ADRENO GPU" 
	<dri-devel@lists.freedesktop.org>,
	open list <linux-kernel@vger.kernel.org>,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" 
	<devicetree@vger.kernel.org>,
	"open list:DRM DRIVER FOR MSM ADRENO GPU" 
	<linux-arm-msm@vger.kernel.org>,
	Abhinav Kumar <quic_abhinavk@quicinc.com>,
	Kuogee Hsieh <quic_khsieh@quicinc.com>,
	freedreno <freedreno@lists.freedesktop.org>
Subject: Re: RFC: DSI host capabilities (was: [PATCH RFC 03/10] drm/panel: Add LGD panel driver for Sony Xperia XZ3)
Date: Wed, 31 May 2023 10:02:04 +0200	[thread overview]
Message-ID: <491055de-93f5-952e-4e37-9b00299a1d2d@collabora.com> (raw)
In-Reply-To: <83c36957-cc85-c7e3-3fe5-f86562e003ee@linaro.org>

Il 30/05/23 17:44, Neil Armstrong ha scritto:
> On 30/05/2023 14:36, 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 <neil.armstrong@linaro.org> wrote:
>>>>>
>>>>> Hi Marijn, Dmitry, Caleb, Jessica,
>>>>>
>>>>> On 29/05/2023 23:11, Marijn Suijten wrote:
>>>>>> On 2023-05-22 04:16:20, Dmitry Baryshkov wrote:
>>>>>> <snip>
>>>>>>>> +   if (ctx->dsi->dsc) {
>>>>>>>
>>>>>>> dsi->dsc is always set, thus this condition can be dropped.
>>>>>>
>>>>>> 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 panel
>>>>>> documentation: probably one of the magic commands sent in this driver
>>>>>> controls it but we don't know which.
>>>>>
>>>>> I'd like to investigate if DSC should perhaps only be enabled if we
>>>>> run non certain platforms/socs ?
>>>>>
>>>>> I mean, we don't know if the controller supports DSC and those particular
>>>>> DSC parameters so we should probably start adding something like :
>>>>>
>>>>> static drm_dsc_config dsc_params_qcom = {}
>>>>>
>>>>> static const struct of_device_id panel_of_dsc_params[] = {
>>>>>          { .compatible = "qcom,sm8150", , .data = &dsc_params_qcom },
>>>>>          { .compatible = "qcom,sm8250", , .data = &dsc_params_qcom },
>>>>>          { .compatible = "qcom,sm8350", , .data = &dsc_params_qcom },
>>>>>          { .compatible = "qcom,sm8450", , .data = &dsc_params_qcom },
>>>>> };
>>>>
>>>> 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.
>>>>
>>>> I think instead we should extend mipi_dsi_host:
>>>>
>>>> #define MIPI_DSI_HOST_MODE_VIDEO BIT(0)
> 
> I assume all DSI controller supports Video mode, so it should be a negative here
> if for a reason it's not the case.

Either all positive or all negative... and yes I agree that all DSI controllers
support video mode nowadays, but:
  - Will that be true for future controllers? (likely yes, but you never know)
  - Is there any controller driver not implementing video mode?
    - Will there be one in the future?

> 
> There should also be a flag to tell if sending LP commands sending while
> in HS Video mode is supported.
> 

+1. This is the case for both qcom and mtk.

>>>> #define MIPI_DSI_HOST_MODE_CMD  BIT(1)
>>>> #define MIPI_DSI_HOST_VIDEO_SUPPORTS_COMMANDS BIT(2)
>>>> // FIXME: do we need to provide additional caps here ?
>>>>
>>>> #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.
>>>>
>>>> struct mipi_dsi_host {
>>>>   // new fields only
>>>>    unsigned long mode_flags;
>>>>    unsigned long dsc_flags;
>>>> };
>>>>
>>>> Then the panel driver can adapt itself to the host capabilities and
>>>> (possibly) select one of the internally supported DSC profiles.
>>>>
>>>
>>> I completely agree about extending mipi_dsi_host, other SoCs could reuse that and
>>> support for DSC panels would become a lot cleaner.
>>
>> 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.
> 
> Good, I was waiting until a DSC panel appears on the list (and I failed to be the 
> first), it's now the case.
> 
> For VTRD6130, the panel is capable of the 4 modes:
> - video mode
> - command mode
> - video mode & DSC
> - command mode & DSC
> 
> So it would need such info to enable one of the mode in some order to determine.
> 

Dynamically determining is not trivial, as that depends on multiple variables:
  - Availability of the modes (obviously)
  - Available lanes
    - Available bandwidth per lane
      - Available total bandwidth
  - Power consumption considerations (DSC IP may be using more or less power
    depending on the actual SoC//controller)
    - Thermal management: DSC may make no thermal sense as in, more heat output
      vs thermal envelope (laptop vs embedded vs handset)
  - Others

Hence, the implementation should also provide a way of choosing a preferred mode
on a per-controller basis (DSC or no compression).

Just a few considerations that came to mind with a good sleep.

Cheers!

> Thanks,
> Neil
>>
>>>
>>> For example, on MediaTek DRM there's some support for DSC, more or less the same
>>> for SPRD DRM and some DSI bridge drivers... having a clean infrastructure would
>>> definitely help.
>>>
>>> I'm sad I cannot offer testing in that case because despite being sure that there
>>> are MTK smartphones around with DSI panels using DSC, I have none... and all of the
>>> Chromebooks are not using DSC anyway (but using DisplayPort compression, which is
>>> obviously an entirely different beast).
>>>
>>>>>
>>>>> ...
>>>>> static int sony_akatsuki_lgd_probe(struct mipi_dsi_device *dsi)
>>>>> ...
>>>>>          const struct of_device_id *match;
>>>>>
>>>>> ...
>>>>>          match = of_match_node(panel_of_dsc_params, of_root);
>>>>>          if (match && match->data) {
>>>>>                  dsi->dsc = devm_kzalloc(&dsi->dev, sizeof(*dsc), GFP_KERNEL);
>>>>>                  memcpy(dsi->dsc, match->data, sizeof(*dsc));
>>>>>          } else {
>>>>>                  dev_warn(&dsi->dev, "DSI controller is not marked as 
>>>>> supporting DSC\n");
>>>>>          }
>>>>> ...
>>>>> }
>>>>>
>>>>> and probably bail out if it's a DSC only panel.
>>>>>
>>>
>>> Usually DDICs support both DSC and non-DSC modes, depending on the initial
>>> programming (read: init commands)... but the usual issue is that many DDICs
>>> are not publicly documented for reasons, so yes, bailing out if DSC is not
>>> supported would be the only option, and would be fine at this point.
>>>
>>> Cheers,
>>> Angelo
>>>
>>>>> We could alternatively match on the DSI controller's dsi->host->dev instead of 
>>>>> the SoC root compatible.
>>>>>
>>>>> Neil
>>>>
>>>
>>
> 


  reply	other threads:[~2023-05-31  8:02 UTC|newest]

Thread overview: 73+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-21 21:23 [PATCH RFC 00/10] drm/panel: Drivers for four Sony CMD-mode (and DSC) panels Marijn Suijten
2023-05-21 21:23 ` [PATCH RFC 01/10] drm/panel: Clean up SOFEF00 config dependencies Marijn Suijten
2023-05-22  9:01   ` Neil Armstrong
2023-05-28 22:00   ` Caleb Connolly
2023-05-21 21:23 ` [PATCH RFC 02/10] dt-bindings: display: panel: Describe Sony Xperia XZ3's LGD panel Marijn Suijten
2023-05-22  0:10   ` Dmitry Baryshkov
2023-05-21 21:23 ` [PATCH RFC 03/10] drm/panel: Add LGD panel driver for Sony Xperia XZ3 Marijn Suijten
2023-05-22  1:16   ` Dmitry Baryshkov
2023-05-22  9:04     ` Neil Armstrong
2023-05-22 12:58       ` Dmitry Baryshkov
2023-05-29 21:07         ` Marijn Suijten
2023-05-29 22:18           ` Dmitry Baryshkov
2023-05-29 22:37             ` Marijn Suijten
2023-05-29 22:39               ` Dmitry Baryshkov
2023-05-30  8:27                 ` Marijn Suijten
2023-05-30 11:11                   ` Dmitry Baryshkov
2023-05-30 18:19                     ` Marijn Suijten
2023-05-30 17:54             ` Abhinav Kumar
2023-05-30 18:13               ` Marijn Suijten
2023-05-30 23:16                 ` Dmitry Baryshkov
2023-05-29 21:11     ` Marijn Suijten
2023-05-29 22:17       ` Dmitry Baryshkov
2023-05-29 22:36       ` Dmitry Baryshkov
2023-05-30  7:24       ` Neil Armstrong
2023-05-30  8:41         ` Marijn Suijten
2023-05-30  9:29           ` Konrad Dybcio
2023-05-30 11:44         ` RFC: DSI host capabilities (was: [PATCH RFC 03/10] drm/panel: Add LGD panel driver for Sony Xperia XZ3) Dmitry Baryshkov
2023-05-30 12:15           ` AngeloGioacchino Del Regno
2023-05-30 12:36             ` Dmitry Baryshkov
2023-05-30 15:44               ` Neil Armstrong
2023-05-31  8:02                 ` AngeloGioacchino Del Regno [this message]
2023-07-05 12:04               ` Maxime Ripard
2023-07-05 13:05                 ` Neil Armstrong
2023-07-05 13:29                   ` Maxime Ripard
2023-07-05 13:37                     ` Dmitry Baryshkov
2023-07-05 14:24                       ` Maxime Ripard
2023-07-05 15:20                         ` Dmitry Baryshkov
2023-07-05 16:53                           ` Maxime Ripard
2023-07-05 20:09                             ` Dmitry Baryshkov
2023-07-06  7:24                               ` Maxime Ripard
2023-07-06  7:33                                 ` Neil Armstrong
2023-07-06  7:59                                   ` Maxime Ripard
2023-07-06  8:03                                     ` Neil Armstrong
2023-07-05 15:58                         ` Neil Armstrong
2023-05-21 21:23 ` [PATCH RFC 04/10] arm64: dts: qcom: sdm845-akatsuki: Configure OLED panel Marijn Suijten
2023-05-21 21:23 ` [PATCH RFC 05/10] dt-bindings: display: panel: Describe Samsung SOFEF01-M Display-IC Marijn Suijten
2023-05-21 22:23   ` Rob Herring
2023-05-21 21:23 ` [PATCH RFC 06/10] drm/panel/samsung-sofef01: Add panel driver for Sony Xperia 5 / 10 II Marijn Suijten
2023-05-22  1:19   ` Dmitry Baryshkov
2023-05-22 16:30     ` Konrad Dybcio
2023-05-22 22:38       ` Marijn Suijten
2023-05-22 22:32     ` Marijn Suijten
2023-05-22 22:56       ` Dmitry Baryshkov
2023-05-29 20:58         ` Marijn Suijten
2023-05-29 22:20           ` Dmitry Baryshkov
2023-05-29 22:35             ` Marijn Suijten
2023-05-21 21:23 ` [PATCH RFC 07/10] dt-bindings: display: panel: Describe Samsung SOFEF03-M Display-IC Marijn Suijten
2023-06-08 19:43   ` Rob Herring
2023-05-21 21:23 ` [PATCH RFC 08/10] drm/panel/samsung-sofef03: Add panel driver for Sony Xperia 5 II Marijn Suijten
2023-05-22  1:23   ` Dmitry Baryshkov
2023-05-22  9:08     ` Neil Armstrong
2023-05-22 12:57       ` Dmitry Baryshkov
2023-05-29 21:21       ` Marijn Suijten
2023-05-29 21:29         ` Konrad Dybcio
2023-05-29 22:22           ` Dmitry Baryshkov
2023-05-29 22:33             ` Marijn Suijten
2023-05-22 16:31     ` Konrad Dybcio
2023-05-21 21:23 ` [PATCH RFC 09/10] dt-bindings: display: panel: Describe Sony Xperia 1 display Marijn Suijten
2023-05-21 22:23   ` Rob Herring
2023-05-21 21:23 ` [PATCH RFC 10/10] drm/panel/sony-griffin-samsung: Add panel driver for Sony Xperia 1 Marijn Suijten
2023-06-28  9:22   ` Linus Walleij
2023-06-28 14:20     ` Marijn Suijten
2023-06-28 19:18       ` Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=491055de-93f5-952e-4e37-9b00299a1d2d@collabora.com \
    --to=angelogioacchino.delregno@collabora.com \
    --cc=agross@kernel.org \
    --cc=airlied@gmail.com \
    --cc=andersson@kernel.org \
    --cc=angelogioacchino.delregno@somainline.org \
    --cc=caleb@connolly.tech \
    --cc=conor+dt@kernel.org \
    --cc=daniel@ffwll.ch \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=jami.kettunen@somainline.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marijn.suijten@somainline.org \
    --cc=martin.botka@somainline.org \
    --cc=neil.armstrong@linaro.org \
    --cc=quic_abhinavk@quicinc.com \
    --cc=quic_jesszhan@quicinc.com \
    --cc=quic_khsieh@quicinc.com \
    --cc=robh+dt@kernel.org \
    --cc=sam@ravnborg.org \
    --cc=~postmarketos/upstreaming@lists.sr.ht \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox