mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2026-08-11 16:32:58 +00:00
lib/gt: api polish for igt_can_hang_ring
Align with common igt library style: - Push the igt_require into the function. - Push the intel_gen into the function. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
This commit is contained in:
+4
-8
@@ -29,16 +29,12 @@
|
||||
#include "igt_debugfs.h"
|
||||
#include "ioctl_wrappers.h"
|
||||
#include "intel_reg.h"
|
||||
#include "intel_chipset.h"
|
||||
|
||||
int igt_can_hang_ring(int fd, int gen, int ring)
|
||||
void igt_require_hang_ring(int fd, int ring)
|
||||
{
|
||||
if (!gem_context_has_param(fd, LOCAL_CONTEXT_PARAM_BAN_PERIOD))
|
||||
return 0;
|
||||
|
||||
if (gen < 5) /* safe resets */
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
igt_require(gem_context_has_param(fd, LOCAL_CONTEXT_PARAM_BAN_PERIOD));
|
||||
igt_require(intel_gen(intel_get_drm_devid(fd)) >= 5);
|
||||
}
|
||||
|
||||
struct igt_hang_ring igt_hang_ring(int fd, int gen, int ring)
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@
|
||||
#ifndef IGT_GT_H
|
||||
#define IGT_GT_H
|
||||
|
||||
int igt_can_hang_ring(int fd, int gen, int ring);
|
||||
void igt_require_hang_ring(int fd, int ring);
|
||||
|
||||
struct igt_hang_ring {
|
||||
unsigned handle;
|
||||
|
||||
Reference in New Issue
Block a user