Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vsp2driver: Support to convert full-range YCbCr buffers #1

Open
wants to merge 1 commit into
base: rcar-gen3
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion vsp2driver/vsp2_rpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ static void rpf_configure(struct vsp2_entity *entity,
u32 stride_c = 0;
struct vsp_src_t *vsp_in = rpf_get_vsp_in(rpf);
u16 vspm_format;
u8 quantization = format->quantization;
bool is_rgb = false;

if (!vsp_in) {
dev_err(rpf->entity.vsp2->dev,
Expand Down Expand Up @@ -190,6 +192,7 @@ static void rpf_configure(struct vsp2_entity *entity,
vspm_format |= (1 << 8);
} else if (vspm_format < 0x0040) {
/* RGB format. */
is_rgb = true;
/* Set bytes per pixel. */
vspm_format |= (fmtinfo->bpp[0] / 8) << 8;
} else {
Expand All @@ -202,10 +205,16 @@ static void rpf_configure(struct vsp2_entity *entity,
vsp_in->cext = (infmt & (3 << 12)) >> 12;
vsp_in->csc = (infmt & (1 << 8)) >> 8;
vsp_in->iturbt = (infmt & (3 << 10)) >> 10;
vsp_in->clrcng = (infmt & (1 << 9)) >> 9;

vsp_in->swap = fmtinfo->swap;

if (quantization == V4L2_QUANTIZATION_DEFAULT)
quantization = V4L2_MAP_QUANTIZATION_DEFAULT(
is_rgb, format->colorspace, format->ycbcr_enc);

vsp_in->clrcng = (quantization == V4L2_QUANTIZATION_FULL_RANGE) ?
0x01 : 0x00;

/* Output location */
if (pipe->bru) {
const struct v4l2_rect *compose;
Expand Down