Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 28 additions & 3 deletions drivers/media/platform/apple/avd/tests/vp9-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
enum vb2_buffer_state { STATE_DUMMY };
#define dev_err(d,...) ((void)(d))
#define kzalloc(n,f) calloc(1,n)
#define kfree free
#define kfree(p) free((void *)(p))
static bool vp_feature = true;
static bool avd_qfw_has_vp_done(const struct avd_dev *d) { return d->queued && vp_feature; }
static bool avd_backend_is_open(const struct avd_dev *d) { return !d->queued; }
Expand All @@ -72,6 +72,32 @@
static struct v4l2_ctrl_vp9_frame params;
static struct v4l2_ctrl_vp9_compressed_hdr updates;
static struct v4l2_ctrl frame_ctrl,update_ctrl;
static struct v4l2_ctrl *locked_ctrl;

static void v4l2_ctrl_lock(struct v4l2_ctrl *ctrl)
{
assert(!locked_ctrl);
locked_ctrl = ctrl;
}

static void v4l2_ctrl_unlock(struct v4l2_ctrl *ctrl)
{
assert(locked_ctrl == ctrl);
locked_ctrl = NULL;
}

static void *kmemdup(const void *source, size_t size, int flags)
{
void *copy;

(void)flags;
assert(locked_ctrl);
copy = malloc(size);
if (copy)
memcpy(copy, source, size);
return copy;
}

static struct v4l2_ctrl *v4l2_ctrl_find(void *h,u32 id) {
(void)h;frame_ctrl.p_cur.p=&params;update_ctrl.p_cur.p=&updates;
return id==V4L2_CID_STATELESS_VP9_FRAME?&frame_ctrl:&update_ctrl;
Expand Down Expand Up @@ -184,8 +210,7 @@ def without_includes(s):
assert(!memcmp(&adapted,&p->bank[1].probability_tables,sizeof(adapted)));
write_program(argv[1],"vp9-adaptive-1",&frame);
assert(!avd_vp9_ready(&ctx));
struct avd_vp9_run attempt;
current_dst=&dst[2].base.vb;assert(avd_vp9_run_preamble(&ctx,&attempt)==-EBUSY);assert(!dst[2].bank);
current_dst=&dst[2].base.vb;assert(avd_vp9_run(&ctx)==-EBUSY);assert(!dst[2].bank);
/* PP(0) retires while b points to bank 1: only bank 0 may be released. */
avd_vp9_done(&ctx,&src,&dst[0].base.vb,VB2_BUF_STATE_DONE);
assert(!p->bank[0].busy&&p->bank[1].busy&&!dst[0].bank);
Expand Down
Loading