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

2023-07-29 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. Reviewed-by: Jessica Zhang Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c | 14 ++ drivers/gpu/drm/msm/d

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

2023-07-29 Thread Dmitry Baryshkov
Drop the dpu_encoder_phys_ops' destroy() callback. No phys backend implements it anymore, so it is useless. Reviewed-by: Jessica Zhang 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

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

2023-07-29 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. Reviewed-by: Jessica Zhang Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 46 +-- 1 file changed, 10 in

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

2023-07-29 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

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

2023-07-29 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

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

2023-07-29 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. Reviewed-by: Jessica Zhang Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 9 .../gpu/drm/msm/disp/dp

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

2023-07-29 Thread Dmitry Baryshkov
The field dpu_plane::lock was never used for protecting any kind of data. Drop it now. Reviewed-by: Jessica Zhang 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/d

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

2023-07-29 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

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

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

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

2023-07-29 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. Reviewed-by: Jessica Zhang Signed-off-by: Dmitry Baryshkov ---

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

2023-07-29 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. Reviewed-by: Jessica Zhang Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_

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

2023-07-29 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. Reviewed-by: Jessica Zhang Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 25 +++- 1 file changed, 7 inse

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

2023-07-29 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

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

2023-07-29 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

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

2023-07-29 Thread Dmitry Baryshkov
On 15/07/2023 00:43, Jessica Zhang wrote: On 7/7/2023 4:12 PM, 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 Signed-off-by: Dmitry Bary

Re: [PATCH 3/3] usb: typec: nb7vpq904m: switch to DRM_SIMPLE_BRIDGE

