public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Stanimir Varbanov <stanimir.varbanov@linaro.org>
To: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	Hans Verkuil <hverkuil@xs4all.nl>,
	Andy Gross <andy.gross@linaro.org>,
	Stephen Boyd <sboyd@codeaurora.org>,
	Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH 5/8] media: vidc: add Host Firmware Interface (HFI)
Date: Fri, 26 Aug 2016 17:21:10 +0300	[thread overview]
Message-ID: <48705e6e-b7eb-cd47-e9ee-6a4eae841fcc@linaro.org> (raw)
In-Reply-To: <20160823032548.GA26240@tuxbot>

Hi Bjorn,

Thanks for the comments!

On 08/23/2016 06:25 AM, Bjorn Andersson wrote:
> On Mon 22 Aug 06:13 PDT 2016, Stanimir Varbanov wrote:
> 
>> This is the implementation of HFI. It is loaded with the
>> responsibility to comunicate with the firmware through an
>> interface commands and messages.
>>
>>  - hfi.c has interface functions used by the core, decoder
>> and encoder parts to comunicate with the firmware. For example
>> there are functions for session and core initialisation.
>>
> 
> I can't help feeling that the split between core.c and hfi.c is a
> remnant of a vidc driver supporting both HFI and pre-HFI with the same
> v4l code.
> 
> What do you think about merging vidc_core with hfi_core and vidc_inst
> with hfi_inst? Both seems to be in a 1:1 relationship.

OK, I can give it a try.

> 
>>  - hfi_cmds has packetization operations which preparing
>> packets to be send from host to firmware.
>>
>>  - hfi_msgs takes care of messages sent from firmware to the
>> host.
>>
> [..]
>> diff --git a/drivers/media/platform/qcom/vidc/hfi_cmds.c b/drivers/media/platform/qcom/vidc/hfi_cmds.c
> [..]
>> +
>> +static const struct hfi_packetization_ops hfi_default = {
>> +	.sys_init = pkt_sys_init,
>> +	.sys_pc_prep = pkt_sys_pc_prep,
>> +	.sys_idle_indicator = pkt_sys_idle_indicator,
>> +	.sys_power_control = pkt_sys_power_control,
>> +	.sys_set_resource = pkt_sys_set_resource,
>> +	.sys_release_resource = pkt_sys_unset_resource,
>> +	.sys_debug_config = pkt_sys_debug_config,
>> +	.sys_coverage_config = pkt_sys_coverage_config,
>> +	.sys_ping = pkt_sys_ping,
>> +	.sys_image_version = pkt_sys_image_version,
>> +	.ssr_cmd = pkt_ssr_cmd,
>> +	.session_init = pkt_session_init,
>> +	.session_cmd = pkt_session_cmd,
>> +	.session_set_buffers = pkt_session_set_buffers,
>> +	.session_release_buffers = pkt_session_release_buffers,
>> +	.session_etb_decoder = pkt_session_etb_decoder,
>> +	.session_etb_encoder = pkt_session_etb_encoder,
>> +	.session_ftb = pkt_session_ftb,
>> +	.session_parse_seq_header = pkt_session_parse_seq_header,
>> +	.session_get_seq_hdr = pkt_session_get_seq_hdr,
>> +	.session_flush = pkt_session_flush,
>> +	.session_get_property = pkt_session_get_property,
>> +	.session_set_property = pkt_session_set_property,
>> +};
>> +
>> +static const struct hfi_packetization_ops *get_3xx_ops(void)
>> +{
>> +	static struct hfi_packetization_ops hfi_3xx;
>> +
>> +	hfi_3xx = hfi_default;
>> +	hfi_3xx.session_set_property = pkt_session_set_property_3xx;
>> +
>> +	return &hfi_3xx;
>> +}
>> +
>> +const struct hfi_packetization_ops *
>> +hfi_get_pkt_ops(enum hfi_packetization_type type)
> 
> The only reasonable argument I can come up with for not just exposing
> these as global functions would be that there are 23 of them... Can we
> skip the jump table?

Of course we can, but what will be the benefit, increased readability ?
Let's keep it for now. Once the driver is merged some smarter guy could
came up with better solution ;)

> 
>> +{
>> +	switch (type) {
>> +	case HFI_PACKETIZATION_LEGACY:
>> +		return &hfi_default;
>> +	case HFI_PACKETIZATION_3XX:
>> +		return get_3xx_ops();
>> +	}
>> +
>> +	return NULL;
>> +}
> 
> Regards,
> Bjorn
> 

-- 
regards,
Stan

  reply	other threads:[~2016-08-26 14:21 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-22 13:13 [PATCH 0/8] Qualcomm video decoder/encoder driver Stanimir Varbanov
2016-08-22 13:13 ` [PATCH 1/8] doc: DT: vidc: binding document for Qualcomm video driver Stanimir Varbanov
2016-08-22 13:13 ` [PATCH 2/8] media: vidc: adding core part and helper functions Stanimir Varbanov
2016-08-22 13:41   ` Hans Verkuil
2016-08-22 16:03     ` Stanimir Varbanov
2016-08-23  2:50   ` Bjorn Andersson
2016-08-25 12:59     ` Stanimir Varbanov
2016-08-25 18:26       ` Bjorn Andersson
2016-08-22 13:13 ` [PATCH 3/8] media: vidc: decoder: add video decoder files Stanimir Varbanov
2016-08-22 14:38   ` Hans Verkuil
2016-08-23 12:45     ` Stanimir Varbanov
2016-08-23 13:12       ` Hans Verkuil
2016-08-29 14:22         ` Stanimir Varbanov
2016-08-22 13:13 ` [PATCH 4/8] media: vidc: encoder: add video encoder files Stanimir Varbanov
2016-08-22 13:13 ` [PATCH 5/8] media: vidc: add Host Firmware Interface (HFI) Stanimir Varbanov
2016-08-23  3:25   ` Bjorn Andersson
2016-08-26 14:21     ` Stanimir Varbanov [this message]
2016-08-22 13:13 ` [PATCH 6/8] media: vidc: add Venus HFI files Stanimir Varbanov
2016-08-23  3:35   ` Bjorn Andersson
2016-08-22 13:13 ` [PATCH 7/8] media: vidc: add Makefiles and Kconfig files Stanimir Varbanov
2016-08-22 13:13 ` [PATCH 8/8] media: vidc: enable building of the video codec driver Stanimir Varbanov
2016-09-05 14:47 ` [PATCH 0/8] Qualcomm video decoder/encoder driver Hans Verkuil
2016-09-07  8:57   ` Stanimir Varbanov

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=48705e6e-b7eb-cd47-e9ee-6a4eae841fcc@linaro.org \
    --to=stanimir.varbanov@linaro.org \
    --cc=andy.gross@linaro.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=sboyd@codeaurora.org \
    --cc=srinivas.kandagatla@linaro.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