[Mesa-dev] RFH and status of XvMC on r600g

Alex Deucher alexdeucher at gmail.com
Sun Jan 9 00:41:39 PST 2011


2011/1/8 Christian König <deathsimple at vodafone.de>:
> Hi,
>
> in the past couple of weeks i tried to optimize the shaders used for the
> iDCT and MC code. Beside optimizing the TGSI code for the shaders i
> optimized the TGSI->R600 code generation in r600g quite a bit:
>        * Removed the temporary register use from most instructions
>        * Optimize away CF_INST_POP
>        * Use special constants for 0, 1, -1, 1.0f, 0.5f etc
>        * Implement output modifiers and use them to further optimize
>        LRP
>        * Fixed TEX and VTX joining
>        * Optimize away CF ALU instructions even if type doesn't match
>        * Fix alu slot assignment
>        * Reworked and fixed bank swizzle code
>        * Implement replacing gpr with pv and ps
>        * Merging of alu slots into larger groups
>        * Reworked literal handling
>        * Implement register remapping
>        * Optimized away unneeded alu moves
>        * Rearanging and merging of export instructions
>        * Fully implemented barrier handling
>
> The end result still looks valid and gives a nice 25% speed increase for
> a 720x480p videos (probably a bit more because the the bottleneck is
> definitely the CPU now), but for 1280x1080i and 1920x1080i the increase
> is only around 7% and 5% with the cpu still quite idle.
>
> I assume that the bottleneck for the higher resolutions is the memory
> bandwidth caused by the access patterns the iDCT and MC code uses. I
> tried to enable tilling, but wasn't successfully so far, all i got when
> setting R600_FORCE_TILING is:
>
> Failed to allocate :
>   size      : 0 bytes
>   alignment : 0 bytes
>
> I updated the kernel and merged my branch with master on a regular
> basis, but still getting the same error.

I'm not sure what's causing that error off hand.  You'd have to track
down what the driver is trying to allocate that's failing.  I'm not
sure if the force tiling stuff works without some changes to the ddx.

>
> So what i'm missing? Do i need to update some other component, like
> libdrm for example? Is there any way to debug the memory bandwith usage
> of the GPU?

Using linear buffers is about the worse layout possible from the GPU's
perspective due to the design of the memory controller.  Ideally we
want to use 2D tiling for everything.  Try these patches which force
2D tiling and make sure you are using 2.6.37 or drm-next:
ddx:
http://people.freedesktop.org/~agd5f/all_2D_tiling.diff
mesa:
http://people.freedesktop.org/~agd5f/2D_tiling_mesa.diff

There's still some issues with 2D tiling handling of the Z buffer in
the r600g, but the rest is pretty solid.  Pageflipping should help as
well for fullscreen 3D:
http://cgit.freedesktop.org/xorg/driver/xf86-video-ati/log/?h=kms-pflip
but for that you'll need drm-next:
http://git.kernel.org/?p=linux/kernel/git/airlied/drm-2.6.git;a=shortlog;h=refs/heads/drm-next

Alex

>
> I'm currently a bit frustrated, because it looks like I'm stuck and
> can't improve the speed further. Any help would be very welcome.
>
> Regards,
> Christian.
>
>


More information about the mesa-dev mailing list