[Freedreno] [PATCH v7 00/14] drm/msm: Add Display Stream Compression Support

2022-04-06 Thread Vinod Koul
Display Stream Compression (DSC) compresses the display stream in host which is later decoded by panel. This series enables this for Qualcomm msm driver. This was tested on Google Pixel3 phone which use LGE SW43408 panel. The changes include DSC data and hardware block enabling for DPU1 then supp

[Freedreno] [PATCH v7 01/14] drm/msm/dsi: add support for dsc data

2022-04-06 Thread Vinod Koul
Display Stream Compression (DSC) parameters need to be calculated. Add helpers and struct msm_display_dsc_config in msm_drv for this msm_display_dsc_config uses drm_dsc_config for DSC parameters. Reviewed-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Signed-off-by: Vinod Koul --- drivers/gpu

[Freedreno] [PATCH v7 02/14] drm/msm/dsi: Pass DSC params to drm_panel

2022-04-06 Thread Vinod Koul
When DSC is enabled, we need to get the DSC parameters from the panel driver, so add a dsc parameter in panel to fetch and pass DSC configuration for DSI panels to DPU encoder, which will enable and then configure DSC hardware blocks accordingly. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhin

[Freedreno] [PATCH v7 03/14] drm/msm/disp/dpu1: Add support for DSC

2022-04-06 Thread Vinod Koul
Display Stream Compression (DSC) is one of the hw blocks in dpu, so add support by adding hw blocks for DSC Reviewed-by: Dmitry Baryshkov Signed-off-by: Vinod Koul --- drivers/gpu/drm/msm/Makefile | 1 + .../gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h| 13 ++ drivers/gpu/drm/

[Freedreno] [PATCH v7 04/14] drm/msm/disp/dpu1: Add support for DSC in pingpong block

2022-04-06 Thread Vinod Koul
In SDM845, DSC can be enabled by writing to pingpong block registers, so add support for DSC in hw_pp Reviewed-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov Signed-off-by: Vinod Koul --- .../gpu/drm/msm/disp/dpu1/dpu_hw_pingpong.c | 32 +++ .../gpu/drm/msm/disp/dpu1/dpu_hw_

[Freedreno] [PATCH v7 05/14] drm/msm/disp/dpu1: Add DSC for SDM845 to hw_catalog

2022-04-06 Thread Vinod Koul
This adds SDM845 DSC blocks into hw_catalog Reviewed-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Signed-off-by: Vinod Koul --- .../gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c| 20 +++ 1 file changed, 20 insertions(+) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog

[Freedreno] [PATCH v7 06/14] drm/msm/disp/dpu1: Add DSC support in hw_ctl

2022-04-06 Thread Vinod Koul
Later gens of hardware have DSC bits moved to hw_ctl, so configure these bits so that DSC would work there as well Reviewed-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Signed-off-by: Vinod Koul --- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c | 11 ++- drivers/gpu/drm/msm/disp/dpu1/d

[Freedreno] [PATCH v7 07/14] drm/msm/disp/dpu1: Add support for DSC in encoder

2022-04-06 Thread Vinod Koul
We need to configure the encoder for DSC configuration and calculate DSC parameters for the given timing so this patch adds that support by adding dpu_encoder_prep_dsc() which is invoked when DSC is enabled. Reviewed-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Signed-off-by: Vinod Koul ---

[Freedreno] [PATCH v7 08/14] drm/msm/dpu: don't use merge_3d if DSC merge topology is used

2022-04-06 Thread Vinod Koul
From: Dmitry Baryshkov DPU supports different topologies for the case when multiple INTFs are being driven by the single phys_enc. The driver defaults to using 3DMux in such cases. Don't use it if DSC merge is used instead. Suggested-by: Abhinav Kumar Signed-off-by: Dmitry Baryshkov Signed-off

[Freedreno] [PATCH v7 09/14] drm/msm: Add missing num_dspp field documentation

2022-04-06 Thread Vinod Koul
Somehow documentation for num_dspp was missed, so add that Reviewed-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Signed-off-by: Vinod Koul --- drivers/gpu/drm/msm/msm_drv.h | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h inde

[Freedreno] [PATCH v7 10/14] drm/msm/disp/dpu1: Add support for DSC in topology

2022-04-06 Thread Vinod Koul
For DSC to work we typically need a 2,2,1 configuration. This should suffice for resolutions up to 4k. For more resolutions like 8k this won't work. Also, it is better to use 2 LMs and DSC instances as half width results in lesser power consumption as compared to single LM, DSC at full width. The

