drm/vmwgfx: Filter out modes those cannot be supported by the current VRAM size.
authorSinclair Yeh <syeh@vmware.com>
Fri, 31 Oct 2014 08:58:06 +0000 (09:58 +0100)
committerZefan Li <lizefan@huawei.com>
Mon, 2 Feb 2015 09:05:09 +0000 (17:05 +0800)
commit7aff1a05050df389dd41eb1d2b9ade8d9ecb3c6c
treea357d1d0f748f5ce2cfd39da035dd23b69c942ba
parent9813ed0b2d83b16206353134835a03af32701697
drm/vmwgfx: Filter out modes those cannot be supported by the current VRAM size.

commit 9a72384d86b26cb8a2b25106677e1197f606668f upstream.

When screen objects are enabled, the bpp is assumed to be 32, otherwise
it is set to 16.

v2:
* Use u32 instead of u64 for assumed_bpp.
* Fixed mechanism to check for screen objects
* Limit the back buffer size to VRAM.

Signed-off-by: Sinclair Yeh <syeh@vmware.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
[lizf: Backported to 3.4: drop the changes to vmw_driver_load()]
Signed-off-by: Zefan Li <lizefan@huawei.com>
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c