mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: AngeloGioacchino Del Regno  <angelogioacchino.delregno@collabora.com>
To: minghsiu.tsai@mediatek.com
Cc: houlong.wei@mediatek.com, andrew-ct.chen@mediatek.com,
	mchehab@kernel.org, matthias.bgg@gmail.com,
	hans.verkuil@cisco.com, linux-media@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org,
	kernel@collabora.com, acourbot@chromium.org,
	irui.wang@mediatek.com
Subject: Re: [PATCH] media: platform: mtk-mdp: Fix mdp_ipi_comm structure alignment
Date: Thu, 21 Apr 2022 13:03:02 +0200	[thread overview]
Message-ID: <7658c8e4-596b-abfc-9255-854c16f920a7@collabora.com> (raw)
In-Reply-To: <20220307155653.460910-1-angelogioacchino.delregno@collabora.com>

Il 07/03/22 16:56, AngeloGioacchino Del Regno ha scritto:
> The mdp_ipi_comm structure defines a command that is either
> PROCESS (start processing) or DEINIT (destroy instance); we
> are using this one to send PROCESS or DEINIT commands from Linux
> to an MDP instance through a VPU write but, while the first wants
> us to stay 4-bytes aligned, the VPU instead requires an 8-bytes
> data alignment.
> 
> Keeping in mind that these commands are executed immediately
> after sending them (hence not chained with others before the
> VPU/MDP "actually" start executing), it is fine to simply add
> a padding of 4 bytes to this structure: this keeps the same
> performance as before, as we're still stack-allocating it,
> while avoiding hackery inside of mtk-vpu to ensure alignment
> bringing a definitely bigger performance impact.
> 
> Fixes: c8eb2d7e8202 ("[media] media: Add Mediatek MDP Driver")
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

Hello,
is there any issue with this patch?

Regards,
Angelo

> ---
> 
> This patch has been tested on Acer Chromebook R 13 (MT8173 Elm) on Debian Sid.
> 
> This is an alternative solution to the mtk-vpu approach, found here:
> https://lore.kernel.org/all/20210920170408.1561-1-dafna.hirschfeld@collabora.com
> 
>   drivers/media/platform/mtk-mdp/mtk_mdp_ipi.h | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_ipi.h b/drivers/media/platform/mtk-mdp/mtk_mdp_ipi.h
> index 2cb8cecb3077..b810c96695c8 100644
> --- a/drivers/media/platform/mtk-mdp/mtk_mdp_ipi.h
> +++ b/drivers/media/platform/mtk-mdp/mtk_mdp_ipi.h
> @@ -40,12 +40,14 @@ struct mdp_ipi_init {
>    * @ipi_id        : IPI_MDP
>    * @ap_inst       : AP mtk_mdp_vpu address
>    * @vpu_inst_addr : VPU MDP instance address
> + * @padding       : Alignment padding
>    */
>   struct mdp_ipi_comm {
>   	uint32_t msg_id;
>   	uint32_t ipi_id;
>   	uint64_t ap_inst;
>   	uint32_t vpu_inst_addr;
> +	uint32_t padding;
>   };
>   
>   /**


-- 
AngeloGioacchino Del Regno
Software Engineer

Collabora Ltd.
Platinum Building, St John's Innovation Park, Cambridge CB4 0DS, UK
Registered in England & Wales, no. 5513718

  reply	other threads:[~2022-04-21 11:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-07 15:56 AngeloGioacchino Del Regno
2022-04-21 11:03 ` AngeloGioacchino Del Regno [this message]
2022-04-22  2:52   ` Irui Wang

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=7658c8e4-596b-abfc-9255-854c16f920a7@collabora.com \
    --to=angelogioacchino.delregno@collabora.com \
    --cc=acourbot@chromium.org \
    --cc=andrew-ct.chen@mediatek.com \
    --cc=hans.verkuil@cisco.com \
    --cc=houlong.wei@mediatek.com \
    --cc=irui.wang@mediatek.com \
    --cc=kernel@collabora.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=mchehab@kernel.org \
    --cc=minghsiu.tsai@mediatek.com \
    /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

all inboxes | Powered by JetHome®