• Thomas Hellstrom's avatar
    drm/vmwgfx: Fix dma buffer memory size accounting · 308d17ef
    Thomas Hellstrom authored
    Also request kernel ttm_buffer objects for buffer objects that obviously
    aren't visible to user-space, and save some device address space.
    
    The accounting was broken in a couple of ways:
    1) We did not differentiate between user dma buffers and kernel dma buffers.
    2) The ttm_bo_acc_size function is broken in that it
    a) Doesn't take into account the size of the optional dma address array,
    b) Doesn't take into account the fact that drivers typically embed the
    ttm_tt structure.
    
    This needs to be fixed in ttm, but meanwhile provide a vmwgfx-specific
    function to do the job.
    Signed-off-by: default avatarThomas Hellstrom <thellstrom@vmware.com>
    Reviewed-by: default avatarJakob Bornecrantz <jakob@vmware.com>
    308d17ef
vmwgfx_resource.c 36 KB