Mesa (master): nouveau: Assume all texture blankets are linear for now.
Ben Skeggs
skeggsb at gmail.com
Mon Nov 2 06:33:17 UTC 2009
On Sun, 2009-11-01 at 15:28 -0800, Younes Manton wrote:
> Module: Mesa
> Branch: master
> Commit: 87d7c1aa15a944d64e43b217e18553256f9fb681
> URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=87d7c1aa15a944d64e43b217e18553256f9fb681
>
> Author: Younes Manton <younes.m at gmail.com>
> Date: Sun Nov 1 18:25:59 2009 -0500
>
> nouveau: Assume all texture blankets are linear for now.
I suggest perhaps "abusing" bo->tile_mode to store this info instead?
It'll accept values from 0-4 with the current DRM, and have no effect on
anything else on <G8x chips.
The DRM will pass this info along to any other client who references the
buffer, and you won't have to guess.
Ben.
>
> ---
>
> src/gallium/drivers/nv30/nv30_miptree.c | 3 +++
> src/gallium/drivers/nv40/nv40_miptree.c | 3 +++
> .../winsys/drm/nouveau/drm/nouveau_drm_api.c | 3 +--
> 3 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/src/gallium/drivers/nv30/nv30_miptree.c b/src/gallium/drivers/nv30/nv30_miptree.c
> index 17acca6..280696d 100644
> --- a/src/gallium/drivers/nv30/nv30_miptree.c
> +++ b/src/gallium/drivers/nv30/nv30_miptree.c
> @@ -147,6 +147,9 @@ nv30_miptree_blanket(struct pipe_screen *pscreen, const struct pipe_texture *pt,
> mt->level[0].pitch = stride[0];
> mt->level[0].image_offset = CALLOC(1, sizeof(unsigned));
>
> + /* Assume whoever created this buffer expects it to be linear for now */
> + mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR;
> +
> pipe_buffer_reference(&mt->buffer, pb);
> return &mt->base;
> }
> diff --git a/src/gallium/drivers/nv40/nv40_miptree.c b/src/gallium/drivers/nv40/nv40_miptree.c
> index 5a201cc..465dd3b 100644
> --- a/src/gallium/drivers/nv40/nv40_miptree.c
> +++ b/src/gallium/drivers/nv40/nv40_miptree.c
> @@ -141,6 +141,9 @@ nv40_miptree_blanket(struct pipe_screen *pscreen, const struct pipe_texture *pt,
> mt->level[0].pitch = stride[0];
> mt->level[0].image_offset = CALLOC(1, sizeof(unsigned));
>
> + /* Assume whoever created this buffer expects it to be linear for now */
> + mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR;
> +
> pipe_buffer_reference(&mt->buffer, pb);
> return &mt->base;
> }
> diff --git a/src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c b/src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c
> index f512c0e..317dc44 100644
> --- a/src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c
> +++ b/src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c
> @@ -21,8 +21,7 @@ dri_surface_from_handle(struct drm_api *api, struct pipe_screen *pscreen,
> struct pipe_texture tmpl;
>
> memset(&tmpl, 0, sizeof(tmpl));
> - tmpl.tex_usage = PIPE_TEXTURE_USAGE_PRIMARY |
> - NOUVEAU_TEXTURE_USAGE_LINEAR;
> + tmpl.tex_usage = PIPE_TEXTURE_USAGE_PRIMARY;
> tmpl.target = PIPE_TEXTURE_2D;
> tmpl.last_level = 0;
> tmpl.depth[0] = 1;
>
> _______________________________________________
> mesa-commit mailing list
> mesa-commit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-commit
More information about the mesa-commit
mailing list