mmm_color_fmt: Added P010 512-bit alignment format

Change-Id: I5ae93dff7d04e5ca2915061751f85691c53abe67
Signed-off-by: Gurkaran Singh <gurksing@codeaurora.org>
This commit is contained in:
Gurkaran Singh
2021-05-05 18:06:13 -04:00
committed by Gerrit - the friendly Code Review server
parent e12be40f65
commit d750ee5742

View File

@@ -730,6 +730,41 @@ enum mmm_color_fmts {
* + UV_Stride * UV_Scanlines, 4096) * + UV_Stride * UV_Scanlines, 4096)
*/ */
MMM_COLOR_FMT_P010, MMM_COLOR_FMT_P010,
/* Venus P010_512:
* YUV 4:2:0 image with a plane of 10 bit Y samples followed
* by an interleaved U/V plane containing 10 bit 2x2 subsampled
* colour difference samples.
*
* <-------- Y/UV_Stride -------->
* <------- Width ------->
* Y Y Y Y Y Y Y Y Y Y Y Y . . . . ^ ^
* Y Y Y Y Y Y Y Y Y Y Y Y . . . . | |
* Y Y Y Y Y Y Y Y Y Y Y Y . . . . Height |
* Y Y Y Y Y Y Y Y Y Y Y Y . . . . | Y_Scanlines
* Y Y Y Y Y Y Y Y Y Y Y Y . . . . | |
* Y Y Y Y Y Y Y Y Y Y Y Y . . . . | |
* Y Y Y Y Y Y Y Y Y Y Y Y . . . . | |
* Y Y Y Y Y Y Y Y Y Y Y Y . . . . V |
* . . . . . . . . . . . . . . . . |
* . . . . . . . . . . . . . . . . |
* . . . . . . . . . . . . . . . . |
* . . . . . . . . . . . . . . . . V
* U V U V U V U V U V U V . . . . ^
* U V U V U V U V U V U V . . . . |
* U V U V U V U V U V U V . . . . |
* U V U V U V U V U V U V . . . . UV_Scanlines
* . . . . . . . . . . . . . . . . |
* . . . . . . . . . . . . . . . . V
* . . . . . . . . . . . . . . . . --> Buffer size alignment
*
* Y_Stride : Width * 2 aligned to 512
* UV_Stride : Width * 2 aligned to 512
* Y_Scanlines: Height aligned to 32
* UV_Scanlines: Height/2 aligned to 16
* Total size = align(Y_Stride * Y_Scanlines
* + UV_Stride * UV_Scanlines, 4096)
*/
MMM_COLOR_FMT_P010_512,
/* Venus NV12_512: /* Venus NV12_512:
* YUV 4:2:0 image with a plane of 8 bit Y samples followed * YUV 4:2:0 image with a plane of 8 bit Y samples followed
* by an interleaved U/V plane containing 8 bit 2x2 subsampled * by an interleaved U/V plane containing 8 bit 2x2 subsampled
@@ -849,6 +884,9 @@ static inline unsigned int MMM_COLOR_FMT_Y_STRIDE(unsigned int color_fmt,
alignment = 256; alignment = 256;
stride = MMM_COLOR_FMT_ALIGN(width * 2, alignment); stride = MMM_COLOR_FMT_ALIGN(width * 2, alignment);
break; break;
case MMM_COLOR_FMT_P010_512:
alignment = 512;
stride = MMM_COLOR_FMT_ALIGN(width * 2, alignment);
default: default:
break; break;
} }
@@ -892,6 +930,10 @@ static inline unsigned int MMM_COLOR_FMT_UV_STRIDE(unsigned int color_fmt,
alignment = 256; alignment = 256;
stride = MMM_COLOR_FMT_ALIGN(width * 2, alignment); stride = MMM_COLOR_FMT_ALIGN(width * 2, alignment);
break; break;
case MMM_COLOR_FMT_P010_512:
alignment = 512;
stride = MMM_COLOR_FMT_ALIGN(width * 2, alignment);
break;
default: default:
break; break;
} }
@@ -921,6 +963,7 @@ static inline unsigned int MMM_COLOR_FMT_Y_SCANLINES(unsigned int color_fmt,
case MMM_COLOR_FMT_NV12: case MMM_COLOR_FMT_NV12:
case MMM_COLOR_FMT_NV21: case MMM_COLOR_FMT_NV21:
case MMM_COLOR_FMT_NV12_UBWC: case MMM_COLOR_FMT_NV12_UBWC:
case MMM_COLOR_FMT_P010_512:
case MMM_COLOR_FMT_P010: case MMM_COLOR_FMT_P010:
alignment = 32; alignment = 32;
break; break;
@@ -960,6 +1003,7 @@ static inline unsigned int MMM_COLOR_FMT_UV_SCANLINES(unsigned int color_fmt,
case MMM_COLOR_FMT_NV21: case MMM_COLOR_FMT_NV21:
case MMM_COLOR_FMT_NV12_BPP10_UBWC: case MMM_COLOR_FMT_NV12_BPP10_UBWC:
case MMM_COLOR_FMT_P010_UBWC: case MMM_COLOR_FMT_P010_UBWC:
case MMM_COLOR_FMT_P010_512:
case MMM_COLOR_FMT_P010: case MMM_COLOR_FMT_P010:
alignment = 16; alignment = 16;
break; break;
@@ -1266,6 +1310,7 @@ static inline unsigned int MMM_COLOR_FMT_BUFFER_SIZE(unsigned int color_fmt,
switch (color_fmt) { switch (color_fmt) {
case MMM_COLOR_FMT_NV21: case MMM_COLOR_FMT_NV21:
case MMM_COLOR_FMT_NV12: case MMM_COLOR_FMT_NV12:
case MMM_COLOR_FMT_P010_512:
case MMM_COLOR_FMT_P010: case MMM_COLOR_FMT_P010:
case MMM_COLOR_FMT_NV12_512: case MMM_COLOR_FMT_NV12_512:
y_plane = y_stride * y_sclines; y_plane = y_stride * y_sclines;