Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /* drivers/gpu/drm/exynos/regs-rotator.h
0003  *
0004  * Copyright (c) 2012 Samsung Electronics Co., Ltd.
0005  *      http://www.samsung.com/
0006  *
0007  * Register definition file for Samsung Rotator Interface (Rotator) driver
0008 */
0009 
0010 #ifndef EXYNOS_REGS_ROTATOR_H
0011 #define EXYNOS_REGS_ROTATOR_H
0012 
0013 /* Configuration */
0014 #define ROT_CONFIG          0x00
0015 #define ROT_CONFIG_IRQ          (3 << 8)
0016 
0017 /* Image Control */
0018 #define ROT_CONTROL         0x10
0019 #define ROT_CONTROL_PATTERN_WRITE   (1 << 16)
0020 #define ROT_CONTROL_FMT_YCBCR420_2P (1 << 8)
0021 #define ROT_CONTROL_FMT_RGB888      (6 << 8)
0022 #define ROT_CONTROL_FMT_MASK        (7 << 8)
0023 #define ROT_CONTROL_FLIP_VERTICAL   (2 << 6)
0024 #define ROT_CONTROL_FLIP_HORIZONTAL (3 << 6)
0025 #define ROT_CONTROL_FLIP_MASK       (3 << 6)
0026 #define ROT_CONTROL_ROT_90      (1 << 4)
0027 #define ROT_CONTROL_ROT_180     (2 << 4)
0028 #define ROT_CONTROL_ROT_270     (3 << 4)
0029 #define ROT_CONTROL_ROT_MASK        (3 << 4)
0030 #define ROT_CONTROL_START       (1 << 0)
0031 
0032 /* Status */
0033 #define ROT_STATUS          0x20
0034 #define ROT_STATUS_IRQ_PENDING(x)   (1 << (x))
0035 #define ROT_STATUS_IRQ(x)       (((x) >> 8) & 0x3)
0036 #define ROT_STATUS_IRQ_VAL_COMPLETE 1
0037 #define ROT_STATUS_IRQ_VAL_ILLEGAL  2
0038 
0039 /* Buffer Address */
0040 #define ROT_SRC_BUF_ADDR(n)     (0x30 + ((n) << 2))
0041 #define ROT_DST_BUF_ADDR(n)     (0x50 + ((n) << 2))
0042 
0043 /* Buffer Size */
0044 #define ROT_SRC_BUF_SIZE        0x3c
0045 #define ROT_DST_BUF_SIZE        0x5c
0046 #define ROT_SET_BUF_SIZE_H(x)       ((x) << 16)
0047 #define ROT_SET_BUF_SIZE_W(x)       ((x) << 0)
0048 #define ROT_GET_BUF_SIZE_H(x)       ((x) >> 16)
0049 #define ROT_GET_BUF_SIZE_W(x)       ((x) & 0xffff)
0050 
0051 /* Crop Position */
0052 #define ROT_SRC_CROP_POS        0x40
0053 #define ROT_DST_CROP_POS        0x60
0054 #define ROT_CROP_POS_Y(x)       ((x) << 16)
0055 #define ROT_CROP_POS_X(x)       ((x) << 0)
0056 
0057 /* Source Crop Size */
0058 #define ROT_SRC_CROP_SIZE       0x44
0059 #define ROT_SRC_CROP_SIZE_H(x)      ((x) << 16)
0060 #define ROT_SRC_CROP_SIZE_W(x)      ((x) << 0)
0061 
0062 /* Round to nearest aligned value */
0063 #define ROT_ALIGN(x, align, mask)   (((x) + (1 << ((align) - 1))) & (mask))
0064 /* Minimum limit value */
0065 #define ROT_MIN(min, mask)      (((min) + ~(mask)) & (mask))
0066 /* Maximum limit value */
0067 #define ROT_MAX(max, mask)      ((max) & (mask))
0068 
0069 #endif /* EXYNOS_REGS_ROTATOR_H */
0070