Hans de Goede
2016-Mar-14 12:50 UTC
[Nouveau] [PATCH mesa] 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. Signed-off-by: Hans de Goede <hdegoede at redhat.com> --- src/gallium/state_trackers/clover/core/kernel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/state_trackers/clover/core/kernel.cpp b/src/gallium/state_trackers/clover/core/kernel.cpp index 8396be9..dad66aa 100644 --- a/src/gallium/state_trackers/clover/core/kernel.cpp +++ b/src/gallium/state_trackers/clover/core/kernel.cpp @@ -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. -- 2.7.2
Samuel Pitoiset
2016-Mar-14 13:01 UTC
[Nouveau] [PATCH mesa] clover: Fix pipe_grid_info.indirect not being initialized
On 03/14/2016 01:50 PM, Hans de Goede wrote:> 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. > > Signed-off-by: Hans de Goede <hdegoede at redhat.com> > --- > src/gallium/state_trackers/clover/core/kernel.cpp | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/gallium/state_trackers/clover/core/kernel.cpp b/src/gallium/state_trackers/clover/core/kernel.cpp > index 8396be9..dad66aa 100644 > --- a/src/gallium/state_trackers/clover/core/kernel.cpp > +++ b/src/gallium/state_trackers/clover/core/kernel.cpp > @@ -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, };Right, good catch, it's my fault. = { 0 }; is enough btw. This should be backported to mesa 11.2 I guess, could you please send a v2 with this minor fix and add the cc thing? Thanks.> > // The handles are created during exec_context::bind(), so we need make > // sure to call exec_context::bind() before retrieving them. >-- -Samuel
Hans de Goede
2016-Mar-14 13:26 UTC
[Nouveau] [PATCH mesa] clover: Fix pipe_grid_info.indirect not being initialized
Hi, On 14-03-16 14:01, Samuel Pitoiset wrote:> > > On 03/14/2016 01:50 PM, Hans de Goede wrote: >> 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. >> >> Signed-off-by: Hans de Goede <hdegoede at redhat.com> >> --- >> src/gallium/state_trackers/clover/core/kernel.cpp | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/src/gallium/state_trackers/clover/core/kernel.cpp b/src/gallium/state_trackers/clover/core/kernel.cpp >> index 8396be9..dad66aa 100644 >> --- a/src/gallium/state_trackers/clover/core/kernel.cpp >> +++ b/src/gallium/state_trackers/clover/core/kernel.cpp >> @@ -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, }; > > Right, good catch, it's my fault. > > = { 0 }; is enough btw.I prefer to add the "," to make clear that we are initializing the entire struct, I read it as ", ...".> This should be backported to mesa 11.2 I guess, could you please send a v2 with this minor fix and add the cc thing?Sure, as soon as we're done bikeshedding on the "," :) Regards, Hans
Apparently Analagous Threads
- [RFC mesa] clover: Fix pipe_grid_info.indirect not being initialized
- [PATCH mesa v2] clover: Fix pipe_grid_info.indirect not being initialized
- [PATCH mesa] clover: Fix pipe_grid_info.indirect not being initialized
- [PATCH mesa] clover: Fix pipe_grid_info.indirect not being initialized
- [PATCH mesa] clover: Fix pipe_grid_info.indirect not being initialized