[Mesa-dev] [PATCH 01/53] i965: Fix GLX_MESA_query_renderer video memory on 32-bit.

Chris Wilson chris at chris-wilson.co.uk
Wed Apr 5 09:04:06 UTC 2017


On Tue, Apr 04, 2017 at 05:09:51PM -0700, Kenneth Graunke wrote:
> On modern systems with 4GB apertures, the size in bytes is 4294967296,
> or (1ull << 32).  The kernel gives us the aperture size as a __u64,
> which works out great.
> 
> Unfortunately, libdrm "helpfully" returns the data as a size_t, which
> on 32-bit systems means it truncates the aperture size to 0 bytes.
> We've happily reported this value as 0 MB of video memory via
> GLX_MESA_query_renderer since it was originally exposed.

You also missed the reason why this has to remain using get_aperture so
that it matches the batch space calculation used by libdrm, and the
reminder that once that is lifted, this can be replaced.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the mesa-dev mailing list