hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/media/platform/qcom/venus/hfi_helper.h
....@@ -1,16 +1,7 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
34 * Copyright (C) 2017 Linaro Ltd.
4
- *
5
- * This program is free software; you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License version 2 and
7
- * only version 2 as published by the Free Software Foundation.
8
- *
9
- * This program is distributed in the hope that it will be useful,
10
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- * GNU General Public License for more details.
13
- *
145 */
156 #ifndef __VENUS_HFI_HELPER_H__
167 #define __VENUS_HFI_HELPER_H__
....@@ -240,6 +231,7 @@
240231 #define HFI_RATE_CONTROL_VBR_CFR 0x1000003
241232 #define HFI_RATE_CONTROL_CBR_VFR 0x1000004
242233 #define HFI_RATE_CONTROL_CBR_CFR 0x1000005
234
+#define HFI_RATE_CONTROL_CQ 0x1000008
243235
244236 #define HFI_VIDEO_CODEC_H264 0x00000002
245237 #define HFI_VIDEO_CODEC_H263 0x00000004
....@@ -371,6 +363,24 @@
371363
372364 #define HFI_HEVC_TIER_MAIN 0x1
373365 #define HFI_HEVC_TIER_HIGH0 0x2
366
+
367
+/* VP9 Profile 0, 8-bit */
368
+#define HFI_VP9_PROFILE_P0 0x00000001
369
+/* VP9 Profile 2, 10-bit */
370
+#define HFI_VP9_PROFILE_P2_10B 0x00000004
371
+
372
+#define HFI_VP9_LEVEL_1 0x00000001
373
+#define HFI_VP9_LEVEL_11 0x00000002
374
+#define HFI_VP9_LEVEL_2 0x00000004
375
+#define HFI_VP9_LEVEL_21 0x00000008
376
+#define HFI_VP9_LEVEL_3 0x00000010
377
+#define HFI_VP9_LEVEL_31 0x00000020
378
+#define HFI_VP9_LEVEL_4 0x00000040
379
+#define HFI_VP9_LEVEL_41 0x00000080
380
+#define HFI_VP9_LEVEL_5 0x00000100
381
+#define HFI_VP9_LEVEL_51 0x00000200
382
+#define HFI_VP9_LEVEL_6 0x00000400
383
+#define HFI_VP9_LEVEL_61 0x00000800
374384
375385 #define HFI_BUFFER_INPUT 0x1
376386 #define HFI_BUFFER_OUTPUT 0x2
....@@ -513,6 +523,7 @@
513523 #define HFI_PROPERTY_CONFIG_VENC_HIER_P_ENH_LAYER 0x200600b
514524 #define HFI_PROPERTY_CONFIG_VENC_LTRPERIOD 0x200600c
515525 #define HFI_PROPERTY_CONFIG_VENC_PERF_MODE 0x200600e
526
+#define HFI_PROPERTY_CONFIG_HEIC_FRAME_QUALITY 0x2006014
516527
517528 /*
518529 * HFI_PROPERTY_PARAM_VPE_COMMON_START
....@@ -529,7 +540,8 @@
529540 enum hfi_version {
530541 HFI_VERSION_1XX,
531542 HFI_VERSION_3XX,
532
- HFI_VERSION_4XX
543
+ HFI_VERSION_4XX,
544
+ HFI_VERSION_6XX,
533545 };
534546
535547 struct hfi_buffer_info {
....@@ -559,6 +571,7 @@
559571 #define HFI_CAPABILITY_LCU_SIZE 0x14
560572 #define HFI_CAPABILITY_HIER_P_HYBRID_NUM_ENH_LAYERS 0x15
561573 #define HFI_CAPABILITY_MBS_PER_SECOND_POWERSAVE 0x16
574
+#define HFI_CAPABILITY_MAX_VIDEOCORES 0x2b
562575
563576 struct hfi_capability {
564577 u32 capability_type;
....@@ -569,7 +582,7 @@
569582
570583 struct hfi_capabilities {
571584 u32 num_capabilities;
572
- struct hfi_capability data[1];
585
+ struct hfi_capability data[];
573586 };
574587
575588 #define HFI_DEBUG_MSG_LOW 0x01
....@@ -726,11 +739,16 @@
726739
727740 struct hfi_profile_level_supported {
728741 u32 profile_count;
729
- struct hfi_profile_level profile_level[1];
742
+ struct hfi_profile_level profile_level[];
730743 };
731744
732745 struct hfi_quality_vs_speed {
733746 u32 quality_vs_speed;
747
+};
748
+
749
+struct hfi_heic_frame_quality {
750
+ u32 frame_quality;
751
+ u32 reserved[3];
734752 };
735753
736754 struct hfi_quantization {
....@@ -801,6 +819,9 @@
801819 u32 time_scale;
802820 };
803821
822
+#define VIDC_BITDEPTH_8 0x00000
823
+#define VIDC_BITDEPTH_10 0x20002
824
+
804825 struct hfi_bit_depth {
805826 u32 buffer_type;
806827 u32 bit_depth;
....@@ -849,8 +870,10 @@
849870 #define HFI_COLOR_FORMAT_10_BIT_BASE 0x4000
850871
851872 #define HFI_COLOR_FORMAT_YUV420_TP10 0x4002
873
+#define HFI_COLOR_FORMAT_P010 0x4003
852874 #define HFI_COLOR_FORMAT_NV12_UBWC 0x8002
853875 #define HFI_COLOR_FORMAT_YUV420_TP10_UBWC 0xc002
876
+#define HFI_COLOR_FORMAT_P010_UBWC 0xc003
854877 #define HFI_COLOR_FORMAT_RGBA8888_UBWC 0x8010
855878
856879 struct hfi_uncompressed_format_select {