Re: [Freedreno] [PATCH 16/16] drm/msm/dpu: add cdm blocks to dpu snapshot

2023-08-30 Thread Dmitry Baryshkov
On Thu, 31 Aug 2023 at 01:50, Abhinav Kumar wrote: > > Now that CDM block support has been added to DPU lets also add its > entry to the DPU snapshot to help debugging. > > Signed-off-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov > --- > drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 4 >

Re: [Freedreno] [PATCH 15/16] drm/msm/dpu: add NV12 in the list of supported WB formats

2023-08-30 Thread Dmitry Baryshkov
On Thu, 31 Aug 2023 at 01:50, Abhinav Kumar wrote: > > Since CDM block support has now been added for writeback blocks > add NV12 in the list of supported WB formats. > > Signed-off-by: Abhinav Kumar > --- > drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c | 1 + > 1 file changed, 1 insertion(+)

Re: [Freedreno] [PATCH 14/16] drm/msm/dpu: do not allow YUV formats if no CDM block is present

2023-08-30 Thread Dmitry Baryshkov
On Thu, 31 Aug 2023 at 01:50, Abhinav Kumar wrote: > > On chipsets where CDM block is not available OR where support has > not been added yet do not allow YUV formats for writeback block. > > Signed-off-by: Abhinav Kumar > --- > drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c | 6 ++ >

Re: [Freedreno] [PATCH 13/16] drm/msm/dpu: reserve cdm blocks for writeback in case of YUV output

2023-08-30 Thread Dmitry Baryshkov
On Thu, 31 Aug 2023 at 01:50, Abhinav Kumar wrote: > > Reserve CDM blocks for writeback if the format of the output fb > is YUV. At the moment, the reservation is done only for writeback > but can easily be extended by relaxing the checks once other > interfaces are ready to output YUV. > >

Re: [Freedreno] [PATCH 12/16] drm/msm/dpu: plug-in the cdm related bits to writeback setup

2023-08-30 Thread Dmitry Baryshkov
On Thu, 31 Aug 2023 at 01:50, Abhinav Kumar wrote: > > To setup and enable CDM block for the writeback pipeline, lets > add the pieces together to set the active bits and the flush > bits for the CDM block. > > Signed-off-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov > --- >

Re: [Freedreno] [PATCH 10/16] drm/msm/dpu: add support to disable CDM block during encoder cleanup

2023-08-30 Thread Dmitry Baryshkov
On Thu, 31 Aug 2023 at 01:50, Abhinav Kumar wrote: > > In preparation of setting up CDM block, add the logic to disable it > properly during encoder cleanup. > > Signed-off-by: Abhinav Kumar > --- > drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 8 >

Re: [Freedreno] [PATCH 09/16] drm/msm/dpu: add CDM related logic to dpu_hw_ctl layer

2023-08-30 Thread Dmitry Baryshkov
On Thu, 31 Aug 2023 at 01:50, Abhinav Kumar wrote: > > CDM block will need its own logic to program the flush and active > bits in the dpu_hw_ctl layer. > > Make necessary changes in dpu_hw_ctl to support CDM programming. > > Signed-off-by: Abhinav Kumar > --- >

Re: [Freedreno] [PATCH 11/16] drm/msm/dpu: add an API to setup the CDM block for writeback

2023-08-30 Thread Dmitry Baryshkov
On Thu, 31 Aug 2023 at 01:50, Abhinav Kumar wrote: > > Add an API dpu_encoder_helper_phys_setup_cdm() which can be used by > the writeback encoder to setup the CDM block. > > Currently, this is defined and used within the writeback's physical > encoder layer however, the function can be modified

Re: [Freedreno] [PATCH 08/16] drm/msm/dpu: add support to allocate CDM from RM

2023-08-30 Thread Dmitry Baryshkov
On Thu, 31 Aug 2023 at 01:50, Abhinav Kumar wrote: > > Even though there is usually only one CDM block, it can be > used by either HDMI, DisplayPort OR Writeback interfaces. > > Hence its allocation needs to be tracked properly by the > resource manager to ensure appropriate availability of the >

Re: [Freedreno] [PATCH 06/16] drm/msm/dpu: add dpu_hw_cdm abstraction for CDM block

