Re: [PATCH v8 16/28] media: iris: implement vb2 streaming ops

From: Stefan Schmidt
Date: Tue Dec 10 2024 - 07:51:03 EST


Hello Dikshita,

On Tue, 10 Dec 2024 at 12:07, Dikshita Agarwal
<quic_dikshita@xxxxxxxxxxx> wrote:
>
> +static int iris_hfi_gen1_session_stop(struct iris_inst *inst, u32 plane)
> +{
> + struct hfi_session_flush_pkt flush_pkt;
> + struct iris_core *core = inst->core;
> + struct hfi_session_pkt pkt;
> + u32 flush_type = 0;
> + int ret = 0;
> +
> + if ((V4L2_TYPE_IS_OUTPUT(plane) &&
> + inst->state == IRIS_INST_INPUT_STREAMING) ||
> + (V4L2_TYPE_IS_CAPTURE(plane) &&
> + inst->state == IRIS_INST_OUTPUT_STREAMING) ||
> + inst->state == IRIS_INST_ERROR) {
> + reinit_completion(&inst->completion);
> + iris_hfi_gen1_packet_session_cmd(inst, &pkt, HFI_CMD_SESSION_STOP);
> + ret = iris_hfi_queue_cmd_write(core, &pkt, pkt.shdr.hdr.size);
> + if (!ret)
> + ret = iris_wait_for_session_response(inst, false);
> +
> + reinit_completion(&inst->completion);
> + iris_hfi_gen1_packet_session_cmd(inst, &pkt, HFI_CMD_SESSION_RELEASE_RESOURCES);
> + ret = iris_hfi_queue_cmd_write(core, &pkt, pkt.shdr.hdr.size);
> + if (!ret)
> + ret = iris_wait_for_session_response(inst, false);
> + } else if (inst->state == IRIS_INST_STREAMING) {
> + if (V4L2_TYPE_IS_OUTPUT(plane))
> + flush_type = HFI_FLUSH_ALL;
> + else if (V4L2_TYPE_IS_CAPTURE(plane))
> + flush_type = HFI_FLUSH_OUTPUT;

Below there is also HFI_FLUSH_OUTPUT2 defined. Do we need to handle
this flush type here as well?

[...]

> +#define HFI_FLUSH_OUTPUT 0x1000002
> +#define HFI_FLUSH_OUTPUT2 0x1000003

regards
Stefan Schmidt