[Mesa-dev] [PATCH] radv: fix common extensions getting registered twice.

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Sun Feb 19 21:06:53 UTC 2017


On Sun, Feb 19, 2017 at 9:56 PM, Dave Airlie <airlied at gmail.com> wrote:
> From: Dave Airlie <airlied at redhat.com>
>
> physical devices can be enumerated multiple time per instance,
> this was causing the realloc to be hit for no reason, and
> the CTS allocation verification would get angry.

We only do the radv_physical_device_init on the enumerate with
instance->physicalDeviceCount < 0 though? We should therefore only
init the devices once? In that case I don't think this should be
necessary.

- Bas


>
> We'd also be allocating common extensions onto the list
> each time for no reason.
>
> This hopefully fixes a bunch of CTS oom tests.
>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
>  src/amd/vulkan/radv_device.c | 14 ++++++++------
>  1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
> index f0cbb7b..d86e17a 100644
> --- a/src/amd/vulkan/radv_device.c
> +++ b/src/amd/vulkan/radv_device.c
> @@ -242,12 +242,14 @@ radv_physical_device_init(struct radv_physical_device *device,
>                 goto fail;
>         }
>
> -       result = radv_extensions_register(instance,
> -                                       &device->extensions,
> -                                       common_device_extensions,
> -                                       ARRAY_SIZE(common_device_extensions));
> -       if (result != VK_SUCCESS)
> -               goto fail;
> +       if (device->extensions.num_ext < ARRAY_SIZE(common_device_extensions)) {
> +               result = radv_extensions_register(instance,
> +                                                 &device->extensions,
> +                                                 common_device_extensions,
> +                                                 ARRAY_SIZE(common_device_extensions));
> +               if (result != VK_SUCCESS)
> +                       goto fail;
> +       }
>
>         fprintf(stderr, "WARNING: radv is not a conformant vulkan implementation, testing use only.\n");
>         device->name = device->rad_info.name;
> --
> 2.9.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list