]> git.baikalelectronics.ru Git - kernel.git/commit
drm/vmwgfx: Fix dma buffer memory size accounting
authorThomas Hellstrom <thellstrom@vmware.com>
Thu, 28 Nov 2013 09:46:56 +0000 (01:46 -0800)
committerThomas Hellstrom <thellstrom@vmware.com>
Wed, 4 Dec 2013 20:03:56 +0000 (12:03 -0800)
commitbc61ada724cebbc17d0b9c52fb776e00b143b978
treebf0ef85f31331efbcffc47b8ae2a7d042af18875
parent87750a025f88ca716fbb81e0ddf56d71046ad791
drm/vmwgfx: Fix dma buffer memory size accounting

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: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
drivers/gpu/drm/vmwgfx/vmwgfx_resource.c