[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <617c8f8a-1fc7-c6a0-eaa5-ce75ff2adc1b@linaro.org>
Date: Tue, 30 May 2023 09:24:24 +0200
From: Neil Armstrong <neil.armstrong@...aro.org>
To: Marijn Suijten <marijn.suijten@...ainline.org>,
Dmitry Baryshkov <dmitry.baryshkov@...aro.org>,
Caleb Connolly <caleb@...nolly.tech>,
Jessica Zhang <quic_jesszhan@...cinc.com>
Cc: Sam Ravnborg <sam@...nborg.org>, David Airlie <airlied@...il.com>,
Daniel Vetter <daniel@...ll.ch>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Conor Dooley <conor+dt@...nel.org>,
Andy Gross <agross@...nel.org>,
Bjorn Andersson <andersson@...nel.org>,
~postmarketos/upstreaming@...ts.sr.ht,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@...ainline.org>,
Konrad Dybcio <konrad.dybcio@...aro.org>,
Martin Botka <martin.botka@...ainline.org>,
Jami Kettunen <jami.kettunen@...ainline.org>,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
devicetree@...r.kernel.org, linux-arm-msm@...r.kernel.org,
Abhinav Kumar <quic_abhinavk@...cinc.com>,
Kuogee Hsieh <quic_khsieh@...cinc.com>
Subject: Re: [PATCH RFC 03/10] drm/panel: Add LGD panel driver for Sony Xperia
XZ3
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 },
};
...
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.
We could alternatively match on the DSI controller's dsi->host->dev instead of the SoC root compatible.
Neil
>
>>> + drm_dsc_pps_payload_pack(&pps, ctx->dsi->dsc);
>>> +
>>> + ret = mipi_dsi_picture_parameter_set(ctx->dsi, &pps);
>>> + if (ret < 0) {
>>> + dev_err(panel->dev, "failed to transmit PPS: %d\n", ret);
>>> + goto fail;
>>> + }
>>> + ret = mipi_dsi_compression_mode(ctx->dsi, true);
>>> + if (ret < 0) {
>>> + dev_err(dev, "failed to enable compression mode: %d\n", ret);
>>> + goto fail;
>>> + }
>>> +
>>> + msleep(28);
>>> + }
>>> +
>>> + ctx->prepared = true;
>>> + return 0;
>>> +
>>> +fail:
>>> + gpiod_set_value_cansleep(ctx->reset_gpio, 0);
>>> + regulator_disable(ctx->vddio);
>>> + return ret;
>>> +}
> <snip>
>>> + /* This panel only supports DSC; unconditionally enable it */
>
> On that note I should perhaps reword this.
>
>>> + dsi->dsc = dsc = devm_kzalloc(&dsi->dev, sizeof(*dsc), GFP_KERNEL);
>>
>> I think double assignments are frowned upon.
>
> Ack.
>
>>
>>> + if (!dsc)
>>> + return -ENOMEM;
>>> +
>>> + dsc->dsc_version_major = 1;
>>> + dsc->dsc_version_minor = 1;
>>> +
>>> + dsc->slice_height = 32;
>>> + dsc->slice_count = 2;
>>> + // TODO: Get hdisplay from the mode
>>
>> Would you like to fix the TODO?
>
> I can't unless either migrating to drm_bridge (is that doable?) or
> expand drm_panel. That's a larger task, but I don't think this driver
> is the right place to track that desire. Should I drop the comment
> entirely or reword it?
>
>>> + WARN_ON(1440 % dsc->slice_count);
>>> + dsc->slice_width = 1440 / dsc->slice_count;
>
> <snip>
>
> - Marijn
Powered by blists - more mailing lists