drm_hwcomposer: Store pixel_stride in the hwc_drm_bo
The new GraphicBufferMapper ImportBuffer takes a pixel_stride
as an argument, so we need to caluclate that and store it in
the hwc_drm_bo at import so we can use it here.
I'd still welcome better ideas to calculate pixel_stride for
generic drm importer.
Change-Id: Iea2c483f3750dd5bed38740802b560911bc54ef2
Signed-off-by: John Stultz <john.stultz@linaro.org>
---
v2:
* Utilized pixel stride values already in some gralloc handle
implementations
* Fixed embarasing bit/byte math snafu (preserving bits per
pixel since YUV conversions using bytes doesn't seem sane)
- Extra review still would be appreciated here!
v3:
* Renamed to use Drm... instead of DRM...
diff --git a/drmhwcgralloc.h b/drmhwcgralloc.h
index abfd2c1..65a4007 100644
--- a/drmhwcgralloc.h
+++ b/drmhwcgralloc.h
@@ -26,6 +26,7 @@
uint32_t format; /* DRM_FORMAT_* from drm_fourcc.h */
uint32_t hal_format; /* HAL_PIXEL_FORMAT_* */
uint32_t usage;
+ uint32_t pixel_stride;
uint32_t pitches[HWC_DRM_BO_MAX_PLANES];
uint32_t offsets[HWC_DRM_BO_MAX_PLANES];
uint32_t gem_handles[HWC_DRM_BO_MAX_PLANES];