[Mesa-dev] [PATCH] r600g: Take care of bo placement domains.
Michel Dänzer
michel at daenzer.net
Mon May 2 04:14:02 PDT 2011
On Sam, 2011-04-30 at 08:07 +0200, Mathias Fröhlich wrote:
>
> For creating and reusing already existing buffer objects,
> take care of the placement domains.
> Have a little more finegrained usage to placement mapping.
>
> This change does not account for the real location of the
> buffer object for buffer objects returned from r600_bomgr.
> But it greatly increases the probability to get buffers
> that already have the desired placement.
>
> This change avoids plenty of gpu uploads on command
> stream emission. Which in turn avoids plenty of implicit
> syncronization on the upload fences. Which, as a whole,
> turns into a noticable performance gain.
[...]
> diff --git a/src/gallium/winsys/r600/drm/r600_bomgr.c b/src/gallium/winsys/r600/drm/r600_bomgr.c
> index 446ef0f..c6ed737 100644
> --- a/src/gallium/winsys/r600/drm/r600_bomgr.c
> +++ b/src/gallium/winsys/r600/drm/r600_bomgr.c
> @@ -53,12 +53,17 @@ static INLINE int r600_bo_is_compat(struct r600_bomgr *mgr,
> struct r600_bo *bo,
> unsigned size,
> unsigned alignment,
> + unsigned domains,
> unsigned cfence)
> {
> if(bo->size < size) {
> return 0;
> }
>
> + if(bo->domains != domains) {
> + return 0;
> + }
I wonder if this test isn't too strict, i.e. if there aren't cases where
the values aren't identical, but where the BO should still be considered
compatible, e.g. because one is a subset of the other. But the patch is
probably an improvement regardless, and this could always be improved
later on.
--
Earthling Michel Dänzer | http://www.vmware.com
Libre software enthusiast | Debian, X and DRI developer
More information about the mesa-dev
mailing list