lima: Fix dump file creation
authorAndreas Baierl <ichgeh@imkreisrum.de>
Fri, 20 Dec 2019 10:30:05 +0000 (11:30 +0100)
committerAndreas Baierl <ichgeh@imkreisrum.de>
Fri, 20 Dec 2019 16:44:12 +0000 (17:44 +0100)
Otherwise lima_dump_file_next() always opens a new file and creates the
dumps regardless of what the environment variables say.

Fixes d71cd245d74 ('lima: Rotate dump files after each finished pp frame')

Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Andreas Baierl <ichgeh@imkreisrum.de>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3179>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3179>

src/gallium/drivers/lima/lima_util.c

index 65e3114ed5f3e8339adf5880babed975622308a9..45f2b27b400d4abf4de7e9b1515b2b2a0de32dcc 100644 (file)
@@ -130,9 +130,11 @@ lima_dump_file_close(void)
 void
 lima_dump_file_next(void)
 {
-   lima_dump_file_close();
-   lima_dump_frame_count++;
-   lima_dump_file_open();
+   if (lima_dump_command_stream) {
+      lima_dump_file_close();
+      lima_dump_frame_count++;
+      lima_dump_file_open();
+   }
 }
 
 void