On Sat, Oct 12, 2013 at 12:10 AM, Ian Romanick <i...@freedesktop.org> wrote: > + /* Once a batch uses more than 75% of the maximum mappable size, we > + * assume that there's some fragmentation, and we start doing extra > + * flushing, etc. That's the big cliff apps will care about. > + * > + * Can only map 2G onto the GPU through the GTT. > + */ > + const unsigned gpu_mappable_megabytes = 2 * 1024 * 3 / 4;
We have an ioctl to tell you that, since it's not really 2G on really old stuff. And will probably change on newer platforms. Also, using that ioctl allows the kernel to limit your usage in case the available ram is less than the virtual size of the gtt (atm we don't bother with that much cleverness, but probably will in the future). See DRM_IOCTL_I915_GEM_GET_APERTURE in libdrm (it's unfortunately not exposed through any libdrm function afaics. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev