summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/mediatek/mtk_mdp_rdma.c
diff options
context:
space:
mode:
authorNancy.Lin <nancy.lin@mediatek.com>2023-03-30 11:26:13 +0800
committerChun-Kuang Hu <chunkuang.hu@kernel.org>2023-04-03 03:02:29 +0000
commitdf4752441d6bad238ca5df628dd11bc92225777b (patch)
treee655ff06dc7b7f6e0f34fe1efcafbc5fc9ab0da9 /drivers/gpu/drm/mediatek/mtk_mdp_rdma.c
parent54b48080278a9e4012d72c95e92378dc6742947d (diff)
drm/mediatek: Add mdp_rdma get format function
Add mdp_rdma get_format and get_num_formats function. Signed-off-by: Nancy.Lin <nancy.lin@mediatek.com> Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20230330032614.18837-2-nancy.lin@mediatek.com/ Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Diffstat (limited to 'drivers/gpu/drm/mediatek/mtk_mdp_rdma.c')
-rw-r--r--drivers/gpu/drm/mediatek/mtk_mdp_rdma.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/gpu/drm/mediatek/mtk_mdp_rdma.c b/drivers/gpu/drm/mediatek/mtk_mdp_rdma.c
index eecfa98ff52e..e06db6e56b5f 100644
--- a/drivers/gpu/drm/mediatek/mtk_mdp_rdma.c
+++ b/drivers/gpu/drm/mediatek/mtk_mdp_rdma.c
@@ -62,6 +62,20 @@
#define RDMA_CSC_FULL709_TO_RGB 5
#define RDMA_CSC_BT601_TO_RGB 6
+static const u32 formats[] = {
+ DRM_FORMAT_XRGB8888,
+ DRM_FORMAT_ARGB8888,
+ DRM_FORMAT_BGRX8888,
+ DRM_FORMAT_BGRA8888,
+ DRM_FORMAT_ABGR8888,
+ DRM_FORMAT_XBGR8888,
+ DRM_FORMAT_RGB888,
+ DRM_FORMAT_BGR888,
+ DRM_FORMAT_RGB565,
+ DRM_FORMAT_UYVY,
+ DRM_FORMAT_YUYV,
+};
+
enum rdma_format {
RDMA_INPUT_FORMAT_RGB565 = 0,
RDMA_INPUT_FORMAT_RGB888 = 1,
@@ -219,6 +233,16 @@ void mtk_mdp_rdma_config(struct device *dev, struct mtk_mdp_rdma_cfg *cfg,
MDP_RDMA_MF_CLIP_SIZE, FLD_MF_CLIP_H);
}
+const u32 *mtk_mdp_rdma_get_formats(struct device *dev)
+{
+ return formats;
+}
+
+size_t mtk_mdp_rdma_get_num_formats(struct device *dev)
+{
+ return ARRAY_SIZE(formats);
+}
+
int mtk_mdp_rdma_clk_enable(struct device *dev)
{
struct mtk_mdp_rdma *rdma = dev_get_drvdata(dev);