[Freedreno] [PATCH v7 11/14] drm/msm/disp/dpu1: Add DSC support in RM

2022-04-06 Thread Vinod Koul
This add the bits in RM to enable the DSC blocks Reviewed-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Signed-off-by: Vinod Koul --- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h | 1 + drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 56 + drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h

[Freedreno] [PATCH v7 12/14] drm/msm/dsi: add mode valid callback for dsi_mgr

2022-04-06 Thread Vinod Koul
Add a mode valid callback for dsi_mgr for checking mode being valid in case of DSC. For DSC the height and width needs to be multiple of slice, so we check that here Reviewed-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Signed-off-by: Vinod Koul --- drivers/gpu/drm/msm/dsi/dsi.h |

[Freedreno] [PATCH v7 13/14] drm/msm: Update generated headers

2022-04-06 Thread Vinod Koul
Update headers from mesa commit: commit 28ae397be111c37c6ced397e12d453a7695701bd Author: Vinod Koul Date: Fri Apr 1 16:53:04 2022 +0530 freedreno/registers: update dsi registers to support dsc Display Stream compression (DSC) compresses the display stream in host which

[Freedreno] [PATCH v7 14/14] drm/msm/dsi: Add support for DSC configuration

2022-04-06 Thread Vinod Koul
When DSC is enabled, we need to configure DSI registers accordingly and configure the respective stream compression registers. Add support to calculate the register setting based on DSC params and timing information and configure these registers. Signed-off-by: Dmitry Baryshkov Reviewed-by: Dmit

Re: [Freedreno] [PATCH 3/3] drm/msm: don't store created planes, connectors and encoders

2022-04-06 Thread Dmitry Baryshkov
On Wed, 6 Apr 2022 at 07:03, Stephen Boyd wrote: > > Quoting Dmitry Baryshkov (2022-04-05 16:50:59) > > diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h > > index d661debb50f1..ee3093890d97 100644 > > --- a/drivers/gpu/drm/msm/msm_drv.h > > +++ b/drivers/gpu/drm/msm/msm_d

[Freedreno] [PATCH v2] drm/msm: remove unused plane_property field from msm_drm_private

2022-04-06 Thread Dmitry Baryshkov
Remove unused field plane_property from struct msm_drm_private. Also drop the enum msm_mdp_plane_property which also becomes unused. Fixes: 7d36db0be3b9 ("drm/msm/mdp5: switch to standard zpos property") Signed-off-by: Dmitry Baryshkov --- Changes since v1: also drop enum msm_mdp_plane_property

[Freedreno] [PATCH v2 0/3] drm/msm: remove DRM mode setting object arrays

2022-04-06 Thread Dmitry Baryshkov
MSM DRM driver stores connectors, encoders and planes in the arrays inside struct msm_drm_private. They are not really necessary, as drm_devices also references lists of these objects. Drop private arrays and use drm_mode_foo() macros. Note, the crtc array is kept intact as it is used in vblank ha

[Freedreno] [PATCH v2 2/3] drm/msm: loop over encoders using drm_for_each_encoder()

2022-04-06 Thread Dmitry Baryshkov
Rather than manually looping over encoders array, use standard drm_for_each_encoder() macro. Reviewed-by: Stephen Boyd Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 5 +++-- drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 6 ++ 2 files changed, 5 insertions(+), 6

[Freedreno] [PATCH v2 1/3] drm/msm/dpu: remove manual destruction of DRM objects

2022-04-06 Thread Dmitry Baryshkov
Remove manual removal of DRM modesetting objects, it is done anyway by the drm_mode_config_cleanup() called from msm_drm_uninit(). Other MSM display drivers (MDP4, MDP5) do not manually destroy objects and trust generic code to do it's work. Reviewed-by: Stephen Boyd Signed-off-by: Dmitry Baryshk

[Freedreno] [PATCH v2 3/3] drm/msm: don't store created planes, connectors and encoders

2022-04-06 Thread Dmitry Baryshkov
There is no point now in storing arrays of creates planes, connectors and encoders. Remove them from struct msm_drm_private. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 13 +++-- drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c | 7 --- drivers/gpu/drm/msm

Re: [Freedreno] [PATCH 1/4] drm/msm/hdmi: properly add and remove created bridges

