diff options
author | Stanimir Varbanov <stanimir.varbanov@linaro.org> | 2020-08-26 14:20:13 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2021-01-13 09:15:46 +0100 |
commit | 05ec881b218c9a9500ce6f0b1363034608708040 (patch) | |
tree | 48f85e60d262d9d609f4f1b98909c73568c32534 /drivers/media/platform | |
parent | 869d77e7062906a84c2726dfc2433755b36a57e3 (diff) | |
download | linux-05ec881b218c9a9500ce6f0b1363034608708040.tar.bz2 |
media: venus: hfi_plat: Add hfi platform buffers ops
>From Venus v6 and beyond the buffer size and count have to be
calculated in the v4l2 driver instead of getting them from
firmware.
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/platform')
-rw-r--r-- | drivers/media/platform/qcom/venus/hfi_plat_bufs.h | 35 | ||||
-rw-r--r-- | drivers/media/platform/qcom/venus/hfi_platform.h | 3 |
2 files changed, 38 insertions, 0 deletions
diff --git a/drivers/media/platform/qcom/venus/hfi_plat_bufs.h b/drivers/media/platform/qcom/venus/hfi_plat_bufs.h new file mode 100644 index 000000000000..6dfecaf5b0bd --- /dev/null +++ b/drivers/media/platform/qcom/venus/hfi_plat_bufs.h @@ -0,0 +1,35 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright (c) 2020, The Linux Foundation. All rights reserved. + */ + +#ifndef __HFI_PLATFORM_BUFFERS_H__ +#define __HFI_PLATFORM_BUFFERS_H__ + +#include <linux/types.h> +#include "hfi_helper.h" + +struct hfi_plat_buffers_params { + u32 width; + u32 height; + u32 codec; + u32 hfi_color_fmt; + enum hfi_version version; + u32 num_vpp_pipes; + union { + struct { + u32 max_mbs_per_frame; + u32 buffer_size_limit; + bool is_secondary_output; + bool is_interlaced; + } dec; + struct { + u32 work_mode; + u32 rc_type; + u32 num_b_frames; + bool is_tenbit; + } enc; + }; +}; + +#endif diff --git a/drivers/media/platform/qcom/venus/hfi_platform.h b/drivers/media/platform/qcom/venus/hfi_platform.h index 845737a50463..3819bb2b36bd 100644 --- a/drivers/media/platform/qcom/venus/hfi_platform.h +++ b/drivers/media/platform/qcom/venus/hfi_platform.h @@ -10,6 +10,7 @@ #include <linux/videodev2.h> #include "hfi.h" +#include "hfi_plat_bufs.h" #include "hfi_helper.h" #define MAX_PLANES 4 @@ -50,6 +51,8 @@ struct hfi_platform { void (*codecs)(u32 *enc_codecs, u32 *dec_codecs, u32 *count); const struct hfi_plat_caps *(*capabilities)(unsigned int *entries); u8 (*num_vpp_pipes)(void); + int (*bufreq)(struct hfi_plat_buffers_params *params, u32 session_type, + u32 buftype, struct hfi_buffer_requirements *bufreq); }; extern const struct hfi_platform hfi_plat_v4; |