Re: [Freedreno] [PATCH v2] drm/msm/dp: remove most of usbpd-related remains

2023-05-20 Thread Bjorn Andersson
On Sat, May 20, 2023 at 09:20:50PM +0300, Dmitry Baryshkov wrote: > Remove most of remains of downstream usbpd code. Mainline kernel uses > different approach for managing Type-C / USB-PD, so this remains unused. > > Signed-off-by: Dmitry Baryshkov Reviewed-by: Bjorn Andersson Regards, Bjorn

Re: [Freedreno] [PATCH 3/3] drm/msm/dp: Clean up pdev/dev duplication in dp_power

2023-05-20 Thread Bjorn Andersson
On Sat, May 20, 2023 at 04:26:59AM +0300, Dmitry Baryshkov wrote: > On 15/05/2023 06:02, Bjorn Andersson wrote: > > The dp_power module keeps track of both the DP controller's struct > > platform_device and struct device - with the prior pulled out of the > > dp_parser module. > > > > Clean up the

Re: [Freedreno] [PATCH v3 5/5] drm/msm/dsi: Remove incorrect references to slice_count

2023-05-20 Thread Dmitry Baryshkov
On 20/05/2023 00:17, Jessica Zhang wrote: Currently, slice_count is being used to calculate word count and pkt_per_line. In downstream, these values are calculated using slice per packet, which is not the same as slice_count. I'd say the reference to downstream is not correct. We have seen case

Re: [Freedreno] [PATCH v11 6/9] drm/msm/dpu: always clear every individual pending flush mask

2023-05-20 Thread Dmitry Baryshkov
On 19/05/2023 02:33, Kuogee Hsieh wrote: There are two tiers of pending flush control, main controller and individual hardware block. Currently only the main controller of flush mask is reset to 0 but leave out some individual pending flush mask of particular hardware block keep previous value at

Re: [Freedreno] [PATCH v4 0/9] drm: fdinfo memory stats

2023-05-20 Thread Dmitry Baryshkov
On 15/05/2023 17:30, Rob Clark wrote: From: Rob Clark Similar motivation to other similar recent attempt[1]. But with an attempt to have some shared code for this. As well as documentation. It is probably a bit UMA-centric, I guess devices with VRAM might want some placement stats as well.

Re: [Freedreno] [PATCH v4 9/9] drm/msm: Wire up comm/cmdline override for fdinfo

2023-05-20 Thread Dmitry Baryshkov
On 15/05/2023 17:30, Rob Clark wrote: From: Rob Clark Also store the override strings in drm_file so that fdinfo can display them. We still need to keep our original copy as we could need these override strings after the device file has been closed and drm_file freed. Signed-off-by: Rob Clark

Re: [Freedreno] [PATCH 31/53] drm/msm: Convert to platform remove callback returning void

2023-05-20 Thread Dmitry Baryshkov
On 07/05/2023 19:25, Uwe Kleine-König wrote: The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resou

Re: [Freedreno] [PATCH 02/11] drm/msm/dpu: use the actual lm maximum width instead of a hardcoded value

2023-05-20 Thread Dmitry Baryshkov
On 20/04/2023 20:47, Jeykumar Sankaran wrote: On 4/19/2023 3:23 PM, Dmitry Baryshkov wrote: On 19/04/2023 17:41, Arnaud Vrac wrote: This avoids using two LMs instead of one when the display width is lower than the maximum supported value. For example on MSM8996/MSM8998, the actual maxwidth is

[Freedreno] [PATCH v2 2/2] drm/msm/dsi: use mult_frac for pclk_bpp calculation

2023-05-20 Thread Dmitry Baryshkov
Simplify calculations around pixel_clk_rate division. Replace common pattern of doing 64-bit multiplication and then a do_div() call with simpler mult_frac() invocation. Reviewed-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/dsi/dsi_host.c | 11 --- 1 file c

[Freedreno] [PATCH v2 1/2] drm/msm/dsi: remove extra call to dsi_get_pclk_rate()

2023-05-20 Thread Dmitry Baryshkov
In dsi_calc_clk_rate_v2() there is no need to call dsi_get_pclk_rate(). This function has just been called (from dsi_calc_pclk()) and its result is stored at msm_host->pixel_clk_rate. Use this variable directly. Reviewed-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov --- Changes since v1:

[Freedreno] [PATCH v2] drm/msm/dp: remove most of usbpd-related remains

2023-05-20 Thread Dmitry Baryshkov
Remove most of remains of downstream usbpd code. Mainline kernel uses different approach for managing Type-C / USB-PD, so this remains unused. Signed-off-by: Dmitry Baryshkov --- Changes since v1: - Also drop USBPD callbacks as per [1]. [1] https://patchwork.freedesktop.org/patch/536942/?series

[Freedreno] [PATCH v7 16/18] drm/msm/a6xx: Use adreno_is_aXYZ macros in speedbin matching

