radeonsi: don't assume ctx is always a threaded_context
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Thu, 16 Apr 2020 12:52:29 +0000 (14:52 +0200)
committerPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Fri, 17 Apr 2020 09:36:20 +0000 (11:36 +0200)
Fixes: dcb1e8fef8a ("radeonsi: use thread_context::bytes_mapped_limit")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4587>

src/gallium/drivers/radeonsi/si_pipe.c

index e3ba1c2fb938c1c56242f0cdfbac617480aa5132..cd38131229a0f0a57cc6eb6f6786af6ce1231817 100644 (file)
@@ -712,7 +712,7 @@ static struct pipe_context *si_pipe_create_context(struct pipe_screen *screen, v
             sscreen->info.is_amdgpu ? si_create_fence : NULL,
             &((struct si_context *)ctx)->tc);
 
-   if (os_get_total_physical_memory(&total_ram)) {
+   if (tc && tc != ctx && os_get_total_physical_memory(&total_ram)) {
       ((struct threaded_context *) tc)->bytes_mapped_limit = total_ram / 4;
    }