[igt-dev] [PATCH i-g-t] tests/perf/i915_ref_count: Skip on __drm_open_driver failure

Umesh Nerlige Ramappa umesh.nerlige.ramappa at intel.com
Tue Jul 19 00:38:32 UTC 2022


On Mon, Jul 18, 2022 at 03:50:41PM -0700, Dixit, Ashutosh wrote:
>On Mon, 18 Jul 2022 15:32:05 -0700, Ashutosh Dixit wrote:
>>
>> Skip early on __drm_open_driver() to generate a consistent failure
>> signature for CI (rather than a follow-on igt_assert(is_i915_device(fd))).
>>
>> Cc: Umesh Nerlige Ramappa <umesh.nerlige.ramappa at intel.com>
>> Signed-off-by: Ashutosh Dixit <ashutosh.dixit at intel.com>
>> ---
>>  tests/i915/perf.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/tests/i915/perf.c b/tests/i915/perf.c
>> index e641d5d2db7e..5502a3fb4e59 100644
>> --- a/tests/i915/perf.c
>> +++ b/tests/i915/perf.c
>> @@ -4838,6 +4838,7 @@ test_i915_ref_count(void)
>>	igt_debug("baseline ref count (drm fd closed) = %u\n", baseline);
>>
>>	drm_fd = __drm_open_driver(DRIVER_INTEL);
>> +	igt_require_intel(drm_fd);
>
>The other option might be to use igt_require_fd() here (or something like
>that) which would be closer to the signature CI expects from
>drm_open_driver().
>
>At the other place in perf.c __drm_open_driver() is followed by
>igt_require_gem() which skips using igt_require_intel() and that's why I
>used igt_require_intel() here (instead of other options).
>
>Maybe as long as we are skipping one way or another (and not asserting) it
>should be ok?

lgtm,

Reviewed-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa at intel.com>

Thanks,
Umesh
>
>
>>	devid = intel_get_drm_devid(drm_fd);
>>	sysfs = igt_sysfs_open(drm_fd);
>>
>> --
>> 2.34.1
>>


More information about the igt-dev mailing list