video: driver: update msm_media_info to use vidc colorformat
Update all functions in msm_media_info.h to use vidc color formats instead of v4l2 color formats macros to restrict the usage of private color format defines in only helper functions. Change-Id: Ib308c76af7b16ddac93023202191a47b21d68f5c Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
This commit is contained in:
@@ -72,18 +72,6 @@ static struct msm_platform_core_capability core_data_anorak[] = {
|
|||||||
{HW_RESPONSE_TIMEOUT, HW_RESPONSE_TIMEOUT_VALUE}, /* 1000 ms */
|
{HW_RESPONSE_TIMEOUT, HW_RESPONSE_TIMEOUT_VALUE}, /* 1000 ms */
|
||||||
{SW_PC_DELAY, SW_PC_DELAY_VALUE }, /* 1500 ms (>HW_RESPONSE_TIMEOUT)*/
|
{SW_PC_DELAY, SW_PC_DELAY_VALUE }, /* 1500 ms (>HW_RESPONSE_TIMEOUT)*/
|
||||||
{FW_UNLOAD_DELAY, FW_UNLOAD_DELAY_VALUE }, /* 3000 ms (>SW_PC_DELAY)*/
|
{FW_UNLOAD_DELAY, FW_UNLOAD_DELAY_VALUE }, /* 3000 ms (>SW_PC_DELAY)*/
|
||||||
// TODO: review below entries, and if required rename as PREFETCH
|
|
||||||
{PREFIX_BUF_COUNT_PIX, 18},
|
|
||||||
{PREFIX_BUF_SIZE_PIX, 13434880}, /* Calculated by VIDEO_RAW_BUFFER_SIZE for 4096x2160 UBWC */
|
|
||||||
{PREFIX_BUF_COUNT_NON_PIX, 1},
|
|
||||||
{PREFIX_BUF_SIZE_NON_PIX, 209715200}, /*
|
|
||||||
* Internal buffer size is calculated for secure decode session
|
|
||||||
* of resolution 4k (4096x2160)
|
|
||||||
* Internal buf size = calculate_scratch_size() +
|
|
||||||
* calculate_scratch1_size() + calculate_persist1_size()
|
|
||||||
* Take maximum between VP9 10bit, HEVC 10bit, AVC secure
|
|
||||||
* decoder sessions
|
|
||||||
*/
|
|
||||||
{PAGEFAULT_NON_FATAL, 1},
|
{PAGEFAULT_NON_FATAL, 1},
|
||||||
{PAGETABLE_CACHING, 0},
|
{PAGETABLE_CACHING, 0},
|
||||||
{DCVS, 1},
|
{DCVS, 1},
|
||||||
|
@@ -73,18 +73,6 @@ static struct msm_platform_core_capability core_data_kalama[] = {
|
|||||||
{HW_RESPONSE_TIMEOUT, HW_RESPONSE_TIMEOUT_VALUE}, /* 1000 ms */
|
{HW_RESPONSE_TIMEOUT, HW_RESPONSE_TIMEOUT_VALUE}, /* 1000 ms */
|
||||||
{SW_PC_DELAY, SW_PC_DELAY_VALUE }, /* 1500 ms (>HW_RESPONSE_TIMEOUT)*/
|
{SW_PC_DELAY, SW_PC_DELAY_VALUE }, /* 1500 ms (>HW_RESPONSE_TIMEOUT)*/
|
||||||
{FW_UNLOAD_DELAY, FW_UNLOAD_DELAY_VALUE }, /* 3000 ms (>SW_PC_DELAY)*/
|
{FW_UNLOAD_DELAY, FW_UNLOAD_DELAY_VALUE }, /* 3000 ms (>SW_PC_DELAY)*/
|
||||||
// TODO: review below entries, and if required rename as PREFETCH
|
|
||||||
{PREFIX_BUF_COUNT_PIX, 18},
|
|
||||||
{PREFIX_BUF_SIZE_PIX, 13434880}, /* Calculated by VIDEO_RAW_BUFFER_SIZE for 4096x2160 UBWC */
|
|
||||||
{PREFIX_BUF_COUNT_NON_PIX, 1},
|
|
||||||
{PREFIX_BUF_SIZE_NON_PIX, 209715200}, /*
|
|
||||||
* Internal buffer size is calculated for secure decode session
|
|
||||||
* of resolution 4k (4096x2160)
|
|
||||||
* Internal buf size = calculate_scratch_size() +
|
|
||||||
* calculate_scratch1_size() + calculate_persist1_size()
|
|
||||||
* Take maximum between VP9 10bit, HEVC 10bit, AVC secure
|
|
||||||
* decoder sessions
|
|
||||||
*/
|
|
||||||
{PAGEFAULT_NON_FATAL, 1},
|
{PAGEFAULT_NON_FATAL, 1},
|
||||||
{PAGETABLE_CACHING, 0},
|
{PAGETABLE_CACHING, 0},
|
||||||
{DCVS, 1},
|
{DCVS, 1},
|
||||||
|
@@ -69,18 +69,6 @@ static struct msm_platform_core_capability core_data_waipio[] = {
|
|||||||
{HW_RESPONSE_TIMEOUT, HW_RESPONSE_TIMEOUT_VALUE}, /* 1000 ms */
|
{HW_RESPONSE_TIMEOUT, HW_RESPONSE_TIMEOUT_VALUE}, /* 1000 ms */
|
||||||
{SW_PC_DELAY, SW_PC_DELAY_VALUE }, /* 1500 ms (>HW_RESPONSE_TIMEOUT)*/
|
{SW_PC_DELAY, SW_PC_DELAY_VALUE }, /* 1500 ms (>HW_RESPONSE_TIMEOUT)*/
|
||||||
{FW_UNLOAD_DELAY, FW_UNLOAD_DELAY_VALUE }, /* 3000 ms (>SW_PC_DELAY)*/
|
{FW_UNLOAD_DELAY, FW_UNLOAD_DELAY_VALUE }, /* 3000 ms (>SW_PC_DELAY)*/
|
||||||
// TODO: review below entries, and if required rename as PREFETCH
|
|
||||||
{PREFIX_BUF_COUNT_PIX, 18},
|
|
||||||
{PREFIX_BUF_SIZE_PIX, 13434880}, /* Calculated by VIDEO_RAW_BUFFER_SIZE for 4096x2160 UBWC */
|
|
||||||
{PREFIX_BUF_COUNT_NON_PIX, 1},
|
|
||||||
{PREFIX_BUF_SIZE_NON_PIX, 209715200}, /*
|
|
||||||
* Internal buffer size is calculated for secure decode session
|
|
||||||
* of resolution 4k (4096x2160)
|
|
||||||
* Internal buf size = calculate_scratch_size() +
|
|
||||||
* calculate_scratch1_size() + calculate_persist1_size()
|
|
||||||
* Take maximum between VP9 10bit, HEVC 10bit, AVC secure
|
|
||||||
* decoder sessions
|
|
||||||
*/
|
|
||||||
{PAGEFAULT_NON_FATAL, 1},
|
{PAGEFAULT_NON_FATAL, 1},
|
||||||
{PAGETABLE_CACHING, 0},
|
{PAGETABLE_CACHING, 0},
|
||||||
{DCVS, 1},
|
{DCVS, 1},
|
||||||
|
@@ -221,23 +221,27 @@ static u32 msm_vidc_decoder_dpb_size_iris2(struct msm_vidc_inst *inst)
|
|||||||
height = f->fmt.pix_mp.height;
|
height = f->fmt.pix_mp.height;
|
||||||
|
|
||||||
if (color_fmt == MSM_VIDC_FMT_NV12) {
|
if (color_fmt == MSM_VIDC_FMT_NV12) {
|
||||||
v4l2_fmt = V4L2_PIX_FMT_VIDC_NV12C;
|
color_fmt = MSM_VIDC_FMT_NV12C;
|
||||||
HFI_NV12_UBWC_IL_CALC_BUF_SIZE_V2(size, width, height,
|
HFI_NV12_UBWC_IL_CALC_BUF_SIZE_V2(size, width, height,
|
||||||
VIDEO_Y_STRIDE_BYTES(v4l2_fmt, width), VIDEO_Y_SCANLINES(v4l2_fmt, height),
|
video_y_stride_bytes(color_fmt, width),
|
||||||
VIDEO_UV_STRIDE_BYTES(v4l2_fmt, width), VIDEO_UV_SCANLINES(v4l2_fmt, height),
|
video_y_scanlines(color_fmt, height),
|
||||||
VIDEO_Y_META_STRIDE(v4l2_fmt, width), VIDEO_Y_META_SCANLINES(v4l2_fmt,
|
video_uv_stride_bytes(color_fmt, width),
|
||||||
height),
|
video_uv_scanlines(color_fmt, height),
|
||||||
VIDEO_UV_META_STRIDE(v4l2_fmt, width), VIDEO_UV_META_SCANLINES(v4l2_fmt,
|
video_y_meta_stride(color_fmt, width),
|
||||||
height));
|
video_y_meta_scanlines(color_fmt, height),
|
||||||
|
video_uv_meta_stride(color_fmt, width),
|
||||||
|
video_uv_meta_scanlines(color_fmt, height));
|
||||||
} else if (color_fmt == MSM_VIDC_FMT_P010) {
|
} else if (color_fmt == MSM_VIDC_FMT_P010) {
|
||||||
v4l2_fmt = V4L2_PIX_FMT_VIDC_TP10C;
|
color_fmt = MSM_VIDC_FMT_TP10C;
|
||||||
HFI_YUV420_TP10_UBWC_CALC_BUF_SIZE(size,
|
HFI_YUV420_TP10_UBWC_CALC_BUF_SIZE(size,
|
||||||
VIDEO_Y_STRIDE_BYTES(v4l2_fmt, width), VIDEO_Y_SCANLINES(v4l2_fmt, height),
|
video_y_stride_bytes(color_fmt, width),
|
||||||
VIDEO_UV_STRIDE_BYTES(v4l2_fmt, width), VIDEO_UV_SCANLINES(v4l2_fmt, height),
|
video_y_scanlines(color_fmt, height),
|
||||||
VIDEO_Y_META_STRIDE(v4l2_fmt, width), VIDEO_Y_META_SCANLINES(v4l2_fmt,
|
video_uv_stride_bytes(color_fmt, width),
|
||||||
height),
|
video_uv_scanlines(color_fmt, height),
|
||||||
VIDEO_UV_META_STRIDE(v4l2_fmt, width), VIDEO_UV_META_SCANLINES(v4l2_fmt,
|
video_y_meta_stride(color_fmt, width),
|
||||||
height));
|
video_y_meta_scanlines(color_fmt, height),
|
||||||
|
video_uv_meta_stride(color_fmt, width),
|
||||||
|
video_uv_meta_scanlines(color_fmt, height));
|
||||||
}
|
}
|
||||||
|
|
||||||
i_vpr_l(inst, "%s: size %d\n", __func__, size);
|
i_vpr_l(inst, "%s: size %d\n", __func__, size);
|
||||||
|
@@ -260,7 +260,7 @@ static u32 msm_vidc_decoder_dpb_size_iris3(struct msm_vidc_inst *inst)
|
|||||||
{
|
{
|
||||||
|
|
||||||
u32 size = 0;
|
u32 size = 0;
|
||||||
u32 color_fmt, v4l2_fmt;
|
u32 color_fmt;
|
||||||
u32 width, height;
|
u32 width, height;
|
||||||
struct v4l2_format *f;
|
struct v4l2_format *f;
|
||||||
|
|
||||||
@@ -285,24 +285,28 @@ static u32 msm_vidc_decoder_dpb_size_iris3(struct msm_vidc_inst *inst)
|
|||||||
|
|
||||||
if (color_fmt == MSM_VIDC_FMT_NV12 ||
|
if (color_fmt == MSM_VIDC_FMT_NV12 ||
|
||||||
color_fmt == MSM_VIDC_FMT_NV12C) {
|
color_fmt == MSM_VIDC_FMT_NV12C) {
|
||||||
v4l2_fmt = V4L2_PIX_FMT_VIDC_NV12C;
|
color_fmt = MSM_VIDC_FMT_NV12C;
|
||||||
HFI_NV12_UBWC_IL_CALC_BUF_SIZE_V2(size, width, height,
|
HFI_NV12_UBWC_IL_CALC_BUF_SIZE_V2(size, width, height,
|
||||||
VIDEO_Y_STRIDE_BYTES(v4l2_fmt, width), VIDEO_Y_SCANLINES(v4l2_fmt, height),
|
video_y_stride_bytes(color_fmt, width),
|
||||||
VIDEO_UV_STRIDE_BYTES(v4l2_fmt, width), VIDEO_UV_SCANLINES(v4l2_fmt, height),
|
video_y_scanlines(color_fmt, height),
|
||||||
VIDEO_Y_META_STRIDE(v4l2_fmt, width), VIDEO_Y_META_SCANLINES(v4l2_fmt,
|
video_uv_stride_bytes(color_fmt, width),
|
||||||
height),
|
video_uv_scanlines(color_fmt, height),
|
||||||
VIDEO_UV_META_STRIDE(v4l2_fmt, width), VIDEO_UV_META_SCANLINES(v4l2_fmt,
|
video_y_meta_stride(color_fmt, width),
|
||||||
height));
|
video_y_meta_scanlines(color_fmt, height),
|
||||||
|
video_uv_meta_stride(color_fmt, width),
|
||||||
|
video_uv_meta_scanlines(color_fmt, height));
|
||||||
} else if (color_fmt == MSM_VIDC_FMT_P010 ||
|
} else if (color_fmt == MSM_VIDC_FMT_P010 ||
|
||||||
color_fmt == MSM_VIDC_FMT_TP10C) {
|
color_fmt == MSM_VIDC_FMT_TP10C) {
|
||||||
v4l2_fmt = V4L2_PIX_FMT_VIDC_TP10C;
|
color_fmt = MSM_VIDC_FMT_TP10C;
|
||||||
HFI_YUV420_TP10_UBWC_CALC_BUF_SIZE(size,
|
HFI_YUV420_TP10_UBWC_CALC_BUF_SIZE(size,
|
||||||
VIDEO_Y_STRIDE_BYTES(v4l2_fmt, width), VIDEO_Y_SCANLINES(v4l2_fmt, height),
|
video_y_stride_bytes(color_fmt, width),
|
||||||
VIDEO_UV_STRIDE_BYTES(v4l2_fmt, width), VIDEO_UV_SCANLINES(v4l2_fmt, height),
|
video_y_scanlines(color_fmt, height),
|
||||||
VIDEO_Y_META_STRIDE(v4l2_fmt, width), VIDEO_Y_META_SCANLINES(v4l2_fmt,
|
video_uv_stride_bytes(color_fmt, width),
|
||||||
height),
|
video_uv_scanlines(color_fmt, height),
|
||||||
VIDEO_UV_META_STRIDE(v4l2_fmt, width), VIDEO_UV_META_SCANLINES(v4l2_fmt,
|
video_y_meta_stride(color_fmt, width),
|
||||||
height));
|
video_y_meta_scanlines(color_fmt, height),
|
||||||
|
video_uv_meta_stride(color_fmt, width),
|
||||||
|
video_uv_meta_scanlines(color_fmt, height));
|
||||||
}
|
}
|
||||||
|
|
||||||
i_vpr_l(inst, "%s: size %d\n", __func__, size);
|
i_vpr_l(inst, "%s: size %d\n", __func__, size);
|
||||||
|
@@ -6,8 +6,7 @@
|
|||||||
#ifndef __MSM_MEDIA_INFO_H__
|
#ifndef __MSM_MEDIA_INFO_H__
|
||||||
#define __MSM_MEDIA_INFO_H__
|
#define __MSM_MEDIA_INFO_H__
|
||||||
|
|
||||||
#include <media/v4l2_vidc_extensions.h>
|
#include "msm_vidc_internal.h"
|
||||||
#include <linux/videodev2.h>
|
|
||||||
|
|
||||||
/* Width and Height should be multiple of 16 */
|
/* Width and Height should be multiple of 16 */
|
||||||
#define INTERLACE_WIDTH_MAX 1920
|
#define INTERLACE_WIDTH_MAX 1920
|
||||||
@@ -31,7 +30,7 @@
|
|||||||
* Progressive: width
|
* Progressive: width
|
||||||
* Interlaced: width
|
* Interlaced: width
|
||||||
*/
|
*/
|
||||||
static inline unsigned int VIDEO_Y_STRIDE_BYTES(unsigned int v4l2_fmt,
|
static inline unsigned int video_y_stride_bytes(unsigned int colorformat,
|
||||||
unsigned int width)
|
unsigned int width)
|
||||||
{
|
{
|
||||||
unsigned int alignment, stride = 0;
|
unsigned int alignment, stride = 0;
|
||||||
@@ -39,19 +38,19 @@ static inline unsigned int VIDEO_Y_STRIDE_BYTES(unsigned int v4l2_fmt,
|
|||||||
if (!width)
|
if (!width)
|
||||||
goto invalid_input;
|
goto invalid_input;
|
||||||
|
|
||||||
switch (v4l2_fmt) {
|
switch (colorformat) {
|
||||||
case V4L2_PIX_FMT_NV12:
|
case MSM_VIDC_FMT_NV12:
|
||||||
case V4L2_PIX_FMT_NV21:
|
case MSM_VIDC_FMT_NV21:
|
||||||
case V4L2_PIX_FMT_VIDC_NV12C:
|
case MSM_VIDC_FMT_NV12C:
|
||||||
alignment = 128;
|
alignment = 128;
|
||||||
stride = MSM_MEDIA_ALIGN(width, alignment);
|
stride = MSM_MEDIA_ALIGN(width, alignment);
|
||||||
break;
|
break;
|
||||||
case V4L2_PIX_FMT_VIDC_TP10C:
|
case MSM_VIDC_FMT_TP10C:
|
||||||
alignment = 256;
|
alignment = 256;
|
||||||
stride = MSM_MEDIA_ALIGN(width, 192);
|
stride = MSM_MEDIA_ALIGN(width, 192);
|
||||||
stride = MSM_MEDIA_ALIGN(stride * 4/3, alignment);
|
stride = MSM_MEDIA_ALIGN(stride * 4/3, alignment);
|
||||||
break;
|
break;
|
||||||
case V4L2_PIX_FMT_VIDC_P010:
|
case MSM_VIDC_FMT_P010:
|
||||||
alignment = 256;
|
alignment = 256;
|
||||||
stride = MSM_MEDIA_ALIGN(width * 2, alignment);
|
stride = MSM_MEDIA_ALIGN(width * 2, alignment);
|
||||||
break;
|
break;
|
||||||
@@ -69,7 +68,7 @@ invalid_input:
|
|||||||
* Progressive: width
|
* Progressive: width
|
||||||
* Interlaced: width
|
* Interlaced: width
|
||||||
*/
|
*/
|
||||||
static inline unsigned int VIDEO_Y_STRIDE_PIX(unsigned int v4l2_fmt,
|
static inline unsigned int video_y_stride_pix(unsigned int colorformat,
|
||||||
unsigned int width)
|
unsigned int width)
|
||||||
{
|
{
|
||||||
unsigned int alignment, stride = 0;
|
unsigned int alignment, stride = 0;
|
||||||
@@ -77,15 +76,15 @@ static inline unsigned int VIDEO_Y_STRIDE_PIX(unsigned int v4l2_fmt,
|
|||||||
if (!width)
|
if (!width)
|
||||||
goto invalid_input;
|
goto invalid_input;
|
||||||
|
|
||||||
switch (v4l2_fmt) {
|
switch (colorformat) {
|
||||||
case V4L2_PIX_FMT_NV12:
|
case MSM_VIDC_FMT_NV12:
|
||||||
case V4L2_PIX_FMT_NV21:
|
case MSM_VIDC_FMT_NV21:
|
||||||
case V4L2_PIX_FMT_VIDC_NV12C:
|
case MSM_VIDC_FMT_NV12C:
|
||||||
case V4L2_PIX_FMT_VIDC_P010:
|
case MSM_VIDC_FMT_P010:
|
||||||
alignment = 128;
|
alignment = 128;
|
||||||
stride = MSM_MEDIA_ALIGN(width, alignment);
|
stride = MSM_MEDIA_ALIGN(width, alignment);
|
||||||
break;
|
break;
|
||||||
case V4L2_PIX_FMT_VIDC_TP10C:
|
case MSM_VIDC_FMT_TP10C:
|
||||||
alignment = 192;
|
alignment = 192;
|
||||||
stride = MSM_MEDIA_ALIGN(width, alignment);
|
stride = MSM_MEDIA_ALIGN(width, alignment);
|
||||||
break;
|
break;
|
||||||
@@ -103,7 +102,7 @@ invalid_input:
|
|||||||
* Progressive: width
|
* Progressive: width
|
||||||
* Interlaced: width
|
* Interlaced: width
|
||||||
*/
|
*/
|
||||||
static inline unsigned int VIDEO_UV_STRIDE_BYTES(unsigned int v4l2_fmt,
|
static inline unsigned int video_uv_stride_bytes(unsigned int colorformat,
|
||||||
unsigned int width)
|
unsigned int width)
|
||||||
{
|
{
|
||||||
unsigned int alignment, stride = 0;
|
unsigned int alignment, stride = 0;
|
||||||
@@ -111,19 +110,19 @@ static inline unsigned int VIDEO_UV_STRIDE_BYTES(unsigned int v4l2_fmt,
|
|||||||
if (!width)
|
if (!width)
|
||||||
goto invalid_input;
|
goto invalid_input;
|
||||||
|
|
||||||
switch (v4l2_fmt) {
|
switch (colorformat) {
|
||||||
case V4L2_PIX_FMT_NV21:
|
case MSM_VIDC_FMT_NV21:
|
||||||
case V4L2_PIX_FMT_NV12:
|
case MSM_VIDC_FMT_NV12:
|
||||||
case V4L2_PIX_FMT_VIDC_NV12C:
|
case MSM_VIDC_FMT_NV12C:
|
||||||
alignment = 128;
|
alignment = 128;
|
||||||
stride = MSM_MEDIA_ALIGN(width, alignment);
|
stride = MSM_MEDIA_ALIGN(width, alignment);
|
||||||
break;
|
break;
|
||||||
case V4L2_PIX_FMT_VIDC_TP10C:
|
case MSM_VIDC_FMT_TP10C:
|
||||||
alignment = 256;
|
alignment = 256;
|
||||||
stride = MSM_MEDIA_ALIGN(width, 192);
|
stride = MSM_MEDIA_ALIGN(width, 192);
|
||||||
stride = MSM_MEDIA_ALIGN(stride * 4/3, alignment);
|
stride = MSM_MEDIA_ALIGN(stride * 4/3, alignment);
|
||||||
break;
|
break;
|
||||||
case V4L2_PIX_FMT_VIDC_P010:
|
case MSM_VIDC_FMT_P010:
|
||||||
alignment = 256;
|
alignment = 256;
|
||||||
stride = MSM_MEDIA_ALIGN(width * 2, alignment);
|
stride = MSM_MEDIA_ALIGN(width * 2, alignment);
|
||||||
break;
|
break;
|
||||||
@@ -141,7 +140,7 @@ invalid_input:
|
|||||||
* Progressive: width
|
* Progressive: width
|
||||||
* Interlaced: width
|
* Interlaced: width
|
||||||
*/
|
*/
|
||||||
static inline unsigned int VIDEO_UV_STRIDE_PIX(unsigned int v4l2_fmt,
|
static inline unsigned int video_uv_stride_pix(unsigned int colorformat,
|
||||||
unsigned int width)
|
unsigned int width)
|
||||||
{
|
{
|
||||||
unsigned int alignment, stride = 0;
|
unsigned int alignment, stride = 0;
|
||||||
@@ -149,15 +148,15 @@ static inline unsigned int VIDEO_UV_STRIDE_PIX(unsigned int v4l2_fmt,
|
|||||||
if (!width)
|
if (!width)
|
||||||
goto invalid_input;
|
goto invalid_input;
|
||||||
|
|
||||||
switch (v4l2_fmt) {
|
switch (colorformat) {
|
||||||
case V4L2_PIX_FMT_NV21:
|
case MSM_VIDC_FMT_NV21:
|
||||||
case V4L2_PIX_FMT_NV12:
|
case MSM_VIDC_FMT_NV12:
|
||||||
case V4L2_PIX_FMT_VIDC_NV12C:
|
case MSM_VIDC_FMT_NV12C:
|
||||||
case V4L2_PIX_FMT_VIDC_P010:
|
case MSM_VIDC_FMT_P010:
|
||||||
alignment = 128;
|
alignment = 128;
|
||||||
stride = MSM_MEDIA_ALIGN(width, alignment);
|
stride = MSM_MEDIA_ALIGN(width, alignment);
|
||||||
break;
|
break;
|
||||||
case V4L2_PIX_FMT_VIDC_TP10C:
|
case MSM_VIDC_FMT_TP10C:
|
||||||
alignment = 192;
|
alignment = 192;
|
||||||
stride = MSM_MEDIA_ALIGN(width, alignment);
|
stride = MSM_MEDIA_ALIGN(width, alignment);
|
||||||
break;
|
break;
|
||||||
@@ -175,7 +174,7 @@ invalid_input:
|
|||||||
* Progressive: height
|
* Progressive: height
|
||||||
* Interlaced: (height+1)>>1
|
* Interlaced: (height+1)>>1
|
||||||
*/
|
*/
|
||||||
static inline unsigned int VIDEO_Y_SCANLINES(unsigned int v4l2_fmt,
|
static inline unsigned int video_y_scanlines(unsigned int colorformat,
|
||||||
unsigned int height)
|
unsigned int height)
|
||||||
{
|
{
|
||||||
unsigned int alignment, sclines = 0;
|
unsigned int alignment, sclines = 0;
|
||||||
@@ -183,14 +182,14 @@ static inline unsigned int VIDEO_Y_SCANLINES(unsigned int v4l2_fmt,
|
|||||||
if (!height)
|
if (!height)
|
||||||
goto invalid_input;
|
goto invalid_input;
|
||||||
|
|
||||||
switch (v4l2_fmt) {
|
switch (colorformat) {
|
||||||
case V4L2_PIX_FMT_NV12:
|
case MSM_VIDC_FMT_NV12:
|
||||||
case V4L2_PIX_FMT_NV21:
|
case MSM_VIDC_FMT_NV21:
|
||||||
case V4L2_PIX_FMT_VIDC_NV12C:
|
case MSM_VIDC_FMT_NV12C:
|
||||||
case V4L2_PIX_FMT_VIDC_P010:
|
case MSM_VIDC_FMT_P010:
|
||||||
alignment = 32;
|
alignment = 32;
|
||||||
break;
|
break;
|
||||||
case V4L2_PIX_FMT_VIDC_TP10C:
|
case MSM_VIDC_FMT_TP10C:
|
||||||
alignment = 16;
|
alignment = 16;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -208,7 +207,7 @@ invalid_input:
|
|||||||
* Progressive: height
|
* Progressive: height
|
||||||
* Interlaced: (height+1)>>1
|
* Interlaced: (height+1)>>1
|
||||||
*/
|
*/
|
||||||
static inline unsigned int VIDEO_UV_SCANLINES(unsigned int v4l2_fmt,
|
static inline unsigned int video_uv_scanlines(unsigned int colorformat,
|
||||||
unsigned int height)
|
unsigned int height)
|
||||||
{
|
{
|
||||||
unsigned int alignment, sclines = 0;
|
unsigned int alignment, sclines = 0;
|
||||||
@@ -216,14 +215,14 @@ static inline unsigned int VIDEO_UV_SCANLINES(unsigned int v4l2_fmt,
|
|||||||
if (!height)
|
if (!height)
|
||||||
goto invalid_input;
|
goto invalid_input;
|
||||||
|
|
||||||
switch (v4l2_fmt) {
|
switch (colorformat) {
|
||||||
case V4L2_PIX_FMT_NV21:
|
case MSM_VIDC_FMT_NV21:
|
||||||
case V4L2_PIX_FMT_NV12:
|
case MSM_VIDC_FMT_NV12:
|
||||||
case V4L2_PIX_FMT_VIDC_TP10C:
|
case MSM_VIDC_FMT_TP10C:
|
||||||
case V4L2_PIX_FMT_VIDC_P010:
|
case MSM_VIDC_FMT_P010:
|
||||||
alignment = 16;
|
alignment = 16;
|
||||||
break;
|
break;
|
||||||
case V4L2_PIX_FMT_VIDC_NV12C:
|
case MSM_VIDC_FMT_NV12C:
|
||||||
alignment = 32;
|
alignment = 32;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -243,7 +242,7 @@ invalid_input:
|
|||||||
* Progressive: width
|
* Progressive: width
|
||||||
* Interlaced: width
|
* Interlaced: width
|
||||||
*/
|
*/
|
||||||
static inline unsigned int VIDEO_Y_META_STRIDE(unsigned int v4l2_fmt,
|
static inline unsigned int video_y_meta_stride(unsigned int colorformat,
|
||||||
unsigned int width)
|
unsigned int width)
|
||||||
{
|
{
|
||||||
int y_tile_width = 0, y_meta_stride = 0;
|
int y_tile_width = 0, y_meta_stride = 0;
|
||||||
@@ -251,11 +250,11 @@ static inline unsigned int VIDEO_Y_META_STRIDE(unsigned int v4l2_fmt,
|
|||||||
if (!width)
|
if (!width)
|
||||||
goto invalid_input;
|
goto invalid_input;
|
||||||
|
|
||||||
switch (v4l2_fmt) {
|
switch (colorformat) {
|
||||||
case V4L2_PIX_FMT_VIDC_NV12C:
|
case MSM_VIDC_FMT_NV12C:
|
||||||
y_tile_width = 32;
|
y_tile_width = 32;
|
||||||
break;
|
break;
|
||||||
case V4L2_PIX_FMT_VIDC_TP10C:
|
case MSM_VIDC_FMT_TP10C:
|
||||||
y_tile_width = 48;
|
y_tile_width = 48;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -276,7 +275,7 @@ invalid_input:
|
|||||||
* Progressive: height
|
* Progressive: height
|
||||||
* Interlaced: (height+1)>>1
|
* Interlaced: (height+1)>>1
|
||||||
*/
|
*/
|
||||||
static inline unsigned int VIDEO_Y_META_SCANLINES(unsigned int v4l2_fmt,
|
static inline unsigned int video_y_meta_scanlines(unsigned int colorformat,
|
||||||
unsigned int height)
|
unsigned int height)
|
||||||
{
|
{
|
||||||
int y_tile_height = 0, y_meta_scanlines = 0;
|
int y_tile_height = 0, y_meta_scanlines = 0;
|
||||||
@@ -284,11 +283,11 @@ static inline unsigned int VIDEO_Y_META_SCANLINES(unsigned int v4l2_fmt,
|
|||||||
if (!height)
|
if (!height)
|
||||||
goto invalid_input;
|
goto invalid_input;
|
||||||
|
|
||||||
switch (v4l2_fmt) {
|
switch (colorformat) {
|
||||||
case V4L2_PIX_FMT_VIDC_NV12C:
|
case MSM_VIDC_FMT_NV12C:
|
||||||
y_tile_height = 8;
|
y_tile_height = 8;
|
||||||
break;
|
break;
|
||||||
case V4L2_PIX_FMT_VIDC_TP10C:
|
case MSM_VIDC_FMT_TP10C:
|
||||||
y_tile_height = 4;
|
y_tile_height = 4;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -309,7 +308,7 @@ invalid_input:
|
|||||||
* Progressive: width
|
* Progressive: width
|
||||||
* Interlaced: width
|
* Interlaced: width
|
||||||
*/
|
*/
|
||||||
static inline unsigned int VIDEO_UV_META_STRIDE(unsigned int v4l2_fmt,
|
static inline unsigned int video_uv_meta_stride(unsigned int colorformat,
|
||||||
unsigned int width)
|
unsigned int width)
|
||||||
{
|
{
|
||||||
int uv_tile_width = 0, uv_meta_stride = 0;
|
int uv_tile_width = 0, uv_meta_stride = 0;
|
||||||
@@ -317,11 +316,11 @@ static inline unsigned int VIDEO_UV_META_STRIDE(unsigned int v4l2_fmt,
|
|||||||
if (!width)
|
if (!width)
|
||||||
goto invalid_input;
|
goto invalid_input;
|
||||||
|
|
||||||
switch (v4l2_fmt) {
|
switch (colorformat) {
|
||||||
case V4L2_PIX_FMT_VIDC_NV12C:
|
case MSM_VIDC_FMT_NV12C:
|
||||||
uv_tile_width = 16;
|
uv_tile_width = 16;
|
||||||
break;
|
break;
|
||||||
case V4L2_PIX_FMT_VIDC_TP10C:
|
case MSM_VIDC_FMT_TP10C:
|
||||||
uv_tile_width = 24;
|
uv_tile_width = 24;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -342,19 +341,19 @@ invalid_input:
|
|||||||
* Progressive: height
|
* Progressive: height
|
||||||
* Interlaced: (height+1)>>1
|
* Interlaced: (height+1)>>1
|
||||||
*/
|
*/
|
||||||
static inline unsigned int VIDEO_UV_META_SCANLINES(unsigned int v4l2_fmt,
|
static inline unsigned int video_uv_meta_scanlines(
|
||||||
unsigned int height)
|
unsigned int colorformat, unsigned int height)
|
||||||
{
|
{
|
||||||
int uv_tile_height = 0, uv_meta_scanlines = 0;
|
int uv_tile_height = 0, uv_meta_scanlines = 0;
|
||||||
|
|
||||||
if (!height)
|
if (!height)
|
||||||
goto invalid_input;
|
goto invalid_input;
|
||||||
|
|
||||||
switch (v4l2_fmt) {
|
switch (colorformat) {
|
||||||
case V4L2_PIX_FMT_VIDC_NV12C:
|
case MSM_VIDC_FMT_NV12C:
|
||||||
uv_tile_height = 8;
|
uv_tile_height = 8;
|
||||||
break;
|
break;
|
||||||
case V4L2_PIX_FMT_VIDC_TP10C:
|
case MSM_VIDC_FMT_TP10C:
|
||||||
uv_tile_height = 4;
|
uv_tile_height = 4;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -368,17 +367,17 @@ invalid_input:
|
|||||||
return uv_meta_scanlines;
|
return uv_meta_scanlines;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline unsigned int VIDEO_RGB_STRIDE_BYTES(unsigned int v4l2_fmt,
|
static inline unsigned int video_rgb_stride_bytes(
|
||||||
unsigned int width)
|
unsigned int colorformat, unsigned int width)
|
||||||
{
|
{
|
||||||
unsigned int alignment = 0, stride = 0, bpp = 4;
|
unsigned int alignment = 0, stride = 0, bpp = 4;
|
||||||
|
|
||||||
if (!width)
|
if (!width)
|
||||||
goto invalid_input;
|
goto invalid_input;
|
||||||
|
|
||||||
switch (v4l2_fmt) {
|
switch (colorformat) {
|
||||||
case V4L2_PIX_FMT_VIDC_ARGB32C:
|
case MSM_VIDC_FMT_RGBA8888C:
|
||||||
case V4L2_PIX_FMT_RGBA32:
|
case MSM_VIDC_FMT_RGBA8888:
|
||||||
alignment = 256;
|
alignment = 256;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -391,15 +390,15 @@ invalid_input:
|
|||||||
return stride;
|
return stride;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline unsigned int VIDEO_RGB_STRIDE_PIX(unsigned int v4l2_fmt,
|
static inline unsigned int video_rgb_stride_pix(unsigned int colorformat,
|
||||||
unsigned int width)
|
unsigned int width)
|
||||||
{
|
{
|
||||||
unsigned int bpp = 4;
|
unsigned int bpp = 4;
|
||||||
|
|
||||||
return VIDEO_RGB_STRIDE_BYTES(v4l2_fmt, width) / bpp;
|
return video_rgb_stride_bytes(colorformat, width) / bpp;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline unsigned int VIDEO_RGB_SCANLINES(unsigned int v4l2_fmt,
|
static inline unsigned int video_rgb_scanlines(unsigned int colorformat,
|
||||||
unsigned int height)
|
unsigned int height)
|
||||||
{
|
{
|
||||||
unsigned int alignment = 0, scanlines = 0;
|
unsigned int alignment = 0, scanlines = 0;
|
||||||
@@ -407,11 +406,11 @@ static inline unsigned int VIDEO_RGB_SCANLINES(unsigned int v4l2_fmt,
|
|||||||
if (!height)
|
if (!height)
|
||||||
goto invalid_input;
|
goto invalid_input;
|
||||||
|
|
||||||
switch (v4l2_fmt) {
|
switch (colorformat) {
|
||||||
case V4L2_PIX_FMT_VIDC_ARGB32C:
|
case MSM_VIDC_FMT_RGBA8888C:
|
||||||
alignment = 16;
|
alignment = 16;
|
||||||
break;
|
break;
|
||||||
case V4L2_PIX_FMT_RGBA32:
|
case MSM_VIDC_FMT_RGBA8888:
|
||||||
alignment = 32;
|
alignment = 32;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -424,17 +423,17 @@ invalid_input:
|
|||||||
return scanlines;
|
return scanlines;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline unsigned int VIDEO_RGB_META_STRIDE(unsigned int v4l2_fmt,
|
static inline unsigned int video_rgb_meta_stride(
|
||||||
unsigned int width)
|
unsigned int colorformat, unsigned int width)
|
||||||
{
|
{
|
||||||
int rgb_tile_width = 0, rgb_meta_stride = 0;
|
int rgb_tile_width = 0, rgb_meta_stride = 0;
|
||||||
|
|
||||||
if (!width)
|
if (!width)
|
||||||
goto invalid_input;
|
goto invalid_input;
|
||||||
|
|
||||||
switch (v4l2_fmt) {
|
switch (colorformat) {
|
||||||
case V4L2_PIX_FMT_VIDC_ARGB32C:
|
case MSM_VIDC_FMT_RGBA8888C:
|
||||||
case V4L2_PIX_FMT_RGBA32:
|
case MSM_VIDC_FMT_RGBA8888:
|
||||||
rgb_tile_width = 16;
|
rgb_tile_width = 16;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -448,17 +447,17 @@ invalid_input:
|
|||||||
return rgb_meta_stride;
|
return rgb_meta_stride;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline unsigned int VIDEO_RGB_META_SCANLINES(unsigned int v4l2_fmt,
|
static inline unsigned int video_rgb_meta_scanlines(
|
||||||
unsigned int height)
|
unsigned int colorformat, unsigned int height)
|
||||||
{
|
{
|
||||||
int rgb_tile_height = 0, rgb_meta_scanlines = 0;
|
int rgb_tile_height = 0, rgb_meta_scanlines = 0;
|
||||||
|
|
||||||
if (!height)
|
if (!height)
|
||||||
goto invalid_input;
|
goto invalid_input;
|
||||||
|
|
||||||
switch (v4l2_fmt) {
|
switch (colorformat) {
|
||||||
case V4L2_PIX_FMT_VIDC_ARGB32C:
|
case MSM_VIDC_FMT_RGBA8888C:
|
||||||
case V4L2_PIX_FMT_RGBA32:
|
case MSM_VIDC_FMT_RGBA8888:
|
||||||
rgb_tile_height = 4;
|
rgb_tile_height = 4;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -472,7 +471,7 @@ invalid_input:
|
|||||||
return rgb_meta_scanlines;
|
return rgb_meta_scanlines;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline unsigned int VIDEO_RAW_BUFFER_SIZE(unsigned int v4l2_fmt,
|
static inline unsigned int video_buffer_size(unsigned int colorformat,
|
||||||
unsigned int pix_width, unsigned int pix_height, unsigned int interlace)
|
unsigned int pix_width, unsigned int pix_height, unsigned int interlace)
|
||||||
{
|
{
|
||||||
unsigned int size = 0;
|
unsigned int size = 0;
|
||||||
@@ -489,33 +488,33 @@ static inline unsigned int VIDEO_RAW_BUFFER_SIZE(unsigned int v4l2_fmt,
|
|||||||
if (!pix_width || !pix_height)
|
if (!pix_width || !pix_height)
|
||||||
goto invalid_input;
|
goto invalid_input;
|
||||||
|
|
||||||
y_stride = VIDEO_Y_STRIDE_BYTES(v4l2_fmt, pix_width);
|
y_stride = video_y_stride_bytes(colorformat, pix_width);
|
||||||
uv_stride = VIDEO_UV_STRIDE_BYTES(v4l2_fmt, pix_width);
|
uv_stride = video_uv_stride_bytes(colorformat, pix_width);
|
||||||
y_sclines = VIDEO_Y_SCANLINES(v4l2_fmt, pix_height);
|
y_sclines = video_y_scanlines(colorformat, pix_height);
|
||||||
uv_sclines = VIDEO_UV_SCANLINES(v4l2_fmt, pix_height);
|
uv_sclines = video_uv_scanlines(colorformat, pix_height);
|
||||||
rgb_stride = VIDEO_RGB_STRIDE_BYTES(v4l2_fmt, pix_width);
|
rgb_stride = video_rgb_stride_bytes(colorformat, pix_width);
|
||||||
rgb_scanlines = VIDEO_RGB_SCANLINES(v4l2_fmt, pix_height);
|
rgb_scanlines = video_rgb_scanlines(colorformat, pix_height);
|
||||||
|
|
||||||
switch (v4l2_fmt) {
|
switch (colorformat) {
|
||||||
case V4L2_PIX_FMT_NV21:
|
case MSM_VIDC_FMT_NV21:
|
||||||
case V4L2_PIX_FMT_NV12:
|
case MSM_VIDC_FMT_NV12:
|
||||||
case V4L2_PIX_FMT_VIDC_P010:
|
case MSM_VIDC_FMT_P010:
|
||||||
y_plane = y_stride * y_sclines;
|
y_plane = y_stride * y_sclines;
|
||||||
uv_plane = uv_stride * uv_sclines;
|
uv_plane = uv_stride * uv_sclines;
|
||||||
size = y_plane + uv_plane;
|
size = y_plane + uv_plane;
|
||||||
break;
|
break;
|
||||||
case V4L2_PIX_FMT_VIDC_NV12C:
|
case MSM_VIDC_FMT_NV12C:
|
||||||
y_meta_stride = VIDEO_Y_META_STRIDE(v4l2_fmt, pix_width);
|
y_meta_stride = video_y_meta_stride(colorformat, pix_width);
|
||||||
uv_meta_stride = VIDEO_UV_META_STRIDE(v4l2_fmt, pix_width);
|
uv_meta_stride = video_uv_meta_stride(colorformat, pix_width);
|
||||||
if (!interlace && v4l2_fmt == V4L2_PIX_FMT_VIDC_NV12C) {
|
if (!interlace && colorformat == MSM_VIDC_FMT_NV12C) {
|
||||||
y_ubwc_plane = MSM_MEDIA_ALIGN(y_stride * y_sclines, 4096);
|
y_ubwc_plane = MSM_MEDIA_ALIGN(y_stride * y_sclines, 4096);
|
||||||
uv_ubwc_plane = MSM_MEDIA_ALIGN(uv_stride * uv_sclines, 4096);
|
uv_ubwc_plane = MSM_MEDIA_ALIGN(uv_stride * uv_sclines, 4096);
|
||||||
y_meta_scanlines =
|
y_meta_scanlines =
|
||||||
VIDEO_Y_META_SCANLINES(v4l2_fmt, pix_height);
|
video_y_meta_scanlines(colorformat, pix_height);
|
||||||
y_meta_plane = MSM_MEDIA_ALIGN(
|
y_meta_plane = MSM_MEDIA_ALIGN(
|
||||||
y_meta_stride * y_meta_scanlines, 4096);
|
y_meta_stride * y_meta_scanlines, 4096);
|
||||||
uv_meta_scanlines =
|
uv_meta_scanlines =
|
||||||
VIDEO_UV_META_SCANLINES(v4l2_fmt, pix_height);
|
video_uv_meta_scanlines(colorformat, pix_height);
|
||||||
uv_meta_plane = MSM_MEDIA_ALIGN(uv_meta_stride *
|
uv_meta_plane = MSM_MEDIA_ALIGN(uv_meta_stride *
|
||||||
uv_meta_scanlines, 4096);
|
uv_meta_scanlines, 4096);
|
||||||
size = (y_ubwc_plane + uv_ubwc_plane + y_meta_plane +
|
size = (y_ubwc_plane + uv_ubwc_plane + y_meta_plane +
|
||||||
@@ -525,36 +524,36 @@ static inline unsigned int VIDEO_RAW_BUFFER_SIZE(unsigned int v4l2_fmt,
|
|||||||
pix_height <= INTERLACE_HEIGHT_MAX &&
|
pix_height <= INTERLACE_HEIGHT_MAX &&
|
||||||
(pix_height * pix_width) / 256 <= INTERLACE_MB_PER_FRAME_MAX) {
|
(pix_height * pix_width) / 256 <= INTERLACE_MB_PER_FRAME_MAX) {
|
||||||
y_sclines =
|
y_sclines =
|
||||||
VIDEO_Y_SCANLINES(v4l2_fmt, (pix_height+1)>>1);
|
video_y_scanlines(colorformat, (pix_height+1)>>1);
|
||||||
y_ubwc_plane =
|
y_ubwc_plane =
|
||||||
MSM_MEDIA_ALIGN(y_stride * y_sclines, 4096);
|
MSM_MEDIA_ALIGN(y_stride * y_sclines, 4096);
|
||||||
uv_sclines =
|
uv_sclines =
|
||||||
VIDEO_UV_SCANLINES(v4l2_fmt, (pix_height+1)>>1);
|
video_uv_scanlines(colorformat, (pix_height+1)>>1);
|
||||||
uv_ubwc_plane =
|
uv_ubwc_plane =
|
||||||
MSM_MEDIA_ALIGN(uv_stride * uv_sclines, 4096);
|
MSM_MEDIA_ALIGN(uv_stride * uv_sclines, 4096);
|
||||||
y_meta_scanlines =
|
y_meta_scanlines =
|
||||||
VIDEO_Y_META_SCANLINES(v4l2_fmt, (pix_height+1)>>1);
|
video_y_meta_scanlines(colorformat, (pix_height+1)>>1);
|
||||||
y_meta_plane = MSM_MEDIA_ALIGN(
|
y_meta_plane = MSM_MEDIA_ALIGN(
|
||||||
y_meta_stride * y_meta_scanlines, 4096);
|
y_meta_stride * y_meta_scanlines, 4096);
|
||||||
uv_meta_scanlines =
|
uv_meta_scanlines =
|
||||||
VIDEO_UV_META_SCANLINES(v4l2_fmt, (pix_height+1)>>1);
|
video_uv_meta_scanlines(colorformat, (pix_height+1)>>1);
|
||||||
uv_meta_plane = MSM_MEDIA_ALIGN(uv_meta_stride *
|
uv_meta_plane = MSM_MEDIA_ALIGN(uv_meta_stride *
|
||||||
uv_meta_scanlines, 4096);
|
uv_meta_scanlines, 4096);
|
||||||
size = (y_ubwc_plane + uv_ubwc_plane + y_meta_plane +
|
size = (y_ubwc_plane + uv_ubwc_plane + y_meta_plane +
|
||||||
uv_meta_plane)*2;
|
uv_meta_plane)*2;
|
||||||
} else {
|
} else {
|
||||||
y_sclines = VIDEO_Y_SCANLINES(v4l2_fmt, pix_height);
|
y_sclines = video_y_scanlines(colorformat, pix_height);
|
||||||
y_ubwc_plane =
|
y_ubwc_plane =
|
||||||
MSM_MEDIA_ALIGN(y_stride * y_sclines, 4096);
|
MSM_MEDIA_ALIGN(y_stride * y_sclines, 4096);
|
||||||
uv_sclines = VIDEO_UV_SCANLINES(v4l2_fmt, pix_height);
|
uv_sclines = video_uv_scanlines(colorformat, pix_height);
|
||||||
uv_ubwc_plane =
|
uv_ubwc_plane =
|
||||||
MSM_MEDIA_ALIGN(uv_stride * uv_sclines, 4096);
|
MSM_MEDIA_ALIGN(uv_stride * uv_sclines, 4096);
|
||||||
y_meta_scanlines =
|
y_meta_scanlines =
|
||||||
VIDEO_Y_META_SCANLINES(v4l2_fmt, pix_height);
|
video_y_meta_scanlines(colorformat, pix_height);
|
||||||
y_meta_plane = MSM_MEDIA_ALIGN(
|
y_meta_plane = MSM_MEDIA_ALIGN(
|
||||||
y_meta_stride * y_meta_scanlines, 4096);
|
y_meta_stride * y_meta_scanlines, 4096);
|
||||||
uv_meta_scanlines =
|
uv_meta_scanlines =
|
||||||
VIDEO_UV_META_SCANLINES(v4l2_fmt, pix_height);
|
video_uv_meta_scanlines(colorformat, pix_height);
|
||||||
uv_meta_plane = MSM_MEDIA_ALIGN(uv_meta_stride *
|
uv_meta_plane = MSM_MEDIA_ALIGN(uv_meta_stride *
|
||||||
uv_meta_scanlines, 4096);
|
uv_meta_scanlines, 4096);
|
||||||
size = (y_ubwc_plane + uv_ubwc_plane + y_meta_plane +
|
size = (y_ubwc_plane + uv_ubwc_plane + y_meta_plane +
|
||||||
@@ -562,32 +561,32 @@ static inline unsigned int VIDEO_RAW_BUFFER_SIZE(unsigned int v4l2_fmt,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case V4L2_PIX_FMT_VIDC_TP10C:
|
case MSM_VIDC_FMT_TP10C:
|
||||||
y_ubwc_plane = MSM_MEDIA_ALIGN(y_stride * y_sclines, 4096);
|
y_ubwc_plane = MSM_MEDIA_ALIGN(y_stride * y_sclines, 4096);
|
||||||
uv_ubwc_plane = MSM_MEDIA_ALIGN(uv_stride * uv_sclines, 4096);
|
uv_ubwc_plane = MSM_MEDIA_ALIGN(uv_stride * uv_sclines, 4096);
|
||||||
y_meta_stride = VIDEO_Y_META_STRIDE(v4l2_fmt, pix_width);
|
y_meta_stride = video_y_meta_stride(colorformat, pix_width);
|
||||||
y_meta_scanlines = VIDEO_Y_META_SCANLINES(v4l2_fmt, pix_height);
|
y_meta_scanlines = video_y_meta_scanlines(colorformat, pix_height);
|
||||||
y_meta_plane = MSM_MEDIA_ALIGN(
|
y_meta_plane = MSM_MEDIA_ALIGN(
|
||||||
y_meta_stride * y_meta_scanlines, 4096);
|
y_meta_stride * y_meta_scanlines, 4096);
|
||||||
uv_meta_stride = VIDEO_UV_META_STRIDE(v4l2_fmt, pix_width);
|
uv_meta_stride = video_uv_meta_stride(colorformat, pix_width);
|
||||||
uv_meta_scanlines = VIDEO_UV_META_SCANLINES(v4l2_fmt, pix_height);
|
uv_meta_scanlines = video_uv_meta_scanlines(colorformat, pix_height);
|
||||||
uv_meta_plane = MSM_MEDIA_ALIGN(uv_meta_stride *
|
uv_meta_plane = MSM_MEDIA_ALIGN(uv_meta_stride *
|
||||||
uv_meta_scanlines, 4096);
|
uv_meta_scanlines, 4096);
|
||||||
|
|
||||||
size = y_ubwc_plane + uv_ubwc_plane + y_meta_plane +
|
size = y_ubwc_plane + uv_ubwc_plane + y_meta_plane +
|
||||||
uv_meta_plane;
|
uv_meta_plane;
|
||||||
break;
|
break;
|
||||||
case V4L2_PIX_FMT_VIDC_ARGB32C:
|
case MSM_VIDC_FMT_RGBA8888C:
|
||||||
rgb_ubwc_plane = MSM_MEDIA_ALIGN(rgb_stride * rgb_scanlines,
|
rgb_ubwc_plane = MSM_MEDIA_ALIGN(rgb_stride * rgb_scanlines,
|
||||||
4096);
|
4096);
|
||||||
rgb_meta_stride = VIDEO_RGB_META_STRIDE(v4l2_fmt, pix_width);
|
rgb_meta_stride = video_rgb_meta_stride(colorformat, pix_width);
|
||||||
rgb_meta_scanlines = VIDEO_RGB_META_SCANLINES(v4l2_fmt,
|
rgb_meta_scanlines = video_rgb_meta_scanlines(colorformat,
|
||||||
pix_height);
|
pix_height);
|
||||||
rgb_meta_plane = MSM_MEDIA_ALIGN(rgb_meta_stride *
|
rgb_meta_plane = MSM_MEDIA_ALIGN(rgb_meta_stride *
|
||||||
rgb_meta_scanlines, 4096);
|
rgb_meta_scanlines, 4096);
|
||||||
size = rgb_ubwc_plane + rgb_meta_plane;
|
size = rgb_ubwc_plane + rgb_meta_plane;
|
||||||
break;
|
break;
|
||||||
case V4L2_PIX_FMT_RGBA32:
|
case MSM_VIDC_FMT_RGBA8888:
|
||||||
rgb_plane = MSM_MEDIA_ALIGN(rgb_stride * rgb_scanlines, 4096);
|
rgb_plane = MSM_MEDIA_ALIGN(rgb_stride * rgb_scanlines, 4096);
|
||||||
size = rgb_plane;
|
size = rgb_plane;
|
||||||
break;
|
break;
|
||||||
|
@@ -175,13 +175,12 @@ static int msm_vdec_set_linear_stride_scanline(struct msm_vidc_inst *inst)
|
|||||||
int rc = 0;
|
int rc = 0;
|
||||||
u32 stride_y, scanline_y, stride_uv, scanline_uv;
|
u32 stride_y, scanline_y, stride_uv, scanline_uv;
|
||||||
u32 payload[2];
|
u32 payload[2];
|
||||||
|
enum msm_vidc_colorformat_type colorformat;
|
||||||
|
|
||||||
if (inst->fmts[OUTPUT_PORT].fmt.pix_mp.pixelformat !=
|
colorformat = v4l2_colorformat_to_driver(
|
||||||
V4L2_PIX_FMT_NV12 &&
|
inst->fmts[OUTPUT_PORT].fmt.pix_mp.pixelformat, __func__);
|
||||||
inst->fmts[OUTPUT_PORT].fmt.pix_mp.pixelformat !=
|
|
||||||
V4L2_PIX_FMT_VIDC_P010 &&
|
if (!is_linear_yuv_colorformat(colorformat))
|
||||||
inst->fmts[OUTPUT_PORT].fmt.pix_mp.pixelformat !=
|
|
||||||
V4L2_PIX_FMT_NV21)
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
stride_y = inst->fmts[OUTPUT_PORT].fmt.pix_mp.width;
|
stride_y = inst->fmts[OUTPUT_PORT].fmt.pix_mp.width;
|
||||||
@@ -216,27 +215,28 @@ static int msm_vdec_set_ubwc_stride_scanline(struct msm_vidc_inst *inst)
|
|||||||
u32 meta_stride_y, meta_scanline_y, meta_stride_uv, meta_scanline_uv;
|
u32 meta_stride_y, meta_scanline_y, meta_stride_uv, meta_scanline_uv;
|
||||||
u32 payload[4];
|
u32 payload[4];
|
||||||
struct v4l2_format *f;
|
struct v4l2_format *f;
|
||||||
u32 pix_fmt, width, height;
|
u32 pix_fmt, width, height, colorformat;
|
||||||
|
|
||||||
f = &inst->fmts[OUTPUT_PORT];
|
f = &inst->fmts[OUTPUT_PORT];
|
||||||
pix_fmt = f->fmt.pix_mp.pixelformat;
|
pix_fmt = f->fmt.pix_mp.pixelformat;
|
||||||
width = f->fmt.pix_mp.width;
|
width = f->fmt.pix_mp.width;
|
||||||
height = f->fmt.pix_mp.height;
|
height = f->fmt.pix_mp.height;
|
||||||
|
|
||||||
|
colorformat = v4l2_colorformat_to_driver(pix_fmt, __func__);
|
||||||
|
|
||||||
if (inst->codec != MSM_VIDC_AV1 ||
|
if (inst->codec != MSM_VIDC_AV1 ||
|
||||||
(pix_fmt != V4L2_PIX_FMT_VIDC_NV12C &&
|
(!is_ubwc_colorformat(colorformat)))
|
||||||
pix_fmt != V4L2_PIX_FMT_VIDC_TP10C))
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
stride_y = VIDEO_Y_STRIDE_BYTES(pix_fmt, width);
|
stride_y = video_y_stride_bytes(colorformat, width);
|
||||||
scanline_y = VIDEO_Y_SCANLINES(pix_fmt, height);
|
scanline_y = video_y_scanlines(colorformat, height);
|
||||||
stride_uv = VIDEO_UV_STRIDE_BYTES(pix_fmt, width);
|
stride_uv = video_uv_stride_bytes(colorformat, width);
|
||||||
scanline_uv = VIDEO_UV_SCANLINES(pix_fmt, height);
|
scanline_uv = video_uv_scanlines(colorformat, height);
|
||||||
|
|
||||||
meta_stride_y = VIDEO_Y_META_STRIDE(pix_fmt, width);
|
meta_stride_y = video_y_meta_stride(colorformat, width);
|
||||||
meta_scanline_y = VIDEO_Y_META_SCANLINES(pix_fmt, height);
|
meta_scanline_y = video_y_meta_scanlines(colorformat, height);
|
||||||
meta_stride_uv = VIDEO_UV_META_STRIDE(pix_fmt, width);
|
meta_stride_uv = video_uv_meta_stride(colorformat, width);
|
||||||
meta_scanline_uv = VIDEO_UV_META_SCANLINES(pix_fmt, height);
|
meta_scanline_uv = video_uv_meta_scanlines(colorformat, height);
|
||||||
|
|
||||||
payload[0] = stride_y << 16 | scanline_y;
|
payload[0] = stride_y << 16 | scanline_y;
|
||||||
payload[1] = stride_uv << 16 | scanline_uv;
|
payload[1] = stride_uv << 16 | scanline_uv;
|
||||||
@@ -306,17 +306,18 @@ static int msm_vdec_set_bit_depth(struct msm_vidc_inst *inst,
|
|||||||
enum msm_vidc_port_type port)
|
enum msm_vidc_port_type port)
|
||||||
{
|
{
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
u32 colorformat;
|
u32 pix_fmt;
|
||||||
u32 bitdepth = 8 << 16 | 8;
|
u32 bitdepth = 8 << 16 | 8;
|
||||||
|
enum msm_vidc_colorformat_type colorformat;
|
||||||
|
|
||||||
if (port != INPUT_PORT && port != OUTPUT_PORT) {
|
if (port != INPUT_PORT && port != OUTPUT_PORT) {
|
||||||
i_vpr_e(inst, "%s: invalid port %d\n", __func__, port);
|
i_vpr_e(inst, "%s: invalid port %d\n", __func__, port);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
colorformat = inst->fmts[OUTPUT_PORT].fmt.pix_mp.pixelformat;
|
pix_fmt = inst->fmts[OUTPUT_PORT].fmt.pix_mp.pixelformat;
|
||||||
if (colorformat == V4L2_PIX_FMT_VIDC_P010 ||
|
colorformat = v4l2_colorformat_to_driver(pix_fmt, __func__);
|
||||||
colorformat == V4L2_PIX_FMT_VIDC_TP10C)
|
if (is_10bit_colorformat(colorformat))
|
||||||
bitdepth = 10 << 16 | 10;
|
bitdepth = 10 << 16 | 10;
|
||||||
|
|
||||||
inst->subcr_params[port].bit_depth = bitdepth;
|
inst->subcr_params[port].bit_depth = bitdepth;
|
||||||
@@ -1232,6 +1233,7 @@ static int msm_vdec_read_input_subcr_params(struct msm_vidc_inst *inst)
|
|||||||
u32 full_range = 0;
|
u32 full_range = 0;
|
||||||
u32 colour_description_present_flag = 0;
|
u32 colour_description_present_flag = 0;
|
||||||
u32 video_signal_type_present_flag = 0;
|
u32 video_signal_type_present_flag = 0;
|
||||||
|
enum msm_vidc_colorformat_type output_fmt;
|
||||||
|
|
||||||
if (!inst || !inst->core || !inst->capabilities) {
|
if (!inst || !inst->core || !inst->capabilities) {
|
||||||
d_vpr_e("%s: invalid params\n", __func__);
|
d_vpr_e("%s: invalid params\n", __func__);
|
||||||
@@ -1248,13 +1250,15 @@ static int msm_vdec_read_input_subcr_params(struct msm_vidc_inst *inst)
|
|||||||
inst->fmts[INPUT_PORT].fmt.pix_mp.width = width;
|
inst->fmts[INPUT_PORT].fmt.pix_mp.width = width;
|
||||||
inst->fmts[INPUT_PORT].fmt.pix_mp.height = height;
|
inst->fmts[INPUT_PORT].fmt.pix_mp.height = height;
|
||||||
|
|
||||||
inst->fmts[OUTPUT_PORT].fmt.pix_mp.width = VIDEO_Y_STRIDE_PIX(
|
output_fmt = v4l2_colorformat_to_driver(
|
||||||
inst->fmts[OUTPUT_PORT].fmt.pix_mp.pixelformat, width);
|
inst->fmts[OUTPUT_PORT].fmt.pix_mp.pixelformat, __func__);
|
||||||
inst->fmts[OUTPUT_PORT].fmt.pix_mp.height = VIDEO_Y_SCANLINES(
|
|
||||||
inst->fmts[OUTPUT_PORT].fmt.pix_mp.pixelformat, height);
|
inst->fmts[OUTPUT_PORT].fmt.pix_mp.width = video_y_stride_pix(
|
||||||
|
output_fmt, width);
|
||||||
|
inst->fmts[OUTPUT_PORT].fmt.pix_mp.height = video_y_scanlines(
|
||||||
|
output_fmt, height);
|
||||||
inst->fmts[OUTPUT_PORT].fmt.pix_mp.plane_fmt[0].bytesperline =
|
inst->fmts[OUTPUT_PORT].fmt.pix_mp.plane_fmt[0].bytesperline =
|
||||||
VIDEO_Y_STRIDE_BYTES(
|
video_y_stride_bytes(output_fmt, width);
|
||||||
inst->fmts[OUTPUT_PORT].fmt.pix_mp.pixelformat, width);
|
|
||||||
inst->fmts[OUTPUT_PORT].fmt.pix_mp.plane_fmt[0].sizeimage =
|
inst->fmts[OUTPUT_PORT].fmt.pix_mp.plane_fmt[0].sizeimage =
|
||||||
call_session_op(core, buffer_size, inst, MSM_VIDC_BUF_OUTPUT);
|
call_session_op(core, buffer_size, inst, MSM_VIDC_BUF_OUTPUT);
|
||||||
//inst->buffers.output.size = inst->fmts[OUTPUT_PORT].fmt.pix_mp.plane_fmt[0].sizeimage;
|
//inst->buffers.output.size = inst->fmts[OUTPUT_PORT].fmt.pix_mp.plane_fmt[0].sizeimage;
|
||||||
@@ -2304,7 +2308,8 @@ int msm_vdec_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
|
|||||||
int rc = 0;
|
int rc = 0;
|
||||||
struct msm_vidc_core *core;
|
struct msm_vidc_core *core;
|
||||||
struct v4l2_format *fmt, *output_fmt;
|
struct v4l2_format *fmt, *output_fmt;
|
||||||
u32 codec_align, pix_fmt;
|
u32 codec_align;
|
||||||
|
enum msm_vidc_colorformat_type colorformat;
|
||||||
|
|
||||||
if (!inst || !inst->core) {
|
if (!inst || !inst->core) {
|
||||||
d_vpr_e("%s: invalid params\n", __func__);
|
d_vpr_e("%s: invalid params\n", __func__);
|
||||||
@@ -2404,16 +2409,16 @@ int msm_vdec_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
|
|||||||
f->fmt.pix_mp.width = inst->fmts[INPUT_PORT].fmt.pix_mp.width;
|
f->fmt.pix_mp.width = inst->fmts[INPUT_PORT].fmt.pix_mp.width;
|
||||||
}
|
}
|
||||||
fmt->fmt.pix_mp.pixelformat = f->fmt.pix_mp.pixelformat;
|
fmt->fmt.pix_mp.pixelformat = f->fmt.pix_mp.pixelformat;
|
||||||
fmt->fmt.pix_mp.width = VIDEO_Y_STRIDE_PIX(
|
colorformat = v4l2_colorformat_to_driver(fmt->fmt.pix_mp.pixelformat,
|
||||||
fmt->fmt.pix_mp.pixelformat, f->fmt.pix_mp.width);
|
__func__);
|
||||||
fmt->fmt.pix_mp.height = VIDEO_Y_SCANLINES(
|
fmt->fmt.pix_mp.width = video_y_stride_pix(
|
||||||
fmt->fmt.pix_mp.pixelformat,
|
colorformat, f->fmt.pix_mp.width);
|
||||||
f->fmt.pix_mp.height);
|
fmt->fmt.pix_mp.height = video_y_scanlines(
|
||||||
|
colorformat, f->fmt.pix_mp.height);
|
||||||
fmt->fmt.pix_mp.num_planes = 1;
|
fmt->fmt.pix_mp.num_planes = 1;
|
||||||
fmt->fmt.pix_mp.plane_fmt[0].bytesperline =
|
fmt->fmt.pix_mp.plane_fmt[0].bytesperline =
|
||||||
VIDEO_Y_STRIDE_BYTES(
|
video_y_stride_bytes(
|
||||||
inst->fmts[OUTPUT_PORT].fmt.pix_mp.pixelformat,
|
colorformat, f->fmt.pix_mp.width);
|
||||||
f->fmt.pix_mp.width);
|
|
||||||
fmt->fmt.pix_mp.plane_fmt[0].sizeimage = call_session_op(core,
|
fmt->fmt.pix_mp.plane_fmt[0].sizeimage = call_session_op(core,
|
||||||
buffer_size, inst, MSM_VIDC_BUF_OUTPUT);
|
buffer_size, inst, MSM_VIDC_BUF_OUTPUT);
|
||||||
|
|
||||||
@@ -2431,8 +2436,7 @@ int msm_vdec_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
|
|||||||
}
|
}
|
||||||
inst->buffers.output.size =
|
inst->buffers.output.size =
|
||||||
fmt->fmt.pix_mp.plane_fmt[0].sizeimage;
|
fmt->fmt.pix_mp.plane_fmt[0].sizeimage;
|
||||||
pix_fmt = v4l2_colorformat_to_driver(f->fmt.pix_mp.pixelformat, __func__);
|
msm_vidc_update_cap_value(inst, PIX_FMTS, colorformat, __func__);
|
||||||
msm_vidc_update_cap_value(inst, PIX_FMTS, pix_fmt, __func__);
|
|
||||||
|
|
||||||
/* update crop while input port is not streaming */
|
/* update crop while input port is not streaming */
|
||||||
if (!inst->bufq[INPUT_PORT].vb2q->streaming) {
|
if (!inst->bufq[INPUT_PORT].vb2q->streaming) {
|
||||||
@@ -2677,6 +2681,7 @@ int msm_vdec_inst_init(struct msm_vidc_inst *inst)
|
|||||||
int rc = 0;
|
int rc = 0;
|
||||||
struct msm_vidc_core *core;
|
struct msm_vidc_core *core;
|
||||||
struct v4l2_format *f;
|
struct v4l2_format *f;
|
||||||
|
enum msm_vidc_colorformat_type colorformat;
|
||||||
|
|
||||||
if (!inst || !inst->core) {
|
if (!inst || !inst->core) {
|
||||||
d_vpr_e("%s: invalid params\n", __func__);
|
d_vpr_e("%s: invalid params\n", __func__);
|
||||||
@@ -2727,15 +2732,13 @@ int msm_vdec_inst_init(struct msm_vidc_inst *inst)
|
|||||||
f = &inst->fmts[OUTPUT_PORT];
|
f = &inst->fmts[OUTPUT_PORT];
|
||||||
f->type = OUTPUT_MPLANE;
|
f->type = OUTPUT_MPLANE;
|
||||||
f->fmt.pix_mp.pixelformat = V4L2_PIX_FMT_VIDC_NV12C;
|
f->fmt.pix_mp.pixelformat = V4L2_PIX_FMT_VIDC_NV12C;
|
||||||
f->fmt.pix_mp.width = VIDEO_Y_STRIDE_PIX(f->fmt.pix_mp.pixelformat,
|
colorformat = v4l2_colorformat_to_driver(
|
||||||
DEFAULT_WIDTH);
|
f->fmt.pix_mp.pixelformat, __func__);
|
||||||
f->fmt.pix_mp.height = VIDEO_Y_SCANLINES(f->fmt.pix_mp.pixelformat,
|
f->fmt.pix_mp.width = video_y_stride_pix(colorformat, DEFAULT_WIDTH);
|
||||||
DEFAULT_HEIGHT);
|
f->fmt.pix_mp.height = video_y_scanlines(colorformat, DEFAULT_HEIGHT);
|
||||||
f->fmt.pix_mp.num_planes = 1;
|
f->fmt.pix_mp.num_planes = 1;
|
||||||
f->fmt.pix_mp.plane_fmt[0].bytesperline =
|
f->fmt.pix_mp.plane_fmt[0].bytesperline =
|
||||||
VIDEO_Y_STRIDE_BYTES(
|
video_y_stride_bytes(colorformat, DEFAULT_WIDTH);
|
||||||
inst->fmts[OUTPUT_PORT].fmt.pix_mp.pixelformat,
|
|
||||||
DEFAULT_WIDTH);
|
|
||||||
f->fmt.pix_mp.plane_fmt[0].sizeimage = call_session_op(core,
|
f->fmt.pix_mp.plane_fmt[0].sizeimage = call_session_op(core,
|
||||||
buffer_size, inst, MSM_VIDC_BUF_OUTPUT);
|
buffer_size, inst, MSM_VIDC_BUF_OUTPUT);
|
||||||
f->fmt.pix_mp.field = V4L2_FIELD_NONE;
|
f->fmt.pix_mp.field = V4L2_FIELD_NONE;
|
||||||
|
@@ -167,14 +167,14 @@ static int msm_venc_set_stride_scanline(struct msm_vidc_inst *inst,
|
|||||||
stride_y = ALIGN(inst->fmts[INPUT_PORT].fmt.pix_mp.width, HEIC_GRID_DIMENSION);
|
stride_y = ALIGN(inst->fmts[INPUT_PORT].fmt.pix_mp.width, HEIC_GRID_DIMENSION);
|
||||||
scanline_y = ALIGN(inst->fmts[INPUT_PORT].fmt.pix_mp.height, HEIC_GRID_DIMENSION);
|
scanline_y = ALIGN(inst->fmts[INPUT_PORT].fmt.pix_mp.height, HEIC_GRID_DIMENSION);
|
||||||
} else if (is_rgba_colorformat(color_format)) {
|
} else if (is_rgba_colorformat(color_format)) {
|
||||||
stride_y = VIDEO_RGB_STRIDE_PIX(inst->fmts[INPUT_PORT].fmt.pix_mp.pixelformat,
|
stride_y = video_rgb_stride_pix(color_format,
|
||||||
inst->fmts[INPUT_PORT].fmt.pix_mp.width);
|
inst->fmts[INPUT_PORT].fmt.pix_mp.width);
|
||||||
scanline_y = VIDEO_RGB_SCANLINES(inst->fmts[INPUT_PORT].fmt.pix_mp.pixelformat,
|
scanline_y = video_rgb_scanlines(color_format,
|
||||||
inst->fmts[INPUT_PORT].fmt.pix_mp.height);
|
inst->fmts[INPUT_PORT].fmt.pix_mp.height);
|
||||||
} else {
|
} else {
|
||||||
stride_y = VIDEO_Y_STRIDE_PIX(inst->fmts[INPUT_PORT].fmt.pix_mp.pixelformat,
|
stride_y = video_y_stride_pix(color_format,
|
||||||
inst->fmts[INPUT_PORT].fmt.pix_mp.width);
|
inst->fmts[INPUT_PORT].fmt.pix_mp.width);
|
||||||
scanline_y = VIDEO_Y_SCANLINES(inst->fmts[INPUT_PORT].fmt.pix_mp.pixelformat,
|
scanline_y = video_y_scanlines(color_format,
|
||||||
inst->fmts[INPUT_PORT].fmt.pix_mp.height);
|
inst->fmts[INPUT_PORT].fmt.pix_mp.height);
|
||||||
}
|
}
|
||||||
if (color_format == MSM_VIDC_FMT_NV12 ||
|
if (color_format == MSM_VIDC_FMT_NV12 ||
|
||||||
@@ -1213,11 +1213,9 @@ static int msm_venc_s_fmt_input(struct msm_vidc_inst *inst, struct v4l2_format *
|
|||||||
bytesperline = ALIGN(f->fmt.pix_mp.width, HEIC_GRID_DIMENSION) *
|
bytesperline = ALIGN(f->fmt.pix_mp.width, HEIC_GRID_DIMENSION) *
|
||||||
(is_10bit_colorformat(pix_fmt) ? 2 : 1);
|
(is_10bit_colorformat(pix_fmt) ? 2 : 1);
|
||||||
} else if (is_rgba_colorformat(pix_fmt)) {
|
} else if (is_rgba_colorformat(pix_fmt)) {
|
||||||
bytesperline = VIDEO_RGB_STRIDE_BYTES(f->fmt.pix_mp.pixelformat,
|
bytesperline = video_rgb_stride_bytes(pix_fmt, f->fmt.pix_mp.width);
|
||||||
f->fmt.pix_mp.width);
|
|
||||||
} else {
|
} else {
|
||||||
bytesperline = VIDEO_Y_STRIDE_BYTES(f->fmt.pix_mp.pixelformat,
|
bytesperline = video_y_stride_bytes(pix_fmt, f->fmt.pix_mp.width);
|
||||||
f->fmt.pix_mp.width);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt = &inst->fmts[INPUT_PORT];
|
fmt = &inst->fmts[INPUT_PORT];
|
||||||
@@ -1790,6 +1788,7 @@ int msm_venc_inst_init(struct msm_vidc_inst *inst)
|
|||||||
int rc = 0;
|
int rc = 0;
|
||||||
struct msm_vidc_core *core;
|
struct msm_vidc_core *core;
|
||||||
struct v4l2_format *f;
|
struct v4l2_format *f;
|
||||||
|
enum msm_vidc_colorformat_type colorformat;
|
||||||
|
|
||||||
if (!inst || !inst->core) {
|
if (!inst || !inst->core) {
|
||||||
d_vpr_e("%s: invalid params\n", __func__);
|
d_vpr_e("%s: invalid params\n", __func__);
|
||||||
@@ -1848,9 +1847,10 @@ int msm_venc_inst_init(struct msm_vidc_inst *inst)
|
|||||||
f->fmt.pix_mp.width = DEFAULT_WIDTH;
|
f->fmt.pix_mp.width = DEFAULT_WIDTH;
|
||||||
f->fmt.pix_mp.height = DEFAULT_HEIGHT;
|
f->fmt.pix_mp.height = DEFAULT_HEIGHT;
|
||||||
f->fmt.pix_mp.num_planes = 1;
|
f->fmt.pix_mp.num_planes = 1;
|
||||||
|
colorformat = v4l2_colorformat_to_driver(f->fmt.pix_mp.pixelformat,
|
||||||
|
__func__);
|
||||||
f->fmt.pix_mp.plane_fmt[0].bytesperline =
|
f->fmt.pix_mp.plane_fmt[0].bytesperline =
|
||||||
VIDEO_Y_STRIDE_BYTES(f->fmt.pix_mp.pixelformat,
|
video_y_stride_bytes(colorformat, DEFAULT_WIDTH);
|
||||||
DEFAULT_WIDTH);
|
|
||||||
f->fmt.pix_mp.plane_fmt[0].sizeimage = call_session_op(core,
|
f->fmt.pix_mp.plane_fmt[0].sizeimage = call_session_op(core,
|
||||||
buffer_size, inst, MSM_VIDC_BUF_INPUT);
|
buffer_size, inst, MSM_VIDC_BUF_INPUT);
|
||||||
f->fmt.pix_mp.field = V4L2_FIELD_NONE;
|
f->fmt.pix_mp.field = V4L2_FIELD_NONE;
|
||||||
|
@@ -272,10 +272,12 @@ u32 msm_vidc_decoder_output_size(struct msm_vidc_inst *inst)
|
|||||||
{
|
{
|
||||||
u32 size;
|
u32 size;
|
||||||
struct v4l2_format *f;
|
struct v4l2_format *f;
|
||||||
|
enum msm_vidc_colorformat_type colorformat;
|
||||||
|
|
||||||
f = &inst->fmts[OUTPUT_PORT];
|
f = &inst->fmts[OUTPUT_PORT];
|
||||||
size = VIDEO_RAW_BUFFER_SIZE(f->fmt.pix_mp.pixelformat,
|
colorformat = v4l2_colorformat_to_driver(f->fmt.pix_mp.pixelformat,
|
||||||
f->fmt.pix_mp.width,
|
__func__);
|
||||||
|
size = video_buffer_size(colorformat, f->fmt.pix_mp.width,
|
||||||
f->fmt.pix_mp.height, true);
|
f->fmt.pix_mp.height, true);
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
@@ -300,16 +302,18 @@ u32 msm_vidc_encoder_input_size(struct msm_vidc_inst *inst)
|
|||||||
u32 size;
|
u32 size;
|
||||||
struct v4l2_format *f;
|
struct v4l2_format *f;
|
||||||
u32 width, height;
|
u32 width, height;
|
||||||
|
enum msm_vidc_colorformat_type colorformat;
|
||||||
|
|
||||||
f = &inst->fmts[INPUT_PORT];
|
f = &inst->fmts[INPUT_PORT];
|
||||||
width = f->fmt.pix_mp.width;
|
width = f->fmt.pix_mp.width;
|
||||||
height = f->fmt.pix_mp.height;
|
height = f->fmt.pix_mp.height;
|
||||||
|
colorformat = v4l2_colorformat_to_driver(f->fmt.pix_mp.pixelformat,
|
||||||
|
__func__);
|
||||||
if (is_image_session(inst)) {
|
if (is_image_session(inst)) {
|
||||||
width = ALIGN(width, HEIC_GRID_DIMENSION);
|
width = ALIGN(width, HEIC_GRID_DIMENSION);
|
||||||
height = ALIGN(height, HEIC_GRID_DIMENSION);
|
height = ALIGN(height, HEIC_GRID_DIMENSION);
|
||||||
}
|
}
|
||||||
size = VIDEO_RAW_BUFFER_SIZE(f->fmt.pix_mp.pixelformat,
|
size = video_buffer_size(colorformat, width, height, true);
|
||||||
width, height, true);
|
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
#include <linux/iommu.h>
|
#include <linux/iommu.h>
|
||||||
#include <linux/workqueue.h>
|
#include <linux/workqueue.h>
|
||||||
#include <media/v4l2_vidc_extensions.h>
|
|
||||||
#include "msm_media_info.h"
|
#include "msm_media_info.h"
|
||||||
|
|
||||||
#include "msm_vidc_driver.h"
|
#include "msm_vidc_driver.h"
|
||||||
|
Reference in New Issue
Block a user