From: Alex Deucher Subject: Re: [PATCH] drm/radeon/kms/r600: reduce gpu cache flushing Date: Thu, 4 Feb 2010 16:18:08 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.sourceforge.net To: Corbin Simpson Cc: DRI Development Mailing List List-Id: dri-devel@lists.freedesktop.org On Thu, Feb 4, 2010 at 3:59 PM, Corbin Simpson wrote: > Can we piggyback the mspos changes on the bump? I have discovered a legit > non-AA use for them so I would like them to be usable. > We can bump the version in the next merge window. Make sure you get your patches in by then. Alex > Posting from a mobile, pardon my terseness. ~ C. > > On Feb 4, 2010 8:07 AM, "Alex Deucher" wrote: > > >From 8ea32b7974dbcf819545f555ca078f709da5ff4e Mon Sep 17 00:00:00 2001 > From: Alex Deucher > Date: Thu, 4 Feb 2010 11:01:52 -0500 > Subject: [PATCH] drm/radeon/kms/r600: reduce gpu cache flushing > > Only flush the gpu caches before we submit a fence. > This leads to a small performance boost when we take > the extra gpu cache flushes out of the ddx and mesa. > Once this patch is in and the drm version is bumped, > we can remove the flushes from the ddx and drm. > > Also, remove the extra cache flushes from the blit > routine. > > Signed-off-by: Alex Deucher > --- > =A0drivers/gpu/drm/radeon/r600.c =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A07 ++= +++++ > =A0drivers/gpu/drm/radeon/r600_blit_kms.c =A0 =A0 | =A0 13 ++----------- > =A0drivers/gpu/drm/radeon/r600_blit_shaders.c | =A0 10 ---------- > =A03 files changed, 9 insertions(+), 21 deletions(-) > > diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c > index b833b4b..95a3261 100644 > --- a/drivers/gpu/drm/radeon/r600.c > +++ b/drivers/gpu/drm/radeon/r600.c > @@ -1777,6 +1777,13 @@ void r600_fence_ring_emit(struct radeon_device *rd= ev, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0struct radeon_fence *f= ence) > =A0{ > =A0 =A0 =A0 =A0/* Also consider EVENT_WRITE_EOP. =A0it handles the interr= upts + > timestamps + events */ > + > + =A0 =A0 =A0 radeon_ring_write(rdev, PACKET3(PACKET3_EVENT_WRITE, 0)); > + =A0 =A0 =A0 radeon_ring_write(rdev, CACHE_FLUSH_AND_INV_EVENT); > + =A0 =A0 =A0 /* wait for 3D idle clean */ > + =A0 =A0 =A0 radeon_ring_write(rdev, PACKET3(PACKET3_SET_CONFIG_REG, 1)); > + =A0 =A0 =A0 radeon_ring_write(rdev, (WAIT_UNTIL - PACKET3_SET_CONFIG_RE= G_OFFSET) >>> 2); > + =A0 =A0 =A0 radeon_ring_write(rdev, WAIT_3D_IDLE_bit | WAIT_3D_IDLECLEA= N_bit); > =A0 =A0 =A0 =A0/* Emit fence sequence & fire IRQ */ > =A0 =A0 =A0 =A0radeon_ring_write(rdev, PACKET3(PACKET3_SET_CONFIG_REG, 1)= ); > =A0 =A0 =A0 =A0radeon_ring_write(rdev, ((rdev->fence_drv.scratch_reg - > PACKET3_SET_CONFIG_REG_OFFSET) >> 2)); > diff --git a/drivers/gpu/drm/radeon/r600_blit_kms.c > b/drivers/gpu/drm/radeon/r600_blit_kms.c > index af1c3ca..2d7d16e 100644 > --- a/drivers/gpu/drm/radeon/r600_blit_kms.c > +++ b/drivers/gpu/drm/radeon/r600_blit_kms.c > @@ -403,8 +403,6 @@ set_default_state(struct radeon_device *rdev) > =A0 =A0 =A0 =A0radeon_ring_write(rdev, upper_32_bits(gpu_addr) & 0xFF); > =A0 =A0 =A0 =A0radeon_ring_write(rdev, dwords); > > - =A0 =A0 =A0 radeon_ring_write(rdev, PACKET3(PACKET3_EVENT_WRITE, 0)); > - =A0 =A0 =A0 radeon_ring_write(rdev, CACHE_FLUSH_AND_INV_EVENT); > =A0 =A0 =A0 =A0/* SQ config */ > =A0 =A0 =A0 =A0radeon_ring_write(rdev, PACKET3(PACKET3_SET_CONFIG_REG, 6)= ); > =A0 =A0 =A0 =A0radeon_ring_write(rdev, (SQ_CONFIG - PACKET3_SET_CONFIG_RE= G_OFFSET) >>> 2); > @@ -581,9 +579,9 @@ int r600_blit_prepare_copy(struct radeon_device > *rdev, int size_bytes) > =A0 =A0 =A0 =A0ring_size =3D num_loops * dwords_per_loop; > =A0 =A0 =A0 =A0/* set default =A0+ shaders */ > =A0 =A0 =A0 =A0ring_size +=3D 40; /* shaders + def state */ > - =A0 =A0 =A0 ring_size +=3D 7; /* fence emit for VB IB */ > + =A0 =A0 =A0 ring_size +=3D 12; /* fence emit for VB IB */ > =A0 =A0 =A0 =A0ring_size +=3D 5; /* done copy */ > - =A0 =A0 =A0 ring_size +=3D 7; /* fence emit for done copy */ > + =A0 =A0 =A0 ring_size +=3D 12; /* fence emit for done copy */ > =A0 =A0 =A0 =A0r =3D radeon_ring_lock(rdev, ring_size); > =A0 =A0 =A0 =A0if (r) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return r; > @@ -597,13 +595,6 @@ void r600_blit_done_copy(struct radeon_device > *rdev, struct radeon_fence *fence) > =A0{ > =A0 =A0 =A0 =A0int r; > > - =A0 =A0 =A0 radeon_ring_write(rdev, PACKET3(PACKET3_EVENT_WRITE, 0)); > - =A0 =A0 =A0 radeon_ring_write(rdev, CACHE_FLUSH_AND_INV_EVENT); > - =A0 =A0 =A0 /* wait for 3D idle clean */ > - =A0 =A0 =A0 radeon_ring_write(rdev, PACKET3(PACKET3_SET_CONFIG_REG, 1)); > - =A0 =A0 =A0 radeon_ring_write(rdev, (WAIT_UNTIL - PACKET3_SET_CONFIG_RE= G_OFFSET) >>> 2); > - =A0 =A0 =A0 radeon_ring_write(rdev, WAIT_3D_IDLE_bit | WAIT_3D_IDLECLEA= N_bit); > - > =A0 =A0 =A0 =A0if (rdev->r600_blit.vb_ib) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0r600_vb_ib_put(rdev); > > diff --git a/drivers/gpu/drm/radeon/r600_blit_shaders.c > b/drivers/gpu/drm/radeon/r600_blit_shaders.c > index d745e81..a112c59 100644 > --- a/drivers/gpu/drm/radeon/r600_blit_shaders.c > +++ b/drivers/gpu/drm/radeon/r600_blit_shaders.c > @@ -9,11 +9,6 @@ const u32 r6xx_default_state[] =3D > =A0 =A0 =A0 =A00xc0012800, > =A0 =A0 =A0 =A00x80000000, > =A0 =A0 =A0 =A00x80000000, > - =A0 =A0 =A0 0xc0004600, > - =A0 =A0 =A0 0x00000016, > - =A0 =A0 =A0 0xc0016800, > - =A0 =A0 =A0 0x00000010, > - =A0 =A0 =A0 0x00028000, > =A0 =A0 =A0 =A00xc0016800, > =A0 =A0 =A0 =A00x00000010, > =A0 =A0 =A0 =A00x00008000, > @@ -531,11 +526,6 @@ const u32 r7xx_default_state[] =3D > =A0 =A0 =A0 =A00xc0012800, > =A0 =A0 =A0 =A00x80000000, > =A0 =A0 =A0 =A00x80000000, > - =A0 =A0 =A0 0xc0004600, > - =A0 =A0 =A0 0x00000016, > - =A0 =A0 =A0 0xc0016800, > - =A0 =A0 =A0 0x00000010, > - =A0 =A0 =A0 0x00028000, > =A0 =A0 =A0 =A00xc0016800, > =A0 =A0 =A0 =A00x00000010, > =A0 =A0 =A0 =A00x00008000, > -- > 1.5.6.3 > > -------------------------------------------------------------------------= ----- > The Planet: dedicated and managed hosting, cloud storage, colocation > Stay online with enterprise data centers and the best network in the > business > Choose flexible plans and management services without long-term contracts > Personal 24x7 support from experience hosting pros just a phone call away. > http://p.sf.net/sfu/theplanet-com > -- > _______________________________________________ > Dri-devel mailing list > Dri-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/dri-devel > > ---------------------------------------------------------------------------= --- The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the busine= ss Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com --