| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (c) 2012-2016, The Linux Foundation. All rights reserved. |
|---|
| 3 | 4 | * 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 | | - * |
|---|
| 14 | 5 | */ |
|---|
| 15 | 6 | #ifndef __VENUS_HFI_HELPER_H__ |
|---|
| 16 | 7 | #define __VENUS_HFI_HELPER_H__ |
|---|
| .. | .. |
|---|
| 240 | 231 | #define HFI_RATE_CONTROL_VBR_CFR 0x1000003 |
|---|
| 241 | 232 | #define HFI_RATE_CONTROL_CBR_VFR 0x1000004 |
|---|
| 242 | 233 | #define HFI_RATE_CONTROL_CBR_CFR 0x1000005 |
|---|
| 234 | +#define HFI_RATE_CONTROL_CQ 0x1000008 |
|---|
| 243 | 235 | |
|---|
| 244 | 236 | #define HFI_VIDEO_CODEC_H264 0x00000002 |
|---|
| 245 | 237 | #define HFI_VIDEO_CODEC_H263 0x00000004 |
|---|
| .. | .. |
|---|
| 371 | 363 | |
|---|
| 372 | 364 | #define HFI_HEVC_TIER_MAIN 0x1 |
|---|
| 373 | 365 | #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 |
|---|
| 374 | 384 | |
|---|
| 375 | 385 | #define HFI_BUFFER_INPUT 0x1 |
|---|
| 376 | 386 | #define HFI_BUFFER_OUTPUT 0x2 |
|---|
| .. | .. |
|---|
| 513 | 523 | #define HFI_PROPERTY_CONFIG_VENC_HIER_P_ENH_LAYER 0x200600b |
|---|
| 514 | 524 | #define HFI_PROPERTY_CONFIG_VENC_LTRPERIOD 0x200600c |
|---|
| 515 | 525 | #define HFI_PROPERTY_CONFIG_VENC_PERF_MODE 0x200600e |
|---|
| 526 | +#define HFI_PROPERTY_CONFIG_HEIC_FRAME_QUALITY 0x2006014 |
|---|
| 516 | 527 | |
|---|
| 517 | 528 | /* |
|---|
| 518 | 529 | * HFI_PROPERTY_PARAM_VPE_COMMON_START |
|---|
| .. | .. |
|---|
| 529 | 540 | enum hfi_version { |
|---|
| 530 | 541 | HFI_VERSION_1XX, |
|---|
| 531 | 542 | HFI_VERSION_3XX, |
|---|
| 532 | | - HFI_VERSION_4XX |
|---|
| 543 | + HFI_VERSION_4XX, |
|---|
| 544 | + HFI_VERSION_6XX, |
|---|
| 533 | 545 | }; |
|---|
| 534 | 546 | |
|---|
| 535 | 547 | struct hfi_buffer_info { |
|---|
| .. | .. |
|---|
| 559 | 571 | #define HFI_CAPABILITY_LCU_SIZE 0x14 |
|---|
| 560 | 572 | #define HFI_CAPABILITY_HIER_P_HYBRID_NUM_ENH_LAYERS 0x15 |
|---|
| 561 | 573 | #define HFI_CAPABILITY_MBS_PER_SECOND_POWERSAVE 0x16 |
|---|
| 574 | +#define HFI_CAPABILITY_MAX_VIDEOCORES 0x2b |
|---|
| 562 | 575 | |
|---|
| 563 | 576 | struct hfi_capability { |
|---|
| 564 | 577 | u32 capability_type; |
|---|
| .. | .. |
|---|
| 569 | 582 | |
|---|
| 570 | 583 | struct hfi_capabilities { |
|---|
| 571 | 584 | u32 num_capabilities; |
|---|
| 572 | | - struct hfi_capability data[1]; |
|---|
| 585 | + struct hfi_capability data[]; |
|---|
| 573 | 586 | }; |
|---|
| 574 | 587 | |
|---|
| 575 | 588 | #define HFI_DEBUG_MSG_LOW 0x01 |
|---|
| .. | .. |
|---|
| 726 | 739 | |
|---|
| 727 | 740 | struct hfi_profile_level_supported { |
|---|
| 728 | 741 | u32 profile_count; |
|---|
| 729 | | - struct hfi_profile_level profile_level[1]; |
|---|
| 742 | + struct hfi_profile_level profile_level[]; |
|---|
| 730 | 743 | }; |
|---|
| 731 | 744 | |
|---|
| 732 | 745 | struct hfi_quality_vs_speed { |
|---|
| 733 | 746 | u32 quality_vs_speed; |
|---|
| 747 | +}; |
|---|
| 748 | + |
|---|
| 749 | +struct hfi_heic_frame_quality { |
|---|
| 750 | + u32 frame_quality; |
|---|
| 751 | + u32 reserved[3]; |
|---|
| 734 | 752 | }; |
|---|
| 735 | 753 | |
|---|
| 736 | 754 | struct hfi_quantization { |
|---|
| .. | .. |
|---|
| 801 | 819 | u32 time_scale; |
|---|
| 802 | 820 | }; |
|---|
| 803 | 821 | |
|---|
| 822 | +#define VIDC_BITDEPTH_8 0x00000 |
|---|
| 823 | +#define VIDC_BITDEPTH_10 0x20002 |
|---|
| 824 | + |
|---|
| 804 | 825 | struct hfi_bit_depth { |
|---|
| 805 | 826 | u32 buffer_type; |
|---|
| 806 | 827 | u32 bit_depth; |
|---|
| .. | .. |
|---|
| 849 | 870 | #define HFI_COLOR_FORMAT_10_BIT_BASE 0x4000 |
|---|
| 850 | 871 | |
|---|
| 851 | 872 | #define HFI_COLOR_FORMAT_YUV420_TP10 0x4002 |
|---|
| 873 | +#define HFI_COLOR_FORMAT_P010 0x4003 |
|---|
| 852 | 874 | #define HFI_COLOR_FORMAT_NV12_UBWC 0x8002 |
|---|
| 853 | 875 | #define HFI_COLOR_FORMAT_YUV420_TP10_UBWC 0xc002 |
|---|
| 876 | +#define HFI_COLOR_FORMAT_P010_UBWC 0xc003 |
|---|
| 854 | 877 | #define HFI_COLOR_FORMAT_RGBA8888_UBWC 0x8010 |
|---|
| 855 | 878 | |
|---|
| 856 | 879 | struct hfi_uncompressed_format_select { |
|---|