Re: [Freedreno] [PATCH 2/2] drm/bridge: lt9611: Do not generate HFP/HBP/HSA and EOT packet

2023-07-07 Thread Neil Armstrong
Hi, On 06/07/2023 11:20, Amit Pundir wrote: On Wed, 5 Jul 2023 at 11:09, Dmitry Baryshkov wrote: [Adding freedreno@ to cc list] On Wed, 5 Jul 2023 at 08:31, Jagan Teki wrote: Hi Amit, On Wed, Jul 5, 2023 at 10:15 AM Amit Pundir wrote: Hi Marek, On Wed, 5 Jul 2023 at 01:48, Marek Vasu

Re: [Freedreno] [PATCH 11/12] dt-bindings: drm/msm/gpu: Extend bindings for chip-id

2023-07-07 Thread Krzysztof Kozlowski
On 06/07/2023 23:10, Rob Clark wrote: > From: Rob Clark > > Upcoming GPUs use an opaque chip-id for identifying the GPU. Please use scripts/get_maintainers.pl to get a list of necessary people and lists to CC. It might happen, that command when run on an older kernel, gives you outdated entries.

Re: [Freedreno] [PATCH 2/2] drm/bridge: lt9611: Do not generate HFP/HBP/HSA and EOT packet

2023-07-07 Thread Neil Armstrong
On 07/07/2023 09:18, Neil Armstrong wrote: Hi, On 06/07/2023 11:20, Amit Pundir wrote: On Wed, 5 Jul 2023 at 11:09, Dmitry Baryshkov wrote: [Adding freedreno@ to cc list] On Wed, 5 Jul 2023 at 08:31, Jagan Teki wrote: Hi Amit, On Wed, Jul 5, 2023 at 10:15 AM Amit Pundir wrote: Hi Mar

Re: [Freedreno] [PATCH 11/12] dt-bindings: drm/msm/gpu: Extend bindings for chip-id

2023-07-07 Thread Rob Clark
On Fri, Jul 7, 2023 at 12:26 AM Krzysztof Kozlowski wrote: > > On 06/07/2023 23:10, Rob Clark wrote: > > From: Rob Clark > > > > Upcoming GPUs use an opaque chip-id for identifying the GPU. > > Please use scripts/get_maintainers.pl to get a list of necessary people > and lists to CC. It might hap

Re: [Freedreno] [PATCH] drm/msm: Check for the GPU IOMMU during bind

2023-07-07 Thread Jordan Crouse
On Thu, Jul 06, 2023 at 09:55:13PM +0300, Dmitry Baryshkov wrote: > > On 10/03/2023 00:20, Jordan Crouse wrote: > > While booting with amd,imageon on a headless target the GPU probe was > > failing with -ENOSPC in get_pages() from msm_gem.c. > > > > Investigation showed that the driver was using

Re: [Freedreno] [PATCH 05/12] drm/msm/adreno: Use quirk to identify cached-coherent support

2023-07-07 Thread Rob Clark
On Thu, Jul 6, 2023 at 7:29 PM Dmitry Baryshkov wrote: > > On 07/07/2023 00:10, Rob Clark wrote: > > From: Rob Clark > > > > It is better to explicitly list it. With the move to opaque chip-id's > > for future devices, we should avoid trying to infer things like > > generation from the numerical

Re: [Freedreno] [PATCH 12/12] drm/msm/adreno: Switch to chip-id for identifying GPU

2023-07-07 Thread Rob Clark
On Thu, Jul 6, 2023 at 5:25 PM Konrad Dybcio wrote: > > On 6.07.2023 23:10, Rob Clark wrote: > > From: Rob Clark > > > > Since the revision becomes an opaque identifier with future GPUs, move > > away from treating different ranges of bits as having a given meaning. > > This means that we need to

Re: [Freedreno] [PATCH] drm/msm: Check for the GPU IOMMU during bind

2023-07-07 Thread Dmitry Baryshkov
On 07/07/2023 18:03, Jordan Crouse wrote: On Thu, Jul 06, 2023 at 09:55:13PM +0300, Dmitry Baryshkov wrote: On 10/03/2023 00:20, Jordan Crouse wrote: While booting with amd,imageon on a headless target the GPU probe was failing with -ENOSPC in get_pages() from msm_gem.c. Investigation showed

[Freedreno] [PATCH v3 01/11] drm/msm/dpu: drop enum dpu_core_perf_data_bus_id

2023-07-07 Thread Dmitry Baryshkov
Drop the leftover of bus-client -> interconnect conversion, the enum dpu_core_perf_data_bus_id. Fixes: cb88482e2570 ("drm/msm/dpu: clean up references of DPU custom bus scaling") Reviewed-by: Konrad Dybcio Reviewed-by: Abhinav Kumar Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp

[Freedreno] [PATCH v3 00/11] drm/msm/dpu: cleanup dpu_core_perf module

2023-07-07 Thread Dmitry Baryshkov
Apply several cleanups to the DPU's core_perf module. Changes since v2: - Dropped perf tuning patches for now (Abhinav) - Restored kms variable assignment in dpu_core_perf_crtc_release_bw (LKP) - Fixed description for the last patch (Abhinav) Changes since v1: - Reworked overrides for the perf

