]> 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)
commit127f93829c7a3d12ab641fa155c20dac5ff367d0
tree37454b0b70d4d38df05f043a9cc69553efa63f7a
parent3e34150625da49711691559aee4590061c4d065b
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