|
|
@ -161,6 +161,21 @@ fn test_i915_uapi_gem_fork_parent() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
|
|
|
|
fn test_i915_uapi_gem_offset() {
|
|
|
|
|
|
|
|
let nodes = i915::find_all_nodes();
|
|
|
|
|
|
|
|
unsafe {
|
|
|
|
|
|
|
|
assert!(nodes.len() > 0);
|
|
|
|
|
|
|
|
for node in nodes {
|
|
|
|
|
|
|
|
let gem = i915::make_gem(node.fd.as_raw_fd(), 4096).expect("Failed to make gem");
|
|
|
|
|
|
|
|
let offset = i915::gem_offset(node.fd.as_raw_fd(), &gem);
|
|
|
|
|
|
|
|
println!("gem: {:?}, node: {:?}, offset: {:?}", gem, node, offset);
|
|
|
|
|
|
|
|
assert!(offset.unwrap() > 0);
|
|
|
|
|
|
|
|
i915::close_gem(node.fd.as_raw_fd(), gem).expect("Failed to close gem");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: Fix this test
|
|
|
|
// TODO: Fix this test
|
|
|
|
// Shared mem needs to be used to communicate the gem handle between parent and child
|
|
|
|
// Shared mem needs to be used to communicate the gem handle between parent and child
|
|
|
|
// Test both a shared fd and separate fd
|
|
|
|
// Test both a shared fd and separate fd
|
|
|
|