aboutsummaryrefslogtreecommitdiffstats
path: root/exynos
diff options
context:
space:
mode:
authorTobias Jakobi2015-11-29 21:12:18 -0600
committerEmil Velikov2015-12-18 11:42:54 -0600
commit51fd93bc38a33df33f7bf6cbf1ae3fbf74a47dba (patch)
treea89863df9ec751ed09695a77ff164b2da1043c42 /exynos
parent1b32e5da44f4c1e24a60c6bad1fa8766cf36be39 (diff)
downloadexternal-libdrm-51fd93bc38a33df33f7bf6cbf1ae3fbf74a47dba.tar.gz
external-libdrm-51fd93bc38a33df33f7bf6cbf1ae3fbf74a47dba.tar.xz
external-libdrm-51fd93bc38a33df33f7bf6cbf1ae3fbf74a47dba.zip
exynos: fimg2d: add g2d_set_direction
This allows setting the two direction registers, which specify how the engine blits pixels. This can be used for overlapping blits, which happen e.g. when 'moving' a rectangular region inside a fixed buffer. Reviewed-by: Hyungwon Hwang <human.hwang@samsung.com> Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
Diffstat (limited to 'exynos')
-rw-r--r--exynos/exynos_fimg2d.c51
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
68enum e_g2d_dir_mode {
69 G2D_DIR_MODE_POSITIVE = 0,
70 G2D_DIR_MODE_NEGATIVE = 1
71};
72
73union 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
68static unsigned int g2d_get_scaling(unsigned int src, unsigned int dst) 106static 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 */
288static 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.