[Freedreno] [PATCH v3 05/11] drm/msm/dpu: rework indentation in dpu_core_perf

2023-07-07 Thread Dmitry Baryshkov
dpu_core_perf.c contains several multi-line conditions which are hard to comprehent because of the indentation. Rework the identation of these conditions to make it easier to understand them. Reviewed-by: Abhinav Kumar Acked-by: Konrad Dybcio Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm

[Freedreno] [PATCH v3 03/11] drm/msm/dpu: core_perf: bail earlier if there are no ICC paths

2023-07-07 Thread Dmitry Baryshkov
Skip bandwidth aggregation and return early if there are no interconnect paths defined for the DPU device. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_c

[Freedreno] [PATCH v3 04/11] drm/msm/dpu: drop separate dpu_core_perf_tune overrides

2023-07-07 Thread Dmitry Baryshkov
The values in struct dpu_core_perf_tune are fixed per the core perf mode. Drop the 'tune' values and substitute them with known values when performing perf management. Note: min_bus_vote was not used at all, so it is just silently dropped. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm

[Freedreno] [PATCH v3 02/11] drm/msm/dpu: core_perf: extract bandwidth aggregation function

2023-07-07 Thread Dmitry Baryshkov
In preparation to refactoring the dpu_core_perf debugfs interface, extract the bandwidth aggregation function from _dpu_core_perf_crtc_update_bus(). Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 39 +++ 1 file changed, 22 insertions(+), 17 de

[Freedreno] [PATCH v3 06/11] drm/msm/dpu: drop the dpu_core_perf_crtc_update()'s stop_req param

2023-07-07 Thread Dmitry Baryshkov
The stop_req is true only in the dpu_crtc_disable() case, when crtc->enable has already been set to false. This renders the stop_req argument useless. Remove it completely. Reviewed-by: Abhinav Kumar Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 12 ++--

[Freedreno] [PATCH v3 08/11] drm/msm/dpu: remove unused fields from struct dpu_core_perf

2023-07-07 Thread Dmitry Baryshkov
Remove dpu_core_perf::dev and dpu_core_perf::debugfs_root fields, they are not used by the code. Reviewed-by: Konrad Dybcio Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 3 --- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h | 6 -- drivers/gpu/drm/msm/di

[Freedreno] [PATCH v3 09/11] drm/msm/dpu: core_perf: remove extra clk_round_rate() call

2023-07-07 Thread Dmitry Baryshkov
The dev_pm_opp_set_rate() already contains a call for clk_round_rate for the passed value. Stop calling it manually from _dpu_core_perf_get_core_clk_rate(). It is slightly incorrect to call it this way, as we should round the final calculated clock rate rather than rounding all the intermediate val

[Freedreno] [PATCH v3 07/11] drm/msm/dpu: use dpu_perf_cfg in DPU core_perf code

2023-07-07 Thread Dmitry Baryshkov
Simplify dpu_core_perf code by using only dpu_perf_cfg instead of using full-featured catalog data. Acked-by: Konrad Dybcio Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 73 --- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h | 8 +- drivers/

[Freedreno] [PATCH v3 11/11] drm/msm/dpu: drop dpu_core_perf_destroy()

2023-07-07 Thread Dmitry Baryshkov
This function does nothing, just clears one struct field. Drop it now. Acked-by: Konrad Dybcio Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 10 -- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h | 6 -- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c

[Freedreno] [PATCH v3 10/11] drm/msm/dpu: move max clock decision to dpu_kms.

2023-07-07 Thread Dmitry Baryshkov
dpu_core_perf should not make decisions on the maximum possible core clock rate. Pass the value from dpu_kms_hw_init(). Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 11 ++- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h | 8 ++-- drivers/gpu/drm

[Freedreno] [PATCH 00/13] drm/msm/dpu: use managed memory allocations

2023-07-07 Thread Dmitry Baryshkov
In a lots of places in DPU driver memory is allocated by using the kzalloc and then manually freed using kfree. However thes memory chunks have a well-defined life cycle. They are either a part of the driver's runtime and can be devm_kzalloc'ed or are exposed to userspace via the DRM objects and th

[Freedreno] [PATCH 02/13] drm/msm/dpu: remove IS_ERR_OR_NULL for dpu_hw_intr_init() error handling

2023-07-07 Thread Dmitry Baryshkov
Using IS_ERR_OR_NULL() together with PTR_ERR() is a typical mistake. If the value is NULL, then the function will return 0 instead of a proper return code. Replace IS_ERR_OR_NULL() with IS_ERR() in the dpu_hw_intr_init() error check. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/d

[Freedreno] [PATCH 01/13] drm/msm/dpu: cleanup dpu_kms_hw_init error path

2023-07-07 Thread Dmitry Baryshkov
It was noticed that dpu_kms_hw_init()'s error path contains several labels which point to the same code path. Replace all of them with a single label. Suggested-by: Konrad Dybcio Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 21 + 1 file chang

[Freedreno] [PATCH 03/13] drm/msm/dpu: use devres-managed allocation for interrupts data

2023-07-07 Thread Dmitry Baryshkov
Use devm_kzalloc to create interrupts data structure. This allows us to remove corresponding kfree and drop dpu_hw_intr_destroy() function. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c | 14 ++ drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.h

[Freedreno] [PATCH 04/13] drm/msm/dpu: use devres-managed allocation for VBIF data

