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:
@@ -6,8 +6,7 @@
|
||||
#ifndef __MSM_MEDIA_INFO_H__
|
||||
#define __MSM_MEDIA_INFO_H__
|
||||
|
||||
#include <media/v4l2_vidc_extensions.h>
|
||||
#include <linux/videodev2.h>
|
||||
#include "msm_vidc_internal.h"
|
||||
|
||||
/* Width and Height should be multiple of 16 */
|
||||
#define INTERLACE_WIDTH_MAX 1920
|
||||
@@ -31,7 +30,7 @@
|
||||
* Progressive: 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 alignment, stride = 0;
|
||||
@@ -39,19 +38,19 @@ static inline unsigned int VIDEO_Y_STRIDE_BYTES(unsigned int v4l2_fmt,
|
||||
if (!width)
|
||||
goto invalid_input;
|
||||
|
||||
switch (v4l2_fmt) {
|
||||
case V4L2_PIX_FMT_NV12:
|
||||
case V4L2_PIX_FMT_NV21:
|
||||
case V4L2_PIX_FMT_VIDC_NV12C:
|
||||
switch (colorformat) {
|
||||
case MSM_VIDC_FMT_NV12:
|
||||
case MSM_VIDC_FMT_NV21:
|
||||
case MSM_VIDC_FMT_NV12C:
|
||||
alignment = 128;
|
||||
stride = MSM_MEDIA_ALIGN(width, alignment);
|
||||
break;
|
||||
case V4L2_PIX_FMT_VIDC_TP10C:
|
||||
case MSM_VIDC_FMT_TP10C:
|
||||
alignment = 256;
|
||||
stride = MSM_MEDIA_ALIGN(width, 192);
|
||||
stride = MSM_MEDIA_ALIGN(stride * 4/3, alignment);
|
||||
break;
|
||||
case V4L2_PIX_FMT_VIDC_P010:
|
||||
case MSM_VIDC_FMT_P010:
|
||||
alignment = 256;
|
||||
stride = MSM_MEDIA_ALIGN(width * 2, alignment);
|
||||
break;
|
||||
@@ -69,7 +68,7 @@ invalid_input:
|
||||
* Progressive: 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 alignment, stride = 0;
|
||||
@@ -77,15 +76,15 @@ static inline unsigned int VIDEO_Y_STRIDE_PIX(unsigned int v4l2_fmt,
|
||||
if (!width)
|
||||
goto invalid_input;
|
||||
|
||||
switch (v4l2_fmt) {
|
||||
case V4L2_PIX_FMT_NV12:
|
||||
case V4L2_PIX_FMT_NV21:
|
||||
case V4L2_PIX_FMT_VIDC_NV12C:
|
||||
case V4L2_PIX_FMT_VIDC_P010:
|
||||
switch (colorformat) {
|
||||
case MSM_VIDC_FMT_NV12:
|
||||
case MSM_VIDC_FMT_NV21:
|
||||
case MSM_VIDC_FMT_NV12C:
|
||||
case MSM_VIDC_FMT_P010:
|
||||
alignment = 128;
|
||||
stride = MSM_MEDIA_ALIGN(width, alignment);
|
||||
break;
|
||||
case V4L2_PIX_FMT_VIDC_TP10C:
|
||||
case MSM_VIDC_FMT_TP10C:
|
||||
alignment = 192;
|
||||
stride = MSM_MEDIA_ALIGN(width, alignment);
|
||||
break;
|
||||
@@ -103,7 +102,7 @@ invalid_input:
|
||||
* Progressive: 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 alignment, stride = 0;
|
||||
@@ -111,19 +110,19 @@ static inline unsigned int VIDEO_UV_STRIDE_BYTES(unsigned int v4l2_fmt,
|
||||
if (!width)
|
||||
goto invalid_input;
|
||||
|
||||
switch (v4l2_fmt) {
|
||||
case V4L2_PIX_FMT_NV21:
|
||||
case V4L2_PIX_FMT_NV12:
|
||||
case V4L2_PIX_FMT_VIDC_NV12C:
|
||||
switch (colorformat) {
|
||||
case MSM_VIDC_FMT_NV21:
|
||||
case MSM_VIDC_FMT_NV12:
|
||||
case MSM_VIDC_FMT_NV12C:
|
||||
alignment = 128;
|
||||
stride = MSM_MEDIA_ALIGN(width, alignment);
|
||||
break;
|
||||
case V4L2_PIX_FMT_VIDC_TP10C:
|
||||
case MSM_VIDC_FMT_TP10C:
|
||||
alignment = 256;
|
||||
stride = MSM_MEDIA_ALIGN(width, 192);
|
||||
stride = MSM_MEDIA_ALIGN(stride * 4/3, alignment);
|
||||
break;
|
||||
case V4L2_PIX_FMT_VIDC_P010:
|
||||
case MSM_VIDC_FMT_P010:
|
||||
alignment = 256;
|
||||
stride = MSM_MEDIA_ALIGN(width * 2, alignment);
|
||||
break;
|
||||
@@ -141,7 +140,7 @@ invalid_input:
|
||||
* Progressive: 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 alignment, stride = 0;
|
||||
@@ -149,15 +148,15 @@ static inline unsigned int VIDEO_UV_STRIDE_PIX(unsigned int v4l2_fmt,
|
||||
if (!width)
|
||||
goto invalid_input;
|
||||
|
||||
switch (v4l2_fmt) {
|
||||
case V4L2_PIX_FMT_NV21:
|
||||
case V4L2_PIX_FMT_NV12:
|
||||
case V4L2_PIX_FMT_VIDC_NV12C:
|
||||
case V4L2_PIX_FMT_VIDC_P010:
|
||||
switch (colorformat) {
|
||||
case MSM_VIDC_FMT_NV21:
|
||||
case MSM_VIDC_FMT_NV12:
|
||||
case MSM_VIDC_FMT_NV12C:
|
||||
case MSM_VIDC_FMT_P010:
|
||||
alignment = 128;
|
||||
stride = MSM_MEDIA_ALIGN(width, alignment);
|
||||
break;
|
||||
case V4L2_PIX_FMT_VIDC_TP10C:
|
||||
case MSM_VIDC_FMT_TP10C:
|
||||
alignment = 192;
|
||||
stride = MSM_MEDIA_ALIGN(width, alignment);
|
||||
break;
|
||||
@@ -175,7 +174,7 @@ invalid_input:
|
||||
* Progressive: height
|
||||
* 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 alignment, sclines = 0;
|
||||
@@ -183,14 +182,14 @@ static inline unsigned int VIDEO_Y_SCANLINES(unsigned int v4l2_fmt,
|
||||
if (!height)
|
||||
goto invalid_input;
|
||||
|
||||
switch (v4l2_fmt) {
|
||||
case V4L2_PIX_FMT_NV12:
|
||||
case V4L2_PIX_FMT_NV21:
|
||||
case V4L2_PIX_FMT_VIDC_NV12C:
|
||||
case V4L2_PIX_FMT_VIDC_P010:
|
||||
switch (colorformat) {
|
||||
case MSM_VIDC_FMT_NV12:
|
||||
case MSM_VIDC_FMT_NV21:
|
||||
case MSM_VIDC_FMT_NV12C:
|
||||
case MSM_VIDC_FMT_P010:
|
||||
alignment = 32;
|
||||
break;
|
||||
case V4L2_PIX_FMT_VIDC_TP10C:
|
||||
case MSM_VIDC_FMT_TP10C:
|
||||
alignment = 16;
|
||||
break;
|
||||
default:
|
||||
@@ -208,7 +207,7 @@ invalid_input:
|
||||
* Progressive: height
|
||||
* 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 alignment, sclines = 0;
|
||||
@@ -216,14 +215,14 @@ static inline unsigned int VIDEO_UV_SCANLINES(unsigned int v4l2_fmt,
|
||||
if (!height)
|
||||
goto invalid_input;
|
||||
|
||||
switch (v4l2_fmt) {
|
||||
case V4L2_PIX_FMT_NV21:
|
||||
case V4L2_PIX_FMT_NV12:
|
||||
case V4L2_PIX_FMT_VIDC_TP10C:
|
||||
case V4L2_PIX_FMT_VIDC_P010:
|
||||
switch (colorformat) {
|
||||
case MSM_VIDC_FMT_NV21:
|
||||
case MSM_VIDC_FMT_NV12:
|
||||
case MSM_VIDC_FMT_TP10C:
|
||||
case MSM_VIDC_FMT_P010:
|
||||
alignment = 16;
|
||||
break;
|
||||
case V4L2_PIX_FMT_VIDC_NV12C:
|
||||
case MSM_VIDC_FMT_NV12C:
|
||||
alignment = 32;
|
||||
break;
|
||||
default:
|
||||
@@ -243,7 +242,7 @@ invalid_input:
|
||||
* Progressive: 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)
|
||||
{
|
||||
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)
|
||||
goto invalid_input;
|
||||
|
||||
switch (v4l2_fmt) {
|
||||
case V4L2_PIX_FMT_VIDC_NV12C:
|
||||
switch (colorformat) {
|
||||
case MSM_VIDC_FMT_NV12C:
|
||||
y_tile_width = 32;
|
||||
break;
|
||||
case V4L2_PIX_FMT_VIDC_TP10C:
|
||||
case MSM_VIDC_FMT_TP10C:
|
||||
y_tile_width = 48;
|
||||
break;
|
||||
default:
|
||||
@@ -276,7 +275,7 @@ invalid_input:
|
||||
* Progressive: height
|
||||
* 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)
|
||||
{
|
||||
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)
|
||||
goto invalid_input;
|
||||
|
||||
switch (v4l2_fmt) {
|
||||
case V4L2_PIX_FMT_VIDC_NV12C:
|
||||
switch (colorformat) {
|
||||
case MSM_VIDC_FMT_NV12C:
|
||||
y_tile_height = 8;
|
||||
break;
|
||||
case V4L2_PIX_FMT_VIDC_TP10C:
|
||||
case MSM_VIDC_FMT_TP10C:
|
||||
y_tile_height = 4;
|
||||
break;
|
||||
default:
|
||||
@@ -309,7 +308,7 @@ invalid_input:
|
||||
* Progressive: 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)
|
||||
{
|
||||
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)
|
||||
goto invalid_input;
|
||||
|
||||
switch (v4l2_fmt) {
|
||||
case V4L2_PIX_FMT_VIDC_NV12C:
|
||||
switch (colorformat) {
|
||||
case MSM_VIDC_FMT_NV12C:
|
||||
uv_tile_width = 16;
|
||||
break;
|
||||
case V4L2_PIX_FMT_VIDC_TP10C:
|
||||
case MSM_VIDC_FMT_TP10C:
|
||||
uv_tile_width = 24;
|
||||
break;
|
||||
default:
|
||||
@@ -342,19 +341,19 @@ invalid_input:
|
||||
* Progressive: height
|
||||
* Interlaced: (height+1)>>1
|
||||
*/
|
||||
static inline unsigned int VIDEO_UV_META_SCANLINES(unsigned int v4l2_fmt,
|
||||
unsigned int height)
|
||||
static inline unsigned int video_uv_meta_scanlines(
|
||||
unsigned int colorformat, unsigned int height)
|
||||
{
|
||||
int uv_tile_height = 0, uv_meta_scanlines = 0;
|
||||
|
||||
if (!height)
|
||||
goto invalid_input;
|
||||
|
||||
switch (v4l2_fmt) {
|
||||
case V4L2_PIX_FMT_VIDC_NV12C:
|
||||
switch (colorformat) {
|
||||
case MSM_VIDC_FMT_NV12C:
|
||||
uv_tile_height = 8;
|
||||
break;
|
||||
case V4L2_PIX_FMT_VIDC_TP10C:
|
||||
case MSM_VIDC_FMT_TP10C:
|
||||
uv_tile_height = 4;
|
||||
break;
|
||||
default:
|
||||
@@ -368,17 +367,17 @@ invalid_input:
|
||||
return uv_meta_scanlines;
|
||||
}
|
||||
|
||||
static inline unsigned int VIDEO_RGB_STRIDE_BYTES(unsigned int v4l2_fmt,
|
||||
unsigned int width)
|
||||
static inline unsigned int video_rgb_stride_bytes(
|
||||
unsigned int colorformat, unsigned int width)
|
||||
{
|
||||
unsigned int alignment = 0, stride = 0, bpp = 4;
|
||||
|
||||
if (!width)
|
||||
goto invalid_input;
|
||||
|
||||
switch (v4l2_fmt) {
|
||||
case V4L2_PIX_FMT_VIDC_ARGB32C:
|
||||
case V4L2_PIX_FMT_RGBA32:
|
||||
switch (colorformat) {
|
||||
case MSM_VIDC_FMT_RGBA8888C:
|
||||
case MSM_VIDC_FMT_RGBA8888:
|
||||
alignment = 256;
|
||||
break;
|
||||
default:
|
||||
@@ -391,15 +390,15 @@ invalid_input:
|
||||
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 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 alignment = 0, scanlines = 0;
|
||||
@@ -407,11 +406,11 @@ static inline unsigned int VIDEO_RGB_SCANLINES(unsigned int v4l2_fmt,
|
||||
if (!height)
|
||||
goto invalid_input;
|
||||
|
||||
switch (v4l2_fmt) {
|
||||
case V4L2_PIX_FMT_VIDC_ARGB32C:
|
||||
switch (colorformat) {
|
||||
case MSM_VIDC_FMT_RGBA8888C:
|
||||
alignment = 16;
|
||||
break;
|
||||
case V4L2_PIX_FMT_RGBA32:
|
||||
case MSM_VIDC_FMT_RGBA8888:
|
||||
alignment = 32;
|
||||
break;
|
||||
default:
|
||||
@@ -424,17 +423,17 @@ invalid_input:
|
||||
return scanlines;
|
||||
}
|
||||
|
||||
static inline unsigned int VIDEO_RGB_META_STRIDE(unsigned int v4l2_fmt,
|
||||
unsigned int width)
|
||||
static inline unsigned int video_rgb_meta_stride(
|
||||
unsigned int colorformat, unsigned int width)
|
||||
{
|
||||
int rgb_tile_width = 0, rgb_meta_stride = 0;
|
||||
|
||||
if (!width)
|
||||
goto invalid_input;
|
||||
|
||||
switch (v4l2_fmt) {
|
||||
case V4L2_PIX_FMT_VIDC_ARGB32C:
|
||||
case V4L2_PIX_FMT_RGBA32:
|
||||
switch (colorformat) {
|
||||
case MSM_VIDC_FMT_RGBA8888C:
|
||||
case MSM_VIDC_FMT_RGBA8888:
|
||||
rgb_tile_width = 16;
|
||||
break;
|
||||
default:
|
||||
@@ -448,17 +447,17 @@ invalid_input:
|
||||
return rgb_meta_stride;
|
||||
}
|
||||
|
||||
static inline unsigned int VIDEO_RGB_META_SCANLINES(unsigned int v4l2_fmt,
|
||||
unsigned int height)
|
||||
static inline unsigned int video_rgb_meta_scanlines(
|
||||
unsigned int colorformat, unsigned int height)
|
||||
{
|
||||
int rgb_tile_height = 0, rgb_meta_scanlines = 0;
|
||||
|
||||
if (!height)
|
||||
goto invalid_input;
|
||||
|
||||
switch (v4l2_fmt) {
|
||||
case V4L2_PIX_FMT_VIDC_ARGB32C:
|
||||
case V4L2_PIX_FMT_RGBA32:
|
||||
switch (colorformat) {
|
||||
case MSM_VIDC_FMT_RGBA8888C:
|
||||
case MSM_VIDC_FMT_RGBA8888:
|
||||
rgb_tile_height = 4;
|
||||
break;
|
||||
default:
|
||||
@@ -472,7 +471,7 @@ invalid_input:
|
||||
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 size = 0;
|
||||
@@ -489,33 +488,33 @@ static inline unsigned int VIDEO_RAW_BUFFER_SIZE(unsigned int v4l2_fmt,
|
||||
if (!pix_width || !pix_height)
|
||||
goto invalid_input;
|
||||
|
||||
y_stride = VIDEO_Y_STRIDE_BYTES(v4l2_fmt, pix_width);
|
||||
uv_stride = VIDEO_UV_STRIDE_BYTES(v4l2_fmt, pix_width);
|
||||
y_sclines = VIDEO_Y_SCANLINES(v4l2_fmt, pix_height);
|
||||
uv_sclines = VIDEO_UV_SCANLINES(v4l2_fmt, pix_height);
|
||||
rgb_stride = VIDEO_RGB_STRIDE_BYTES(v4l2_fmt, pix_width);
|
||||
rgb_scanlines = VIDEO_RGB_SCANLINES(v4l2_fmt, pix_height);
|
||||
y_stride = video_y_stride_bytes(colorformat, pix_width);
|
||||
uv_stride = video_uv_stride_bytes(colorformat, pix_width);
|
||||
y_sclines = video_y_scanlines(colorformat, pix_height);
|
||||
uv_sclines = video_uv_scanlines(colorformat, pix_height);
|
||||
rgb_stride = video_rgb_stride_bytes(colorformat, pix_width);
|
||||
rgb_scanlines = video_rgb_scanlines(colorformat, pix_height);
|
||||
|
||||
switch (v4l2_fmt) {
|
||||
case V4L2_PIX_FMT_NV21:
|
||||
case V4L2_PIX_FMT_NV12:
|
||||
case V4L2_PIX_FMT_VIDC_P010:
|
||||
switch (colorformat) {
|
||||
case MSM_VIDC_FMT_NV21:
|
||||
case MSM_VIDC_FMT_NV12:
|
||||
case MSM_VIDC_FMT_P010:
|
||||
y_plane = y_stride * y_sclines;
|
||||
uv_plane = uv_stride * uv_sclines;
|
||||
size = y_plane + uv_plane;
|
||||
break;
|
||||
case V4L2_PIX_FMT_VIDC_NV12C:
|
||||
y_meta_stride = VIDEO_Y_META_STRIDE(v4l2_fmt, pix_width);
|
||||
uv_meta_stride = VIDEO_UV_META_STRIDE(v4l2_fmt, pix_width);
|
||||
if (!interlace && v4l2_fmt == V4L2_PIX_FMT_VIDC_NV12C) {
|
||||
case MSM_VIDC_FMT_NV12C:
|
||||
y_meta_stride = video_y_meta_stride(colorformat, pix_width);
|
||||
uv_meta_stride = video_uv_meta_stride(colorformat, pix_width);
|
||||
if (!interlace && colorformat == MSM_VIDC_FMT_NV12C) {
|
||||
y_ubwc_plane = MSM_MEDIA_ALIGN(y_stride * y_sclines, 4096);
|
||||
uv_ubwc_plane = MSM_MEDIA_ALIGN(uv_stride * uv_sclines, 4096);
|
||||
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_stride * y_meta_scanlines, 4096);
|
||||
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_scanlines, 4096);
|
||||
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 * pix_width) / 256 <= INTERLACE_MB_PER_FRAME_MAX) {
|
||||
y_sclines =
|
||||
VIDEO_Y_SCANLINES(v4l2_fmt, (pix_height+1)>>1);
|
||||
video_y_scanlines(colorformat, (pix_height+1)>>1);
|
||||
y_ubwc_plane =
|
||||
MSM_MEDIA_ALIGN(y_stride * y_sclines, 4096);
|
||||
uv_sclines =
|
||||
VIDEO_UV_SCANLINES(v4l2_fmt, (pix_height+1)>>1);
|
||||
video_uv_scanlines(colorformat, (pix_height+1)>>1);
|
||||
uv_ubwc_plane =
|
||||
MSM_MEDIA_ALIGN(uv_stride * uv_sclines, 4096);
|
||||
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_stride * y_meta_scanlines, 4096);
|
||||
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_scanlines, 4096);
|
||||
size = (y_ubwc_plane + uv_ubwc_plane + y_meta_plane +
|
||||
uv_meta_plane)*2;
|
||||
} else {
|
||||
y_sclines = VIDEO_Y_SCANLINES(v4l2_fmt, pix_height);
|
||||
y_sclines = video_y_scanlines(colorformat, pix_height);
|
||||
y_ubwc_plane =
|
||||
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 =
|
||||
MSM_MEDIA_ALIGN(uv_stride * uv_sclines, 4096);
|
||||
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_stride * y_meta_scanlines, 4096);
|
||||
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_scanlines, 4096);
|
||||
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;
|
||||
case V4L2_PIX_FMT_VIDC_TP10C:
|
||||
case MSM_VIDC_FMT_TP10C:
|
||||
y_ubwc_plane = MSM_MEDIA_ALIGN(y_stride * y_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_scanlines = VIDEO_Y_META_SCANLINES(v4l2_fmt, pix_height);
|
||||
y_meta_stride = video_y_meta_stride(colorformat, pix_width);
|
||||
y_meta_scanlines = video_y_meta_scanlines(colorformat, pix_height);
|
||||
y_meta_plane = MSM_MEDIA_ALIGN(
|
||||
y_meta_stride * y_meta_scanlines, 4096);
|
||||
uv_meta_stride = VIDEO_UV_META_STRIDE(v4l2_fmt, pix_width);
|
||||
uv_meta_scanlines = VIDEO_UV_META_SCANLINES(v4l2_fmt, pix_height);
|
||||
uv_meta_stride = video_uv_meta_stride(colorformat, pix_width);
|
||||
uv_meta_scanlines = video_uv_meta_scanlines(colorformat, pix_height);
|
||||
uv_meta_plane = MSM_MEDIA_ALIGN(uv_meta_stride *
|
||||
uv_meta_scanlines, 4096);
|
||||
|
||||
size = y_ubwc_plane + uv_ubwc_plane + y_meta_plane +
|
||||
uv_meta_plane;
|
||||
break;
|
||||
case V4L2_PIX_FMT_VIDC_ARGB32C:
|
||||
case MSM_VIDC_FMT_RGBA8888C:
|
||||
rgb_ubwc_plane = MSM_MEDIA_ALIGN(rgb_stride * rgb_scanlines,
|
||||
4096);
|
||||
rgb_meta_stride = VIDEO_RGB_META_STRIDE(v4l2_fmt, pix_width);
|
||||
rgb_meta_scanlines = VIDEO_RGB_META_SCANLINES(v4l2_fmt,
|
||||
rgb_meta_stride = video_rgb_meta_stride(colorformat, pix_width);
|
||||
rgb_meta_scanlines = video_rgb_meta_scanlines(colorformat,
|
||||
pix_height);
|
||||
rgb_meta_plane = MSM_MEDIA_ALIGN(rgb_meta_stride *
|
||||
rgb_meta_scanlines, 4096);
|
||||
size = rgb_ubwc_plane + rgb_meta_plane;
|
||||
break;
|
||||
case V4L2_PIX_FMT_RGBA32:
|
||||
case MSM_VIDC_FMT_RGBA8888:
|
||||
rgb_plane = MSM_MEDIA_ALIGN(rgb_stride * rgb_scanlines, 4096);
|
||||
size = rgb_plane;
|
||||
break;
|
||||
|
@@ -175,13 +175,12 @@ static int msm_vdec_set_linear_stride_scanline(struct msm_vidc_inst *inst)
|
||||
int rc = 0;
|
||||
u32 stride_y, scanline_y, stride_uv, scanline_uv;
|
||||
u32 payload[2];
|
||||
enum msm_vidc_colorformat_type colorformat;
|
||||
|
||||
if (inst->fmts[OUTPUT_PORT].fmt.pix_mp.pixelformat !=
|
||||
V4L2_PIX_FMT_NV12 &&
|
||||
inst->fmts[OUTPUT_PORT].fmt.pix_mp.pixelformat !=
|
||||
V4L2_PIX_FMT_VIDC_P010 &&
|
||||
inst->fmts[OUTPUT_PORT].fmt.pix_mp.pixelformat !=
|
||||
V4L2_PIX_FMT_NV21)
|
||||
colorformat = v4l2_colorformat_to_driver(
|
||||
inst->fmts[OUTPUT_PORT].fmt.pix_mp.pixelformat, __func__);
|
||||
|
||||
if (!is_linear_yuv_colorformat(colorformat))
|
||||
return 0;
|
||||
|
||||
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 payload[4];
|
||||
struct v4l2_format *f;
|
||||
u32 pix_fmt, width, height;
|
||||
u32 pix_fmt, width, height, colorformat;
|
||||
|
||||
f = &inst->fmts[OUTPUT_PORT];
|
||||
pix_fmt = f->fmt.pix_mp.pixelformat;
|
||||
width = f->fmt.pix_mp.width;
|
||||
height = f->fmt.pix_mp.height;
|
||||
|
||||
colorformat = v4l2_colorformat_to_driver(pix_fmt, __func__);
|
||||
|
||||
if (inst->codec != MSM_VIDC_AV1 ||
|
||||
(pix_fmt != V4L2_PIX_FMT_VIDC_NV12C &&
|
||||
pix_fmt != V4L2_PIX_FMT_VIDC_TP10C))
|
||||
(!is_ubwc_colorformat(colorformat)))
|
||||
return 0;
|
||||
|
||||
stride_y = VIDEO_Y_STRIDE_BYTES(pix_fmt, width);
|
||||
scanline_y = VIDEO_Y_SCANLINES(pix_fmt, height);
|
||||
stride_uv = VIDEO_UV_STRIDE_BYTES(pix_fmt, width);
|
||||
scanline_uv = VIDEO_UV_SCANLINES(pix_fmt, height);
|
||||
stride_y = video_y_stride_bytes(colorformat, width);
|
||||
scanline_y = video_y_scanlines(colorformat, height);
|
||||
stride_uv = video_uv_stride_bytes(colorformat, width);
|
||||
scanline_uv = video_uv_scanlines(colorformat, height);
|
||||
|
||||
meta_stride_y = VIDEO_Y_META_STRIDE(pix_fmt, width);
|
||||
meta_scanline_y = VIDEO_Y_META_SCANLINES(pix_fmt, height);
|
||||
meta_stride_uv = VIDEO_UV_META_STRIDE(pix_fmt, width);
|
||||
meta_scanline_uv = VIDEO_UV_META_SCANLINES(pix_fmt, height);
|
||||
meta_stride_y = video_y_meta_stride(colorformat, width);
|
||||
meta_scanline_y = video_y_meta_scanlines(colorformat, height);
|
||||
meta_stride_uv = video_uv_meta_stride(colorformat, width);
|
||||
meta_scanline_uv = video_uv_meta_scanlines(colorformat, height);
|
||||
|
||||
payload[0] = stride_y << 16 | scanline_y;
|
||||
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)
|
||||
{
|
||||
int rc = 0;
|
||||
u32 colorformat;
|
||||
u32 pix_fmt;
|
||||
u32 bitdepth = 8 << 16 | 8;
|
||||
enum msm_vidc_colorformat_type colorformat;
|
||||
|
||||
if (port != INPUT_PORT && port != OUTPUT_PORT) {
|
||||
i_vpr_e(inst, "%s: invalid port %d\n", __func__, port);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
colorformat = inst->fmts[OUTPUT_PORT].fmt.pix_mp.pixelformat;
|
||||
if (colorformat == V4L2_PIX_FMT_VIDC_P010 ||
|
||||
colorformat == V4L2_PIX_FMT_VIDC_TP10C)
|
||||
pix_fmt = inst->fmts[OUTPUT_PORT].fmt.pix_mp.pixelformat;
|
||||
colorformat = v4l2_colorformat_to_driver(pix_fmt, __func__);
|
||||
if (is_10bit_colorformat(colorformat))
|
||||
bitdepth = 10 << 16 | 10;
|
||||
|
||||
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 colour_description_present_flag = 0;
|
||||
u32 video_signal_type_present_flag = 0;
|
||||
enum msm_vidc_colorformat_type output_fmt;
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
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.height = height;
|
||||
|
||||
inst->fmts[OUTPUT_PORT].fmt.pix_mp.width = VIDEO_Y_STRIDE_PIX(
|
||||
inst->fmts[OUTPUT_PORT].fmt.pix_mp.pixelformat, width);
|
||||
inst->fmts[OUTPUT_PORT].fmt.pix_mp.height = VIDEO_Y_SCANLINES(
|
||||
inst->fmts[OUTPUT_PORT].fmt.pix_mp.pixelformat, height);
|
||||
output_fmt = v4l2_colorformat_to_driver(
|
||||
inst->fmts[OUTPUT_PORT].fmt.pix_mp.pixelformat, __func__);
|
||||
|
||||
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 =
|
||||
VIDEO_Y_STRIDE_BYTES(
|
||||
inst->fmts[OUTPUT_PORT].fmt.pix_mp.pixelformat, width);
|
||||
video_y_stride_bytes(output_fmt, width);
|
||||
inst->fmts[OUTPUT_PORT].fmt.pix_mp.plane_fmt[0].sizeimage =
|
||||
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;
|
||||
@@ -2304,7 +2308,8 @@ int msm_vdec_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
|
||||
int rc = 0;
|
||||
struct msm_vidc_core *core;
|
||||
struct v4l2_format *fmt, *output_fmt;
|
||||
u32 codec_align, pix_fmt;
|
||||
u32 codec_align;
|
||||
enum msm_vidc_colorformat_type colorformat;
|
||||
|
||||
if (!inst || !inst->core) {
|
||||
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;
|
||||
}
|
||||
fmt->fmt.pix_mp.pixelformat = f->fmt.pix_mp.pixelformat;
|
||||
fmt->fmt.pix_mp.width = VIDEO_Y_STRIDE_PIX(
|
||||
fmt->fmt.pix_mp.pixelformat, f->fmt.pix_mp.width);
|
||||
fmt->fmt.pix_mp.height = VIDEO_Y_SCANLINES(
|
||||
fmt->fmt.pix_mp.pixelformat,
|
||||
f->fmt.pix_mp.height);
|
||||
colorformat = v4l2_colorformat_to_driver(fmt->fmt.pix_mp.pixelformat,
|
||||
__func__);
|
||||
fmt->fmt.pix_mp.width = video_y_stride_pix(
|
||||
colorformat, f->fmt.pix_mp.width);
|
||||
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.plane_fmt[0].bytesperline =
|
||||
VIDEO_Y_STRIDE_BYTES(
|
||||
inst->fmts[OUTPUT_PORT].fmt.pix_mp.pixelformat,
|
||||
f->fmt.pix_mp.width);
|
||||
video_y_stride_bytes(
|
||||
colorformat, f->fmt.pix_mp.width);
|
||||
fmt->fmt.pix_mp.plane_fmt[0].sizeimage = call_session_op(core,
|
||||
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 =
|
||||
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, pix_fmt, __func__);
|
||||
msm_vidc_update_cap_value(inst, PIX_FMTS, colorformat, __func__);
|
||||
|
||||
/* update crop while input port is not 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;
|
||||
struct msm_vidc_core *core;
|
||||
struct v4l2_format *f;
|
||||
enum msm_vidc_colorformat_type colorformat;
|
||||
|
||||
if (!inst || !inst->core) {
|
||||
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->type = OUTPUT_MPLANE;
|
||||
f->fmt.pix_mp.pixelformat = V4L2_PIX_FMT_VIDC_NV12C;
|
||||
f->fmt.pix_mp.width = VIDEO_Y_STRIDE_PIX(f->fmt.pix_mp.pixelformat,
|
||||
DEFAULT_WIDTH);
|
||||
f->fmt.pix_mp.height = VIDEO_Y_SCANLINES(f->fmt.pix_mp.pixelformat,
|
||||
DEFAULT_HEIGHT);
|
||||
colorformat = v4l2_colorformat_to_driver(
|
||||
f->fmt.pix_mp.pixelformat, __func__);
|
||||
f->fmt.pix_mp.width = video_y_stride_pix(colorformat, DEFAULT_WIDTH);
|
||||
f->fmt.pix_mp.height = video_y_scanlines(colorformat, DEFAULT_HEIGHT);
|
||||
f->fmt.pix_mp.num_planes = 1;
|
||||
f->fmt.pix_mp.plane_fmt[0].bytesperline =
|
||||
VIDEO_Y_STRIDE_BYTES(
|
||||
inst->fmts[OUTPUT_PORT].fmt.pix_mp.pixelformat,
|
||||
DEFAULT_WIDTH);
|
||||
video_y_stride_bytes(colorformat, DEFAULT_WIDTH);
|
||||
f->fmt.pix_mp.plane_fmt[0].sizeimage = call_session_op(core,
|
||||
buffer_size, inst, MSM_VIDC_BUF_OUTPUT);
|
||||
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);
|
||||
scanline_y = ALIGN(inst->fmts[INPUT_PORT].fmt.pix_mp.height, HEIC_GRID_DIMENSION);
|
||||
} 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);
|
||||
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);
|
||||
} 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);
|
||||
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);
|
||||
}
|
||||
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) *
|
||||
(is_10bit_colorformat(pix_fmt) ? 2 : 1);
|
||||
} else if (is_rgba_colorformat(pix_fmt)) {
|
||||
bytesperline = VIDEO_RGB_STRIDE_BYTES(f->fmt.pix_mp.pixelformat,
|
||||
f->fmt.pix_mp.width);
|
||||
bytesperline = video_rgb_stride_bytes(pix_fmt, f->fmt.pix_mp.width);
|
||||
} else {
|
||||
bytesperline = VIDEO_Y_STRIDE_BYTES(f->fmt.pix_mp.pixelformat,
|
||||
f->fmt.pix_mp.width);
|
||||
bytesperline = video_y_stride_bytes(pix_fmt, f->fmt.pix_mp.width);
|
||||
}
|
||||
|
||||
fmt = &inst->fmts[INPUT_PORT];
|
||||
@@ -1790,6 +1788,7 @@ int msm_venc_inst_init(struct msm_vidc_inst *inst)
|
||||
int rc = 0;
|
||||
struct msm_vidc_core *core;
|
||||
struct v4l2_format *f;
|
||||
enum msm_vidc_colorformat_type colorformat;
|
||||
|
||||
if (!inst || !inst->core) {
|
||||
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.height = DEFAULT_HEIGHT;
|
||||
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 =
|
||||
VIDEO_Y_STRIDE_BYTES(f->fmt.pix_mp.pixelformat,
|
||||
DEFAULT_WIDTH);
|
||||
video_y_stride_bytes(colorformat, DEFAULT_WIDTH);
|
||||
f->fmt.pix_mp.plane_fmt[0].sizeimage = call_session_op(core,
|
||||
buffer_size, inst, MSM_VIDC_BUF_INPUT);
|
||||
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;
|
||||
struct v4l2_format *f;
|
||||
enum msm_vidc_colorformat_type colorformat;
|
||||
|
||||
f = &inst->fmts[OUTPUT_PORT];
|
||||
size = VIDEO_RAW_BUFFER_SIZE(f->fmt.pix_mp.pixelformat,
|
||||
f->fmt.pix_mp.width,
|
||||
colorformat = v4l2_colorformat_to_driver(f->fmt.pix_mp.pixelformat,
|
||||
__func__);
|
||||
size = video_buffer_size(colorformat, f->fmt.pix_mp.width,
|
||||
f->fmt.pix_mp.height, true);
|
||||
return size;
|
||||
}
|
||||
@@ -300,16 +302,18 @@ u32 msm_vidc_encoder_input_size(struct msm_vidc_inst *inst)
|
||||
u32 size;
|
||||
struct v4l2_format *f;
|
||||
u32 width, height;
|
||||
enum msm_vidc_colorformat_type colorformat;
|
||||
|
||||
f = &inst->fmts[INPUT_PORT];
|
||||
width = f->fmt.pix_mp.width;
|
||||
height = f->fmt.pix_mp.height;
|
||||
colorformat = v4l2_colorformat_to_driver(f->fmt.pix_mp.pixelformat,
|
||||
__func__);
|
||||
if (is_image_session(inst)) {
|
||||
width = ALIGN(width, HEIC_GRID_DIMENSION);
|
||||
height = ALIGN(height, HEIC_GRID_DIMENSION);
|
||||
}
|
||||
size = VIDEO_RAW_BUFFER_SIZE(f->fmt.pix_mp.pixelformat,
|
||||
width, height, true);
|
||||
size = video_buffer_size(colorformat, width, height, true);
|
||||
return size;
|
||||
}
|
||||
|
||||
|
@@ -5,7 +5,6 @@
|
||||
|
||||
#include <linux/iommu.h>
|
||||
#include <linux/workqueue.h>
|
||||
#include <media/v4l2_vidc_extensions.h>
|
||||
#include "msm_media_info.h"
|
||||
|
||||
#include "msm_vidc_driver.h"
|
||||
|
Reference in New Issue
Block a user