2022-04-06 Thread Dmitry Baryshkov
On 06/04/2022 05:51, Stephen Boyd wrote: Quoting Dmitry Baryshkov (2022-04-05 16:45:48) Add calls to drm_bridge_add()/drm_bridge_remove() for the internal HDMI bridges. This fixes the following warning. [2.195003] [ cut here ] Usually this line is left out [2

Re: [Freedreno] [PATCH v6 2/4] drm: introduce drm_writeback_connector_init_with_encoder() API

2022-04-06 Thread Liviu Dudau
Hi Abhinav, On Thu, Mar 31, 2022 at 05:12:11PM -0700, Abhinav Kumar wrote: > For vendors drivers which pass an already allocated and > initialized encoder especially for cases where the encoder > hardware is shared OR the writeback encoder shares the resources > with the rest of the display pipeli

Re: [Freedreno] [PATCH 1/4] drm/msm/hdmi: properly add and remove created bridges

2022-04-06 Thread Stephen Boyd
Quoting Dmitry Baryshkov (2022-04-06 03:21:25) > On 06/04/2022 05:51, Stephen Boyd wrote: > > > > Is there any Fixes tag for this? Still seems worthwhile to have one even > > if this is a lockdep warning. > I thought about this before sending v1, but ended up not doing so. Each > of these changes i

Re: [Freedreno] [PATCH v2] drm/msm: remove unused plane_property field from msm_drm_private

2022-04-06 Thread Stephen Boyd
Quoting Dmitry Baryshkov (2022-04-06 03:05:56) > Remove unused field plane_property from struct msm_drm_private. Also > drop the enum msm_mdp_plane_property which also becomes unused. > > Fixes: 7d36db0be3b9 ("drm/msm/mdp5: switch to standard zpos property") > Signed-off-by: Dmitry Baryshkov > ---

Re: [Freedreno] [PATCH v2 3/3] drm/msm: don't store created planes, connectors and encoders

2022-04-06 Thread Stephen Boyd
Quoting Dmitry Baryshkov (2022-04-06 03:12:47) > There is no point now in storing arrays of creates planes, connectors > and encoders. Remove them from struct msm_drm_private. > > Signed-off-by: Dmitry Baryshkov > --- Reviewed-by: Stephen Boyd

Re: [Freedreno] [PATCH] drm/msm: Stop using iommu_present()

2022-04-06 Thread Rob Clark
On Tue, Apr 5, 2022 at 7:17 AM Robin Murphy wrote: > > Even if some IOMMU has registered itself on the platform "bus", that > doesn't necessarily mean it provides translation for the device we > care about. Replace iommu_present() with a more appropriate check. > > Signed-off-by: Robin Murphy Re

Re: [Freedreno] [PATCH] drm/msm/mdp5: check the return of kzalloc()

2022-04-06 Thread Rob Clark
On Thu, Mar 24, 2022 at 1:37 AM wrote: > > From: Xiaoke Wang > > kzalloc() is a memory allocation function which can return NULL when > some internal memory errors happen. So it is better to check it to > prevent potential wrong memory access. > > Signed-off-by: Xiaoke Wang > --- > drivers/gpu/

Re: [Freedreno] [PATCH v6 2/4] drm: introduce drm_writeback_connector_init_with_encoder() API

2022-04-06 Thread Abhinav Kumar
Hi Liviu Thank you for your reviews. They were very useful to get this in shape. Some comments below. Abhinav On 4/6/2022 7:55 AM, Liviu Dudau wrote: Hi Abhinav, On Thu, Mar 31, 2022 at 05:12:11PM -0700, Abhinav Kumar wrote: For vendors drivers which pass an already allocated and initialize

Re: [Freedreno] [PATCH] drm/msm/dp: enhance both connect and disconnect pending_timeout handle

2022-04-06 Thread Kuogee Hsieh
On 4/5/2022 12:48 PM, Stephen Boyd wrote: Quoting Kuogee Hsieh (2022-04-05 11:17:07) HPD plugin handle is responsible for setting up main link and depend on Is "HPD plugin handle" a function? Can you use the function name? user space frame work to start video stream. Similarly, HPD unplugge

[Freedreno] [PATCH v2] drm/msm/dp: enhance both connect and disconnect pending_timeout handle

2022-04-06 Thread Kuogee Hsieh
dp_hpd_plug_handle() is responsible for setting up main link and send uevent to notify user space framework to start video stream. Similarly, dp_hdp_unplug_handle is responsible to send uevent to notify user space framework to stop video stream and then tear down main link. However there are rare c

[Freedreno] [PATCH v3 00/10] drm/msm: Userspace allocated GPU addresses

2022-04-06 Thread Rob Clark
From: Rob Clark The first six paches are various cleanups and simplifications. The next two get rid of redundant vma lookups in the submit and retire paths. Following that, fenced vma lets us indicate a fence value following which the vma is no longer used, which is needed because otherwise use

[Freedreno] [PATCH v3 01/10] drm/msm/gem: Move prototypes

2022-04-06 Thread Rob Clark
From: Rob Clark These belong more cleanly in the gem header. Signed-off-by: Rob Clark Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/msm_drv.h | 23 --- drivers/gpu/drm/msm/msm_gem.h | 22 ++ 2 files changed, 22 insertions(+), 23 deletions(-) di

[Freedreno] [PATCH v3 02/10] drm/msm/gpu: Drop duplicate fence counter

2022-04-06 Thread Rob Clark
From: Rob Clark The ring seqno counter duplicates the fence-context last_fence counter. They end up getting incremented in lock-step, on the same scheduler thread, but the split just makes things less obvious. Signed-off-by: Rob Clark --- drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 2 +- drivers

[Freedreno] [PATCH v3 03/10] drm/msm/gem: Convert some missed GEM_WARN_ON()s

2022-04-06 Thread Rob Clark
From: Rob Clark Signed-off-by: Rob Clark --- drivers/gpu/drm/msm/msm_gem_vma.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/msm/msm_gem_vma.c b/drivers/gpu/drm/msm/msm_gem_vma.c index f914ddbaea89..64906594fc65 100644 --- a/drivers/gpu/drm/msm/

[Freedreno] [PATCH v3 04/10] drm/msm/gem: Split out inuse helper

2022-04-06 Thread Rob Clark
From: Rob Clark Prep for a following patch, where it gets a bit more complicated. Signed-off-by: Rob Clark --- drivers/gpu/drm/msm/msm_gem.c | 2 +- drivers/gpu/drm/msm/msm_gem.h | 1 + drivers/gpu/drm/msm/msm_gem_vma.c | 9 +++-- 3 files changed, 9 insertions(+), 3 deletions(-) d

[Freedreno] [PATCH v3 05/10] drm/msm/gem: Drop PAGE_SHIFT for address space mm

2022-04-06 Thread Rob Clark
From: Rob Clark Get rid of all the unnecessary conversion between address/size and page offsets. It just confuses things. Signed-off-by: Rob Clark Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 2 +- drivers/gpu/drm/msm/msm_gem.c | 5 ++--- drivers/gpu/dr

[Freedreno] [PATCH v3 06/10] drm/msm: Drop msm_gem_iova()

2022-04-06 Thread Rob Clark
From: Rob Clark There was only a single user, which could just as easily stash the iova when pinning. v2: fix prepare->prepare->cleanup->cleanup sequences Signed-off-by: Rob Clark Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/msm_fb.c | 20 ++-- drivers/gpu/drm/msm/m

[Freedreno] [PATCH v3 07/10] drm/msm/gem: Rework vma lookup and pin

2022-04-06 Thread Rob Clark
From: Rob Clark Combines duplicate vma lookup in the get_and_pin path. Signed-off-by: Rob Clark Reviewed-by: Dmitry Osipenko --- drivers/gpu/drm/msm/msm_gem.c | 50 ++- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/msm/msm_gem.

[Freedreno] [PATCH v3 08/10] drm/msm/gem: Split vma lookup and pin

2022-04-06 Thread Rob Clark
From: Rob Clark This way we only lookup vma once per object per submit, for both the submit and retire path. Signed-off-by: Rob Clark --- drivers/gpu/drm/msm/msm_gem.c| 60 +--- drivers/gpu/drm/msm/msm_gem.h| 9 +++-- drivers/gpu/drm/msm/msm_gem_submit.

[Freedreno] [PATCH v3 09/10] drm/msm/gem: Add fenced vma unpin

2022-04-06 Thread Rob Clark
From: Rob Clark With userspace allocated iova (next patch), we can have a race condition where userspace observes the fence completion and deletes the vma before retire_submit() gets around to unpinning the vma. To handle this, add a fenced unpin which drops the refcount but tracks the fence, an

[Freedreno] [PATCH v3 10/10] drm/msm: Add a way for userspace to allocate GPU iova

2022-04-06 Thread Rob Clark
From: Rob Clark The motivation at this point is mainly native userspace mesa driver in a VM guest. The one remaining synchronous "hotpath" is buffer allocation, because guest needs to wait to know the bo's iova before it can start emitting cmdstream/state that references the new bo. By allocati

[Freedreno] [PATCH v2] drm/msm/mdp5: check the return of kzalloc()

2022-04-06 Thread xkernel . wang
From: Xiaoke Wang kzalloc() is a memory allocation function which can return NULL when some internal memory errors happen. So it is better to check it to prevent potential wrong memory access. Besides, since mdp5_plane_reset() is void type, so we should better set `plane-state` to NULL after rel