2023-07-29 Thread kernel test robot
Hi Dmitry, kernel test robot noticed the following build errors: [auto build test ERROR on drm-misc/drm-misc-next] [also build test ERROR on usb/usb-testing usb/usb-next usb/usb-linus drm-intel/for-linux-next-fixes drm-tip/drm-tip linus/master v6.5-rc3 next-20230728] [cannot apply to drm-intel/

[PATCH v5 10/10] drm/msm/dpu: drop dpu_core_perf_destroy()

2023-07-29 Thread Dmitry Baryshkov
This function does nothing, just clears one struct field. Drop it now. Acked-by: Konrad Dybcio Reviewed-by: Abhinav Kumar 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/dr

[PATCH v5 04/10] drm/msm/dpu: rework indentation in dpu_core_perf

2023-07-29 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

[PATCH v5 07/10] drm/msm/dpu: remove unused fields from struct dpu_core_perf

2023-07-29 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 Reviewed-by: Abhinav Kumar 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 --

[PATCH v5 09/10] drm/msm/dpu: move max clock decision to dpu_kms.

2023-07-29 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() and drop handling of core_clk from dpu_core_perf.c Reviewed-by: Abhinav Kumar Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 11 ++-

[PATCH v5 05/10] drm/msm/dpu: drop the dpu_core_perf_crtc_update()'s stop_req param

2023-07-29 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 ++--

[PATCH v5 08/10] drm/msm/dpu: remove extra clk_round_rate() call

2023-07-29 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

[PATCH v5 02/10] drm/msm/dpu: bail from _dpu_core_perf_crtc_update_bus if there are no ICC paths

2023-07-29 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 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu

[PATCH v5 03/10] drm/msm/dpu: drop separate dpu_core_perf_tune overrides

2023-07-29 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. Reviewed-by: Abhinav Kumar Signed-off-by: Dmitry Baryshk

[PATCH v5 06/10] drm/msm/dpu: use dpu_perf_cfg in DPU core_perf code

2023-07-29 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 Reviewed-by: Abhinav Kumar Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 73 --- drivers/gpu/drm/msm/disp/dpu1/dpu_c

[PATCH v5 01/10] drm/msm/dpu: drop enum dpu_core_perf_data_bus_id

2023-07-29 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

[PATCH v5 00/10] drm/msm/dpu: cleanup dpu_core_perf module

2023-07-29 Thread Dmitry Baryshkov
Apply several cleanups to the DPU's core_perf module. Changes since v4: - Dropped the 'extract bandwidth aggregation function' (Abhinav) - Fixed commit message for the patch 9 (Abhinav) Changes since v3: - Dropped avg_bw type change (Abhinav) - Removed core_perf from the commit cubject (Abhinav)

[PATCH v2 8/8] drm/msm/dpu: move INTF tearing checks to dpu_encoder_phys_cmd_init

2023-07-29 Thread Dmitry Baryshkov
As the INTF is fixed at the encoder creation time, we can move the check whether INTF supports tearchck to dpu_encoder_phys_cmd_init(). This function can return an error if INTF doesn't have required feature. Performing this check in dpu_encoder_phys_cmd_tearcheck_config() is less useful, as this f

[PATCH v2 3/8] drm/msm/dpu: drop the DPU_PINGPONG_TE flag

2023-07-29 Thread Dmitry Baryshkov
The DPU_PINGPONG_TE flag became unused, we can drop it now. Reviewed-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c | 2 +- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --gi

[PATCH v2 4/8] drm/msm/dpu: inline _setup_intf_ops()

2023-07-29 Thread Dmitry Baryshkov
Inline the _setup_intf_ops() function, it makes it easier to handle different conditions involving INTF configuration. Reviewed-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c | 48 ++--- 1 file changed, 22 insertions(+), 26 del

[PATCH v2 5/8] drm/msm/dpu: enable INTF TE operations only when supported by HW

2023-07-29 Thread Dmitry Baryshkov
The DPU_INTF_TE bit is set for all INTF blocks on DPU >= 5.0, however only INTF_1 and INTF_2 actually support tearing control (both are INTF_DSI). Rather than trying to limit the DPU_INTF_TE feature bit to those two INTF instances, check for the major && INTF type. Reviewed-by: Marijn Suijten Sig

[PATCH v2 7/8] drm/msm/dpu: drop useless check from dpu_encoder_phys_cmd_te_rd_ptr_irq()

2023-07-29 Thread Dmitry Baryshkov
The dpu_encoder_phys_cmd_te_rd_ptr_irq() function uses neither hw_intf nor hw_pp data, so we can drop the corresponding check. Reviewed-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c | 8 1 file changed, 8 deletions(-) diff

[PATCH v2 6/8] drm/msm/dpu: drop DPU_INTF_TE feature flag

2023-07-29 Thread Dmitry Baryshkov
Replace the only user of the DPU_INTF_TE feature flag with the direct DPU version comparison. Reviewed-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c | 5 +++-- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c | 1 - drivers/gpu/d

[PATCH v2 2/8] drm/msm/dpu: enable PINGPONG TE operations only when supported by HW

2023-07-29 Thread Dmitry Baryshkov
The DPU_PINGPONG_TE bit is set for all PINGPONG blocks on DPU < 5.0. Rather than checking for the flag, check for the presense of the corresponding interrupt line. Reviewed-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_pingpong.c | 6 -- drivers

[PATCH v2 0/8] drm/msm/dpu: drop DPU_INTF_TE and DPU_PINGPONG_TE

2023-07-29 Thread Dmitry Baryshkov
Drop two feature flags, DPU_INTF_TE and DPU_PINGPONG_TE, in favour of performing the MDSS revision checks instead. Changes since v1: - Added missing patch - Reworked commit messages (following suggestions by Marijn) - Changed code to check for major & INTF type rather than checking for intr pres

[PATCH v2 1/8] drm/msm/dpu: inline _setup_pingpong_ops()

2023-07-29 Thread Dmitry Baryshkov
Inline the _setup_pingpong_ops() function, it makes it easier to handle different conditions involving PINGPONG configuration. Signed-off-by: Dmitry Baryshkov --- .../gpu/drm/msm/disp/dpu1/dpu_hw_pingpong.c | 39 --- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git

Re: [PATCH 4/7] drm/msm/dpu: enable INTF TE operations only when supported by HW

2023-07-29 Thread Dmitry Baryshkov
On 27/07/2023 23:12, Marijn Suijten wrote: On 2023-07-27 19:21:01, Dmitry Baryshkov wrote: The DPU_INTF_TE bit is set for all INTF blocks on DPU >= 5.0, however only INTF_1 and INTF_2 actually support tearing control. Rather than trying to fix the DPU_INTF_TE, check for the presense of the I w

Re: [PATCH v2 3/4] drm/msm/dpu: deduplicate some (most) of SSPP sub-blocks

2023-07-29 Thread Dmitry Baryshkov
On 30/07/2023 03:00, Abhinav Kumar wrote: On 7/13/2023 6:55 PM, Dmitry Baryshkov wrote: As we have dropped the variadic parts of SSPP sub-blocks declarations, deduplicate them now, reducing memory cruft. Signed-off-by: Dmitry Baryshkov --- Perhaps I am missing something here, so wanted to

Re: [PATCH 7/7] drm/msm/dpu: move INTF tearing checks to dpu_encoder_phys_cmd_init

2023-07-29 Thread Dmitry Baryshkov
On 27/07/2023 23:25, Marijn Suijten wrote: On 2023-07-27 22:22:20, Marijn Suijten wrote: On 2023-07-27 19:21:04, Dmitry Baryshkov wrote: As the INTF is fixed at the encoder creation time, we can move the check whether INTF supports tearchck to dpu_encoder_phys_cmd_init(). This function can retu

Re: [PATCH v2 3/4] drm/msm/dpu: deduplicate some (most) of SSPP sub-blocks

2023-07-29 Thread Abhinav Kumar
On 7/13/2023 6:55 PM, Dmitry Baryshkov wrote: As we have dropped the variadic parts of SSPP sub-blocks declarations, deduplicate them now, reducing memory cruft. Signed-off-by: Dmitry Baryshkov --- Perhaps I am missing something here, so wanted to clarify. The first change drops the id fi

Re: [PATCH v2 7/7] drm/msm/dpu: drop BWC features from DPU_MDP_foo namespace

2023-07-29 Thread Abhinav Kumar
On 7/28/2023 2:33 PM, Dmitry Baryshkov wrote: The feature bits DPU_MDP_BWC, DPU_MDP_UBWC_1_0, and DPU_MDP_UBWC_1_5 are not used by the driver, drop them completely as a followup cleanup. "as a followup cleanup" is meaning you will do it later. But you are doing it in this patch. You can st

Re: [PATCH 1/7] drm/msm/dpu: enable PINGPONG TE operations only when supported by HW

2023-07-29 Thread Dmitry Baryshkov
On 29/07/2023 21:31, Marijn Suijten wrote: On 2023-07-29 02:59:32, Dmitry Baryshkov wrote: On 27/07/2023 23:03, Marijn Suijten wrote: On 2023-07-27 19:20:58, Dmitry Baryshkov wrote: The DPU_PINGPONG_TE bit is set for all PINGPONG blocks on DPU < 5.0. Rather than checking for the flag, check fo

Re: [PATCH 1/3] drm/display: add transparent bridge helper

2023-07-29 Thread Dmitry Baryshkov
On Sat, 29 Jul 2023 at 23:43, Dmitry Baryshkov wrote: > > Define a helper for creating simple transparent bridges which serve the > only purpose of linking devices into the bridge chain up to the last > bridge representing the connector. This is especially useful for > DP/USB-C bridge chains, whic

Re: [PATCH 3/3] usb: typec: nb7vpq904m: switch to DRM_SIMPLE_BRIDGE

2023-07-29 Thread kernel test robot
Hi Dmitry, kernel test robot noticed the following build errors: [auto build test ERROR on drm-misc/drm-misc-next] [also build test ERROR on usb/usb-testing usb/usb-next usb/usb-linus drm-intel/for-linux-next-fixes drm-tip/drm-tip linus/master v6.5-rc3 next-20230728] [cannot apply to drm-intel/

[PATCH] drm/vkms: avoid race-condition between flushing and destroying

2023-07-29 Thread Maíra Canal
After we flush the workqueue at the commit tale, we need to make sure that no work is queued until we destroy the state. Currently, new work can be queued in the workqueue, even after the commit tale, as the vblank thread is still running. Therefore, to avoid a race-condition that will lead to the

[PATCH v4 2/7] drm/msm/dpu: extract dpu_core_irq_is_valid() helper

2023-07-29 Thread Dmitry Baryshkov
In preparation to reworking IRQ indices, move irq_idx validation to a separate helper. Reviewed-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov --- .../gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c | 22 +-- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/

[PATCH v4 7/7] drm/msm/dpu: shift IRQ indices by 1

2023-07-29 Thread Dmitry Baryshkov
In order to simplify IRQ declarations, shift IRQ indices by 1. This makes 0 the 'no IRQ' value. Thanks to this change, we do no longer have to explicitly set the 'no interrupt' fields in catalog structures. Reviewed-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov --- .../msm/disp/dpu1/catalo

[PATCH v4 6/7] drm/msm/dpu: stop using raw IRQ indices in the kernel traces

2023-07-29 Thread Dmitry Baryshkov
In preparation to reworking IRQ indcies, stop using raw indices in kernel traces. Instead use a pair of register index and bit. This corresponds closer to the values in HW catalog. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 6 +- .../gpu/drm/msm/disp/dpu

[PATCH v4 5/7] drm/msm/dpu: stop using raw IRQ indices in the kernel output

2023-07-29 Thread Dmitry Baryshkov
In preparation to reworking IRQ indcies, stop using raw indices in kernel output (both printk and debugfs). Instead use a pair of register index and bit. This corresponds closer to the values in HW catalog. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 26 ++

[PATCH v4 4/7] drm/msm/dpu: make the irq table size static

2023-07-29 Thread Dmitry Baryshkov
The size of the irq table is static, it has MDP_INTR_MAX * 32 interrupt entries. Provide the fixed length and drop struct_size() statement. Reviewed-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov --- .../gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c | 26 --- .../gpu/drm/msm/dis

[PATCH v4 1/7] drm/msm/dpu: remove irq_idx argument from IRQ callbacks

2023-07-29 Thread Dmitry Baryshkov
There is no point in passing the IRQ index to IRQ callbacks, no function uses that. Drop it at last. Reviewed-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_core_irq.h | 2 +- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 4 ++-- drivers/gpu/

[PATCH v4 3/7] drm/msm/dpu: add helper to get IRQ-related data

2023-07-29 Thread Dmitry Baryshkov
In preparation to reworking IRQ indices, move irq_tbl access to a separate helper. Reviewed-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov --- .../gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c | 48 +-- .../gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.h | 12 +++-- 2 files changed, 4

[PATCH v4 0/7] drm/msm/dpu: change interrupts code to make 0 be the no IRQ

2023-07-29 Thread Dmitry Baryshkov
Having an explicit init of interrupt fields to -1 for not existing IRQs makes it easier to forget and/or miss such initialisation, resulting in a wrong interrupt definition. Instead shift all IRQ indices to turn '0' to be the non-existing IRQ. Dependencies: [1] [1] https://patchwork.freedesktop.

[PATCH 3/3] usb: typec: nb7vpq904m: switch to DRM_SIMPLE_BRIDGE

2023-07-29 Thread Dmitry Baryshkov
Switch to using the new DRM_SIMPLE_BRIDGE helper to create the transparent DRM bridge device instead of handcoding corresponding functionality. Signed-off-by: Dmitry Baryshkov --- drivers/usb/typec/mux/Kconfig | 3 +- drivers/usb/typec/mux/nb7vpq904m.c | 44 ++

[PATCH 2/3] phy: qcom: qmp-combo: switch to DRM_SIMPLE_BRIDGE

2023-07-29 Thread Dmitry Baryshkov
Switch to using the new DRM_SIMPLE_BRIDGE helper to create the transparent DRM bridge device instead of handcoding corresponding functionality. Signed-off-by: Dmitry Baryshkov --- drivers/phy/qualcomm/Kconfig | 3 +- drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 44 ++

[PATCH 1/3] drm/display: add transparent bridge helper

2023-07-29 Thread Dmitry Baryshkov
Define a helper for creating simple transparent bridges which serve the only purpose of linking devices into the bridge chain up to the last bridge representing the connector. This is especially useful for DP/USB-C bridge chains, which can span across several devices, but do not require any additio

[PATCH 0/3] drm/display: simplify support for transparent DRM bridges

2023-07-29 Thread Dmitry Baryshkov
Supporting DP/USB-C can result in a chain of several transparent bridges (PHY, redrivers, mux, etc). This results in drivers having similar boilerplate code for such bridges. Next, these drivers are susceptible to -EPROBE_DEFER loops: the next bridge can either be probed from the bridge->attach ca

Re: [PATCH] drm/radeon: Prefer 'unsigned int' to bare use of 'unsigned'

2023-07-29 Thread Nathan Chancellor
On Sat, Jul 29, 2023 at 09:12:05PM +0700, Bagas Sanjaya wrote: > On Fri, Jul 28, 2023 at 10:35:19PM +0800, 孙冉 wrote: > > WARNING: Prefer 'unsigned int' to bare use of 'unsigned' > > > > Signed-off-by: Ran Sun > > Your From: address != SoB identity While the comment below is a completely valid c

[PATCH 2/4] fbdev: Use _SYSMEM_ infix for system-memory helpers

2023-07-29 Thread Thomas Zimmermann
Change the infix for fbdev's system-memory helpers from _SYS_ to _SYSMEM_. The helpers perform operations within system memory, but not on the state of the operating system itself. Naming should make this clear. Adapt all users. No functional changes. Suggested-by: Helge Deller Signed-off-by: Tho

[PATCH 3/4] fbdev: Use _DMAMEM_ infix for DMA-memory helpers

2023-07-29 Thread Thomas Zimmermann
Change the infix for fbdev's DMA-memory helpers from _DMA_ to _DMAMEM_. The helpers perform operations within DMA-able memory, but they don't perform DMA operations. Naming should make this clear. Adapt all users. No functional changes. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/Kconfi

[PATCH 1/4] fbdev: Use _IOMEM_ infix for I/O-memory helpers

2023-07-29 Thread Thomas Zimmermann
Change the infix for fbdev's I/O-memory helpers from _IO_ to _IOMEM_ to distiguish them from other types of I/O, such as file operations. The helpers operate on memory ranges in the I/O address space and the naming should make this clear. Adapt all users. No functional changes. Suggested-by: Helge

[PATCH 0/4] fbdev: Rename helpers for struct fb_ops

2023-07-29 Thread Thomas Zimmermann
As discussed at [1], rename helpers for struct fb_ops to include 'MEM' in their name to signal that these helpers operate on a certain type of memory address; either I/O, system or DMA-able ranges. These are trival renames without any functional changes. [1] https://lore.kernel.org/dri-devel/1ab4

[PATCH 4/4] fbdev: Align deferred I/O with naming of helpers

2023-07-29 Thread Thomas Zimmermann
Deferred-I/O generator macros generate callbacks for struct fb_ops that operate on memory ranges in I/O address space or system address space. Rename the macros to use the _IOMEM_ and _SYSMEM_ infixes of their underlying helpers. Adapt all users. No functional changes. Signed-off-by: Thomas Zimmer

Re: [PATCH v3 0/4] drm: Atomic modesetting doc and comment improvements

2023-07-29 Thread Javier Martinez Canillas
Geert Uytterhoeven writes: Hello Geert, > Hi all, > > This patch series contains various improvements to the documentation and > comments related to atomic modesetting. Hopefully, it will ease the job > of DRM novice who want to tackle the daunting task of converting a > legacy DRM driv

Re: [PATCH v2 5/5] drm/repaper: Reduce temporary buffer size in repaper_fb_dirty()

2023-07-29 Thread Javier Martinez Canillas
Geert Uytterhoeven writes: > As the temporary buffer is no longer used to store 8-bit grayscale data, > its size can be reduced to the size needed to store the monochrome > bitmap data. > > Fixes: 24c6bedefbe71de9 ("drm/repaper: Use format helper for xrgb to > monochrome conversion") > Signe

Re: [PATCH v3 2/4] drm/todo: Convert list of fbconv links to footnotes

2023-07-29 Thread Javier Martinez Canillas
Geert Uytterhoeven writes: Hello Geert, > Convert the references to fbconv links to footnotes, so they can be > navigated. > > Signed-off-by: Geert Uytterhoeven > --- > v3: > - Make main text read correctly when ignoring the footnotes, > > v2: > - New. > --- Acked-by: Javier Martinez Canil

Re: [PATCH v2 resend 2] drm/armada: Fix off-by-one error in armada_overlay_get_property()

2023-07-29 Thread Javier Martinez Canillas
Geert Uytterhoeven writes: > As ffs() returns one more than the index of the first bit set (zero > means no bits set), the color key mode value is shifted one position too > much. > > Fix this by using FIELD_GET() instead. > > Fixes: c96103b6c49ff9a8 ("drm/armada: move colorkey properties into ov

Re: [PATCH v3] drm: Spelling s/randevouz/rendez-vous/

2023-07-29 Thread Javier Martinez Canillas
Geert Uytterhoeven writes: > Fix a misspelling of "rendez-vous". > > Signed-off-by: Geert Uytterhoeven > Reviewed-by: Hamza Mahfooz > --- > v3: > - Add Reviewed-by, > Pushed to drm-misc (drm-misc-next). Thanks! -- Best regards, Javier Martinez Canillas Core Platforms Red Hat

Re: [PATCH v3 5/6] drm/msm/dpu: stop using raw IRQ indices in the kernel output

2023-07-29 Thread Marijn Suijten
On 2023-07-29 02:31:59, Dmitry Baryshkov wrote: > In preparation to reworking IRQ indcies, stop using raw indices in > kernel output (both printk and debugfs). Instead use a pair of register > index and bit. This corresponds closer to the values in HW catalog. > > Signed-off-by: Dmitry Baryshkov

Re: [PATCH v2] drm: Spelling s/sempahore/semaphore/

2023-07-29 Thread Javier Martinez Canillas
Geert Uytterhoeven writes: > Fix misspellings of "semaphore". > > Signed-off-by: Geert Uytterhoeven > Reviewed-by: Hamza Mahfooz > --- > v2: > - Add Reviewed-by. > --- Pushed to drm-misc (drm-misc-next). Thanks! -- Best regards, Javier Martinez Canillas Core Platforms Red Hat

Re: [PATCH v3 6/6] drm/msm/dpu: shift IRQ indices by 1

2023-07-29 Thread Marijn Suijten
On 2023-07-29 02:32:00, Dmitry Baryshkov wrote: > In order to simplify IRQ declarations, shift IRQ indices by 1. This > makes 0 the 'no IRQ' value. Thanks to this change, we do no longer have > to explicitly set the 'no interrupt' fields in catalog structures. > > Signed-off-by: Dmitry Baryshkov

Re: [PATCH v2] drm/udl: Convert to drm_crtc_helper_atomic_check()

2023-07-29 Thread Javier Martinez Canillas
Geert Uytterhoeven writes: > Use the drm_crtc_helper_atomic_check() helper instead of open-coding the > same operation. > > Signed-off-by: Geert Uytterhoeven > Reviewed-by: Thomas Zimmermann > Reviewed-by: Sui Jingfeng > --- Pushed to drm-misc (drm-misc-next). Thanks! -- Best regards, Javi

Re: [PATCH v3 5/6] drm/msm/dpu: stop using raw IRQ indices in the kernel output

2023-07-29 Thread Marijn Suijten
Title suggestion: replace "stop using" with "Replace RAW IRQ indices in prints with tuple" or something else that describes what the new case is that we can expect after this PR was applied (at your discretion, it might be hard to fit that in 72 chars). Otherwise this reads as if you just dropped

Re: [PATCH v3] drm/bridge_connector: Handle drm_connector_init_with_ddc() failures

2023-07-29 Thread Javier Martinez Canillas
Geert Uytterhoeven writes: Hello Geert, > drm_connector_init_with_ddc() can fail, but the call in > drm_bridge_connector_init() does not check that. Fix this by adding > the missing error handling. > > Signed-off-by: Geert Uytterhoeven > Reviewed-by: Laurent Pinchart > Reviewed-by: Maxime Rip

Re: [PATCH v3 4/6] drm/msm/dpu: make the irq table size static

2023-07-29 Thread Marijn Suijten
On 2023-07-29 02:31:58, Dmitry Baryshkov wrote: > The size of the irq table is static, it has MDP_INTR_MAX * 32 interrupt > entries. Provide the fixed length and drop struct_size() statement. Good call. I thought it was supposed to be allocated based on enabled interrupts (but then indexing becom

Re: [PATCH 3/7] drm/msm/dpu: inline _setup_intf_ops()

2023-07-29 Thread Dmitry Baryshkov
On Sat, 29 Jul 2023 at 21:28, Marijn Suijten wrote: > > On 2023-07-29 02:45:43, Dmitry Baryshkov wrote: > > On 27/07/2023 23:10, Marijn Suijten wrote: > > > On 2023-07-27 19:21:00, Dmitry Baryshkov wrote: > > >> Inline the _setup_intf_ops() function, it makes it easier to handle > > >> different c

Re: [PATCH v3 3/6] drm/msm/dpu: add helper to get IRQ-related data

2023-07-29 Thread Marijn Suijten
On 2023-07-29 02:31:57, Dmitry Baryshkov wrote: > In preparation to reworking the IRQ indices, move irq_tbl access to > separate helper. Nit: "to _a_ separate helper" > > Reviewed-by: Marijn Suijten > Signed-off-by: Dmitry Baryshkov > --- > .../gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c | 48 +

Re: [PATCH v3 2/6] drm/msm/dpu: extract dpu_core_irq_is_valid() helper

2023-07-29 Thread Marijn Suijten
On 2023-07-29 02:31:56, Dmitry Baryshkov wrote: > In preparation to reworking the IRQ indices, move irq_idx validation to > the separate helper. Nit: "the" sounds as if "separate helper" is a thing that already exists, where you just moved it to. Instead, you created a new helper that now contain

Re: [PATCH v2 4/4] drm/msm/dpu: shift IRQ indices by 1

2023-07-29 Thread Marijn Suijten
On 2023-07-28 18:03:35, Dmitry Baryshkov wrote: > > > - if (irq_idx < 0 || irq_idx >= intr->total_irqs) { > > > + if (!irq_idx || irq_idx > intr->total_irqs) { > > > pr_err("invalid IRQ index: [%d]\n", irq_idx); > > > > Logs like this might be harder to interpret (and compare

Re: [PATCH 1/7] drm/msm/dpu: enable PINGPONG TE operations only when supported by HW

2023-07-29 Thread Marijn Suijten
On 2023-07-29 02:59:32, Dmitry Baryshkov wrote: > On 27/07/2023 23:03, Marijn Suijten wrote: > > On 2023-07-27 19:20:58, Dmitry Baryshkov wrote: > >> The DPU_PINGPONG_TE bit is set for all PINGPONG blocks on DPU < 5.0. > >> Rather than checking for the flag, check for the presense of the > >> corre

Re: [PATCH 3/7] drm/msm/dpu: inline _setup_intf_ops()

2023-07-29 Thread Marijn Suijten
On 2023-07-29 02:45:43, Dmitry Baryshkov wrote: > On 27/07/2023 23:10, Marijn Suijten wrote: > > On 2023-07-27 19:21:00, Dmitry Baryshkov wrote: > >> Inline the _setup_intf_ops() function, it makes it easier to handle > >> different conditions involving INTF configuration. > >> > >> Signed-off-by:

Re: [PATCH] drm/radeon: Prefer 'unsigned int' to bare use of 'unsigned'

2023-07-29 Thread Bagas Sanjaya
On Fri, Jul 28, 2023 at 10:35:19PM +0800, 孙冉 wrote: > WARNING: Prefer 'unsigned int' to bare use of 'unsigned' > > Signed-off-by: Ran Sun Your From: address != SoB identity > --- > drivers/gpu/drm/radeon/radeon_object.h | 8 > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff

Re: [PATCH 00/47] fbdev: Use I/O helpers

2023-07-29 Thread Helge Deller
On 7/29/23 15:21, Thomas Zimmermann wrote: Hi Helge Am 29.07.23 um 08:51 schrieb Helge Deller: On 7/28/23 23:01, Sam Ravnborg wrote: Hi Helge, On Fri, Jul 28, 2023 at 08:46:59PM +0200, Helge Deller wrote: On 7/28/23 18:39, Thomas Zimmermann wrote: Most fbdev drivers operate on I/O memory.

Re: [PATCH 00/47] fbdev: Use I/O helpers

2023-07-29 Thread Thomas Zimmermann
Hi Helge Am 29.07.23 um 08:51 schrieb Helge Deller: On 7/28/23 23:01, Sam Ravnborg wrote: Hi Helge, On Fri, Jul 28, 2023 at 08:46:59PM +0200, Helge Deller wrote: On 7/28/23 18:39, Thomas Zimmermann wrote: Most fbdev drivers operate on I/O memory. Just nitpicking here: What is I/O memory? I

Re: [PATCH 00/47] fbdev: Use I/O helpers

2023-07-29 Thread Thomas Zimmermann
Hi Sam Am 28.07.23 um 20:39 schrieb Sam Ravnborg: Hi Thomas, On Fri, Jul 28, 2023 at 06:39:43PM +0200, Thomas Zimmermann wrote: Most fbdev drivers operate on I/O memory. And most of those use the default implementations for file I/O and console drawing. Convert all these low-hanging fruits to

Re: [PATCH v4 2/3] dt-bindings: display: simple: support non-default data-mapping

2023-07-29 Thread Conor Dooley
On Fri, Jul 28, 2023 at 04:16:56PM +0200, Johannes Zink wrote: > Some Displays support more than just a single default LVDS data mapping, > which can be used to run displays on only 3 LVDS lanes in the jeida-18 > data-mapping mode. > > Add an optional data-mapping property to allow overriding the

Re: [PATCH v4 1/3] dt-bindings: display: move LVDS data-mapping definition to separate file

2023-07-29 Thread Conor Dooley
On Fri, Jul 28, 2023 at 04:16:55PM +0200, Johannes Zink wrote: > As the LVDS data-mapping property is required in multiple bindings: move > it to separate file and include instead of duplicating it. > > Signed-off-by: Johannes Zink > > --- > > Changes: > > v3 -> v4: none > > v2 -> v3: worked

Re: [PATCH v3 05/49] mm: shrinker: add infrastructure for dynamically allocating shrinker

2023-07-29 Thread Qi Zheng
Hi Simon, On 2023/7/28 20:17, Simon Horman wrote: On Thu, Jul 27, 2023 at 04:04:18PM +0800, Qi Zheng wrote: Currently, the shrinker instances can be divided into the following three types: a) global shrinker instance statically defined in the kernel, such as workingset_shadow_shrinker. b)

[PATCH 2/2] drm:rcar-du: Enable ABGR and XBGR formats

2023-07-29 Thread Damian Hobson-Garcia
These formats are used by Android so having them available allows the DU to be used for composition operations. Signed-off-by: Damian Hobson-Garcia --- drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_d

[PATCH 1/2] drm: rcar-du: Add more formats to DRM_MODE_BLEND_PIXEL_NONE support

2023-07-29 Thread Damian Hobson-Garcia
Add additional pixel formats for which blending is disabling when DRM_MODE_BLEND_PIXEL_NONE is set. Refactor the fourcc selection into a separate function to handle the increased number of formats. Signed-off-by: Damian Hobson-Garcia --- drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c | 49 ++

Re: [PATCH v6 3/3] drm/bridge_connector: implement oob_hotplug_event

2023-07-29 Thread Janne Grunau
On 2023-07-09 23:25:11 +0300, Dmitry Baryshkov wrote: > Implement the oob_hotplug_event() callback. Translate it to the HPD > notification sent to the HPD bridge in the chain. > > Signed-off-by: Dmitry Baryshkov Reviewed-by: Janne Grunau > --- > drivers/gpu/drm/drm_bridge_connector.c | 29