Mesa (master): i915g: Add cursor case for scanout layout
Jakob Bornecrantz
wallbraker at kemper.freedesktop.org
Fri Aug 28 20:41:31 UTC 2009
Module: Mesa
Branch: master
Commit: 55e7abf81f3c515919ef8ff69125c7aafd274716
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=55e7abf81f3c515919ef8ff69125c7aafd274716
Author: Jakob Bornecrantz <jakob at vmware.com>
Date: Fri Aug 28 22:39:29 2009 +0100
i915g: Add cursor case for scanout layout
---
src/gallium/drivers/i915simple/i915_texture.c | 25 +++++++++++++------------
1 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/src/gallium/drivers/i915simple/i915_texture.c b/src/gallium/drivers/i915simple/i915_texture.c
index 03f0e14..0dc6a54 100644
--- a/src/gallium/drivers/i915simple/i915_texture.c
+++ b/src/gallium/drivers/i915simple/i915_texture.c
@@ -171,26 +171,25 @@ i915_scanout_layout(struct i915_texture *tex)
1 );
i915_miptree_set_image_offset( tex, 0, 0, 0, 0 );
- if (tex->base.width[0] >= 128) {
-#if 0
+#if 0 /* TODO use this code when backend is smarter */
+ if (tex->base.width[0] >= 240) {
tex->stride = power_of_two(tex->base.nblocksx[0] * pt->block.size);
+ tex->total_nblocksy = round_up(tex->base.nblocksy[0], 8);
#else
- tex->stride = 2048 * 4; /* TODO fix when backend is smarter */
-#endif
+ if (tex->base.width[0] >= 240) {
+ tex->stride = 2048 * 4;
tex->total_nblocksy = round_up(tex->base.nblocksy[0], 8);
-#if 0 /* used for tiled textures */
- tex->tiled = 1;
#endif
+ } else if (tex->base.width[0] == 64 && tex->base.height[0] == 64) {
+ tex->stride = power_of_two(tex->base.nblocksx[0] * pt->block.size);
+ tex->total_nblocksy = round_up(tex->base.nblocksy[0], 8);
} else {
- tex->stride = round_up(tex->base.nblocksx[0] * pt->block.size, 64);
- tex->total_nblocksy = tex->base.nblocksy[0];
+ return 0;
}
- /*
- printf("%s size: %d,%d,%d offset %d,%d (0x%x)\n", __FUNCTION__,
+ debug_printf("%s size: %d,%d,%d offset %d,%d (0x%x)\n", __FUNCTION__,
tex->base.width[0], tex->base.height[0], pt->block.size,
tex->stride, tex->total_nblocksy, tex->stride * tex->total_nblocksy);
- */
return 1;
}
@@ -606,7 +605,9 @@ i915_texture_create(struct pipe_screen *screen,
tex_size = tex->stride * tex->total_nblocksy;
buf_usage = PIPE_BUFFER_USAGE_PIXEL;
- if (templat->tex_usage & PIPE_TEXTURE_USAGE_PRIMARY)
+
+ /* for scanouts and cursors, cursors don't have the scanout tag */
+ if (templat->tex_usage & PIPE_TEXTURE_USAGE_PRIMARY && templat->width[0] != 64)
buf_usage |= I915_BUFFER_USAGE_SCANOUT;
tex->buffer = screen->buffer_create(screen, 64, buf_usage, tex_size);
More information about the mesa-commit
mailing list