gbm: Export a per plane getter for offset
authorBen Widawsky <ben@bwidawsk.net>
Wed, 26 Oct 2016 23:02:23 +0000 (16:02 -0700)
committerBen Widawsky <ben@bwidawsk.net>
Thu, 9 Mar 2017 23:35:44 +0000 (15:35 -0800)
commit2ee34bd5dcf30f202c9f37e3d986640f71b8a210
tree03be27dd1feb00d44578acbd5e37fc7d00ea43fe
parent7f6209e46f8de409f182931e0ca23bb64f1a8e39
gbm: Export a per plane getter for offset

Unlike stride, there was no previous offset getter, so it can be right
on the first try.

v2: Return EINVAL when plane is greater than total planes to make it
match the similar APIs.
Avoid leak after fromPlanar (Daniel)
Make sure when getting offsets we consider dumb images (Daniel)

v3: Use Jason's recommendation for handling the non-planar case.

v4: Return int64_t so we can get real errors

v5: Add an assertion for dumb BOs (Jason)

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Daniel Stone <daniels@collabora.com>
src/gbm/backends/dri/gbm_dri.c
src/gbm/gbm-symbols-check
src/gbm/main/gbm.c
src/gbm/main/gbm.h
src/gbm/main/gbmint.h