All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Stellard <tom@stellard.net>
To: "Deucher, Alexander" <Alexander.Deucher@amd.com>
Cc: Alex Deucher <alexdeucher@gmail.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [PATCH 1/2] drm/radeon: fix surface sync in fence on cayman
Date: Thu, 16 Jan 2014 15:37:12 -0800	[thread overview]
Message-ID: <20140116233712.GB10960@freedesktop.org> (raw)
In-Reply-To: <A3397C8B8B789E45844E7EC5DEAD89D03EC53C2D@satlexdag05.amd.com>

On Thu, Jan 16, 2014 at 11:30:14PM +0000, Deucher, Alexander wrote:
> > -----Original Message-----
> > From: Tom Stellard [mailto:tom@stellard.net]
> > Sent: Thursday, January 16, 2014 6:25 PM
> > To: Alex Deucher
> > Cc: dri-devel@lists.freedesktop.org; Deucher, Alexander;
> > stable@vger.kernel.org
> > Subject: Re: [PATCH 1/2] drm/radeon: fix surface sync in fence on cayman
> > 
> > On Thu, Jan 16, 2014 at 06:14:58PM -0500, Alex Deucher wrote:
> > > We need to set the engine bit to select the ME and
> > > also set the full cache bit.  Should help stability
> > > on TN and cayman.
> > >
> > > Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> > > Cc: stable@vger.kernel.org
> > > ---
> > >  drivers/gpu/drm/radeon/ni.c  | 7 +++----
> > >  drivers/gpu/drm/radeon/nid.h | 1 +
> > >  2 files changed, 4 insertions(+), 4 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c
> > > index 9f11a55..04e9516 100644
> > > --- a/drivers/gpu/drm/radeon/ni.c
> > > +++ b/drivers/gpu/drm/radeon/ni.c
> > > @@ -1319,13 +1319,12 @@ void cayman_fence_ring_emit(struct
> > radeon_device *rdev,
> > >  {
> > >  	struct radeon_ring *ring = &rdev->ring[fence->ring];
> > >  	u64 addr = rdev->fence_drv[fence->ring].gpu_addr;
> > > +	u32 cp_coher_cntl = PACKET3_FULL_CACHE_ENA |
> > PACKET3_TC_ACTION_ENA |
> > > +		PACKET3_SH_ACTION_ENA;
> > >
> > >  	/* flush read cache over gart for this vmid */
> > > -	radeon_ring_write(ring, PACKET3(PACKET3_SET_CONFIG_REG, 1));
> > > -	radeon_ring_write(ring, (CP_COHER_CNTL2 -
> > PACKET3_SET_CONFIG_REG_START) >> 2);
> > > -	radeon_ring_write(ring, 0);
> > >  	radeon_ring_write(ring, PACKET3(PACKET3_SURFACE_SYNC, 3));
> > > -	radeon_ring_write(ring, PACKET3_TC_ACTION_ENA |
> > PACKET3_SH_ACTION_ENA);
> > > +	radeon_ring_write(ring, PACKET3_ENGINE_ME | cp_coher_cntl);
> > >  	radeon_ring_write(ring, 0xFFFFFFFF);
> > >  	radeon_ring_write(ring, 0);
> > >  	radeon_ring_write(ring, 10); /* poll interval */
> > 
> > Doesn't this also need to be changed in cayman_ring_ib_execute() ?
> 
> Oh, yeah.  That also emits a surface sync packet.  I'm not sure why we need one there, but I'll fix that up too.
> 
> 
> > 
> > > diff --git a/drivers/gpu/drm/radeon/nid.h
> > b/drivers/gpu/drm/radeon/nid.h
> > > index 22421bc..d996033 100644
> > > --- a/drivers/gpu/drm/radeon/nid.h
> > > +++ b/drivers/gpu/drm/radeon/nid.h
> > > @@ -1154,6 +1154,7 @@
> > >  #              define PACKET3_DB_ACTION_ENA        (1 << 26)
> > >  #              define PACKET3_SH_ACTION_ENA        (1 << 27)
> > >  #              define PACKET3_SX_ACTION_ENA        (1 << 28)
> > > +#              define PACKET3_ENGINE_ME            (1 << 31)
> > 
> > Technically (1 << 31) is undefined.  It should be (1U << 31).
> 
> Hmmm... a lot of drivers do this pretty regularly.  I guess gcc does the right thing?
>

Yes, I've seen this all over the place, and I'm sure most compilers do
what everyone expects here.

-Tom

> Alex
> 
> > 
> > -Tom
> > 
> > >  #define	PACKET3_ME_INITIALIZE				0x44
> > >  #define		PACKET3_ME_INITIALIZE_DEVICE_ID(x) ((x) << 16)
> > >  #define	PACKET3_COND_WRITE				0x45
> > > --
> > > 1.8.3.1
> > >
> > > _______________________________________________
> > > dri-devel mailing list
> > > dri-devel@lists.freedesktop.org
> > > http://lists.freedesktop.org/mailman/listinfo/dri-devel
> 
> 

      reply	other threads:[~2014-01-16 23:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-16 23:14 [PATCH 1/2] drm/radeon: fix surface sync in fence on cayman Alex Deucher
2014-01-16 23:14 ` [PATCH 2/2] drm/radeon: set the full cache bit for fences on r7xx+ Alex Deucher
2014-01-16 23:24 ` [PATCH 1/2] drm/radeon: fix surface sync in fence on cayman Tom Stellard
2014-01-16 23:30   ` Deucher, Alexander
2014-01-16 23:37     ` Tom Stellard [this message]

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=20140116233712.GB10960@freedesktop.org \
    --to=tom@stellard.net \
    --cc=Alexander.Deucher@amd.com \
    --cc=alexdeucher@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=stable@vger.kernel.org \
    /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.