Re: [PATCH 3/5] accel/qaic: Add consistent integer overflow checks

2023-07-07 Thread Pranjal Ramajor Asha Kanojiya
On 7/8/2023 12:21 AM, Jeffrey Hugo wrote: On 6/21/2023 1:22 AM, Dan Carpenter wrote: The encode_dma() function has integer overflow checks.  The encode_passthrough(), encode_activate() and encode_status() functions did not.  I added integer overflow checking everywhere.  I also updated the

Re: [PATCH 5/5] accel/qaic: Fix a leak in map_user_pages()

2023-07-07 Thread Pranjal Ramajor Asha Kanojiya
On 6/21/2023 12:52 PM, Dan Carpenter wrote: If get_user_pages_fast() allocates some pages but not as many as we wanted, then the current code leaks those pages. Call put_page() on the pages before returning. Fixes: 129776ac2e38 ("accel/qaic: Add control path") Signed-off-by: Dan Carpenter

Re: [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

Re: [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

Re: [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 ---

Re: [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 ---

Re: [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:

Re: [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.

[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

[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

[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 ---

[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

[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

[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 ---

[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

[Patch v2] drm/ttm: Use init_on_free to delay release TTM BOs

2023-07-07 Thread Rajneesh Bhardwaj
Delay release TTM BOs when the kernel default setting is init_on_free. This offloads the overhead of clearing the system memory to the work item and potentially a different CPU. This could be very beneficial when the application does a lot of malloc/free style allocations of system memory.

[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

[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

[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

[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

[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

[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(-)

[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

[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

[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

[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

[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 ---

[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

[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 +++---

[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

[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

[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 -

[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 +++---

[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 -

Re: [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

Re: [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

Re: [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

Re: [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: [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:

Re: [PATCH] drm/nouveau/disp/g94: enable HDMI

2023-07-07 Thread Karol Herbst
On Fri, Jul 7, 2023 at 11:03 PM Lyude Paul wrote: > > Reviewed-by: Lyude Paul > > But seeing as I looked at this + some other patches yesterday I assume there's > still more to this? > not really. All those patches are all independent and just a bunch of fixes. I just figured this one out a bit

Re: [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

Re: [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 ---

Re: [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

[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

[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 +

[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 ---

[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 ++

[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

Re: [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

[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: [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

Re: [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 >

[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 ++--

[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

[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

[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

[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(-)

[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

[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

[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

[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

[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 +---

[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 ++

[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 ---

[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

[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

[PATCH v5 6/6] drm/doc: Define KMS atomic state set

2023-07-07 Thread André Almeida
From: Pekka Paalanen Specify how the atomic state is maintained between userspace and kernel, plus the special case for async flips. Signed-off-by: Pekka Paalanen Signed-off-by: André Almeida --- v4: total rework by Pekka --- Documentation/gpu/drm-uapi.rst | 41

[PATCH v5 5/6] drm: Refuse to async flip with atomic prop changes

2023-07-07 Thread André Almeida
Given that prop changes may lead to modesetting, which would defeat the fast path of the async flip, refuse any atomic prop change for async flips in atomic API. The only exceptions are the framebuffer ID to flip to and the mode ID, that could be referring to an identical mode. Signed-off-by:

[PATCH v5 4/6] amd/display: indicate support for atomic async page-flips on DC

2023-07-07 Thread André Almeida
From: Simon Ser amdgpu_dm_commit_planes() already sets the flip_immediate flag for async page-flips. This flag is used to set the UNP_FLIP_CONTROL register. Thus, no additional change is required to handle async page-flips with the atomic uAPI. Signed-off-by: Simon Ser Reviewed-by: André

[PATCH v5 3/6] drm: introduce drm_mode_config.atomic_async_page_flip_not_supported

2023-07-07 Thread André Almeida
From: Simon Ser This new field indicates whether the driver has the necessary logic to support async page-flips via the atomic uAPI. This is leveraged by the next commit to allow user-space to use this functionality. All atomic drivers setting drm_mode_config.async_page_flip are updated to also

[PATCH v5 2/6] drm: introduce DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP

2023-07-07 Thread André Almeida
From: Simon Ser This new kernel capability indicates whether async page-flips are supported via the atomic uAPI. DRM clients can use it to check for support before feeding DRM_MODE_PAGE_FLIP_ASYNC to the kernel. Make it clear that DRM_CAP_ASYNC_PAGE_FLIP is for legacy uAPI only. Signed-off-by:

[PATCH v5 0/6] drm: Add support for atomic async page-flip

2023-07-07 Thread André Almeida
Hi, This work from me and Simon adds support for DRM_MODE_PAGE_FLIP_ASYNC through the atomic API. This feature is already available via the legacy API. The use case is to be able to present a new frame immediately (or as soon as possible), even if after missing a vblank. This might result in

[PATCH v5 1/6] drm: allow DRM_MODE_PAGE_FLIP_ASYNC for atomic commits

2023-07-07 Thread André Almeida
From: Simon Ser If the driver supports it, allow user-space to supply the DRM_MODE_PAGE_FLIP_ASYNC flag to request an async page-flip. Set drm_crtc_state.async_flip accordingly. Document that drivers will reject atomic commits if an async flip isn't possible. This allows user-space to fall back

[PATCH] drm/nouveau/nvkm/dp: Add hack to fix DP 1.3+ DPCD issues

2023-07-07 Thread Lyude Paul
Currently we use the drm_dp_dpcd_read_caps() helper in the DRM side of nouveau in order to read the DPCD of a DP connector, which makes sure we do the right thing and also check for extended DPCD caps. However, it turns out we're not currently doing this on the nvkm side since we don't have access

Re: [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

[PATCH v4] drm/virtio: conditionally allocate virtio_gpu_fence

2023-07-07 Thread Gurchetan Singh
We don't want to create a fence for every command submission. It's only necessary when userspace provides a waitable token for submission. This could be: 1) bo_handles, to be used with VIRTGPU_WAIT 2) out_fence_fd, to be used with dma_fence apis 3) a ring_idx provided with

Re: [PATCH] drm/nouveau/disp/g94: enable HDMI

2023-07-07 Thread Lyude Paul
Reviewed-by: Lyude Paul But seeing as I looked at this + some other patches yesterday I assume there's still more to this? On Fri, 2023-06-30 at 18:06 +0200, Karol Herbst wrote: > Cc: Ben Skeggs > Cc: Lyude Paul > Fixes: f530bc60a30b ("drm/nouveau/disp: move HDMI config into acquire + >

Re: [PATCH v4 2/8] drm/atomic: Add support for mouse hotspots

2023-07-07 Thread Michael Banack
On 7/7/23 01:38, Pekka Paalanen wrote: That statement was based on the assumption that existing hypervisors and VM viewer applications are not prepared to deal with hotspots outside of cursor image. Therefore, if a guest is upgraded to a version that uses hotspots outside of cursor images,

Re: [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

[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

[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

[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(-)

[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

[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

[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(-)

[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 +---

[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

[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 ++--

[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

[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 ++

[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

[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 ---

[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

Re: [PATCH v3] drm/virtio: conditionally allocate virtio_gpu_fence

2023-07-07 Thread Dmitry Osipenko
On 7/7/23 20:59, Gurchetan Singh wrote: /// >>> Previously, when VIRTGPU_EXECBUF_RING_IDX flag wasn't specified, the >>> fence event was created for a default ring_idx=0. Now you changed this >>> behaviour and event will never be created without >>> VIRTGPU_EXECBUF_RING_IDX flag being set. > >

[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 --

[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

[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

[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 ++--

[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

[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

  1   2   3   >