tegra: Support tiled buffers

If GBM_BO_USE_RENDERING flag is passed, allocate tiled buffers.  Add logic
to the Tegra backend to compute tiled buffer dimensions and tiling
parameters (kind and block height).

The tiling parameters must somehow be passed to EGL at EGLImage creation.
The long term plan is to introduce an extensible structure that can contain
arbitrary vendor specific metadata.  For now, we abuse the PITCH attribute
to pass tiling parameters.

Add a new GBM utility function gbm_bo_get_stride_or_tiling, which returns
either the tiling parameters or byte pitch, depending whether the buffer
is tiled or not.

The Nvidia term for our tiled layout is "blocklinear".

BUG=None
TEST=null_platform_test on Tegra

Change-Id: I4e0226efa401b08f7e4a009a7f74b3453c622a10
Signed-off-by: Lauri Peltonen <lpeltonen@nvidia.com>
Reviewed-on: https://chromium-review.googlesource.com/236663
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Stéphane Marchesin <marcheu@chromium.org>
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
diff --git a/gbm.c b/gbm.c
index 483dfcf..b9f08f2 100644
--- a/gbm.c
+++ b/gbm.c
@@ -244,6 +244,12 @@
 }
 
 PUBLIC uint32_t
+gbm_bo_get_stride_or_tiling(struct gbm_bo *bo)
+{
+	return bo->tiling ? bo->tiling : bo->stride;
+}
+
+PUBLIC uint32_t
 gbm_bo_get_format(struct gbm_bo *bo)
 {
 	return bo->format;