Re: [PATCH 20/33] iris: vidc: hfi: add helpers for handling shared queues

From: Konrad Dybcio
Date: Fri Jul 28 2023 - 13:58:59 EST


On 28.07.2023 15:23, Vikash Garodia wrote:
> This implements functions to allocate and update the shared memory
> used for sending commands to firmware and receiving messages from
> firmware.
>
> Signed-off-by: Dikshita Agarwal <quic_dikshita@xxxxxxxxxxx>
> Signed-off-by: Vikash Garodia <quic_vgarodia@xxxxxxxxxxx>
> ---
> .../platform/qcom/iris/vidc/inc/venus_hfi_queue.h | 89 ++++
> .../platform/qcom/iris/vidc/src/venus_hfi_queue.c | 537 +++++++++++++++++++++
> 2 files changed, 626 insertions(+)
> create mode 100644 drivers/media/platform/qcom/iris/vidc/inc/venus_hfi_queue.h
> create mode 100644 drivers/media/platform/qcom/iris/vidc/src/venus_hfi_queue.c
>
> diff --git a/drivers/media/platform/qcom/iris/vidc/inc/venus_hfi_queue.h b/drivers/media/platform/qcom/iris/vidc/inc/venus_hfi_queue.h
> new file mode 100644
> index 0000000..f533811
> --- /dev/null
> +++ b/drivers/media/platform/qcom/iris/vidc/inc/venus_hfi_queue.h
> @@ -0,0 +1,89 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +/*
> + * Copyright (c) 2020-2022, The Linux Foundation. All rights reserved.
> + * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
> + */
> +
> +#ifndef _VENUS_HFI_QUEUE_H_
> +#define _VENUS_HFI_QUEUE_H_
> +
> +#include <linux/types.h>
> +
> +#include "msm_vidc_internal.h"
> +
> +#define HFI_MASK_QHDR_TX_TYPE 0xff000000
> +#define HFI_MASK_QHDR_RX_TYPE 0x00ff0000
> +#define HFI_MASK_QHDR_PRI_TYPE 0x0000ff00
> +#define HFI_MASK_QHDR_Q_ID_TYPE 0x000000ff
> +#define HFI_Q_ID_HOST_TO_CTRL_CMD_Q 0
> +#define HFI_Q_ID_CTRL_TO_HOST_MSG_Q 1
> +#define HFI_Q_ID_CTRL_TO_HOST_DEBUG_Q 2
> +#define HFI_MASK_QHDR_STATUS 0x000000ff
GENMASK, BIT()..

Konrad