Skip to content

Commit 05ec881

Browse files
Stanimir Varbanovmchehab
authored andcommitted
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 <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 869d77e commit 05ec881

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/* SPDX-License-Identifier: GPL-2.0-only */
2+
/*
3+
* Copyright (c) 2020, The Linux Foundation. All rights reserved.
4+
*/
5+
6+
#ifndef __HFI_PLATFORM_BUFFERS_H__
7+
#define __HFI_PLATFORM_BUFFERS_H__
8+
9+
#include <linux/types.h>
10+
#include "hfi_helper.h"
11+
12+
struct hfi_plat_buffers_params {
13+
u32 width;
14+
u32 height;
15+
u32 codec;
16+
u32 hfi_color_fmt;
17+
enum hfi_version version;
18+
u32 num_vpp_pipes;
19+
union {
20+
struct {
21+
u32 max_mbs_per_frame;
22+
u32 buffer_size_limit;
23+
bool is_secondary_output;
24+
bool is_interlaced;
25+
} dec;
26+
struct {
27+
u32 work_mode;
28+
u32 rc_type;
29+
u32 num_b_frames;
30+
bool is_tenbit;
31+
} enc;
32+
};
33+
};
34+
35+
#endif

drivers/media/platform/qcom/venus/hfi_platform.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <linux/videodev2.h>
1111

1212
#include "hfi.h"
13+
#include "hfi_plat_bufs.h"
1314
#include "hfi_helper.h"
1415

1516
#define MAX_PLANES 4
@@ -50,6 +51,8 @@ struct hfi_platform {
5051
void (*codecs)(u32 *enc_codecs, u32 *dec_codecs, u32 *count);
5152
const struct hfi_plat_caps *(*capabilities)(unsigned int *entries);
5253
u8 (*num_vpp_pipes)(void);
54+
int (*bufreq)(struct hfi_plat_buffers_params *params, u32 session_type,
55+
u32 buftype, struct hfi_buffer_requirements *bufreq);
5356
};
5457

5558
extern const struct hfi_platform hfi_plat_v4;

0 commit comments

Comments
 (0)