[Mesa-dev] [PATCH 05/11] st/nine: return GetAvailableTextureMem in bytes as expected (v2)

Ilia Mirkin imirkin at alum.mit.edu
Sun Nov 23 21:55:10 PST 2014


On Sun, Nov 23, 2014 at 5:40 PM, David Heidelberg <david at ixit.cz> wrote:
> PIPE_CAP_VIDEO_MEMORY returns the amount of video memory in megabytes,
> so need to converted it to bytes.
>
> Fixed Warframe memory detection.
>
> v2: also prepare for cards with more than 4GB memory
>
> Cc: "10.4" <mesa-stable at lists.freedesktop.org>
> Tested-by: Yaroslav Andrusyak <pontostroy at gmail.com>
> Reviewed-by: Axel Davy <axel.davy at ens.fr>
> Signed-off-by: David Heidelberg <david at ixit.cz>

Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>

> ---
>  src/gallium/state_trackers/nine/device9.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c
> index 66d5e66..d48f47d 100644
> --- a/src/gallium/state_trackers/nine/device9.c
> +++ b/src/gallium/state_trackers/nine/device9.c
> @@ -423,7 +423,11 @@ NineDevice9_TestCooperativeLevel( struct NineDevice9 *This )
>  UINT WINAPI
>  NineDevice9_GetAvailableTextureMem( struct NineDevice9 *This )
>  {
> -    return This->screen->get_param(This->screen, PIPE_CAP_VIDEO_MEMORY);
> +   const unsigned mem = This->screen->get_param(This->screen, PIPE_CAP_VIDEO_MEMORY);
> +   if (mem < 4096)
> +      return mem << 20;
> +   else
> +      return UINT_MAX;
>  }
>
>  HRESULT WINAPI
> --
> 2.1.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list