vmwgfx: Implement memory accounting for resources
authorThomas Hellstrom <thellstrom@vmware.com>
Fri, 7 Oct 2011 13:23:06 +0000 (15:23 +0200)
committerDave Airlie <airlied@redhat.com>
Mon, 10 Oct 2011 08:01:44 +0000 (09:01 +0100)
commit414ee50b3a111983056b1a828fac08f9e8fbc7e9
treed946756ccdca539c8ca707f02b2a47a3e589c649
parent1c248b7d2960faec3e1b8f3f9c5d9d0df28e0a3c
vmwgfx: Implement memory accounting for resources

Contexts, surfaces and streams allocate persistent kernel memory as the
direct result of user-space requests. Make sure this memory is
accounted as graphics memory, to avoid DOS vulnerabilities.

Also take the TTM read lock around resource creation to block
switched-out dri clients from allocating resources.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/vmwgfx/vmwgfx_resource.c