2023-07-07 Thread Dmitry Baryshkov
Use devm_kzalloc to create VBIF data structure. This allows us to remove corresponding kfree and drop dpu_hw_intr_destroy() function. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_vbif.c | 14 ++ drivers/gpu/drm/msm/disp/dpu1/dpu_hw_vbif.h | 8 dr

[Freedreno] [PATCH 05/13] drm/msm/dpu: use devres-managed allocation for MDP TOP

2023-07-07 Thread Dmitry Baryshkov
Use devm_kzalloc to create MDP TOP structure. This allows us to remove corresponding kfree and drop dpu_hw_mdp_destroy() function. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_top.c | 17 +++-- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_top.h | 8 +--- driv

[Freedreno] [PATCH 08/13] drm/msm/dpu: remove QoS teardown on plane destruction

2023-07-07 Thread Dmitry Baryshkov
There is little point in disabling QoS on plane destruction: it happens during DPU device destruction process, after which there will be no running planes. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/driv

[Freedreno] [PATCH 10/13] drm/msm/dpu: use drmm-managed allocation for dpu_crtc

2023-07-07 Thread Dmitry Baryshkov
Change struct dpu_crtc allocation to use drmm_crtc_alloc_with_planes(). This removes the need to perform any actions on CRTC destruction. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 21 + 1 file changed, 5 insertions(+), 16 deletions(-) dif

[Freedreno] [PATCH 07/13] drm/msm/dpu: drop unused dpu_plane::lock

2023-07-07 Thread Dmitry Baryshkov
The field dpu_plane::lock was never used for protecting any kind of data. Drop it now. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1

[Freedreno] [PATCH 09/13] drm/msm/dpu: use drmm-managed allocation for dpu_plane

2023-07-07 Thread Dmitry Baryshkov
Change struct dpu_plane allocation to use drmm_universal_plane_alloc(). This removes the need to perform any actions on plane destruction. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 44 +-- 1 file changed, 9 insertions(+), 35 deletions(-)

[Freedreno] [PATCH 06/13] drm/msm/dpu: use devres-managed allocation for HW blocks

2023-07-07 Thread Dmitry Baryshkov
Use devm_kzalloc to create HW block structure. This allows us to remove corresponding kfree and drop all dpu_hw_*_destroy() functions as well as dpu_rm_destroy(), which becomes empty afterwards. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c| 19 ++-- drivers/

[Freedreno] [PATCH 12/13] drm/msm/dpu: drop dpu_encoder_phys_ops::destroy

2023-07-07 Thread Dmitry Baryshkov
Drop the dpu_encoder_phys_ops' destroy() callback. No phys backend implements it anymore, so it is useless. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c| 18 -- .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h | 2 -- 2 files changed, 20 dele

[Freedreno] [PATCH 11/13] drm/msm/dpu: use drmm-managed allocation for dpu_encoder_phys

2023-07-07 Thread Dmitry Baryshkov
Change struct allocation of encoder's phys backend data to use drmm_kzalloc(). This removes the need to perform any actions on encoder destruction. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 9 .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h | 8

[Freedreno] [PATCH 13/13] drm/msm/dpu: use drmm-managed allocation for dpu_encoder_virt

2023-07-07 Thread Dmitry Baryshkov
It is incorrect to use devm-managed memory allocations for DRM data structures exposed to userspace. They should use drmm_ allocations. Change struct dpu_encoder allocation to use drmm_encoder_alloc(). This removes the need to perform any actions on encoder destruction. Signed-off-by: Dmitry Barys

Re: [Freedreno] [PATCH v4 6/6] drm/msm/dpu: Update dev core dump to dump registers of sub-blocks

2023-07-07 Thread Ryan McCann
My apologies for the private email, I hit reply instead of reply all by accident. On 7/6/2023 5:24 PM, Dmitry Baryshkov wrote: On 06/07/2023 23:48, Ryan McCann wrote: Currently, the device core dump mechanism does not dump registers of sub-blocks within the DSPP, SSPP, DSC, and PINGPONG blocks

Re: [Freedreno] [PATCH v4 6/6] drm/msm/dpu: Update dev core dump to dump registers of sub-blocks

2023-07-07 Thread Dmitry Baryshkov
On Fri, 7 Jul 2023 at 23:49, Ryan McCann wrote: > > My apologies for the private email, I hit reply instead of reply all by > accident. No problem, it happens sometimes. > > On 7/6/2023 5:24 PM, Dmitry Baryshkov wrote: > > On 06/07/2023 23:48, Ryan McCann wrote: > >> Currently, the device core d

[Freedreno] [PATCH v2 00/13] drm/msm/dpu: use managed memory allocations

2023-07-07 Thread Dmitry Baryshkov
Please excuse me for sending v2 on the same day, it fixes erorr paths for drmm allocation code. In a lots of places in DPU driver memory is allocated by using the kzalloc and then manually freed using kfree. However thes memory chunks have a well-defined life cycle. They are either a part of the d

[Freedreno] [PATCH v2 01/13] drm/msm/dpu: cleanup dpu_kms_hw_init error path

2023-07-07 Thread Dmitry Baryshkov
It was noticed that dpu_kms_hw_init()'s error path contains several labels which point to the same code path. Replace all of them with a single label. Suggested-by: Konrad Dybcio Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 21 + 1 file chang

