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

2022-03-29 Thread Rob Clark
On Tue, Mar 29, 2022 at 4:42 PM Dmitry Baryshkov wrote: > > On Wed, 30 Mar 2022 at 02:00, Rob Clark wrote: > > > > 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, > > bec

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

2022-03-29 Thread Dmitry Osipenko
On 3/30/22 02:00, Rob Clark wrote: > +static int msm_ioctl_gem_info_set_iova(struct drm_device *dev, > + struct drm_file *file, struct drm_gem_object *obj, > + uint64_t iova) > +{ > + struct msm_drm_private *priv = dev->dev_private; > + struct msm_file_private *ctx

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

2022-03-29 Thread Dmitry Baryshkov
On Wed, 30 Mar 2022 at 02:00, Rob Clark wrote: > > 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 > emit

Re: [Freedreno] [PATCH 4/9] drm/msm/gem: Drop PAGE_SHIFT for address space mm

2022-03-29 Thread Dmitry Baryshkov
On Wed, 30 Mar 2022 at 02:00, Rob Clark wrote: > > From: Rob Clark > > Get rid of all the unnecessary conversion between address/size and page > offsets. It just confuses things. Reviewed-by: Dmitry Baryshkov > > Signed-off-by: Rob Clark > --- > drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 2

Re: [Freedreno] [PATCH 1/9] drm/msm/gem: Move prototypes

2022-03-29 Thread Dmitry Baryshkov
On Wed, 30 Mar 2022 at 02:00, Rob Clark wrote: > > From: Rob Clark > > These belong more cleanly in the gem header. > > Signed-off-by: Rob Clark Reviewed-by: Dmitry Baryshkov -- With best wishes Dmitry

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

2022-03-29 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 8/9] drm/msm/gem: Add fenced vma unpin

2022-03-29 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 6/9] drm/msm/gem: Rework vma lookup and pin

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

[Freedreno] [PATCH 7/9] drm/msm/gem: Split vma lookup and pin

2022-03-29 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 5/9] drm/msm: Drop msm_gem_iova()

2022-03-29 Thread Rob Clark
From: Rob Clark There was only a single user, which could just as easily stash the iova when pinning. Signed-off-by: Rob Clark --- drivers/gpu/drm/msm/msm_fb.c | 16 ++-- drivers/gpu/drm/msm/msm_gem.c | 16 drivers/gpu/drm/msm/msm_gem.h | 2 -- 3 files changed, 1

[Freedreno] [PATCH 4/9] drm/msm/gem: Drop PAGE_SHIFT for address space mm

2022-03-29 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 --- drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 2 +- drivers/gpu/drm/msm/msm_gem.c | 5 ++--- drivers/gpu/drm/msm/msm_gem.h | 4 ++

[Freedreno] [PATCH 0/9] drm/msm: Userspace allocated GPU addresses

2022-03-29 Thread Rob Clark
From: Rob Clark The first five 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 us

[Freedreno] [PATCH 1/9] drm/msm/gem: Move prototypes

2022-03-29 Thread Rob Clark
From: Rob Clark These belong more cleanly in the gem header. Signed-off-by: Rob Clark --- drivers/gpu/drm/msm/msm_drv.h | 23 --- drivers/gpu/drm/msm/msm_gem.h | 22 ++ 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/drivers/gpu/drm/msm/

[Freedreno] [PATCH 2/9] drm/msm/gpu: Drop duplicate fence counter

2022-03-29 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 3/9] drm/msm/gem: Split out inuse helper

2022-03-29 Thread Rob Clark
From: Rob Clark Prep for a following patch. While we are at it, convert a few remaining WARN_ON()s to GEM_WARN_ON(). 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 | 15 ++- 3 file

Re: [Freedreno] [PATCH 3/3] drm/msm/dpu: drop VBIF indices

2022-03-29 Thread Abhinav Kumar
On 2/16/2022 7:45 PM, Dmitry Baryshkov wrote: We do not expect to have other VBIFs. Drop VBIF_n indices and always use VBIF_RT and VBIF_NRT. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar --- .../gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c| 4 +-- drivers/gpu/drm/msm/disp/d

Re: [Freedreno] [PATCH 2/3] drm/msm/dpu: fix error handling around dpu_hw_vbif_init

2022-03-29 Thread Abhinav Kumar
On 2/16/2022 7:45 PM, Dmitry Baryshkov wrote: 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. Moreover dpu_hw_vbif_init() function can not return NULL. So, replace corresponding IS_ERR_O

Re: [Freedreno] [PATCH 1/3] drm/msm/dpu: index dpu_kms->hw_vbif using vbif_idx

2022-03-29 Thread Abhinav Kumar
Assuming this series is newer and supersedes https://patchwork.freedesktop.org/patch/464353/?series=97307&rev=2, please check below. On 2/16/2022 7:45 PM, Dmitry Baryshkov wrote: Remove loops over hw_vbif. Instead always VBIF's idx as an index in the array. This fixes an error in dpu_kms_hw_in

Re: [Freedreno] [PATCH] drm: msm: add null pointer check

2022-03-29 Thread Abhinav Kumar
Seems to be a duplicate of https://patchwork.freedesktop.org/patch/479378/ Thanks Abhinav On 3/29/2022 3:34 AM, cgel@gmail.com wrote: From: Lv Ruyi kzalloc is a memory allocation function which can return NULL when some internal memory errors happen. Add null pointer check to avoid dere

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

2022-03-29 Thread Abhinav Kumar
Hi Liviu Gentle reminder ... Can you please help to clarify the last set of questions so that I can work on the next version? Thanks Abhinav On 3/25/2022 9:31 AM, Abhinav Kumar wrote: Hi Liviu On 3/25/2022 3:19 AM, Liviu Dudau wrote: On Thu, Mar 24, 2022 at 09:36:50AM -0700, Abhinav Kumar

Re: [Freedreno] [PATCH] dt-bindings: display: msm: dsi: remove address/size cells

2022-03-29 Thread Rob Herring
On Tue, Mar 29, 2022 at 12:01:52PM +0530, Vinod Koul wrote: > On 28-03-22, 13:21, Rob Herring wrote: > > On Mon, Mar 28, 2022 at 12:18 PM Krzysztof Kozlowski > > wrote: > > > > > > On 28/03/2022 19:16, Vinod Koul wrote: > > > > On 28-03-22, 19:43, Dmitry Baryshkov wrote: > > > >> On Mon, 28 Mar 20

[Freedreno] [PATCH] drm: msm: add null pointer check

2022-03-29 Thread cgel . zte
From: Lv Ruyi kzalloc is a memory allocation function which can return NULL when some internal memory errors happen. Add null pointer check to avoid dereferencing null pointer. Reported-by: Zeal Robot Signed-off-by: Lv Ruyi --- drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c | 2 ++ 1 file