2023-05-20 Thread Konrad Dybcio
Before transitioning to using per-SoC and not per-Adreno speedbin fuse values (need another patchset to land elsewhere), a good improvement/stopgap solution is to use adreno_is_aXYZ macros in place of explicit revision matching. Do so to allow differentiating between A619 and A619_holi. Reviewed-b

[Freedreno] [PATCH v7 18/18] drm/msm/a6xx: Add A610 speedbin support

2023-05-20 Thread Konrad Dybcio
A610 is implemented on at least three SoCs: SM6115 (bengal), SM6125 (trinket) and SM6225 (khaje). Trinket does not support speed binning (only a single SKU exists) and we don't yet support khaje upstream. Hence, add a fuse mapping table for bengal to allow for per-chip frequency limiting. Reviewed

[Freedreno] [PATCH v7 17/18] drm/msm/a6xx: Add A619_holi speedbin support

2023-05-20 Thread Konrad Dybcio
A619_holi is implemented on at least two SoCs: SM4350 (holi) and SM6375 (blair). This is what seems to be a first occurrence of this happening, but it's easy to overcome by guarding the SoC-specific fuse values with of_machine_is_compatible(). Do just that to enable frequency limiting on these SoCs

[Freedreno] [PATCH v7 11/18] drm/msm/adreno: Disable has_cached_coherent in GMU wrapper configurations

2023-05-20 Thread Konrad Dybcio
A610 and A619_holi don't support the feature. Disable it to make the GPU stop crashing after almost each and every submission - the received data on the GPU end was simply incomplete in garbled, resulting in almost nothing being executed properly. Extend the disablement to adreno_has_gmu_wrapper, a

[Freedreno] [PATCH v7 14/18] drm/msm/a6xx: Fix some A619 tunables

2023-05-20 Thread Konrad Dybcio
Adreno 619 expects some tunables to be set differently. Make up for it. Fixes: b7616b5c69e6 ("drm/msm/adreno: Add A619 support") Reviewed-by: Dmitry Baryshkov Signed-off-by: Konrad Dybcio --- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff

[Freedreno] [PATCH v7 15/18] drm/msm/a6xx: Use "else if" in GPU speedbin rev matching

2023-05-20 Thread Konrad Dybcio
The GPU can only be one at a time. Turn a series of ifs into if + elseifs to save some CPU cycles. Reviewed-by: Dmitry Baryshkov Signed-off-by: Konrad Dybcio --- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/msm

[Freedreno] [PATCH v7 13/18] drm/msm/a6xx: Add A610 support

2023-05-20 Thread Konrad Dybcio
A610 is one of (if not the) lowest-tier SKUs in the A6XX family. It features no GMU, as it's implemented solely on SoCs with SMD_RPM. What's more interesting is that it does not feature a VDDGX line either, being powered solely by VDDCX and has an unfortunate hardware quirk that makes its reset lin

[Freedreno] [PATCH v7 12/18] drm/msm/a6xx: Add support for A619_holi

2023-05-20 Thread Konrad Dybcio
A619_holi is a GMU-less variant of the already-supported A619 GPU. It's present on at least SM4350 (holi) and SM6375 (blair). No mesa changes are required. Add the required kernel-side support for it. Signed-off-by: Konrad Dybcio --- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 27 +

[Freedreno] [PATCH v7 10/18] drm/msm/a6xx: Introduce GMU wrapper support

2023-05-20 Thread Konrad Dybcio
Some (particularly SMD_RPM, a.k.a non-RPMh) SoCs implement A6XX GPUs but don't implement the associated GMUs. This is due to the fact that the GMU directly pokes at RPMh. Sadly, this means we have to take care of enabling & scaling power rails, clocks and bandwidth ourselves. Reuse existing Adreno

[Freedreno] [PATCH v7 07/18] drm/msm/a6xx: Add a helper for software-resetting the GPU

2023-05-20 Thread Konrad Dybcio
Introduce a6xx_gpu_sw_reset() in preparation for adding GMU wrapper GPUs and reuse it in a6xx_gmu_force_off(). This helper, contrary to the original usage in GMU code paths, adds a write memory barrier which together with the necessary delay should ensure that the reset is never deasserted too qui

[Freedreno] [PATCH v7 08/18] drm/msm/a6xx: Remove both GBIF and RBBM GBIF halt on hw init

2023-05-20 Thread Konrad Dybcio
Currently we're only deasserting REG_A6XX_RBBM_GBIF_HALT, but we also need REG_A6XX_GBIF_HALT to be set to 0. This is typically done automatically on successful GX collapse, but in case that fails, we should take care of it. Also, add a memory barrier to ensure it's gone through before jumping to

[Freedreno] [PATCH v7 09/18] drm/msm/a6xx: Extend and explain UBWC config

