Skip to contentSkip to conversation

clover: Fix pipe_grid_info.indirect not being initialized

RFC Superseded Hans de Goede 1 participant 2 messages Mar 14, 2016 1 message not in the archive

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

RFC 1/1 clover: Fix pipe_grid_info.indirect not being initialized

After pipe_grid_info.indirect was introduced, clover was not modified to set it causing it to pass uninitialized memory for it to launch_grid.

This commit fixes this by zero-ing the entire pipe_grid_info struct when declaring it, to avoid similar problems popping-up in the future.

---
Changes in v2:
-Drop trailing "," from struct initializer -Add Cc: "11.2" <[email protected]>

---
 src/gallium/state_trackers/clover/core/kernel.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/gallium/state_trackers/clover/core/kernel.cpp +1 -1
index 8396be9..1ab87ec 100644
@@ -55,7 +55,7 @@ kernel::launch(command_queue &q,
    const auto reduced_grid_size =
       map(divides(), grid_size, block_size);
    void *st = exec.bind(&q, grid_offset);
-   struct pipe_grid_info info;
+   struct pipe_grid_info info = { 0 };
 
    // The handles are created during exec_context::bind(), so we need make
    // sure to call exec_context::bind() before retrieving them.
Signature · 6 lines
2.7.2

_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau

A message that is not in the archive (sent off-list or not yet received): 1457964007-3082-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org

#2 lore raw

Messed up the subject prefix, sorry. Resending with proper prefix.

Quoted 22 lines · Hans de Goede

After pipe_grid_info.indirect was introduced, clover was not modified to set it causing it to pass uninitialized memory for it to launch_grid.

This commit fixes this by zero-ing the entire pipe_grid_info struct when declaring it, to avoid similar problems popping-up in the future.

---
Changes in v2:

(quoted diff) +0 -3
-Drop trailing "," from struct initializer
-Add Cc: "11.2" <[email protected]>
---
  src/gallium/state_trackers/clover/core/kernel.cpp | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
src/gallium/state_trackers/clover/core/kernel.cpp +0 -0
index 8396be9..1ab87ec 100644

src/gallium/state_trackers/clover/core/kernel.cpp kernel::launch(command_queue &q, · line 61

Quoted 8 lines
src/gallium/state_trackers/clover/core/kernel.cpp +1 -1
@@ -55,7 +55,7 @@ kernel::launch(command_queue &q,
     const auto reduced_grid_size =
        map(divides(), grid_size, block_size);
     void *st = exec.bind(&q, grid_offset);
-   struct pipe_grid_info info;
+   struct pipe_grid_info info = { 0 };
 
     // The handles are created during exec_context::bind(), so we need make
     // sure to call exec_context::bind() before retrieving them.

_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau