Mesa (master): radeonsi: don't assume ctx is always a threaded_context

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Apr 17 09:48:55 UTC 2020


Module: Mesa
Branch: master
Commit: 8521acd660764973940fbdc2c85334670d620b45
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8521acd660764973940fbdc2c85334670d620b45

Author: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Date:   Thu Apr 16 14:52:29 2020 +0200

radeonsi: don't assume ctx is always a threaded_context

Fixes: dcb1e8fef8a ("radeonsi: use thread_context::bytes_mapped_limit")
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4587>

---

 src/gallium/drivers/radeonsi/si_pipe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c
index e3ba1c2fb93..cd38131229a 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.c
+++ b/src/gallium/drivers/radeonsi/si_pipe.c
@@ -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;
    }
 



More information about the mesa-commit mailing list