2023-05-20 Thread Konrad Dybcio
Rename lower_bit to hbb_lo and explain what it signifies. Add explanations (wherever possible to other tunables). Port setting min_access_length, ubwc_mode and hbb_hi from downstream. Reviewed-by: Rob Clark Signed-off-by: Konrad Dybcio --- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 39 +++

[Freedreno] [PATCH v7 05/18] drm/msm/a6xx: Move a6xx_bus_clear_pending_transactions to a6xx_gpu

2023-05-20 Thread Konrad Dybcio
This function is responsible for telling the GPU to halt transactions on all of its relevant buses, drain them and leave them in a predictable state, so that the GPU can be e.g. reset cleanly. Move the function to a6xx_gpu.c, remove the static keyword and add a prototype in a6xx_gpu.h to accomodat

[Freedreno] [PATCH v7 04/18] drm/msm/a6xx: Move force keepalive vote removal to a6xx_gmu_force_off()

2023-05-20 Thread Konrad Dybcio
As pointed out by Akhil during the review process of GMU wrapper introduction [1], it makes sense to move this write into the function that's responsible for forcibly shutting the GMU off. It is also very convenient to move this to GMU-specific code, so that it does not have to be guarded by an if

[Freedreno] [PATCH v7 06/18] drm/msm/a6xx: Improve a6xx_bus_clear_pending_transactions()

2023-05-20 Thread Konrad Dybcio
Unify the indentation and explain the cryptic 0xF value. Signed-off-by: Konrad Dybcio --- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c index 6bb4da

[Freedreno] [PATCH v7 03/18] drm/msm/a6xx: Remove static keyword from sptprac en/disable functions

2023-05-20 Thread Konrad Dybcio
These two will be reused by at least A619_holi in the non-gmu paths. Turn them non-static them to make it possible. Reviewed-by: Dmitry Baryshkov Signed-off-by: Konrad Dybcio --- drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 4 ++-- drivers/gpu/drm/msm/adreno/a6xx_gmu.h | 2 ++ 2 files changed, 4 ins

[Freedreno] [PATCH v7 01/18] dt-bindings: display/msm: gpu: Document GMU wrapper-equipped A6xx

2023-05-20 Thread Konrad Dybcio
The "GMU Wrapper" is Qualcomm's name for "let's treat the GPU blocks we'd normally assign to the GMU as if they were a part of the GMU, even though they are not". It's a (good) software representation of the GMU_CX and GMU_GX register spaces within the GPUSS that helps us programatically treat thes

[Freedreno] [PATCH v7 02/18] dt-bindings: display/msm/gmu: Add GMU wrapper

2023-05-20 Thread Konrad Dybcio
The "GMU Wrapper" is Qualcomm's name for "let's treat the GPU blocks we'd normally assign to the GMU as if they were a part of the GMU, even though they are not". It's a (good) software representation of the GMU_CX and GMU_GX register spaces within the GPUSS that helps us programatically treat thes

[Freedreno] [PATCH v7 00/18] GMU-less A6xx support (A610, A619_holi)

2023-05-20 Thread Konrad Dybcio
v6 -> v7: - Rebase on next-20230519 (A640/650 speedbin merged already) - separate out the .get_timestamp cb for gmu wrapper - check for gmu presence inside a6xx_llc_slices_(init|destroy) instead of before calling them - use REG_A6XX_RBBM_GPR0_CNTL instead of literal 0x18 - move a6xx_bus_clear

Re: [Freedreno] [PATCH 2/2] drm/msm/dsi: use mult_frac for pclk_bpp calculation

2023-05-20 Thread Marijn Suijten
On 2023-05-20 03:28:46, Dmitry Baryshkov wrote: > Simplify calculatoins around pixel_clk_rate division. Replace common calculations* > pattern of doing 64-bit multiplication and then a do_div() call with > simpler mult_frac call. > > Signed-off-by: Dmitry Baryshkov That's a cool function, I di

Re: [Freedreno] [PATCH 1/2] drm/msm/dsi: remove extra call to dsi_get_pclk_rate()

2023-05-20 Thread Marijn Suijten
On 2023-05-20 03:28:45, Dmitry Baryshkov wrote: > In dsi_calc_clk_rate_v2() there is no need to call dsi_get_pclk_rate(). > This functions has just been called and it's result is stored at function (drop -s) has just been called *inside dsi_calc_pclk()* it's -> its > msm_host->pixel_clk_rate. Use

Re: [Freedreno] [PATCH v3 1/5] msm/drm/dsi: Round up DSC hdisplay calculation

2023-05-20 Thread Marijn Suijten
On 2023-05-19 14:17:26, Jessica Zhang wrote: > Currently, when compression is enabled, hdisplay is reduced via integer > division. This causes issues for modes where the original hdisplay is > not a multiple of 3. > > To fix this, use DIV_ROUND_UP to divide hdisplay. > > Reported-by: Marijn Suijt