On 11/07/2013 01:33 PM, Daniel Vetter wrote: > 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.
This only does GEN4+. i915 and earlier chips are handled in the previous patch, which uses drmAgpSize. Should that be used here too? > -Daniel _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev