2022-08-31 17:33:59

by Allen-KH Cheng

[permalink] [raw]
Subject: [PATCH v3 0/2] Add mt8186 mutex support for mdp3

This series are based on matthias.bgg/linux.git, for-next and provide
mt8186 mutex support for Media Data Path 3 (MDP3).

As discussed, we add data field (mt8186_mdp_mutex_driver_data) for
mt8186 mdp3 mutex support instead of adding mutex_table_mod into mt8186
disp mutex data.

changes since v2:
- rebase to matthias.bgg/linux.git
- add C-d-b, R-b and A-b tags

changes since v1:
- add mt8186_mdp_mutex_table_mod
- add mt8186_mdp_mutex_driver_data for mt8186-mdp3-mutex

Allen-KH Cheng (2):
dt-bindings: soc: mediatek: Add mdp3 mutex support for mt8186
soc: mediatek: mutex: Add mt8186 mutex mod settings for mdp3

.../bindings/soc/mediatek/mediatek,mutex.yaml | 1 +
drivers/soc/mediatek/mtk-mutex.c | 28 +++++++++++++++++++
include/linux/soc/mediatek/mtk-mutex.h | 2 ++
3 files changed, 31 insertions(+)

--
2.18.0


2022-08-31 17:41:15

by Allen-KH Cheng

[permalink] [raw]
Subject: [PATCH v3 1/2] dt-bindings: soc: mediatek: Add mdp3 mutex support for mt8186

Add mdp3 mutex compatible for mt8186 SoC.

Co-developed-by: Xiandong Wang <[email protected]>
Signed-off-by: Xiandong Wang <[email protected]>
Signed-off-by: Allen-KH Cheng <[email protected]>
Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
Acked-by: Rob Herring <[email protected]>
---
.../devicetree/bindings/soc/mediatek/mediatek,mutex.yaml | 1 +
1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/soc/mediatek/mediatek,mutex.yaml b/Documentation/devicetree/bindings/soc/mediatek/mediatek,mutex.yaml
index 627dcc3e8b32..234fa5dc07c2 100644
--- a/Documentation/devicetree/bindings/soc/mediatek/mediatek,mutex.yaml
+++ b/Documentation/devicetree/bindings/soc/mediatek/mediatek,mutex.yaml
@@ -30,6 +30,7 @@ properties:
- mediatek,mt8173-disp-mutex
- mediatek,mt8183-disp-mutex
- mediatek,mt8186-disp-mutex
+ - mediatek,mt8186-mdp3-mutex
- mediatek,mt8192-disp-mutex
- mediatek,mt8195-disp-mutex

--
2.18.0

2022-08-31 17:41:36

by Allen-KH Cheng

[permalink] [raw]
Subject: [PATCH v3 2/2] soc: mediatek: mutex: Add mt8186 mutex mod settings for mdp3

Add mt8186 mutex mod settings for mdp3.

Co-developed-by: Xiandong Wang <[email protected]>
Signed-off-by: Xiandong Wang <[email protected]>
Signed-off-by: Allen-KH Cheng <[email protected]>
Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
---
drivers/soc/mediatek/mtk-mutex.c | 28 ++++++++++++++++++++++++++
include/linux/soc/mediatek/mtk-mutex.h | 2 ++
2 files changed, 30 insertions(+)

diff --git a/drivers/soc/mediatek/mtk-mutex.c b/drivers/soc/mediatek/mtk-mutex.c
index 5ea43de4e410..f95100d4de73 100644
--- a/drivers/soc/mediatek/mtk-mutex.c
+++ b/drivers/soc/mediatek/mtk-mutex.c
@@ -91,6 +91,15 @@
#define MT8183_MUTEX_MOD_MDP_AAL0 23
#define MT8183_MUTEX_MOD_MDP_CCORR0 24

+#define MT8186_MUTEX_MOD_MDP_RDMA0 0
+#define MT8186_MUTEX_MOD_MDP_AAL0 2
+#define MT8186_MUTEX_MOD_MDP_HDR0 4
+#define MT8186_MUTEX_MOD_MDP_RSZ0 5
+#define MT8186_MUTEX_MOD_MDP_RSZ1 6
+#define MT8186_MUTEX_MOD_MDP_WROT0 7
+#define MT8186_MUTEX_MOD_MDP_TDSHP0 9
+#define MT8186_MUTEX_MOD_MDP_COLOR0 14
+
#define MT8173_MUTEX_MOD_DISP_OVL0 11
#define MT8173_MUTEX_MOD_DISP_OVL1 12
#define MT8173_MUTEX_MOD_DISP_RDMA0 13
@@ -324,6 +333,17 @@ static const unsigned int mt8186_mutex_mod[DDP_COMPONENT_ID_MAX] = {
[DDP_COMPONENT_RDMA1] = MT8186_MUTEX_MOD_DISP_RDMA1,
};

