]> www.infradead.org Git - users/jedix/linux-maple.git/commit
media: platform: mtk-mdp3: Remove mask parameter from MM_REG_WRITE macro
authorNĂ­colas F. R. A. Prado <nfraprado@collabora.com>
Fri, 23 Aug 2024 21:31:23 +0000 (17:31 -0400)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Fri, 13 Dec 2024 16:30:57 +0000 (17:30 +0100)
commit7b00fcfdb5ddfbcab34295dee3b8c4989ae92c2a
treea0f3dc1fcca21641483b88c5dfaf05d8424afc46
parent6d9038dc87003623aaf9a4dd86d7096ab5748397
media: platform: mtk-mdp3: Remove mask parameter from MM_REG_WRITE macro

There are two macros to issue a cmdq write: MM_REG_WRITE_MASK and
MM_REG_WRITE, but confusingly, both of them take a mask parameter. The
difference is that MM_REG_WRITE additionally checks whether the mask
passed in contains the register mask, in which case, the 0xffffffff mask
is passed to cmdq_pkt_write_mask(), effectively disregarding the mask
and calling cmdq_pkt_write() as an optimization.

Move that optimization to the MM_REG_WRITE_MASK macro and make
MM_REG_WRITE the variant that doesn't take a mask, directly calling to
cmdq_pkt_write().

Change the call sites to MM_REG_WRITE whenever a mask wasn't necessary
(ie 0xffffffff or a <register>_MASK was passed as mask) and in other
cases to MM_REG_WRITE_MASK.

Signed-off-by: NĂ­colas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Sebastian Fricke <sebastian.fricke@collabora.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c
drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.h