[Freedreno] [PATCH 1/2] drm/msm: drop unused ring variable in msm_ioctl_gem_submit()

Rob Clark robdclark at gmail.com
Wed Feb 22 17:47:05 UTC 2023


On Fri, Feb 17, 2023 at 5:25 PM Dmitry Baryshkov
<dmitry.baryshkov at linaro.org> wrote:
>
> The variable ring is not used by msm_parse_deps() and
> msm_ioctl_gem_submit() and thus can be dropped.
>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov at linaro.org>
> ---
>  drivers/gpu/drm/msm/msm_gem_submit.c | 10 +++-------
>  drivers/gpu/drm/msm/msm_gpu_trace.h  | 10 ++++------
>  2 files changed, 7 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/msm_gem_submit.c b/drivers/gpu/drm/msm/msm_gem_submit.c
> index ac8ed731f76d..a539eb31042f 100644
> --- a/drivers/gpu/drm/msm/msm_gem_submit.c
> +++ b/drivers/gpu/drm/msm/msm_gem_submit.c
> @@ -550,8 +550,7 @@ static struct drm_syncobj **msm_parse_deps(struct msm_gem_submit *submit,
>                                             struct drm_file *file,
>                                             uint64_t in_syncobjs_addr,
>                                             uint32_t nr_in_syncobjs,
> -                                           size_t syncobj_stride,
> -                                           struct msm_ringbuffer *ring)
> +                                           size_t syncobj_stride)
>  {
>         struct drm_syncobj **syncobjs = NULL;
>         struct drm_msm_gem_submit_syncobj syncobj_desc = {0};
> @@ -722,7 +721,6 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data,
>         struct msm_gem_submit *submit;
>         struct msm_gpu *gpu = priv->gpu;
>         struct msm_gpu_submitqueue *queue;
> -       struct msm_ringbuffer *ring;
>         struct msm_submit_post_dep *post_deps = NULL;
>         struct drm_syncobj **syncobjs_to_reset = NULL;
>         int out_fence_fd = -1;
> @@ -760,8 +758,6 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data,
>         if (!queue)
>                 return -ENOENT;
>
> -       ring = gpu->rb[queue->ring_nr];
> -
>         if (args->flags & MSM_SUBMIT_FENCE_FD_OUT) {
>                 out_fence_fd = get_unused_fd_flags(O_CLOEXEC);
>                 if (out_fence_fd < 0) {
> @@ -774,7 +770,7 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data,
>         if (IS_ERR(submit))
>                 return PTR_ERR(submit);
>
> -       trace_msm_gpu_submit(pid_nr(submit->pid), ring->id, submit->ident,
> +       trace_msm_gpu_submit(pid_nr(submit->pid), submit->ident,
>                 args->nr_bos, args->nr_cmds);

Please don't remove things from the tracepoint, we have userspace
tools that use the tracepoints..

Other parts look ok.

BR,
-R

>
>         ret = mutex_lock_interruptible(&queue->lock);
> @@ -803,7 +799,7 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data,
>                 syncobjs_to_reset = msm_parse_deps(submit, file,
>                                                    args->in_syncobjs,
>                                                    args->nr_in_syncobjs,
> -                                                  args->syncobj_stride, ring);
> +                                                  args->syncobj_stride);
>                 if (IS_ERR(syncobjs_to_reset)) {
>                         ret = PTR_ERR(syncobjs_to_reset);
>                         goto out_unlock;
> diff --git a/drivers/gpu/drm/msm/msm_gpu_trace.h b/drivers/gpu/drm/msm/msm_gpu_trace.h
> index ac40d857bc45..12ef10f1de4c 100644
> --- a/drivers/gpu/drm/msm/msm_gpu_trace.h
> +++ b/drivers/gpu/drm/msm/msm_gpu_trace.h
> @@ -9,24 +9,22 @@
>  #define TRACE_INCLUDE_FILE msm_gpu_trace
>
>  TRACE_EVENT(msm_gpu_submit,
> -           TP_PROTO(pid_t pid, u32 ringid, u32 id, u32 nr_bos, u32 nr_cmds),
> -           TP_ARGS(pid, ringid, id, nr_bos, nr_cmds),
> +           TP_PROTO(pid_t pid, u32 id, u32 nr_bos, u32 nr_cmds),
> +           TP_ARGS(pid, id, nr_bos, nr_cmds),
>             TP_STRUCT__entry(
>                     __field(pid_t, pid)
>                     __field(u32, id)
> -                   __field(u32, ringid)
>                     __field(u32, nr_cmds)
>                     __field(u32, nr_bos)
>                     ),
>             TP_fast_assign(
>                     __entry->pid = pid;
>                     __entry->id = id;
> -                   __entry->ringid = ringid;
>                     __entry->nr_bos = nr_bos;
>                     __entry->nr_cmds = nr_cmds
>                     ),
> -           TP_printk("id=%d pid=%d ring=%d bos=%d cmds=%d",
> -                   __entry->id, __entry->pid, __entry->ringid,
> +           TP_printk("id=%d pid=%d bos=%d cmds=%d",
> +                   __entry->id, __entry->pid,
>                     __entry->nr_bos, __entry->nr_cmds)
>  );
>
> --
> 2.39.1
>


More information about the Freedreno mailing list