[Freedreno] [PATCH v2 02/13] drm/msm/dpu: remove IS_ERR_OR_NULL for dpu_hw_intr_init() error handling

2023-07-07 Thread Dmitry Baryshkov
Using IS_ERR_OR_NULL() together with PTR_ERR() is a typical mistake. If the value is NULL, then the function will return 0 instead of a proper return code. Replace IS_ERR_OR_NULL() with IS_ERR() in the dpu_hw_intr_init() error check. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/d

[Freedreno] [PATCH v2 03/13] drm/msm/dpu: use devres-managed allocation for interrupts data

2023-07-07 Thread Dmitry Baryshkov
Use devm_kzalloc to create interrupts data structure. This allows us to remove corresponding kfree and drop dpu_hw_intr_destroy() function. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c | 14 ++ drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.h

[Freedreno] [PATCH v2 07/13] drm/msm/dpu: drop unused dpu_plane::lock

2023-07-07 Thread Dmitry Baryshkov
The field dpu_plane::lock was never used for protecting any kind of data. Drop it now. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1

[Freedreno] [PATCH v2 05/13] drm/msm/dpu: use devres-managed allocation for MDP TOP

2023-07-07 Thread Dmitry Baryshkov
Use devm_kzalloc to create MDP TOP structure. This allows us to remove corresponding kfree and drop dpu_hw_mdp_destroy() function. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_top.c | 17 +++-- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_top.h | 8 +--- driv

[Freedreno] [PATCH v2 04/13] drm/msm/dpu: use devres-managed allocation for VBIF data

2023-07-07 Thread Dmitry Baryshkov
Use devm_kzalloc to create VBIF data structure. This allows us to remove corresponding kfree and drop dpu_hw_intr_destroy() function. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_vbif.c | 14 ++ drivers/gpu/drm/msm/disp/dpu1/dpu_hw_vbif.h | 8 dr

[Freedreno] [PATCH v2 06/13] drm/msm/dpu: use devres-managed allocation for HW blocks

2023-07-07 Thread Dmitry Baryshkov
Use devm_kzalloc to create HW block structure. This allows us to remove corresponding kfree and drop all dpu_hw_*_destroy() functions as well as dpu_rm_destroy(), which becomes empty afterwards. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c| 19 ++-- drivers/

[Freedreno] [PATCH v2 08/13] drm/msm/dpu: remove QoS teardown on plane destruction

2023-07-07 Thread Dmitry Baryshkov
There is little point in disabling QoS on plane destruction: it happens during DPU device destruction process, after which there will be no running planes. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/driv

[Freedreno] [PATCH v2 09/13] drm/msm/dpu: use drmm-managed allocation for dpu_plane

2023-07-07 Thread Dmitry Baryshkov
Change struct dpu_plane allocation to use drmm_universal_plane_alloc(). This removes the need to perform any actions on plane destruction. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 46 +-- 1 file changed, 10 insertions(+), 36 deletions(-)

[Freedreno] [PATCH v2 10/13] drm/msm/dpu: use drmm-managed allocation for dpu_crtc

2023-07-07 Thread Dmitry Baryshkov
Change struct dpu_crtc allocation to use drmm_crtc_alloc_with_planes(). This removes the need to perform any actions on CRTC destruction. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 25 +++- 1 file changed, 7 insertions(+), 18 deletions(-)

[Freedreno] [PATCH v2 11/13] drm/msm/dpu: use drmm-managed allocation for dpu_encoder_phys

2023-07-07 Thread Dmitry Baryshkov
Change struct allocation of encoder's phys backend data to use drmm_kzalloc(). This removes the need to perform any actions on encoder destruction. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 9 .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h | 8

[Freedreno] [PATCH v2 12/13] drm/msm/dpu: drop dpu_encoder_phys_ops::destroy

2023-07-07 Thread Dmitry Baryshkov
Drop the dpu_encoder_phys_ops' destroy() callback. No phys backend implements it anymore, so it is useless. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c| 18 -- .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h | 2 -- 2 files changed, 20 dele

[Freedreno] [PATCH v2 13/13] drm/msm/dpu: use drmm-managed allocation for dpu_encoder_virt

2023-07-07 Thread Dmitry Baryshkov
It is incorrect to use devm-managed memory allocations for DRM data structures exposed to userspace. They should use drmm_ allocations. Change struct dpu_encoder allocation to use drmm_encoder_alloc(). This removes the need to perform any actions on encoder destruction. Signed-off-by: Dmitry Barys

Re: [Freedreno] [PATCH 01/13] drm/msm/dpu: cleanup dpu_kms_hw_init error path

2023-07-07 Thread Konrad Dybcio
On 7.07.2023 22:37, Dmitry Baryshkov wrote: > It was noticed that dpu_kms_hw_init()'s error path contains several > labels which point to the same code path. Replace all of them with a > single label. > > Suggested-by: Konrad Dybcio it's the first time I'm seeing this code Konrad > Signed-off-by

Re: [Freedreno] [PATCH 01/13] drm/msm/dpu: cleanup dpu_kms_hw_init error path

2023-07-07 Thread Dmitry Baryshkov
On 08/07/2023 02:25, Konrad Dybcio wrote: On 7.07.2023 22:37, Dmitry Baryshkov wrote: It was noticed that dpu_kms_hw_init()'s error path contains several labels which point to the same code path. Replace all of them with a single label. Suggested-by: Konrad Dybcio it's the first time I'm seei

[Freedreno] [PATCH v1 0/5] incorporate pm runtime framework and eDP clean up

2023-07-07 Thread Kuogee Hsieh
Incorporate pm runtime framework into DP driver and clean up eDP by moving of_dp_aux_populate_bus() to probe() Kuogee Hsieh (5): drm/msm/dp: remove pm_runtime_xxx() from dp_power.c drm/msm/dp: incorporate pm_runtime framework into DP driver drm/msm/dp: delete EV_HPD_INIT_SETUP drm/msm/dp:

Re: [Freedreno] [PATCH 09/12] drm/msm/adreno: Add adreno family

2023-07-07 Thread Rob Clark
On Thu, Jul 6, 2023 at 8:16 PM Dmitry Baryshkov wrote: > > On 07/07/2023 02:35, Konrad Dybcio wrote: > > On 6.07.2023 23:10, Rob Clark wrote: > >> From: Rob Clark > >> > >> Sometimes it is useful to know the sub-generation (or "family"). And in > >> any case, this helps us get away from infering

[Freedreno] [PATCH v1 1/5] drm/msm/dp: remove pm_runtime_xxx() from dp_power.c

2023-07-07 Thread Kuogee Hsieh
Since both pm_runtime_resume() and pm_runtime_suspend() are not populated at dp_pm_ops. Those pm_runtime_get/put() functions within dp_power.c will not have any effects in addition to increase/decrease power counter. Also pm_runtime_xxx() should be executed at top layer. Signed-off-by: Kuogee Hsie

[Freedreno] [PATCH v1 4/5] drm/msm/dp: move relevant dp initialization code from bind() to probe()

2023-07-07 Thread Kuogee Hsieh
In preparation of moving edp of_dp_aux_populate_bus() to dp_display_probe(), move dp_display_request_irq(), dp->parser->parse() and dp_power_client_init() to dp_display_probe() too. Signed-off-by: Kuogee Hsieh --- drivers/gpu/drm/msm/dp/dp_display.c | 48 + dr

[Freedreno] [PATCH v1 3/5] drm/msm/dp: delete EV_HPD_INIT_SETUP

2023-07-07 Thread Kuogee Hsieh
EV_HPD_INIT_SETUP flag is used to trigger the initialization of external DP host controller. Since external DP host controller initialization had been incorporated into pm_runtime_resume(), this flag become obsolete. Lets get rid of it. Signed-off-by: Kuogee Hsieh --- drivers/gpu/drm/msm/dp/dp_d

[Freedreno] [PATCH v1 2/5] drm/msm/dp: incorporate pm_runtime framework into DP driver

2023-07-07 Thread Kuogee Hsieh
Incorporating pm runtime framework into DP driver so that power and clock resource handling can be centralized allowing easier control of these resources in preparation of registering aux bus uring probe. Signed-off-by: Kuogee Hsieh --- drivers/gpu/drm/msm/dp/dp_aux.c | 3 ++ drivers/gpu/dr

[Freedreno] [PATCH v1 5/5] drm/msm/dp: move of_dp_aux_populate_bus() to probe for eDP

2023-07-07 Thread Kuogee Hsieh
Move of_dp_aux_populate_bus() to dp_display_probe() for eDP from dp_display_bind() so that probe deferral cases can be handled effectively Signed-off-by: Kuogee Hsieh --- drivers/gpu/drm/msm/dp/dp_aux.c | 25 drivers/gpu/drm/msm/dp/dp_display.c | 79 +++--

Re: [Freedreno] [PATCH 09/12] drm/msm/adreno: Add adreno family

2023-07-07 Thread Dmitry Baryshkov
On 08/07/2023 02:52, Rob Clark wrote: On Thu, Jul 6, 2023 at 8:16 PM Dmitry Baryshkov wrote: On 07/07/2023 02:35, Konrad Dybcio wrote: On 6.07.2023 23:10, Rob Clark wrote: From: Rob Clark Sometimes it is useful to know the sub-generation (or "family"). And in any case, this helps us get a

Re: [Freedreno] [PATCH v1 2/5] drm/msm/dp: incorporate pm_runtime framework into DP driver

2023-07-07 Thread Dmitry Baryshkov
On 08/07/2023 02:52, Kuogee Hsieh wrote: Incorporating pm runtime framework into DP driver so that power and clock resource handling can be centralized allowing easier control of these resources in preparation of registering aux bus uring probe. Signed-off-by: Kuogee Hsieh --- drivers/gpu/drm

Re: [Freedreno] [PATCH v1 1/5] drm/msm/dp: remove pm_runtime_xxx() from dp_power.c

2023-07-07 Thread Dmitry Baryshkov
On 08/07/2023 02:52, Kuogee Hsieh wrote: Since both pm_runtime_resume() and pm_runtime_suspend() are not populated at dp_pm_ops. Those pm_runtime_get/put() functions within dp_power.c will not have any effects in addition to increase/decrease power counter. Lie. Also pm_runtime_xxx() should b

Re: [Freedreno] [PATCH v1 3/5] drm/msm/dp: delete EV_HPD_INIT_SETUP

