radv: Don't underflow non-visible VRAM size.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Sun, 30 Jul 2017 21:26:11 +0000 (23:26 +0200)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Mon, 31 Jul 2017 20:50:13 +0000 (22:50 +0200)
commit8229706ad86b27ed571f17872006a488fcd35378
tree3b32003bcff633b51491e6ac20ba06ef7eb179ce
parentd0540d5b8528215d77e6a43d70bfc5e0239c430e
radv: Don't underflow non-visible VRAM size.

In some APU situations the reported visible size can be larger than
VRAM size. This properly clamps the value.

Surprisingly both CTS and spec seem to allow a heap type with size 0,
so this seemed like the easiest option to me.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Fixes: 4ae84efbc5c "radv: Use enum for memory heaps."
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
src/amd/vulkan/radv_device.c