Skip to content

Commit

Permalink
Merge tag 'VIDEO.LA.2.0.r1-09200-WAIPIO.0' of https://git.codelinaro.…
Browse files Browse the repository at this point in the history
…org/clo/la/platform/vendor/opensource/video-driver into melt

"VIDEO.LA.2.0.r1-09200-WAIPIO.0"
  • Loading branch information
Pzqqt authored and Gosth15 committed Sep 18, 2023
1 parent a5e9ca2 commit 71a8025
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 31 deletions.
4 changes: 2 additions & 2 deletions techpack/video/driver/platform/diwali/src/msm_vidc_diwali.c
Original file line number Diff line number Diff line change
Expand Up @@ -3255,7 +3255,7 @@ static struct msm_platform_inst_capability instance_data_diwali_v1[] = {
{PIX_FMTS, ENC, HEIC,
MSM_VIDC_FMT_NV12,
MSM_VIDC_FMT_P010,
MSM_VIDC_FMT_NV12 | MSM_VIDC_FMT_P010,
MSM_VIDC_FMT_NV12 | MSM_VIDC_FMT_NV21 | MSM_VIDC_FMT_P010,
MSM_VIDC_FMT_NV12,
0, 0,
CAP_FLAG_ROOT,
Expand Down Expand Up @@ -4792,7 +4792,7 @@ static struct msm_platform_inst_capability instance_data_diwali_v2[] = {
{PIX_FMTS, ENC, HEIC,
MSM_VIDC_FMT_NV12,
MSM_VIDC_FMT_P010,
MSM_VIDC_FMT_NV12 | MSM_VIDC_FMT_P010,
MSM_VIDC_FMT_NV12 | MSM_VIDC_FMT_NV21 | MSM_VIDC_FMT_P010,
MSM_VIDC_FMT_NV12,
0, 0,
CAP_FLAG_ROOT,
Expand Down
7 changes: 4 additions & 3 deletions techpack/video/driver/platform/khaje/src/msm_vidc_khaje.c
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,7 @@ static struct msm_platform_inst_capability instance_data_khaje[] = {

{LEVEL, DEC, H264,
V4L2_MPEG_VIDEO_H264_LEVEL_1_0,
V4L2_MPEG_VIDEO_H264_LEVEL_4_2,
V4L2_MPEG_VIDEO_H264_LEVEL_5_0,
BIT(V4L2_MPEG_VIDEO_H264_LEVEL_1_0)|
BIT(V4L2_MPEG_VIDEO_H264_LEVEL_1B)|
BIT(V4L2_MPEG_VIDEO_H264_LEVEL_1_1)|
Expand All @@ -1008,8 +1008,9 @@ static struct msm_platform_inst_capability instance_data_khaje[] = {
BIT(V4L2_MPEG_VIDEO_H264_LEVEL_3_2)|
BIT(V4L2_MPEG_VIDEO_H264_LEVEL_4_0)|
BIT(V4L2_MPEG_VIDEO_H264_LEVEL_4_1)|
BIT(V4L2_MPEG_VIDEO_H264_LEVEL_4_2),
V4L2_MPEG_VIDEO_H264_LEVEL_4_2,
BIT(V4L2_MPEG_VIDEO_H264_LEVEL_4_2)|
BIT(V4L2_MPEG_VIDEO_H264_LEVEL_5_0),
V4L2_MPEG_VIDEO_H264_LEVEL_5_0,
V4L2_CID_MPEG_VIDEO_H264_LEVEL,
HFI_PROP_LEVEL,
CAP_FLAG_ROOT | CAP_FLAG_OUTPUT_PORT | CAP_FLAG_MENU,
Expand Down
6 changes: 3 additions & 3 deletions techpack/video/driver/platform/monaco/src/msm_vidc_monaco.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
*/

#include <linux/of.h>
Expand Down Expand Up @@ -1538,8 +1538,8 @@ static struct msm_platform_inst_capability instance_data_monaco[] = {
NULL, msm_vidc_set_u32},
{PIX_FMTS, ENC, HEIC,
MSM_VIDC_FMT_NV12,
MSM_VIDC_FMT_NV12,
MSM_VIDC_FMT_NV12,
MSM_VIDC_FMT_NV21,
MSM_VIDC_FMT_NV12 | MSM_VIDC_FMT_NV21,
MSM_VIDC_FMT_NV12,
0, 0,
0,
Expand Down
24 changes: 12 additions & 12 deletions techpack/video/driver/platform/parrot/src/msm_vidc_parrot.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ static struct msm_platform_core_capability core_data_parrot_v1[] = {
{ENC_CODECS, H264|HEVC|HEIC},
{DEC_CODECS, H264|HEVC|VP9|HEIC},
{MAX_SESSION_COUNT, 16},
{MAX_NUM_720P_SESSIONS, 4},
{MAX_NUM_1080P_SESSIONS, 2},
{MAX_NUM_4K_SESSIONS, 1},
{MAX_NUM_720P_SESSIONS, 8},
{MAX_NUM_1080P_SESSIONS, 4},
{MAX_NUM_4K_SESSIONS, 2},
{MAX_SECURE_SESSION_COUNT, 3},
{MAX_RT_MBPF, 40800}, /* ((3840x2176)/256) + (1920x1088)/256 */
{MAX_MBPF, 42976}, /* ((4096x2176)/256) + (1920x1088)/256 */
{MAX_MBPF, 69632}, /* ((4096x2176)/256) x 2 */
/* max_load 4096x2176@30fps */
{MAX_MBPS, 1224000}, /* Concurrency: UHD@30 decode + 1080p@30 encode */
{MAX_IMAGE_MBPF, 1048576}, /* (16384x16384)/256 */
Expand Down Expand Up @@ -156,12 +156,12 @@ static struct msm_platform_core_capability core_data_parrot_v2[] = {
{ENC_CODECS, H264|HEVC|HEIC},
{DEC_CODECS, H264|HEVC|VP9|HEIC},
{MAX_SESSION_COUNT, 16},
{MAX_NUM_720P_SESSIONS, 4},
{MAX_NUM_1080P_SESSIONS, 2},
{MAX_NUM_4K_SESSIONS, 1},
{MAX_NUM_720P_SESSIONS, 8},
{MAX_NUM_1080P_SESSIONS, 4},
{MAX_NUM_4K_SESSIONS, 2},
{MAX_SECURE_SESSION_COUNT, 3},
{MAX_RT_MBPF, 40800}, /* ((3840x2176)/256) + (1920x1088)/256 */
{MAX_MBPF, 42976}, /* ((4096x2176)/256) + (1920x1088)/256 */
{MAX_MBPF, 69632}, /* ((4096x2176)/256) x 2 */
/* max_load 4096x2176@30fps */
{MAX_MBPS, 1224000}, /* Concurrency: UHD@30 decode + 1080p@30 encode */
{MAX_IMAGE_MBPF, 1048576}, /* (16384x16384)/256 */
Expand Down Expand Up @@ -1712,8 +1712,8 @@ static struct msm_platform_inst_capability instance_data_parrot_v0[] = {
NULL, msm_vidc_set_u32},
{PIX_FMTS, ENC, HEIC,
MSM_VIDC_FMT_NV12,
MSM_VIDC_FMT_NV12,
MSM_VIDC_FMT_NV12,
MSM_VIDC_FMT_NV21,
MSM_VIDC_FMT_NV12 | MSM_VIDC_FMT_NV21,
MSM_VIDC_FMT_NV12,
0, 0,
CAP_FLAG_ROOT,
Expand Down Expand Up @@ -3260,8 +3260,8 @@ static struct msm_platform_inst_capability instance_data_parrot_v1[] = {
NULL, msm_vidc_set_u32},
{PIX_FMTS, ENC, HEIC,
MSM_VIDC_FMT_NV12,
MSM_VIDC_FMT_NV12,
MSM_VIDC_FMT_NV12,
MSM_VIDC_FMT_NV21,
MSM_VIDC_FMT_NV12 | MSM_VIDC_FMT_NV21,
MSM_VIDC_FMT_NV12,
0, 0,
CAP_FLAG_ROOT,
Expand Down
2 changes: 1 addition & 1 deletion techpack/video/driver/vidc/inc/msm_vidc_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ bool inst_lock_check(struct msm_vidc_inst *inst, const char *function);
int msm_vidc_update_bitstream_buffer_size(struct msm_vidc_inst *inst);
int msm_vidc_update_meta_port_settings(struct msm_vidc_inst *inst);
int msm_vidc_update_buffer_count(struct msm_vidc_inst *inst, u32 port);
void msm_vidc_schedule_core_deinit(struct msm_vidc_core *core, bool force_deinit);
int msm_vidc_schedule_core_deinit(struct msm_vidc_core *core, bool force_deinit);
bool msm_vidc_is_super_buffer(struct msm_vidc_inst *inst);
int msm_vidc_init_core_caps(struct msm_vidc_core* core);
int msm_vidc_init_instance_caps(struct msm_vidc_core* core);
Expand Down
6 changes: 5 additions & 1 deletion techpack/video/driver/vidc/src/msm_vdec.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved.
*/

#include <media/v4l2_vidc_extensions.h>
Expand Down Expand Up @@ -1214,6 +1214,8 @@ static int msm_vdec_session_resume(struct msm_vidc_inst *inst,
{
int rc = 0;

msm_vidc_scale_power(inst, true);

i_vpr_h(inst, "%s()\n", __func__);
rc = venus_hfi_session_command(inst,
HFI_CMD_RESUME,
Expand Down Expand Up @@ -2251,6 +2253,8 @@ int msm_vdec_process_cmd(struct msm_vidc_inst *inst, u32 cmd)
return 0;
else if (allow != MSM_VIDC_ALLOW)
return -EINVAL;

msm_vidc_scale_power(inst, true);
rc = venus_hfi_session_command(inst,
HFI_CMD_DRAIN,
INPUT_PORT,
Expand Down
6 changes: 4 additions & 2 deletions techpack/video/driver/vidc/src/msm_venc.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved.
*/

#include <media/v4l2_vidc_extensions.h>
Expand Down Expand Up @@ -920,6 +920,8 @@ int msm_venc_process_cmd(struct msm_vidc_inst *inst, u32 cmd)
return 0;
else if (allow != MSM_VIDC_ALLOW)
return -EINVAL;

msm_vidc_scale_power(inst, true);
rc = venus_hfi_session_command(inst,
HFI_CMD_DRAIN,
INPUT_PORT,
Expand Down Expand Up @@ -948,7 +950,7 @@ int msm_venc_process_cmd(struct msm_vidc_inst *inst, u32 cmd)

/* print final buffer counts & size details */
msm_vidc_print_buffer_info(inst);

msm_vidc_scale_power(inst, true);
rc = venus_hfi_session_command(inst,
HFI_CMD_RESUME,
INPUT_PORT,
Expand Down
14 changes: 10 additions & 4 deletions techpack/video/driver/vidc/src/msm_vidc_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -5571,13 +5571,19 @@ int msm_vidc_update_buffer_count(struct msm_vidc_inst *inst, u32 port)
return 0;
}

void msm_vidc_schedule_core_deinit(struct msm_vidc_core *core, bool force_deinit)
int msm_vidc_schedule_core_deinit(struct msm_vidc_core *core, bool force_deinit)
{
if (!core)
return;
return -EINVAL;

if (!(core->capabilities[FW_UNLOAD].value || force_deinit))
return;
return -EINVAL;

/* in normal case, deinit core only if no session present */
if (!list_empty(&core->instances)) {
d_vpr_e("%s(): skip core deinit\n", __func__);
return -ECANCELED;
}

cancel_delayed_work(&core->fw_unload_work);

Expand All @@ -5587,7 +5593,7 @@ void msm_vidc_schedule_core_deinit(struct msm_vidc_core *core, bool force_deinit
d_vpr_h("firmware unload delayed by %u ms\n",
core->capabilities[FW_UNLOAD_DELAY].value);

return;
return 0;
}

static const char *get_codec_str(enum msm_vidc_codec_type type)
Expand Down
7 changes: 5 additions & 2 deletions techpack/video/driver/vidc/src/msm_vidc_power.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved.
*/

#include "msm_vidc_power.h"
Expand Down Expand Up @@ -483,7 +483,10 @@ int msm_vidc_scale_clocks(struct msm_vidc_inst *inst)
initial_window = power->nom_threshold ? power->nom_threshold : DCVS_WINDOW;

if (inst->power.buffer_counter < min(initial_window, DCVS_WINDOW) ||
is_image_session(inst)) {
is_image_session(inst)
|| inst->state == MSM_VIDC_DRAIN
|| inst->state == MSM_VIDC_DRC
|| inst->state == MSM_VIDC_DRC_DRAIN) {
inst->power.min_freq = msm_vidc_max_freq(inst);
inst->power.dcvs_flags = 0;
} else if (msm_vidc_clock_voting) {
Expand Down
2 changes: 1 addition & 1 deletion techpack/video/driver/vidc/src/msm_vidc_probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ static int msm_vidc_pm_suspend(struct device *dev)
#ifdef CONFIG_DEEPSLEEP
if (pm_suspend_via_firmware()) {
d_vpr_l("%s : deepsleep is triggered\n", __func__);
msm_vidc_schedule_core_deinit(core, true);
rc = msm_vidc_schedule_core_deinit(core, true);
} else {
rc = msm_vidc_suspend(core);
}
Expand Down

0 comments on commit 71a8025

Please sign in to comment.