Re: [Freedreno] [v2, 11/12] drm/fbdev-generic: Implement dedicated fbdev I/O helpers

2023-05-17 Thread Thomas Zimmermann
Hi Am 17.05.23 um 03:58 schrieb Sui Jingfeng: Hi, Thomas After apply your patch set, the kernel with arch/loongarch/configs/loongson3_defconfig can not finish compile anymore.  gcc complains:   AR  drivers/gpu/built-in.a   AR  drivers/built-in.a   AR  built-in.a   AR 

Re: [Freedreno] [PATCH v6 6/8] drm/display/dsc: split DSC 1.2 and DSC 1.1 (pre-SCR) parameters

2023-05-17 Thread Dmitry Baryshkov
On 17/05/2023 06:10, Kandpal, Suraj wrote: The array of rc_parameters contains a mixture of parameters from DSC 1.1 and DSC 1.2 standards. Split these tow configuration arrays in preparation to adding more configuration data. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/display/drm_ds

[Freedreno] [PATCH v7 0/8] drm/i915: move DSC RC tables to drm_dsc_helper.c

2023-05-17 Thread Dmitry Baryshkov
Other platforms (msm) will benefit from sharing the DSC config setup functions. This series moves parts of static DSC config data from the i915 driver to the common helpers to be used by other drivers. Note: the RC parameters were cross-checked against config files found in DSC model 2021062, 2016

[Freedreno] [PATCH v7 1/8] drm/i915/dsc: change DSC param tables to follow the DSC model

2023-05-17 Thread Dmitry Baryshkov
After cross-checking DSC models (20150914, 20161212, 20210623) change values in rc_parameters tables to follow config files present inside the DSC model. Handle two places, where i915 tables diverged from the model, by patching the rc values in the code. Note: I left one case uncorrected, 8bpp/10b

[Freedreno] [PATCH v7 2/8] drm/i915/dsc: move rc_buf_thresh values to common helper

2023-05-17 Thread Dmitry Baryshkov
The rc_buf_thresh values are common to all DSC implementations. Move them to the common helper together with the code to propagate them to the drm_dsc_config. Reviewed-by: Jani Nikula Reviewed-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/display/drm_dsc_helper.c | 35

[Freedreno] [PATCH v7 3/8] drm/i915/dsc: move DSC tables to DRM DSC helper

2023-05-17 Thread Dmitry Baryshkov
Move DSC RC tables to DRM DSC helper. No additional code changes and/or cleanups are a part of this commit, it will be cleaned up in the followup commits. Reviewed-by: Jani Nikula Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/display/drm_dsc_helper.c | 372 ++ drivers

[Freedreno] [PATCH v7 6/8] drm/display/dsc: split DSC 1.2 and DSC 1.1 (pre-SCR) parameters

2023-05-17 Thread Dmitry Baryshkov
The array of rc_parameters contains a mixture of parameters from DSC 1.1 and DSC 1.2 standards. Split these tow configuration arrays in preparation to adding more configuration data. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/display/drm_dsc_helper.c | 139 ++ drive

[Freedreno] [PATCH v7 4/8] drm/i915/dsc: stop using interim structure for calculated params

2023-05-17 Thread Dmitry Baryshkov
Stop using an interim structure rc_parameters for storing calculated params and then setting drm_dsc_config using that structure. Instead put calculated params into the struct drm_dsc_config directly. Reviewed-by: Jani Nikula Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/i915/display/inte

[Freedreno] [PATCH v7 7/8] drm/display/dsc: include the rest of pre-SCR parameters

2023-05-17 Thread Dmitry Baryshkov
DSC model contains pre-SCR RC parameters for other bpp/bpc combinations, include them here for completeness. The values were generated from the 'pre_scr_cfg_files_for_reference' files found in DSC models 20210623. The same fileset is a part of DSC model 20161212. Reviewed-by: Jessica Zhang Signed

[Freedreno] [PATCH v7 5/8] drm/display/dsc: use flat array for rc_parameters lookup

2023-05-17 Thread Dmitry Baryshkov
Next commits are going to add support for additional RC parameter lookup tables. These tables are going to use different bpp/bpc combinations, thus it makes little sense to keep the 2d array for RC parameters. Switch to using the flat array. Reviewed-by: Jani Nikula Signed-off-by: Dmitry Baryshko

[Freedreno] [PATCH v7 8/8] drm/display/dsc: add YCbCr 4:2:2 and 4:2:0 RC parameters

2023-05-17 Thread Dmitry Baryshkov
Include RC parameters for YCbCr 4:2:2 and 4:2:0 configurations. Reviewed-by: Suraj Kandpal Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/display/drm_dsc_helper.c | 450 +++ include/drm/display/drm_dsc_helper.h | 2 + 2 files changed, 452 insertions(+) diff --git

Re: [Freedreno] [PATCH v7 6/8] drm/display/dsc: split DSC 1.2 and DSC 1.1 (pre-SCR) parameters

2023-05-17 Thread Kandpal, Suraj
> > The array of rc_parameters contains a mixture of parameters from DSC 1.1 > and DSC 1.2 standards. Split these tow configuration arrays in preparation to > adding more configuration data. > > Signed-off-by: Dmitry Baryshkov LGTM. Reviewed-by: Suraj Kandpal > --- > drivers/gpu/drm/display/

Re: [Freedreno] [PATCH v7 6/8] drm/display/dsc: split DSC 1.2 and DSC 1.1 (pre-SCR) parameters

2023-05-17 Thread Dmitry Baryshkov
On 17/05/2023 13:42, Kandpal, Suraj wrote: The array of rc_parameters contains a mixture of parameters from DSC 1.1 and DSC 1.2 standards. Split these tow configuration arrays in preparation to adding more configuration data. Signed-off-by: Dmitry Baryshkov LGTM. Reviewed-by: Suraj Kandpal

[Freedreno] [pull] drm/msm: drm-msm-fixes-2023-05-17 for v6.4-rc3

2023-05-17 Thread Rob Clark
Hi Dave, A few fixes for v6.4, summary below. One arm-smmu-qcom fix to un-break GPU per-process page-tables which was broken by a small refactor in arm-smmu-qcom. (Also added some WARN()s to make this sort of breakage more obvious in the future.) The following changes since commit ac7e7c9c65ecf

[Freedreno] [PATCH 0/6] Adreno QoL changes

2023-05-17 Thread Konrad Dybcio
/a6xx_gmu.c | 21 + drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 23 --- 2 files changed, 29 insertions(+), 15 deletions(-) --- base-commit: 065efa589871e93b6610c70c1e9de274ef1f1ba2 change-id: 20230517-topic-a7xx_prep-787a69c7d0ff Best regards, -- Konrad Dybcio

[Freedreno] [PATCH 2/6] drm/msm/a6xx: Skip empty protection ranges entries

2023-05-17 Thread Konrad Dybcio
Some specific SKUs leave certain protection range registers empty. Allow for that behavior. Signed-off-by: Konrad Dybcio --- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/m

[Freedreno] [PATCH 3/6] drm/msm/a6xx: Ensure clean GMU state in a6xx_gmu_fw_start

2023-05-17 Thread Konrad Dybcio
While it's not very well understood, there is some sort of a fault handler implemented in the GMU firmware which triggers when a certain bit is set, resulting in the M3 core not booting up the way we expect it to. Write a magic value to a magic register to hopefully prevent that from happening. S

[Freedreno] [PATCH 1/6] drm/msm/a6xx: Explain CP_PROTECT_CNTL writes in a6xx_set_cp_protect

2023-05-17 Thread Konrad Dybcio
We have the necessary information, so explain which bit does what. Signed-off-by: Konrad Dybcio --- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c inde

[Freedreno] [PATCH 6/6] drm/msm/a6xx: Fix up GMU region reservations

2023-05-17 Thread Konrad Dybcio
Change the order of region allocations to make the addresses match downstream. This shouldn't matter very much, but helps eliminate one more difference when comparing register accesses. Also, make the log region 16K long. That's what it is, unconditionally on A6xx and A7xx. Signed-off-by: Konrad

[Freedreno] [PATCH 5/6] drm/msm/a6xx: Use GMU_ALWAYS_ON_COUNTER for GMU-equipped GPUs in timestamp

2023-05-17 Thread Konrad Dybcio
Use the always-on counter provided by the GMU to skip having to keep the GPU online. Signed-off-by: Konrad Dybcio --- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/ad

[Freedreno] [PATCH 4/6] drm/msm/a6xx: Improve GMU force shutdown sequence

2023-05-17 Thread Konrad Dybcio
The GMU force shutdown sequence involves some additional register cleanup which was not implemented previously. Do so. Signed-off-by: Konrad Dybcio --- drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/driver

Re: [Freedreno] [PATCH v1 1/2] drm/msm/dp: enable HDP plugin/unplugged interrupts to hpd_enable/disable

2023-05-17 Thread Kuogee Hsieh
On 5/16/2023 4:20 PM, Dmitry Baryshkov wrote: On 17/05/2023 01:35, Abhinav Kumar wrote: On 5/16/2023 6:50 AM, Dmitry Baryshkov wrote: On 13/05/2023 00:28, Abhinav Kumar wrote: Hi Bjorn and Dmitry On 5/12/2023 12:34 PM, Kuogee Hsieh wrote: On 5/12/2023 10:28 AM, Dmitry Baryshkov wrote: O

Re: [Freedreno] [PATCH 5/6] drm/msm/a6xx: Use GMU_ALWAYS_ON_COUNTER for GMU-equipped GPUs in timestamp

2023-05-17 Thread Jonathan Marek
AFAIK GMU_ALWAYS_ON_COUNTER does not have the same value as CP_ALWAYS_ON_COUNTER (only the same frequency), so changing this would break userspace expecting to be able to compare the value returned by MSM_PARAM_TIMESTAMP with CP timestamp values. On 5/17/23 12:50 PM, Konrad Dybcio wrote: Use

Re: [Freedreno] [PATCH v1 1/2] drm/msm/dp: enable HDP plugin/unplugged interrupts to hpd_enable/disable

2023-05-17 Thread Dmitry Baryshkov
On Wed, 17 May 2023 at 20:42, Kuogee Hsieh wrote: > > > On 5/16/2023 4:20 PM, Dmitry Baryshkov wrote: > > On 17/05/2023 01:35, Abhinav Kumar wrote: > >> > >> > >> On 5/16/2023 6:50 AM, Dmitry Baryshkov wrote: > >>> On 13/05/2023 00:28, Abhinav Kumar wrote: > Hi Bjorn and Dmitry > >

[Freedreno] [PATCH v11 2/9] drm/display/dsc: add helper to set semi-const parameters

2023-05-17 Thread Jessica Zhang
From: Dmitry Baryshkov Add a helper setting config values which are typically constant across operating modes (table E-4 of the standard) and mux_word_size (which is a const according to 3.5.2). Signed-off-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Signed-off-by: Jessica Zhang --- driv

