All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Gmeiner <christian.gmeiner@gmail.com>
To: Lucas Stach <l.stach@pengutronix.de>
Cc: DRI mailing list <dri-devel@lists.freedesktop.org>,
	Russell King <linux+etnaviv@armlinux.org.uk>,
	The etnaviv authors <etnaviv@lists.freedesktop.org>,
	Sascha Hauer <kernel@pengutronix.de>,
	patchwork-lst@pengutronix.de
Subject: Re: [PATCH 10/27] drm/etnaviv: remove switch_context member from etnaviv_gpu
Date: Mon, 11 Dec 2017 11:51:12 +0100	[thread overview]
Message-ID: <CAH9NwWexonTnGJ++wFMHiZtMxRS-zuZj7EAz6PWYGOyw2fsvMw@mail.gmail.com> (raw)
In-Reply-To: <20171201103624.6565-11-l.stach@pengutronix.de>

2017-12-01 11:36 GMT+01:00 Lucas Stach <l.stach@pengutronix.de>:
> There is no need to store this in the gpu struct. MMU flushes are triggered
> correctly in reaction to MMU maps and unmaps, independent of the current ctx
> and required pipe switches can be infered from the current and the desired
> GPU exec state.
>
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>

Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>

> ---
>  drivers/gpu/drm/etnaviv/etnaviv_buffer.c | 10 ++++++----
>  drivers/gpu/drm/etnaviv/etnaviv_gpu.c    |  8 +-------
>  drivers/gpu/drm/etnaviv/etnaviv_gpu.h    |  1 -
>  3 files changed, 7 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_buffer.c b/drivers/gpu/drm/etnaviv/etnaviv_buffer.c
> index 9e7098e3207f..6ad8972a59cc 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_buffer.c
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_buffer.c
> @@ -294,6 +294,7 @@ void etnaviv_buffer_queue(struct etnaviv_gpu *gpu, unsigned int event,
>         unsigned int waitlink_offset = buffer->user_size - 16;
>         u32 return_target, return_dwords;
>         u32 link_target, link_dwords;
> +       bool switch_context = gpu->exec_state != cmdbuf->exec_state;
>
>         if (drm_debug & DRM_UT_DRIVER)
>                 etnaviv_buffer_dump(gpu, buffer, 0, 0x50);
> @@ -306,7 +307,7 @@ void etnaviv_buffer_queue(struct etnaviv_gpu *gpu, unsigned int event,
>          * need to append a mmu flush load state, followed by a new
>          * link to this buffer - a total of four additional words.
>          */
> -       if (gpu->mmu->need_flush || gpu->switch_context) {
> +       if (gpu->mmu->need_flush || switch_context) {
>                 u32 target, extra_dwords;
>
>                 /* link command */
> @@ -321,7 +322,7 @@ void etnaviv_buffer_queue(struct etnaviv_gpu *gpu, unsigned int event,
>                 }
>
>                 /* pipe switch commands */
> -               if (gpu->switch_context)
> +               if (switch_context)
>                         extra_dwords += 4;
>
>                 target = etnaviv_buffer_reserve(gpu, buffer, extra_dwords);
> @@ -349,10 +350,9 @@ void etnaviv_buffer_queue(struct etnaviv_gpu *gpu, unsigned int event,
>                         gpu->mmu->need_flush = false;
>                 }
>
> -               if (gpu->switch_context) {
> +               if (switch_context) {
>                         etnaviv_cmd_select_pipe(gpu, buffer, cmdbuf->exec_state);
>                         gpu->exec_state = cmdbuf->exec_state;
> -                       gpu->switch_context = false;
>                 }
>
>                 /* And the link to the submitted buffer */
> @@ -421,4 +421,6 @@ void etnaviv_buffer_queue(struct etnaviv_gpu *gpu, unsigned int event,
>
>         if (drm_debug & DRM_UT_DRIVER)
>                 etnaviv_buffer_dump(gpu, buffer, 0, 0x50);
> +
> +       gpu->lastctx = cmdbuf->ctx;
>  }
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> index ae152bb78f18..65eaa8c10ba2 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> @@ -1416,12 +1416,6 @@ int etnaviv_gpu_submit(struct etnaviv_gpu *gpu,
>         submit->fence = dma_fence_get(fence);
>         gpu->active_fence = submit->fence->seqno;
>
> -       if (gpu->lastctx != cmdbuf->ctx) {
> -               gpu->mmu->need_flush = true;
> -               gpu->switch_context = true;
> -               gpu->lastctx = cmdbuf->ctx;
> -       }
> -
>         if (cmdbuf->nr_pmrs) {
>                 gpu->event[event[1]].sync_point = &sync_point_perfmon_sample_pre;
>                 gpu->event[event[1]].cmdbuf = cmdbuf;
> @@ -1662,7 +1656,7 @@ static int etnaviv_gpu_hw_resume(struct etnaviv_gpu *gpu)
>         etnaviv_gpu_update_clock(gpu);
>         etnaviv_gpu_hw_init(gpu);
>
> -       gpu->switch_context = true;
> +       gpu->lastctx = NULL;
>         gpu->exec_state = -1;
>
>         mutex_unlock(&gpu->lock);
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.h b/drivers/gpu/drm/etnaviv/etnaviv_gpu.h
> index 4f10f147297a..15090bb68f5a 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.h
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.h
> @@ -106,7 +106,6 @@ struct etnaviv_gpu {
>         struct mutex lock;
>         struct etnaviv_chip_identity identity;
>         struct etnaviv_file_private *lastctx;
> -       bool switch_context;
>
>         /* 'ring'-buffer: */
>         struct etnaviv_cmdbuf *buffer;
> --
> 2.11.0
>
> _______________________________________________
> etnaviv mailing list
> etnaviv@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/etnaviv



-- 
greets
--
Christian Gmeiner, MSc

https://christian-gmeiner.info
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2017-12-11 10:51 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-01 10:35 [PATCH 00/27] Etnaviv job lifetime issue fixes Lucas Stach
2017-12-01 10:35 ` [PATCH 01/27] drm/etnaviv: fix GPU vs sync point race Lucas Stach
2017-12-01 11:33   ` Philipp Zabel
2017-12-11  7:47   ` Christian Gmeiner
2017-12-01 10:35 ` [PATCH 02/27] drm/etnaviv: split obj locks in different classes depending on the obj type Lucas Stach
2017-12-01 11:33   ` Philipp Zabel
2017-12-11  7:48   ` Christian Gmeiner
2017-12-01 10:36 ` [PATCH 03/27] drm/etnaviv: add lockdep annotation for userptr object population Lucas Stach
2017-12-11 10:46   ` Christian Gmeiner
2017-12-01 10:36 ` [PATCH 04/27] drm/etnaviv: fold __etnaviv_gem_new into caller Lucas Stach
2017-12-01 11:34   ` Philipp Zabel
2017-12-11 10:47   ` Christian Gmeiner
2017-12-01 10:36 ` [PATCH 05/27] drm/etnaviv: change return type of etnaviv_gem_obj_add to void Lucas Stach
2017-12-01 11:34   ` Philipp Zabel
2017-12-11 10:47   ` Christian Gmeiner
2017-12-01 10:36 ` [PATCH 06/27] drm/etnaviv: get rid of userptr worker Lucas Stach
2017-12-01 16:38   ` Philipp Zabel
2017-12-01 16:51     ` Russell King - ARM Linux
2017-12-01 17:02       ` Lucas Stach
2017-12-01 10:36 ` [PATCH 07/27] drm/etnaviv: remove -EAGAIN handling from submit path Lucas Stach
2017-12-01 16:39   ` Philipp Zabel
2017-12-01 10:36 ` [PATCH 08/27] drm/etnaviv: remove stale TODO in etnaviv_gpu_submit Lucas Stach
2017-12-11 10:49   ` Christian Gmeiner
2017-12-01 10:36 ` [PATCH 09/27] drm/etnaviv: don't flush workqueue in etnaviv_gpu_wait_obj_inactive Lucas Stach
2017-12-01 16:39   ` Philipp Zabel
2017-12-01 16:59   ` Russell King - ARM Linux
2017-12-01 17:12     ` Lucas Stach
2017-12-01 10:36 ` [PATCH 10/27] drm/etnaviv: remove switch_context member from etnaviv_gpu Lucas Stach
2017-12-01 16:40   ` Philipp Zabel
2017-12-11 10:51   ` Christian Gmeiner [this message]
2017-12-01 10:36 ` [PATCH 11/27] drm/etnaviv: move workqueue to be per GPU Lucas Stach
2017-12-01 16:42   ` Philipp Zabel
2017-12-01 10:36 ` [PATCH 12/27] drm/etnaviv: hold GPU lock while inserting END command Lucas Stach
2017-12-01 16:43   ` Philipp Zabel
2017-12-11 10:48   ` Christian Gmeiner
2017-12-01 10:36 ` [PATCH 13/27] drm/etnaviv: add lockdep annotations to buffer manipulation functions Lucas Stach
2017-12-01 16:47   ` Philipp Zabel
2017-12-01 10:36 ` [PATCH 14/27] drm/etnaviv: simplify submit_create Lucas Stach
2017-12-01 16:47   ` Philipp Zabel
2017-12-01 10:36 ` [PATCH 15/27] drm/etnaviv: move object fence attachment to gem_submit path Lucas Stach
2017-12-11  9:17   ` Philipp Zabel
2017-12-01 10:36 ` [PATCH 16/27] drm/etnaviv: rename submit fence to out_fence Lucas Stach
2017-12-01 10:36 ` [PATCH 17/27] drm/etnaviv: attach in fence to submit and move fence wait to fence_sync Lucas Stach
2017-12-11  9:20   ` Philipp Zabel
2017-12-01 10:36 ` [PATCH 18/27] drm/etnaviv: move object unpinning to submit cleanup Lucas Stach
2017-12-11  9:23   ` Philipp Zabel
2017-12-01 10:36 ` [PATCH 19/27] drm/etnaviv: move ww_acquire_ctx out of submit object Lucas Stach
2017-12-15 18:34   ` Philipp Zabel
2017-12-01 10:36 ` [PATCH 20/27] drm/etnaviv: refcount the " Lucas Stach
2017-12-11 12:41   ` Philipp Zabel
2017-12-01 10:36 ` [PATCH 21/27] drm/etnaviv: move PMRs to " Lucas Stach
2017-12-01 10:36 ` [PATCH 22/27] drm/etnaviv: move exec_state " Lucas Stach
2017-12-01 10:36 ` [PATCH 23/27] drm/etnaviv: use submit exec_state for perfmon sampling Lucas Stach
2017-12-01 10:36 ` [PATCH 24/27] drm/etnaviv: move cmdbuf into submit object Lucas Stach
2017-12-01 10:36 ` [PATCH 25/27] drm/etnaviv: move GPU active handling to bo pin/unpin Lucas Stach
2017-12-01 10:36 ` [PATCH 26/27] drm/etnaviv: couple runtime PM management to submit object lifetime Lucas Stach
2017-12-01 10:36 ` [PATCH 27/27] drm/etnaviv: re-enable perfmon support Lucas Stach

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAH9NwWexonTnGJ++wFMHiZtMxRS-zuZj7EAz6PWYGOyw2fsvMw@mail.gmail.com \
    --to=christian.gmeiner@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=etnaviv@lists.freedesktop.org \
    --cc=kernel@pengutronix.de \
    --cc=l.stach@pengutronix.de \
    --cc=linux+etnaviv@armlinux.org.uk \
    --cc=patchwork-lst@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.