Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm: zte: move CSC register definitions into a common header

The CSC (Color Space Conversion) block in VOU is used by not only
Graphic Layer (plane) but also channel (CRTC) module. Let's move
its register definitions into a common header, so that CRTC driver can
include it when needed.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1491490870-6330-3-git-send-email-shawnguo@kernel.org

+32 -18
+31
drivers/gpu/drm/zte/zx_common_regs.h
··· 1 + /* 2 + * Copyright (C) 2017 Sanechips Technology Co., Ltd. 3 + * Copyright 2017 Linaro Ltd. 4 + * 5 + * This program is free software; you can redistribute it and/or modify 6 + * it under the terms of the GNU General Public License version 2 as 7 + * published by the Free Software Foundation. 8 + */ 9 + 10 + #ifndef __ZX_COMMON_REGS_H__ 11 + #define __ZX_COMMON_REGS_H__ 12 + 13 + /* CSC registers */ 14 + #define CSC_CTRL0 0x30 15 + #define CSC_COV_MODE_SHIFT 16 16 + #define CSC_COV_MODE_MASK (0xffff << CSC_COV_MODE_SHIFT) 17 + #define CSC_BT601_IMAGE_RGB2YCBCR 0 18 + #define CSC_BT601_IMAGE_YCBCR2RGB 1 19 + #define CSC_BT601_VIDEO_RGB2YCBCR 2 20 + #define CSC_BT601_VIDEO_YCBCR2RGB 3 21 + #define CSC_BT709_IMAGE_RGB2YCBCR 4 22 + #define CSC_BT709_IMAGE_YCBCR2RGB 5 23 + #define CSC_BT709_VIDEO_RGB2YCBCR 6 24 + #define CSC_BT709_VIDEO_YCBCR2RGB 7 25 + #define CSC_BT2020_IMAGE_RGB2YCBCR 8 26 + #define CSC_BT2020_IMAGE_YCBCR2RGB 9 27 + #define CSC_BT2020_VIDEO_RGB2YCBCR 10 28 + #define CSC_BT2020_VIDEO_YCBCR2RGB 11 29 + #define CSC_WORK_ENABLE BIT(0) 30 + 31 + #endif /* __ZX_COMMON_REGS_H__ */
+1
drivers/gpu/drm/zte/zx_plane.c
··· 16 16 #include <drm/drm_plane_helper.h> 17 17 #include <drm/drmP.h> 18 18 19 + #include "zx_common_regs.h" 19 20 #include "zx_drm_drv.h" 20 21 #include "zx_plane.h" 21 22 #include "zx_plane_regs.h"
-18
drivers/gpu/drm/zte/zx_plane_regs.h
··· 77 77 #define LUMA_STRIDE(x) (((x) << LUMA_STRIDE_SHIFT) & LUMA_STRIDE_MASK) 78 78 #define CHROMA_STRIDE(x) (((x) << CHROMA_STRIDE_SHIFT) & CHROMA_STRIDE_MASK) 79 79 80 - /* CSC registers */ 81 - #define CSC_CTRL0 0x30 82 - #define CSC_COV_MODE_SHIFT 16 83 - #define CSC_COV_MODE_MASK (0xffff << CSC_COV_MODE_SHIFT) 84 - #define CSC_BT601_IMAGE_RGB2YCBCR 0 85 - #define CSC_BT601_IMAGE_YCBCR2RGB 1 86 - #define CSC_BT601_VIDEO_RGB2YCBCR 2 87 - #define CSC_BT601_VIDEO_YCBCR2RGB 3 88 - #define CSC_BT709_IMAGE_RGB2YCBCR 4 89 - #define CSC_BT709_IMAGE_YCBCR2RGB 5 90 - #define CSC_BT709_VIDEO_RGB2YCBCR 6 91 - #define CSC_BT709_VIDEO_YCBCR2RGB 7 92 - #define CSC_BT2020_IMAGE_RGB2YCBCR 8 93 - #define CSC_BT2020_IMAGE_YCBCR2RGB 9 94 - #define CSC_BT2020_VIDEO_RGB2YCBCR 10 95 - #define CSC_BT2020_VIDEO_YCBCR2RGB 11 96 - #define CSC_WORK_ENABLE BIT(0) 97 - 98 80 /* RSZ registers */ 99 81 #define RSZ_SRC_CFG 0x00 100 82 #define RSZ_DEST_CFG 0x04