[Freedreno] [PATCH v11 5/9] drm/msm: Add MSM-specific DSC helper methods

2023-05-17 Thread Jessica Zhang
Introduce MSM-specific DSC helper methods, as some calculations are common between DP and DSC. Signed-off-by: Jessica Zhang --- drivers/gpu/drm/msm/msm_dsc_helper.h | 38 1 file changed, 38 insertions(+) diff --git a/drivers/gpu/drm/msm/msm_dsc_helper.h b/d

[Freedreno] [PATCH v11 0/9] Introduce MSM-specific DSC helpers

2023-05-17 Thread Jessica Zhang
There are some overlap in calculations for MSM-specific DSC variables between DP and DSI. In addition, the calculations for initial_scale_value and det_thresh_flatness that are defined within the DSC 1.2 specifications, but aren't yet included in drm_dsc_helper.c. This series moves these calculati

[Freedreno] [PATCH v11 7/9] drm/msm/dpu: Fix slice_last_group_size calculation

2023-05-17 Thread Jessica Zhang
Correct the math for slice_last_group_size so that it matches the calculations downstream. Fixes: c110cfd1753e ("drm/msm/disp/dpu1: Add support for DSC") Reviewed-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Signed-off-by: Jessica Zhang --- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.c | 5 ++

[Freedreno] [PATCH v11 6/9] drm/msm/dpu: Use fixed DRM DSC helper for det_thresh_flatness

2023-05-17 Thread Jessica Zhang
The current dpu_hw_dsc calculation for det_thresh_flatness does not match the downstream calculation or the DSC spec. Use the DRM DSC helper for det_thresh_flatness to match downstream implementation and the DSC spec. Fixes: c110cfd1753e ("drm/msm/disp/dpu1: Add support for DSC") Reviewed-by: Dmi

[Freedreno] [PATCH v11 8/9] drm/msm/dsi: Use MSM and DRM DSC helper methods

2023-05-17 Thread Jessica Zhang
Use MSM and DRM DSC helper methods to configure DSC for DSI. Reviewed-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Signed-off-by: Jessica Zhang --- drivers/gpu/drm/msm/dsi/dsi_host.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi_host

[Freedreno] [PATCH v11 9/9] drm/msm/dsi: update hdisplay calculation for dsi_timing_setup

2023-05-17 Thread Jessica Zhang
Currently, hdisplay is being divided by 3 for DSC. However, this calculation only works for cases where BPP = 8. Update hdisplay calculation to be bytes_per_line / 3, so that it accounts for cases where BPP != 8. Reviewed-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Signed-off-by: Jessica Z

[Freedreno] [PATCH v11 3/9] drm/display/dsc: Add drm_dsc_get_bpp_int helper

2023-05-17 Thread Jessica Zhang
Add helper to get the integer value of drm_dsc_config.bits_per_pixel Signed-off-by: Jessica Zhang --- include/drm/display/drm_dsc_helper.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/include/drm/display/drm_dsc_helper.h b/include/drm/display/drm_dsc_helper.h index ea99b0b90674..b

[Freedreno] [PATCH v11 1/9] drm/display/dsc: Add flatness and initial scale value calculations

2023-05-17 Thread Jessica Zhang
Add helpers to calculate det_thresh_flatness and initial_scale_value as these calculations are defined within the DSC spec. Signed-off-by: Jessica Zhang --- include/drm/display/drm_dsc_helper.h | 10 ++ 1 file changed, 10 insertions(+) diff --git a/include/drm/display/drm_dsc_helper.h

[Freedreno] [PATCH v11 4/9] drm/msm/dsi: use DRM DSC helpers for DSC setup

2023-05-17 Thread Jessica Zhang
From: Dmitry Baryshkov Use new DRM DSC helpers to setup DSI DSC configuration. The initial_scale_value needs to be adjusted according to the standard, but this is a separate change. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Signed-off-by: Jessica Zhang --- drivers/gpu/drm/ms

Re: [Freedreno] [PATCH 5/6] drm/msm/a6xx: Use GMU_ALWAYS_ON_COUNTER for GMU-equipped GPUs in timestamp

2023-05-17 Thread Konrad Dybcio
On 17.05.2023 20:09, Jonathan Marek wrote: > AFAIK GMU_ALWAYS_ON_COUNTER does not have the same value as > CP_ALWAYS_ON_COUNTER (only the same frequency), so changing this would break > userspace expecting to be able to compare the value returned by > MSM_PARAM_TIMESTAMP with CP timestamp val

Re: [Freedreno] [PATCH v11 8/9] drm/msm/dsi: Use MSM and DRM DSC helper methods

