From patchwork Wed Dec 18 13:22:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 181999 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp646538ile; Wed, 18 Dec 2019 05:24:03 -0800 (PST) X-Google-Smtp-Source: APXvYqwgC/QH9e5ul2u6IsYjZaDC/VYFELpeYZ3AIjIOwl5lvOIbtwcIZc8WsBPNR3cmo/RdX07p X-Received: by 2002:aca:36c5:: with SMTP id d188mr367091oia.54.1576675443184; Wed, 18 Dec 2019 05:24:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576675443; cv=none; d=google.com; s=arc-20160816; b=M1tfGIohoNbpEp2HtItfHLqkOZyX8qKChFJx0JbOgwJ7XIHHsFXpf5mgADdULfdfvK Qg15n3+s+FpV5a0NyAlB0RErtT1prfk518qqMTxX/1EQdvpD8uBz7vqt5oBVqDgPYPLA x7pDEXtWdYOZRh+qUMkbd1Zxcv71j1C7sStLQcU2qZ2zJi1L5OopLCeKxS0quIizC0Bx gymBI8DXAbGmN9Hx6qCdejSCJ9JnLX/s4pRqvlit7wQ3aPJ1urB7iS2HWj5nHAGEQlEU xCwFDKfeTwwtPdAgHe1XAR1dbv6IBZsrrOM/a9gfvKqDJz2UXPcAdTxhpRSqD2foUXe2 IDLQ== 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; bh=NVL5+pBVbAL5rpEkMW1hQcPnra9m/vRP70pZvH2RbgM=; b=GiGJt1xyIzFDmbg4NNOMGIqr7UiGWg3mt8K8xPWCZrIC2bvCawPBSRVWbgG9IjxBg5 LyzLrGQpF181t8t7ZIJa93RFXkuzbwLLGGUU20n0tm2eD0EfozUM5IHkukVWf3A//Wfe EdmrU8TNhNPxTQUFSToWfBZ0BSzqcCTf5ZLddIMULMm5Dg7l5O0ZOHh+9O0yd3gpbj54 pJR6QF0DXwZIeZ30iJZ1m3wfxP7zVDdTB++b3M+Vi8dHZvcq2pJKjFOx2BUBVjwwIrOB BfnvVxe9z04X2IUFPvLBQPPcp+mhmTpNTiPoEix4KYtbyZG6MIUsv4IDzvx2h1PETsst f8Cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="TP/W6hrW"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (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 t18si1407797oij.133.2019.12.18.05.24.02; Wed, 18 Dec 2019 05:24:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="TP/W6hrW"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727256AbfLRNYA (ORCPT + 27 others); Wed, 18 Dec 2019 08:24:00 -0500 Received: from mail-lf1-f65.google.com ([209.85.167.65]:45370 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726749AbfLRNX7 (ORCPT ); Wed, 18 Dec 2019 08:23:59 -0500 Received: by mail-lf1-f65.google.com with SMTP id 203so1663682lfa.12 for ; Wed, 18 Dec 2019 05:23:57 -0800 (PST) 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=NVL5+pBVbAL5rpEkMW1hQcPnra9m/vRP70pZvH2RbgM=; b=TP/W6hrWPtyhXCnkJ/M9rO3u+zLh3YW8407ypXPQ0jPTnR218QRgcQEVS8vVPruxsJ b5iwm5Q3gQnNMqIY88TBmzVs2o3mwbIN+y+oXlF7OuTSeTHfB1isqtaI4Ln9XLACWMZm NPzC9Mh4i89TNToP9uCHGuInBM9Ec6CGNNt7ZG/AMWhruQEkhnQgpDzIA1IDfpSVCFuF TmKl2ATKudd2O2B4a3xB+L696oTUIm0K0e2jqliW3KMsB3heYCGcDZzCuA/+e34tMaZX +AmSE8c3El6Pb3H7UGz8qauHmaIKIkkawsaTaYVE9wXgB62Xk/Jyi2ilR2Qki6i9Tvi7 ZbQA== 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=NVL5+pBVbAL5rpEkMW1hQcPnra9m/vRP70pZvH2RbgM=; b=aPNt8y6epFhmA2y2MIuj0Cr3bU+/AyaKeBxVWG9tWybhWrp7czZDQAesiR2f8vhw4t 1Z3swzddlHzpKEpxeKUh2iRpEbDwqiUo+t08bUFOviQZocwX5+wvAf9p4tW02xqA/w8L 8MaUwCR/JPmWrP7LL8lYreMhd8ZDuF/6+jupsK4ETkIDl0LCZhPITIu+fbaF3z35aFhc EyyyJGqZdvImxljkIH/FCZ+b//2aHXceHaWyjGknlrQA6IMHTTpc0lKhrRISoKjY94XT YTkr+ZXScIZOsuFf0JFyWWfCeAmkVEP2re//bYacyY9jx3Pcec57hTOjUqqjuZEyY/O2 17ew== X-Gm-Message-State: APjAAAVx/pJv/9t4x+wamrM+HaVwbWctfWmnE6vetNCUBrgBTM86pKal shiC9IiFl3o8kyaVO5SAAzm7Vw== X-Received: by 2002:ac2:5c4b:: with SMTP id s11mr1699990lfp.133.1576675436728; Wed, 18 Dec 2019 05:23:56 -0800 (PST) Received: from localhost.localdomain ([37.157.136.193]) by smtp.gmail.com with ESMTPSA id z7sm1440667lfa.81.2019.12.18.05.23.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Dec 2019 05:23:56 -0800 (PST) From: Stanimir Varbanov To: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org Cc: Vikash Garodia , dikshita@codeaurora.org, Aniket Masule , Stanimir Varbanov Subject: [PATCH v2 02/12] media: venus: introduce core selection Date: Wed, 18 Dec 2019 15:22:41 +0200 Message-Id: <20191218132251.24161-3-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191218132251.24161-1-stanimir.varbanov@linaro.org> References: <20191218132251.24161-1-stanimir.varbanov@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Aniket Masule Presently the core (vcodec pipelines) assignment is static. Here we introduce dynamic load balancing across the cores depending on the current session load. The load on earch core is calculated and core with minimum load is assigned to given instance. This will be applicable on Venus v4 with more than one vcodec cores. Signed-off-by: Aniket Masule Co-developed-by: Stanimir Varbanov Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/core.h | 3 + drivers/media/platform/qcom/venus/helpers.c | 17 +- drivers/media/platform/qcom/venus/helpers.h | 1 - .../media/platform/qcom/venus/hfi_helper.h | 1 + .../media/platform/qcom/venus/hfi_parser.h | 5 + .../media/platform/qcom/venus/pm_helpers.c | 183 ++++++++++++++++-- .../media/platform/qcom/venus/pm_helpers.h | 26 +++ drivers/media/platform/qcom/venus/vdec.c | 11 +- drivers/media/platform/qcom/venus/venc.c | 10 +- 9 files changed, 221 insertions(+), 36 deletions(-) -- 2.17.1 diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h index c66763e1b8f1..bfbd4a1ba089 100644 --- a/drivers/media/platform/qcom/venus/core.h +++ b/drivers/media/platform/qcom/venus/core.h @@ -181,6 +181,8 @@ struct venus_core { struct delayed_work work; struct venus_caps caps[MAX_CODEC_NUM]; unsigned int codecs_count; + unsigned int core0_usage_count; + unsigned int core1_usage_count; }; struct vdec_controls { @@ -379,6 +381,7 @@ struct venus_inst { const struct hfi_inst_ops *ops; u32 session_type; union hfi_get_property hprop; + unsigned int core_acquired: 1; }; #define IS_V1(core) ((core)->res->hfi_version == HFI_VERSION_1XX) diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index cbeeaf6077e0..043e0d8705a8 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -723,21 +723,6 @@ int venus_helper_set_work_mode(struct venus_inst *inst, u32 mode) } EXPORT_SYMBOL_GPL(venus_helper_set_work_mode); -int venus_helper_set_core_usage(struct venus_inst *inst, u32 usage) -{ - const u32 ptype = HFI_PROPERTY_CONFIG_VIDEOCORES_USAGE; - struct hfi_videocores_usage_type cu; - - inst->clk_data.core_id = usage; - if (!IS_V4(inst->core)) - return 0; - - cu.video_core_enable_mask = usage; - - return hfi_session_set_property(inst, ptype, &cu); -} -EXPORT_SYMBOL_GPL(venus_helper_set_core_usage); - int venus_helper_init_codec_freq_data(struct venus_inst *inst) { const struct codec_freq_data *data; @@ -1101,6 +1086,8 @@ void venus_helper_vb2_stop_streaming(struct vb2_queue *q) else inst->streamon_cap = 0; + venus_pm_release_core(inst); + mutex_unlock(&inst->lock); } EXPORT_SYMBOL_GPL(venus_helper_vb2_stop_streaming); diff --git a/drivers/media/platform/qcom/venus/helpers.h b/drivers/media/platform/qcom/venus/helpers.h index 44b50914cd12..b64875564064 100644 --- a/drivers/media/platform/qcom/venus/helpers.h +++ b/drivers/media/platform/qcom/venus/helpers.h @@ -34,7 +34,6 @@ int venus_helper_set_output_resolution(struct venus_inst *inst, u32 buftype); int venus_helper_set_work_mode(struct venus_inst *inst, u32 mode); int venus_helper_init_codec_freq_data(struct venus_inst *inst); -int venus_helper_set_core_usage(struct venus_inst *inst, u32 usage); int venus_helper_set_num_bufs(struct venus_inst *inst, unsigned int input_bufs, unsigned int output_bufs, unsigned int output2_bufs); diff --git a/drivers/media/platform/qcom/venus/hfi_helper.h b/drivers/media/platform/qcom/venus/hfi_helper.h index b70551e296b7..2a47f6c0a07a 100644 --- a/drivers/media/platform/qcom/venus/hfi_helper.h +++ b/drivers/media/platform/qcom/venus/hfi_helper.h @@ -550,6 +550,7 @@ struct hfi_bitrate { #define HFI_CAPABILITY_LCU_SIZE 0x14 #define HFI_CAPABILITY_HIER_P_HYBRID_NUM_ENH_LAYERS 0x15 #define HFI_CAPABILITY_MBS_PER_SECOND_POWERSAVE 0x16 +#define HFI_CAPABILITY_MAX_VIDEOCORES 0x2b struct hfi_capability { u32 capability_type; diff --git a/drivers/media/platform/qcom/venus/hfi_parser.h b/drivers/media/platform/qcom/venus/hfi_parser.h index 3e931c747e19..264e6dd2415f 100644 --- a/drivers/media/platform/qcom/venus/hfi_parser.h +++ b/drivers/media/platform/qcom/venus/hfi_parser.h @@ -107,4 +107,9 @@ static inline u32 frate_step(struct venus_inst *inst) return cap_step(inst, HFI_CAPABILITY_FRAMERATE); } +static inline u32 core_num_max(struct venus_inst *inst) +{ + return cap_max(inst, HFI_CAPABILITY_MAX_VIDEOCORES); +} + #endif diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c index 9531c01f067b..46d9d2fb5e23 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.c +++ b/drivers/media/platform/qcom/venus/pm_helpers.c @@ -14,6 +14,7 @@ #include #include "core.h" +#include "hfi_parser.h" #include "hfi_venus_io.h" #include "pm_helpers.h" @@ -480,6 +481,173 @@ static int poweron_coreid(struct venus_core *core, unsigned int coreid_mask) return 0; } +static void +min_loaded_core(struct venus_inst *inst, u32 *min_coreid, u32 *min_load) +{ + u32 mbs_per_sec, load, core1_load = 0, core2_load = 0; + u32 cores_max = core_num_max(inst); + struct venus_core *core = inst->core; + struct venus_inst *inst_pos; + unsigned long vpp_freq; + u32 coreid; + + mutex_lock(&core->lock); + + list_for_each_entry(inst_pos, &core->instances, list) { + if (inst_pos == inst) + continue; + vpp_freq = inst_pos->clk_data.codec_freq_data->vpp_freq; + coreid = inst_pos->clk_data.core_id; + + mbs_per_sec = load_per_instance(inst_pos); + load = mbs_per_sec * vpp_freq; + + if ((coreid & VIDC_CORE_ID_3) == VIDC_CORE_ID_3) { + core1_load += load / 2; + core2_load += load / 2; + } else if (coreid & VIDC_CORE_ID_1) { + core1_load += load; + } else if (coreid & VIDC_CORE_ID_2) { + core2_load += load; + } + } + + *min_coreid = core1_load <= core2_load ? + VIDC_CORE_ID_1 : VIDC_CORE_ID_2; + *min_load = min(core1_load, core2_load); + + if (cores_max < VIDC_CORE_ID_2 || core->res->vcodec_num < 2) { + *min_coreid = VIDC_CORE_ID_1; + *min_load = core1_load; + } + + mutex_unlock(&core->lock); +} + +static int decide_core(struct venus_inst *inst) +{ + const u32 ptype = HFI_PROPERTY_CONFIG_VIDEOCORES_USAGE; + struct venus_core *core = inst->core; + u32 min_coreid, min_load, inst_load; + struct hfi_videocores_usage_type cu; + unsigned long max_freq; + + if (legacy_binding) { + if (inst->session_type == VIDC_SESSION_TYPE_DEC) + cu.video_core_enable_mask = VIDC_CORE_ID_1; + else + cu.video_core_enable_mask = VIDC_CORE_ID_2; + + goto done; + } + + if (inst->clk_data.core_id != VIDC_CORE_ID_DEFAULT) + return 0; + + inst_load = load_per_instance(inst); + inst_load *= inst->clk_data.codec_freq_data->vpp_freq; + max_freq = core->res->freq_tbl[0].freq; + + min_loaded_core(inst, &min_coreid, &min_load); + + if ((inst_load + min_load) > max_freq) { + dev_warn(core->dev, "HW is overloaded, needed: %u max: %lu\n", + inst_load, max_freq); + return -EINVAL; + } + + inst->clk_data.core_id = min_coreid; + cu.video_core_enable_mask = min_coreid; + +done: + return hfi_session_set_property(inst, ptype, &cu); +} + +static int acquire_core(struct venus_inst *inst) +{ + struct venus_core *core = inst->core; + unsigned int coreid_mask = 0; + + if (inst->core_acquired) + return 0; + + inst->core_acquired = true; + + if (inst->clk_data.core_id & VIDC_CORE_ID_1) { + if (core->core0_usage_count++) + return 0; + + coreid_mask = VIDC_CORE_ID_1; + } + + if (inst->clk_data.core_id & VIDC_CORE_ID_2) { + if (core->core1_usage_count++) + return 0; + + coreid_mask |= VIDC_CORE_ID_2; + } + + return poweron_coreid(core, coreid_mask); +} + +static int release_core(struct venus_inst *inst) +{ + struct venus_core *core = inst->core; + unsigned int coreid_mask = 0; + int ret; + + if (!inst->core_acquired) + return 0; + + if (inst->clk_data.core_id & VIDC_CORE_ID_1) { + if (--core->core0_usage_count) + goto done; + + coreid_mask = VIDC_CORE_ID_1; + } + + if (inst->clk_data.core_id & VIDC_CORE_ID_2) { + if (--core->core1_usage_count) + goto done; + + coreid_mask |= VIDC_CORE_ID_2; + } + + ret = poweroff_coreid(core, coreid_mask); + if (ret) + return ret; + +done: + inst->clk_data.core_id = VIDC_CORE_ID_DEFAULT; + inst->core_acquired = false; + return 0; +} + +static int coreid_power_v4(struct venus_inst *inst, int on) +{ + struct venus_core *core = inst->core; + int ret; + + if (legacy_binding) + return 0; + + if (on == POWER_ON) { + ret = decide_core(inst); + if (ret) + return ret; + + mutex_lock(&core->lock); + ret = acquire_core(inst); + mutex_unlock(&core->lock); + } else { + mutex_lock(&core->lock); + ret = release_core(inst); + mutex_unlock(&core->lock); + } + + return ret; +} + static int vdec_get_v4(struct device *dev) { struct venus_core *core = dev_get_drvdata(dev); @@ -661,22 +829,12 @@ static void core_put_v4(struct device *dev) static int core_power_v4(struct device *dev, int on) { struct venus_core *core = dev_get_drvdata(dev); - const unsigned int coreid_mask = VIDC_CORE_ID_1 | VIDC_CORE_ID_2; int ret = 0; - if (on == POWER_ON) { + if (on == POWER_ON) ret = core_clks_enable(core); - if (ret) - return ret; - - if (!legacy_binding) - ret = poweron_coreid(core, coreid_mask); - } else { - if (!legacy_binding) - ret = poweroff_coreid(core, coreid_mask); - + else core_clks_disable(core); - } return ret; } @@ -786,6 +944,7 @@ static const struct venus_pm_ops pm_ops_v4 = { .venc_get = venc_get_v4, .venc_put = venc_put_v4, .venc_power = venc_power_v4, + .coreid_power = coreid_power_v4, .load_scale = load_scale_v4, }; diff --git a/drivers/media/platform/qcom/venus/pm_helpers.h b/drivers/media/platform/qcom/venus/pm_helpers.h index d98b6dc20740..aa2f6afa2354 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.h +++ b/drivers/media/platform/qcom/venus/pm_helpers.h @@ -21,6 +21,8 @@ struct venus_pm_ops { void (*venc_put)(struct device *dev); int (*venc_power)(struct device *dev, int on); + int (*coreid_power)(struct venus_inst *inst, int on); + int (*load_scale)(struct venus_inst *inst); }; @@ -36,4 +38,28 @@ static inline int venus_pm_load_scale(struct venus_inst *inst) return core->pm_ops->load_scale(inst); } +static inline int venus_pm_acquire_core(struct venus_inst *inst) +{ + struct venus_core *core = inst->core; + const struct venus_pm_ops *pm_ops = core->pm_ops; + int ret = 0; + + if (pm_ops && pm_ops->coreid_power) + ret = pm_ops->coreid_power(inst, POWER_ON); + + return ret; +} + +static inline int venus_pm_release_core(struct venus_inst *inst) +{ + struct venus_core *core = inst->core; + const struct venus_pm_ops *pm_ops = core->pm_ops; + int ret = 0; + + if (pm_ops && pm_ops->coreid_power) + ret = pm_ops->coreid_power(inst, POWER_OFF); + + return ret; +} + #endif diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index 83ce30516591..7b7a4f3377cf 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -579,10 +579,6 @@ static int vdec_output_conf(struct venus_inst *inst) if (ret) return ret; - ret = venus_helper_set_core_usage(inst, VIDC_CORE_ID_1); - if (ret) - return ret; - if (core->res->hfi_version == HFI_VERSION_1XX) { ptype = HFI_PROPERTY_PARAM_VDEC_CONTINUE_DATA_TRANSFER; ret = hfi_session_set_property(inst, ptype, &en); @@ -951,6 +947,10 @@ static int vdec_start_streaming(struct vb2_queue *q, unsigned int count) mutex_lock(&inst->lock); + ret = venus_pm_acquire_core(inst); + if (ret) + return ret; + if (q->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) ret = vdec_start_capture(inst); else @@ -1078,6 +1078,7 @@ static void vdec_session_release(struct venus_inst *inst) venus_helper_free_dpb_bufs(inst); venus_pm_load_scale(inst); + venus_pm_release_core(inst); INIT_LIST_HEAD(&inst->registeredbufs); mutex_unlock(&inst->lock); @@ -1337,6 +1338,8 @@ static int vdec_open(struct file *file) inst->num_output_bufs = 1; inst->codec_state = VENUS_DEC_STATE_DEINIT; inst->buf_count = 0; + inst->clk_data.core_id = VIDC_CORE_ID_DEFAULT; + inst->core_acquired = false; init_waitqueue_head(&inst->reconf_wait); venus_helper_init_instance(inst); diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c index 5fa1724cb537..4f594fe4b661 100644 --- a/drivers/media/platform/qcom/venus/venc.c +++ b/drivers/media/platform/qcom/venus/venc.c @@ -656,10 +656,6 @@ static int venc_set_properties(struct venus_inst *inst) if (ret) return ret; - ret = venus_helper_set_core_usage(inst, VIDC_CORE_ID_2); - if (ret) - return ret; - ptype = HFI_PROPERTY_CONFIG_FRAME_RATE; frate.buffer_type = HFI_BUFFER_OUTPUT; frate.framerate = inst->fps * (1 << 16); @@ -992,6 +988,10 @@ static int venc_start_streaming(struct vb2_queue *q, unsigned int count) if (ret) goto bufs_done; + ret = venus_pm_acquire_core(inst); + if (ret) + goto deinit_sess; + ret = venc_set_properties(inst); if (ret) goto deinit_sess; @@ -1160,6 +1160,8 @@ static int venc_open(struct file *file) inst->core = core; inst->session_type = VIDC_SESSION_TYPE_ENC; + inst->clk_data.core_id = VIDC_CORE_ID_DEFAULT; + inst->core_acquired = false; venus_helper_init_instance(inst); From patchwork Wed Dec 18 13:22:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 182002 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp646739ile; Wed, 18 Dec 2019 05:24:11 -0800 (PST) X-Google-Smtp-Source: APXvYqwumW9/nt3e2z/dpEgWOwpycT51IHaGvgOu5Uejfa3JnFr0IoZyK575XA/aw9u9x1XfhXr/ X-Received: by 2002:a9d:4692:: with SMTP id z18mr2515091ote.163.1576675451437; Wed, 18 Dec 2019 05:24:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576675451; cv=none; d=google.com; s=arc-20160816; b=zWdwCwIHK4VdJvB4rVJsvKXbDWnmeBmGyKdp7xq6oVfeJLwd+uKgy8yS3VCpcyswAt b7+erbsIY+u/pIJfOcpD0NVZG7ZCsKmytooK0cXd9yBi9BP9ImVNJRtJZ1ONhnzRj2Vy wIIHNaUUbw64/YTMCJuT3Q+MupNacr3mPDkmS1JdCsNfJfe8nQyh9BjKALAvTAG1zgy+ UexMosNvy/qpBqhFv21X0zW2UEiXU3iQxfrCD4n2LzQiK6plQm+5ShxDoAgvD2I0Br9m 6KV8DN88UOFqLliPhgJRaYwaIQvYipfPdkO+2hQyyIWmLnFYSk5RbePiDu/91KbSYfos oH6w== 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; bh=uwOaY4uZyAiVBXTrHS/QGxhnoJkW9mn9qhM7V3ufkpk=; b=OUKBZWW8TGib8vPyaqzVl6H/clRHXXevL0mXtTZgTjuefwyU3p5NUHCI1KLlzdgTFP VPUDjcsDX4m03pS4g3ldPZb5cjuccRQzxnmVyMy/Lw5Z1643Qlt78mfUsIUltXBWpyKe Y5ggY9tO86PfrmtApdvpPSHGMhapQfYev4KDRurRj7cMy5By+6i0ihSev/YIy4rgz213 CDT2aL3A1IOKUYZGRhyuX0O907xqRO3Mg1zRvEf0xgM7jejNSM47cqPXFwKgJHF+jLcx 37mPkQqwpa3ONc8vckMJDpx0VQD7LRDIV91ktUbDZw2EujKToGLnSnPNJAGlNbcvRcZ6 TkTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uJrRYfpV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (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 p3si1359165otk.154.2019.12.18.05.24.11; Wed, 18 Dec 2019 05:24:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uJrRYfpV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727324AbfLRNYJ (ORCPT + 27 others); Wed, 18 Dec 2019 08:24:09 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:44223 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727283AbfLRNYI (ORCPT ); Wed, 18 Dec 2019 08:24:08 -0500 Received: by mail-lj1-f193.google.com with SMTP id u71so2110121lje.11 for ; Wed, 18 Dec 2019 05:24:06 -0800 (PST) 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=uwOaY4uZyAiVBXTrHS/QGxhnoJkW9mn9qhM7V3ufkpk=; b=uJrRYfpVOhj3ls8G4ukNtbhiVo5QGZkcZVMdUNb+lIYx1q7wt8XK35NKZ9hlRJ5sfu TwP7KGVSC7XP2zPFzecy0r7TT/zNuDIO8f00Wog2cpz/cFWOTcxg+IXGArbZTTufwPUp ROHzVIP+jr4QIiD0xQsvIfnzRYWkVN7kN+3VMNBIUFPTweTIlaC4tDhaYx3SRPqldN+/ ydsnr2AcdUTPHGCUdzAKzR0DWinmTkNpEtEkvjo3FII7OGwa6O4B7Az2X499DRUMF6M7 3hh4YQQpO/izxQjh58WcwzisLI/amztCP3vCLefEh1Hq8bTa6g+XlV+U9Q83BmbUh+8/ Sp2A== 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=uwOaY4uZyAiVBXTrHS/QGxhnoJkW9mn9qhM7V3ufkpk=; b=kJ3yxCyevCrVlYhfZSCFECppxHu6wDACqBASjWf/8YVOsXoT98kOmpCpVhEwFkV+qO vLxggO6ejiaum/yY3s09KOmc6eqshfmlw/7dJw1RNiCosUDadyDA6SnfONAiG1kV+ZTX YTi370H8YLmzJBBqcY0qMehvLh7/g5nyomBJITQfJ25yUcMrePQIwmmsBgImajPPeTIX mAmeW1ssUceqntRleqc4JnioFEg/PZTIRU7AQWtKsRe65D7XoVFKiG+wr4ksO/ogewEW Zq41XnNb2BDyLeRkc/riuRdIWmSrYvmqkmusGi4raWMDGSi/1evkZex27dFIbMKVAZlc XVHA== X-Gm-Message-State: APjAAAV88WnaDf4lkDp5HCqvNX0Q+bfU0S5N4bGWnSG3p7CKF9txj71j PESRCfQPiNssVugQXxAky/ablA== X-Received: by 2002:a2e:7f08:: with SMTP id a8mr1694392ljd.164.1576675445780; Wed, 18 Dec 2019 05:24:05 -0800 (PST) Received: from localhost.localdomain ([37.157.136.193]) by smtp.gmail.com with ESMTPSA id z7sm1440667lfa.81.2019.12.18.05.24.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Dec 2019 05:24:05 -0800 (PST) From: Stanimir Varbanov To: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org Cc: Vikash Garodia , dikshita@codeaurora.org, Aniket Masule , Stanimir Varbanov Subject: [PATCH v2 05/12] media: venus: vdec: handle 10bit bitstreams Date: Wed, 18 Dec 2019 15:22:44 +0200 Message-Id: <20191218132251.24161-6-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191218132251.24161-1-stanimir.varbanov@linaro.org> References: <20191218132251.24161-1-stanimir.varbanov@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Aniket Masule Handle 10bit video streams in the decoder by using dithering, i.e the decoder output buffers will be in 8bit format. The runtime handling is implemented by sending v4l2 event to userspace application, then the application should stop the streaming on capture queue and initiate format negotiation, and start streaming again. Signed-off-by: Aniket Masule Co-developed-by: Stanimir Varbanov Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/core.h | 1 + drivers/media/platform/qcom/venus/helpers.c | 97 +++++++++++++++++++ .../media/platform/qcom/venus/hfi_helper.h | 5 + drivers/media/platform/qcom/venus/vdec.c | 8 +- 4 files changed, 110 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h index bfbd4a1ba089..55bdeda780bc 100644 --- a/drivers/media/platform/qcom/venus/core.h +++ b/drivers/media/platform/qcom/venus/core.h @@ -382,6 +382,7 @@ struct venus_inst { u32 session_type; union hfi_get_property hprop; unsigned int core_acquired: 1; + unsigned int bit_depth; }; #define IS_V1(core) ((core)->res->hfi_version == HFI_VERSION_1XX) diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index 043e0d8705a8..a29662405e3a 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -626,6 +626,76 @@ static u32 get_framesize_raw_nv12_ubwc(u32 width, u32 height) max(extradata, y_stride * 48), SZ_4K); } +static u32 get_framesize_raw_p010(u32 width, u32 height) +{ + u32 y_plane, uv_plane, y_stride, uv_stride, y_sclines, uv_sclines; + + y_stride = ALIGN(width * 2, 256); + uv_stride = ALIGN(width * 2, 256); + y_sclines = ALIGN(height, 32); + uv_sclines = ALIGN((height + 1) >> 1, 16); + y_plane = y_stride * y_sclines; + uv_plane = uv_stride * uv_sclines; + + return ALIGN((y_plane + uv_plane), SZ_4K); +} + +static u32 get_framesize_raw_p010_ubwc(u32 width, u32 height) +{ + u32 y_stride, uv_stride, y_sclines, uv_sclines; + u32 y_ubwc_plane, uv_ubwc_plane; + u32 y_meta_stride, y_meta_scanlines; + u32 uv_meta_stride, uv_meta_scanlines; + u32 y_meta_plane, uv_meta_plane; + u32 size; + + y_stride = ALIGN(width * 2, 256); + uv_stride = ALIGN(width * 2, 256); + y_sclines = ALIGN(height, 16); + uv_sclines = ALIGN((height + 1) >> 1, 16); + + y_ubwc_plane = ALIGN(y_stride * y_sclines, SZ_4K); + uv_ubwc_plane = ALIGN(uv_stride * uv_sclines, SZ_4K); + y_meta_stride = ALIGN(DIV_ROUND_UP(width, 32), 64); + y_meta_scanlines = ALIGN(DIV_ROUND_UP(height, 4), 16); + y_meta_plane = ALIGN(y_meta_stride * y_meta_scanlines, SZ_4K); + uv_meta_stride = ALIGN(DIV_ROUND_UP((width + 1) >> 1, 16), 64); + uv_meta_scanlines = ALIGN(DIV_ROUND_UP((height + 1) >> 1, 4), 16); + uv_meta_plane = ALIGN(uv_meta_stride * uv_meta_scanlines, SZ_4K); + + size = y_ubwc_plane + uv_ubwc_plane + y_meta_plane + uv_meta_plane; + + return ALIGN(size, SZ_4K); +} + +static u32 get_framesize_raw_yuv420_tp10_ubwc(u32 width, u32 height) +{ + u32 y_stride, uv_stride, y_sclines, uv_sclines; + u32 y_ubwc_plane, uv_ubwc_plane; + u32 y_meta_stride, y_meta_scanlines; + u32 uv_meta_stride, uv_meta_scanlines; + u32 y_meta_plane, uv_meta_plane; + u32 size; + + y_stride = ALIGN(ALIGN(width, 192) * 4 / 3, 256); + uv_stride = ALIGN(ALIGN(width, 192) * 4 / 3, 256); + y_sclines = ALIGN(height, 16); + uv_sclines = ALIGN((height + 1) >> 1, 16); + + y_ubwc_plane = ALIGN(y_stride * y_sclines, SZ_4K); + uv_ubwc_plane = ALIGN(uv_stride * uv_sclines, SZ_4K); + y_meta_stride = ALIGN(DIV_ROUND_UP(width, 48), 64); + y_meta_scanlines = ALIGN(DIV_ROUND_UP(height, 4), 16); + y_meta_plane = ALIGN(y_meta_stride * y_meta_scanlines, SZ_4K); + uv_meta_stride = ALIGN(DIV_ROUND_UP((width + 1) >> 1, 24), 64); + uv_meta_scanlines = ALIGN(DIV_ROUND_UP((height + 1) >> 1, 4), 16); + uv_meta_plane = ALIGN(uv_meta_stride * uv_meta_scanlines, SZ_4K); + + size = y_ubwc_plane + uv_ubwc_plane + y_meta_plane + uv_meta_plane; + + return ALIGN(size, SZ_4K); +} + u32 venus_helper_get_framesz_raw(u32 hfi_fmt, u32 width, u32 height) { switch (hfi_fmt) { @@ -634,6 +704,12 @@ u32 venus_helper_get_framesz_raw(u32 hfi_fmt, u32 width, u32 height) return get_framesize_raw_nv12(width, height); case HFI_COLOR_FORMAT_NV12_UBWC: return get_framesize_raw_nv12_ubwc(width, height); + case HFI_COLOR_FORMAT_P010: + return get_framesize_raw_p010(width, height); + case HFI_COLOR_FORMAT_P010_UBWC: + return get_framesize_raw_p010_ubwc(width, height); + case HFI_COLOR_FORMAT_YUV420_TP10_UBWC: + return get_framesize_raw_yuv420_tp10_ubwc(width, height); default: return 0; } @@ -1235,6 +1311,27 @@ int venus_helper_get_out_fmts(struct venus_inst *inst, u32 v4l2_fmt, if (!caps) return -EINVAL; + if (inst->bit_depth == VIDC_BITDEPTH_10 && + inst->session_type == VIDC_SESSION_TYPE_DEC) { + found_ubwc = + find_fmt_from_caps(caps, HFI_BUFFER_OUTPUT, + HFI_COLOR_FORMAT_YUV420_TP10_UBWC); + found = find_fmt_from_caps(caps, HFI_BUFFER_OUTPUT2, + HFI_COLOR_FORMAT_NV12); + if (found_ubwc && found) { + /* + * Hard-code DPB buffers to be 10bit UBWC and decoder + * output buffers in 8bit NV12 until V4L2 is able to + * expose compressed/tiled formats to applications. + */ + *out_fmt = HFI_COLOR_FORMAT_YUV420_TP10_UBWC; + *out2_fmt = HFI_COLOR_FORMAT_NV12; + return 0; + } + + return -EINVAL; + } + if (ubwc) { ubwc_fmt = fmt | HFI_COLOR_FORMAT_UBWC_BASE; found_ubwc = find_fmt_from_caps(caps, HFI_BUFFER_OUTPUT, diff --git a/drivers/media/platform/qcom/venus/hfi_helper.h b/drivers/media/platform/qcom/venus/hfi_helper.h index 2a47f6c0a07a..0b4597c73fb5 100644 --- a/drivers/media/platform/qcom/venus/hfi_helper.h +++ b/drivers/media/platform/qcom/venus/hfi_helper.h @@ -793,6 +793,9 @@ struct hfi_h264_vui_timing_info { u32 time_scale; }; +#define VIDC_BITDEPTH_8 0 +#define VIDC_BITDEPTH_10 1 + struct hfi_bit_depth { u32 buffer_type; u32 bit_depth; @@ -841,8 +844,10 @@ struct hfi_extradata_input_crop { #define HFI_COLOR_FORMAT_10_BIT_BASE 0x4000 #define HFI_COLOR_FORMAT_YUV420_TP10 0x4002 +#define HFI_COLOR_FORMAT_P010 0x4003 #define HFI_COLOR_FORMAT_NV12_UBWC 0x8002 #define HFI_COLOR_FORMAT_YUV420_TP10_UBWC 0xc002 +#define HFI_COLOR_FORMAT_P010_UBWC 0xc003 #define HFI_COLOR_FORMAT_RGBA8888_UBWC 0x8010 struct hfi_uncompressed_format_select { diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index 7b7a4f3377cf..eeff0d8e46b2 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -1172,7 +1172,7 @@ static void vdec_buf_done(struct venus_inst *inst, unsigned int buf_type, static void vdec_event_change(struct venus_inst *inst, struct hfi_event_data *ev_data, bool sufficient) { - static const struct v4l2_event ev = { + struct v4l2_event ev = { .type = V4L2_EVENT_SOURCE_CHANGE, .u.src_change.changes = V4L2_EVENT_SRC_CH_RESOLUTION }; struct device *dev = inst->core->dev_dec; @@ -1193,6 +1193,11 @@ static void vdec_event_change(struct venus_inst *inst, inst->out_width = ev_data->width; inst->out_height = ev_data->height; + if (inst->bit_depth != ev_data->bit_depth) { + inst->bit_depth = ev_data->bit_depth; + ev.u.src_change.changes |= V4L2_EVENT_SRC_CH_COLOR_DEPTH; + } + dev_dbg(dev, "event %s sufficient resources (%ux%u)\n", sufficient ? "" : "not", ev_data->width, ev_data->height); @@ -1340,6 +1345,7 @@ static int vdec_open(struct file *file) inst->buf_count = 0; inst->clk_data.core_id = VIDC_CORE_ID_DEFAULT; inst->core_acquired = false; + inst->bit_depth = VIDC_BITDEPTH_8; init_waitqueue_head(&inst->reconf_wait); venus_helper_init_instance(inst); From patchwork Wed Dec 18 13:22:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 182003 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp646781ile; Wed, 18 Dec 2019 05:24:13 -0800 (PST) X-Google-Smtp-Source: APXvYqw24t6RcWER0OtFqC4reK5dRKNo3aQm4iqqhH9KSLx2XgPfYnWRqE0Iyjk2o+FrJ/r3hPf7 X-Received: by 2002:aca:f1c2:: with SMTP id p185mr201853oih.87.1576675453174; Wed, 18 Dec 2019 05:24:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576675453; cv=none; d=google.com; s=arc-20160816; b=fX9KoW6pZAH1PkiUwc7lA7BI2jaHTdEylo/W0dMC3kaVvH7Bp4x64U0RYbFvN6HC9w C5k9ijtgEdLNVxoeGYXTnTihFNZBbC52X9N6gWFLKSI3FDTYd5qCwUiYuB07gL83pMP1 R56fstTWXTFVHXOkyQ0NtuWy/tTXk/Xf10/f/t+7iPTxfSAFdCvNBk0hgbS1LU6Deq0p /LFWSfwZV/HRnhnK7cywTek64G+eYA2PX+WtBIqLTiRDU8lLjvWSCuUK2jrxcn0EBHKz Lj2l54OqWaa9NkUOTeRRtmFUaJuKsrpANFBbKkbFwYWUABqpCDmUdZR0itPX6LFGcvC9 pqMA== 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; bh=elchFhZaQqCljObbrVWX5gAwlUOkHif5wtGb7OTNVrQ=; b=LF4A4i0/psJXNpBwCPIhWZ2eBIR6T+xhsrVe4X1FbiWqK/Rg3vNsvf7swYTDt51wnN 3VQNWOm2i/rnOXVNj/gfl1iey9rgG4m2kGf4nj1WXWUflHhQqQ9qHFw/a1QZTY/6tOGu /xscC01k+4Axv8+vs3XO5yUflchObuY4tilglnOg9YWaj5K4fBNqgFjT8h1g8hVqLCKN /ZKJeNNv8s553lvF/cbE8WphB+NGyCh0FyO0d5hTa5uOdy8izlIn4bE8pr0xQvv4I8O2 0JFe2ab8dy/S/m4+VB48L6WjTzp4duzEtaoNQutinS61R3JN+bNy4sth2IddbSaQOLvC 1DsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Sd9/Owv7"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (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 t18si1408196oij.133.2019.12.18.05.24.12; Wed, 18 Dec 2019 05:24:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Sd9/Owv7"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727345AbfLRNYK (ORCPT + 27 others); Wed, 18 Dec 2019 08:24:10 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:37320 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727097AbfLRNYJ (ORCPT ); Wed, 18 Dec 2019 08:24:09 -0500 Received: by mail-lj1-f194.google.com with SMTP id u17so2125388lja.4 for ; Wed, 18 Dec 2019 05:24:08 -0800 (PST) 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=elchFhZaQqCljObbrVWX5gAwlUOkHif5wtGb7OTNVrQ=; b=Sd9/Owv7c4QCll0EOO34jDhL1TvjTR3zg7RdBLhRq2l9YNY56Z+nkVsfGhAhPnTr6W kXP2Qpq3mdlhErLzCofHRUpBbfac4KpS4c9LIe3R98MVHNJajyGzDZkrQrJMvb78uhqH xi3PG1w3+dH1997lQCiCT4GEf/4WgV84185mRRfolgRVgTgZWEunmprO17CqINodLAKC 8orR+BZQHIyN6J9tLaUChiggcnED4oLFTZ+6g0AF+RFlLxX5ND9kjKhmDX81y27rjsBu V+CNNTZT7nWL8o7OhwUQJ/4zP7XhgwA0RFdsiIUo8WsskKxMSB24ZC46t1K7EiHXeWyF 57qA== 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=elchFhZaQqCljObbrVWX5gAwlUOkHif5wtGb7OTNVrQ=; b=gLjwE3YffwXUV8R8ACsh7oJ6aC/wKUoD7MKlKrch7g0ODxrpbauXzWiodIzFocnR31 iWvtMdUB6P2PdrNmtPudP1Gzxw6RDIiEiAj44WHkcUekWchtBkeIEcI84igBYYrdNXmz x03XpADahTlO9G/tOlP2cvIpLtUCaN6vYLyqC9g8oW+6mUFdtrwerb4qBqeLz3x1gink mDiHYGlVH65jakKAQP0BNsBDpocCyMjS2pNU8DTspBRIDu5iozN1ac60C2D58flH9OwF a5RY1giGSAwrj/PkNOPNxDxjSxLnTMwkgilVt6VkFi7P+RguiLebjOnyBA91RCatw6xl emfQ== X-Gm-Message-State: APjAAAWyEOUaH2CxTJWgEJqyAfD0gkDLAPROYP9LA7GvNNaxId0iqkNN NhxMyKz3ndvscKr1TytjnglUJg== X-Received: by 2002:a2e:999a:: with SMTP id w26mr1783354lji.142.1576675447780; Wed, 18 Dec 2019 05:24:07 -0800 (PST) Received: from localhost.localdomain ([37.157.136.193]) by smtp.gmail.com with ESMTPSA id z7sm1440667lfa.81.2019.12.18.05.24.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Dec 2019 05:24:07 -0800 (PST) From: Stanimir Varbanov To: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org Cc: Vikash Garodia , dikshita@codeaurora.org, Stanimir Varbanov Subject: [PATCH v2 06/12] dt-bindings: media: venus: Convert msm8916 to DT schema Date: Wed, 18 Dec 2019 15:22:45 +0200 Message-Id: <20191218132251.24161-7-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191218132251.24161-1-stanimir.varbanov@linaro.org> References: <20191218132251.24161-1-stanimir.varbanov@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Convert qcom,msm8916-venus Venus binding to DT schema Signed-off-by: Stanimir Varbanov --- .../bindings/media/qcom,venus-msm8916.yaml | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/qcom,venus-msm8916.yaml -- 2.17.1 diff --git a/Documentation/devicetree/bindings/media/qcom,venus-msm8916.yaml b/Documentation/devicetree/bindings/media/qcom,venus-msm8916.yaml new file mode 100644 index 000000000000..f82a8d968202 --- /dev/null +++ b/Documentation/devicetree/bindings/media/qcom,venus-msm8916.yaml @@ -0,0 +1,115 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) + +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/media/qcom,venus-msm8916.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: Qualcomm Venus video encode and decode accelerators + +maintainers: + - Stanimir Varbanov + +description: | + The Venus IP is a video encode and decode accelerator present + on Qualcomm platforms + +properties: + compatible: + enum: + - qcom,msm8916-venus + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + power-domains: + maxItems: 1 + + clocks: + maxItems: 3 + + clock-names: + maxItems: 3 + items: + - const: core + - const: iface + - const: bus + + iommus: + minItems: 1 + maxItems: 20 + + memory-region: + maxItems: 1 + + video-decoder: + type: object + + properties: + compatible: + const: "venus-decoder" + + required: + - compatible + + video-encoder: + type: object + + properties: + compatible: + const: "venus-encoder" + + required: + - compatible + + video-firmware: + type: object + + description: | + Firmware subnode is needed when the platform does not + have TrustZone. + + properties: + iommus: + minItems: 1 + +required: + - compatible + - reg + - interrupts + - power-domains + - clocks + - clock-names + - iommus + - memory-region + - video-decoder + - video-encoder + +examples: + - | + #include + #include + + video-codec@1d00000 { + compatible = "qcom,msm8916-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"; + }; + + video-encoder { + compatible = "venus-encoder"; + }; + }; From patchwork Wed Dec 18 13:22:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 182005 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp646863ile; Wed, 18 Dec 2019 05:24:16 -0800 (PST) X-Google-Smtp-Source: APXvYqyFVuRBXV8res8cMO40K/j1HYXHG7s8+g8ddISAzWAzW6EOnXMxXKx8TeI/hs2jBt3qRuTP X-Received: by 2002:a05:6830:2111:: with SMTP id i17mr2484077otc.24.1576675456590; Wed, 18 Dec 2019 05:24:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576675456; cv=none; d=google.com; s=arc-20160816; b=tlKlm35CndmLzWXdfLUr5Qtk/xos7lSX6GSFWgeEoBTKg5nKr0eY6NsaXl+3fesX0z KgA05ZiwULdH2i/cUNTJdVMM7eeyoEmn7RVk1qPBEk1lZX1yH6JIIxGGpr0dVMMojmD3 3KkFuRnb5CNN9E32LrQyzXnzdWGBL0KyNaZFGUnExpNz+pz6/FrxIRdbr1tbwSmy+Bd6 KxbotnQtZaw44Xkbi+sbFrde2Hoh7PuqEQAtRs4dj7ZcxQ9evlTXP596EpqXBbAkBIRe RQnef3/Zb1j4iUxdQLG+iZrTB/sBBFxrOHCNI/NfPj2+T8uH+rQSQeFRHmivg5H7s42U Y2CA== 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; bh=2E0JQXe1pZot4z3LbYAnlOx/3QufFKC+hmq2Am0jK/U=; b=zKGVnqT0UNncwXkv5q+TtMJqLLJRGNp+xk4g6rAuS9J3TXGl21EYbi7/+8rDsUChuv zSSGRy4VQKCO5bcfHvca7PPRRK2VM0UJ/4eMOMPF2CsHoTViylKR37WxkKlIXyGy9gl8 RezvYN1P3DiurIV9CB4h39529PdHt69lRjbG0wySik0KpXgQ1jWCKECD6mJE4+cm8zVW DC0ABiXLDlt3XvmvdEfax+TzGe3PRgTg4QtkNjMU1i5Sx/Q0lTEIKQiC6SIuslHvU4ty fkyRWB4x2Wqw3E7lJsLSK0pyIgNom5TgL4v2WR2N2EvEpMnuRaMUW87ocny8Ts9Bl0zA T8xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=w5Aojco+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (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 p7si1476228otk.81.2019.12.18.05.24.16; Wed, 18 Dec 2019 05:24:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=w5Aojco+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727377AbfLRNYO (ORCPT + 27 others); Wed, 18 Dec 2019 08:24:14 -0500 Received: from mail-lf1-f66.google.com ([209.85.167.66]:45385 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727329AbfLRNYL (ORCPT ); Wed, 18 Dec 2019 08:24:11 -0500 Received: by mail-lf1-f66.google.com with SMTP id 203so1664125lfa.12 for ; Wed, 18 Dec 2019 05:24:10 -0800 (PST) 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=2E0JQXe1pZot4z3LbYAnlOx/3QufFKC+hmq2Am0jK/U=; b=w5Aojco+S485wwfMKoZYKx1/YAGbrjcHffhqg5wrUy0veQzYYvwH6nkaP0DZhuhwdX 5W0JM5FNURjEYxLMd0w47qOEdmcwb5J9rBkTtlKs7ce+ZXmuyhWs6dgkGgQZKApYx20l ZcVcQWOOHm4cSSKvAcML1OVnYWD1uz0WDFPsg6QsdVJXp51VetZPRA6vfIZ3AVgCY3nY bXc7rnlkMqxpaMufndiG3vnB9ASdOA01Og0jgS3ILJwYrYG3jah+LcbhTxLnHyTU6VH3 AnxfrBw0W9mDh0UB40tG3lWXY2PW6u4Ub2Fdm3StDn2hODcC9hX19SaQzGM/uj9ZBIW+ R8+g== 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=2E0JQXe1pZot4z3LbYAnlOx/3QufFKC+hmq2Am0jK/U=; b=Ge7m4tbbKM6jV0Iy26Chv84w/qWNph+vdOnCIi7gfS+zrVVcRuA2Nbg0XWIQw1bP5S 8Y5dtBYtBwKXvGpTLQ2eJdhPz562Ot4SLdcbpwUc5DOlvwPR0xCk0bQkaLEeH2MmdVE8 Ws8n5pYahrlFemaLyhg7jd8/+7IDsBqxEFo/1TxAUBB6bfart4xVq9aW2I67ltqJkkff yQCn/tAIw9p5rRnuo5xmB/4qMSKcf4o6ShAE3AqOpJ/ycEMvlZm5HBdQlrgzYhDPZj9H ANK5NV19l8GcAxRcviCzYhwJGaMZdcvHvzCu3pHZgNKVmxC1Vx9YGuDUspmL3n7CgJNN iNbA== X-Gm-Message-State: APjAAAXPBLK2fUb7Pj+gGz0eSI1OrNfAekkjW4nmGyQzmPGbO96qhIxm FlqCmMWt5xFDdvt4qRADNghrhg== X-Received: by 2002:a19:4a12:: with SMTP id x18mr1712471lfa.158.1576675449583; Wed, 18 Dec 2019 05:24:09 -0800 (PST) Received: from localhost.localdomain ([37.157.136.193]) by smtp.gmail.com with ESMTPSA id z7sm1440667lfa.81.2019.12.18.05.24.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Dec 2019 05:24:09 -0800 (PST) From: Stanimir Varbanov To: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org Cc: Vikash Garodia , dikshita@codeaurora.org, Stanimir Varbanov Subject: [PATCH v2 07/12] dt-bindings: media: venus: Convert msm8996 to DT schema Date: Wed, 18 Dec 2019 15:22:46 +0200 Message-Id: <20191218132251.24161-8-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191218132251.24161-1-stanimir.varbanov@linaro.org> References: <20191218132251.24161-1-stanimir.varbanov@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Convert qcom,msm8996-venus Venus binding to DT schema. Signed-off-by: Stanimir Varbanov --- .../bindings/media/qcom,venus-msm8996.yaml | 139 ++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/qcom,venus-msm8996.yaml -- 2.17.1 diff --git a/Documentation/devicetree/bindings/media/qcom,venus-msm8996.yaml b/Documentation/devicetree/bindings/media/qcom,venus-msm8996.yaml new file mode 100644 index 000000000000..8dd852aa0d25 --- /dev/null +++ b/Documentation/devicetree/bindings/media/qcom,venus-msm8996.yaml @@ -0,0 +1,139 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) + +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/media/qcom,venus-msm8996.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: Qualcomm Venus video encode and decode accelerators + +maintainers: + - Stanimir Varbanov + +description: | + The Venus IP is a video encode and decode accelerator present + on Qualcomm platforms + +properties: + compatible: + enum: + - qcom,msm8996-venus + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + power-domains: + maxItems: 1 + + clocks: + maxItems: 4 + + clock-names: + maxItems: 4 + items: + - const: core + - const: iface + - const: bus + - const: mbus + + iommus: + minItems: 1 + maxItems: 20 + + memory-region: + maxItems: 1 + + video-decoder: + type: object + + properties: + compatible: + const: "venus-decoder" + + clocks: + maxItems: 1 + + clock-names: + maxItems: 1 + items: + - const: core + + required: + - compatible + + video-encoder: + type: object + + properties: + compatible: + const: "venus-encoder" + + clocks: + maxItems: 1 + + clock-names: + maxItems: 1 + items: + - const: core + + required: + - compatible + + video-firmware: + type: object + + description: | + Firmware subnode is needed when the platform does not + have TrustZone. + + properties: + iommus: + minItems: 1 + +required: + - compatible + - reg + - interrupts + - power-domains + - clocks + - clock-names + - iommus + - memory-region + - video-decoder + - video-encoder + +examples: + - | + #include + #include + + video-codec@c00000 { + compatible = "qcom,msm8996-venus"; + reg = <0x00c00000 0xff000>; + interrupts = ; + clocks = <&mmcc VIDEO_CORE_CLK>, + <&mmcc VIDEO_AHB_CLK>, + <&mmcc VIDEO_AXI_CLK>, + <&mmcc VIDEO_MAXI_CLK>; + clock-names = "core", "iface", "bus", "mbus"; + power-domains = <&mmcc VENUS_GDSC>; + iommus = <&iommu 0>; + memory-region = <&venus_mem>; + + video-decoder { + compatible = "venus-decoder"; + clocks = <&mmcc VIDEO_SUBCORE0_CLK>; + clock-names = "core"; + power-domains = <&mmcc VENUS_CORE0_GDSC>; + }; + + video-encoder { + compatible = "venus-encoder"; + clocks = <&mmcc VIDEO_SUBCORE1_CLK>; + clock-names = "core"; + power-domains = <&mmcc VENUS_CORE1_GDSC>; + }; + }; From patchwork Wed Dec 18 13:22:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 182006 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp646926ile; Wed, 18 Dec 2019 05:24:19 -0800 (PST) X-Google-Smtp-Source: APXvYqw9k5HEkYG+RFWk8yRbL/iy0SK682zrUo8QQ1HLkEg7JLQMLQw50CoTwvyUul1l9BWfS0ky X-Received: by 2002:a05:6830:15a:: with SMTP id j26mr2486914otp.137.1576675459730; Wed, 18 Dec 2019 05:24:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576675459; cv=none; d=google.com; s=arc-20160816; b=vfoI+d3obPS1M75JSlTnR/1yudJ5ZQ+WZvF4iTcG6KY42/CuTEdQJRP9Ni7Z+VsOAJ 43Tcrf+mBA7Vssvzn3r5oOsTW3R1nqURloxdmEIVWkVThgZA5iqR0HRyw6SA6l/7jua2 lq5Cby3JwKZIaI4PRE5MkfwrjYUEy4MUIJZDiOxNKLTbi02hiU3jNfv68bgsLhoW6v9a czYJvakLbiY5+XgOQjXp/fTMR/NrbiTEKNUnTEIEhl92MyTpiwg7s+VBT7TQtoDhdL69 KUEkOFnZb+nhQrqyhP9cWsJaDx5xwnGHVAZCaKa2aB6qow3mwoqLDCF3XLeGIgbAf2Jp zdqQ== 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; bh=CITEx26ya518MBT0p0F7PP8DiduXDPXSSgjqESe9/eA=; b=gzLmhjPnnnvzYK8dk6fnyd6OjixriEPfblxq6kylGaUbtyt3HguLGN0IF5T6FeyamL d3KOZoDTvLCAtLtFqiBnRlZsJU/d1gBO6zQhK57/vF8Ap4usjJMUtBDRsb7OqQUBeMV5 s/ZgbhEVIjTc/wksq8E3APnPu/2s5an1p77bZSWmYNIIHnWovhOx/oy6Sp25LOQ+YWp7 /1FTaEcZhaQ5rkTp1mtFR6GVMtM4MIWLZIYzWO4durXhi7CmDTJZZTpKmRmYO1B+ZNii TZ8uRNVrESu+yaVnR/cWunWoE6ZkHt5ZoM0l+oef6bcAPxX17Eukwb7yRYybcKmaw0Y4 KgqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HqqpQIYz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (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 j13si1388285otk.9.2019.12.18.05.24.19; Wed, 18 Dec 2019 05:24:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HqqpQIYz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727415AbfLRNYS (ORCPT + 27 others); Wed, 18 Dec 2019 08:24:18 -0500 Received: from mail-lj1-f195.google.com ([209.85.208.195]:44244 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727329AbfLRNYP (ORCPT ); Wed, 18 Dec 2019 08:24:15 -0500 Received: by mail-lj1-f195.google.com with SMTP id u71so2110566lje.11 for ; Wed, 18 Dec 2019 05:24:14 -0800 (PST) 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=CITEx26ya518MBT0p0F7PP8DiduXDPXSSgjqESe9/eA=; b=HqqpQIYz08yRuwZxJa+FF3HZ+sKTzhV6q+LENhfdzGZPn+Tov0WvsgDJkKRkFGV49N kQWSqMx9DM5GnfkKAntAfBgAeTUICk+BslIpWw9byKAr3Kj9JyV0SLdHuoJqxUEozMu5 FUgVYxCGGL1C0Wtoa8p6kIpeCZP3jCxu3ptDsrS5ObIln+GU4yiyfQaYJvLmpZ7KdKVe bN7OQjgFf2EM3NvejCPXNa6bkMXPQKd+uXNFuApsRkaA7DmDzywZCuWpJTQGjcI7ZYzY OCIyyN0LXc5efjPaFqsuTdEx+rz2HDIuWrtoTnScvjZF/nkT04ADMmYwgoupTV3oEmMO 4j4Q== 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=CITEx26ya518MBT0p0F7PP8DiduXDPXSSgjqESe9/eA=; b=Y5EYyyw2zb2MraKAS005K+P5wYV+OyXOvncTRwrus1WKftI7+j6I6F4F04t4csJcZf mb2Nru6opHJbAIJ+DDhRjN3NVycGax30j44JFCqArv5fyvNbhvbXWgeIBWsiJ0vpmWYx rCMFDAdyybzJLCEZW3HYfPn+4+p14kS05ThaUMrDBpUNpswUVRQT5QJcD4qeylQ7BiIf WNO7HSQrVaghGJ249igYO+PTFhZMs3nhcjWNqqZRHHgA7Mv5xFMuN6TwWqj10lxRxs2k A1b711SybgvBT9F/sskR9FMDSULjl5xeKEJ1qTA0KB/3Jc046m7L0+henwHK8ylT3sbl 8UEg== X-Gm-Message-State: APjAAAWaIt/9G5d0Oa0yTqWdm/bpdbQ9nYMVX7flZPljnKiuneUnurtC ERHWipb+iTLhERKA02y4vNVrGg== X-Received: by 2002:a2e:9886:: with SMTP id b6mr1754928ljj.47.1576675453349; Wed, 18 Dec 2019 05:24:13 -0800 (PST) Received: from localhost.localdomain ([37.157.136.193]) by smtp.gmail.com with ESMTPSA id z7sm1440667lfa.81.2019.12.18.05.24.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Dec 2019 05:24:12 -0800 (PST) From: Stanimir Varbanov To: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org Cc: Vikash Garodia , dikshita@codeaurora.org, Stanimir Varbanov Subject: [PATCH v2 09/12] dt-bindings: media: venus: Add sdm845v2 DT schema Date: Wed, 18 Dec 2019 15:22:48 +0200 Message-Id: <20191218132251.24161-10-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191218132251.24161-1-stanimir.varbanov@linaro.org> References: <20191218132251.24161-1-stanimir.varbanov@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add new qcom,sdm845-venus-v2 DT binding schema. Signed-off-by: Stanimir Varbanov --- .../bindings/media/qcom,venus-sdm845-v2.yaml | 137 ++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/qcom,venus-sdm845-v2.yaml -- 2.17.1 diff --git a/Documentation/devicetree/bindings/media/qcom,venus-sdm845-v2.yaml b/Documentation/devicetree/bindings/media/qcom,venus-sdm845-v2.yaml new file mode 100644 index 000000000000..920cb05d17ce --- /dev/null +++ b/Documentation/devicetree/bindings/media/qcom,venus-sdm845-v2.yaml @@ -0,0 +1,137 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) + +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/media/qcom,venus-sdm845-v2.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: Qualcomm Venus video encode and decode accelerators + +maintainers: + - Stanimir Varbanov + +description: | + The Venus IP is a video encode and decode accelerator present + on Qualcomm platforms + +properties: + compatible: + enum: + - qcom,sdm845-venus-v2 + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + power-domains: + maxItems: 3 + + power-domain-names: + maxItems: 3 + items: + - const: venus + - const: vcodec0 + - const: vcodec1 + + clocks: + maxItems: 7 + + clock-names: + maxItems: 7 + items: + - const: core + - const: iface + - const: bus + - const: vcodec0_core + - const: vcodec0_bus + - const: vcodec1_core + - const: vcodec1_bus + + iommus: + minItems: 1 + maxItems: 20 + + memory-region: + maxItems: 1 + + video-core0: + type: object + + properties: + compatible: + const: "venus-decoder" + + required: + - compatible + + video-core1: + type: object + + properties: + compatible: + const: "venus-encoder" + + required: + - compatible + + video-firmware: + type: object + + description: | + Firmware subnode is needed when the platform does not + have TrustZone. + + properties: + iommus: + minItems: 1 + +required: + - compatible + - reg + - interrupts + - power-domains + - power-domain-names + - clocks + - clock-names + - iommus + - memory-region + - video-core0 + - video-core1 + +examples: + - | + #include + #include + + video-codec@aa00000 { + compatible = "qcom,sdm845-venus-v2"; + reg = <0 0x0aa00000 0 0xff000>; + interrupts = ; + clocks = <&videocc VIDEO_CC_VENUS_CTL_CORE_CLK>, + <&videocc VIDEO_CC_VENUS_AHB_CLK>, + <&videocc VIDEO_CC_VENUS_CTL_AXI_CLK>, + <&videocc VIDEO_CC_VCODEC0_CORE_CLK>, + <&videocc VIDEO_CC_VCODEC0_AXI_CLK>, + <&videocc VIDEO_CC_VCODEC1_CORE_CLK>, + <&videocc VIDEO_CC_VCODEC1_AXI_CLK>; + clock-names = "core", "iface", "bus", + "vcodec0_core", "vcodec0_bus", + "vcodec1_core", "vcodec1_bus"; + power-domains = <&videocc VENUS_GDSC>, + <&videocc VCODEC0_GDSC>, + <&videocc VCODEC1_GDSC>; + power-domain-names = "venus", "vcodec0", "vcodec1"; + iommus = <&apps_smmu 0x10a0 0x8>, + <&apps_smmu 0x10b0 0x0>; + memory-region = <&venus_mem>; + + video-core0 { + compatible = "venus-decoder"; + }; + + video-core1 { + compatible = "venus-encoder"; + }; + }; From patchwork Wed Dec 18 13:22:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 182008 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp647122ile; Wed, 18 Dec 2019 05:24:28 -0800 (PST) X-Google-Smtp-Source: APXvYqy1yWWgvS1jo46pmnqZW9nnfodomFG5Mp/XZWq8iuPVe75cLbleOLFwnsF/JUFaJt02xQnr X-Received: by 2002:a05:6830:1b71:: with SMTP id d17mr2524314ote.42.1576675467952; Wed, 18 Dec 2019 05:24:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576675467; cv=none; d=google.com; s=arc-20160816; b=K010klrYLSL5v3h8UpdUxA3L94Vf7+7Hr8BF+JGspWzvOxEwdXzujI2z1bckWXzFUU yWq4/gxnA7Qa13KB2xFdCUEr0q2vz/e5PuJU5w1+od0Xz9R+I1ftoPSnlTslKRJ86+aX QABM3QI2SLZBNlnGmlqG1ZlH6Y2ThCD8bUvwDDDq8KMe0koeGPn5rYYb5RRI173tAcJD QK4x/AZepSk1PIoe045upGKzqA4MGjH/47yB224x2CzPGkjRh64766YMIRmPsGnXvzqQ V5Paj91wZiqT7K+xFC5VGattSMhl0efTe6Xz0NQrZi2iJ5Zoc9WJJYe1BqT2ovxyQSPs 9Dhg== 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; bh=BGNJV+T/A2yMDmvoIRAZ3Ql5cKw3jiqTHheiep1uASM=; b=RqAz14XbNkVssbHY2mvXiTJqjqXZvo0o3cMDVhqARSXF3JW8YMKnUga7pepfXpJK/d QaB9UWGYIbmfGY+Y6TQR7NgQkHxS+NJ4p85sCE0R1Km9rHCi2iyH7sb4tjsjbrP2vfhM ctUu+VWO1lyThfEI8mIkJHVWg0PQg+RV5TRWPwHwIhK6uE7uo2/xLxK9o96x19v93vLu 9K0salAyXStaaV8IrZ6pRbfU+RDHa9eCUf+QaWalVGN9CqfBH931d0a5YpA3AHq+ca3C IQwjPQVka4hnBDfP0B8xZzFtHXOMXFdXMCFwFrPIfN+Ia3QogaaM9668ZFIBMIa5H3UD uDVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=J38NAh8c; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (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 a29si965558otd.268.2019.12.18.05.24.22; Wed, 18 Dec 2019 05:24:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=J38NAh8c; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727441AbfLRNYV (ORCPT + 27 others); Wed, 18 Dec 2019 08:24:21 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:39843 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727398AbfLRNYS (ORCPT ); Wed, 18 Dec 2019 08:24:18 -0500 Received: by mail-lj1-f193.google.com with SMTP id l2so2123948lja.6 for ; Wed, 18 Dec 2019 05:24:16 -0800 (PST) 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=BGNJV+T/A2yMDmvoIRAZ3Ql5cKw3jiqTHheiep1uASM=; b=J38NAh8cLjcopCFZceQKVt6FktIHUfe2ZgUof7WZnrMfuI60kCOnjz3yElmRclfKZG vZgYh6wiz+yZ9ftGZJ7D8xag4F0Al6nVr7ypbuG2BvMkAZhayhLv2wozZDTY2CLXN+FR xLduJlNN93xj8AlmVAc+xMaPFNtnSUBmNHX3Rv1+ah+QFSfe42AG41hV8leAWSoBpbQf 1ZWhDgy412o8AOIDXNlQkpHsLa9CgvIM9YVjTieApipdS0+fimKwzfyNS6vn6hgCaJHx AwXXjctUO7QuMh91fgZYWsSgsvju4nD+ReOdZ9iNjaud/vuVzchkpuDY9sz6dh4HveeR eMBw== 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=BGNJV+T/A2yMDmvoIRAZ3Ql5cKw3jiqTHheiep1uASM=; b=fmeER6C9Ic/HVfcubJdQyqJqwS1+BBFBFGIJQ81ZS12ziQFSEn7JWePRjaY2Hfr2QA Wb4RrENA3BXoYqfEkvaiCKMeSso3rWKtKgxjqvGcYaYHXpzv0C54J8Pa+JgwCW7UEPh2 Hfvfxpw2AbldVuksv4entw6zLdK4ZA0xLajJ2Nudu3/kVftwqz/x8CefYffrKsplUtNy YM8gFuQ5vRqMAAsBuSrwLfyrJk032bu1Ls8Zw9DrNZJlaXRmUBKRYcBeusRwqGjbnZ65 LK0HtwUXvSeVKEwjgYmItw83s3uYMIHXi17JHx7AtmbWdHOWefwToyQLcunMwrwr/Vun 7i1Q== X-Gm-Message-State: APjAAAXL51R8of0eF6mGGb1dmGArC6Chbj+xwu1jSuaXqIn7L09QBIZl aBJpXkW0CPnFB1G8IxCli2h9Xw== X-Received: by 2002:a2e:800b:: with SMTP id j11mr1613563ljg.126.1576675455853; Wed, 18 Dec 2019 05:24:15 -0800 (PST) Received: from localhost.localdomain ([37.157.136.193]) by smtp.gmail.com with ESMTPSA id z7sm1440667lfa.81.2019.12.18.05.24.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Dec 2019 05:24:15 -0800 (PST) From: Stanimir Varbanov To: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org Cc: Vikash Garodia , dikshita@codeaurora.org, Stanimir Varbanov Subject: [PATCH v2 10/12] venus: core: add sdm845-v2 DT compatible and resource struct Date: Wed, 18 Dec 2019 15:22:49 +0200 Message-Id: <20191218132251.24161-11-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191218132251.24161-1-stanimir.varbanov@linaro.org> References: <20191218132251.24161-1-stanimir.varbanov@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In order to use dynamic video codec assignment add a new sdm845-v2 DT compatible and new venus_resource structure to cover the binding where all pmdomains and clocks are under the venus_core control. Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/core.c | 27 ++++++++++++++++++++++++ 1 file changed, 27 insertions(+) -- 2.17.1 diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index a20ab00a8068..c7525d951e92 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -495,10 +495,37 @@ static const struct venus_resources sdm845_res = { .fwname = "qcom/venus-5.2/venus.mdt", }; +static const struct venus_resources sdm845_res_v2 = { + .freq_tbl = sdm845_freq_table, + .freq_tbl_size = ARRAY_SIZE(sdm845_freq_table), + .bw_tbl_enc = sdm845_bw_table_enc, + .bw_tbl_enc_size = ARRAY_SIZE(sdm845_bw_table_enc), + .bw_tbl_dec = sdm845_bw_table_dec, + .bw_tbl_dec_size = ARRAY_SIZE(sdm845_bw_table_dec), + .codec_freq_data = sdm845_codec_freq_data, + .codec_freq_data_size = ARRAY_SIZE(sdm845_codec_freq_data), + .clks = {"core", "iface", "bus" }, + .clks_num = 3, + .vcodec0_clks = { "vcodec0_core", "vcodec0_bus" }, + .vcodec1_clks = { "vcodec1_core", "vcodec1_bus" }, + .vcodec_clks_num = 2, + .vcodec_pmdomains = { "venus", "vcodec0", "vcodec1" }, + .vcodec_pmdomains_num = 3, + .vcodec_num = 2, + .max_load = 3110400, /* 4096x2160@90 */ + .hfi_version = HFI_VERSION_4XX, + .vmem_id = VIDC_RESOURCE_NONE, + .vmem_size = 0, + .vmem_addr = 0, + .dma_mask = 0xe0000000 - 1, + .fwname = "qcom/venus-5.2/venus.mdt", +}; + static const struct of_device_id venus_dt_match[] = { { .compatible = "qcom,msm8916-venus", .data = &msm8916_res, }, { .compatible = "qcom,msm8996-venus", .data = &msm8996_res, }, { .compatible = "qcom,sdm845-venus", .data = &sdm845_res, }, + { .compatible = "qcom,sdm845-venus-v2", .data = &sdm845_res_v2, }, { } }; MODULE_DEVICE_TABLE(of, venus_dt_match);