2023-07-07 Thread Dmitry Baryshkov
On 08/07/2023 02:52, Kuogee Hsieh wrote: EV_HPD_INIT_SETUP flag is used to trigger the initialization of external DP host controller. Since external DP host controller initialization had been incorporated into pm_runtime_resume(), this flag become obsolete. Lets get rid of it. Signed-off-by: Kuo

Re: [Freedreno] [PATCH v1 4/5] drm/msm/dp: move relevant dp initialization code from bind() to probe()

2023-07-07 Thread Dmitry Baryshkov
On 08/07/2023 02:52, Kuogee Hsieh wrote: In preparation of moving edp of_dp_aux_populate_bus() to dp_display_probe(), move dp_display_request_irq(), dp->parser->parse() and dp_power_client_init() to dp_display_probe() too. Signed-off-by: Kuogee Hsieh --- drivers/gpu/drm/msm/dp/dp_display.c |

Re: [Freedreno] [PATCH v1 5/5] drm/msm/dp: move of_dp_aux_populate_bus() to probe for eDP

2023-07-07 Thread Dmitry Baryshkov
On 08/07/2023 02:52, Kuogee Hsieh wrote: Move of_dp_aux_populate_bus() to dp_display_probe() for eDP from dp_display_bind() so that probe deferral cases can be handled effectively Signed-off-by: Kuogee Hsieh --- drivers/gpu/drm/msm/dp/dp_aux.c | 25 drivers/gpu/drm/msm/dp/dp

Re: [Freedreno] [PATCH v1 3/5] drm/msm/dp: delete EV_HPD_INIT_SETUP

2023-07-07 Thread Dmitry Baryshkov
On 08/07/2023 02:52, Kuogee Hsieh wrote: EV_HPD_INIT_SETUP flag is used to trigger the initialization of external DP host controller. Since external DP host controller initialization had been incorporated into pm_runtime_resume(), this flag become obsolete. Lets get rid of it. And another quest

Re: [Freedreno] [PATCH v1 0/5] incorporate pm runtime framework and eDP clean up

