From: "Michel Dänzer" <michel@daenzer.net>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linuxppc-dev@lists.ozlabs.org,
o jordan <ojordan12345@hotmail.co.uk>,
Andreas Schwab <schwab@linux-m68k.org>
Subject: Re: PowerPC radeon KMS - is it possible?
Date: Wed, 18 Apr 2012 15:27:58 +0200 [thread overview]
Message-ID: <1334755678.5989.320.camel@thor.local> (raw)
In-Reply-To: <1334747877.3143.12.camel@pasglop>
On Mit, 2012-04-18 at 21:17 +1000, Benjamin Herrenschmidt wrote:=20
> On Wed, 2012-04-18 at 12:34 +0200, Michel D=C3=A4nzer wrote:
> > On Mit, 2012-04-18 at 20:20 +1000, Benjamin Herrenschmidt wrote:=20
> > > On Wed, 2012-04-18 at 10:02 +0200, Michel D=C3=A4nzer wrote:
> > > >=20
> > > > > GPU lockup appears to be a common problem with the radeon driver.
> > > >=20
> > > > It's what happens when anything goes wrong with the GPU. If it does=
n't
> > > > happen with agpmode=3D-1, it's probably an AGP related coherency is=
sue.=20
> > >=20
> > > I had some success hacking the DRM to do an in_le32 from the ring hea=
d
> > > after writing it. Just a gross hack but it seemed to help on a G5.
> >=20
> > AFAICT radeon_ring_commit() does that already:
> >=20
> > DRM_MEMORYBARRIER();
> > WREG32(ring->wptr_reg, (ring->wptr << ring->ptr_reg_shift) & ri=
ng->ptr_reg_mask);
> > (void)RREG32(ring->wptr_reg);
> >=20
> > We added the readback about a decade ago. :)
>=20
> Hrm, I have a different hack in that old tree I was playing with a while
> back, let me see...
>=20
> --- a/drivers/gpu/drm/radeon/radeon_cp.c
> +++ b/drivers/gpu/drm/radeon/radeon_cp.c
Note that radeon_cp.c is UMS code, for KMS you need to look at
radeon_ring.c.
> @@ -2245,6 +2245,9 @@ void radeon_commit_ring(drm_radeon_private_t
> *dev_priv)
> DRM_MEMORYBARRIER();
> GET_RING_HEAD( dev_priv );
> =20
> +#ifdef CONFIG_PPC
> + in_be32(dev_priv->ring.start);
> +#endif
> if ((dev_priv->flags & RADEON_FAMILY_MASK) >=3D CHIP_R600) {
>=20
>=20
> I think that my rational was to ensure that all previous stores to
> AGP (indirect buffers etc...) were pushed out & ordered vs the ring
> wptr update or something like that, bcs I think those path aren't well
> ordered in HW. In fact I suspect we might even need a bigger hammer than
> that in_be32().
Probably wouldn't hurt trying something like that in the KMS code as
well.
> Another hack I had around was removing the SBA reset from agp-uninorth
> completely on binding new pages, it seemed to cause hangs.
You mean like commit 5613beb46d54da6ef7f1c4589e9f2e60eeb10721? :)
> > > I suspect there's a fundamental design issue with apple bridge in tha=
t
> > > the CPU to memory path isn't coherent at all with the GPU to memory p=
ath
> > > ie. even vs. cache flush instructions (ie buffers in the memory
> > > controllers can still be out of sync).
> > >=20
> > > Darwin does some gross hacks to work around that, some of them visibl=
e
> > > in the AGP drivers, some burried in the Apple driver, I don't know fo=
r
> > > sure. It's possible that they end up mapping all AGP memory as cache
> > > inhibited, but we can't do that because of our linear mapping.
> >=20
> > We are doing that though...
>=20
> Are we really ? I thought we were taking existing cachable RAM objects
> and mapping them into the AGP gart.
No, the radeon driver has always mapped memory uncacheable to the CPU
while it's bound into the AGP GART.
> Are we replacing both kernel & user mappings for those objects with an
> equivalent cache inhibited mapping ?=20
>=20
> I'm not -that- familiar with how ttm works here.
I'm hardly more familiar with how it all works than you. :)
> In any case it can cause bus checkstops because the same pages can be
> prefetched into the cache via the linear mapping which is covered by
> BATs
So you've been saying for about a decade. :) But I've never seen any
problems tracked down to that.
> (unless you make your graphic objects HIGHMEM only but good luck with
> that :-)
FWIW I think TTM indeed prefers highmem pages for GPU access. The radeon
driver normally doesn't need kernel mappings for them.
--=20
Earthling Michel D=C3=A4nzer | http://www.amd.c=
om
Libre software enthusiast | Debian, X and DRI developer
next prev parent reply other threads:[~2012-04-18 13:28 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-17 19:49 PowerPC radeon KMS - is it possible? o jordan
2012-04-18 6:35 ` Michel Dänzer
2012-04-18 6:59 ` Benjamin Herrenschmidt
[not found] ` <1334730915.5989.265.camel__41553.0639271767$1334731329$gmane$org@thor.local>
2012-04-18 7:42 ` Andreas Schwab
2012-04-18 7:52 ` Michel Dänzer
2012-04-18 11:25 ` Andreas Schwab
2012-04-18 13:02 ` Michel Dänzer
2012-04-18 13:22 ` Andreas Schwab
2012-04-18 13:25 ` Michel Dänzer
2012-04-18 13:47 ` Andreas Schwab
2012-04-18 7:54 ` Andreas Schwab
2012-04-18 8:02 ` Michel Dänzer
2012-04-18 10:20 ` Benjamin Herrenschmidt
2012-04-18 10:34 ` Michel Dänzer
2012-04-18 10:44 ` Michel Dänzer
2012-04-18 11:19 ` Benjamin Herrenschmidt
2012-04-18 13:08 ` Michel Dänzer
2012-04-18 12:49 ` Andreas Schwab
2012-04-18 11:17 ` Benjamin Herrenschmidt
2012-04-18 13:27 ` Michel Dänzer [this message]
2012-04-18 11:30 ` Andreas Schwab
2012-04-18 13:38 ` Michel Dänzer
2012-04-18 14:28 ` Andreas Schwab
2012-04-18 14:31 ` Michel Dänzer
2012-04-18 14:55 ` Andreas Schwab
2012-04-18 15:01 ` Michel Dänzer
2012-04-18 15:49 ` Gerhard Pircher
2012-04-18 16:06 ` Michel Dänzer
2012-04-18 16:23 ` Gerhard Pircher
2012-04-19 6:32 ` Michel Dänzer
2012-04-19 11:48 ` Gerhard Pircher
2012-04-19 12:41 ` Michel Dänzer
2012-04-18 15:39 ` Andreas Schwab
[not found] ` <1334732346.1159.5.camel__22339.9641145535$1334732429$gmane$org@pasglop>
2012-04-18 7:46 ` Andreas Schwab
2012-04-18 10:35 ` Benjamin Herrenschmidt
2012-04-18 10:37 ` Benjamin Herrenschmidt
2012-04-18 10:54 ` Michel Dänzer
2012-04-18 11:23 ` Benjamin Herrenschmidt
2012-04-18 13:07 ` Michel Dänzer
2012-04-18 22:25 ` Benjamin Herrenschmidt
-- strict thread matches above, loose matches on Subject: below --
2012-04-20 11:15 Gerhard Pircher
2012-04-20 13:18 ` Michel Dänzer
2012-04-20 16:14 ` Gerhard Pircher
2012-04-23 9:56 ` Michel Dänzer
2012-04-23 16:45 ` Gerhard Pircher
2012-04-24 14:15 ` Michel Dänzer
2012-04-24 17:10 ` Gerhard Pircher
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=1334755678.5989.320.camel@thor.local \
--to=michel@daenzer.net \
--cc=benh@kernel.crashing.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=ojordan12345@hotmail.co.uk \
--cc=schwab@linux-m68k.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.