From: Stanimir Varbanov <stanimir.varbanov@linaro.org>
To: Aniket Masule <amasule@codeaurora.org>, linux-media@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
vgarodia@codeaurora.org
Subject: Re: [PATCH v3 3/4] media: venus: Add interface for load per core
Date: Mon, 1 Jul 2019 16:55:02 +0300 [thread overview]
Message-ID: <87d41362-d86f-8da4-30ca-06390c9ceeff@linaro.org> (raw)
In-Reply-To: <1561480044-11834-4-git-send-email-amasule@codeaurora.org>
Hi Aniket,
On 6/25/19 7:27 PM, Aniket Masule wrote:
> Add and interface to calculate load per core. Also,
> add an interface to get maximum cores available with
> video. This interface is preparation for updating core
> selection.
>
> Signed-off-by: Aniket Masule <amasule@codeaurora.org>
> ---
> drivers/media/platform/qcom/venus/helpers.c | 19 +++++++++++++++++++
> drivers/media/platform/qcom/venus/hfi_helper.h | 1 +
> drivers/media/platform/qcom/venus/hfi_parser.h | 5 +++++
> 3 files changed, 25 insertions(+)
>
> diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c
> index e1a0247..b79e83a 100644
> --- a/drivers/media/platform/qcom/venus/helpers.c
> +++ b/drivers/media/platform/qcom/venus/helpers.c
> @@ -26,6 +26,7 @@
> #include "helpers.h"
> #include "hfi_helper.h"
> #include "hfi_venus_io.h"
> +#include "hfi_parser.h"
>
> struct intbuf {
> struct list_head list;
> @@ -331,6 +332,24 @@ static u32 load_per_instance(struct venus_inst *inst)
> return mbs * inst->fps;
> }
>
> +static u32 load_per_core(struct venus_core *core, u32 core_id)
> +{
> + struct venus_inst *inst = NULL;
> + u32 mbs_per_sec = 0, load = 0;
> +
> + mutex_lock(&core->lock);
> + list_for_each_entry(inst, &core->instances, list) {
> + if (!(inst->clk_data.core_id == core_id))
> + continue;
> +
> + mbs_per_sec = load_per_instance(inst);
> + load = mbs_per_sec * inst->clk_data.codec_freq_data->vpp_freq;
> + }
> + mutex_unlock(&core->lock);
> +
> + return load;
> +}
> +
Please squash this patch with the next one where load_per_core() is used
to avoid compiler warnings.
--
regards,
Stan
next prev parent reply other threads:[~2019-07-01 13:55 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-25 16:27 [PATCH v3 0/4] media: venus: Update clock scaling and core selection Aniket Masule
2019-06-25 16:27 ` [PATCH v3 1/4] media: venus: Add codec data table Aniket Masule
2019-07-01 11:43 ` Stanimir Varbanov
2019-07-02 4:55 ` amasule
2019-06-25 16:27 ` [PATCH v3 2/4] media: venus: Update clock scaling Aniket Masule
2019-07-01 13:11 ` Stanimir Varbanov
2019-07-02 4:59 ` amasule
2019-06-25 16:27 ` [PATCH v3 3/4] media: venus: Add interface for load per core Aniket Masule
2019-07-01 13:55 ` Stanimir Varbanov [this message]
2019-06-25 16:27 ` [PATCH v3 4/4] media: venus: Update core selection Aniket Masule
2019-07-01 13:58 ` Stanimir Varbanov
2019-07-02 5:01 ` amasule
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87d41362-d86f-8da4-30ca-06390c9ceeff@linaro.org \
--to=stanimir.varbanov@linaro.org \
--cc=amasule@codeaurora.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=vgarodia@codeaurora.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).