mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 21:40:08 +01:00
radeonsi/vpe: support vpe 1.1
update radeonsi and vpelib to support vpe 1.1 Co-authored-by: Alan Liu <haoping.liu@amd.com> Signed-off-by: Peyton Lee <peytolee@amd.com> Signed-off-by: Yifan Zhang <yifan1.zhang@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28239>
This commit is contained in:
parent
c73c244a6c
commit
f351e4be11
13 changed files with 504 additions and 0 deletions
|
|
@ -80,6 +80,7 @@ enum vpe_status {
|
|||
enum vpe_ip_level {
|
||||
VPE_IP_LEVEL_UNKNOWN = (-1),
|
||||
VPE_IP_LEVEL_1_0,
|
||||
VPE_IP_LEVEL_1_1
|
||||
};
|
||||
|
||||
/****************************************
|
||||
|
|
@ -604,6 +605,8 @@ struct vpe_build_param {
|
|||
uint32_t reserved : 31;
|
||||
} flags;
|
||||
|
||||
uint16_t num_instances;
|
||||
bool collaboration_mode;
|
||||
};
|
||||
|
||||
/** reported through vpe_check_support()
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ c_args_vpe += [
|
|||
'-DLITTLEENDIAN_CPU',
|
||||
'-DVPE_BUILD_1_0',
|
||||
'-DVPE_BUILD_1_X',
|
||||
'-DVPE_BUILD_1_1',
|
||||
]
|
||||
|
||||
vpe_files = files(
|
||||
|
|
@ -127,6 +128,10 @@ vpe_files = files(
|
|||
'src/chip/vpe10/vpe10_background.c',
|
||||
'src/chip/vpe10/vpe10_cdc.c',
|
||||
'src/chip/vpe10/vpe10_vpec.c',
|
||||
'src/chip/vpe11/inc/vpe11_cmd_builder.h',
|
||||
'src/chip/vpe11/inc/vpe11_resource.h',
|
||||
'src/chip/vpe11/vpe11_cmd_builder.c',
|
||||
'src/chip/vpe11/vpe11_resource.c',
|
||||
)
|
||||
|
||||
inc_amd_vpe = include_directories(
|
||||
|
|
@ -136,6 +141,7 @@ inc_amd_vpe = include_directories(
|
|||
'src/chip',
|
||||
'src/utils/inc',
|
||||
'src/chip/vpe10/inc',
|
||||
'src/chip/vpe11/inc',
|
||||
)
|
||||
|
||||
libvpe = static_library(
|
||||
|
|
|
|||
38
src/amd/vpelib/src/chip/vpe11/inc/vpe11_cmd_builder.h
Normal file
38
src/amd/vpelib/src/chip/vpe11/inc/vpe11_cmd_builder.h
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
/* Copyright 2023 Advanced Micro Devices, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Authors: AMD
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "cmd_builder.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void vpe11_construct_cmd_builder(struct vpe_priv *vpe_priv, struct cmd_builder *cmd_builder);
|
||||
|
||||
enum vpe_status vpe11_build_collaborate_sync_cmd(
|
||||
struct vpe_priv *vpe_priv, struct vpe_build_bufs *cur_bufs, bool is_end);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
42
src/amd/vpelib/src/chip/vpe11/inc/vpe11_resource.h
Normal file
42
src/amd/vpelib/src/chip/vpe11/inc/vpe11_resource.h
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
/* Copyright 2023 Advanced Micro Devices, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Authors: AMD
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "resource.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
enum vpe_status vpe11_construct_resource(struct vpe_priv *vpe_priv, struct resource *res);
|
||||
|
||||
void vpe11_destroy_resource(struct vpe_priv *vpe_priv, struct resource *res);
|
||||
|
||||
enum vpe_status vpe11_set_num_segments(struct vpe_priv *vpe_priv, struct stream_ctx *stream_ctx,
|
||||
struct scaler_data *scl_data, struct vpe_rect *src_rect, struct vpe_rect *dst_rect,
|
||||
uint32_t *max_seg_width);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
68
src/amd/vpelib/src/chip/vpe11/vpe11_cmd_builder.c
Normal file
68
src/amd/vpelib/src/chip/vpe11/vpe11_cmd_builder.c
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
/* Copyright 2023 Advanced Micro Devices, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Authors: AMD
|
||||
*
|
||||
*/
|
||||
#include "vpe_assert.h"
|
||||
#include "common.h"
|
||||
#include "vpe_priv.h"
|
||||
#include "vpe_command.h"
|
||||
#include "vpe10_cmd_builder.h"
|
||||
#include "vpe11_cmd_builder.h"
|
||||
#include "plane_desc_writer.h"
|
||||
#include "reg_helper.h"
|
||||
|
||||
void vpe11_construct_cmd_builder(struct vpe_priv *vpe_priv, struct cmd_builder *builder)
|
||||
{
|
||||
builder->build_noops = vpe10_build_noops;
|
||||
builder->build_vpe_cmd = vpe10_build_vpe_cmd;
|
||||
builder->build_plane_descriptor = vpe10_build_plane_descriptor;
|
||||
// build collaborate sync cmd
|
||||
builder->build_collaborate_sync_cmd = vpe11_build_collaborate_sync_cmd;
|
||||
}
|
||||
|
||||
enum vpe_status vpe11_build_collaborate_sync_cmd(
|
||||
struct vpe_priv *vpe_priv, struct vpe_build_bufs *cur_bufs, bool is_end)
|
||||
{
|
||||
struct vpe_buf *buf = &cur_bufs->cmd_buf;
|
||||
uint32_t *cmd_space;
|
||||
uint64_t size = 2 * sizeof(uint32_t);
|
||||
uint32_t collarborate_sync_data = vpe_priv->collaborate_sync_index;
|
||||
enum vpe_status status = VPE_STATUS_OK;
|
||||
|
||||
if (buf->size < size)
|
||||
status = VPE_STATUS_BUFFER_OVERFLOW;
|
||||
|
||||
if (status == VPE_STATUS_OK) {
|
||||
cmd_space = (uint32_t*)(uintptr_t)buf->cpu_va;
|
||||
*cmd_space++ = VPE_COLLABORATE_SYNC_CMD_HEADER;
|
||||
*cmd_space++ = VPE_COLLABORATE_SYNC_DATA_MASK(collarborate_sync_data);
|
||||
|
||||
if (is_end == true) {
|
||||
vpe_priv->collaborate_sync_index++;
|
||||
}
|
||||
buf->cpu_va += size;
|
||||
buf->gpu_va += size;
|
||||
buf->size -= size;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
237
src/amd/vpelib/src/chip/vpe11/vpe11_resource.c
Normal file
237
src/amd/vpelib/src/chip/vpe11/vpe11_resource.c
Normal file
|
|
@ -0,0 +1,237 @@
|
|||
/* Copyright 2023 Advanced Micro Devices, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Authors: AMD
|
||||
*
|
||||
*/
|
||||
#include <string.h>
|
||||
#include "vpe_priv.h"
|
||||
#include "common.h"
|
||||
#include "vpe11_resource.h"
|
||||
#include "vpe10_resource.h"
|
||||
#include "vpe11_cmd_builder.h"
|
||||
#include "vpe10_vpec.h"
|
||||
#include "vpe10_cdc.h"
|
||||
#include "vpe10_dpp.h"
|
||||
#include "vpe10_mpc.h"
|
||||
#include "vpe10_opp.h"
|
||||
#include "vpe_command.h"
|
||||
#include "vpe10_cm_common.h"
|
||||
#include "vpe10_background.h"
|
||||
#include "vpe10/inc/asic/bringup_vpe_6_1_0_offset.h"
|
||||
#include "vpe10/inc/asic/bringup_vpe_6_1_0_sh_mask.h"
|
||||
#include "vpe10/inc/asic/bringup_vpe_6_1_0_default.h"
|
||||
#include "vpe10/inc/asic/vpe_1_0_offset.h"
|
||||
#include "custom_fp16.h"
|
||||
#include "custom_float.h"
|
||||
#include "background.h"
|
||||
|
||||
#define LUT_NUM_ENTRIES (17 * 17 * 17)
|
||||
#define LUT_ENTRY_SIZE (2)
|
||||
#define LUT_NUM_COMPONENT (3)
|
||||
#define LUT_BUFFER_SIZE (LUT_NUM_ENTRIES * LUT_ENTRY_SIZE * LUT_NUM_COMPONENT)
|
||||
|
||||
// set field/register/bitfield name
|
||||
#define SFRB(field_name, reg_name, post_fix) .field_name = reg_name##__##field_name##post_fix
|
||||
|
||||
#define BASE_INNER(seg_id) VPE_BASE__INST0_SEG##seg_id
|
||||
|
||||
#define BASE(seg_id) BASE_INNER(seg_id)
|
||||
|
||||
// set register with block id and default val, init lastWrittenVal as default while isWritten set to
|
||||
// false
|
||||
#define SRIDFVL(reg_name, block, id) \
|
||||
.reg_name = {BASE(reg##reg_name##_BASE_IDX) + reg##reg_name, reg##reg_name##_##DEFAULT, \
|
||||
reg##reg_name##_##DEFAULT, false}
|
||||
|
||||
static struct vpe_caps caps = {
|
||||
.lut_size = LUT_BUFFER_SIZE,
|
||||
.rotation_support = 0,
|
||||
.h_mirror_support = 1,
|
||||
.v_mirror_support = 0,
|
||||
.is_apu = 1,
|
||||
.bg_color_check_support = 0,
|
||||
.resource_caps =
|
||||
{
|
||||
.num_dpp = 1,
|
||||
.num_opp = 1,
|
||||
.num_mpc_3dlut = 1,
|
||||
.num_queue = 8,
|
||||
},
|
||||
.color_caps = {.dpp =
|
||||
{
|
||||
.pre_csc = 1,
|
||||
.luma_key = 0,
|
||||
.dgam_ram = 0,
|
||||
.post_csc = 1,
|
||||
.gamma_corr = 1,
|
||||
.hw_3dlut = 1,
|
||||
.ogam_ram = 1, /**< programmable gam in output -> gamma_corr */
|
||||
.ocsc = 0,
|
||||
.dgam_rom_caps =
|
||||
{
|
||||
.srgb = 1,
|
||||
.bt2020 = 1,
|
||||
.gamma2_2 = 1,
|
||||
.pq = 1,
|
||||
.hlg = 1,
|
||||
},
|
||||
},
|
||||
.mpc =
|
||||
{
|
||||
.gamut_remap = 1,
|
||||
.ogam_ram = 1,
|
||||
.ocsc = 1,
|
||||
.shared_3d_lut = 1,
|
||||
.global_alpha = 1,
|
||||
.top_bottom_blending = 0,
|
||||
}},
|
||||
.plane_caps =
|
||||
{
|
||||
.per_pixel_alpha = 1,
|
||||
.input_pixel_format_support =
|
||||
{
|
||||
.argb_packed_32b = 1,
|
||||
.nv12 = 1,
|
||||
.fp16 = 0,
|
||||
.p010 = 1, /**< planar 4:2:0 10-bit */
|
||||
.p016 = 0, /**< planar 4:2:0 16-bit */
|
||||
.ayuv = 0, /**< packed 4:4:4 */
|
||||
.yuy2 = 0 /**< packed 4:2:2 */
|
||||
},
|
||||
.output_pixel_format_support = {.argb_packed_32b = 1,
|
||||
.nv12 = 0,
|
||||
.fp16 = 1,
|
||||
.p010 = 0,
|
||||
.p016 = 0,
|
||||
.ayuv = 0,
|
||||
.yuy2 = 0},
|
||||
.max_upscale_factor = 64000,
|
||||
|
||||
// 6:1 downscaling ratio: 1000/6 = 166.666
|
||||
.max_downscale_factor = 167,
|
||||
|
||||
.pitch_alignment = 256,
|
||||
.addr_alignment = 256,
|
||||
.max_viewport_width = 1024,
|
||||
},
|
||||
};
|
||||
|
||||
static struct vpe_cap_funcs cap_funcs = {.get_dcc_compression_cap = vpe10_get_dcc_compression_cap};
|
||||
|
||||
enum vpe_status vpe11_construct_resource(struct vpe_priv *vpe_priv, struct resource *res)
|
||||
{
|
||||
struct vpe *vpe = &vpe_priv->pub;
|
||||
|
||||
vpe->caps = ∩︀
|
||||
vpe->cap_funcs = &cap_funcs;
|
||||
|
||||
vpe10_construct_vpec(vpe_priv, &res->vpec);
|
||||
|
||||
res->cdc[0] = vpe10_cdc_create(vpe_priv, 0);
|
||||
if (!res->cdc[0])
|
||||
goto err;
|
||||
|
||||
res->dpp[0] = vpe10_dpp_create(vpe_priv, 0);
|
||||
if (!res->dpp[0])
|
||||
goto err;
|
||||
|
||||
res->mpc[0] = vpe10_mpc_create(vpe_priv, 0);
|
||||
if (!res->mpc[0])
|
||||
goto err;
|
||||
|
||||
res->opp[0] = vpe10_opp_create(vpe_priv, 0);
|
||||
if (!res->opp[0])
|
||||
goto err;
|
||||
|
||||
vpe11_construct_cmd_builder(vpe_priv, &res->cmd_builder);
|
||||
vpe_priv->num_pipe = 1;
|
||||
|
||||
res->internal_hdr_normalization = 1;
|
||||
|
||||
res->check_input_color_space = vpe10_check_input_color_space;
|
||||
res->check_output_color_space = vpe10_check_output_color_space;
|
||||
res->check_h_mirror_support = vpe10_check_h_mirror_support;
|
||||
res->calculate_segments = vpe10_calculate_segments;
|
||||
res->set_num_segments = vpe11_set_num_segments;
|
||||
res->split_bg_gap = vpe10_split_bg_gap;
|
||||
res->calculate_dst_viewport_and_active = vpe10_calculate_dst_viewport_and_active;
|
||||
res->find_bg_gaps = vpe_find_bg_gaps;
|
||||
res->create_bg_segments = vpe_create_bg_segments;
|
||||
res->populate_cmd_info = vpe10_populate_cmd_info;
|
||||
res->program_frontend = vpe10_program_frontend;
|
||||
res->program_backend = vpe10_program_backend;
|
||||
res->get_bufs_req = vpe10_get_bufs_req;
|
||||
res->get_tf_pwl_params = vpe10_cm_get_tf_pwl_params;
|
||||
|
||||
return VPE_STATUS_OK;
|
||||
err:
|
||||
vpe11_destroy_resource(vpe_priv, res);
|
||||
return VPE_STATUS_ERROR;
|
||||
}
|
||||
|
||||
void vpe11_destroy_resource(struct vpe_priv *vpe_priv, struct resource *res)
|
||||
{
|
||||
if (res->cdc[0] != NULL) {
|
||||
vpe_free(container_of(res->cdc[0], struct vpe10_cdc, base));
|
||||
res->cdc[0] = NULL;
|
||||
}
|
||||
|
||||
if (res->dpp[0] != NULL) {
|
||||
vpe_free(container_of(res->dpp[0], struct vpe10_dpp, base));
|
||||
res->dpp[0] = NULL;
|
||||
}
|
||||
|
||||
if (res->mpc[0] != NULL) {
|
||||
vpe_free(container_of(res->mpc[0], struct vpe10_mpc, base));
|
||||
res->mpc[0] = NULL;
|
||||
}
|
||||
|
||||
if (res->opp[0] != NULL) {
|
||||
vpe_free(container_of(res->opp[0], struct vpe10_opp, base));
|
||||
res->opp[0] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
enum vpe_status vpe11_set_num_segments(struct vpe_priv *vpe_priv, struct stream_ctx *stream_ctx,
|
||||
struct scaler_data *scl_data, struct vpe_rect *src_rect, struct vpe_rect *dst_rect,
|
||||
uint32_t *max_seg_width)
|
||||
{
|
||||
|
||||
uint16_t num_segs;
|
||||
struct dpp *dpp = vpe_priv->resource.dpp[0];
|
||||
const uint32_t max_lb_size = dpp->funcs->get_line_buffer_size();
|
||||
|
||||
*max_seg_width = min(*max_seg_width, max_lb_size / scl_data->taps.v_taps);
|
||||
|
||||
num_segs = vpe_get_num_segments(vpe_priv, src_rect, dst_rect, *max_seg_width);
|
||||
if ((src_rect->width > (uint32_t)(vpe_priv->vpe_num_instance * VPE_MIN_VIEWPORT_SIZE)) &&
|
||||
(num_segs % vpe_priv->vpe_num_instance != 0)) {
|
||||
num_segs += (vpe_priv->vpe_num_instance - (num_segs % vpe_priv->vpe_num_instance));
|
||||
}
|
||||
|
||||
stream_ctx->segment_ctx = vpe_alloc_segment_ctx(vpe_priv, num_segs);
|
||||
if (!stream_ctx->segment_ctx)
|
||||
return VPE_STATUS_NO_MEMORY;
|
||||
|
||||
stream_ctx->num_segments = num_segs;
|
||||
|
||||
return VPE_STATUS_OK;
|
||||
}
|
||||
|
|
@ -160,7 +160,11 @@ uint16_t vpe_find_bg_gaps(struct vpe_priv *vpe_priv, const struct vpe_rect *targ
|
|||
struct vpe_rect *dst_viewport_rect;
|
||||
bool full_bg = false;
|
||||
const uint32_t max_seg_width = vpe_priv->pub.caps->plane_caps.max_viewport_width;
|
||||
#ifdef VPE_BUILD_1_1
|
||||
const uint16_t num_multiple = vpe_priv->vpe_num_instance ? vpe_priv->vpe_num_instance : 1;
|
||||
#else
|
||||
const uint16_t num_multiple = 1;
|
||||
#endif
|
||||
|
||||
num_segs = vpe_priv->stream_ctx[0].num_segments;
|
||||
dst_viewport_rect = &(vpe_priv->stream_ctx[0].segment_ctx[0].scaler_data.dst_viewport);
|
||||
|
|
|
|||
|
|
@ -43,6 +43,10 @@ struct cmd_builder {
|
|||
enum vpe_status (*build_plane_descriptor)(
|
||||
struct vpe_priv *vpe_priv, struct vpe_buf *buf, uint32_t cmd_idx);
|
||||
|
||||
#ifdef VPE_BUILD_1_1
|
||||
enum vpe_status (*build_collaborate_sync_cmd)(
|
||||
struct vpe_priv *vpe_priv, struct vpe_build_bufs *cur_bufs, bool is_end);
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
|||
|
|
@ -41,6 +41,9 @@ enum VPE_CMD_OPCODE {
|
|||
VPE_CMD_OPCODE_POLL_REGMEM = 0x8,
|
||||
VPE_CMD_OPCODE_ATOMIC = 0xA,
|
||||
VPE_CMD_OPCODE_PLANE_FILL = 0xB,
|
||||
#ifdef VPE_BUILD_1_1
|
||||
VPE_CMD_OPCODE_COLLABORATE_SYNC = 0xC,
|
||||
#endif
|
||||
VPE_CMD_OPCODE_TIMESTAMP = 0xD
|
||||
};
|
||||
|
||||
|
|
@ -193,6 +196,14 @@ enum VPE_VPEP_CFG_SUBOP {
|
|||
#define VPE_IND_CFG_PKT_REGISTER_OFFSET__SHIFT 2
|
||||
#define VPE_IND_CFG_PKT_REGISTER_OFFSET_MASK 0x000FFFFC
|
||||
|
||||
#ifdef VPE_BUILD_1_1
|
||||
// Collaborate sync Command Header
|
||||
#define VPE_COLLABORATE_SYNC_HEADER_MASK 0x000000FF
|
||||
#define VPE_COLLABORATE_SYNC_DATA_MASK(collaborate_data) ((collaborate_data) & 0xFFFFFFFF)
|
||||
#define VPE_COLLABORATE_SYNC_CMD_HEADER \
|
||||
(VPE_CMD_HEADER(VPE_CMD_OPCODE_COLLABORATE_SYNC, 0) & VPE_COLLABORATE_SYNC_HEADER_MASK)
|
||||
#endif
|
||||
|
||||
/**************************
|
||||
* Poll Reg/Mem Sub-OpCode
|
||||
**************************/
|
||||
|
|
|
|||
|
|
@ -255,6 +255,12 @@ struct vpe_priv {
|
|||
bool scale_yuv_matrix; // this is a flag that forces scaling the yuv->rgb matrix
|
||||
// when embedding the color adjustments
|
||||
|
||||
#ifdef VPE_BUILD_1_1
|
||||
// collaborate sync data counter
|
||||
int32_t collaborate_sync_index;
|
||||
uint16_t vpe_num_instance;
|
||||
bool collaboration_mode;
|
||||
#endif
|
||||
enum vpe_expansion_mode expansion_mode;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -31,6 +31,10 @@
|
|||
#include "vpe10_resource.h"
|
||||
#endif
|
||||
|
||||
#ifdef VPE_BUILD_1_1
|
||||
#include "vpe11_resource.h"
|
||||
#endif
|
||||
|
||||
static const struct vpe_debug_options debug_defaults = {
|
||||
.flags = {0},
|
||||
.cm_in_bypass = 0,
|
||||
|
|
@ -87,6 +91,12 @@ enum vpe_ip_level vpe_resource_parse_ip_version(
|
|||
ip_level = VPE_IP_LEVEL_1_0;
|
||||
break;
|
||||
#endif
|
||||
#if VPE_BUILD_1_1
|
||||
case VPE_VERSION(6, 1, 1):
|
||||
case VPE_VERSION(6, 1, 2):
|
||||
ip_level = VPE_IP_LEVEL_1_1;
|
||||
break;
|
||||
#endif
|
||||
#endif
|
||||
default:
|
||||
ip_level = VPE_IP_LEVEL_UNKNOWN;
|
||||
|
|
@ -104,6 +114,11 @@ enum vpe_status vpe_construct_resource(
|
|||
case VPE_IP_LEVEL_1_0:
|
||||
status = vpe10_construct_resource(vpe_priv, res);
|
||||
break;
|
||||
#endif
|
||||
#ifdef VPE_BUILD_1_1
|
||||
case VPE_IP_LEVEL_1_1:
|
||||
status = vpe11_construct_resource(vpe_priv, res);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
status = VPE_STATUS_NOT_SUPPORTED;
|
||||
|
|
@ -126,6 +141,11 @@ void vpe_destroy_resource(struct vpe_priv *vpe_priv, struct resource *res)
|
|||
case VPE_IP_LEVEL_1_0:
|
||||
vpe10_destroy_resource(vpe_priv, res);
|
||||
break;
|
||||
#endif
|
||||
#ifdef VPE_BUILD_1_1
|
||||
case VPE_IP_LEVEL_1_1:
|
||||
vpe11_destroy_resource(vpe_priv, res);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -119,6 +119,22 @@ static void override_debug_option(
|
|||
debug->skip_optimal_tap_check = user_debug->skip_optimal_tap_check;
|
||||
}
|
||||
|
||||
#ifdef VPE_BUILD_1_1
|
||||
static void verify_collaboration_mode(struct vpe_priv *vpe_priv)
|
||||
{
|
||||
if (vpe_priv->pub.level == VPE_IP_LEVEL_1_1) {
|
||||
if (vpe_priv->collaboration_mode == true) {
|
||||
vpe_priv->collaborate_sync_index = 1;
|
||||
} else {
|
||||
// after the f_model support collaborate sync command
|
||||
// return VPE_STATUS_ERROR
|
||||
}
|
||||
} else if (vpe_priv->pub.level == VPE_IP_LEVEL_1_0) {
|
||||
vpe_priv->collaboration_mode = false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
struct vpe *vpe_create(const struct vpe_init_data *params)
|
||||
{
|
||||
struct vpe_priv *vpe_priv;
|
||||
|
|
@ -356,6 +372,12 @@ enum vpe_status vpe_check_support(
|
|||
if (status != VPE_STATUS_OK)
|
||||
status = VPE_STATUS_NUM_STREAM_NOT_SUPPORTED;
|
||||
|
||||
#ifdef VPE_BUILD_1_1
|
||||
vpe_priv->collaboration_mode = param->collaboration_mode;
|
||||
vpe_priv->vpe_num_instance = param->num_instances;
|
||||
verify_collaboration_mode(vpe_priv);
|
||||
#endif
|
||||
|
||||
if (!vpe_priv->stream_ctx || vpe_priv->num_streams != param->num_streams) {
|
||||
if (vpe_priv->stream_ctx)
|
||||
vpe_free_stream_ctx(vpe_priv);
|
||||
|
|
@ -513,6 +535,14 @@ static bool validate_cached_param(struct vpe_priv *vpe_priv, const struct vpe_bu
|
|||
if (vpe_priv->num_streams != param->num_streams)
|
||||
return false;
|
||||
|
||||
#ifdef VPE_BUILD_1_1
|
||||
if (vpe_priv->collaboration_mode != param->collaboration_mode)
|
||||
return false;
|
||||
|
||||
if (param->num_instances > 0 && vpe_priv->vpe_num_instance != param->num_instances)
|
||||
return false;
|
||||
#endif
|
||||
|
||||
for (i = 0; i < param->num_streams; i++) {
|
||||
struct vpe_stream stream = param->streams[i];
|
||||
|
||||
|
|
@ -551,6 +581,9 @@ enum vpe_status vpe_build_commands(
|
|||
int64_t emb_buf_size;
|
||||
uint64_t cmd_buf_gpu_a, cmd_buf_cpu_a;
|
||||
uint64_t emb_buf_gpu_a, emb_buf_cpu_a;
|
||||
#ifdef VPE_BUILD_1_1
|
||||
bool is_collaborate_sync_end = false;
|
||||
#endif
|
||||
|
||||
if (!vpe || !param || !bufs)
|
||||
return VPE_STATUS_ERROR;
|
||||
|
|
@ -648,12 +681,36 @@ enum vpe_status vpe_build_commands(
|
|||
&vpe_priv->output_ctx.bg_color, vpe_priv->stream_ctx[0].enable_3dlut);
|
||||
|
||||
for (cmd_idx = 0; cmd_idx < vpe_priv->num_vpe_cmds; cmd_idx++) {
|
||||
#ifdef VPE_BUILD_1_1
|
||||
if ((vpe_priv->collaboration_mode == true) &&
|
||||
(vpe_priv->vpe_cmd_info[cmd_idx].is_begin == true)) {
|
||||
status = builder->build_collaborate_sync_cmd(
|
||||
vpe_priv, &curr_bufs, is_collaborate_sync_end);
|
||||
if (status != VPE_STATUS_OK) {
|
||||
vpe_log("failed in building collaborate sync cmd %d\n", (int)status);
|
||||
} else {
|
||||
is_collaborate_sync_end = true;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
status = builder->build_vpe_cmd(vpe_priv, &curr_bufs, cmd_idx);
|
||||
if (status != VPE_STATUS_OK) {
|
||||
vpe_log("failed in building vpe cmd %d\n", (int)status);
|
||||
}
|
||||
|
||||
#ifdef VPE_BUILD_1_1
|
||||
if ((vpe_priv->collaboration_mode == true) &&
|
||||
(vpe_priv->vpe_cmd_info[cmd_idx].is_end == true)) {
|
||||
status = builder->build_collaborate_sync_cmd(
|
||||
vpe_priv, &curr_bufs, is_collaborate_sync_end);
|
||||
if (status != VPE_STATUS_OK) {
|
||||
vpe_log("failed in building collaborate sync cmd %d\n", (int)status);
|
||||
} else {
|
||||
is_collaborate_sync_end = false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -900,6 +900,14 @@ si_vpe_processor_process_frame(struct pipe_video_codec *codec,
|
|||
// build_param->streams[0].tm_params.enable_3dlut);
|
||||
}
|
||||
|
||||
if(vpe_handle->level == VPE_IP_LEVEL_1_1) {
|
||||
build_param->num_instances = 2;
|
||||
build_param->collaboration_mode = true;
|
||||
} else {
|
||||
build_param->num_instances = 1;
|
||||
build_param->collaboration_mode = false;
|
||||
}
|
||||
|
||||
result = vpe_check_support(vpe_handle, build_param, &bufs_required);
|
||||
if (VPE_STATUS_OK != result) {
|
||||
SIVPE_ERR("Check support failed with result: %d\n", result);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue