mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2026-08-20 21:02:59 +00:00
i-g-t: check kernel enable rings or not
1. add functions check kernel enable a ring or not. 2. add function gem_get_num_rings() to check how many rings kernel has enable. 3. gem_ring_sync_loop.c will call gem_get_num_rings() directly instead of original static fucntion get_number_rings(). Signed-off-by: Zhong Li <zhong.li@intel.com> [Ben: Wrapped commit message + whitespace fixes] Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
This commit is contained in:
@@ -55,47 +55,11 @@ static drm_intel_bo *target_buffer;
|
||||
#define MI_COND_BATCH_BUFFER_END (0x36<<23 | 1)
|
||||
#define MI_DO_COMPARE (1<<21)
|
||||
|
||||
static int
|
||||
get_num_rings(int fd)
|
||||
{
|
||||
int num_rings = 1; /* render ring is always available */
|
||||
drm_i915_getparam_t gp;
|
||||
int ret, tmp;
|
||||
|
||||
memset(&gp, 0, sizeof(gp));
|
||||
gp.value = &tmp;
|
||||
|
||||
gp.param = I915_PARAM_HAS_BSD;
|
||||
ret = drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp);
|
||||
|
||||
if ((ret == 0) && (*gp.value > 0))
|
||||
num_rings++;
|
||||
else
|
||||
goto skip;
|
||||
|
||||
gp.param = I915_PARAM_HAS_BLT;
|
||||
ret = drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp);
|
||||
|
||||
if ((ret == 0) && (*gp.value > 0))
|
||||
num_rings++;
|
||||
else
|
||||
goto skip;
|
||||
|
||||
if (gem_has_vebox(fd))
|
||||
num_rings++;
|
||||
else
|
||||
goto skip;
|
||||
|
||||
|
||||
skip:
|
||||
return num_rings;
|
||||
}
|
||||
|
||||
static void
|
||||
store_dword_loop(int fd)
|
||||
{
|
||||
int i;
|
||||
int num_rings = get_num_rings(fd);
|
||||
int num_rings = gem_get_num_rings(fd);
|
||||
|
||||
srandom(0xdeadbeef);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user