video: driver: allow adaptive/external blur along with rotation/flip
[1] Allow adaptive/external blur along with rotation/flip. [2] Update HFI_BUFFER_VPSS_ENC macro to align with CL: 30984523. Change-Id: Ibca9f273da4a8204f586e952aeb9b2e78b5ff941 Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
This commit is contained in:
@@ -251,7 +251,7 @@ static struct msm_platform_inst_capability instance_data_waipio[] = {
|
||||
CAP_FLAG_ROOT | CAP_FLAG_OUTPUT_PORT |
|
||||
CAP_FLAG_INPUT_PORT | CAP_FLAG_DYNAMIC_ALLOWED,
|
||||
{0},
|
||||
{BLUR_TYPES},
|
||||
{0},
|
||||
NULL, msm_vidc_set_flip},
|
||||
|
||||
{VFLIP, ENC, CODECS_ALL,
|
||||
@@ -272,7 +272,7 @@ static struct msm_platform_inst_capability instance_data_waipio[] = {
|
||||
HFI_PROP_ROTATION,
|
||||
CAP_FLAG_ROOT | CAP_FLAG_OUTPUT_PORT,
|
||||
{0},
|
||||
{BLUR_TYPES},
|
||||
{0},
|
||||
NULL, msm_vidc_set_rotation},
|
||||
|
||||
{SUPER_FRAME, ENC, H264|HEVC,
|
||||
@@ -448,8 +448,7 @@ static struct msm_platform_inst_capability instance_data_waipio[] = {
|
||||
V4L2_CID_MPEG_VIDC_VIDEO_BLUR_TYPES,
|
||||
HFI_PROP_BLUR_TYPES,
|
||||
CAP_FLAG_OUTPUT_PORT | CAP_FLAG_DYNAMIC_ALLOWED,
|
||||
{PIX_FMTS, ROTATION, HFLIP, BITRATE_MODE,
|
||||
CONTENT_ADAPTIVE_CODING},
|
||||
{PIX_FMTS, BITRATE_MODE, CONTENT_ADAPTIVE_CODING},
|
||||
{BLUR_RESOLUTION},
|
||||
msm_vidc_adjust_blur_type, msm_vidc_set_blur_type},
|
||||
|
||||
|
@@ -1520,11 +1520,11 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes) \
|
||||
HFI_BUFFER_DPB_ENC(_size, frame_width, frame_height, is_ten_bit); \
|
||||
} while (0)
|
||||
|
||||
#define HFI_BUFFER_VPSS_ENC(vpss_size, dswidth, dsheight, ds_enable, is_ten_bit) \
|
||||
#define HFI_BUFFER_VPSS_ENC(vpss_size, dswidth, dsheight, ds_enable, blur, is_ten_bit) \
|
||||
do \
|
||||
{ \
|
||||
vpss_size = 0; \
|
||||
if (ds_enable) \
|
||||
if (ds_enable || blur) \
|
||||
{ \
|
||||
HFI_BUFFER_DPB_ENC(vpss_size, dswidth, dsheight, is_ten_bit); \
|
||||
} \
|
||||
|
@@ -441,7 +441,7 @@ static u32 msm_vidc_encoder_arp_size_iris2(struct msm_vidc_inst *inst)
|
||||
static u32 msm_vidc_encoder_vpss_size_iris2(struct msm_vidc_inst* inst)
|
||||
{
|
||||
u32 size = 0;
|
||||
bool ds_enable = false, is_tenbit = false;
|
||||
bool ds_enable = false, is_tenbit = false, blur = false;
|
||||
u32 rotation_val = HFI_ROTATION_NONE;
|
||||
u32 width, height, driver_colorfmt;
|
||||
struct v4l2_format* f;
|
||||
@@ -472,8 +472,10 @@ static u32 msm_vidc_encoder_vpss_size_iris2(struct msm_vidc_inst* inst)
|
||||
driver_colorfmt = v4l2_colorformat_to_driver(
|
||||
f->fmt.pix_mp.pixelformat, __func__);
|
||||
is_tenbit = is_10bit_colorformat(driver_colorfmt);
|
||||
if (inst->capabilities->cap[BLUR_TYPES].value != VIDC_BLUR_NONE)
|
||||
blur = true;
|
||||
|
||||
HFI_BUFFER_VPSS_ENC(size, width, height, ds_enable, is_tenbit);
|
||||
HFI_BUFFER_VPSS_ENC(size, width, height, ds_enable, blur, is_tenbit);
|
||||
i_vpr_l(inst, "%s: size %d\n", __func__, size);
|
||||
return size;
|
||||
}
|
||||
|
@@ -1781,7 +1781,7 @@ int msm_vidc_adjust_blur_type(void *instance, struct v4l2_ctrl *ctrl)
|
||||
struct msm_vidc_inst_capability *capability;
|
||||
s32 adjusted_value;
|
||||
struct msm_vidc_inst *inst = (struct msm_vidc_inst *) instance;
|
||||
s32 rc_type = -1, rotation = -1, hflip = -1, vflip = -1, cac = -1;
|
||||
s32 rc_type = -1, cac = -1;
|
||||
s32 pix_fmts = -1;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
@@ -1801,25 +1801,18 @@ int msm_vidc_adjust_blur_type(void *instance, struct v4l2_ctrl *ctrl)
|
||||
|
||||
if (msm_vidc_get_parent_value(inst, BLUR_TYPES, BITRATE_MODE,
|
||||
&rc_type, __func__) ||
|
||||
msm_vidc_get_parent_value(inst, BLUR_TYPES, ROTATION,
|
||||
&rotation, __func__) ||
|
||||
msm_vidc_get_parent_value(inst, BLUR_TYPES,
|
||||
CONTENT_ADAPTIVE_CODING, &cac, __func__) ||
|
||||
msm_vidc_get_parent_value(inst, BLUR_TYPES, HFLIP,
|
||||
&hflip, __func__) ||
|
||||
msm_vidc_get_parent_value(inst, BLUR_TYPES, PIX_FMTS,
|
||||
&pix_fmts, __func__))
|
||||
return -EINVAL;
|
||||
|
||||
vflip = capability->cap[VFLIP].value;
|
||||
|
||||
if (adjusted_value == VIDC_BLUR_EXTERNAL) {
|
||||
if (rotation || hflip || vflip || is_scaling_enabled(inst)) {
|
||||
if (is_scaling_enabled(inst)) {
|
||||
adjusted_value = VIDC_BLUR_NONE;
|
||||
}
|
||||
} else if (adjusted_value == VIDC_BLUR_ADAPTIVE) {
|
||||
if (rotation || hflip || vflip || is_scaling_enabled(inst) ||
|
||||
(rc_type != HFI_RC_VBR_CFR) ||
|
||||
if (is_scaling_enabled(inst) || (rc_type != HFI_RC_VBR_CFR) ||
|
||||
!cac || is_10bit_colorformat(pix_fmts)) {
|
||||
adjusted_value = VIDC_BLUR_NONE;
|
||||
}
|
||||
|
Reference in New Issue
Block a user