summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/i915/i915_state_sampler.c
diff options
context:
space:
mode:
authorDaniel Vetter <[email protected]>2010-12-01 21:03:13 +0100
committerJakob Bornecrantz <[email protected]>2010-12-02 01:34:13 +0100
commitf34fd58ec92b9344982b4a5a4b9e05fe4b151a64 (patch)
treefbfaf2ef48fe511e773440a55f8e12ec6467bd51 /src/gallium/drivers/i915/i915_state_sampler.c
parenta95e694eaf3b40c86fbe8116fc3b5f1add365898 (diff)
i915g: implement unfenced relocs for textures using tiling bits
Signed-off-by: Daniel Vetter <[email protected]> Reviewed-by: Jakob Bornecrantz <[email protected]> Signed-off-by: Jakob Bornecrantz <[email protected]>
Diffstat (limited to 'src/gallium/drivers/i915/i915_state_sampler.c')
-rw-r--r--src/gallium/drivers/i915/i915_state_sampler.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/gallium/drivers/i915/i915_state_sampler.c b/src/gallium/drivers/i915/i915_state_sampler.c
index 9771274ca11..916cb767536 100644
--- a/src/gallium/drivers/i915/i915_state_sampler.c
+++ b/src/gallium/drivers/i915/i915_state_sampler.c
@@ -243,6 +243,23 @@ static uint translate_texture_format(enum pipe_format pipeFormat)
}
}
+static inline uint32_t
+ms3_tiling_bits(enum i915_winsys_buffer_tile tiling)
+{
+ uint32_t tiling_bits = 0;
+
+ switch (tiling) {
+ case I915_TILE_Y:
+ tiling_bits |= MS3_TILE_WALK_Y;
+ case I915_TILE_X:
+ tiling_bits |= MS3_TILED_SURFACE;
+ case I915_TILE_NONE:
+ break;
+ }
+
+ return tiling_bits;
+}
+
static void update_map(struct i915_context *i915,
uint unit,
const struct i915_texture *tex,
@@ -254,7 +271,6 @@ static void update_map(struct i915_context *i915,
const uint width = pt->width0, height = pt->height0, depth = pt->depth0;
const uint num_levels = pt->last_level;
unsigned max_lod = num_levels * 4;
- unsigned tiled = MS3_USE_FENCE_REGS;
assert(tex);
assert(width);
@@ -272,7 +288,7 @@ static void update_map(struct i915_context *i915,
(((height - 1) << MS3_HEIGHT_SHIFT)
| ((width - 1) << MS3_WIDTH_SHIFT)
| format
- | tiled);
+ | ms3_tiling_bits(tex->tiling));
/*
* XXX When min_filter != mag_filter and there's just one mipmap level,