gralloc: Store aligned width in pvt handle for TP10

- For TP10 Venus UBWC format, the Venus macro returns the
  stride, which is 4/3 times the width.
- Need to store the pixel width instead of stride
  in the private handle hence * 3/4

Change-Id: I2c1348c6b90f141ecef6cabf493780325f17db77
Crs-fixed: 1059165
diff --git a/libgralloc/alloc_controller.cpp b/libgralloc/alloc_controller.cpp
index 0ef0a9a..55c1b2b 100644
--- a/libgralloc/alloc_controller.cpp
+++ b/libgralloc/alloc_controller.cpp
@@ -989,7 +989,8 @@
             aligned_h = VENUS_Y_SCANLINES(COLOR_FMT_NV12_UBWC, height);
             break;
         case HAL_PIXEL_FORMAT_YCbCr_420_TP10_UBWC:
-            aligned_w = VENUS_Y_STRIDE(COLOR_FMT_NV12_BPP10_UBWC, width);
+            // The macro returns the stride which is 4/3 times the width, hence * 3/4
+            aligned_w = (VENUS_Y_STRIDE(COLOR_FMT_NV12_BPP10_UBWC, width) * 3) / 4;
             aligned_h = VENUS_Y_SCANLINES(COLOR_FMT_NV12_BPP10_UBWC, height);
             break;
         default:
diff --git a/libgralloc1/gr_allocator.cpp b/libgralloc1/gr_allocator.cpp
index b45ba83..1a269be 100644
--- a/libgralloc1/gr_allocator.cpp
+++ b/libgralloc1/gr_allocator.cpp
@@ -670,6 +670,11 @@
       *aligned_w = VENUS_Y_STRIDE(COLOR_FMT_NV12_UBWC, width);
       *aligned_h = VENUS_Y_SCANLINES(COLOR_FMT_NV12_UBWC, height);
       break;
+    case HAL_PIXEL_FORMAT_YCbCr_420_TP10_UBWC:
+      // The macro returns the stride which is 4/3 times the width, hence * 3/4
+      *aligned_w = (VENUS_Y_STRIDE(COLOR_FMT_NV12_BPP10_UBWC, width) * 3) / 4;
+      *aligned_h = VENUS_Y_SCANLINES(COLOR_FMT_NV12_BPP10_UBWC, height);
+      break;
     default:
       ALOGE("%s: Unsupported pixel format: 0x%x", __FUNCTION__, format);
       *aligned_w = 0;