On Thu, 27 Jun 2019, Jani Nikula <[email protected]> wrote:
> On Thu, 27 Jun 2019, Tvrtko Ursulin <[email protected]> wrote:
>> From: Tvrtko Ursulin <[email protected]>
>>
>> Let Valgrind know the ioctl initializes the passed in info block to reduce
>> the noise while debugging.
>>
>> Signed-off-by: Tvrtko Ursulin <[email protected]>
>> ---
>>  lib/sw_sync.c | 11 +++++++++++
>>  1 file changed, 11 insertions(+)
>>
>> diff --git a/lib/sw_sync.c b/lib/sw_sync.c
>> index f208603312c2..73f3f7015d9d 100644
>> --- a/lib/sw_sync.c
>> +++ b/lib/sw_sync.c
>> @@ -41,6 +41,15 @@
>>  #include "drmtest.h"
>>  #include "ioctl_wrappers.h"
>>  
>> +#ifdef HAVE_VALGRIND
>> +#include <valgrind/valgrind.h>
>> +#include <valgrind/memcheck.h>
>> +
>> +#define VG(x) x
>> +#else
>> +#define VG(x) do {} while (0)
>
> OOC, why not just
>
> #define VALGRIND_MAKE_MEM_DEFINED(...)

And to underline, this is not a request to change anything!

BR,
Jani.


>
> BR,
> Jani.
>
>> +#endif
>> +
>>  /**
>>   * SECTION:sw_sync
>>   * @short_description: Software sync (fencing) support library
>> @@ -218,6 +227,8 @@ int sync_fence_status(int fence)
>>      if (file_info.num_fences != 1)
>>              return -EINVAL;
>>  
>> +    VG(VALGRIND_MAKE_MEM_DEFINED(&fence_info, sizeof(fence_info)));
>> +
>>      return fence_info.status;
>>  }

-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to