Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2068995ybi; Mon, 1 Jul 2019 05:41:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqw4X8nUrDRoVoVJOHppePJoNMgI7WVJnVdQ5bA5Eg7kIx43PuiQ1z/PTNEY+B5YOi4EJITI X-Received: by 2002:a17:902:86:: with SMTP id a6mr29182586pla.244.1561984860445; Mon, 01 Jul 2019 05:41:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561984860; cv=none; d=google.com; s=arc-20160816; b=dS7gZwxCWQIoGmGaEqOqN0SROd3+9DgpfXgMxdw/1eNgRVW/aRpByKw7oOqmroICdl vnPJKyyFF7wSsLl9aOfeYS1z2PuUEsi/buHW+BDqD6BJFDL37oJ/PpzOAX1YkQRPCl9D nB+OjxsIUJmvFGNHEActb8r6vhb9srZRDsrxE5DDLLt3jnauFCUPjaTWuF4Xos3a9+ze 7hrW68+GeIPIsgmg9wFr51WL0hJSugaQuCz7nO5zQVHd///nPMrc5vCNXODHMGb+MyIw y9t1cr+gq3HDONTih1vrqFPHhwoWxXH7Klvg/2DEyEzl0x5KoBlSZiD0JgEFiYHDCzWY JGlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=fgB0TjaeFr88KvhXx4bipObTa6TkqlAFEUSMdvck4Zk=; b=wMCypWbG/f+1AGQo3hVfFRrwuXZzA6B85qoQN5fVRcB2EGdoP7WjcwlQ3Uvd0I75Kq tXnls/cdEVXZdrKB6sOZlR97Cg0gV9Pn4/a7KGwCiD396ye3jy1EJwsF/v9Xyxh9vBLV YsHXtzX6OaCdTW46AyD4PAIUi5Ca7XC+K79NaQtd9UGkoofHlhmoTzybFNCgu3EZtkiE g12YGhva6+/AZipKnn81AQ3v2u8yUn7qPHjhzjYFThlr1nexdzjaTYQJbSnYYZEc33yD X7mTvC0/6HBgTOPN38XdzO/9NrcISlu8LClHOj5IDxIr5pvhlqutkpJ5BsklY0H+pztG vGyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SrGiNLfe; 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 b40si9832547plb.426.2019.07.01.05.40.44; Mon, 01 Jul 2019 05:41:00 -0700 (PDT) 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=SrGiNLfe; 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 S1728626AbfGALnl (ORCPT + 99 others); Mon, 1 Jul 2019 07:43:41 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:45550 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728614AbfGALnl (ORCPT ); Mon, 1 Jul 2019 07:43:41 -0400 Received: by mail-lf1-f67.google.com with SMTP id u10so8530375lfm.12 for ; Mon, 01 Jul 2019 04:43:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=fgB0TjaeFr88KvhXx4bipObTa6TkqlAFEUSMdvck4Zk=; b=SrGiNLfeGiOpYlqK27vCuumQEaX1IERqxpk1bEKh/09cofQu9/CzbAi0cu7Hxhz3wD +vs05zNo/YOtfJCS8kR/yk2cab7zNC4hqxZNtN4wp0Co1jFXvDBMA17cgRmbcSbKqkwT DP+FitOJ+fP27zcNwyJ/OoVJAa+yHjJsXbUvzU+s0J9JOvwGWqB1zWGT4M58FJbp7tDw wGuDaB5nKp4Iz5lSBMVosFTolIfKBG6W6maxBvsjfFMN18lHU/h/GDEZQxvmJpxHNFtV l4yjXb09QuloGm9d39O+RYU8bXTdz7wcgB9R1gBS0LUYlDDFkATO2kWGa//v0EBVJRru KzXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=fgB0TjaeFr88KvhXx4bipObTa6TkqlAFEUSMdvck4Zk=; b=BGRaXmEprMJy7ZQ3yq6eRHL3AcbdEsqOmhh0qiYIWK6ETbT7Vq0PP6E8eDJz47IsQK Wx2Mzu7kJHe1UbjJw/q/k9dOF6OyVJzisGZAAbFH4RVE/vUw8cAQmTSdTHxqp9p4EHXz CAUXsqYvS1DO0H30rXo1U2VPo2tjV8Ht1KsuYD2suHiCqYaHuEHRsvZE/HoPInOk6FlP yUjXzFEhnhix2oPADmxVDCUVuX87OZ2DAUR/oYg3R6ZvfP1XyXHPFDHG5h1XOiHDY06F U/DHwpOUyW6P9gK0wC7h+9S9C+DlWnDEJXfcthipaVwwaD8zZBB35hU+RXj4eJKLAIZh v23g== X-Gm-Message-State: APjAAAU9Ayt5E7zIxJs2VfyKb22xEQazJzQEmreZHnhAX6raLAZIH/4x G3f85Gg7kUt3855Tm1niNq37no5jNHg= X-Received: by 2002:ac2:54ae:: with SMTP id w14mr11361496lfk.124.1561981418228; Mon, 01 Jul 2019 04:43:38 -0700 (PDT) Received: from [192.168.27.209] ([37.157.136.206]) by smtp.googlemail.com with ESMTPSA id j77sm3185246ljb.55.2019.07.01.04.43.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Jul 2019 04:43:37 -0700 (PDT) Subject: Re: [PATCH v3 1/4] media: venus: Add codec data table To: Aniket Masule , linux-media@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, vgarodia@codeaurora.org References: <1561480044-11834-1-git-send-email-amasule@codeaurora.org> <1561480044-11834-2-git-send-email-amasule@codeaurora.org> From: Stanimir Varbanov Message-ID: Date: Mon, 1 Jul 2019 14:43:35 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.1 MIME-Version: 1.0 In-Reply-To: <1561480044-11834-2-git-send-email-amasule@codeaurora.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/25/19 7:27 PM, Aniket Masule wrote: > Add vpp cycles for for different types of codec > It indicates the cycles required by video hardware > to process each macroblock. Initialize the codec > data with core resources. > > Signed-off-by: Aniket Masule > --- > drivers/media/platform/qcom/venus/core.c | 13 +++++++++++++ > drivers/media/platform/qcom/venus/core.h | 15 +++++++++++++++ > drivers/media/platform/qcom/venus/helpers.c | 30 +++++++++++++++++++++++++++++ > drivers/media/platform/qcom/venus/helpers.h | 1 + > drivers/media/platform/qcom/venus/vdec.c | 4 ++++ > drivers/media/platform/qcom/venus/venc.c | 4 ++++ > 6 files changed, 67 insertions(+) > > diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c > index 7393667..f1597d6 100644 > --- a/drivers/media/platform/qcom/venus/core.c > +++ b/drivers/media/platform/qcom/venus/core.c > @@ -473,9 +473,22 @@ static __maybe_unused int venus_runtime_resume(struct device *dev) > { 244800, 100000000 }, /* 1920x1080@30 */ > }; > > +static struct codec_freq_data sdm845_codec_freq_data[] = { > + { V4L2_PIX_FMT_H264, VIDC_SESSION_TYPE_ENC, 675 }, > + { V4L2_PIX_FMT_HEVC, VIDC_SESSION_TYPE_ENC, 675 }, > + { V4L2_PIX_FMT_VP8, VIDC_SESSION_TYPE_ENC, 675 }, > + { V4L2_PIX_FMT_MPEG2, VIDC_SESSION_TYPE_DEC, 200 }, > + { V4L2_PIX_FMT_H264, VIDC_SESSION_TYPE_DEC, 200 }, > + { V4L2_PIX_FMT_HEVC, VIDC_SESSION_TYPE_DEC, 200 }, > + { V4L2_PIX_FMT_VP8, VIDC_SESSION_TYPE_DEC, 200 }, > + { V4L2_PIX_FMT_VP9, VIDC_SESSION_TYPE_DEC, 200 }, > +}; > + > static const struct venus_resources sdm845_res = { > .freq_tbl = sdm845_freq_table, > .freq_tbl_size = ARRAY_SIZE(sdm845_freq_table), > + .codec_freq_data = sdm845_codec_freq_data, > + .codec_freq_data_size = ARRAY_SIZE(sdm845_codec_freq_data), > .clks = {"core", "iface", "bus" }, > .clks_num = 3, > .max_load = 2563200, > diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h > index 7a3feb5..2ed6496 100644 > --- a/drivers/media/platform/qcom/venus/core.h > +++ b/drivers/media/platform/qcom/venus/core.h > @@ -35,12 +35,20 @@ struct reg_val { > u32 value; > }; > > +struct codec_freq_data { > + u32 pixfmt; > + u32 session_type; > + unsigned int vpp_freq; isn't unsigned long more suitable? > +}; > + > struct venus_resources { > u64 dma_mask; > const struct freq_tbl *freq_tbl; > unsigned int freq_tbl_size; > const struct reg_val *reg_tbl; > unsigned int reg_tbl_size; > + const struct codec_freq_data *codec_freq_data; > + unsigned int codec_freq_data_size; > const char * const clks[VIDC_CLKS_NUM_MAX]; > unsigned int clks_num; > enum hfi_version hfi_version; > @@ -216,6 +224,12 @@ struct venus_buffer { > struct list_head ref_list; > }; > > +struct clock_data { > + u32 core_id; > + unsigned long freq; > + struct codec_freq_data *codec_freq_data; > +}; > + > #define to_venus_buffer(ptr) container_of(ptr, struct venus_buffer, vb) > > /** > @@ -275,6 +289,7 @@ struct venus_inst { > struct list_head list; > struct mutex lock; > struct venus_core *core; > + struct clock_data clk_data; > struct list_head dpbbufs; > struct list_head internalbufs; > struct list_head registeredbufs; > diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c > index 5cad601..f7f724b 100644 > --- a/drivers/media/platform/qcom/venus/helpers.c > +++ b/drivers/media/platform/qcom/venus/helpers.c > @@ -715,6 +715,36 @@ int venus_helper_set_core_usage(struct venus_inst *inst, u32 usage) > } > EXPORT_SYMBOL_GPL(venus_helper_set_core_usage); > > +int venus_helper_init_codec_data(struct venus_inst *inst) > +{ > + const struct codec_data *codec_data; Something is wrong here, there is no prototype of struct codec_data. -- regards, Stan