提交 feb3dc76 编写于 作者: A AngeloGioacchino Del Regno 提交者: Zheng Zengkai

media: platform: mtk-mdp: Fix mdp_ipi_comm structure alignment

stable inclusion
from stable-v5.10.137
commit b1812f6500ddaf5e707af0ce6fdcd956481e8958
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I60PLB

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=b1812f6500ddaf5e707af0ce6fdcd956481e8958

--------------------------------

[ Upstream commit ab14c99c ]

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: c8eb2d7e ("[media] media: Add Mediatek MDP Driver")
Signed-off-by: NAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: NHoulong Wei <houlong.wei@mediatek.com>
Reviewed-by: NIrui Wang <irui.wang@mediatek.com>
Signed-off-by: NHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: NMauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Reviewed-by: NWei Li <liwei391@huawei.com>
上级 d4f08086
...@@ -40,12 +40,14 @@ struct mdp_ipi_init { ...@@ -40,12 +40,14 @@ struct mdp_ipi_init {
* @ipi_id : IPI_MDP * @ipi_id : IPI_MDP
* @ap_inst : AP mtk_mdp_vpu address * @ap_inst : AP mtk_mdp_vpu address
* @vpu_inst_addr : VPU MDP instance address * @vpu_inst_addr : VPU MDP instance address
* @padding : Alignment padding
*/ */
struct mdp_ipi_comm { struct mdp_ipi_comm {
uint32_t msg_id; uint32_t msg_id;
uint32_t ipi_id; uint32_t ipi_id;
uint64_t ap_inst; uint64_t ap_inst;
uint32_t vpu_inst_addr; uint32_t vpu_inst_addr;
uint32_t padding;
}; };
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册