2023-05-17 Thread Marijn Suijten
On 2023-05-17 11:51:17, Jessica Zhang wrote: > > Use MSM and DRM DSC helper methods to configure DSC for DSI. > > Reviewed-by: Dmitry Baryshkov > Reviewed-by: Marijn Suijten > Signed-off-by: Jessica Zhang > --- > drivers/gpu/drm/msm/dsi/dsi_host.c | 7 --- > 1 file changed, 4 insertions(+

Re: [Freedreno] [PATCH v11 8/9] drm/msm/dsi: Use MSM and DRM DSC helper methods

2023-05-17 Thread Marijn Suijten
On 2023-05-17 21:13:36, Marijn Suijten wrote: > > On 2023-05-17 11:51:17, Jessica Zhang wrote: > > > > Use MSM and DRM DSC helper methods to configure DSC for DSI. > > > > Reviewed-by: Dmitry Baryshkov > > Reviewed-by: Marijn Suijten > > Signed-off-by: Jessica Zhang > > --- > > drivers/gpu/d

Re: [Freedreno] [PATCH v11 8/9] drm/msm/dsi: Use MSM and DRM DSC helper methods

2023-05-17 Thread Jessica Zhang
On 5/17/2023 12:25 PM, Marijn Suijten wrote: On 2023-05-17 21:13:36, Marijn Suijten wrote: On 2023-05-17 11:51:17, Jessica Zhang wrote: Use MSM and DRM DSC helper methods to configure DSC for DSI. Reviewed-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Signed-off-by: Jessica Zhang --

Re: [Freedreno] [PATCH v1 1/2] drm/msm/dp: enable HDP plugin/unplugged interrupts to hpd_enable/disable

2023-05-17 Thread Abhinav Kumar
On 5/17/2023 11:48 AM, Dmitry Baryshkov wrote: On Wed, 17 May 2023 at 20:42, Kuogee Hsieh wrote: On 5/16/2023 4:20 PM, Dmitry Baryshkov wrote: On 17/05/2023 01:35, Abhinav Kumar wrote: On 5/16/2023 6:50 AM, Dmitry Baryshkov wrote: On 13/05/2023 00:28, Abhinav Kumar wrote: Hi Bjorn an

Re: [Freedreno] [PATCH 5/6] drm/msm/a6xx: Use GMU_ALWAYS_ON_COUNTER for GMU-equipped GPUs in timestamp

2023-05-17 Thread Jonathan Marek
On 5/17/23 3:08 PM, Konrad Dybcio wrote: On 17.05.2023 20:09, Jonathan Marek wrote: AFAIK GMU_ALWAYS_ON_COUNTER does not have the same value as CP_ALWAYS_ON_COUNTER (only the same frequency), so changing this would break userspace expecting to be able to compare the value returned by MSM_PA

Re: [Freedreno] [PATCH v11 1/9] drm/display/dsc: Add flatness and initial scale value calculations

2023-05-17 Thread Marijn Suijten
On 2023-05-17 11:51:10, Jessica Zhang wrote: > Add helpers to calculate det_thresh_flatness and initial_scale_value as > these calculations are defined within the DSC spec. > > Signed-off-by: Jessica Zhang Was this r-b dropped because of changing the return types in v10->v11? Reviewed-by: Marij

Re: [Freedreno] [PATCH v11 2/9] drm/display/dsc: add helper to set semi-const parameters

2023-05-17 Thread Marijn Suijten
On 2023-05-17 11:51:11, Jessica Zhang wrote: > From: Dmitry Baryshkov > > Add a helper setting config values which are typically constant across > operating modes (table E-4 of the standard) and mux_word_size (which is > a const according to 3.5.2). > > Signed-off-by: Dmitry Baryshkov > Reviewe

Re: [Freedreno] [PATCH v11 3/9] drm/display/dsc: Add drm_dsc_get_bpp_int helper

2023-05-17 Thread Marijn Suijten
On 2023-05-17 11:51:12, Jessica Zhang wrote: > Add helper to get the integer value of drm_dsc_config.bits_per_pixel > > Signed-off-by: Jessica Zhang Seems fine, but folks might request to make int->integer to make it more clear that it returns the integer part, and/or add the commit body to a do

Re: [Freedreno] [PATCH v11 4/9] drm/msm/dsi: use DRM DSC helpers for DSC setup

2023-05-17 Thread Marijn Suijten
On 2023-05-17 11:51:13, Jessica Zhang wrote: > From: Dmitry Baryshkov > > Use new DRM DSC helpers to setup DSI DSC configuration. The > initial_scale_value needs to be adjusted according to the standard, but > this is a separate change. > > Signed-off-by: Dmitry Baryshkov > Reviewed-by: Abhinav

Re: [Freedreno] [PATCH v11 5/9] drm/msm: Add MSM-specific DSC helper methods

2023-05-17 Thread Marijn Suijten
On 2023-05-17 11:51:14, Jessica Zhang wrote: > Introduce MSM-specific DSC helper methods, as some calculations are > common between DP and DSC. > > Signed-off-by: Jessica Zhang > --- > drivers/gpu/drm/msm/msm_dsc_helper.h | 38 > > 1 file changed, 38 inserti

Re: [Freedreno] [PATCH v11 5/9] drm/msm: Add MSM-specific DSC helper methods

2023-05-17 Thread Jessica Zhang
On 5/17/2023 2:26 PM, Marijn Suijten wrote: On 2023-05-17 11:51:14, Jessica Zhang wrote: Introduce MSM-specific DSC helper methods, as some calculations are common between DP and DSC. Signed-off-by: Jessica Zhang --- drivers/gpu/drm/msm/msm_dsc_helper.h | 38 ++

Re: [Freedreno] [PATCH v11 1/9] drm/display/dsc: Add flatness and initial scale value calculations

2023-05-17 Thread Jessica Zhang
On 5/17/2023 2:13 PM, Marijn Suijten wrote: On 2023-05-17 11:51:10, Jessica Zhang wrote: Add helpers to calculate det_thresh_flatness and initial_scale_value as these calculations are defined within the DSC spec. Signed-off-by: Jessica Zhang Was this r-b dropped because of changing the re

Re: [Freedreno] [PATCH v11 2/9] drm/display/dsc: add helper to set semi-const parameters

2023-05-17 Thread Jessica Zhang
On 5/17/2023 2:15 PM, Marijn Suijten wrote: On 2023-05-17 11:51:11, Jessica Zhang wrote: From: Dmitry Baryshkov Add a helper setting config values which are typically constant across operating modes (table E-4 of the standard) and mux_word_size (which is a const according to 3.5.2). Signed

[Freedreno] [PATCH v10 0/8] add DSC 1.2 dpu supports

2023-05-17 Thread Kuogee Hsieh
This series adds the DPU side changes to support DSC 1.2 encoder. This was validated with both DSI DSC 1.2 panel and DP DSC 1.2 monitor. The DSI and DP parts will be pushed later on top of this change. This seriel is rebase on [1], [2] and catalog fixes from rev-4 of [3]. [1]: https://patchwork.fr

[Freedreno] [PATCH v10 1/8] drm/msm/dpu: add dsc blocks to the catalog of MSM8998 and SC8180X

2023-05-17 Thread Kuogee Hsieh
From: Abhinav Kumar Some platforms have DSC blocks which have not been declared in the catalog. Complete DSC 1.1 support for all platforms by adding the missing blocks to MSM8998 and SC8180X. Changes in v9: -- add MSM8998 and SC8180x to commit titil Changes in v10: -- fix grammar at commit text

[Freedreno] [PATCH v10 2/8] drm/msm/dpu: add DPU_PINGPONG_DSC feature bit for DPU < 7.0.0

2023-05-17 Thread Kuogee Hsieh
DPU < 7.0.0 requires the PINGPONG block to be involved during DSC setting up. Since DPU >= 7.0.0, enabling and starting the DSC encoder engine was moved to INTF with the help of the flush mechanism. Add a DPU_PINGPONG_DSC feature bit to restrict the availability of dpu_hw_pp_setup_dsc() and dpu_hw_

[Freedreno] [PATCH v10 4/8] drm/msm/dpu: Introduce PINGPONG_NONE to disconnect DSC from PINGPONG

2023-05-17 Thread Kuogee Hsieh
Disabling the crossbar mux between DSC and PINGPONG currently requires a bogus enum dpu_pingpong value to be passed when calling dsc_bind_pingpong_blk() with enable=false, even though the register value written is independent of the current PINGPONG block. Replace that `bool enable` parameter with

[Freedreno] [PATCH v10 3/8] drm/msm/dpu: Guard PINGPONG DSC ops behind DPU_PINGPONG_DSC bit

2023-05-17 Thread Kuogee Hsieh
DPU < 7.0.0 has DPU_PINGPONG_DSC feature bit set to indicate it requires both dpu_hw_pp_setup_dsc() and dpu_hw_pp_dsc_{enable,disable}() to be executed to complete DSC configuration if DSC hardware block is present. Hence test DPU_PINGPONG_DSC feature bit and assign DSC related functions to the ops

[Freedreno] [PATCH v10 5/8] drm/msm/dpu: add support for DSC encoder v1.2 engine

2023-05-17 Thread Kuogee Hsieh
Add support for DSC 1.2 by providing the necessary hooks to program the DPU DSC 1.2 encoder. Changes in v3: -- fixed kernel test rebot report that "__iomem *off" is declared but not used at dpu_hw_dsc_config_1_2() -- unrolling thresh loops Changes in v4: -- delete DPU_DSC_HW_REV_1_1 -- delete

[Freedreno] [PATCH v10 6/8] drm/msm/dpu: separate DSC flush update out of interface

2023-05-17 Thread Kuogee Hsieh
Currently DSC flushing happens during interface configuration at dpu_hw_ctl_intf_cfg_v1(). Separate DSC flush away from dpu_hw_ctl_intf_cfg_v1() by adding dpu_hw_ctl_update_pending_flush_dsc_v1() to handle both per-DSC engine and DSC flush bits at same time to make it consistent with the location o

[Freedreno] [PATCH v10 8/8] drm/msm/dpu: tear down DSC data path when DSC disabled

2023-05-17 Thread Kuogee Hsieh
Unset DSC_ACTIVE bit at dpu_hw_ctl_reset_intf_cfg_v1(), dpu_encoder_unprep_dsc() and dpu_encoder_dsc_pipe_clr() functions to tear down DSC data path if DSC data path was setup previous. Changes in V10: -- pass ctl directly instead of dpu_enc to dsc_pipe_cfg() -- move both dpu_encoder_unprep_dsc()

[Freedreno] [PATCH v10 7/8] drm/msm/dpu: add DSC 1.2 hw blocks for relevant chipsets

2023-05-17 Thread Kuogee Hsieh
From: Abhinav Kumar Add DSC 1.2 hardware blocks to the catalog with necessary sub-block and feature flag information. Each display compression engine (DCE) contains dual DSC encoders so both share same base address but with its own different sub block address. changes in v4: -- delete DPU_DSC_H

Re: [Freedreno] [PATCH v10 1/8] drm/msm/dpu: add dsc blocks to the catalog of MSM8998 and SC8180X

2023-05-17 Thread Marijn Suijten
DSC* in the title. On 2023-05-17 15:01:52, Kuogee Hsieh wrote: > From: Abhinav Kumar > > Some platforms have DSC blocks which have not been declared in the catalog. > Complete DSC 1.1 support for all platforms by adding the missing blocks to > MSM8998 and SC8180X. > > Changes in v9: > -- add MS

Re: [Freedreno] [PATCH v10 5/8] drm/msm/dpu: add support for DSC encoder v1.2 engine

2023-05-17 Thread Marijn Suijten
On 2023-05-17 15:01:56, Kuogee Hsieh wrote: > Add support for DSC 1.2 by providing the necessary hooks to program > the DPU DSC 1.2 encoder. > > Changes in v3: > -- fixed kernel test rebot report that "__iomem *off" is declared but not >used at dpu_hw_dsc_config_1_2() > -- unrolling thresh loo

[Freedreno] [PATCH v12 3/9] drm/display/dsc: Add drm_dsc_get_bpp_int helper

2023-05-17 Thread Jessica Zhang
Add helper to get the integer value of drm_dsc_config.bits_per_pixel Reviewed-by: Marijn Suijten Signed-off-by: Jessica Zhang --- include/drm/display/drm_dsc_helper.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/include/drm/display/drm_dsc_helper.h b/include/drm/display/drm_dsc_h

[Freedreno] [PATCH v12 0/9] Introduce MSM-specific DSC helpers

2023-05-17 Thread Jessica Zhang
There are some overlap in calculations for MSM-specific DSC variables between DP and DSI. In addition, the calculations for initial_scale_value and det_thresh_flatness that are defined within the DSC 1.2 specifications, but aren't yet included in drm_dsc_helper.c. This series moves these calculati

[Freedreno] [PATCH v12 4/9] drm/msm/dsi: use DRM DSC helpers for DSC setup

2023-05-17 Thread Jessica Zhang
From: Dmitry Baryshkov Use new DRM DSC helpers to setup DSI DSC configuration. The initial_scale_value needs to be adjusted according to the standard, but this is a separate change. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Reviewed-by: Marijn Suijten Signed-off-by: Jessica Z

[Freedreno] [PATCH v12 5/9] drm/msm: Add MSM-specific DSC helper methods

2023-05-17 Thread Jessica Zhang
Introduce MSM-specific DSC helper methods, as some calculations are common between DP and DSC. Signed-off-by: Jessica Zhang --- drivers/gpu/drm/msm/msm_dsc_helper.h | 38 1 file changed, 38 insertions(+) diff --git a/drivers/gpu/drm/msm/msm_dsc_helper.h b/d

[Freedreno] [PATCH v12 7/9] drm/msm/dpu: Fix slice_last_group_size calculation

2023-05-17 Thread Jessica Zhang
Correct the math for slice_last_group_size so that it matches the calculations downstream. Fixes: c110cfd1753e ("drm/msm/disp/dpu1: Add support for DSC") Reviewed-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Signed-off-by: Jessica Zhang --- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.c | 5 ++

[Freedreno] [PATCH v12 9/9] drm/msm/dsi: update hdisplay calculation for dsi_timing_setup

2023-05-17 Thread Jessica Zhang
Currently, hdisplay is being divided by 3 for DSC. However, this calculation only works for cases where BPP = 8. Update hdisplay calculation to be bytes_per_line / 3, so that it accounts for cases where BPP != 8. Reviewed-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Signed-off-by: Jessica Z

[Freedreno] [PATCH v12 2/9] drm/display/dsc: add helper to set semi-const parameters

2023-05-17 Thread Jessica Zhang
From: Dmitry Baryshkov Add a helper setting config values which are typically constant across operating modes (table E-4 of the standard) and mux_word_size (which is a const according to 3.5.2). Signed-off-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Signed-off-by: Jessica Zhang --- driv

[Freedreno] [PATCH v12 1/9] drm/display/dsc: Add flatness and initial scale value calculations

2023-05-17 Thread Jessica Zhang
Add helpers to calculate det_thresh_flatness and initial_scale_value as these calculations are defined within the DSC spec. Reviewed-by: Marijn Suijten Signed-off-by: Jessica Zhang --- include/drm/display/drm_dsc_helper.h | 10 ++ 1 file changed, 10 insertions(+) diff --git a/include/d

[Freedreno] [PATCH v12 8/9] drm/msm/dsi: Use MSM and DRM DSC helper methods

2023-05-17 Thread Jessica Zhang
Use MSM and DRM DSC helper methods to configure DSC for DSI. Reviewed-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Signed-off-by: Jessica Zhang --- drivers/gpu/drm/msm/dsi/dsi_host.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c

[Freedreno] [PATCH v12 6/9] drm/msm/dpu: Use fixed DRM DSC helper for det_thresh_flatness

2023-05-17 Thread Jessica Zhang
The current dpu_hw_dsc calculation for det_thresh_flatness does not match the downstream calculation or the DSC spec. Use the DRM DSC helper for det_thresh_flatness to match downstream implementation and the DSC spec. Fixes: c110cfd1753e ("drm/msm/disp/dpu1: Add support for DSC") Reviewed-by: Dmi

Re: [Freedreno] [PATCH v10 6/8] drm/msm/dpu: separate DSC flush update out of interface

2023-05-17 Thread Marijn Suijten
On 2023-05-17 15:01:57, Kuogee Hsieh wrote: > Currently DSC flushing happens during interface configuration at > dpu_hw_ctl_intf_cfg_v1(). Separate DSC flush away from > dpu_hw_ctl_intf_cfg_v1() by adding dpu_hw_ctl_update_pending_flush_dsc_v1() > to handle both per-DSC engine and DSC flush bits at

Re: [Freedreno] [PATCH v10 7/8] drm/msm/dpu: add DSC 1.2 hw blocks for relevant chipsets

2023-05-17 Thread Marijn Suijten
Title: "DPU >= 7.0" instead of "relevant chipsets" to match the others. On 2023-05-17 15:01:58, Kuogee Hsieh wrote: > From: Abhinav Kumar > > Add DSC 1.2 hardware blocks to the catalog with necessary sub-block and > feature flag information. Each display compression engine (DCE) contains > dual

Re: [Freedreno] [PATCH v10 8/8] drm/msm/dpu: tear down DSC data path when DSC disabled

2023-05-17 Thread Marijn Suijten
Title: Tear down DSC datapath* on encoder cleanup* On 2023-05-17 15:01:59, Kuogee Hsieh wrote: > Unset DSC_ACTIVE bit at dpu_hw_ctl_reset_intf_cfg_v1(), > dpu_encoder_unprep_dsc() and dpu_encoder_dsc_pipe_clr() functions > to tear down DSC data path if DSC data path was setup previous. > > Change

Re: [Freedreno] [PATCH v11 1/9] drm/display/dsc: Add flatness and initial scale value calculations

2023-05-17 Thread Marijn Suijten
On 2023-05-17 14:32:42, Jessica Zhang wrote: > > > On 5/17/2023 2:13 PM, Marijn Suijten wrote: > > On 2023-05-17 11:51:10, Jessica Zhang wrote: > >> Add helpers to calculate det_thresh_flatness and initial_scale_value as > >> these calculations are defined within the DSC spec. > >> > >> Signed-of

Re: [Freedreno] [PATCH v12 5/9] drm/msm: Add MSM-specific DSC helper methods

2023-05-17 Thread Marijn Suijten
On 2023-05-17 15:27:18, Jessica Zhang wrote: > Introduce MSM-specific DSC helper methods, as some calculations are > common between DP and DSC. > > Signed-off-by: Jessica Zhang > --- > drivers/gpu/drm/msm/msm_dsc_helper.h | 38 > > 1 file changed, 38 inserti

Re: [Freedreno] [PATCH v10 7/8] drm/msm/dpu: add DSC 1.2 hw blocks for relevant chipsets

2023-05-17 Thread Abhinav Kumar
On 5/17/2023 3:47 PM, Marijn Suijten wrote: Title: "DPU >= 7.0" instead of "relevant chipsets" to match the others. On 2023-05-17 15:01:58, Kuogee Hsieh wrote: From: Abhinav Kumar Add DSC 1.2 hardware blocks to the catalog with necessary sub-block and feature flag information. Each displa

Re: [Freedreno] [RFC PATCH v2 05/13] drm/msm/dpu: get rid of struct dpu_rm_requirements

2023-05-17 Thread Abhinav Kumar
On 5/14/2023 10:06 AM, Dmitry Baryshkov wrote: On Sat, 13 May 2023 at 01:39, Abhinav Kumar wrote: On 3/20/2023 6:18 PM, Dmitry Baryshkov wrote: The struct dpu_rm_requirements was used to wrap display topology and hw resources, which meant INTF indices. As of commit ef58e0ad3436 ("drm/msm/dp

Re: [Freedreno] [PATCH v12 5/9] drm/msm: Add MSM-specific DSC helper methods

2023-05-17 Thread Jessica Zhang
On 5/17/2023 4:01 PM, Marijn Suijten wrote: On 2023-05-17 15:27:18, Jessica Zhang wrote: Introduce MSM-specific DSC helper methods, as some calculations are common between DP and DSC. Signed-off-by: Jessica Zhang --- drivers/gpu/drm/msm/msm_dsc_helper.h | 38 ++

Re: [Freedreno] [PATCH v10 3/8] drm/msm/dpu: Guard PINGPONG DSC ops behind DPU_PINGPONG_DSC bit

2023-05-17 Thread Dmitry Baryshkov
On 18/05/2023 01:01, Kuogee Hsieh wrote: DPU < 7.0.0 has DPU_PINGPONG_DSC feature bit set to indicate it requires both dpu_hw_pp_setup_dsc() and dpu_hw_pp_dsc_{enable,disable}() to be executed to complete DSC configuration if DSC hardware block is present. Hence test DPU_PINGPONG_DSC feature bit

Re: [Freedreno] [PATCH v10 5/8] drm/msm/dpu: add support for DSC encoder v1.2 engine

2023-05-17 Thread Dmitry Baryshkov
On 18/05/2023 01:22, Marijn Suijten wrote: On 2023-05-17 15:01:56, Kuogee Hsieh wrote: Add support for DSC 1.2 by providing the necessary hooks to program the DPU DSC 1.2 encoder. Changes in v3: -- fixed kernel test rebot report that "__iomem *off" is declared but not used at dpu_hw_dsc_con

Re: [Freedreno] [PATCH v10 6/8] drm/msm/dpu: separate DSC flush update out of interface

2023-05-17 Thread Dmitry Baryshkov
On 18/05/2023 01:01, Kuogee Hsieh wrote: Currently DSC flushing happens during interface configuration at dpu_hw_ctl_intf_cfg_v1(). Separate DSC flush away from dpu_hw_ctl_intf_cfg_v1() by adding dpu_hw_ctl_update_pending_flush_dsc_v1() to handle both per-DSC engine and DSC flush bits at same tim

Re: [Freedreno] [PATCH v12 1/9] drm/display/dsc: Add flatness and initial scale value calculations

2023-05-17 Thread Dmitry Baryshkov
On 18/05/2023 01:27, Jessica Zhang wrote: Add helpers to calculate det_thresh_flatness and initial_scale_value as these calculations are defined within the DSC spec. Reviewed-by: Marijn Suijten Signed-off-by: Jessica Zhang --- include/drm/display/drm_dsc_helper.h | 10 ++ 1 file cha

Re: [Freedreno] [PATCH v12 3/9] drm/display/dsc: Add drm_dsc_get_bpp_int helper

2023-05-17 Thread Dmitry Baryshkov
On 18/05/2023 01:27, Jessica Zhang wrote: Add helper to get the integer value of drm_dsc_config.bits_per_pixel Reviewed-by: Marijn Suijten Signed-off-by: Jessica Zhang --- include/drm/display/drm_dsc_helper.h | 7 +++ 1 file changed, 7 insertions(+) Reviewed-by: Dmitry Baryshkov --

Re: [Freedreno] [PATCH v11 1/9] drm/display/dsc: Add flatness and initial scale value calculations

2023-05-17 Thread Dmitry Baryshkov
On 18/05/2023 01:58, Marijn Suijten wrote: On 2023-05-17 14:32:42, Jessica Zhang wrote: On 5/17/2023 2:13 PM, Marijn Suijten wrote: On 2023-05-17 11:51:10, Jessica Zhang wrote: Add helpers to calculate det_thresh_flatness and initial_scale_value as these calculations are defined within the D

[Freedreno] [PATCH v13 0/9] Introduce MSM-specific DSC helpers

2023-05-17 Thread Jessica Zhang
There are some overlap in calculations for MSM-specific DSC variables between DP and DSI. In addition, the calculations for initial_scale_value and det_thresh_flatness that are defined within the DSC 1.2 specifications, but aren't yet included in drm_dsc_helper.c. This series moves these calculati

[Freedreno] [PATCH v13 1/9] drm/display/dsc: Add flatness and initial scale value calculations

2023-05-17 Thread Jessica Zhang
Add helpers to calculate det_thresh_flatness and initial_scale_value as these calculations are defined within the DSC spec. Reviewed-by: Marijn Suijten Reviewed-by: Dmitry Baryshkov Signed-off-by: Jessica Zhang --- include/drm/display/drm_dsc_helper.h | 10 ++ 1 file changed, 10 insert

[Freedreno] [PATCH v13 6/9] drm/msm/dpu: Use fixed DRM DSC helper for det_thresh_flatness

2023-05-17 Thread Jessica Zhang
The current dpu_hw_dsc calculation for det_thresh_flatness does not match the downstream calculation or the DSC spec. Use the DRM DSC helper for det_thresh_flatness to match downstream implementation and the DSC spec. Fixes: c110cfd1753e ("drm/msm/disp/dpu1: Add support for DSC") Reviewed-by: Dmi

[Freedreno] [PATCH v13 2/9] drm/display/dsc: add helper to set semi-const parameters

2023-05-17 Thread Jessica Zhang
From: Dmitry Baryshkov Add a helper setting config values which are typically constant across operating modes (table E-4 of the standard) and mux_word_size (which is a const according to 3.5.2). Signed-off-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Signed-off-by: Jessica Zhang --- driv

[Freedreno] [PATCH v13 7/9] drm/msm/dpu: Fix slice_last_group_size calculation

2023-05-17 Thread Jessica Zhang
Correct the math for slice_last_group_size so that it matches the calculations downstream. Fixes: c110cfd1753e ("drm/msm/disp/dpu1: Add support for DSC") Reviewed-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Signed-off-by: Jessica Zhang --- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.c | 5 ++

[Freedreno] [PATCH v13 4/9] drm/msm/dsi: use DRM DSC helpers for DSC setup

2023-05-17 Thread Jessica Zhang
From: Dmitry Baryshkov Use new DRM DSC helpers to setup DSI DSC configuration. The initial_scale_value needs to be adjusted according to the standard, but this is a separate change. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Reviewed-by: Marijn Suijten Signed-off-by: Jessica Z

[Freedreno] [PATCH v13 3/9] drm/display/dsc: Add drm_dsc_get_bpp_int helper

2023-05-17 Thread Jessica Zhang
Add helper to get the integer value of drm_dsc_config.bits_per_pixel Reviewed-by: Marijn Suijten Reviewed-by: Dmitry Baryshkov Signed-off-by: Jessica Zhang --- include/drm/display/drm_dsc_helper.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/include/drm/display/drm_dsc_helper.h

[Freedreno] [PATCH v13 9/9] drm/msm/dsi: update hdisplay calculation for dsi_timing_setup

2023-05-17 Thread Jessica Zhang
Currently, hdisplay is being divided by 3 for DSC. However, this calculation only works for cases where BPP = 8. Update hdisplay calculation to be bytes_per_line / 3, so that it accounts for cases where BPP != 8. Reviewed-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Signed-off-by: Jessica Z

[Freedreno] [PATCH v13 5/9] drm/msm: Add MSM-specific DSC helper methods

2023-05-17 Thread Jessica Zhang
Introduce MSM-specific DSC helper methods, as some calculations are common between DP and DSC. Signed-off-by: Jessica Zhang --- drivers/gpu/drm/msm/msm_dsc_helper.h | 38 1 file changed, 38 insertions(+) diff --git a/drivers/gpu/drm/msm/msm_dsc_helper.h b/d

[Freedreno] [PATCH v13 8/9] drm/msm/dsi: Use MSM and DRM DSC helper methods

2023-05-17 Thread Jessica Zhang
Use MSM and DRM DSC helper methods to configure DSC for DSI. Reviewed-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Signed-off-by: Jessica Zhang --- drivers/gpu/drm/msm/dsi/dsi_host.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c