+static const unsigned int mt8186_mdp_mutex_table_mod[MUTEX_MOD_IDX_MAX] = {
+ [MUTEX_MOD_IDX_MDP_RDMA0] = MT8186_MUTEX_MOD_MDP_RDMA0,
+ [MUTEX_MOD_IDX_MDP_RSZ0] = MT8186_MUTEX_MOD_MDP_RSZ0,
+ [MUTEX_MOD_IDX_MDP_RSZ1] = MT8186_MUTEX_MOD_MDP_RSZ1,
+ [MUTEX_MOD_IDX_MDP_TDSHP0] = MT8186_MUTEX_MOD_MDP_TDSHP0,
+ [MUTEX_MOD_IDX_MDP_WROT0] = MT8186_MUTEX_MOD_MDP_WROT0,
+ [MUTEX_MOD_IDX_MDP_HDR0] = MT8186_MUTEX_MOD_MDP_HDR0,
+ [MUTEX_MOD_IDX_MDP_AAL0] = MT8186_MUTEX_MOD_MDP_AAL0,
+ [MUTEX_MOD_IDX_MDP_COLOR0] = MT8186_MUTEX_MOD_MDP_COLOR0,
+};
+
static const unsigned int mt8192_mutex_mod[DDP_COMPONENT_ID_MAX] = {
[DDP_COMPONENT_AAL0] = MT8192_MUTEX_MOD_DISP_AAL0,
[DDP_COMPONENT_CCORR] = MT8192_MUTEX_MOD_DISP_CCORR0,
@@ -458,6 +478,12 @@ static const struct mtk_mutex_data mt8183_mutex_driver_data = {
.no_clk = true,
};

+static const struct mtk_mutex_data mt8186_mdp_mutex_driver_data = {
+ .mutex_mod_reg = MT8183_MUTEX0_MOD0,
+ .mutex_sof_reg = MT8183_MUTEX0_SOF0,
+ .mutex_table_mod = mt8186_mdp_mutex_table_mod,
+};
+
static const struct mtk_mutex_data mt8186_mutex_driver_data = {
.mutex_mod = mt8186_mutex_mod,
.mutex_sof = mt8186_mutex_sof,
@@ -810,6 +836,8 @@ static const struct of_device_id mutex_driver_dt_match[] = {
.data = &mt8183_mutex_driver_data},
{ .compatible = "mediatek,mt8186-disp-mutex",
.data = &mt8186_mutex_driver_data},
+ { .compatible = "mediatek,mt8186-mdp3-mutex",
+ .data = &mt8186_mdp_mutex_driver_data},
{ .compatible = "mediatek,mt8192-disp-mutex",
.data = &mt8192_mutex_driver_data},
{ .compatible = "mediatek,mt8195-disp-mutex",
diff --git a/include/linux/soc/mediatek/mtk-mutex.h b/include/linux/soc/mediatek/mtk-mutex.h
index a0f4f51a3b45..b335c2837cd8 100644
--- a/include/linux/soc/mediatek/mtk-mutex.h
+++ b/include/linux/soc/mediatek/mtk-mutex.h
@@ -20,6 +20,8 @@ enum mtk_mutex_mod_index {
MUTEX_MOD_IDX_MDP_WDMA,
MUTEX_MOD_IDX_MDP_AAL0,
MUTEX_MOD_IDX_MDP_CCORR0,
+ MUTEX_MOD_IDX_MDP_HDR0,
+ MUTEX_MOD_IDX_MDP_COLOR0,

MUTEX_MOD_IDX_MAX /* ALWAYS keep at the end */
};
--
2.18.0

2022-08-31 20:04:01

by Matthias Brugger

[permalink] [raw]
Subject: Re: [PATCH v3 0/2] Add mt8186 mutex support for mdp3

Series applied, thanks!

On 31/08/2022 19:21, Allen-KH Cheng wrote:
> This series are based on matthias.bgg/linux.git, for-next and provide
> mt8186 mutex support for Media Data Path 3 (MDP3).
>
> As discussed, we add data field (mt8186_mdp_mutex_driver_data) for
> mt8186 mdp3 mutex support instead of adding mutex_table_mod into mt8186
> disp mutex data.
>
> changes since v2:
> - rebase to matthias.bgg/linux.git
> - add C-d-b, R-b and A-b tags
>
> changes since v1:
> - add mt8186_mdp_mutex_table_mod
> - add mt8186_mdp_mutex_driver_data for mt8186-mdp3-mutex
>
> Allen-KH Cheng (2):
> dt-bindings: soc: mediatek: Add mdp3 mutex support for mt8186
> soc: mediatek: mutex: Add mt8186 mutex mod settings for mdp3
>
> .../bindings/soc/mediatek/mediatek,mutex.yaml | 1 +
> drivers/soc/mediatek/mtk-mutex.c | 28 +++++++++++++++++++
> include/linux/soc/mediatek/mtk-mutex.h | 2 ++
> 3 files changed, 31 insertions(+)
>