2023-08-30 Thread Dmitry Baryshkov
On Thu, 31 Aug 2023 at 01:50, Abhinav Kumar wrote: > > CDM block comes with its own set of registers and operations > which can be done. In-line with other hardware sub-blocks, this > change adds the dpu_hw_cdm abstraction for the CDM block. > > Signed-off-by: Abhinav Kumar > --- >

Re: [Freedreno] [PATCH 07/16] drm/msm/dpu: add cdm blocks to RM

2023-08-30 Thread Dmitry Baryshkov
On Thu, 31 Aug 2023 at 01:50, Abhinav Kumar wrote: > > Add the RM APIs necessary to initialize and allocate CDM > blocks by the rest of the DPU pipeline. ... to be used by the rest? > > Signed-off-by: Abhinav Kumar > --- > drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 17 + >

Re: [Freedreno] [PATCH 03/16] drm/msm/dpu: rename dpu_encoder_phys_wb_setup_cdp to match its functionality

2023-08-30 Thread Dmitry Baryshkov
On Thu, 31 Aug 2023 at 01:49, Abhinav Kumar wrote: > > dpu_encoder_phys_wb_setup_cdp() is not programming the chroma down > prefetch block. Its setting up the display ctl path for writeback. > > Hence rename it to dpu_encoder_phys_wb_setup_ctl() to match what its > actually doing. > > Fixes:

Re: [Freedreno] [PATCH 02/16] drm/msm/dpu: add formats check for writeback encoder

2023-08-30 Thread Dmitry Baryshkov
On Thu, 31 Aug 2023 at 01:49, Abhinav Kumar wrote: > > In preparation of adding more formats to dpu writeback add I think it is `preparation to' Other than that: Reviewed-by: Dmitry Baryshkov > format validation to it to fail any unsupported formats. > > Fixes: d7d0e73f7de3 ("drm/msm/dpu:

Re: [Freedreno] [PATCH 01/16] drm/msm/dpu: fix writeback programming for YUV cases

2023-08-30 Thread Dmitry Baryshkov
On Thu, 31 Aug 2023 at 01:49, Abhinav Kumar wrote: > > For YUV cases, setting the required format bits was missed > out in the register programming. Lets fix it now in preparation > of adding YUV formats support for writeback. > > Fixes: 84a33d0fd921 ("drm/msm/dpu: add dpu_hw_wb abstraction for

Re: [Freedreno] [PATCH 04/16] drm/msm/dpu: add cdm blocks to sc7280 dpu_hw_catalog

2023-08-30 Thread Dmitry Baryshkov
On Thu, 31 Aug 2023 at 01:49, Abhinav Kumar wrote: > > Add CDM blocks to the sc7280 dpu_hw_catalog to support > YUV format output from writeback block. > > Signed-off-by: Abhinav Kumar > --- > .../gpu/drm/msm/disp/dpu1/catalog/dpu_7_2_sc7280.h | 9 + >

[Freedreno] [PATCH 16/16] drm/msm/dpu: add cdm blocks to dpu snapshot

2023-08-30 Thread Abhinav Kumar
Now that CDM block support has been added to DPU lets also add its entry to the DPU snapshot to help debugging. Signed-off-by: Abhinav Kumar --- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c

[Freedreno] [PATCH 14/16] drm/msm/dpu: do not allow YUV formats if no CDM block is present

2023-08-30 Thread Abhinav Kumar
On chipsets where CDM block is not available OR where support has not been added yet do not allow YUV formats for writeback block. Signed-off-by: Abhinav Kumar --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c | 6 ++ 1 file changed, 6 insertions(+) diff --git

[Freedreno] [PATCH 13/16] drm/msm/dpu: reserve cdm blocks for writeback in case of YUV output

2023-08-30 Thread Abhinav Kumar
Reserve CDM blocks for writeback if the format of the output fb is YUV. At the moment, the reservation is done only for writeback but can easily be extended by relaxing the checks once other interfaces are ready to output YUV. Signed-off-by: Abhinav Kumar ---

[Freedreno] [PATCH 12/16] drm/msm/dpu: plug-in the cdm related bits to writeback setup

2023-08-30 Thread Abhinav Kumar
To setup and enable CDM block for the writeback pipeline, lets add the pieces together to set the active bits and the flush bits for the CDM block. Signed-off-by: Abhinav Kumar --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c | 10 ++ 1 file changed, 10 insertions(+) diff --git

[Freedreno] [PATCH 09/16] drm/msm/dpu: add CDM related logic to dpu_hw_ctl layer

2023-08-30 Thread Abhinav Kumar
CDM block will need its own logic to program the flush and active bits in the dpu_hw_ctl layer. Make necessary changes in dpu_hw_ctl to support CDM programming. Signed-off-by: Abhinav Kumar --- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c | 34 ++

[Freedreno] [PATCH 15/16] drm/msm/dpu: add NV12 in the list of supported WB formats

2023-08-30 Thread Abhinav Kumar
Since CDM block support has now been added for writeback blocks add NV12 in the list of supported WB formats. Signed-off-by: Abhinav Kumar --- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c

[Freedreno] [PATCH 10/16] drm/msm/dpu: add support to disable CDM block during encoder cleanup

2023-08-30 Thread Abhinav Kumar
In preparation of setting up CDM block, add the logic to disable it properly during encoder cleanup. Signed-off-by: Abhinav Kumar --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 8 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h | 2 ++ 2 files changed, 10 insertions(+) diff

[Freedreno] [PATCH 07/16] drm/msm/dpu: add cdm blocks to RM

2023-08-30 Thread Abhinav Kumar
Add the RM APIs necessary to initialize and allocate CDM blocks by the rest of the DPU pipeline. Signed-off-by: Abhinav Kumar --- drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 17 + drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h | 2 ++ 2 files changed, 19 insertions(+) diff --git

[Freedreno] [PATCH 11/16] drm/msm/dpu: add an API to setup the CDM block for writeback

2023-08-30 Thread Abhinav Kumar
Add an API dpu_encoder_helper_phys_setup_cdm() which can be used by the writeback encoder to setup the CDM block. Currently, this is defined and used within the writeback's physical encoder layer however, the function can be modified to be used to setup the CDM block even for non-writeback

[Freedreno] [PATCH 05/16] drm/msm/dpu: add cdm blocks to sm8250 dpu_hw_catalog

2023-08-30 Thread Abhinav Kumar
Add CDM blocks to the sm8250 dpu_hw_catalog to support YUV format output from writeback block. Signed-off-by: Abhinav Kumar --- drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_6_0_sm8250.h | 9 + 1 file changed, 9 insertions(+) diff --git

[Freedreno] [PATCH 08/16] drm/msm/dpu: add support to allocate CDM from RM

2023-08-30 Thread Abhinav Kumar
Even though there is usually only one CDM block, it can be used by either HDMI, DisplayPort OR Writeback interfaces. Hence its allocation needs to be tracked properly by the resource manager to ensure appropriate availability of the block. Signed-off-by: Abhinav Kumar ---

[Freedreno] [PATCH 06/16] drm/msm/dpu: add dpu_hw_cdm abstraction for CDM block

2023-08-30 Thread Abhinav Kumar
CDM block comes with its own set of registers and operations which can be done. In-line with other hardware sub-blocks, this change adds the dpu_hw_cdm abstraction for the CDM block. Signed-off-by: Abhinav Kumar --- drivers/gpu/drm/msm/Makefile| 1 +

[Freedreno] [PATCH 04/16] drm/msm/dpu: add cdm blocks to sc7280 dpu_hw_catalog

2023-08-30 Thread Abhinav Kumar
Add CDM blocks to the sc7280 dpu_hw_catalog to support YUV format output from writeback block. Signed-off-by: Abhinav Kumar --- .../gpu/drm/msm/disp/dpu1/catalog/dpu_7_2_sc7280.h | 9 + drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h | 13 +

[Freedreno] [PATCH 03/16] drm/msm/dpu: rename dpu_encoder_phys_wb_setup_cdp to match its functionality

2023-08-30 Thread Abhinav Kumar
dpu_encoder_phys_wb_setup_cdp() is not programming the chroma down prefetch block. Its setting up the display ctl path for writeback. Hence rename it to dpu_encoder_phys_wb_setup_ctl() to match what its actually doing. Fixes: d7d0e73f7de3 ("drm/msm/dpu: introduce the dpu_encoder_phys_* for

[Freedreno] [PATCH 02/16] drm/msm/dpu: add formats check for writeback encoder

2023-08-30 Thread Abhinav Kumar
In preparation of adding more formats to dpu writeback add format validation to it to fail any unsupported formats. Fixes: d7d0e73f7de3 ("drm/msm/dpu: introduce the dpu_encoder_phys_* for writeback") Signed-off-by: Abhinav Kumar --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c | 7

[Freedreno] [PATCH 01/16] drm/msm/dpu: fix writeback programming for YUV cases

2023-08-30 Thread Abhinav Kumar
For YUV cases, setting the required format bits was missed out in the register programming. Lets fix it now in preparation of adding YUV formats support for writeback. Fixes: 84a33d0fd921 ("drm/msm/dpu: add dpu_hw_wb abstraction for writeback blocks") Signed-off-by: Abhinav Kumar ---

[Freedreno] [PATCH 00/16] Add CDM support for MSM writeback

2023-08-30 Thread Abhinav Kumar
Chroma Down Sampling (CDM) block is a hardware block in the DPU pipeline which among other things has a CSC block that can convert RGB input from the DPU to YUV data. This block can be used with either HDMI, DP or writeback interface. In this series, lets first add the support for CDM block to

Re: [Freedreno] [PATCH v2 6/6] drm/drm-file: Allow size unit selection in drm_show_memory_stats

2023-08-30 Thread Adrián Larumbe
>> The current implementation will try to pick the highest available >> unit. This is rather unflexible, and allowing drivers to display BO size >> statistics through fdinfo in units of their choice might be desirable. >> >> The new argument to drm_show_memory_stats is to be interpreted as the >>

Re: [Freedreno] [PATCH v2 5/6] drm/panfrost: Implement generic DRM object RSS reporting function

2023-08-30 Thread Boris Brezillon
On Thu, 24 Aug 2023 02:34:48 +0100 Adrián Larumbe wrote: > BO's RSS is updated every time new pages are allocated and mapped for the > object, either in its entirety at creation time for non-heap buffers, or > else on demand for heap buffers at GPU page fault's IRQ handler. > > Same

Re: [Freedreno] [PATCH v2 1/6] drm/panfrost: Add cycle count GPU register definitions

2023-08-30 Thread Boris Brezillon
On Thu, 24 Aug 2023 02:34:44 +0100 Adrián Larumbe wrote: > These GPU registers will be used when programming the cycle counter, which > we need for providing accurate fdinfo drm-cycles values to user space. > > Signed-off-by: Adrián Larumbe Reviewed-by: Boris Brezillon > --- >

Re: [Freedreno] [PATCH v2 4/6] drm/drm_file: Add DRM obj's RSS reporting function for fdinfo

2023-08-30 Thread Boris Brezillon
On Thu, 24 Aug 2023 02:34:47 +0100 Adrián Larumbe wrote: > Some BO's might be mapped onto physical memory chunkwise and on demand, > like Panfrost's tiler heap. In this case, even though the > drm_gem_shmem_object page array might already be allocated, only a very > small fraction of the BO is

Re: [Freedreno] [PATCH v2 3/6] drm/panfrost: Add fdinfo support for memory stats

2023-08-30 Thread Boris Brezillon
On Thu, 24 Aug 2023 02:34:46 +0100 Adrián Larumbe wrote: > A new DRM GEM object function is added so that drm_show_memory_stats can > provider more accurate memory usage numbers. s/provider/provide/ > > Ideally, in panfrost_gem_status, the BO's purgeable flag would be checked > after

Re: [Freedreno] [PATCH v2 2/6] drm/panfrost: Add fdinfo support GPU load metrics

2023-08-30 Thread Boris Brezillon
On Thu, 24 Aug 2023 02:34:45 +0100 Adrián Larumbe wrote: > The drm-stats fdinfo tags made available to user space are drm-engine, > drm-cycles, drm-max-freq and drm-curfreq, one per job slot. Pretty sure this has already been discussed, but it's probably worth mentioning that drm-cycles is not