Revert "Revert "msm: media: uapi: Redefine NV12 format with different alignment""

This reverts commit f90529f1dec9bdf47082ed0c4d279918459b1be0.

This gerrit was temporarily reverted so as to align all the other
dependent gerrits to merge together.

Mot-CRs-Fixed:(CR)

Change-Id: Idcb99939488d6d83aee1a9c9af4e613820a3a181
Signed-off-by: V(CR) Garodia <vgarodia@codeaurora.org>
Reviewed-on: https://gerrit.mot.com/1730952
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Zilong Zhang <zhangzl7@lenovo.com>
Reviewed-by: Ji Zhao <zhaoji1@lenovo.com>
Reviewed-by: Zhuoran Xu <xuzr3@motorola.com>
Reviewed-by: Zhichao Chen <chenzc2@motorola.com>
Reviewed-by: Tao Sun <suntao2@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
Vikash Garodia authored and Gilberto Gambugge committed 2023-06-01 00:47:13 -03:00
1 parent 2c5bc95478
commit 7d4edd8312
1 file changed
+28 -8
+28 -8
View File
@@ -3,6 +3,16 @@
#define __MSM_MEDIA_INFO_H__
#include <asm/bitsperlong.h>
#if __BITS_PER_LONG == 64
#define NV12_STRIDE_ALIGNMENT 512
#define NV12_SCANLINE_ALIGNMENT 512
#else
#define NV12_STRIDE_ALIGNMENT 128
#define NV12_SCANLINE_ALIGNMENT 32
#endif
#ifdef VENUS_USE_64BIT_ALIGNMENT
#undef NV12_STRIDE_ALIGNMENT
#undef NV12_SCANLINE_ALIGNMENT
@@ -53,10 +63,10 @@ enum color_fmts {
* . . . . . . . . . . . . . . . . V
* . . . . . . . . . . . . . . . . --> Buffer size alignment
*
* Y_Stride : Width aligned to 512
* UV_Stride : Width aligned to 512
* Y_Scanlines: Height aligned to 512
* UV_Scanlines: Height/2 aligned to 256
* Y_Stride : Width aligned to 512 or 128
* UV_Stride : Width aligned to 512 or 128
* Y_Scanlines: Height aligned to 512 or 32
* UV_Scanlines: Height/2 aligned to 256 or 16
* Total size = align(Y_Stride * Y_Scanlines
* + UV_Stride * UV_Scanlines, 4096)
*/
@@ -123,10 +133,10 @@ enum color_fmts {
* . . . . . . . . . . . . . . . . V
* . . . . . . . . . . . . . . . . --> Padding & Buffer size alignment
*
* Y_Stride : Width aligned to 512
* UV_Stride : Width aligned to 512
* Y_Scanlines: Height aligned to 512
* UV_Scanlines: Height/2 aligned to 256
* Y_Stride : Width aligned to 512 or 128
* UV_Stride : Width aligned to 512 or 128
* Y_Scanlines: Height aligned to 512 or 32
* UV_Scanlines: Height/2 aligned to 256 or 16
* Total size = align(Y_Stride * Y_Scanlines
* + UV_Stride * UV_Scanlines, 4096)
*/
@@ -825,6 +835,9 @@ static inline unsigned int VENUS_Y_STRIDE(unsigned int color_fmt,
switch (color_fmt) {
case COLOR_FMT_NV12:
case COLOR_FMT_NV21:
alignment = NV12_STRIDE_ALIGNMENT;
stride = MSM_MEDIA_ALIGN(width, alignment);
break;
case COLOR_FMT_NV12_512:
alignment = 512;
stride = MSM_MEDIA_ALIGN(width, alignment);
@@ -869,6 +882,9 @@ static inline unsigned int VENUS_UV_STRIDE(unsigned int color_fmt,
switch (color_fmt) {
case COLOR_FMT_NV21:
case COLOR_FMT_NV12:
alignment = NV12_STRIDE_ALIGNMENT;
stride = MSM_MEDIA_ALIGN(width, alignment);
break;
case COLOR_FMT_NV12_512:
alignment = 512;
stride = MSM_MEDIA_ALIGN(width, alignment);
@@ -913,6 +929,8 @@ static inline unsigned int VENUS_Y_SCANLINES(unsigned int color_fmt,
switch (color_fmt) {
case COLOR_FMT_NV12:
case COLOR_FMT_NV21:
alignment = NV12_SCANLINE_ALIGNMENT;
break;
case COLOR_FMT_NV12_512:
alignment = 512;
break;
@@ -951,6 +969,8 @@ static inline unsigned int VENUS_UV_SCANLINES(unsigned int color_fmt,
switch (color_fmt) {
case COLOR_FMT_NV21:
case COLOR_FMT_NV12:
alignment = NV12_SCANLINE_ALIGNMENT/2;
break;
case COLOR_FMT_NV12_512:
alignment = 256;
break;