diff options
author | Lucas Stach <l.stach@pengutronix.de> | 2015-12-15 17:27:25 +0100 |
---|---|---|
committer | Russell King <rmk@arm.linux.org.uk> | 2015-12-17 22:05:34 +0000 |
commit | 0db6ca5b10a3ceb93c6d657a767e6f56e3102a32 (patch) | |
tree | 6708110145f1df0a2251f050433e262bfe9fe68f | |
parent | 82ea3195d9297b387d74454b26c0bc1a50d9870a (diff) |
etnaviv: adapt to additional flags parameter
Update to the latest DRM API, which adds an additional flags parameter
to the relocations.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
-rw-r--r-- | etnaviv/etnadrm.c | 25 | ||||
-rw-r--r-- | etnaviv/etnaviv_drm.h | 10 |
2 files changed, 25 insertions, 10 deletions
diff --git a/etnaviv/etnadrm.c b/etnaviv/etnadrm.c index 21d6593..bdb40c6 100644 --- a/etnaviv/etnadrm.c +++ b/etnaviv/etnadrm.c @@ -1007,7 +1007,8 @@ void etna_emit_reloc(struct etna_ctx *ctx, uint32_t buf_offset, unsigned int api_date = to_etna_viv_conn(ctx->conn)->api_date; struct _gcoCMDBUF *buf = ctx->cmdbuf[ctx->cur_buf]; union reloc { - struct drm_etnaviv_gem_submit_reloc latest; + struct drm_etnaviv_gem_submit_reloc_r20151214 r20151214; + struct drm_etnaviv_gem_submit_reloc_r20150302 r20150302; struct drm_etnaviv_gem_submit_reloc_r20130625 r20130625; } reloc; uint32_t flags; @@ -1026,17 +1027,23 @@ void etna_emit_reloc(struct etna_ctx *ctx, uint32_t buf_offset, reloc.r20130625.reloc_offset = offset; reloc.r20130625.submit_offset = buf_offset * 4; } else if (api_date < ETNAVIV_DATE_PENGUTRONIX2) { - size = sizeof(reloc.latest); + size = sizeof(reloc.r20150302); memset(&reloc, 0, size); - reloc.latest.reloc_idx = index; - reloc.latest.reloc_offset = offset; - reloc.latest.submit_offset = buf_offset * 4; + reloc.r20150302.reloc_idx = index; + reloc.r20150302.reloc_offset = offset; + reloc.r20150302.submit_offset = buf_offset * 4; + } else if (api_date < ETNAVIV_DATE_PENGUTRONIX4) { + size = sizeof(reloc.r20150302); + memset(&reloc, 0, size); + reloc.r20150302.reloc_idx = index; + reloc.r20150302.reloc_offset = offset; + reloc.r20150302.submit_offset = buf_offset * 4 - buf->offset; } else { - size = sizeof(reloc.latest); + size = sizeof(reloc.r20151214); memset(&reloc, 0, size); - reloc.latest.reloc_idx = index; - reloc.latest.reloc_offset = offset; - reloc.latest.submit_offset = buf_offset * 4 - buf->offset; + reloc.r20151214.reloc_idx = index; + reloc.r20151214.reloc_offset = offset; + reloc.r20151214.submit_offset = buf_offset * 4 - buf->offset; } n = buf->num_relocs++; diff --git a/etnaviv/etnaviv_drm.h b/etnaviv/etnaviv_drm.h index f9cdc15..3f8b91e 100644 --- a/etnaviv/etnaviv_drm.h +++ b/etnaviv/etnaviv_drm.h @@ -22,6 +22,7 @@ #define ETNAVIV_DATE_PENGUTRONIX 20150302 #define ETNAVIV_DATE_PENGUTRONIX2 20150910 #define ETNAVIV_DATE_PENGUTRONIX3 20151126 +#define ETNAVIV_DATE_PENGUTRONIX4 20151214 #define ETNAVIV_DATE ETNAVIV_DATE_PENGUTRONIX #include <stddef.h> @@ -142,7 +143,14 @@ struct drm_etnaviv_gem_cpu_fini { * NOTE that reloc's must be sorted by order of increasing submit_offset, * otherwise EINVAL. */ -struct drm_etnaviv_gem_submit_reloc { +struct drm_etnaviv_gem_submit_reloc_r20151214 { + uint32_t submit_offset; /* in, offset from submit_bo */ + uint32_t reloc_idx; /* in, index of reloc_bo buffer */ + uint64_t reloc_offset; /* in, offset from start of reloc_bo */ + uint32_t flags; /* in, placeholder for now */ +}; + +struct drm_etnaviv_gem_submit_reloc_r20150302 { uint32_t submit_offset; /* in, offset from submit_bo */ uint32_t reloc_idx; /* in, index of reloc_bo buffer */ uint64_t reloc_offset; /* in, offset from start of reloc_bo */ |