mirror of
https://github.com/torvalds/linux.git
synced 2026-09-28 12:02:03 +02:00
media: qcom: iris: vdec: update size and stride calculations for 10bit formats
Update the gen2 response and vdec s_fmt code to take in account the P010 and QC010 when calculating the width, height and stride. Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Tested-by: Wangao Wang <wangao.wang@oss.qualcomm.com> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Bryan O'Donoghue <bod@kernel.org>
This commit is contained in:
parent
3ea0343c09
commit
2f2f76d433
|
|
@ -542,9 +542,24 @@ static void iris_hfi_gen2_read_input_subcr_params(struct iris_inst *inst)
|
|||
pixmp_ip->width = width;
|
||||
pixmp_ip->height = height;
|
||||
|
||||
pixmp_op->width = ALIGN(width, 128);
|
||||
pixmp_op->height = ALIGN(height, 32);
|
||||
pixmp_op->plane_fmt[0].bytesperline = ALIGN(width, 128);
|
||||
switch (pixmp_op->pixelformat) {
|
||||
case V4L2_PIX_FMT_P010:
|
||||
pixmp_op->width = ALIGN(width, 128);
|
||||
pixmp_op->height = ALIGN(height, 32);
|
||||
pixmp_op->plane_fmt[0].bytesperline = ALIGN(width * 2, 256);
|
||||
break;
|
||||
case V4L2_PIX_FMT_QC10C:
|
||||
pixmp_op->width = roundup(width, 192);
|
||||
pixmp_op->height = ALIGN(height, 16);
|
||||
pixmp_op->plane_fmt[0].bytesperline = ALIGN(pixmp_op->width * 4 / 3, 256);
|
||||
break;
|
||||
case V4L2_PIX_FMT_NV12:
|
||||
case V4L2_PIX_FMT_QC08C:
|
||||
pixmp_op->width = ALIGN(width, 128);
|
||||
pixmp_op->height = ALIGN(height, 32);
|
||||
pixmp_op->plane_fmt[0].bytesperline = pixmp_op->width;
|
||||
break;
|
||||
}
|
||||
pixmp_op->plane_fmt[0].sizeimage = iris_get_buffer_size(inst, BUF_OUTPUT);
|
||||
|
||||
matrix_coeff = subsc_params.color_info & 0xFF;
|
||||
|
|
|
|||
|
|
@ -263,10 +263,28 @@ int iris_vdec_s_fmt(struct iris_inst *inst, struct v4l2_format *f)
|
|||
fmt = inst->fmt_dst;
|
||||
fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
|
||||
fmt->fmt.pix_mp.pixelformat = f->fmt.pix_mp.pixelformat;
|
||||
fmt->fmt.pix_mp.width = ALIGN(f->fmt.pix_mp.width, 128);
|
||||
fmt->fmt.pix_mp.height = ALIGN(f->fmt.pix_mp.height, 32);
|
||||
fmt->fmt.pix_mp.num_planes = 1;
|
||||
fmt->fmt.pix_mp.plane_fmt[0].bytesperline = ALIGN(f->fmt.pix_mp.width, 128);
|
||||
switch (f->fmt.pix_mp.pixelformat) {
|
||||
case V4L2_PIX_FMT_P010:
|
||||
fmt->fmt.pix_mp.width = ALIGN(f->fmt.pix_mp.width, 128);
|
||||
fmt->fmt.pix_mp.height = ALIGN(f->fmt.pix_mp.height, 32);
|
||||
fmt->fmt.pix_mp.plane_fmt[0].bytesperline =
|
||||
ALIGN(f->fmt.pix_mp.width * 2, 256);
|
||||
break;
|
||||
case V4L2_PIX_FMT_QC10C:
|
||||
fmt->fmt.pix_mp.width = roundup(f->fmt.pix_mp.width, 192);
|
||||
fmt->fmt.pix_mp.height = ALIGN(f->fmt.pix_mp.height, 16);
|
||||
fmt->fmt.pix_mp.plane_fmt[0].bytesperline =
|
||||
ALIGN(f->fmt.pix_mp.width * 4 / 3, 256);
|
||||
break;
|
||||
case V4L2_PIX_FMT_NV12:
|
||||
case V4L2_PIX_FMT_QC08C:
|
||||
fmt->fmt.pix_mp.width = ALIGN(f->fmt.pix_mp.width, 128);
|
||||
fmt->fmt.pix_mp.height = ALIGN(f->fmt.pix_mp.height, 32);
|
||||
fmt->fmt.pix_mp.plane_fmt[0].bytesperline =
|
||||
ALIGN(f->fmt.pix_mp.width, 128);
|
||||
break;
|
||||
}
|
||||
fmt->fmt.pix_mp.plane_fmt[0].sizeimage = iris_get_buffer_size(inst, BUF_OUTPUT);
|
||||
inst->buffers[BUF_OUTPUT].min_count = iris_vpu_buf_count(inst, BUF_OUTPUT);
|
||||
inst->buffers[BUF_OUTPUT].size = fmt->fmt.pix_mp.plane_fmt[0].sizeimage;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user