From patchwork Tue May 15 07:58:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 135856 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp681951lji; Tue, 15 May 2018 01:13:29 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpNEbTigS5inj3trf6M4cHQPgNTuX7aXEyG92EWjptcXiNEgh5moJclgzuZR0e6Y3RgZVf3 X-Received: by 2002:a62:5754:: with SMTP id l81-v6mr14021619pfb.56.1526372009771; Tue, 15 May 2018 01:13:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526372009; cv=none; d=google.com; s=arc-20160816; b=P2ubGXZAusTIjsCeOR1ykwKgIiSnNHhjPvKn9808lVmGejNrLWHyNr6qv20F6eF4/z 6YmEC/bGBvpCTta6+331VE8hA2QPO7Q/Msx4Xj0hRlPs7jR6LRjLYRNMsDlXRkHBMd5X rf967B+pD0S084ec9ruaTCdtI1kCCoznvWmIYWXClIMsqcTwKh7tf4cMUn/f7q3EKa5T kIEnUFBDZkwpnrUyBghVWBalpupmdAg4azBYAi21ZwIa3xDz78LXsoZUNDAWHdJ5VBaB EqJrvyMDah+n9ooiJpRpM1OflGTIEQCONy5/Hlv/qvdch1RV1WqoJCcULg+CPLEjJbNZ AolQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=9Bhk7dcRt4uzxj9HhQKwZbjVkUI2/atLC4tUe65t0Rc=; b=a65tCOmZJvVkaQgAmN4EHhqmMHpbWBH35IFTDcvS5sRffJSXaXb0hvQsXgG1mkuFD0 kDs2vJh5oH689WLL3B/jnEt2ogiOQBsl8LjP1kJ4hrm31WwMd25qSYuSwPBrgepwzpEv dd/CsbBZSEzyUmHYUWyofTmtLb4oAALIU9AnCv+bbdFAyXmLW6Vh6nX191tSXC00S+VT awaRPC46fVtX0DBF/dJ4V9eZ9Se52KuA3+DFgBBBn7x8kDiSTuF8h6kntBixRViU3JgX FugVzalMiMKPJnE2GL0wpkA0ukhTXuJT0rYW8dgXQGhj7bCzcXLsgBAKEuIJEQYCMCdy 5fdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=KyGImG5R; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k134-v6si8923970pga.591.2018.05.15.01.13.29; Tue, 15 May 2018 01:13:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=KyGImG5R; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752381AbeEOIN1 (ORCPT + 13 others); Tue, 15 May 2018 04:13:27 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:37980 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752089AbeEOH7b (ORCPT ); Tue, 15 May 2018 03:59:31 -0400 Received: by mail-wm0-f66.google.com with SMTP id m129-v6so19613294wmb.3 for ; Tue, 15 May 2018 00:59:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=VfCYxQLMAq/EqeOKzJDOjJif0LMyIYIiIdWQCn1RamU=; b=KyGImG5RrLKz82q0ypcjOcWD/UssttO4Xx/0yHc/n5SGmIc93ld1rFKP7R+ES0Ofb/ tSmcaCvRMxRT6MQFPaRjleQauctYue3FKYuMQV0dEPSb+HYvg69+l4Ufp8dpWC6uwj1x dK6+XIabM69hQWcMP0cWNAS3pR2MffzxRO7xc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=VfCYxQLMAq/EqeOKzJDOjJif0LMyIYIiIdWQCn1RamU=; b=DUaXPvJhQV7oVe47zH+3NFVz2mSp2dWzRAEEgzYt5YeboLZCyTJzQI4f1ctoQ9R7BT 0wyXG4mrA5IbftycGhmYtEErBy2Ua/ZoNQ5DLan24koEqTOG6M0JbrKK4LuqNf7QrY5p zA/9KkW4JCNvctEsLiE9ZptXz3KvFmdbDm7cJC3yIcExixUu4VaXWlkB5TLUpYVw6dki 02Qr95OPfMdp39VH6zlOOLuq9m6A49J8PlkfLCMwZDtCt0d59HbYwk1JwyRsRSw+TvxM xn03zMAGnPmie7NINGxeubX4wVwqlj4qNZ3XzvAfFflpPzaqLVaV54XAtn3UkITxvi/6 TSqQ== X-Gm-Message-State: ALKqPwcZ1E0E5p8VLbE9rEkUMIKHTmM/4afxCI4V4DXyUVQpPS1Nvv+X rLqV3AkFgrwmgCVpsio+PVjObjnttzU= X-Received: by 2002:a1c:2054:: with SMTP id g81-v6mr6485903wmg.122.1526371169520; Tue, 15 May 2018 00:59:29 -0700 (PDT) Received: from mms-0440.qualcomm.mm-sol.com ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id 4-v6sm10918510wmg.40.2018.05.15.00.59.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 May 2018 00:59:29 -0700 (PDT) From: Stanimir Varbanov To: Mauro Carvalho Chehab , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Vikash Garodia , Stanimir Varbanov Subject: [PATCH v2 02/29] venus: hfi: preparation to support venus 4xx Date: Tue, 15 May 2018 10:58:32 +0300 Message-Id: <20180515075859.17217-3-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180515075859.17217-1-stanimir.varbanov@linaro.org> References: <20180515075859.17217-1-stanimir.varbanov@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org This covers the differences between 1xx,3xx and 4xx. Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/core.h | 4 ++ drivers/media/platform/qcom/venus/helpers.c | 37 +++++++---- drivers/media/platform/qcom/venus/hfi_helper.h | 84 ++++++++++++++++++++++-- drivers/media/platform/qcom/venus/hfi_venus_io.h | 24 +++++++ drivers/media/platform/qcom/venus/vdec.c | 5 +- drivers/media/platform/qcom/venus/venc.c | 5 +- 6 files changed, 137 insertions(+), 22 deletions(-) -- 2.14.1 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h index 0360d295f4c8..8d3e150800c9 100644 --- a/drivers/media/platform/qcom/venus/core.h +++ b/drivers/media/platform/qcom/venus/core.h @@ -305,6 +305,10 @@ struct venus_inst { struct hfi_buffer_requirements bufreq[HFI_BUFFER_TYPE_MAX]; }; +#define IS_V1(core) ((core)->res->hfi_version == HFI_VERSION_1XX) +#define IS_V3(core) ((core)->res->hfi_version == HFI_VERSION_3XX) +#define IS_V4(core) ((core)->res->hfi_version == HFI_VERSION_4XX) + #define ctrl_to_inst(ctrl) \ container_of((ctrl)->handler, struct venus_inst, ctrl_handler) diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index 0ce9559a2924..d9065cc8a7d3 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -166,21 +166,37 @@ static int intbufs_unset_buffers(struct venus_inst *inst) return ret; } -static const unsigned int intbuf_types[] = { - HFI_BUFFER_INTERNAL_SCRATCH, - HFI_BUFFER_INTERNAL_SCRATCH_1, - HFI_BUFFER_INTERNAL_SCRATCH_2, +static const unsigned int intbuf_types_1xx[] = { + HFI_BUFFER_INTERNAL_SCRATCH(HFI_VERSION_1XX), + HFI_BUFFER_INTERNAL_SCRATCH_1(HFI_VERSION_1XX), + HFI_BUFFER_INTERNAL_SCRATCH_2(HFI_VERSION_1XX), + HFI_BUFFER_INTERNAL_PERSIST, + HFI_BUFFER_INTERNAL_PERSIST_1, +}; + +static const unsigned int intbuf_types_4xx[] = { + HFI_BUFFER_INTERNAL_SCRATCH(HFI_VERSION_4XX), + HFI_BUFFER_INTERNAL_SCRATCH_1(HFI_VERSION_4XX), + HFI_BUFFER_INTERNAL_SCRATCH_2(HFI_VERSION_4XX), HFI_BUFFER_INTERNAL_PERSIST, HFI_BUFFER_INTERNAL_PERSIST_1, }; static int intbufs_alloc(struct venus_inst *inst) { - unsigned int i; + size_t arr_sz; + size_t i; int ret; - for (i = 0; i < ARRAY_SIZE(intbuf_types); i++) { - ret = intbufs_set_buffer(inst, intbuf_types[i]); + if (IS_V4(inst->core)) + arr_sz = ARRAY_SIZE(intbuf_types_4xx); + else + arr_sz = ARRAY_SIZE(intbuf_types_1xx); + + for (i = 0; i < arr_sz; i++) { + ret = intbufs_set_buffer(inst, + IS_V4(inst->core) ? intbuf_types_4xx[i] : + intbuf_types_1xx[i]); if (ret) goto error; } @@ -257,12 +273,11 @@ static int load_scale_clocks(struct venus_core *core) set_freq: - if (core->res->hfi_version == HFI_VERSION_3XX) { - ret = clk_set_rate(clk, freq); + ret = clk_set_rate(clk, freq); + + if (IS_V3(core) || IS_V4(core)) { ret |= clk_set_rate(core->core0_clk, freq); ret |= clk_set_rate(core->core1_clk, freq); - } else { - ret = clk_set_rate(clk, freq); } if (ret) { diff --git a/drivers/media/platform/qcom/venus/hfi_helper.h b/drivers/media/platform/qcom/venus/hfi_helper.h index 55d8eb21403a..1bc5aab1ce6b 100644 --- a/drivers/media/platform/qcom/venus/hfi_helper.h +++ b/drivers/media/platform/qcom/venus/hfi_helper.h @@ -121,6 +121,7 @@ #define HFI_EXTRADATA_METADATA_FILLER 0x7fe00002 #define HFI_INDEX_EXTRADATA_INPUT_CROP 0x0700000e +#define HFI_INDEX_EXTRADATA_OUTPUT_CROP 0x0700000f #define HFI_INDEX_EXTRADATA_DIGITAL_ZOOM 0x07000010 #define HFI_INDEX_EXTRADATA_ASPECT_RATIO 0x7f100003 @@ -376,13 +377,18 @@ #define HFI_BUFFER_OUTPUT2 0x3 #define HFI_BUFFER_INTERNAL_PERSIST 0x4 #define HFI_BUFFER_INTERNAL_PERSIST_1 0x5 -#define HFI_BUFFER_INTERNAL_SCRATCH 0x1000001 -#define HFI_BUFFER_EXTRADATA_INPUT 0x1000002 -#define HFI_BUFFER_EXTRADATA_OUTPUT 0x1000003 -#define HFI_BUFFER_EXTRADATA_OUTPUT2 0x1000004 -#define HFI_BUFFER_INTERNAL_SCRATCH_1 0x1000005 -#define HFI_BUFFER_INTERNAL_SCRATCH_2 0x1000006 - +#define HFI_BUFFER_INTERNAL_SCRATCH(ver) \ + (((ver) == HFI_VERSION_4XX) ? 0x6 : 0x1000001) +#define HFI_BUFFER_INTERNAL_SCRATCH_1(ver) \ + (((ver) == HFI_VERSION_4XX) ? 0x7 : 0x1000005) +#define HFI_BUFFER_INTERNAL_SCRATCH_2(ver) \ + (((ver) == HFI_VERSION_4XX) ? 0x8 : 0x1000006) +#define HFI_BUFFER_EXTRADATA_INPUT(ver) \ + (((ver) == HFI_VERSION_4XX) ? 0xc : 0x1000002) +#define HFI_BUFFER_EXTRADATA_OUTPUT(ver) \ + (((ver) == HFI_VERSION_4XX) ? 0xa : 0x1000003) +#define HFI_BUFFER_EXTRADATA_OUTPUT2(ver) \ + (((ver) == HFI_VERSION_4XX) ? 0xb : 0x1000004) #define HFI_BUFFER_TYPE_MAX 11 #define HFI_BUFFER_MODE_STATIC 0x1000001 @@ -424,12 +430,14 @@ #define HFI_PROPERTY_PARAM_CODEC_MASK_SUPPORTED 0x100e #define HFI_PROPERTY_PARAM_MVC_BUFFER_LAYOUT 0x100f #define HFI_PROPERTY_PARAM_MAX_SESSIONS_SUPPORTED 0x1010 +#define HFI_PROPERTY_PARAM_WORK_MODE 0x1015 /* * HFI_PROPERTY_CONFIG_COMMON_START * HFI_DOMAIN_BASE_COMMON + HFI_ARCH_COMMON_OFFSET + 0x2000 */ #define HFI_PROPERTY_CONFIG_FRAME_RATE 0x2001 +#define HFI_PROPERTY_CONFIG_VIDEOCORES_USAGE 0x2002 /* * HFI_PROPERTY_PARAM_VDEC_COMMON_START @@ -438,6 +446,9 @@ #define HFI_PROPERTY_PARAM_VDEC_MULTI_STREAM 0x1003001 #define HFI_PROPERTY_PARAM_VDEC_CONCEAL_COLOR 0x1003002 #define HFI_PROPERTY_PARAM_VDEC_NONCP_OUTPUT2 0x1003003 +#define HFI_PROPERTY_PARAM_VDEC_PIXEL_BITDEPTH 0x1003007 +#define HFI_PROPERTY_PARAM_VDEC_PIC_STRUCT 0x1003009 +#define HFI_PROPERTY_PARAM_VDEC_COLOUR_SPACE 0x100300a /* * HFI_PROPERTY_CONFIG_VDEC_COMMON_START @@ -518,6 +529,7 @@ enum hfi_version { HFI_VERSION_1XX, HFI_VERSION_3XX, + HFI_VERSION_4XX }; struct hfi_buffer_info { @@ -767,12 +779,56 @@ struct hfi_framesize { u32 height; }; +#define VIDC_CORE_ID_DEFAULT 0 +#define VIDC_CORE_ID_1 1 +#define VIDC_CORE_ID_2 2 +#define VIDC_CORE_ID_3 3 + +struct hfi_videocores_usage_type { + u32 video_core_enable_mask; +}; + +#define VIDC_WORK_MODE_1 1 +#define VIDC_WORK_MODE_2 2 + +struct hfi_video_work_mode { + u32 video_work_mode; +}; + struct hfi_h264_vui_timing_info { u32 enable; u32 fixed_framerate; u32 time_scale; }; +struct hfi_bit_depth { + u32 buffer_type; + u32 bit_depth; +}; + +struct hfi_picture_type { + u32 is_sync_frame; + u32 picture_type; +}; + +struct hfi_pic_struct { + u32 progressive_only; +}; + +struct hfi_colour_space { + u32 colour_space; +}; + +struct hfi_extradata_input_crop { + u32 size; + u32 version; + u32 port_index; + u32 left; + u32 top; + u32 width; + u32 height; +}; + #define HFI_COLOR_FORMAT_MONOCHROME 0x01 #define HFI_COLOR_FORMAT_NV12 0x02 #define HFI_COLOR_FORMAT_NV21 0x03 @@ -961,6 +1017,12 @@ struct hfi_buffer_count_actual { u32 count_actual; }; +struct hfi_buffer_count_actual_4xx { + u32 type; + u32 count_actual; + u32 count_min_host; +}; + struct hfi_buffer_size_actual { u32 type; u32 size; @@ -971,6 +1033,14 @@ struct hfi_buffer_display_hold_count_actual { u32 hold_count; }; +/* HFI 4XX reorder the fields, use these macros */ +#define HFI_BUFREQ_HOLD_COUNT(bufreq, ver) \ + ((ver) == HFI_VERSION_4XX ? 0 : (bufreq)->hold_count) +#define HFI_BUFREQ_COUNT_MIN(bufreq, ver) \ + ((ver) == HFI_VERSION_4XX ? (bufreq)->hold_count : (bufreq)->count_min) +#define HFI_BUFREQ_COUNT_MIN_HOST(bufreq, ver) \ + ((ver) == HFI_VERSION_4XX ? (bufreq)->count_min : 0) + struct hfi_buffer_requirements { u32 type; u32 size; diff --git a/drivers/media/platform/qcom/venus/hfi_venus_io.h b/drivers/media/platform/qcom/venus/hfi_venus_io.h index 98cc350113ab..76f47936d0fa 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus_io.h +++ b/drivers/media/platform/qcom/venus/hfi_venus_io.h @@ -110,4 +110,28 @@ #define WRAPPER_CPU_STATUS (WRAPPER_BASE + 0x2014) #define WRAPPER_SW_RESET (WRAPPER_BASE + 0x3000) +/* Venus 4xx */ +#define WRAPPER_VCODEC0_MMCC_POWER_STATUS (WRAPPER_BASE + 0x90) +#define WRAPPER_VCODEC0_MMCC_POWER_CONTROL (WRAPPER_BASE + 0x94) + +#define WRAPPER_VCODEC1_MMCC_POWER_STATUS (WRAPPER_BASE + 0x110) +#define WRAPPER_VCODEC1_MMCC_POWER_CONTROL (WRAPPER_BASE + 0x114) + +/* vcodec noc error log registers */ +#define VCODEC_CORE0_VIDEO_NOC_BASE_OFFS 0x4000 +#define VCODEC_CORE1_VIDEO_NOC_BASE_OFFS 0xc000 +#define VCODEC_COREX_VIDEO_NOC_ERR_SWID_LOW_OFFS 0x500 +#define VCODEC_COREX_VIDEO_NOC_ERR_SWID_HIGH_OFFS 0x504 +#define VCODEC_COREX_VIDEO_NOC_ERR_MAINCTL_LOW_OFFS 0x508 +#define VCODEC_COREX_VIDEO_NOC_ERR_ERRVLD_LOW_OFFS 0x510 +#define VCODEC_COREX_VIDEO_NOC_ERR_ERRCLR_LOW_OFFS 0x518 +#define VCODEC_COREX_VIDEO_NOC_ERR_ERRLOG0_LOW_OFFS 0x520 +#define VCODEC_COREX_VIDEO_NOC_ERR_ERRLOG0_HIGH_OFFS 0x524 +#define VCODEC_COREX_VIDEO_NOC_ERR_ERRLOG1_LOW_OFFS 0x528 +#define VCODEC_COREX_VIDEO_NOC_ERR_ERRLOG1_HIGH_OFFS 0x52c +#define VCODEC_COREX_VIDEO_NOC_ERR_ERRLOG2_LOW_OFFS 0x530 +#define VCODEC_COREX_VIDEO_NOC_ERR_ERRLOG2_HIGH_OFFS 0x534 +#define VCODEC_COREX_VIDEO_NOC_ERR_ERRLOG3_LOW_OFFS 0x538 +#define VCODEC_COREX_VIDEO_NOC_ERR_ERRLOG3_HIGH_OFFS 0x53c + #endif diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index 49bbd1861d3a..261a51adeef2 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -689,6 +689,7 @@ static int vdec_queue_setup(struct vb2_queue *q, static int vdec_verify_conf(struct venus_inst *inst) { + enum hfi_version ver = inst->core->res->hfi_version; struct hfi_buffer_requirements bufreq; int ret; @@ -700,14 +701,14 @@ static int vdec_verify_conf(struct venus_inst *inst) return ret; if (inst->num_output_bufs < bufreq.count_actual || - inst->num_output_bufs < bufreq.count_min) + inst->num_output_bufs < HFI_BUFREQ_COUNT_MIN(&bufreq, ver)) return -EINVAL; ret = venus_helper_get_bufreq(inst, HFI_BUFFER_INPUT, &bufreq); if (ret) return ret; - if (inst->num_input_bufs < bufreq.count_min) + if (inst->num_input_bufs < HFI_BUFREQ_COUNT_MIN(&bufreq, ver)) return -EINVAL; return 0; diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c index 6b2ce479584e..947001170a77 100644 --- a/drivers/media/platform/qcom/venus/venc.c +++ b/drivers/media/platform/qcom/venus/venc.c @@ -892,6 +892,7 @@ static int venc_queue_setup(struct vb2_queue *q, static int venc_verify_conf(struct venus_inst *inst) { + enum hfi_version ver = inst->core->res->hfi_version; struct hfi_buffer_requirements bufreq; int ret; @@ -903,7 +904,7 @@ static int venc_verify_conf(struct venus_inst *inst) return ret; if (inst->num_output_bufs < bufreq.count_actual || - inst->num_output_bufs < bufreq.count_min) + inst->num_output_bufs < HFI_BUFREQ_COUNT_MIN(&bufreq, ver)) return -EINVAL; ret = venus_helper_get_bufreq(inst, HFI_BUFFER_INPUT, &bufreq); @@ -911,7 +912,7 @@ static int venc_verify_conf(struct venus_inst *inst) return ret; if (inst->num_input_bufs < bufreq.count_actual || - inst->num_input_bufs < bufreq.count_min) + inst->num_input_bufs < HFI_BUFREQ_COUNT_MIN(&bufreq, ver)) return -EINVAL; return 0; From patchwork Tue May 15 07:58:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 135830 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp668156lji; Tue, 15 May 2018 00:59:42 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrgaNbvuu3YJAcB8MfPIEALSxPW6dulhTR/rxKY6tDxwp2wy7orAyKdWIA0qPKWZNhmMeiE X-Received: by 2002:a63:9512:: with SMTP id p18-v6mr11052469pgd.183.1526371181921; Tue, 15 May 2018 00:59:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526371181; cv=none; d=google.com; s=arc-20160816; b=umRVizM1Xn8zy2UByC2Gu5P9WWzg5tCZwMsFaFYdkonqHRrQWjukoxE9AnJudR4H8v EWE/lcqzufZI0IMtRGDKn56NRke70cmHfzv2zj8ll5CUyhjEDhfy/ikpFB931ak20Zk4 LS57ojhW2jdcg1v6Id4ljL9AVOARtBg4Vo1LLmtyiAH0CHzcnBPsvOiVzqozn1KJvNOO EKGt9i3tL6y8DPwE8I5I+sK6hP3q7GrjFDJFmM3K68nG5tZ2EUKTk6qET+lk6HrAEJwv daZRle3wJxgDv6RKEbEGKjZB3+hsip55rHBRZ+p5UvKq4+XTgaCgI+1vAHUXYUyXZtIs iS4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=l7eWwx060UJkZofhnU08VjnBmb5ZXk8vei9+yemmMhc=; b=WkF8Ywm1amYIc0cGRe0Goz77KGP3mwpe1KnKxSTJ1QVZ0gZSplwjR81e8z7tDPf5w8 8mwayybO/JCTYWsDbmI6MmUmuwQ2INS1UL8vwSKEqZYUEHgm9w1F73v32xMwojPY0NJN TVSamwH3oAlZ0dGAb/JYpPDiHSfEV444n4j/zoJZWCYnuJdRHOm17Bv11snJ2nrYHxEt FG160GOxv/Xu3Qk+el3UewbbRDAOWwbmwEaOJvZIHIAzyjjxVuvotABCkX67V9GcLQ89 xNSn2yX7Cu4d30rnh+0izXxXu1WA64fwKC08TKNDgAbLZTe2lh6AYngUDsTwl2qMArPZ 0WZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=C1P8Pikn; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a65-v6si1564927pgc.503.2018.05.15.00.59.41; Tue, 15 May 2018 00:59:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=C1P8Pikn; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752537AbeEOH7j (ORCPT + 13 others); Tue, 15 May 2018 03:59:39 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:50646 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752188AbeEOH7e (ORCPT ); Tue, 15 May 2018 03:59:34 -0400 Received: by mail-wm0-f65.google.com with SMTP id t11-v6so17686700wmt.0 for ; Tue, 15 May 2018 00:59:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=UJY1ElvCAePNUPkqjsGk3ZluUk9SleoeEVToFWcXc0U=; b=C1P8PiknuPwX3hDZMWhJntybejNb/CoX7QR4pYi6WT/3lDZwLB9BSqM53d+U8Ij19/ w+ZKNA9kIpCtWHWgOlw9AhUkqTOmkfOpkD+qkL43oQLc1rq86TJVrEe8C9OGrGdGHUak GDPojQmhO7yBLf9Kh+/M0JHEF3AvIAp6KvYic= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=UJY1ElvCAePNUPkqjsGk3ZluUk9SleoeEVToFWcXc0U=; b=Ey35mHrKKBnHEZ2t/njAdhAkk7c7M0uQbEB6eqsNd7I68dOUMHic/wajG6i0HonboD BA1cKfwNYnJwzrCC2QwncIh/cug3gYr4pDtOtzeQk1IvWam8s+yq5tJqfcNm4e8UqI9f Vkvj15e+qNzzRJKYdTcWSOF/rhB+U8ABJ1hSsn49ZjFWzTv38Pm/1i7oEfCaCJtTzLfV Ni7FUC21ms0eblRfapn1TDCTHOHpqq4Fv6ZTbKrPvES4M9pDP2nhxOzXFdS+NXeBR9jt HsHizN+gdYyGODKzUY/AUwwXGr23tHqe1+tcF2KS+lVyGM4ezsyxYmbSYMHGlBygxT0/ 9HTw== X-Gm-Message-State: ALKqPwds2e3idADPNFuYTwWJKACvZKZG/c3nku591wjwasJ2Tmo/h8sb ldQ7gBIqoaPCsIBjgqEmiyOvESVXHvI= X-Received: by 2002:a1c:3313:: with SMTP id z19-v6mr490564wmz.48.1526371173836; Tue, 15 May 2018 00:59:33 -0700 (PDT) Received: from mms-0440.qualcomm.mm-sol.com ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id 4-v6sm10918510wmg.40.2018.05.15.00.59.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 May 2018 00:59:33 -0700 (PDT) From: Stanimir Varbanov To: Mauro Carvalho Chehab , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Vikash Garodia , Stanimir Varbanov Subject: [PATCH v2 06/29] venus: hfi: handle buffer output2 type as well Date: Tue, 15 May 2018 10:58:36 +0300 Message-Id: <20180515075859.17217-7-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180515075859.17217-1-stanimir.varbanov@linaro.org> References: <20180515075859.17217-1-stanimir.varbanov@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org This adds handling of buffers of type OUTPUT2 which is needed to support Venus 4xx version. Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/hfi.c | 3 ++- drivers/media/platform/qcom/venus/hfi_msgs.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) -- 2.14.1 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/platform/qcom/venus/hfi.c b/drivers/media/platform/qcom/venus/hfi.c index cbc6fad05e47..a570fdad0de0 100644 --- a/drivers/media/platform/qcom/venus/hfi.c +++ b/drivers/media/platform/qcom/venus/hfi.c @@ -473,7 +473,8 @@ int hfi_session_process_buf(struct venus_inst *inst, struct hfi_frame_data *fd) if (fd->buffer_type == HFI_BUFFER_INPUT) return ops->session_etb(inst, fd); - else if (fd->buffer_type == HFI_BUFFER_OUTPUT) + else if (fd->buffer_type == HFI_BUFFER_OUTPUT || + fd->buffer_type == HFI_BUFFER_OUTPUT2) return ops->session_ftb(inst, fd); return -EINVAL; diff --git a/drivers/media/platform/qcom/venus/hfi_msgs.c b/drivers/media/platform/qcom/venus/hfi_msgs.c index 5970e9b1716b..023802e62833 100644 --- a/drivers/media/platform/qcom/venus/hfi_msgs.c +++ b/drivers/media/platform/qcom/venus/hfi_msgs.c @@ -825,7 +825,8 @@ static void hfi_session_ftb_done(struct venus_core *core, error = HFI_ERR_SESSION_INVALID_PARAMETER; } - if (buffer_type != HFI_BUFFER_OUTPUT) + if (buffer_type != HFI_BUFFER_OUTPUT && + buffer_type != HFI_BUFFER_OUTPUT2) goto done; if (hfi_flags & HFI_BUFFERFLAG_EOS) From patchwork Tue May 15 07:58:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 135841 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp671139lji; Tue, 15 May 2018 01:02:39 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrcDgtKjWHpTbcE73VS/FStE5VO6n2zx824XUvThtUZDGzcbtIg/4biHkE+OjfWCLDZJ/M+ X-Received: by 2002:a62:4544:: with SMTP id s65-v6mr14014010pfa.150.1526371359518; Tue, 15 May 2018 01:02:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526371359; cv=none; d=google.com; s=arc-20160816; b=bszidK6ecUVoQRq+csCP30pBQHJYV2SIgXTdxe4b5aTmY9177OVifPjXDdZJG9gX7k oJ/Yp6NVWSaVpL4J/FE9To1u7TmYhWNJLue9K+p7ezmVEdN+5ENII119l7bYFw9Krodt P7/Bs6HPlgYqOTUK/1kVeyYtHCDjMTLTiLBDZl4rgMy/e9mb0WtKNccbaOo8CneSU7i4 LlzTZt9ZTkmPDSDuac/aSZJ0U/irlgRyG5SyWseiEWX6GZC2AvKkHAa4TndD/T5AqBYE v1fgT+B930l/qGXunoGks2dBc7LjrACJjmaNBe8HmlaRDtLqE7N+LeSER7UXHE61lGf/ 7erw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=PjZXoDkYghrxf3CUQE41axDLa7Aubzew82wVKcm3niU=; b=qYVKeTKOtUT2vWod9Rt53RRhzZu+dhLcSqtHZQhk3DojOlhDGbD0RDwLIz80SAHDId ob2J2g1GfvqCSOWhKQ3jAM3DVj3mppBooi4BeivA9bEmo4oGVhXaJu/RONJfB4zhLovs JNWulcopVFiqSglAC2rggcGgrvwwBqKfWTF0hhV/FFBCVlrykpHi3/XnSgK8rw7toF+x dLkmOj1Tz6Jw/3D6mn0hWvtJ42zzIZJDp8XV/ngYOziHdVnLJ0XsQtvlvhrLoCZQLlmk w0nXeHeuaBbGQsrEkLB4jRPlsISJtBaLs719u4vvt8m92eLNh3uxGY6fDbuwKu3BEygI 7EnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=BIzVhr2a; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l4-v6si9528859pgn.54.2018.05.15.01.02.39; Tue, 15 May 2018 01:02:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=BIzVhr2a; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752611AbeEOH7x (ORCPT + 13 others); Tue, 15 May 2018 03:59:53 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:37178 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752550AbeEOH7n (ORCPT ); Tue, 15 May 2018 03:59:43 -0400 Received: by mail-wm0-f65.google.com with SMTP id l1-v6so19722351wmb.2 for ; Tue, 15 May 2018 00:59:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=boZzvw8J9AG3zB/hNfpFR04mGD4vUKszkUB2fak/o04=; b=BIzVhr2abEfSwT9D35P77bSVEI6ul25nz+hc6z0zVBsxdFXn/bS6DnzQI7v/TqY673 d5ak5b0iISdleCY7d4bDUre3K1xxKN5fTCl87Apk8s9WiwQnkT1Xx7tmnap9v8HifEtr M+hKiB5vNyJ8txU5H35zfZGkOV+LAPLUonhr0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=boZzvw8J9AG3zB/hNfpFR04mGD4vUKszkUB2fak/o04=; b=F2NV8lGITRI/f8fT+YPVrRytp7Q+B4+ORCSo0GKfHfaxU6fSeQ+yyhuFNxvyk1uoPs o5bPqiwnQzkx8piG+SK/on2XWi5T+q2xvOIOL0EdQNY6O7rHrT/9iosvd/ISCL+v8P92 dfMbRDLVurihR27+BOspThQvqtDc85+iCIN7QtJwg2/1paY0EVMCDxfKsLP5b7xy30nf jDhOnjqMkxqTm5k1iQVN0y71VGFLl4Pdnr2IHh1gc2YH283DNOnBzAf4ABt5dO3rDiR+ wIyXNqYZF9AYDUrzDv6GI24wdxk0brFRA71WQsBMlGVqfeNu9QhH7yR8RjvaE3s6wjjk wf8Q== X-Gm-Message-State: ALKqPwcer+Qc2ra/PurVBhRQVMyKC/GXK23l1JzshGKnQxwVrAYJmbrh /MOdRLKkINAJsGr84Em9N/gV/A== X-Received: by 2002:a1c:8645:: with SMTP id i66-v6mr7626183wmd.40.1526371182663; Tue, 15 May 2018 00:59:42 -0700 (PDT) Received: from mms-0440.qualcomm.mm-sol.com ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id 4-v6sm10918510wmg.40.2018.05.15.00.59.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 May 2018 00:59:42 -0700 (PDT) From: Stanimir Varbanov To: Mauro Carvalho Chehab , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Vikash Garodia , Stanimir Varbanov Subject: [PATCH v2 14/29] venus: core: delete not used flag for buffer mode Date: Tue, 15 May 2018 10:58:44 +0300 Message-Id: <20180515075859.17217-15-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180515075859.17217-1-stanimir.varbanov@linaro.org> References: <20180515075859.17217-1-stanimir.varbanov@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Delete not used flag for capture buffer allocation mode. Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/core.h | 2 -- 1 file changed, 2 deletions(-) -- 2.14.1 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h index fe2d2b9e8af8..c46334454cd9 100644 --- a/drivers/media/platform/qcom/venus/core.h +++ b/drivers/media/platform/qcom/venus/core.h @@ -249,7 +249,6 @@ struct venus_buffer { * @priv: a private for HFI operations callbacks * @session_type: the type of the session (decoder or encoder) * @hprop: a union used as a holder by get property - * @cap_bufs_mode_static: buffers allocation mode capability * @cap_bufs_mode_dynamic: buffers allocation mode capability */ struct venus_inst { @@ -299,7 +298,6 @@ struct venus_inst { const struct hfi_inst_ops *ops; u32 session_type; union hfi_get_property hprop; - bool cap_bufs_mode_static; bool cap_bufs_mode_dynamic; }; From patchwork Tue May 15 07:58:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 135840 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp670985lji; Tue, 15 May 2018 01:02:31 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq5as0EzJ3N1vQNgRXOCA03HMk0QLBZG5r6/3mv9AknUjLqmdht+QihWeDOFP781mWL72ol X-Received: by 2002:a63:3706:: with SMTP id e6-v6mr11247172pga.281.1526371350936; Tue, 15 May 2018 01:02:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526371350; cv=none; d=google.com; s=arc-20160816; b=tuiwbk8x5SLmELl/IPbnVIlHpVmw2/qCm70dbu5Gzc8OGGvZHuCMjES5fFvYdp/Ezz 6lAC5Fau0n+LLIBbpK3qd9ta32uOGBJpYOcSGZYVIbMsbhXnuDdYOUHisDy/9H+FtJwx WMIbAxsfkqRyW13b10Xjj/uUl1ftWCpWQ6wd7dXndop/P/AaXvRhupnFUJb75TtQOCIw qW4FIBXxaqyN6DIwG3tN/GQfoVr5dUyVGzytoQ+DTYzo8YIU7XYMyf6q8FsQscghCnRB RVXbsFxaPArYF6IZeeEnkZhhgDrL6Y5hHM38Ei4ufkkpch3C4oTypp5BhtZPJqfwTMaI SB/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=OcZuRaXmoSYNJtMeTx37SYSi6mTTY4bgOH3iUTdF6x0=; b=Im9nvrfFPcNn+ZoUCpfCSaKFmo6rJqNrixgX3H5d26aHLIaLXMmNsfAu5GMwcLOgOS 7QGEIDXcvnxZrG6tPxp4yKDdFOQUti5BSx3Abh+0b3F0kwWMg9+sbjrzTUNJBTunr+8y LG2STwncP1tUGOZjWit26WZWmEZbf3VyNH4bzmTBJo50YTc9ucmCPUUCkcu83MqmJ4xP 4XCWBSFMw4rLxDNVLFjS+lCxOOKe1rq5jd5JPhNIW1pbK2MJyjUBIkEWpLpizMLyobdk zpovDak7Ria/8w5ZaaJi9tSepme4FSb+3l6ynhU75DIHEQdqKH61UHPDtE6hO9wau5d5 qtHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=ZAJ7XiVR; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l4-v6si9528859pgn.54.2018.05.15.01.02.30; Tue, 15 May 2018 01:02:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=ZAJ7XiVR; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752618AbeEOH7y (ORCPT + 13 others); Tue, 15 May 2018 03:59:54 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:33880 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752560AbeEOH7r (ORCPT ); Tue, 15 May 2018 03:59:47 -0400 Received: by mail-wr0-f195.google.com with SMTP id p18-v6so14910414wrm.1 for ; Tue, 15 May 2018 00:59:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=zJxnpqaIIqZtdOKFlNGYC5gg+khf/QPmLkujQMd3QTs=; b=ZAJ7XiVRqN+rP8ZWjFxT4DnjjxuecrOcRi0HG83jhBVYNMvHjMao0yL8E2AtKi6XjC gTKU0MQ0+5ZTntU+vbFYGJ2AOOn6u8l42e8W+w3Jyaznz1BhCRBxXA4Lu9bwAbhRGDUl LEn3j0/UQi/9ECKwg7LeZ5DR/fHKUZCIdWTew= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=zJxnpqaIIqZtdOKFlNGYC5gg+khf/QPmLkujQMd3QTs=; b=pUMTqNrfESyQdzLqaNq2qybViNJ2JVOyKIeVfMXmpvxGJnHGeYBftC1v8/S7ekLa7R Qe8JN3bKhh3rV77ztFkKmEqMAIcUKJ/n2cQetpfDMmwzxgIV7YTY/6h0F8e/hxh+6HXG 6H34CrKMdj+RA5LWpH8IqfaBpX+B2O8Q2OXYYbPY/T4+DL6xh9Fc1z/E+eeuJk2ft3bk jRXELGth3RbKEsQSYCppPcqfWVSyeF5Li6SwnaZiqIdenjmYWLpjjZRWh9j+rWgn+lQl RgOKMU3WXmtGWtO6ojtZ+tIOFrytX4+bUAtda83LGpwk2mtlz8uMblnwdG0eXLgBZ1JO OKug== X-Gm-Message-State: ALKqPwf51i11QyD0aja0/Am9mQUcaHpZeqe8UAJkh0+W99WAkvGQHi2K JvKF+Z8jjeRsJZIb87/J/CAD7g== X-Received: by 2002:adf:e78b:: with SMTP id n11-v6mr9049314wrm.192.1526371185922; Tue, 15 May 2018 00:59:45 -0700 (PDT) Received: from mms-0440.qualcomm.mm-sol.com ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id 4-v6sm10918510wmg.40.2018.05.15.00.59.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 May 2018 00:59:45 -0700 (PDT) From: Stanimir Varbanov To: Mauro Carvalho Chehab , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Vikash Garodia , Stanimir Varbanov Subject: [PATCH v2 17/29] venus: add helper function to set actual buffer size Date: Tue, 15 May 2018 10:58:47 +0300 Message-Id: <20180515075859.17217-18-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180515075859.17217-1-stanimir.varbanov@linaro.org> References: <20180515075859.17217-1-stanimir.varbanov@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add and use a helper function to set actual buffer size for particular buffer type. This is also preparation to use the second decoder output. Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/helpers.c | 12 ++++++++++++ drivers/media/platform/qcom/venus/helpers.h | 1 + drivers/media/platform/qcom/venus/vdec.c | 10 ++-------- 3 files changed, 15 insertions(+), 8 deletions(-) -- 2.14.1 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index 824ad4d2d064..94664a3ce3e2 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -544,6 +544,18 @@ int venus_helper_set_dyn_bufmode(struct venus_inst *inst) } EXPORT_SYMBOL_GPL(venus_helper_set_dyn_bufmode); +int venus_helper_set_bufsize(struct venus_inst *inst, u32 bufsize, u32 buftype) +{ + u32 ptype = HFI_PROPERTY_PARAM_BUFFER_SIZE_ACTUAL; + struct hfi_buffer_size_actual bufsz; + + bufsz.type = buftype; + bufsz.size = bufsize; + + return hfi_session_set_property(inst, ptype, &bufsz); +} +EXPORT_SYMBOL_GPL(venus_helper_set_bufsize); + static void delayed_process_buf_func(struct work_struct *work) { struct venus_buffer *buf, *n; diff --git a/drivers/media/platform/qcom/venus/helpers.h b/drivers/media/platform/qcom/venus/helpers.h index 52b961ed491e..cd306bd8978f 100644 --- a/drivers/media/platform/qcom/venus/helpers.h +++ b/drivers/media/platform/qcom/venus/helpers.h @@ -41,6 +41,7 @@ int venus_helper_set_num_bufs(struct venus_inst *inst, unsigned int input_bufs, unsigned int output_bufs); int venus_helper_set_color_format(struct venus_inst *inst, u32 fmt); int venus_helper_set_dyn_bufmode(struct venus_inst *inst); +int venus_helper_set_bufsize(struct venus_inst *inst, u32 bufsize, u32 buftype); void venus_helper_acquire_buf_ref(struct vb2_v4l2_buffer *vbuf); void venus_helper_release_buf_ref(struct venus_inst *inst, unsigned int idx); void venus_helper_init_instance(struct venus_inst *inst); diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index 271192273953..e8e00d0650e9 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -710,7 +710,6 @@ static int vdec_start_streaming(struct vb2_queue *q, unsigned int count) { struct venus_inst *inst = vb2_get_drv_priv(q); struct venus_core *core = inst->core; - u32 ptype; int ret; mutex_lock(&inst->lock); @@ -740,13 +739,8 @@ static int vdec_start_streaming(struct vb2_queue *q, unsigned int count) goto deinit_sess; if (core->res->hfi_version == HFI_VERSION_3XX) { - struct hfi_buffer_size_actual buf_sz; - - ptype = HFI_PROPERTY_PARAM_BUFFER_SIZE_ACTUAL; - buf_sz.type = HFI_BUFFER_OUTPUT; - buf_sz.size = inst->output_buf_size; - - ret = hfi_session_set_property(inst, ptype, &buf_sz); + ret = venus_helper_set_bufsize(inst, inst->output_buf_size, + HFI_BUFFER_OUTPUT); if (ret) goto deinit_sess; }