[Intel-gfx] [PATCH i-g-t 2/3] lib: Add reset-type helper in ioctl_wrappers
Michel Thierry
michel.thierry at intel.com
Wed Jun 28 17:19:05 UTC 2017
On 6/28/2017 7:10 AM, Arkadiusz Hiler wrote:
> On Tue, Jun 20, 2017 at 11:25:01AM -0700, Michel Thierry wrote:
>> Soon we will have tests that are only for platforms with reset-engine
>> (GEN8+), so add a helper to query the has_gpu_reset via the getparam ioctl.
>>
>> Signed-off-by: Michel Thierry <michel.thierry at intel.com>
>> ---
>> lib/ioctl_wrappers.c | 22 ++++++++++++++++++++++
>> lib/ioctl_wrappers.h | 1 +
>> 2 files changed, 23 insertions(+)
>>
>> diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c
>> index 0816a7b6..958b7d03 100644
>> --- a/lib/ioctl_wrappers.c
>> +++ b/lib/ioctl_wrappers.c
>> @@ -1199,6 +1199,28 @@ bool gem_uses_full_ppgtt(int fd)
>> }
>>
>> /**
>> + * gem_gpu_reset_type:
>> + * @fd: open i915 drm file descriptor
>> + *
>> + * Query whether reset-engine (2), global-reset (1) or reset-disable (0)
>
> What about using an enum to save us commenting on the magic numbers
> later on?
>
The problem with enum is that we will forget to keep them updated.
But I can do something like we have for gem_gtt_type(); instead of tests
calling gem_gpu_reset_type directly, I add these helpers:
- gem_reset_enabled {return gem_gpu_reset_type > 0}
- gem_reset_engine_enabled {return gem_gpu_reset_type > 1}
-Michel
More information about the Intel-gfx
mailing list