drm_hwcomposer: Add HWC_DRM_BO_MAX_PLANES constant
Add HWC_DRM_BO_MAX_PLANES to avoid open coded num_gem_handles
calculations.
Change-Id: Iebdaa67518e75f5b7f4445d92b97ca72e625c04b
Signed-off-by: John Stultz <john.stultz@linaro.org>
diff --git a/drmhwcgralloc.h b/drmhwcgralloc.h
index 759746a..daa44dc 100644
--- a/drmhwcgralloc.h
+++ b/drmhwcgralloc.h
@@ -19,14 +19,15 @@
#include <stdint.h>
+#define HWC_DRM_BO_MAX_PLANES 4
typedef struct hwc_drm_bo {
uint32_t width;
uint32_t height;
uint32_t format; /* DRM_FORMAT_* from drm_fourcc.h */
uint32_t usage;
- uint32_t pitches[4];
- uint32_t offsets[4];
- uint32_t gem_handles[4];
+ 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];
uint32_t fb_id;
int acquire_fence_fd;
void *priv;