diff --git a/Documentation/devicetree/bindings/media/qcom,msm8939-venus.yaml b/Documentation/devicetree/bindings/media/qcom,msm8939-venus.yaml new file mode 100644 index 00000000000000..78720216dc5a33 --- /dev/null +++ b/Documentation/devicetree/bindings/media/qcom,msm8939-venus.yaml @@ -0,0 +1,126 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/qcom,msm8939-venus.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm MSM8939 Venus video encode and decode accelerators + +maintainers: + - Stanimir Varbanov + +description: | + The Venus IP is a video encode and decode accelerator present + on Qualcomm platforms + +allOf: + - $ref: qcom,venus-common.yaml# + +properties: + compatible: + const: qcom,msm8939-venus + + power-domains: + maxItems: 1 + + clocks: + maxItems: 3 + + clock-names: + items: + - const: core + - const: iface + - const: bus + + iommus: + maxItems: 1 + + video-decoder: + type: object + + properties: + compatible: + const: venus-decoder + + clocks: + maxItems: 1 + + clock-names: + items: + - const: core + + power-domains: + maxItems: 1 + + required: + - compatible + - clocks + - clock-names + - power-domains + + additionalProperties: false + + video-encoder: + type: object + + properties: + compatible: + const: venus-encoder + + clocks: + maxItems: 1 + + clock-names: + items: + - const: core + + power-domains: + maxItems: 1 + + required: + - compatible + - clocks + - clock-names + - power-domains + + additionalProperties: false + +required: + - compatible + - iommus + - video-decoder + - video-encoder + +unevaluatedProperties: false + +examples: + - | + #include + #include + + video-codec@1d00000 { + compatible = "qcom,msm8939-venus"; + reg = <0x01d00000 0xff000>; + interrupts = ; + clocks = <&gcc GCC_VENUS0_VCODEC0_CLK>, + <&gcc GCC_VENUS0_AHB_CLK>, + <&gcc GCC_VENUS0_AXI_CLK>; + clock-names = "core", "iface", "bus"; + power-domains = <&gcc VENUS_GDSC>; + iommus = <&apps_iommu 5>; + memory-region = <&venus_mem>; + + video-decoder { + compatible = "venus-decoder"; + clocks = <&gcc GCC_VENUS0_CORE0_VCODEC0_CLK>; + clock-names = "core"; + power-domains = <&gcc VENUS_CORE0_GDSC>; + }; + + video-encoder { + compatible = "venus-encoder"; + clocks = <&gcc GCC_VENUS0_CORE1_VCODEC0_CLK>; + clock-names = "core"; + power-domains = <&gcc VENUS_CORE1_GDSC>; + }; + }; diff --git a/arch/arm64/boot/dts/qcom/msm8939-asus-z00t.dts b/arch/arm64/boot/dts/qcom/msm8939-asus-z00t.dts index 1f2892b9de284d..0785839d9564d6 100644 --- a/arch/arm64/boot/dts/qcom/msm8939-asus-z00t.dts +++ b/arch/arm64/boot/dts/qcom/msm8939-asus-z00t.dts @@ -262,6 +262,14 @@ extcon = <&usb_id>; }; +&venus { + status = "okay"; +}; + +&venus_mem { + status = "okay"; +}; + &wcnss { status = "okay"; }; diff --git a/arch/arm64/boot/dts/qcom/msm8939-longcheer-l9100.dts b/arch/arm64/boot/dts/qcom/msm8939-longcheer-l9100.dts index 17d59345a00933..29a6dfee5ba01f 100644 --- a/arch/arm64/boot/dts/qcom/msm8939-longcheer-l9100.dts +++ b/arch/arm64/boot/dts/qcom/msm8939-longcheer-l9100.dts @@ -416,6 +416,14 @@ extcon = <&charger>; }; +&venus { + status = "okay"; +}; + +&venus_mem { + status = "okay"; +}; + &wcnss { status = "okay"; }; diff --git a/arch/arm64/boot/dts/qcom/msm8939.dtsi b/arch/arm64/boot/dts/qcom/msm8939.dtsi index bdbf07e647aa19..b1e2298b2e747c 100644 --- a/arch/arm64/boot/dts/qcom/msm8939.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8939.dtsi @@ -1516,6 +1516,25 @@ }; }; + venus: video-codec@1d00000 { + compatible = "qcom,msm8939-venus"; + reg = <0x01d00000 0xff000>; + interrupts = ; + clocks = <&gcc GCC_VENUS0_VCODEC0_CLK>, + <&gcc GCC_VENUS0_AHB_CLK>, + <&gcc GCC_VENUS0_AXI_CLK>, + <&gcc GCC_VENUS0_CORE0_VCODEC0_CLK>, + <&gcc GCC_VENUS0_CORE1_VCODEC0_CLK>; + clock-names = "core", "iface", "bus", "core0", "core1"; + power-domains = <&gcc VENUS_GDSC>, + <&gcc VENUS_CORE0_GDSC>, + <&gcc VENUS_CORE1_GDSC>; + power-domain-names = "venus", "core0", "core1"; + iommus = <&apps_iommu 5>; + memory-region = <&venus_mem>; + status = "disabled"; + }; + apps_iommu: iommu@1ef0000 { compatible = "qcom,msm8916-iommu", "qcom,msm-iommu-v1"; reg = <0x01ef0000 0x3000>; diff --git a/drivers/clk/qcom/gcc-msm8939.c b/drivers/clk/qcom/gcc-msm8939.c index 45193b3d714bab..08ee098b0674f7 100644 --- a/drivers/clk/qcom/gcc-msm8939.c +++ b/drivers/clk/qcom/gcc-msm8939.c @@ -3664,6 +3664,7 @@ static struct clk_branch gcc_venus0_vcodec0_clk = { static struct clk_branch gcc_venus0_core0_vcodec0_clk = { .halt_reg = 0x4c02c, + .halt_check = BRANCH_HALT_SKIP, .clkr = { .enable_reg = 0x4c02c, .enable_mask = BIT(0), @@ -3681,6 +3682,7 @@ static struct clk_branch gcc_venus0_core0_vcodec0_clk = { static struct clk_branch gcc_venus0_core1_vcodec0_clk = { .halt_reg = 0x4c034, + .halt_check = BRANCH_HALT_SKIP, .clkr = { .enable_reg = 0x4c034, .enable_mask = BIT(0), @@ -3710,6 +3712,8 @@ static struct clk_branch gcc_oxili_timer_clk = { static struct gdsc venus_gdsc = { .gdscr = 0x4c018, + .cxcs = (unsigned int []) { 0x4c024, 0x4c01c }, + .cxc_count = 2, .pd = { .name = "venus", }, @@ -3718,6 +3722,8 @@ static struct gdsc venus_gdsc = { static struct gdsc mdss_gdsc = { .gdscr = 0x4d078, + .cxcs = (unsigned int []) { 0x4d080, 0x4d088 }, + .cxc_count = 2, .pd = { .name = "mdss", }, @@ -3726,6 +3732,8 @@ static struct gdsc mdss_gdsc = { static struct gdsc jpeg_gdsc = { .gdscr = 0x5701c, + .cxcs = (unsigned int []) { 0x57020, 0x57028 }, + .cxc_count = 2, .pd = { .name = "jpeg", }, @@ -3734,6 +3742,8 @@ static struct gdsc jpeg_gdsc = { static struct gdsc vfe_gdsc = { .gdscr = 0x58034, + .cxcs = (unsigned int []) { 0x58038, 0x58048, 0x58050 }, + .cxc_count = 3, .pd = { .name = "vfe", }, @@ -3742,6 +3752,8 @@ static struct gdsc vfe_gdsc = { static struct gdsc oxili_gdsc = { .gdscr = 0x5901c, + .cxcs = (unsigned int []) { 0x59020 }, + .cxc_count = 1, .pd = { .name = "oxili", }, @@ -3750,17 +3762,25 @@ static struct gdsc oxili_gdsc = { static struct gdsc venus_core0_gdsc = { .gdscr = 0x4c028, + .cxcs = (unsigned int []) { 0x4c02c }, + .cxc_count = 1, .pd = { .name = "venus_core0", }, + .parent = &venus_gdsc.pd, + .flags = HW_CTRL, .pwrsts = PWRSTS_OFF_ON, }; static struct gdsc venus_core1_gdsc = { .gdscr = 0x4c030, + .cxcs = (unsigned int []) { 0x4c034 }, + .cxc_count = 1, .pd = { .name = "venus_core1", }, + .parent = &venus_gdsc.pd, + .flags = HW_CTRL, .pwrsts = PWRSTS_OFF_ON, }; diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index abf959b8f3a679..5ef654420c3743 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -3,6 +3,7 @@ * Copyright (c) 2012-2016, The Linux Foundation. All rights reserved. * Copyright (C) 2017 Linaro Ltd. */ +#include "linux/videodev2.h" #include #include #include @@ -178,6 +179,8 @@ static void venus_sys_error_handler(struct work_struct *work) static u32 to_v4l2_codec_type(u32 codec) { switch (codec) { + case HFI_VIDEO_CODEC_HEVC: + return V4L2_PIX_FMT_HEVC; case HFI_VIDEO_CODEC_H264: return V4L2_PIX_FMT_H264; case HFI_VIDEO_CODEC_H263: @@ -688,6 +691,49 @@ static const struct venus_resources msm8916_res = { .enc_nodename = "video-encoder", }; +static const struct freq_tbl msm8939_freq_table[] = { + { 489600, 266670000 }, /* 1080p @ 60 */ + { 244800, 133330000 }, /* 1080p @ 30 */ + { 244800, 200000000 }, /* 1080p @ 30 */ + { 220800, 133330000 }, /* 720p @ 60 */ + { 108000, 133330000 }, /* 720p @ 30 */ + { 108000, 200000000 }, /* 720p @ 30 */ + { 72000, 133330000 }, /* VGA @ 60 */ + { 36000, 133330000 }, /* VGA @ 30 */ +}; + +static const struct reg_val msm8939_reg_preset[] = { + { 0xe0020, 0x0aaaaaaa }, + { 0xe0024, 0x0aaaaaaa }, + { 0x80124, 0x00000003 }, +}; + +static const struct venus_resources msm8939_res = { + .freq_tbl = msm8939_freq_table, + .freq_tbl_size = ARRAY_SIZE(msm8939_freq_table), + .reg_tbl = msm8939_reg_preset, + .reg_tbl_size = ARRAY_SIZE(msm8939_reg_preset), + .clks = { "core", "iface", "bus", }, + .clks_num = 3, + .vcodec0_clks = { "core0", "core1" }, + .vcodec_clks_num = 2, + .vcodec_pmdomains = (const char *[]) { "venus", "core0", "core1", }, + .vcodec_pmdomains_num = 3, + .max_load = 489600, /* 1080p@30 + 1080p@30 */ + .hfi_version = HFI_VERSION_1XX, + .vmem_id = VIDC_RESOURCE_NONE, + .vmem_size = 0, + .vmem_addr = 0, + .cp_start = 0, + .cp_size = 0x5dc00000, + .cp_nonpixel_start = 0x1000000, + .cp_nonpixel_size = 0x25800000, + .dma_mask = 0xddc00000 - 1, + .fwname = "qcom/venus-1.8/venus.mbn", + .dec_nodename = "video-decoder", + .enc_nodename = "video-encoder", +}; + static const struct freq_tbl msm8996_freq_table[] = { { 1944000, 520000000 }, /* 4k UHD @ 60 (decode only) */ { 972000, 520000000 }, /* 4k UHD @ 30 */ @@ -1121,6 +1167,7 @@ static const struct venus_resources qcm2290_res = { static const struct of_device_id venus_dt_match[] = { { .compatible = "qcom,msm8916-venus", .data = &msm8916_res, }, + { .compatible = "qcom,msm8939-venus", .data = &msm8939_res, }, { .compatible = "qcom,msm8996-venus", .data = &msm8996_res, }, { .compatible = "qcom,msm8998-venus", .data = &msm8998_res, }, { .compatible = "qcom,qcm2290-venus", .data = &qcm2290_res, }, diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index 2e4363f8223171..02c9f5af62cd4f 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -80,6 +80,7 @@ bool venus_helper_check_codec(struct venus_inst *inst, u32 v4l2_pixfmt) return false; } + dev_info(core->dev_enc, "%s: codec = %x, session_type = %x, enc_codecs = %lx", __func__, codec, session_type, core->enc_codecs); if (session_type == VIDC_SESSION_TYPE_ENC && core->enc_codecs & codec) return true; diff --git a/drivers/media/platform/qcom/venus/hfi_parser.c b/drivers/media/platform/qcom/venus/hfi_parser.c index 92765f9c88730a..ad61c6f4534478 100644 --- a/drivers/media/platform/qcom/venus/hfi_parser.c +++ b/drivers/media/platform/qcom/venus/hfi_parser.c @@ -207,7 +207,7 @@ static int parse_codecs(struct venus_core *core, void *data) core->enc_codecs = codecs->enc_codecs; if (IS_V1(core)) { - core->dec_codecs &= ~HFI_VIDEO_CODEC_HEVC; + // core->dec_codecs &= ~HFI_VIDEO_CODEC_HEVC; core->dec_codecs &= ~HFI_VIDEO_CODEC_SPARK; core->enc_codecs &= ~HFI_VIDEO_CODEC_HEVC; } diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c index f0269524ac70eb..209f98da303fbd 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.c +++ b/drivers/media/platform/qcom/venus/pm_helpers.c @@ -4,6 +4,7 @@ * * Author: Stanimir Varbanov */ +#include "linux/err.h" #include #include #include @@ -23,16 +24,16 @@ static bool legacy_binding; -static int core_clks_get(struct venus_core *core) +static int core_clks_get(struct venus_core *core, struct clk **clks, + const char * const *id, unsigned int count) { - const struct venus_resources *res = core->res; struct device *dev = core->dev; unsigned int i; - for (i = 0; i < res->clks_num; i++) { - core->clks[i] = devm_clk_get(dev, res->clks[i]); - if (IS_ERR(core->clks[i])) - return PTR_ERR(core->clks[i]); + for (i = 0; i < count; i++) { + clks[i] = devm_clk_get(dev, id[i]); + if (IS_ERR(clks[i])) + return PTR_ERR(clks[i]); } return 0; @@ -297,19 +298,114 @@ static int load_scale_v1(struct venus_inst *inst) return ret; } +static int vcodec_domains_get(struct venus_core *core) +{ + int ret; + struct device *dev = core->dev; + const struct venus_resources *res = core->res; + struct dev_pm_domain_attach_data vcodec_data = { + .pd_names = res->vcodec_pmdomains, + .num_pd_names = res->vcodec_pmdomains_num, + .pd_flags = PD_FLAG_NO_DEV_LINK, + }; + struct dev_pm_domain_attach_data opp_pd_data = { + .pd_names = res->opp_pmdomain, + .num_pd_names = 1, + .pd_flags = PD_FLAG_DEV_LINK_ON | PD_FLAG_REQUIRED_OPP, + }; + + if (!res->vcodec_pmdomains_num) + goto skip_pmdomains; + + ret = devm_pm_domain_attach_list(dev, &vcodec_data, &core->pmdomains); + if (ret < 0) + return ret; + +skip_pmdomains: + if (!res->opp_pmdomain) + return 0; + + /* Attach the power domain for setting performance state */ + ret = devm_pm_domain_attach_list(dev, &opp_pd_data, &core->opp_pmdomain); + if (ret < 0) + return ret; + + return 0; +} + static int core_get_v1(struct venus_core *core) { + struct device *dev = core->dev; + const struct venus_resources *res = core->res; int ret; - ret = core_clks_get(core); + ret = core_clks_get(core, core->clks, res->clks, res->clks_num); if (ret) return ret; - ret = devm_pm_opp_set_clkname(core->dev, "core"); + ret = core_clks_get(core, core->vcodec0_clks, res->vcodec0_clks, res->vcodec_clks_num); + if (ret) + return ret; + + ret = devm_pm_opp_set_clkname(dev, "core"); + if (ret) + return ret; + + if (!res->vcodec_pmdomains_num) + goto skip_pmdomains; + + ret = vcodec_domains_get(core); if (ret) return ret; +skip_pmdomains: + return 0; +} + +static int poweron_cores(struct venus_core *core) +{ + const struct venus_resources *res = core->res; + struct dev_pm_domain_list *pmdomains = core->pmdomains; + int ret, i, core_idx; + + if (!pmdomains) + return 0; + + for (i = 1; i < res->vcodec_pmdomains_num; i++) { + ret = pm_runtime_resume_and_get(pmdomains->pd_devs[i]); + if (ret < 0) + goto err; + + core_idx = i - 1; + ret = clk_prepare_enable(core->vcodec0_clks[core_idx]); + + if (ret < 0) + goto err; + } + return 0; + +err: + while (core_idx--) + clk_disable_unprepare(core->vcodec0_clks[core_idx]); + + while (i-- != 1) + pm_runtime_put_sync(core->pmdomains->pd_devs[i]); + + return ret; +} + +static int poweroff_cores(struct venus_core *core) +{ + int ret = 0; + + for (int i = 1; i < core->res->vcodec_pmdomains_num; i++) { + int core_idx = i - 1; + clk_disable_unprepare(core->vcodec0_clks[core_idx]); + pm_runtime_put_sync(core->pmdomains->pd_devs[i]);; + } + + return ret; } static void core_put_v1(struct venus_core *core) @@ -318,12 +414,34 @@ static void core_put_v1(struct venus_core *core) static int core_power_v1(struct venus_core *core, int on) { + struct device *pmctrl = core->pmdomains ? + core->pmdomains->pd_devs[0] : NULL; + int ret = 0; + if (on == POWER_ON) { + if (pmctrl) { + ret = pm_runtime_resume_and_get(pmctrl); + if (ret < 0) + return ret; + } - if (on == POWER_ON) ret = core_clks_enable(core); - else + if (ret < 0 && pmctrl) + pm_runtime_put_sync(pmctrl); + + ret = poweron_cores(core); + if (ret < 0) + return ret; + } + else { + ret = poweroff_cores(core); + if (ret < 0) + return ret; + core_clks_disable(core); + if (pmctrl) + pm_runtime_put_sync(pmctrl); + } return ret; } @@ -875,41 +993,6 @@ static int venc_power_v4(struct device *dev, int on) return ret; } -static int vcodec_domains_get(struct venus_core *core) -{ - int ret; - struct device *dev = core->dev; - const struct venus_resources *res = core->res; - struct dev_pm_domain_attach_data vcodec_data = { - .pd_names = res->vcodec_pmdomains, - .num_pd_names = res->vcodec_pmdomains_num, - .pd_flags = PD_FLAG_NO_DEV_LINK, - }; - struct dev_pm_domain_attach_data opp_pd_data = { - .pd_names = res->opp_pmdomain, - .num_pd_names = 1, - .pd_flags = PD_FLAG_DEV_LINK_ON | PD_FLAG_REQUIRED_OPP, - }; - - if (!res->vcodec_pmdomains_num) - goto skip_pmdomains; - - ret = devm_pm_domain_attach_list(dev, &vcodec_data, &core->pmdomains); - if (ret < 0) - return ret; - -skip_pmdomains: - if (!res->opp_pmdomain) - return 0; - - /* Attach the power domain for setting performance state */ - ret = devm_pm_domain_attach_list(dev, &opp_pd_data, &core->opp_pmdomain); - if (ret < 0) - return ret; - - return 0; -} - static int core_resets_reset(struct venus_core *core) { const struct venus_resources *res = core->res; @@ -965,7 +1048,7 @@ static int core_get_v4(struct venus_core *core) unsigned int i; int ret; - ret = core_clks_get(core); + ret = core_clks_get(core, core->clks, res->clks, res->clks_num); if (ret) return ret; diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c index fba07557a3996a..789b610d2edafb 100644 --- a/drivers/media/platform/qcom/venus/venc.c +++ b/drivers/media/platform/qcom/venus/venc.c @@ -83,6 +83,8 @@ find_format(struct venus_inst *inst, u32 pixfmt, u32 type) !venus_helper_check_codec(inst, fmt[i].pixfmt)) return NULL; + dev_info(inst->core->dev, "%s: Success!", __func__); + return &fmt[i]; } @@ -112,6 +114,8 @@ find_format_by_index(struct venus_inst *inst, unsigned int index, u32 type) if (i == size) return NULL; + dev_info(inst->core->dev, "%s: Success!", __func__); + return &fmt[i]; } @@ -122,22 +126,28 @@ static int venc_v4l2_to_hfi(int id, int value) switch (value) { case V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CAVLC: default: + printk("%s: Success! V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE, V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CAVLC", __func__); return HFI_H264_ENTROPY_CAVLC; case V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC: + printk("%s: Success! V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE, V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC", __func__); return HFI_H264_ENTROPY_CABAC; } case V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE: switch (value) { case V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_ENABLED: default: + printk("%s: Success! V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE, V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_ENABLED", __func__); return HFI_H264_DB_MODE_ALL_BOUNDARY; case V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED: + printk("%s: Success! V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE, V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED", __func__); return HFI_H264_DB_MODE_DISABLE; case V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED_AT_SLICE_BOUNDARY: + printk("%s: Success! V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE, V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED_AT_SLICE_BOUNDARY", __func__); return HFI_H264_DB_MODE_SKIP_SLICE_BOUNDARY; } } + printk("%s: Success!", __func__); return 0; } @@ -164,7 +174,7 @@ static int venc_enum_fmt(struct file *file, void *fh, struct v4l2_fmtdesc *f) return -EINVAL; f->pixelformat = fmt->pixfmt; - + dev_info(inst->core->dev, "%s: Success!", __func__); return 0; } @@ -218,6 +228,7 @@ venc_try_fmt_common(struct venus_inst *inst, struct v4l2_format *f) else pfmt[0].bytesperline = 0; + dev_info(inst->core->dev, "%s: Success!", __func__); return fmt; } @@ -226,6 +237,7 @@ static int venc_try_fmt(struct file *file, void *fh, struct v4l2_format *f) struct venus_inst *inst = to_inst(file); venc_try_fmt_common(inst, f); + dev_info(inst->core->dev, "%s: Success!", __func__); return 0; } @@ -243,15 +255,19 @@ static int venc_s_fmt(struct file *file, void *fh, struct v4l2_format *f) q = v4l2_m2m_get_vq(inst->m2m_ctx, f->type); if (!q) return -EINVAL; + dev_info(inst->core->dev, "%s: Success! v4l2_m2m_get_vq", __func__); if (vb2_is_busy(q)) return -EBUSY; + dev_info(inst->core->dev, "%s: Success! vb2_is_busy", __func__); orig_pixmp = *pixmp; fmt = venc_try_fmt_common(inst, f); if (!fmt) return -EINVAL; + dev_info(inst->core->dev, "%s: Success! venc_try_fmt_common", __func__); + if (f->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { pixfmt_out = pixmp->pixelformat; @@ -296,6 +312,7 @@ static int venc_s_fmt(struct file *file, void *fh, struct v4l2_format *f) inst->output_buf_size = pixmp->plane_fmt[0].sizeimage; } + dev_info(inst->core->dev, "%s: Success!", __func__); return 0; } @@ -310,7 +327,8 @@ static int venc_g_fmt(struct file *file, void *fh, struct v4l2_format *f) else if (f->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) fmt = inst->fmt_out; else - return -EINVAL; + return -EINVAL; + dev_info(inst->core->dev, "%s: Success! f type check", __func__); pixmp->pixelformat = fmt->pixfmt; @@ -327,6 +345,7 @@ static int venc_g_fmt(struct file *file, void *fh, struct v4l2_format *f) } venc_try_fmt_common(inst, f); + dev_info(inst->core->dev, "%s: Success!", __func__); return 0; } @@ -338,6 +357,7 @@ venc_g_selection(struct file *file, void *fh, struct v4l2_selection *s) if (s->type != V4L2_BUF_TYPE_VIDEO_OUTPUT) return -EINVAL; + dev_info(inst->core->dev, "%s: Success! s type check", __func__); switch (s->target) { case V4L2_SEL_TGT_CROP_DEFAULT: @@ -352,10 +372,12 @@ venc_g_selection(struct file *file, void *fh, struct v4l2_selection *s) default: return -EINVAL; } + dev_info(inst->core->dev, "%s: Success! s target match", __func__); s->r.top = 0; s->r.left = 0; + dev_info(inst->core->dev, "%s: Success!", __func__); return 0; } @@ -366,10 +388,12 @@ venc_s_selection(struct file *file, void *fh, struct v4l2_selection *s) if (s->type != V4L2_BUF_TYPE_VIDEO_OUTPUT) return -EINVAL; + dev_info(inst->core->dev, "%s: Success! Right type", __func__); if (s->r.width > inst->out_width || s->r.height > inst->out_height) return -EINVAL; + dev_info(inst->core->dev, "%s: Success! Fits dimensions", __func__); s->r.width = ALIGN(s->r.width, 2); s->r.height = ALIGN(s->r.height, 2); @@ -384,6 +408,7 @@ venc_s_selection(struct file *file, void *fh, struct v4l2_selection *s) default: return -EINVAL; } + dev_info(inst->core->dev, "%s: Success! Smth about crop", __func__); return 0; } @@ -398,6 +423,7 @@ static int venc_s_parm(struct file *file, void *fh, struct v4l2_streamparm *a) if (a->type != V4L2_BUF_TYPE_VIDEO_OUTPUT && a->type != V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) return -EINVAL; + dev_info(inst->core->dev, "%s: Success! a type check", __func__); memset(out->reserved, 0, sizeof(out->reserved)); @@ -418,6 +444,7 @@ static int venc_s_parm(struct file *file, void *fh, struct v4l2_streamparm *a) inst->timeperframe = *timeperframe; inst->fps = fps; + dev_info(inst->core->dev, "%s: Success!", __func__); return 0; } @@ -429,8 +456,11 @@ static int venc_g_parm(struct file *file, void *fh, struct v4l2_streamparm *a) a->type != V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) return -EINVAL; + dev_info(inst->core->dev, "%s: Success! a type check", __func__); + a->parm.output.capability |= V4L2_CAP_TIMEPERFRAME; a->parm.output.timeperframe = inst->timeperframe; + dev_info(inst->core->dev, "%s: Success!", __func__); return 0; } @@ -451,9 +481,11 @@ static int venc_enum_framesizes(struct file *file, void *fh, if (!fmt) return -EINVAL; } + dev_info(inst->core->dev, "%s: Success! fmt check", __func__); if (fsize->index) - return -EINVAL; + return -EINVAL; + dev_info(inst->core->dev, "%s: Success! fsize index", __func__); fsize->stepwise.min_width = frame_width_min(inst); fsize->stepwise.max_width = frame_width_max(inst); @@ -462,6 +494,7 @@ static int venc_enum_framesizes(struct file *file, void *fh, fsize->stepwise.max_height = frame_height_max(inst); fsize->stepwise.step_height = frame_height_step(inst); + dev_info(inst->core->dev, "%s: Success!", __func__); return 0; } @@ -482,18 +515,22 @@ static int venc_enum_frameintervals(struct file *file, void *fh, if (!fmt) return -EINVAL; } + dev_info(inst->core->dev, "%s: Success! fmt check", __func__); if (fival->index) return -EINVAL; + dev_info(inst->core->dev, "%s: Success! fival index", __func__); if (!fival->width || !fival->height) return -EINVAL; + dev_info(inst->core->dev, "%s: Success! fival w/h", __func__); if (fival->width > frame_width_max(inst) || fival->width < frame_width_min(inst) || fival->height > frame_height_max(inst) || fival->height < frame_height_min(inst)) return -EINVAL; + dev_info(inst->core->dev, "%s: Success! fival dimms", __func__); if (IS_V1(inst->core)) { /* framerate is reported in 1/65535 fps unit */ @@ -507,6 +544,7 @@ static int venc_enum_frameintervals(struct file *file, void *fh, fival->stepwise.step.numerator = 1; fival->stepwise.step.denominator = frate_max(inst) / framerate_factor; + dev_info(inst->core->dev, "%s: Success!", __func__); return 0; } @@ -515,8 +553,10 @@ static int venc_subscribe_event(struct v4l2_fh *fh, { switch (sub->type) { case V4L2_EVENT_EOS: + printk("%s: Success!", __func__); return v4l2_event_subscribe(fh, sub, 2, NULL); case V4L2_EVENT_CTRL: + printk("%s: Success!", __func__); return v4l2_ctrl_subscribe_event(fh, sub); default: return -EINVAL; @@ -533,6 +573,7 @@ venc_encoder_cmd(struct file *file, void *fh, struct v4l2_encoder_cmd *cmd) ret = v4l2_m2m_ioctl_try_encoder_cmd(file, fh, cmd); if (ret) return ret; + dev_info(inst->core->dev, "%s: Success! v4l2_m2m_ioctl_try_encoder_cmd", __func__); mutex_lock(&inst->lock); @@ -542,8 +583,10 @@ venc_encoder_cmd(struct file *file, void *fh, struct v4l2_encoder_cmd *cmd) * Implement V4L2_ENC_CMD_STOP by enqueue an empty buffer on * encoder input to signal EOS. */ - if (!(inst->streamon_out && inst->streamon_cap)) + if (!(inst->streamon_out && inst->streamon_cap)) { + dev_err(inst->core->dev, "%s: Failure! !(inst->streamon_out && inst->streamon_cap)", __func__); goto unlock; + } fdata.buffer_type = HFI_BUFFER_INPUT; fdata.flags |= HFI_BUFFERFLAG_EOS; @@ -555,6 +598,7 @@ venc_encoder_cmd(struct file *file, void *fh, struct v4l2_encoder_cmd *cmd) } else if (cmd->cmd == V4L2_ENC_CMD_START) { if (inst->enc_state == VENUS_ENC_STATE_DRAIN) { ret = -EBUSY; + dev_err(inst->core->dev, "%s: Failure! -EBUSY", __func__); goto unlock; } if (inst->enc_state == VENUS_ENC_STATE_STOPPED) { @@ -563,6 +607,7 @@ venc_encoder_cmd(struct file *file, void *fh, struct v4l2_encoder_cmd *cmd) } } + dev_info(inst->core->dev, "%s: ret = %d", __func__, ret); unlock: mutex_unlock(&inst->lock); return ret; @@ -677,6 +722,7 @@ static int venc_set_properties(struct venus_inst *inst) ret = venus_helper_set_work_mode(inst); if (ret) return ret; + dev_info(inst->core->dev, "%s: Success! venus_helper_set_work_mode", __func__); ptype = HFI_PROPERTY_CONFIG_FRAME_RATE; frate.buffer_type = HFI_BUFFER_OUTPUT; @@ -685,6 +731,7 @@ static int venc_set_properties(struct venus_inst *inst) ret = hfi_session_set_property(inst, ptype, &frate); if (ret) return ret; + dev_info(inst->core->dev, "%s: Success! hfi_session_set_property", __func__); if (inst->fmt_cap->pixfmt == V4L2_PIX_FMT_H264) { struct hfi_h264_vui_timing_info info; @@ -700,6 +747,7 @@ static int venc_set_properties(struct venus_inst *inst) ret = hfi_session_set_property(inst, ptype, &info); if (ret) return ret; + dev_info(inst->core->dev, "%s: Success! hfi_session_set_property2", __func__); ptype = HFI_PROPERTY_PARAM_VENC_H264_ENTROPY_CONTROL; entropy.entropy_mode = venc_v4l2_to_hfi( @@ -710,6 +758,7 @@ static int venc_set_properties(struct venus_inst *inst) ret = hfi_session_set_property(inst, ptype, &entropy); if (ret) return ret; + dev_info(inst->core->dev, "%s: Success! hfi_session_set_property3", __func__); ptype = HFI_PROPERTY_PARAM_VENC_H264_DEBLOCK_CONTROL; deblock.mode = venc_v4l2_to_hfi( @@ -721,6 +770,7 @@ static int venc_set_properties(struct venus_inst *inst) ret = hfi_session_set_property(inst, ptype, &deblock); if (ret) return ret; + dev_info(inst->core->dev, "%s: Success! hfi_session_set_property4", __func__); ptype = HFI_PROPERTY_PARAM_VENC_H264_TRANSFORM_8X8; h264_transform.enable_type = 0; @@ -731,6 +781,7 @@ static int venc_set_properties(struct venus_inst *inst) ret = hfi_session_set_property(inst, ptype, &h264_transform); if (ret) return ret; + dev_info(inst->core->dev, "%s: Success! hfi_session_set_property5", __func__); if (ctr->layer_bitrate) { unsigned int i; @@ -739,11 +790,15 @@ static int venc_set_properties(struct venus_inst *inst) ret = hfi_session_set_property(inst, ptype, &ctr->h264_hier_layers); if (ret) return ret; + dev_info(inst->core->dev, "%s: Success! hfi_session_set_property6", __func__); + ptype = HFI_PROPERTY_CONFIG_VENC_HIER_P_ENH_LAYER; ret = hfi_session_set_property(inst, ptype, &ctr->layer_bitrate); if (ret) return ret; + dev_info(inst->core->dev, "%s: Success! hfi_session_set_property7", __func__); + for (i = 0; i < ctr->h264_hier_layers; ++i) { ptype = HFI_PROPERTY_CONFIG_VENC_TARGET_BITRATE; @@ -753,6 +808,7 @@ static int venc_set_properties(struct venus_inst *inst) ret = hfi_session_set_property(inst, ptype, &brate); if (ret) return ret; + dev_info(inst->core->dev, "%s: Success! hfi_session_set_property8", __func__); } } } @@ -769,6 +825,7 @@ static int venc_set_properties(struct venus_inst *inst) ret = hfi_session_set_property(inst, ptype, &idrp); if (ret) return ret; + dev_info(inst->core->dev, "%s: Success! hfi_session_set_property9", __func__); } if (inst->fmt_cap->pixfmt == V4L2_PIX_FMT_HEVC && @@ -799,6 +856,7 @@ static int venc_set_properties(struct venus_inst *inst) ret = hfi_session_set_property(inst, ptype, &hdr10); if (ret) return ret; + dev_info(inst->core->dev, "%s: Success! hfi_session_set_property10", __func__); } if (ctr->num_b_frames) { @@ -808,6 +866,7 @@ static int venc_set_properties(struct venus_inst *inst) ret = hfi_session_set_property(inst, ptype, &max_num_b_frames); if (ret) return ret; + dev_info(inst->core->dev, "%s: Success! hfi_session_set_property11", __func__); } ptype = HFI_PROPERTY_CONFIG_VENC_INTRA_PERIOD; @@ -817,6 +876,7 @@ static int venc_set_properties(struct venus_inst *inst) ret = hfi_session_set_property(inst, ptype, &intra_period); if (ret) return ret; + dev_info(inst->core->dev, "%s: Success! hfi_session_set_property12", __func__); if (!ctr->rc_enable) rate_control = HFI_RATE_CONTROL_OFF; @@ -833,6 +893,8 @@ static int venc_set_properties(struct venus_inst *inst) ret = hfi_session_set_property(inst, ptype, &rate_control); if (ret) return ret; + dev_info(inst->core->dev, "%s: Success! hfi_session_set_property13", __func__); + if (rate_control == HFI_RATE_CONTROL_CQ && ctr->const_quality) { struct hfi_heic_frame_quality quality = {}; @@ -842,6 +904,7 @@ static int venc_set_properties(struct venus_inst *inst) ret = hfi_session_set_property(inst, ptype, &quality); if (ret) return ret; + dev_info(inst->core->dev, "%s: Success! hfi_session_set_property14", __func__); } if (!ctr->layer_bitrate) { @@ -857,6 +920,7 @@ static int venc_set_properties(struct venus_inst *inst) ret = hfi_session_set_property(inst, ptype, &brate); if (ret) return ret; + dev_info(inst->core->dev, "%s: Success! hfi_session_set_property15", __func__); if (!ctr->bitrate_peak) bitrate *= 2; @@ -870,6 +934,7 @@ static int venc_set_properties(struct venus_inst *inst) ret = hfi_session_set_property(inst, ptype, &brate); if (ret) return ret; + dev_info(inst->core->dev, "%s: Success! hfi_session_set_property16", __func__); } if (inst->fmt_cap->pixfmt == V4L2_PIX_FMT_H264 || @@ -883,6 +948,7 @@ static int venc_set_properties(struct venus_inst *inst) ret = hfi_session_set_property(inst, ptype, &en); if (ret) return ret; + dev_info(inst->core->dev, "%s: Success! hfi_session_set_property17", __func__); } ptype = HFI_PROPERTY_PARAM_VENC_SESSION_QP; @@ -899,6 +965,7 @@ static int venc_set_properties(struct venus_inst *inst) ret = hfi_session_set_property(inst, ptype, &quant); if (ret) return ret; + dev_info(inst->core->dev, "%s: Success! hfi_session_set_property18", __func__); if (inst->core->res->hfi_version == HFI_VERSION_4XX || inst->core->res->hfi_version == HFI_VERSION_6XX) { @@ -936,6 +1003,7 @@ static int venc_set_properties(struct venus_inst *inst) if (ret) return ret; + dev_info(inst->core->dev, "%s: Success! hfi_session_set_property19", __func__); ptype = HFI_PROPERTY_PARAM_VENC_LTRMODE; ltr_mode.ltr_count = ctr->ltr_count; @@ -944,6 +1012,7 @@ static int venc_set_properties(struct venus_inst *inst) ret = hfi_session_set_property(inst, ptype, <r_mode); if (ret) return ret; + dev_info(inst->core->dev, "%s: Success! hfi_session_set_property20", __func__); switch (inst->hfi_codec) { case HFI_VIDEO_CODEC_H264: @@ -976,6 +1045,7 @@ static int venc_set_properties(struct venus_inst *inst) ret = venus_helper_set_profile_level(inst, profile, level); if (ret) return ret; + dev_info(inst->core->dev, "%s: Success! venus_helper_set_profile_level", __func__); if (inst->fmt_cap->pixfmt == V4L2_PIX_FMT_H264 || inst->fmt_cap->pixfmt == V4L2_PIX_FMT_HEVC) { @@ -1018,8 +1088,10 @@ static int venc_set_properties(struct venus_inst *inst) ret = hfi_session_set_property(inst, ptype, &intra_refresh); if (ret) return ret; + dev_info(inst->core->dev, "%s: Success! hfi_session_set_property21", __func__); } + dev_info(inst->core->dev, "%s: Success! hfi_session_set_property21 :%d", __func__, ret); return 0; } @@ -1028,8 +1100,10 @@ static int venc_init_session(struct venus_inst *inst) int ret; ret = venus_helper_session_init(inst); - if (ret == -EALREADY) + if (ret == -EALREADY) { + dev_info(inst->core->dev, "%s: Success! already", __func__); return 0; + } else if (ret) return ret; @@ -1037,25 +1111,31 @@ static int venc_init_session(struct venus_inst *inst) inst->out_height); if (ret) goto deinit; + dev_info(inst->core->dev, "%s: Success! venus_helper_set_stride", __func__); ret = venus_helper_set_input_resolution(inst, inst->width, inst->height); if (ret) goto deinit; + dev_info(inst->core->dev, "%s: Success! venus_helper_set_input_resolution", __func__); ret = venus_helper_set_output_resolution(inst, inst->width, inst->height, HFI_BUFFER_OUTPUT); if (ret) goto deinit; + dev_info(inst->core->dev, "%s: Success! venus_helper_set_output_resolution", __func__); ret = venus_helper_set_color_format(inst, inst->fmt_out->pixfmt); if (ret) goto deinit; + dev_info(inst->core->dev, "%s: Success! venus_helper_set_color_format", __func__); ret = venc_set_properties(inst); if (ret) goto deinit; + dev_info(inst->core->dev, "%s: Success! venc_set_properties", __func__); + dev_info(inst->core->dev, "%s: Success!", __func__); return 0; deinit: @@ -1071,8 +1151,10 @@ static int venc_out_num_buffers(struct venus_inst *inst, unsigned int *num) ret = venus_helper_get_bufreq(inst, HFI_BUFFER_INPUT, &bufreq); if (ret) return ret; + dev_info(inst->core->dev, "%s: Success! venus_helper_get_bufreq", __func__); *num = bufreq.count_actual; + dev_info(inst->core->dev, "%s: Success!", __func__); return 0; } @@ -1087,6 +1169,7 @@ static int venc_queue_setup(struct vb2_queue *q, int ret; if (*num_planes) { + dev_info(inst->core->dev, "%s: Num planes found.", __func__); if (q->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE && *num_planes != inst->fmt_out->num_planes) return -EINVAL; @@ -1103,22 +1186,26 @@ static int venc_queue_setup(struct vb2_queue *q, sizes[0] < inst->output_buf_size) return -EINVAL; + dev_info(inst->core->dev, "%s: Success!", __func__); return 0; } if (test_bit(0, &core->sys_error)) { if (inst->nonblock) return -EAGAIN; + dev_info(inst->core->dev, "%s: Success! kinda. core error but not blocking", __func__); ret = wait_event_interruptible(core->sys_err_done, !test_bit(0, &core->sys_error)); if (ret) return ret; + dev_info(inst->core->dev, "%s: Success! wait_event_interruptible", __func__); } ret = venc_pm_get(inst); if (ret) return ret; + dev_info(inst->core->dev, "%s: Success! venc_pm_get", __func__); mutex_lock(&inst->lock); ret = venc_init_session(inst); @@ -1126,10 +1213,12 @@ static int venc_queue_setup(struct vb2_queue *q, if (ret) goto put_power; + dev_info(inst->core->dev, "%s: Success! venc_init_session", __func__); ret = venc_pm_put(inst, false); if (ret) return ret; + dev_info(inst->core->dev, "%s: Success! venc_pm_put", __func__); switch (q->type) { case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE: @@ -1138,6 +1227,7 @@ static int venc_queue_setup(struct vb2_queue *q, ret = venc_out_num_buffers(inst, &num); if (ret) break; + dev_info(inst->core->dev, "%s: Success! venc_out_num_buffers", __func__); num = max(num, min); *num_buffers = max(*num_buffers, num); @@ -1163,6 +1253,7 @@ static int venc_queue_setup(struct vb2_queue *q, break; } + dev_info(inst->core->dev, "%s: Success!", __func__); return ret; put_power: venc_pm_put(inst, false); @@ -1224,23 +1315,28 @@ static int venc_verify_conf(struct venus_inst *inst) if (!inst->num_input_bufs || !inst->num_output_bufs) return -EINVAL; + dev_info(inst->core->dev, "%s: Success! !inst->num_input_bufs || !inst->num_output_bufs", __func__); ret = venus_helper_get_bufreq(inst, HFI_BUFFER_OUTPUT, &bufreq); if (ret) return ret; + dev_info(inst->core->dev, "%s: Success! venus_helper_get_bufreq HFI_BUFFER_OUTPUT", __func__); if (inst->num_output_bufs < bufreq.count_actual || inst->num_output_bufs < hfi_bufreq_get_count_min(&bufreq, ver)) return -EINVAL; + dev_info(inst->core->dev, "%s: Success! num_output_bufs", __func__); ret = venus_helper_get_bufreq(inst, HFI_BUFFER_INPUT, &bufreq); if (ret) return ret; + dev_info(inst->core->dev, "%s: Success! venus_helper_get_bufreq HFI_BUFFER_INPUT", __func__); if (inst->num_input_bufs < bufreq.count_actual || inst->num_input_bufs < hfi_bufreq_get_count_min(&bufreq, ver)) return -EINVAL; - + dev_info(inst->core->dev, "%s: Success! num_input_bufs", __func__); + dev_info(inst->core->dev, "%s: Success!", __func__); return 0; } @@ -1269,35 +1365,43 @@ static int venc_start_streaming(struct vb2_queue *q, unsigned int count) ret = venc_pm_get(inst); if (ret) goto error; + dev_info(inst->core->dev, "%s: venc_pm_get!", __func__); ret = venus_pm_acquire_core(inst); if (ret) goto put_power; + dev_info(inst->core->dev, "%s: venus_pm_acquire_core!", __func__); ret = venc_pm_put(inst, true); if (ret) goto error; + dev_info(inst->core->dev, "%s: venc_pm_put!", __func__); ret = venc_set_properties(inst); if (ret) goto error; + dev_info(inst->core->dev, "%s: venc_set_properties!", __func__); ret = venc_verify_conf(inst); if (ret) goto error; + dev_info(inst->core->dev, "%s: venc_verify_conf!", __func__); ret = venus_helper_set_num_bufs(inst, inst->num_input_bufs, inst->num_output_bufs, 0); if (ret) goto error; + dev_info(inst->core->dev, "%s: venus_helper_set_num_bufs!", __func__); ret = venus_helper_vb2_start_streaming(inst); if (ret) goto error; + dev_info(inst->core->dev, "%s: venus_helper_vb2_start_streaming!", __func__); inst->enc_state = VENUS_ENC_STATE_ENCODING; mutex_unlock(&inst->lock); + dev_info(inst->core->dev, "%s: Success!", __func__); return 0; @@ -1363,6 +1467,7 @@ static void venc_buf_done(struct venus_inst *inst, unsigned int buf_type, vbuf = venus_helper_find_buf(inst, type, tag); if (!vbuf) return; + dev_info(inst->core->dev, "%s: Success! venus_helper_find_buf", __func__); vbuf->flags = flags; @@ -1381,6 +1486,7 @@ static void venc_buf_done(struct venus_inst *inst, unsigned int buf_type, } v4l2_m2m_buf_done(vbuf, VB2_BUF_STATE_DONE); + dev_info(inst->core->dev, "%s: Success!", __func__); } static void venc_event_notify(struct venus_inst *inst, u32 event, @@ -1429,6 +1535,7 @@ static int m2m_queue_init(void *priv, struct vb2_queue *src_vq, ret = vb2_queue_init(src_vq); if (ret) return ret; + dev_info(inst->core->dev, "%s: vb2_queue_init", __func__); dst_vq->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; dst_vq->io_modes = VB2_MMAP | VB2_USERPTR | VB2_DMABUF; @@ -1441,6 +1548,7 @@ static int m2m_queue_init(void *priv, struct vb2_queue *src_vq, dst_vq->min_queued_buffers = 1; dst_vq->dev = inst->core->dev; dst_vq->lock = &inst->ctx_q_lock; + dev_info(inst->core->dev, "%s: Success...", __func__); return vb2_queue_init(dst_vq); } @@ -1489,6 +1597,7 @@ static int venc_open(struct file *file) ret = venc_ctrl_init(inst); if (ret) goto err_free; + dev_info(inst->core->dev, "%s: Success! venc_ctrl_init", __func__); venc_inst_init(inst); @@ -1507,17 +1616,20 @@ static int venc_open(struct file *file) ret = PTR_ERR(inst->m2m_ctx); goto err_m2m_dev_release; } + dev_info(inst->core->dev, "%s: Success! v4l2_m2m_ctx_init", __func__); ret = hfi_session_create(inst, &venc_hfi_ops); if (ret) goto err_m2m_ctx_release; + dev_info(inst->core->dev, "%s: Success! hfi_session_create", __func__); v4l2_fh_init(&inst->fh, core->vdev_enc); inst->fh.ctrl_handler = &inst->ctrl_handler; v4l2_fh_add(&inst->fh, file); inst->fh.m2m_ctx = inst->m2m_ctx; - + + dev_info(inst->core->dev, "%s: Success!", __func__); return 0; err_m2m_ctx_release: @@ -1562,10 +1674,12 @@ static int venc_probe(struct platform_device *pdev) if (!dev->parent) return -EPROBE_DEFER; + dev_info(dev, "%s: !dev->parent", __func__); core = dev_get_drvdata(dev->parent); if (!core) return -EPROBE_DEFER; + dev_info(dev, "%s: core", __func__); platform_set_drvdata(pdev, core); @@ -1573,6 +1687,7 @@ static int venc_probe(struct platform_device *pdev) ret = core->pm_ops->venc_get(dev); if (ret) return ret; + dev_info(dev, "%s: venc_get", __func__); } vdev = video_device_alloc(); @@ -1590,6 +1705,7 @@ static int venc_probe(struct platform_device *pdev) ret = video_register_device(vdev, VFL_TYPE_VIDEO, -1); if (ret) goto err_vdev_release; + dev_info(dev, "%s: video_register_device", __func__); core->vdev_enc = vdev; core->dev_enc = dev; @@ -1599,6 +1715,7 @@ static int venc_probe(struct platform_device *pdev) pm_runtime_use_autosuspend(dev); pm_runtime_enable(dev); + dev_info(dev, "%s: Success!", __func__); return 0; err_vdev_release: