On Sat, 20 Nov 2010 22:43:56 +0100, Jakob Bornecrantz <wallbra...@gmail.com> 
wrote:
> On Fri, Nov 19, 2010 at 11:38 PM, Daniel Vetter <daniel.vet...@ffwll.ch> 
> wrote:
> >  #define BUF_3D_TILED_SURFACE   (1<<22)
> >  #define BUF_3D_TILE_WALK_X     0
> >  #define BUF_3D_TILE_WALK_Y     (1<<21)
> > +#define BUF_3D_TILE_BITS(tiling) (((tiling) ? BUF_3D_TILED_SURFACE : 0) \
> > +                               | ((tiling) == I915_TILE_Y ? 
> >  BUF_3D_TILE_WALK_Y : 0))
> 
> Hmm are textures never X tiled?

The macro is correct if rather obtuse. I prefer

static inline uint32_t i915_buf_tiling(uint32_t tiling)
{
        uint32_t v = 0;
        switch (tiling) {
        case I915_TILING_Y: v |= BUF_3D_TILE_WALK_Y;
        case I915_TILING_X: v |= BUF_3D_TILED_SURFACE;
        case I915_TILING_NONE: break;
        }
        return v;
}

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to