vmwgfx: Restrict number of GMR pages to device limit
commitfb17f18993071cc230ec8ddb6dd3dd9932d2dba2
authorThomas Hellstrom <thellstrom@vmware.com>
Wed, 31 Aug 2011 07:42:53 +0000 (31 07:42 +0000)
committerDave Airlie <airlied@redhat.com>
Thu, 1 Sep 2011 08:38:07 +0000 (1 09:38 +0100)
treec44f01b1f015cce50e7c4d12045dc8815618f253
parent05730b32a78dab4bed8fb7ccc64c53d9fcf31e9d
vmwgfx: Restrict number of GMR pages to device limit

When GMR2 is available, make sure we restrict the number of used GMR pages
to the limit indicated by the device.
This is done by failing a GMRID allocation if the total number of GMR pages
exceeds the limit.
As a result TTM will then start evicting buffers in GMR memory on a
LRU basis until the allocation succeeds.

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_drv.c
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c