Age | Commit message (Collapse) | Author |
|
Refresh the RkISP1 user-space header to match the latest state in the
media-tree [1]. This requires update of symbol names in the RkISP1 IPA
but there is no functional change.
Unfortunately the upstream header has a few problems that needs to be
fixed before it can be used.
1. The SPDX header does not satisfy the Linux scripts/headers_install.sh
so the installation step have to be done manually (dropping _UAPI
prefix from header include guard). Issue is reported upstream.
2. The BIT() macro is used in the header but unfortunately this macro
is not accessible in user-space headers. Fix this by reverting back
to open code setting the bit without macro. Fix submitted upstream
and acked by maintainer.
1. d7a81a5b07313535 ("media: staging: rkisp1: uapi: remove __packed")
2. [PATCH v2] staging: rkisp1: uapi: Do not use BIT() macro
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
FrameBufferAllocator is supposed to delete copy constructor and
copy-assignment operator. It doesn't do that as it uses Camera as a
parameter instead of FrameBufferAllocator.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@iki.fi>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
Move the GPL2 utilities which handle generation of controls, formats and
the top level libcamera header to the utils subtree.
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
|
|
There are no user left of the copyFrom() operation, remove it.
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
Handle the case where a FrameBuffer that has been externally allocated
(i.e. not through the v4l2 video device) is passed into a Request.
We must store the buffer pointer in the stream internal buffer list to
identify when used.
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
|
|
The IPA now signals up front how many frames it wants the pipeline
handler to drop. This makes it easier to handle up-coming changes to the
buffer handling for import/export buffers.
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: David Plowman <david.plowman@raspberrypi.com>
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
|
|
The ipc_unixsocket.h and process.h internal headers don't need to
include event_notifier.h, the former because a forward declaration
suffices, and the latter because it doesn't use event notifiers. Remove
the unnecessary include, and include signal.h instead which is required
and was included indirectly through event_notifier.h.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
href='#n193'>193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2019, Google Inc.
*
* timer.cpp - Timer test
*/
#include <chrono>
#include <iostream>
#include <libcamera/event_dispatcher.h>
#include <libcamera/timer.h>
#include "libcamera/internal/thread.h"
#include "test.h"
using namespace std;
using namespace libcamera;
class ManagedTimer : public Timer
{
public:
ManagedTimer()
: Timer(), count_(0)
{
timeout.connect(this, &ManagedTimer::timeoutHandler);
}
void start(int msec)
{
count_ = 0;
start_ = std::chrono::steady_clock::now();
expiration_ = std::chrono::steady_clock::time_point();
Timer::start(msec);
}
void start(std::chrono::steady_clock::time_point deadline)
{
count_ = 0;
start_ = std::chrono::steady_clock::now();
expiration_ = std::chrono::steady_clock::time_point();
Timer::start(deadline);
}
int jitter()
{
std::chrono::steady_clock::duration duration = expiration_ - deadline();
return abs(std::chrono::duration_cast<std::chrono::milliseconds>(duration).count());
}
bool hasFailed()
{
return isRunning() || count_ != 1 || jitter() > 50;
}
private:
void timeoutHandler(Timer *timer)
{
expiration_ = std::chrono::steady_clock::now();
count_++;
}
unsigned int count_;
std::chrono::steady_clock::time_point start_;
std::chrono::steady_clock::time_point expiration_;
};
class TimerTest : public Test
{
protected:
int init()
{
return 0;
}
int run()
{
EventDispatcher *dispatcher = Thread::current()->eventDispatcher();
ManagedTimer timer;
ManagedTimer timer2;
/* Timer expiration. */
timer.start(1000);
if (!timer.isRunning()) {
cout << "Timer expiration test failed" << endl;
return TestFail;
}
dispatcher->processEvents();
if (timer.hasFailed()) {
cout << "Timer expiration test failed" << endl;
return TestFail;
}
/*
* 32 bit wrap test
* Nanosecond resolution in a 32 bit value wraps at 4.294967
* seconds (0xFFFFFFFF / 1000000)
*/
timer.start(4295);
dispatcher->processEvents();
if (timer.hasFailed()) {
cout << "Timer expiration test failed" << endl;
return TestFail;
}
/* Timer restart. */
timer.start(500);
if (!timer.isRunning()) {
cout << "Timer restart test failed" << endl;
return TestFail;
}
dispatcher->processEvents();
if (timer.hasFailed()) {
cout << "Timer restart test failed" << endl;
return TestFail;
}
/* Timer restart before expiration. */
timer.start(50);
timer.start(100);
timer.start(150);
dispatcher->processEvents();
if (timer.hasFailed()) {
cout << "Timer restart before expiration test failed" << endl;
return TestFail;
}
/* Timer with absolute deadline. */
timer.start(std::chrono::steady_clock::now() + std::chrono::milliseconds(200));
dispatcher->processEvents();
if (timer.hasFailed()) {
cout << "Absolute deadline test failed" << endl;
return TestFail;
}
/* Two timers. */
timer.start(1000);
timer2.start(300);
dispatcher->processEvents();
if (!timer.isRunning()) {
cout << "Two timers test failed" << endl;
return TestFail;
}
if (timer2.jitter() > 50) {
cout << "Two timers test failed" << endl;
return TestFail;
}
dispatcher->processEvents();
if (timer.jitter() > 50) {
cout << "Two timers test failed" << endl;
return TestFail;
}
/* Restart timer before expiration. */
timer.start(1000);
timer2.start(300);
dispatcher->processEvents();
if (timer2.jitter() > 50) {
cout << "Two timers test failed" << endl;
return TestFail;
}
timer.start(1000);
dispatcher->processEvents();
if (timer.jitter() > 50) {
cout << "Two timers test failed" << endl;
return TestFail;
}
/*
* Test that dynamically allocated timers are stopped when
* deleted. This will result in a crash on failure.
*/
ManagedTimer *dyntimer = new ManagedTimer();
dyntimer->start(100);
delete dyntimer;
timer.start(200);
dispatcher->processEvents();
return TestPass;
}
void cleanup()
{
}
};
TEST_REGISTER(TimerTest)
|