OSDN Git Service

radv: Don't underflow non-visible VRAM size.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Sun, 30 Jul 2017 21:26:11 +0000 (23:26 +0200)
committerEmil Velikov <emil.l.velikov@gmail.com>
Wed, 2 Aug 2017 23:19:08 +0000 (00:19 +0100)
commitb84abbfff712fbd024652a9c4425735661d3a121
treee0815b3344076da9b73c414b0d015644df32c3ae
parent4d27d9cb26a6f9e576274b82dd1600cfe0b0c9fe
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>
(cherry picked from commit 8229706ad86b27ed571f17872006a488fcd35378)
[Emil Velikov: branch uses radeon_info::visible_vram_size]
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Conflicts:
src/amd/vulkan/radv_device.c
src/amd/vulkan/radv_device.c