diff mbox series

drm/msm/gpu: fix bo size for msm_rbmemptrs

Message ID 20181220184702.103067-1-olvaffe@gmail.com (mailing list archive)
State New, archived
Headers show
Series drm/msm/gpu: fix bo size for msm_rbmemptrs | expand

Commit Message

Chia-I Wu Dec. 20, 2018, 6:47 p.m. UTC
memptrs_bo is used to store msm_rbmemptrs.  Size it correctly.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
---
 drivers/gpu/drm/msm/msm_gpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jordan Crouse Dec. 20, 2018, 7:47 p.m. UTC | #1
On Thu, Dec 20, 2018 at 10:47:02AM -0800, Chia-I Wu wrote:
> memptrs_bo is used to store msm_rbmemptrs.  Size it correctly.
> 
> Signed-off-by: Chia-I Wu <olvaffe@gmail.com>

Thanks for your patch. I'm really glad somebody is looking seriously at this
code.  We have this in msm-next:

https://cgit.freedesktop.org/~robclark/linux/commit/?h=msm-next&id=546ec7b471bcae78463426a218b8c7f35bbb71f4

I think that might fix your concern?

Jordan

> ---
>  drivers/gpu/drm/msm/msm_gpu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c
> index 11aac8337066..d23049eb29c4 100644
> --- a/drivers/gpu/drm/msm/msm_gpu.c
> +++ b/drivers/gpu/drm/msm/msm_gpu.c
> @@ -917,7 +917,7 @@ int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev,
>  		goto fail;
>  	}
>  
> -	memptrs = msm_gem_kernel_new(drm, sizeof(*gpu->memptrs_bo),
> +	memptrs = msm_gem_kernel_new(drm, sizeof(struct msm_rbmemptrs) * nr_rings,
>  		MSM_BO_UNCACHED, gpu->aspace, &gpu->memptrs_bo,
>  		&memptrs_iova);
>  
> -- 
> 2.18.1
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
Chia-I Wu Dec. 21, 2018, 12:10 a.m. UTC | #2
Ah, thanks.  I was on drm-next branch.  I will switch to msm-next.

On Thu, Dec 20, 2018 at 11:47 AM Jordan Crouse <jcrouse@codeaurora.org>
wrote:

> On Thu, Dec 20, 2018 at 10:47:02AM -0800, Chia-I Wu wrote:
> > memptrs_bo is used to store msm_rbmemptrs.  Size it correctly.
> >
> > Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
>
> Thanks for your patch. I'm really glad somebody is looking seriously at
> this
> code.  We have this in msm-next:
>
>
> https://cgit.freedesktop.org/~robclark/linux/commit/?h=msm-next&id=546ec7b471bcae78463426a218b8c7f35bbb71f4
>
> I think that might fix your concern?
>
> Jordan
>
> > ---
> >  drivers/gpu/drm/msm/msm_gpu.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/msm/msm_gpu.c
> b/drivers/gpu/drm/msm/msm_gpu.c
> > index 11aac8337066..d23049eb29c4 100644
> > --- a/drivers/gpu/drm/msm/msm_gpu.c
> > +++ b/drivers/gpu/drm/msm/msm_gpu.c
> > @@ -917,7 +917,7 @@ int msm_gpu_init(struct drm_device *drm, struct
> platform_device *pdev,
> >               goto fail;
> >       }
> >
> > -     memptrs = msm_gem_kernel_new(drm, sizeof(*gpu->memptrs_bo),
> > +     memptrs = msm_gem_kernel_new(drm, sizeof(struct msm_rbmemptrs) *
> nr_rings,
> >               MSM_BO_UNCACHED, gpu->aspace, &gpu->memptrs_bo,
> >               &memptrs_iova);
> >
> > --
> > 2.18.1
> >
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/dri-devel
>
> --
> The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
> a Linux Foundation Collaborative Project
>
<div dir="ltr">Ah, thanks.  I was on drm-next branch.  I will switch to msm-next.</div><br><div class="gmail_quote"><div dir="ltr">On Thu, Dec 20, 2018 at 11:47 AM Jordan Crouse &lt;<a href="mailto:jcrouse@codeaurora.org">jcrouse@codeaurora.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Thu, Dec 20, 2018 at 10:47:02AM -0800, Chia-I Wu wrote:<br>
&gt; memptrs_bo is used to store msm_rbmemptrs.  Size it correctly.<br>
&gt; <br>
&gt; Signed-off-by: Chia-I Wu &lt;<a href="mailto:olvaffe@gmail.com" target="_blank">olvaffe@gmail.com</a>&gt;<br>
<br>
Thanks for your patch. I&#39;m really glad somebody is looking seriously at this<br>
code.  We have this in msm-next:<br>
<br>
<a href="https://cgit.freedesktop.org/~robclark/linux/commit/?h=msm-next&amp;id=546ec7b471bcae78463426a218b8c7f35bbb71f4" rel="noreferrer" target="_blank">https://cgit.freedesktop.org/~robclark/linux/commit/?h=msm-next&amp;id=546ec7b471bcae78463426a218b8c7f35bbb71f4</a><br>
<br>
I think that might fix your concern?<br>
<br>
Jordan<br>
<br>
&gt; ---<br>
&gt;  drivers/gpu/drm/msm/msm_gpu.c | 2 +-<br>
&gt;  1 file changed, 1 insertion(+), 1 deletion(-)<br>
&gt; <br>
&gt; diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c<br>
&gt; index 11aac8337066..d23049eb29c4 100644<br>
&gt; --- a/drivers/gpu/drm/msm/msm_gpu.c<br>
&gt; +++ b/drivers/gpu/drm/msm/msm_gpu.c<br>
&gt; @@ -917,7 +917,7 @@ int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev,<br>
&gt;               goto fail;<br>
&gt;       }<br>
&gt;  <br>
&gt; -     memptrs = msm_gem_kernel_new(drm, sizeof(*gpu-&gt;memptrs_bo),<br>
&gt; +     memptrs = msm_gem_kernel_new(drm, sizeof(struct msm_rbmemptrs) * nr_rings,<br>
&gt;               MSM_BO_UNCACHED, gpu-&gt;aspace, &amp;gpu-&gt;memptrs_bo,<br>
&gt;               &amp;memptrs_iova);<br>
&gt;  <br>
&gt; -- <br>
&gt; 2.18.1<br>
&gt; <br>
&gt; _______________________________________________<br>
&gt; dri-devel mailing list<br>
&gt; <a href="mailto:dri-devel@lists.freedesktop.org" target="_blank">dri-devel@lists.freedesktop.org</a><br>
&gt; <a href="https://lists.freedesktop.org/mailman/listinfo/dri-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/dri-devel</a><br>
<br>
-- <br>
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,<br>
a Linux Foundation Collaborative Project<br>
</blockquote></div>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c
index 11aac8337066..d23049eb29c4 100644
--- a/drivers/gpu/drm/msm/msm_gpu.c
+++ b/drivers/gpu/drm/msm/msm_gpu.c
@@ -917,7 +917,7 @@  int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev,
 		goto fail;
 	}
 
-	memptrs = msm_gem_kernel_new(drm, sizeof(*gpu->memptrs_bo),
+	memptrs = msm_gem_kernel_new(drm, sizeof(struct msm_rbmemptrs) * nr_rings,
 		MSM_BO_UNCACHED, gpu->aspace, &gpu->memptrs_bo,
 		&memptrs_iova);