From: Abhinav Kumar <quic_abhinavk@quicinc.com>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
Kuogee Hsieh <quic_khsieh@quicinc.com>
Cc: <dri-devel@lists.freedesktop.org>, <robdclark@gmail.com>,
<sean@poorly.run>, <swboyd@chromium.org>, <dianders@chromium.org>,
<vkoul@kernel.org>, <daniel@ffwll.ch>, <airlied@gmail.com>,
<agross@kernel.org>, <andersson@kernel.org>,
<quic_sbillaka@quicinc.com>, <marijn.suijten@somainline.org>,
<freedreno@lists.freedesktop.org>,
<linux-arm-msm@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH 1/2] drm/msm/dpu: add dsc helper functions
Date: Sat, 25 Feb 2023 16:16:00 -0800 [thread overview]
Message-ID: <7650f183-9860-9074-e5d5-539afdf41248@quicinc.com> (raw)
In-Reply-To: <CAA8EJprowFyBMdW5QC2zG0gYUtxJ-hHXqhPfYTct2GzYJKLSHg@mail.gmail.com>
Hi Dmitry
On 2/24/2023 3:57 PM, Dmitry Baryshkov wrote:
> On Sat, 25 Feb 2023 at 01:51, Kuogee Hsieh <quic_khsieh@quicinc.com> wrote:
>>
>>
>> On 2/24/2023 1:13 PM, Dmitry Baryshkov wrote:
>>> On 24/02/2023 21:40, Kuogee Hsieh wrote:
>>>> Add DSC helper functions based on DSC configuration profiles to produce
>>>> DSC related runtime parameters through both table look up and runtime
>>>> calculation to support DSC on DPU.
>>>>
>>>> There are 6 different DSC configuration profiles are supported
>>>> currently.
>>>> DSC configuration profiles are differiented by 5 keys, DSC version
>>>> (V1.1),
>>>> chroma (444/422/420), colorspace (RGB/YUV), bpc(8/10),
>>>> bpp (6/7/7.5/8/9/10/12/15) and SCR (0/1).
>>>>
>>>> Only DSC version V1.1 added and V1.2 will be added later.
>>>
>>> These helpers should go to drivers/gpu/drm/display/drm_dsc_helper.c
>>> Also please check that they can be used for i915 or for amdgpu
>>> (ideally for both of them).
>>>
>>> I didn't check the tables against the standard (or against the current
>>> source code), will do that later.
>>>
>>>>
>>>> Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
>>>> ---
>>>> drivers/gpu/drm/msm/Makefile | 1 +
>>>> drivers/gpu/drm/msm/disp/dpu1/dpu_dsc_helper.c | 209
>>>> +++++++++++++++++++++++++
>>>> drivers/gpu/drm/msm/disp/dpu1/dpu_dsc_helper.h | 34 ++++
>>>> 3 files changed, 244 insertions(+)
>>>> create mode 100644 drivers/gpu/drm/msm/disp/dpu1/dpu_dsc_helper.c
>>>> create mode 100644 drivers/gpu/drm/msm/disp/dpu1/dpu_dsc_helper.h
>>>>
>>>> diff --git a/drivers/gpu/drm/msm/Makefile b/drivers/gpu/drm/msm/Makefile
>>>> index 7274c412..28cf52b 100644
>>>> --- a/drivers/gpu/drm/msm/Makefile
>>>> +++ b/drivers/gpu/drm/msm/Makefile
>>>> @@ -65,6 +65,7 @@ msm-$(CONFIG_DRM_MSM_DPU) += \
>>>> disp/dpu1/dpu_hw_catalog.o \
>>>> disp/dpu1/dpu_hw_ctl.o \
>>>> disp/dpu1/dpu_hw_dsc.o \
>>>> + disp/dpu1/dpu_dsc_helper.o \
>>>> disp/dpu1/dpu_hw_interrupts.o \
>>>> disp/dpu1/dpu_hw_intf.o \
>>>> disp/dpu1/dpu_hw_lm.o \
>>>> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_dsc_helper.c
>>>> b/drivers/gpu/drm/msm/disp/dpu1/dpu_dsc_helper.c
>>>> new file mode 100644
>>>> index 00000000..88207e9
>>>> --- /dev/null
>>>> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_dsc_helper.c
>>>> @@ -0,0 +1,209 @@
>>>> +// SPDX-License-Identifier: GPL-2.0-only
>>>> +/*
>>>> + * Copyright (c) 2023. Qualcomm Innovation Center, Inc. All rights
>>>> reserved
>>>> + */
>>>> +
>>>> +#include <drm/display/drm_dsc_helper.h>
>>>> +#include "msm_drv.h"
>>>> +#include "dpu_kms.h"
>>>> +#include "dpu_hw_dsc.h"
>>>> +#include "dpu_dsc_helper.h"
>>>> +
>>>> +
>>>
>>> Extra empty line
>>>
>>>> +#define DPU_DSC_PPS_SIZE 128
>>>> +
>>>> +enum dpu_dsc_ratio_type {
>>>> + DSC_V11_8BPC_8BPP,
>>>> + DSC_V11_10BPC_8BPP,
>>>> + DSC_V11_10BPC_10BPP,
>>>> + DSC_V11_SCR1_8BPC_8BPP,
>>>> + DSC_V11_SCR1_10BPC_8BPP,
>>>> + DSC_V11_SCR1_10BPC_10BPP,
>>>> + DSC_RATIO_TYPE_MAX
>>>> +};
>>>> +
>>>> +
>>>> +static u16 dpu_dsc_rc_buf_thresh[DSC_NUM_BUF_RANGES - 1] = {
>>>> + 0x0e, 0x1c, 0x2a, 0x38, 0x46, 0x54,
>>>> + 0x62, 0x69, 0x70, 0x77, 0x79, 0x7b, 0x7d, 0x7e
>>>
>>> Weird indentation
>>>
>>>> +};
>>>> +
>>>> +/*
>>>> + * Rate control - Min QP values for each ratio type in
>>>> dpu_dsc_ratio_type
>>>> + */
>>>> +static char
>>>> dpu_dsc_rc_range_min_qp[DSC_RATIO_TYPE_MAX][DSC_NUM_BUF_RANGES] = {
>>>> + /* DSC v1.1 */
>>>> + {0, 0, 1, 1, 3, 3, 3, 3, 3, 3, 5, 5, 5, 7, 13},
>>>> + {0, 4, 5, 5, 7, 7, 7, 7, 7, 7, 9, 9, 9, 11, 17},
>>>> + {0, 4, 5, 6, 7, 7, 7, 7, 7, 7, 9, 9, 9, 11, 15},
>>>> + /* DSC v1.1 SCR and DSC v1.2 RGB 444 */
>>>
>>> What is SCR? Is there any reason to use older min/max Qp params
>>> instead of always using the ones from the VESA-DSC-1.1 standard?
>>
>> Standards change request, some vendors may use scr to work with their panel.
>>
>> These table value are provided by system team.
>
> So, what will happen if we use values from 1.2 standard (aka 1.1 SCR
> 1) with the older panel?
>
Standards change request means fixing errors/errata for the given
standard. Those are typically released as a different spec.
So I referred the DSC 1.1 SCR spec, and it does have a few differences
in the table compared to DSC 1.1 which will get into DSC 1.2.
Hence the table entries are same between DSC 1.1 SCR and DSC 1.2
You are right, ideally DSC 1.2 should be backwards compatible with DSC
1.1 in terms of the values (thats what the spec says too) but I am not
sure if we can expect every panel/DP monitor to be forward compatible
without any SW change because it might need some firmware update (for
the panel) or SW update to support that especially during transitions of
the spec revisions (SCR to be precise).
Typically we do below for DP monitors exactly for the same reason:
DSC_ver_to_use = min(what_we_support, what_DP_monitor_supports) and use
that table.
For DSI panels, typically in the panel spec it should say whether the
SCR version needs to be used because we have seen that for some panels (
I dont remember exactly which one ) based on which panel and which
revision of the panel, it might not.
Thats why downstream started adding qcom,mdss-dsc-scr-version to the
devicetree.
>>>> + {0, 0, 1, 1, 3, 3, 3, 3, 3, 3, 5, 5, 5, 9, 12},
>>>> + {0, 4, 5, 5, 7, 7, 7, 7, 7, 7, 9, 9, 9, 13, 16},
>>>> + {0, 4, 5, 6, 7, 7, 7, 7, 7, 7, 9, 9, 9, 11, 15},
>
>
next prev parent reply other threads:[~2023-02-26 0:16 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-24 19:40 [RFC PATCH 0/2] Add DPU DSC helper module Kuogee Hsieh
2023-02-24 19:40 ` [RFC PATCH 1/2] drm/msm/dpu: add dsc helper functions Kuogee Hsieh
2023-02-24 21:13 ` Dmitry Baryshkov
2023-02-24 21:23 ` Abhinav Kumar
2023-02-24 21:36 ` Dmitry Baryshkov
2023-02-24 22:26 ` Abhinav Kumar
2023-02-24 23:53 ` Dmitry Baryshkov
2023-02-25 0:36 ` Abhinav Kumar
2023-02-25 15:23 ` Dmitry Baryshkov
2023-02-26 0:47 ` Abhinav Kumar
2023-02-26 13:09 ` Dmitry Baryshkov
2023-02-26 23:49 ` Abhinav Kumar
2023-02-27 12:45 ` Dmitry Baryshkov
2023-02-27 17:59 ` Abhinav Kumar
2023-02-27 19:25 ` Dmitry Baryshkov
2023-02-27 21:24 ` Abhinav Kumar
2023-03-16 1:28 ` [Freedreno] " Jessica Zhang
2023-03-16 16:03 ` Dmitry Baryshkov
2023-03-16 16:13 ` Abhinav Kumar
2023-03-16 16:23 ` Dmitry Baryshkov
2023-03-16 16:36 ` Abhinav Kumar
2023-03-16 23:40 ` Abhinav Kumar
2023-02-27 12:48 ` Jani Nikula
2023-02-24 23:51 ` Kuogee Hsieh
2023-02-24 23:57 ` Dmitry Baryshkov
2023-02-26 0:16 ` Abhinav Kumar [this message]
2023-02-26 13:13 ` Dmitry Baryshkov
2023-02-27 0:15 ` Abhinav Kumar
2023-02-27 12:33 ` Dmitry Baryshkov
2023-02-24 19:40 ` [RFC PATCH 2/2] drm/msm/dsi: use new dpu_dsc_populate_dsc_config() Kuogee Hsieh
2023-02-24 21:04 ` Dmitry Baryshkov
2023-02-24 21:09 ` Abhinav Kumar
2023-02-24 21:14 ` Dmitry Baryshkov
2023-02-24 21:24 ` Abhinav Kumar
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=7650f183-9860-9074-e5d5-539afdf41248@quicinc.com \
--to=quic_abhinavk@quicinc.com \
--cc=agross@kernel.org \
--cc=airlied@gmail.com \
--cc=andersson@kernel.org \
--cc=daniel@ffwll.ch \
--cc=dianders@chromium.org \
--cc=dmitry.baryshkov@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marijn.suijten@somainline.org \
--cc=quic_khsieh@quicinc.com \
--cc=quic_sbillaka@quicinc.com \
--cc=robdclark@gmail.com \
--cc=sean@poorly.run \
--cc=swboyd@chromium.org \
--cc=vkoul@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).