All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH xf86-video-intel] sna: Forcibly relinquish the GPU bo cache of a SHM pixmap on flushing
       [not found] <EoydNgW-S7xa7n3jQG150edg3gCUP2etA@mail.gmail.com>
@ 2020-04-17 14:05 ` Chris Wilson
  2020-04-17 19:26   ` Alexei Podtelezhnikov
  2020-04-17 19:33 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for " Patchwork
  1 sibling, 1 reply; 3+ messages in thread
From: Chris Wilson @ 2020-04-17 14:05 UTC (permalink / raw)
  To: intel-gfx; +Cc: Chris Wilson

Before we indicate return control of the SHM Pixmap to the client (that
is prior to the next XReply), we ensure that the original SHM buffer is
uptodate with any changes made on the GPU. We must flush the GPU writes
back to the CPU and so not allow ourselves to keep the dirty cache of
the CPU bo.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Alexei Podtelezhnikov <apodtele@gmail.com>
---
 src/sna/sna_accel.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index edbfe5a4a..6e14cf7b4 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -2119,6 +2119,11 @@ static inline bool operate_inplace(struct sna_pixmap *priv, unsigned flags)
 	if (!USE_INPLACE)
 		return false;
 
+	if (flags & __MOVE_FORCE) {
+		DBG(("%s: no, inplace operation denied by force\n", __FUNCTION__));
+		return false;
+	}
+
 	if ((flags & MOVE_INPLACE_HINT) == 0) {
 		DBG(("%s: no, inplace operation not suitable\n", __FUNCTION__));
 		return false;
@@ -2327,7 +2332,7 @@ skip_inplace_map:
 
 	sna_pixmap_unmap(pixmap, priv);
 
-	if (USE_INPLACE &&
+	if (USE_INPLACE && !(flags & __MOVE_FORCE) &&
 	    (flags & MOVE_WRITE ? (void *)priv->gpu_bo : (void *)priv->gpu_damage) && priv->cpu_damage == NULL &&
 	    priv->gpu_bo->tiling == I915_TILING_NONE &&
 	    (flags & MOVE_READ || kgem_bo_can_map__cpu(&sna->kgem, priv->gpu_bo, flags & MOVE_WRITE)) &&
@@ -17409,7 +17414,10 @@ void sna_accel_flush(struct sna *sna)
 			     priv->pixmap->refcnt));
 			assert(!priv->flush);
 			ret = sna_pixmap_move_to_cpu(priv->pixmap,
-						     MOVE_READ | MOVE_WRITE);
+						     MOVE_READ |
+						     MOVE_WRITE |
+						     MOVE_WHOLE_HINT |
+						     __MOVE_FORCE);
 			assert(!ret || priv->gpu_bo == NULL);
 			if (priv->pixmap->refcnt == 0) {
 				sna_damage_destroy(&priv->cpu_damage);
-- 
2.26.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Intel-gfx] [PATCH xf86-video-intel] sna: Forcibly relinquish the GPU bo cache of a SHM pixmap on flushing
  2020-04-17 14:05 ` [Intel-gfx] [PATCH xf86-video-intel] sna: Forcibly relinquish the GPU bo cache of a SHM pixmap on flushing Chris Wilson
@ 2020-04-17 19:26   ` Alexei Podtelezhnikov
  0 siblings, 0 replies; 3+ messages in thread
From: Alexei Podtelezhnikov @ 2020-04-17 19:26 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

On Fri, Apr 17, 2020 at 10:05 AM Chris Wilson <chris@chris-wilson.co.uk> wrote:
>
> Before we indicate return control of the SHM Pixmap to the client (that
> is prior to the next XReply), we ensure that the original SHM buffer is
> uptodate with any changes made on the GPU. We must flush the GPU writes
> back to the CPU and so not allow ourselves to keep the dirty cache of
> the CPU bo.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Alexei Podtelezhnikov <apodtele@gmail.com>

The failed assertion is gone.

Tested-by: Alexei Podtelezhnikov <apodtele@gmail.com>

> ---
>  src/sna/sna_accel.c | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
> index edbfe5a4a..6e14cf7b4 100644
> --- a/src/sna/sna_accel.c
> +++ b/src/sna/sna_accel.c
> @@ -2119,6 +2119,11 @@ static inline bool operate_inplace(struct sna_pixmap *priv, unsigned flags)
>         if (!USE_INPLACE)
>                 return false;
>
> +       if (flags & __MOVE_FORCE) {
> +               DBG(("%s: no, inplace operation denied by force\n", __FUNCTION__));
> +               return false;
> +       }
> +
>         if ((flags & MOVE_INPLACE_HINT) == 0) {
>                 DBG(("%s: no, inplace operation not suitable\n", __FUNCTION__));
>                 return false;
> @@ -2327,7 +2332,7 @@ skip_inplace_map:
>
>         sna_pixmap_unmap(pixmap, priv);
>
> -       if (USE_INPLACE &&
> +       if (USE_INPLACE && !(flags & __MOVE_FORCE) &&
>             (flags & MOVE_WRITE ? (void *)priv->gpu_bo : (void *)priv->gpu_damage) && priv->cpu_damage == NULL &&
>             priv->gpu_bo->tiling == I915_TILING_NONE &&
>             (flags & MOVE_READ || kgem_bo_can_map__cpu(&sna->kgem, priv->gpu_bo, flags & MOVE_WRITE)) &&
> @@ -17409,7 +17414,10 @@ void sna_accel_flush(struct sna *sna)
>                              priv->pixmap->refcnt));
>                         assert(!priv->flush);
>                         ret = sna_pixmap_move_to_cpu(priv->pixmap,
> -                                                    MOVE_READ | MOVE_WRITE);
> +                                                    MOVE_READ |
> +                                                    MOVE_WRITE |
> +                                                    MOVE_WHOLE_HINT |
> +                                                    __MOVE_FORCE);
>                         assert(!ret || priv->gpu_bo == NULL);
>                         if (priv->pixmap->refcnt == 0) {
>                                 sna_damage_destroy(&priv->cpu_damage);
> --
> 2.26.0
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Intel-gfx] ✗ Fi.CI.BUILD: failure for sna: Forcibly relinquish the GPU bo cache of a SHM pixmap on flushing
       [not found] <EoydNgW-S7xa7n3jQG150edg3gCUP2etA@mail.gmail.com>
  2020-04-17 14:05 ` [Intel-gfx] [PATCH xf86-video-intel] sna: Forcibly relinquish the GPU bo cache of a SHM pixmap on flushing Chris Wilson
@ 2020-04-17 19:33 ` Patchwork
  1 sibling, 0 replies; 3+ messages in thread
From: Patchwork @ 2020-04-17 19:33 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: sna: Forcibly relinquish the GPU bo cache of a SHM pixmap on flushing
URL   : https://patchwork.freedesktop.org/series/76099/
State : failure

== Summary ==

Applying: sna: Forcibly relinquish the GPU bo cache of a SHM pixmap on flushing
error: sha1 information is lacking or useless (src/sna/sna_accel.c).
error: could not build fake ancestor
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 sna: Forcibly relinquish the GPU bo cache of a SHM pixmap on flushing
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-04-17 19:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <EoydNgW-S7xa7n3jQG150edg3gCUP2etA@mail.gmail.com>
2020-04-17 14:05 ` [Intel-gfx] [PATCH xf86-video-intel] sna: Forcibly relinquish the GPU bo cache of a SHM pixmap on flushing Chris Wilson
2020-04-17 19:26   ` Alexei Podtelezhnikov
2020-04-17 19:33 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for " Patchwork

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.