igt/gem_exec_params: Drop drm master privileges only on drm master fds

Subtest 'secure-non-master' tries to drop drm-master privileges on a
non drm-master fd. Instead drop master privileges after the subtest
acquires it so that other subtests are not affected by it.

v2:
	- Require root privilege for the sub-test. (Chris)

V3:
	- Cosmetic refactoring. (Chris)

Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
1 file changed