mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-27 04:22:58 +00:00
During the stream on operation, send HFI_CMD_START on the capture and
output planes to start processing on the respective planes.
During the stream off operation, send HFI_CMD_STOP to the firmware,
which is a synchronous command. After the response is received by the
firmware, the session is closed on the firmware.
Introduce different states for the instance and state transitions.
IRIS_INST_INIT - video instance is opened.
IRIS_INST_INPUT_STREAMING - stream on is completed on output plane.
IRIS_INST_OUTPUT_STREAMING - stream on is completed on capture plane.
IRIS_INST_STREAMING - stream on is completed on both output and capture
planes.
IRIS_INST_DEINIT - video instance is closed.
IRIS_INST_ERROR - error state.
|
v
-------------
+---------| INIT |--------- +
| ------------- |
| ^ ^ |
| / \ |
| / \ |
| v v |
| ----------- ----------- |
| | INPUT OUTPUT | |
|---| STREAMING STREAMING |---|
| ----------- ----------- |
| ^ ^ |
| \ / |
| \ / |
| v v |
| ------------- |
|--------| STREAMING |-----------|
| ------------- |
| | |
| | |
| v |
| ----------- |
+-------->| DEINIT |<----------+
| ----------- |
| | |
| | |
| v |
| ---------- |
+-------->| ERROR |<-----------+
----------.
Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
Tested-by: Stefan Schmidt <stefan.schmidt@linaro.org> # x1e80100 (Dell XPS 13 9345)
Reviewed-by: Stefan Schmidt <stefan.schmidt@linaro.org>
Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8550-QRD
Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8550-HDK
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
35 lines
778 B
C
35 lines
778 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved.
|
|
*/
|
|
|
|
#ifndef __IRIS_UTILS_H__
|
|
#define __IRIS_UTILS_H__
|
|
|
|
struct iris_core;
|
|
#include "iris_buffer.h"
|
|
|
|
struct iris_hfi_rect_desc {
|
|
u32 left;
|
|
u32 top;
|
|
u32 width;
|
|
u32 height;
|
|
};
|
|
|
|
#define NUM_MBS_PER_FRAME(height, width) \
|
|
(DIV_ROUND_UP(height, 16) * DIV_ROUND_UP(width, 16))
|
|
|
|
static inline enum iris_buffer_type iris_v4l2_type_to_driver(u32 type)
|
|
{
|
|
if (type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE)
|
|
return BUF_INPUT;
|
|
else
|
|
return BUF_OUTPUT;
|
|
}
|
|
|
|
int iris_get_mbpf(struct iris_inst *inst);
|
|
struct iris_inst *iris_get_instance(struct iris_core *core, u32 session_id);
|
|
int iris_wait_for_session_response(struct iris_inst *inst, bool is_flush);
|
|
|
|
#endif
|