summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNiklas Söderlund <niklas.soderlund@ragnatech.se>2019-11-25 22:14:40 +0100
committerNiklas Söderlund <niklas.soderlund@ragnatech.se>2020-01-12 16:10:37 +0100
commit007517618c8440d09cfd39db5dbf451e87ef703a (patch)
treec946dbcd940f14988881c48ac03b37c50796db18 /test
parentde9243bdc1986c57bee4dae3a5ba4fc8fc4293fe (diff)
ipa: Switch to FrameBuffer interface
Switch the IPA interfaces and implementations to use the Framebuffer interface. - The IPA interface is switched to use the simpler FrameBuffer::Plane container when carrying dmabuf descriptions (fd and length) over the pipeline/IPA boundary. - The RkISP1 IPA implementation takes advantage of the new simpler and safer (better control over file descriptors) FrameBuffer interface. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'test')
-rw-r--r--test/ipa/ipa_wrappers_test.cpp41
1 files changed, 22 insertions, 19 deletions
diff --git a/test/ipa/ipa_wrappers_test.cpp b/test/ipa/ipa_wrappers_test.cpp
index a1e34ad5..e711e4fe 100644
--- a/test/ipa/ipa_wrappers_test.cpp
+++ b/test/ipa/ipa_wrappers_test.cpp
@@ -115,28 +115,28 @@ public:
return report(Op_mapBuffers, TestFail);
}
- if (buffers[0].memory.planes().size() != 3 ||
- buffers[1].memory.planes().size() != 3) {
+ if (buffers[0].planes.size() != 3 ||
+ buffers[1].planes.size() != 3) {
cerr << "mapBuffers(): Invalid number of planes" << endl;
return report(Op_mapBuffers, TestFail);
}
- if (buffers[0].memory.planes()[0].length() != 4096 ||
- buffers[0].memory.planes()[1].length() != 0 ||
- buffers[0].memory.planes()[2].length() != 0 ||
- buffers[0].memory.planes()[0].length() != 4096 ||
- buffers[1].memory.planes()[1].length() != 4096 ||
- buffers[1].memory.planes()[2].length() != 0) {
+ if (buffers[0].planes[0].length != 4096 ||
+ buffers[0].planes[1].length != 0 ||
+ buffers[0].planes[2].length != 0 ||
+ buffers[0].planes[0].length != 4096 ||
+ buffers[1].planes[1].length != 4096 ||
+ buffers[1].planes[2].length != 0) {
cerr << "mapBuffers(): Invalid length" << endl;
return report(Op_mapBuffers, TestFail);
}
- if (buffers[0].memory.planes()[0].dmabuf() == -1 ||
- buffers[0].memory.planes()[1].dmabuf() != -1 ||
- buffers[0].memory.planes()[2].dmabuf() != -1 ||
- buffers[0].memory.planes()[0].dmabuf() == -1 ||
- buffers[1].memory.planes()[1].dmabuf() == -1 ||
- buffers[1].memory.planes()[2].dmabuf() != -1) {
+ if (buffers[0].planes[0].fd.fd() == -1 ||
+ buffers[0].planes[1].fd.fd() != -1 ||
+ buffers[0].planes[2].fd.fd() != -1 ||
+ buffers[0].planes[0].fd.fd() == -1 ||
+ buffers[1].planes[1].fd.fd() == -1 ||
+ buffers[1].planes[2].fd.fd() != -1) {
cerr << "mapBuffers(): Invalid dmabuf" << endl;
return report(Op_mapBuffers, TestFail);
}
@@ -287,13 +287,16 @@ protected:
/* Test mapBuffers(). */
std::vector<IPABuffer> buffers(2);
- buffers[0].memory.planes().resize(3);
+ buffers[0].planes.resize(3);
buffers[0].id = 10;
- buffers[0].memory.planes()[0].setDmabuf(fd_, 4096);
+ buffers[0].planes[0].fd = FileDescriptor(fd_);
+ buffers[0].planes[0].length = 4096;
buffers[1].id = 11;
- buffers[1].memory.planes().resize(3);
- buffers[1].memory.planes()[0].setDmabuf(fd_, 4096);
- buffers[1].memory.planes()[1].setDmabuf(fd_, 4096);
+ buffers[1].planes.resize(3);
+ buffers[1].planes[0].fd = FileDescriptor(fd_);
+ buffers[1].planes[0].length = 4096;
+ buffers[1].planes[1].fd = FileDescriptor(fd_);
+ buffers[1].planes[1].length = 4096;
ret = INVOKE(mapBuffers, buffers);
if (ret == TestFail)