]> git.baikalelectronics.ru Git - kernel.git/commit
drm/ttm: Fix memory space allocation v2
authorThomas Hellstrom <thellstrom@vmware.com>
Mon, 14 Sep 2015 08:24:41 +0000 (01:24 -0700)
committerThomas Hellstrom <thellstrom@vmware.com>
Tue, 15 Sep 2015 07:57:01 +0000 (00:57 -0700)
commit47e58defbbd8b84c47732ceadbd90fb88f96087c
tree37454b0b70d4d38df05f043a9cc69553efa63f7a
parentacab4de7c24d2c8ab662bef1197065a029af7c54
drm/ttm: Fix memory space allocation v2

In the event that TTM doesn't find a compatible memory type for the
driver's first placement choice (placement without eviction), TTM
returns -EINVAL without trying the driver's second choice.
This causes problems on vmwgfx when VRAM is disabled before first modeset
and during VT switches when fbdev is not enabled.

Fix this by also trying the driver's second choice before returning
-EINVAL.

v2: Also check that man->use_type is true for the driver's second choice.
Fixes a bug where disallowed memory types could be used.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
drivers/gpu/drm/ttm/ttm_bo.c