aboutsummaryrefslogtreecommitdiffstats
path: root/exynos
diff options
context:
space:
mode:
authorTobias Jakobi2015-11-29 21:12:15 -0600
committerEmil Velikov2015-12-18 11:42:54 -0600
commit60df3581961ef7f1003459f696e5954b5df30aeb (patch)
tree50179500d1d4e3a0eea869c640c108e06a248db1 /exynos
parent2e4b9f08c74fa591a0fd1655c0caa5f41eb9a5b6 (diff)
downloadexternal-libgbm-60df3581961ef7f1003459f696e5954b5df30aeb.tar.gz
external-libgbm-60df3581961ef7f1003459f696e5954b5df30aeb.tar.xz
external-libgbm-60df3581961ef7f1003459f696e5954b5df30aeb.zip
exynos/fimg2d: add g2d_config_event
This enables us to pass command buffers to the kernel which trigger an event on the DRM fd upon completion. The final goal is to enable asynchronous operation of the G2D engine, similar to async page flips. Passing the event userdata pointer through the G2D context was chosen to not change the current API (e.g. by adding a userdata argument to each public functions). Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Diffstat (limited to 'exynos')
-rwxr-xr-xexynos/exynos-symbol-check1
-rw-r--r--exynos/exynos_fimg2d.c28
-rw-r--r--exynos/exynos_fimg2d.h1
3 files changed, 28 insertions, 2 deletions
diff --git a/exynos/exynos-symbol-check b/exynos/exynos-symbol-check
index c3ddbe4d..bb12315e 100755
--- a/exynos/exynos-symbol-check
+++ b/exynos/exynos-symbol-check
@@ -27,6 +27,7 @@ g2d_blend
27g2d_copy 27g2d_copy
28g2d_copy_with_scale 28g2d_copy_with_scale
29g2d_exec 29g2d_exec
30g2d_config_event
30g2d_fini 31g2d_fini
31g2d_init 32g2d_init
32g2d_scale_and_blend 33g2d_scale_and_blend
diff --git a/exynos/exynos_fimg2d.c b/exynos/exynos_fimg2d.c
index e7341449..b10620b2 100644
--- a/exynos/exynos_fimg2d.c
+++ b/exynos/exynos_fimg2d.c
@@ -57,6 +57,7 @@ struct g2d_context {
57 unsigned int cmd_nr; 57 unsigned int cmd_nr;
58 unsigned int cmd_buf_nr; 58 unsigned int cmd_buf_nr;
59 unsigned int cmdlist_nr; 59 unsigned int cmdlist_nr;
60 void *event_userdata;
60}; 61};
61 62
62enum g2d_base_addr_reg { 63enum g2d_base_addr_reg {
@@ -280,8 +281,15 @@ static int g2d_flush(struct g2d_context *ctx)
280 cmdlist.cmd_buf = (uint64_t)(uintptr_t)&ctx->cmd_buf[0]; 281 cmdlist.cmd_buf = (uint64_t)(uintptr_t)&ctx->cmd_buf[0];
281 cmdlist.cmd_nr = ctx->cmd_nr; 282 cmdlist.cmd_nr = ctx->cmd_nr;
282 cmdlist.cmd_buf_nr = ctx->cmd_buf_nr; 283 cmdlist.cmd_buf_nr = ctx->cmd_buf_nr;
283 cmdlist.event_type = G2D_EVENT_NOT; 284
284 cmdlist.user_data = 0; 285 if (ctx->event_userdata) {
286 cmdlist.event_type = G2D_EVENT_NONSTOP;
287 cmdlist.user_data = (uint64_t)(uintptr_t)(ctx->event_userdata);
288 ctx->event_userdata = NULL;
289 } else {
290 cmdlist.event_type = G2D_EVENT_NOT;
291 cmdlist.user_data = 0;
292 }
285 293
286 ctx->cmd_nr = 0; 294 ctx->cmd_nr = 0;
287 ctx->cmd_buf_nr = 0; 295 ctx->cmd_buf_nr = 0;
@@ -336,6 +344,22 @@ void g2d_fini(struct g2d_context *ctx)
336} 344}
337 345
338/** 346/**
347 * g2d_config_event - setup userdata configuration for a g2d event.
348 * The next invocation of a g2d call (e.g. g2d_solid_fill) is
349 * then going to flag the command buffer as 'nonstop'.
350 * Completion of the command buffer execution can then be
351 * determined by using drmHandleEvent on the DRM fd.
352 * The userdata is 'consumed' in the process.
353 *
354 * @ctx: a pointer to g2d_context structure.
355 * @userdata: a pointer to the user data
356 */
357void g2d_config_event(struct g2d_context *ctx, void *userdata)
358{
359 ctx->event_userdata = userdata;
360}
361
362/**
339 * g2d_exec - start the dma to process all commands summited by g2d_flush(). 363 * g2d_exec - start the dma to process all commands summited by g2d_flush().
340 * 364 *
341 * @ctx: a pointer to g2d_context structure. 365 * @ctx: a pointer to g2d_context structure.
diff --git a/exynos/exynos_fimg2d.h b/exynos/exynos_fimg2d.h
index 4aa15683..a2c22da7 100644
--- a/exynos/exynos_fimg2d.h
+++ b/exynos/exynos_fimg2d.h
@@ -290,6 +290,7 @@ struct g2d_context;
290 290
291struct g2d_context *g2d_init(int fd); 291struct g2d_context *g2d_init(int fd);
292void g2d_fini(struct g2d_context *ctx); 292void g2d_fini(struct g2d_context *ctx);
293void g2d_config_event(struct g2d_context *ctx, void *userdata);
293int g2d_exec(struct g2d_context *ctx); 294int g2d_exec(struct g2d_context *ctx);
294int g2d_solid_fill(struct g2d_context *ctx, struct g2d_image *img, 295int g2d_solid_fill(struct g2d_context *ctx, struct g2d_image *img,
295 unsigned int x, unsigned int y, unsigned int w, 296 unsigned int x, unsigned int y, unsigned int w,