2020-12-20 02:41:31

by Chun-Kuang Hu

[permalink] [raw]
Subject: [PATCH 0/5] Share mtk mutex driver for both DRM and MDP

mtk mutex is a driver used by DRM and MDP [1], so this series move
mtk mutex driver from DRM folder to soc folder, so it could be used
by DRM and MDP.

This series based on linux-next next-20201218 [2]

[1] https://patchwork.kernel.org/patch/11140751/
[2] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/log/?h=next-20201218

CK Hu (5):
drm/mediatek: Remove redundant file including
drm/mediatek: Rename file mtk_drm_ddp to mtk_mutex
drm/mediatek: Change disp/ddp term to mutex in mtk mutex driver
drm/mediatek: Automatically search unclaimed mtk mutex in
mtk_mutex_get()
soc / drm: mediatek: Move mtk mutex driver to soc folder

drivers/gpu/drm/mediatek/Makefile | 1 -
drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 32 +-
drivers/gpu/drm/mediatek/mtk_drm_ddp.h | 28 --
drivers/gpu/drm/mediatek/mtk_drm_drv.c | 3 -
drivers/gpu/drm/mediatek/mtk_drm_drv.h | 1 -
drivers/soc/mediatek/Makefile | 1 +
.../mediatek/mtk-mutex.c} | 317 +++++++++---------
include/linux/soc/mediatek/mtk-mutex.h | 26 ++
8 files changed, 201 insertions(+), 208 deletions(-)
delete mode 100644 drivers/gpu/drm/mediatek/mtk_drm_ddp.h
rename drivers/{gpu/drm/mediatek/mtk_drm_ddp.c => soc/mediatek/mtk-mutex.c} (54%)
create mode 100644 include/linux/soc/mediatek/mtk-mutex.h

--
2.17.1


2020-12-20 02:41:50

by Chun-Kuang Hu

[permalink] [raw]
Subject: [PATCH 5/5] soc / drm: mediatek: Move mtk mutex driver to soc folder

From: CK Hu <[email protected]>

mtk mutex is used by DRM and MDP driver, and its function is SoC-specific,
so move it to soc folder.

Signed-off-by: CK Hu <[email protected]>
Signed-off-by: Chun-Kuang Hu <[email protected]>
---
drivers/gpu/drm/mediatek/Makefile | 3 +--
drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 2 +-
drivers/gpu/drm/mediatek/mtk_drm_drv.c | 1 -
drivers/gpu/drm/mediatek/mtk_drm_drv.h | 1 -
drivers/soc/mediatek/Makefile | 1 +
.../{gpu/drm/mediatek/mtk_mutex.c => soc/mediatek/mtk-mutex.c} | 2 ++
.../mtk_mutex.h => include/linux/soc/mediatek/mtk-mutex.h | 0
7 files changed, 5 insertions(+), 5 deletions(-)
rename drivers/{gpu/drm/mediatek/mtk_mutex.c => soc/mediatek/mtk-mutex.c} (99%)
rename drivers/gpu/drm/mediatek/mtk_mutex.h => include/linux/soc/mediatek/mtk-mutex.h (100%)

diff --git a/drivers/gpu/drm/mediatek/Makefile b/drivers/gpu/drm/mediatek/Makefile
index 09979c4c340a..01d06332f767 100644
--- a/drivers/gpu/drm/mediatek/Makefile
+++ b/drivers/gpu/drm/mediatek/Makefile
@@ -9,8 +9,7 @@ mediatek-drm-y := mtk_disp_color.o \
mtk_drm_gem.o \
mtk_drm_plane.o \
mtk_dsi.o \
- mtk_dpi.o \
- mtk_mutex.o
+ mtk_dpi.o

obj-$(CONFIG_DRM_MEDIATEK) += mediatek-drm.o

diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
index 23d9abc4f46c..d7bd07916d74 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
@@ -7,6 +7,7 @@
#include <linux/pm_runtime.h>
#include <linux/soc/mediatek/mtk-cmdq.h>
#include <linux/soc/mediatek/mtk-mmsys.h>
+#include <linux/soc/mediatek/mtk-mutex.h>

#include <asm/barrier.h>
#include <soc/mediatek/smi.h>
@@ -22,7 +23,6 @@
#include "mtk_drm_ddp_comp.h"
#include "mtk_drm_gem.h"
#include "mtk_drm_plane.h"
-#include "mtk_mutex.h"

/*
* struct mtk_drm_crtc - MediaTek specific crtc structure.
diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
index 907a69eb6d51..d1232124b650 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
@@ -602,7 +602,6 @@ static struct platform_driver mtk_drm_platform_driver = {
};

static struct platform_driver * const mtk_drm_drivers[] = {
- &mtk_mutex_driver,
&mtk_disp_color_driver,
&mtk_disp_ovl_driver,
&mtk_disp_rdma_driver,
diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.h b/drivers/gpu/drm/mediatek/mtk_drm_drv.h
index c7220f267a62..f7cd95903a4e 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_drv.h
+++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.h
@@ -46,7 +46,6 @@ struct mtk_drm_private {
struct drm_atomic_state *suspend_state;
};

-extern struct platform_driver mtk_mutex_driver;
extern struct platform_driver mtk_disp_color_driver;
extern struct platform_driver mtk_disp_ovl_driver;
extern struct platform_driver mtk_disp_rdma_driver;
diff --git a/drivers/soc/mediatek/Makefile b/drivers/soc/mediatek/Makefile
index b6908db534c2..90270f8114ed 100644
--- a/drivers/soc/mediatek/Makefile
+++ b/drivers/soc/mediatek/Makefile
@@ -6,3 +6,4 @@ obj-$(CONFIG_MTK_PMIC_WRAP) += mtk-pmic-wrap.o
obj-$(CONFIG_MTK_SCPSYS) += mtk-scpsys.o
obj-$(CONFIG_MTK_SCPSYS_PM_DOMAINS) += mtk-pm-domains.o
obj-$(CONFIG_MTK_MMSYS) += mtk-mmsys.o
+obj-$(CONFIG_MTK_MMSYS) += mtk-mutex.o
diff --git a/drivers/gpu/drm/mediatek/mtk_mutex.c b/drivers/soc/mediatek/mtk-mutex.c
similarity index 99%
rename from drivers/gpu/drm/mediatek/mtk_mutex.c
rename to drivers/soc/mediatek/mtk-mutex.c
index e16b1772317c..f2597ebf52db 100644
--- a/drivers/gpu/drm/mediatek/mtk_mutex.c
+++ b/drivers/soc/mediatek/mtk-mutex.c
@@ -459,3 +459,5 @@ struct platform_driver mtk_mutex_driver = {
.of_match_table = mutex_driver_dt_match,
},
};
+
+builtin_platform_driver(mtk_mutex_driver);
diff --git a/drivers/gpu/drm/mediatek/mtk_mutex.h b/include/linux/soc/mediatek/mtk-mutex.h
similarity index 100%
rename from drivers/gpu/drm/mediatek/mtk_mutex.h
rename to include/linux/soc/mediatek/mtk-mutex.h
--
2.17.1