Commit 61890cca authored by Moudy Ho's avatar Moudy Ho Committed by Mauro Carvalho Chehab
Browse files

media: platform: mtk-mdp3: add MediaTek MDP3 driver



This patch adds driver for MediaTek's Media Data Path ver.3 (MDP3).
It provides the following functions:
  color transform, format conversion, resize, crop, rotate, flip
  and additional image quality enhancement.

The MDP3 driver is mainly used for Google Chromebook products to
import the new architecture to set the HW settings as shown below:
  User -> V4L2 framework
    -> MDP3 driver -> SCP (setting calculations)
      -> MDP3 driver -> CMDQ (GCE driver) -> HW

Each modules' related operation control is sited in mtk-mdp3-comp.c
Each modules' register table is defined in file with "mdp_reg_" prefix
GCE related API, operation control  sited in mtk-mdp3-cmdq.c
V4L2 m2m device functions are implemented in mtk-mdp3-m2m.c
Probe, power, suspend/resume, system level functions are defined in
mtk-mdp3-core.c

[hverkuil: add 'depends on REMOTEPROC']

Signed-off-by: default avatarPing-Hsun Wu <ping-hsun.wu@mediatek.com>
Signed-off-by: default avatardaoyuan huang <daoyuan.huang@mediatek.com>
Signed-off-by: default avatarMoudy Ho <moudy.ho@mediatek.com>
Tested-by: default avatarAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 8bbdead4
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -6,3 +6,4 @@ source "drivers/media/platform/mediatek/jpeg/Kconfig"
source "drivers/media/platform/mediatek/mdp/Kconfig"
source "drivers/media/platform/mediatek/vcodec/Kconfig"
source "drivers/media/platform/mediatek/vpu/Kconfig"
source "drivers/media/platform/mediatek/mdp3/Kconfig"
+1 −0
Original line number Diff line number Diff line
@@ -3,3 +3,4 @@ obj-y += jpeg/
obj-y += mdp/
obj-y += vcodec/
obj-y += vpu/
obj-y += mdp3/
+21 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only
config VIDEO_MEDIATEK_MDP3
	tristate "MediaTek MDP v3 driver"
	depends on MTK_IOMMU || COMPILE_TEST
	depends on VIDEO_DEV
	depends on ARCH_MEDIATEK || COMPILE_TEST
	depends on HAS_DMA
	depends on REMOTEPROC
	select VIDEOBUF2_DMA_CONTIG
	select V4L2_MEM2MEM_DEV
	select MTK_MMSYS
	select VIDEO_MEDIATEK_VPU
	select MTK_CMDQ
	select MTK_SCP
	default n
	help
	    It is a v4l2 driver and present in MediaTek MT8183 SoC.
	    The driver supports scaling and color space conversion.

	    To compile this driver as a module, choose M here: the
	    module will be called mtk-mdp3.
+6 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only
mtk-mdp3-y += mtk-mdp3-core.o mtk-mdp3-vpu.o mtk-mdp3-regs.o
mtk-mdp3-y += mtk-mdp3-m2m.o
mtk-mdp3-y += mtk-mdp3-comp.o mtk-mdp3-cmdq.o

obj-$(CONFIG_VIDEO_MEDIATEK_MDP3) += mtk-mdp3.o
+19 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2022 MediaTek Inc.
 * Author: Ping-Hsun Wu <ping-hsun.wu@mediatek.com>
 */

#ifndef __MDP_REG_CCORR_H__
#define __MDP_REG_CCORR_H__

#define MDP_CCORR_EN                0x000
#define MDP_CCORR_CFG               0x020
#define MDP_CCORR_SIZE              0x030

/* MASK */
#define MDP_CCORR_EN_MASK           0x00000001
#define MDP_CCORR_CFG_MASK          0x70001317
#define MDP_CCORR_SIZE_MASK         0x1fff1fff

#endif  // __MDP_REG_CCORR_H__
Loading