All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/radeon: fix PFP sync in vm_flush
@ 2012-10-16  9:02 Christian König
  2012-10-16 12:45 ` Alex Deucher
  0 siblings, 1 reply; 2+ messages in thread
From: Christian König @ 2012-10-16  9:02 UTC (permalink / raw)
  To: alexdeucher; +Cc: dri-devel

Otherwise the next IB might start reading commands
with the page table still invalid.

Signed-off-by: Christian König <deathsimple@vodafone.de>
---
 drivers/gpu/drm/radeon/ni.c  |    4 ++++
 drivers/gpu/drm/radeon/nid.h |    1 +
 drivers/gpu/drm/radeon/si.c  |    4 ++++
 3 files changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c
index 8c74c72..19b7fe1 100644
--- a/drivers/gpu/drm/radeon/ni.c
+++ b/drivers/gpu/drm/radeon/ni.c
@@ -1586,4 +1586,8 @@ void cayman_vm_flush(struct radeon_device *rdev, int ridx, struct radeon_vm *vm)
 	/* bits 0-7 are the VM contexts0-7 */
 	radeon_ring_write(ring, PACKET0(VM_INVALIDATE_REQUEST, 0));
 	radeon_ring_write(ring, 1 << vm->id);
+
+	/* sync PFP to ME, otherwise we might get invalid PFP reads */
+	radeon_ring_write(ring, PACKET3(PACKET3_PFP_SYNC_ME, 0));
+	radeon_ring_write(ring, 0x0);
 }
diff --git a/drivers/gpu/drm/radeon/nid.h b/drivers/gpu/drm/radeon/nid.h
index 2423d1b..cbef681 100644
--- a/drivers/gpu/drm/radeon/nid.h
+++ b/drivers/gpu/drm/radeon/nid.h
@@ -502,6 +502,7 @@
 #define	PACKET3_MPEG_INDEX				0x3A
 #define	PACKET3_WAIT_REG_MEM				0x3C
 #define	PACKET3_MEM_WRITE				0x3D
+#define	PACKET3_PFP_SYNC_ME				0x42
 #define	PACKET3_SURFACE_SYNC				0x43
 #              define PACKET3_CB0_DEST_BASE_ENA    (1 << 6)
 #              define PACKET3_CB1_DEST_BASE_ENA    (1 << 7)
diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c
index df8dd77..da184de 100644
--- a/drivers/gpu/drm/radeon/si.c
+++ b/drivers/gpu/drm/radeon/si.c
@@ -2868,6 +2868,10 @@ void si_vm_flush(struct radeon_device *rdev, int ridx, struct radeon_vm *vm)
 	radeon_ring_write(ring, VM_INVALIDATE_REQUEST >> 2);
 	radeon_ring_write(ring, 0);
 	radeon_ring_write(ring, 1 << vm->id);
+
+	/* sync PFP to ME, otherwise we might get invalid PFP reads */
+	radeon_ring_write(ring, PACKET3(PACKET3_PFP_SYNC_ME, 0));
+	radeon_ring_write(ring, 0x0);
 }
 
 /*
-- 
1.7.9.5

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/radeon: fix PFP sync in vm_flush
  2012-10-16  9:02 [PATCH] drm/radeon: fix PFP sync in vm_flush Christian König
@ 2012-10-16 12:45 ` Alex Deucher
  0 siblings, 0 replies; 2+ messages in thread
From: Alex Deucher @ 2012-10-16 12:45 UTC (permalink / raw)
  To: Christian König; +Cc: dri-devel

On Tue, Oct 16, 2012 at 5:02 AM, Christian König
<deathsimple@vodafone.de> wrote:
> Otherwise the next IB might start reading commands
> with the page table still invalid.
>
> Signed-off-by: Christian König <deathsimple@vodafone.de>

Looks good to me.  I'll add it to my -fixes queue.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

> ---
>  drivers/gpu/drm/radeon/ni.c  |    4 ++++
>  drivers/gpu/drm/radeon/nid.h |    1 +
>  drivers/gpu/drm/radeon/si.c  |    4 ++++
>  3 files changed, 9 insertions(+)
>
> diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c
> index 8c74c72..19b7fe1 100644
> --- a/drivers/gpu/drm/radeon/ni.c
> +++ b/drivers/gpu/drm/radeon/ni.c
> @@ -1586,4 +1586,8 @@ void cayman_vm_flush(struct radeon_device *rdev, int ridx, struct radeon_vm *vm)
>         /* bits 0-7 are the VM contexts0-7 */
>         radeon_ring_write(ring, PACKET0(VM_INVALIDATE_REQUEST, 0));
>         radeon_ring_write(ring, 1 << vm->id);
> +
> +       /* sync PFP to ME, otherwise we might get invalid PFP reads */
> +       radeon_ring_write(ring, PACKET3(PACKET3_PFP_SYNC_ME, 0));
> +       radeon_ring_write(ring, 0x0);
>  }
> diff --git a/drivers/gpu/drm/radeon/nid.h b/drivers/gpu/drm/radeon/nid.h
> index 2423d1b..cbef681 100644
> --- a/drivers/gpu/drm/radeon/nid.h
> +++ b/drivers/gpu/drm/radeon/nid.h
> @@ -502,6 +502,7 @@
>  #define        PACKET3_MPEG_INDEX                              0x3A
>  #define        PACKET3_WAIT_REG_MEM                            0x3C
>  #define        PACKET3_MEM_WRITE                               0x3D
> +#define        PACKET3_PFP_SYNC_ME                             0x42
>  #define        PACKET3_SURFACE_SYNC                            0x43
>  #              define PACKET3_CB0_DEST_BASE_ENA    (1 << 6)
>  #              define PACKET3_CB1_DEST_BASE_ENA    (1 << 7)
> diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c
> index df8dd77..da184de 100644
> --- a/drivers/gpu/drm/radeon/si.c
> +++ b/drivers/gpu/drm/radeon/si.c
> @@ -2868,6 +2868,10 @@ void si_vm_flush(struct radeon_device *rdev, int ridx, struct radeon_vm *vm)
>         radeon_ring_write(ring, VM_INVALIDATE_REQUEST >> 2);
>         radeon_ring_write(ring, 0);
>         radeon_ring_write(ring, 1 << vm->id);
> +
> +       /* sync PFP to ME, otherwise we might get invalid PFP reads */
> +       radeon_ring_write(ring, PACKET3(PACKET3_PFP_SYNC_ME, 0));
> +       radeon_ring_write(ring, 0x0);
>  }
>
>  /*
> --
> 1.7.9.5
>

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

end of thread, other threads:[~2012-10-16 12:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-16  9:02 [PATCH] drm/radeon: fix PFP sync in vm_flush Christian König
2012-10-16 12:45 ` Alex Deucher

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.