2023-07-07 Thread Dmitry Baryshkov
On 08/07/2023 02:52, Kuogee Hsieh wrote: Incorporate pm runtime framework into DP driver and clean up eDP by moving of_dp_aux_populate_bus() to probe() Please use sensible prefix for cover letters too. It helps people understand, which driver/area is touched by the patchset. Kuogee Hsieh (

[Freedreno] [PATCH 02/17] drm/msm/mdp5: use devres-managed allocation for configuration data

2023-07-07 Thread Dmitry Baryshkov
Use devm_kzalloc to create configuration data structure. This allows us to remove corresponding kfree and drop mdp5_cfg_destroy() function. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c | 24 +--- drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.h | 1 -

[Freedreno] [PATCH 01/17] drm/msm: add arrays listing formats supported by MDP4/MDP5 hardware

2023-07-07 Thread Dmitry Baryshkov
MDP4 and MDP5 drivers enumerate supported formats each time the plane is created. As the list of supported image formats is constant, create corresponding data arrays to be used by MDP4 and MDP5 drivers. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/mdp_format.c | 49 +

[Freedreno] [PATCH 03/17] drm/msm/mdp5: use devres-managed allocation for CTL manager data

2023-07-07 Thread Dmitry Baryshkov
Use devm_kzalloc to create CTL manager data structure. This allows us to remove corresponding kfree and drop mdp5_ctlm_destroy() function. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/mdp5/mdp5_ctl.c | 21 - drivers/gpu/drm/msm/disp/mdp5/mdp5_ctl.h | 1 - dri

[Freedreno] [PATCH 00/17] drm/msm/mdp[45]: use managed memory allocations

2023-07-07 Thread Dmitry Baryshkov
Follow the DPU patchset ([1]) and use devm_ and drmm_ functions to allocate long-living data structures in mdp4 and mdp5 drivers. [1] https://patchwork.freedesktop.org/series/120366/ Dmitry Baryshkov (17): drm/msm: add arrays listing formats supported by MDP4/MDP5 hardware drm/msm/mdp5: use d

[Freedreno] [PATCH 07/17] drm/msm/mdp5: use devres-managed allocation for INTF data

2023-07-07 Thread Dmitry Baryshkov
Use devm_kzalloc to create INTF data structure. This allows us to remove corresponding kfree() call. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c b/

[Freedreno] [PATCH 09/17] drm/msm/mdp5: use drmm-managed allocation for mdp5_encoder

2023-07-07 Thread Dmitry Baryshkov
Change struct mdp5_encoder allocation to use drmm_encoder_alloc(). This removes the need to perform any actions on encoder destruction. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/mdp5/mdp5_encoder.c | 29 +++- 1 file changed, 4 insertions(+), 25 deletions(-) di

[Freedreno] [PATCH 04/17] drm/msm/mdp5: use devres-managed allocation for mixer data

2023-07-07 Thread Dmitry Baryshkov
Use devm_kzalloc to create mixer data structure. This allows us to remove corresponding kfree and drop mdp5_mixer_destroy() function. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 5 + drivers/gpu/drm/msm/disp/mdp5/mdp5_mixer.c | 10 +++--- drivers/gpu

[Freedreno] [PATCH 10/17] drm/msm/mdp5: use drmm-managed allocation for mdp5_plane

2023-07-07 Thread Dmitry Baryshkov
Change struct mdp5_plane allocation to use drmm_plane_alloc(). This removes the need to perform any actions on plane destruction. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c | 40 -- 1 file changed, 6 insertions(+), 34 deletions(-) diff --g

[Freedreno] [PATCH 08/17] drm/msm/mdp5: use drmm-managed allocation for mdp5_crtc

2023-07-07 Thread Dmitry Baryshkov
Change struct mdp5_crtc allocation to use drmm_crtc_alloc(). This removes the need to perform any actions on CRTC destruction. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c | 30 +++ 1 file changed, 15 insertions(+), 15 deletions(-) diff --git

[Freedreno] [PATCH 05/17] drm/msm/mdp5: use devres-managed allocation for pipe data

2023-07-07 Thread Dmitry Baryshkov
Use devm_kzalloc to create pipe data structure. This allows us to remove corresponding kfree and drop mdp5_pipe_destroy() function. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 6 +- drivers/gpu/drm/msm/disp/mdp5/mdp5_pipe.c | 10 +++--- drivers/gpu/dr

[Freedreno] [PATCH 11/17] drm/msm/mdp4: use bulk regulators API for LCDC encoder

2023-07-07 Thread Dmitry Baryshkov
Switch mdp4_lcdc_encoder to using regulator_bulk_* API instead of enumerating regulators by hand. Signed-off-by: Dmitry Baryshkov --- .../gpu/drm/msm/disp/mdp4/mdp4_lcdc_encoder.c | 51 ++- 1 file changed, 15 insertions(+), 36 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/m

[Freedreno] [PATCH 06/17] drm/msm/mdp5: use devres-managed allocation for SMP data

2023-07-07 Thread Dmitry Baryshkov
Use devm_kzalloc to create SMP data structure. This allows us to remove corresponding kfree and drop mdp5_smp_destroy() function. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 3 --- drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c | 19 --- drivers/gpu/

[Freedreno] [PATCH 15/17] drm/msm/mdp4: use drmm-managed allocation for mdp4_lcdc_encoder

2023-07-07 Thread Dmitry Baryshkov
Change struct mdp4_lcdc_encoder allocation to use drmm_encoder_alloc(). This removes the need to perform any actions on this encoder destruction. Signed-off-by: Dmitry Baryshkov --- .../gpu/drm/msm/disp/mdp4/mdp4_lcdc_encoder.c | 36 --- 1 file changed, 7 insertions(+), 29 deleti

[Freedreno] [PATCH 14/17] drm/msm/mdp4: use drmm-managed allocation for mdp4_dtv_encoder

2023-07-07 Thread Dmitry Baryshkov
Change struct mdp4_dtv_encoder allocation to use drmm_encoder_alloc(). This removes the need to perform any actions on this encoder destruction. Signed-off-by: Dmitry Baryshkov --- .../gpu/drm/msm/disp/mdp4/mdp4_dtv_encoder.c | 37 --- 1 file changed, 7 insertions(+), 30 deletio

[Freedreno] [PATCH 13/17] drm/msm/mdp4: use drmm-managed allocation for mdp4_dsi_encoder

2023-07-07 Thread Dmitry Baryshkov
Change struct mdp4_dsi_encoder allocation to use drmm_encoder_alloc(). This removes the need to perform any actions on this encoder destruction. Signed-off-by: Dmitry Baryshkov --- .../gpu/drm/msm/disp/mdp4/mdp4_dsi_encoder.c | 32 +++ 1 file changed, 5 insertions(+), 27 deletio

[Freedreno] [PATCH 12/17] drm/msm/mdp4: use drmm-managed allocation for mdp4_crtc

2023-07-07 Thread Dmitry Baryshkov
Change struct mdp4_crtc allocation to use drmm_crtc_alloc(). This removes the need to perform any actions on CRTC destruction. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c | 33 --- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git

[Freedreno] [PATCH 16/17] drm/msm/mdp4: use drmm-managed allocation for mdp4_plane

2023-07-07 Thread Dmitry Baryshkov
Change struct mdp4_plane allocation to use drmm_plane_alloc(). This removes the need to perform any actions on plane destruction. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c | 59 -- 1 file changed, 20 insertions(+), 39 deletions(-) diff --

[Freedreno] [PATCH 17/17] drm/msm: drop mdp_get_formats()

2023-07-07 Thread Dmitry Baryshkov
Drop the function mdp_get_formats(), which became unused after converting both MDP4 and MDP5 planes to use static formats arrays. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/mdp_format.c | 24 drivers/gpu/drm/msm/disp/mdp_kms.h| 1 - 2 files changed

[Freedreno] [PATCH v5 6/6] drm/msm/dpu: Update dev core dump to dump registers of sub-blocks

2023-07-07 Thread Ryan McCann
Currently, the device core dump mechanism does not dump registers of sub-blocks within the DSPP, SSPP, DSC, and PINGPONG blocks. Edit dpu_kms_mdp_snapshot function to account for sub-blocks. Signed-off-by: Ryan McCann --- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 66 +++--

[Freedreno] [PATCH v5 0/6] Add support to print sub-block registers in dpu hw catalog

2023-07-07 Thread Ryan McCann
The purpose of this patch series is to add support to print the registers of sub-blocks in the DPU hardware catalog and fix the order in which all hardware blocks are dumped for a device core dump. This involves: 1. Changing data structure from stack to queue to fix the printing order of the devic

[Freedreno] [PATCH v5 5/6] drm/msm/dpu: Refactor printing of main blocks in device core dump

2023-07-07 Thread Ryan McCann
Currently, the names of main blocks are hardcoded into the msm_disp_snapshot_add_block function rather than using the name that already exists in the catalog. Change this to take the name directly from the catalog instead of hardcoding it. Signed-off-by: Ryan McCann --- drivers/gpu/drm/msm/disp/

[Freedreno] [PATCH v5 2/6] drm/msm/dpu: Drop unused num argument from relevant macros

2023-07-07 Thread Ryan McCann
Drop unused parameter "num" from VIG_SBLK_NOSCALE and DMA sub-block macros. Update calls to relevant macros to reflect change. Reviewed-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov Signed-off-by: Ryan McCann --- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c | 20 ++-- 1 fil

[Freedreno] [PATCH v5 4/6] drm/msm/dpu: Remove redundant prefix/suffix in name of sub-blocks

2023-07-07 Thread Ryan McCann
For a device core dump, the registers of sub-blocks are printed under a title formatted as . For example, the csc sub-block for an SSPP main block "sspp_0" would be printed "sspp_0_sspp_csc0". The title is clearly redundant due to the duplicate "sspp" and "0" that exist in both the mainBlkName and

[Freedreno] [PATCH v5 3/6] drm/msm/dpu: Define names for unnamed sblks

2023-07-07 Thread Ryan McCann
Some sub-blocks in the hw catalog have not been given a name, so when the registers from that block are dumped, there is no name to reference. Define names for relevant sub-blocks to fix this. Reviewed-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov Signed-off-by: Ryan McCann --- drivers/gpu/d

[Freedreno] [PATCH v5 1/6] drm/msm: Update dev core dump to not print backwards

2023-07-07 Thread Ryan McCann
Device core dump add block method adds hardware blocks to dumping queue with stack behavior which causes the hardware blocks to be printed in reverse order. Change the addition to dumping queue data structure from "list_add" to "list_add_tail" for FIFO queue behavior. Fixes: 98659487b845 ("drm/msm

Re: [Freedreno] [PATCH v5 5/6] drm/msm/dpu: Refactor printing of main blocks in device core dump

2023-07-07 Thread Abhinav Kumar
On 7/7/2023 6:24 PM, Ryan McCann wrote: Currently, the names of main blocks are hardcoded into the msm_disp_snapshot_add_block function rather than using the name that already exists in the catalog. Change this to take the name directly from the catalog instead of hardcoding it. Signed-off-by

Re: [Freedreno] [PATCH v5 5/6] drm/msm/dpu: Refactor printing of main blocks in device core dump

2023-07-07 Thread Dmitry Baryshkov
On 08/07/2023 04:24, Ryan McCann wrote: Currently, the names of main blocks are hardcoded into the msm_disp_snapshot_add_block function rather than using the name that already exists in the catalog. Change this to take the name directly from the catalog instead of hardcoding it. Signed-off-by: R

Re: [Freedreno] [PATCH v5 6/6] drm/msm/dpu: Update dev core dump to dump registers of sub-blocks

2023-07-07 Thread Dmitry Baryshkov
On 08/07/2023 04:24, Ryan McCann wrote: Currently, the device core dump mechanism does not dump registers of sub-blocks within the DSPP, SSPP, DSC, and PINGPONG blocks. Edit dpu_kms_mdp_snapshot function to account for sub-blocks. Signed-off-by: Ryan McCann --- drivers/gpu/drm/msm/disp/dpu1/d

Re: [Freedreno] [PATCH v5 6/6] drm/msm/dpu: Update dev core dump to dump registers of sub-blocks

2023-07-07 Thread Abhinav Kumar
On 7/7/2023 6:24 PM, Ryan McCann wrote: Currently, the device core dump mechanism does not dump registers of sub-blocks within the DSPP, SSPP, DSC, and PINGPONG blocks. Edit dpu_kms_mdp_snapshot function to account for sub-blocks. Signed-off-by: Ryan McCann --- drivers/gpu/drm/msm/disp/dpu

Re: [Freedreno] [PATCH v5 0/6] Add support to print sub-block registers in dpu hw catalog

2023-07-07 Thread Abhinav Kumar
On 7/7/2023 6:24 PM, Ryan McCann wrote: The purpose of this patch series is to add support to print the registers of sub-blocks in the DPU hardware catalog and fix the order in which all hardware blocks are dumped for a device core dump. This involves: Nice work on completing this feature a

Re: [Freedreno] [PATCH 2/2] drm/msm/dpu: fix DSC 1.2 enc subblock length

2023-07-07 Thread Abhinav Kumar
On 6/22/2023 6:37 PM, Dmitry Baryshkov wrote: Both struct dpu_dsc_sub_blks instances declare enc subblock length to be 0x100, while the actual length is 0x9c (last register having offset 0x98). Reduce subblock length to remove the empty register space from being dumped. Fixes: 0d1b10c63346 ("