diff options
Diffstat (limited to 'exynos')
-rw-r--r-- | exynos/exynos_fimg2d.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/exynos/exynos_fimg2d.c b/exynos/exynos_fimg2d.c index b10620b2..3bef93b0 100644 --- a/exynos/exynos_fimg2d.c +++ b/exynos/exynos_fimg2d.c | |||
@@ -65,6 +65,44 @@ enum g2d_base_addr_reg { | |||
65 | g2d_src | 65 | g2d_src |
66 | }; | 66 | }; |
67 | 67 | ||
68 | enum e_g2d_dir_mode { | ||
69 | G2D_DIR_MODE_POSITIVE = 0, | ||
70 | G2D_DIR_MODE_NEGATIVE = 1 | ||
71 | }; | ||
72 | |||
73 | union g2d_direction_val { | ||
74 | unsigned int val[2]; | ||
75 | struct { | ||
76 | /* SRC_MSK_DIRECT_REG [0:1] (source) */ | ||
77 | enum e_g2d_dir_mode src_x_direction:1; | ||
78 | enum e_g2d_dir_mode src_y_direction:1; | ||
79 | |||
80 | /* SRC_MSK_DIRECT_REG [2:3] */ | ||
81 | unsigned int reversed1:2; | ||
82 | |||
83 | /* SRC_MSK_DIRECT_REG [4:5] (mask) */ | ||
84 | enum e_g2d_dir_mode mask_x_direction:1; | ||
85 | enum e_g2d_dir_mode mask_y_direction:1; | ||
86 | |||
87 | /* SRC_MSK_DIRECT_REG [6:31] */ | ||
88 | unsigned int padding1:26; | ||
89 | |||
90 | /* DST_PAT_DIRECT_REG [0:1] (destination) */ | ||
91 | enum e_g2d_dir_mode dst_x_direction:1; | ||
92 | enum e_g2d_dir_mode dst_y_direction:1; | ||
93 | |||
94 | /* DST_PAT_DIRECT_REG [2:3] */ | ||
95 | unsigned int reversed2:2; | ||
96 | |||
97 | /* DST_PAT_DIRECT_REG [4:5] (pattern) */ | ||
98 | enum e_g2d_dir_mode pat_x_direction:1; | ||
99 | enum e_g2d_dir_mode pat_y_direction:1; | ||
100 | |||
101 | /* DST_PAT_DIRECT_REG [6:31] */ | ||
102 | unsigned int padding2:26; | ||
103 | } data; | ||
104 | }; | ||
105 | |||
68 | static unsigned int g2d_get_scaling(unsigned int src, unsigned int dst) | 106 | static unsigned int g2d_get_scaling(unsigned int src, unsigned int dst) |
69 | { | 107 | { |
70 | /* | 108 | /* |
@@ -242,6 +280,19 @@ static void g2d_add_base_addr(struct g2d_context *ctx, struct g2d_image *img, | |||
242 | } | 280 | } |
243 | 281 | ||
244 | /* | 282 | /* |
283 | * g2d_set_direction - setup direction register (useful for overlapping blits). | ||
284 | * | ||
285 | * @ctx: a pointer to g2d_context structure. | ||
286 | * @dir: a pointer to the g2d_direction_val structure. | ||
287 | */ | ||
288 | static void g2d_set_direction(struct g2d_context *ctx, | ||
289 | const union g2d_direction_val *dir) | ||
290 | { | ||
291 | g2d_add_cmd(ctx, SRC_MASK_DIRECT_REG, dir->val[0]); | ||
292 | g2d_add_cmd(ctx, DST_PAT_DIRECT_REG, dir->val[1]); | ||
293 | } | ||
294 | |||
295 | /* | ||
245 | * g2d_reset - reset fimg2d hardware. | 296 | * g2d_reset - reset fimg2d hardware. |
246 | * | 297 | * |
247 | * @ctx: a pointer to g2d_context structure. | 298 | * @ctx: a pointer to g2d_context structure. |