From patchwork Tue Mar 23 13:35:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 406878 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp4460813jai; Tue, 23 Mar 2021 06:36:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2WQ0VyOC3M8bihEirN3QWQSwjVRzdURWwd8ioIwGxaEFvNcrN9XyNsf9iFQSJiFTTwpso X-Received: by 2002:a50:f391:: with SMTP id g17mr4681387edm.26.1616506599724; Tue, 23 Mar 2021 06:36:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616506599; cv=none; d=google.com; s=arc-20160816; b=Is1jRrpT7TPo7Wza5ODnA32bINQd9o11l2bnWxxIK6kegjpAHOfTnsJxdQlyPCPsjS 6l/k3Y/3Ydqyb0o05URYwH8wki9f0VXJusFkNShgZK7Xhp0Su7W7jG4fMIzj/GU1z5x7 UG33iiioj3O1ohBS9FWdfrEUTDnDgVjOrXP766HlX8l5axiWSYGaNn7PVoNPGtFkrSLs ZFqzhPRPvLAyIvH8COro9VK0NAnow8umjeOJwifN/hjf8gybw7tWL/sbJU4Cckrzi5kN jKmArzE54pSV9ZEHhB93WOWSSDS8uo/CazGdSEw9XldvQzZY4UGdmSWCFeenmpoqLgdi C+xA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=//l1BqtUdSaKhUnb1YjCkD3o+Rvljtn6xVLWzLoWilo=; b=lj01rDxkef+Kh7M1vXCHI3MkYVQ4qpHqThTtVRWSlHoAvsgF68invwE54Ilx5ApGUZ XAAeABXKOzZhZkHESj3W0MjuGNVAHl+m1fsJNv3hIxGenCepOH6s4x70LROFiKELvQEa UBjelSD3y8Hha7cw7V5wia67IUoQ0eRfJ8fH6uoTm9fbwRP4W/af3jCQ4voLRKaHOZ0o nyFV94drO1L17skW5Qso+HJYx1B5q3yZBLu2gGcCk/gVhIY8Yt3YFfXMMW7aCcc9X3Op QpkZTW/2W7uq1Ulz9FDrqcPwjXCzia+7O31inietfrLCQHoHxC4WZFbHxlED60uw33Mb ctSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gx7fWGRZ; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k3si15121514edh.184.2021.03.23.06.36.39; Tue, 23 Mar 2021 06:36:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gx7fWGRZ; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231502AbhCWNgG (ORCPT + 17 others); Tue, 23 Mar 2021 09:36:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231485AbhCWNfg (ORCPT ); Tue, 23 Mar 2021 09:35:36 -0400 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F209C0613D8 for ; Tue, 23 Mar 2021 06:35:35 -0700 (PDT) Received: by mail-ej1-x632.google.com with SMTP id u5so27138732ejn.8 for ; Tue, 23 Mar 2021 06:35:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=//l1BqtUdSaKhUnb1YjCkD3o+Rvljtn6xVLWzLoWilo=; b=gx7fWGRZU0o+J7Wa5zj8uTxm5c7mUll7wtai6kMQOA3U9bBwtNYFoGnG1npykJyqnf ZcRHUbTRH9zed0EdFLuSUHNyAEkC3ToLFoXp6LTwGqgVAcjjYUdIlMPb7s9xAQMLMyr0 HYQWrulmsSaxtrSKJvVdoLQ6x5g4mh+WZq3pGNutJBVch/tH1PcskmMuK9ZImqcQr6Ao Vp7Mi+eWWiOc85nFkNsDR8q/W51jANP9/jyExYRlfunQXRjMolSTqVEDgMm5c5K+WOhf Q4SNc8mvwNgf6CYqDm6YIMNRkPWl25lcu4EAN3UDKT1DwM3dfzoLRP/vu2eDyHz/9Kgo jM7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=//l1BqtUdSaKhUnb1YjCkD3o+Rvljtn6xVLWzLoWilo=; b=GzjN1dcRf+bhgVgYLGCGQswJZ9xyCydgneVk3Km+1cWXGQFcrOEKsDCdWtSwKQxOW0 ErutP3+3zHengGxBVImGgigireInmnRsIDX1M6RH+BzE8pRMKg9L6QP/9WuCU9HP7zgr 6vsADvRbZltqTzYiXpejPOcM9y/EKfxOJnmS+YJVhyTNthjTAhujOMQCE82ax9h86XgD iPOtdxbVO4V6InNDVMQ83C/HLuVgXvr2zAdmeRBo3DOmKzgaUXkeupsZKAy9yuJ7rIUW lryvl3EJZBBYxenBT88Gay4Pb+6x0rY0MeTiO4QUwTuWlw0O71if+iQVKf2rpct38cBO mGLQ== X-Gm-Message-State: AOAM530OJAxVpQOEs377JKiUiTgQsFEVSGQRRc1aZQl52B/okSdQohdq 2StMdxuT2DmSfO6rv1ptO4zAYQ== X-Received: by 2002:a17:907:75c2:: with SMTP id jl2mr5054063ejc.334.1616506534192; Tue, 23 Mar 2021 06:35:34 -0700 (PDT) Received: from localhost.localdomain (hst-221-103.medicom.bg. [84.238.221.103]) by smtp.gmail.com with ESMTPSA id m7sm12627104edp.81.2021.03.23.06.35.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Mar 2021 06:35:33 -0700 (PDT) From: Stanimir Varbanov To: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: hverkuil-cisco@xs4all.nl, Stanimir Varbanov Subject: [PATCH v3 1/2] v4l2-ctrl: Add decoder conceal color control Date: Tue, 23 Mar 2021 15:35:19 +0200 Message-Id: <20210323133520.943317-2-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210323133520.943317-1-stanimir.varbanov@linaro.org> References: <20210323133520.943317-1-stanimir.varbanov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add decoder v4l2 control to set conceal color. Signed-off-by: Stanimir Varbanov Reviewed-by: Hans Verkuil --- .../media/v4l/ext-ctrls-codec.rst | 33 +++++++++++++++++++ drivers/media/v4l2-core/v4l2-ctrls.c | 9 +++++ include/uapi/linux/v4l2-controls.h | 1 + 3 files changed, 43 insertions(+) -- 2.25.1 diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst index 9963c1c9a4d5..e11a734c43bd 100644 --- a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst @@ -674,6 +674,39 @@ enum v4l2_mpeg_video_frame_skip_mode - is currently displayed (decoded). This value is reset to 0 whenever the decoder is started. +``V4L2_CID_MPEG_VIDEO_DEC_CONCEAL_COLOR (integer64)`` + This control sets the conceal color in YUV color space. It describes + the client preference of the error conceal color in case of an error + where the reference frame is missing. The decoder should fill the + reference buffer with the preferred color and use it for future + decoding. The control is using 16 bits per channel. + Applicable to decoders. + +.. flat-table:: + :header-rows: 0 + :stub-columns: 0 + + * - + - 8bit format + - 10bit format + - 12bit format + * - Y luminance + - Bit 0:7 + - Bit 0:9 + - Bit 0:11 + * - Cb chrominance + - Bit 16:23 + - Bit 16:25 + - Bit 16:27 + * - Cr chrominance + - Bit 32:39 + - Bit 32:41 + - Bit 32:43 + * - Must be zero + - Bit 48:63 + - Bit 48:63 + - Bit 48:63 + ``V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE (boolean)`` If enabled the decoder expects to receive a single slice per buffer, otherwise the decoder expects a single frame in per buffer. diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c index ca50e21e2838..c35c538c4aa4 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls.c +++ b/drivers/media/v4l2-core/v4l2-ctrls.c @@ -948,6 +948,7 @@ const char *v4l2_ctrl_get_name(u32 id) case V4L2_CID_MPEG_VIDEO_VBV_SIZE: return "VBV Buffer Size"; case V4L2_CID_MPEG_VIDEO_DEC_PTS: return "Video Decoder PTS"; case V4L2_CID_MPEG_VIDEO_DEC_FRAME: return "Video Decoder Frame Count"; + case V4L2_CID_MPEG_VIDEO_DEC_CONCEAL_COLOR: return "Video Decoder Conceal Color"; case V4L2_CID_MPEG_VIDEO_VBV_DELAY: return "Initial Delay for VBV Control"; case V4L2_CID_MPEG_VIDEO_MV_H_SEARCH_RANGE: return "Horizontal MV Search Range"; case V4L2_CID_MPEG_VIDEO_MV_V_SEARCH_RANGE: return "Vertical MV Search Range"; @@ -1436,6 +1437,14 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, *max = 0x7fffffffffffffffLL; *step = 1; break; + case V4L2_CID_MPEG_VIDEO_DEC_CONCEAL_COLOR: + *type = V4L2_CTRL_TYPE_INTEGER64; + *min = 0; + /* default for 8 bit black, luma is 16, chroma is 128 */ + *def = 0x8000800010LL; + *max = 0xffffffffffffLL; + *step = 1; + break; case V4L2_CID_PIXEL_RATE: *type = V4L2_CTRL_TYPE_INTEGER64; *flags |= V4L2_CTRL_FLAG_READ_ONLY; diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h index 6f8c08507bf4..926877c0c653 100644 --- a/include/uapi/linux/v4l2-controls.h +++ b/include/uapi/linux/v4l2-controls.h @@ -429,6 +429,7 @@ enum v4l2_mpeg_video_multi_slice_mode { #define V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME (V4L2_CID_CODEC_BASE+229) #define V4L2_CID_MPEG_VIDEO_BASELAYER_PRIORITY_ID (V4L2_CID_CODEC_BASE+230) #define V4L2_CID_MPEG_VIDEO_AU_DELIMITER (V4L2_CID_CODEC_BASE+231) +#define V4L2_CID_MPEG_VIDEO_DEC_CONCEAL_COLOR (V4L2_CID_CODEC_BASE+232) /* CIDs for the MPEG-2 Part 2 (H.262) codec */ #define V4L2_CID_MPEG_VIDEO_MPEG2_LEVEL (V4L2_CID_CODEC_BASE+270) From patchwork Tue Mar 23 13:35:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 407015 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C67B1C433E3 for ; Tue, 23 Mar 2021 13:36:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8612261983 for ; Tue, 23 Mar 2021 13:36:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231512AbhCWNgG (ORCPT ); Tue, 23 Mar 2021 09:36:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231492AbhCWNfg (ORCPT ); Tue, 23 Mar 2021 09:35:36 -0400 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3598CC061763 for ; Tue, 23 Mar 2021 06:35:36 -0700 (PDT) Received: by mail-ej1-x633.google.com with SMTP id b7so27151357ejv.1 for ; Tue, 23 Mar 2021 06:35:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tsEGpa4dqu8Xcycnuv/YrEf3ZyFT/539KnPTDuqzdP8=; b=mH9DyFhrr5BDsaj0c1NV4J7A2ukBV1DFd8j3i/o1qXbPmU1xxOFgIrvCIzD9yn+sz0 r2Gb5Dq+5JcXWvjBjObjvLQ3/bmJxtAbn6OmZ/fM4H7AlCy4OQ2YmBzMqLlHs+vVjOsD hxGA1byVN8ode5lkSu9Nqw9KdG3w4gN1UheWkNvmYl3ELkOXzoH805/1YQHJWjxVW9ec 7awsvuyVOhHmatQlwJ/ewBeU/u7lQ0A5h97COpOAW1ocidnmn9oofXcv1rHtsBt5Wa/4 DhZOgVuQxRexG6C1qCklHBIRZjjFkcY+ZqKaN0ojps6v8A6hUjWAi3eAGYLCqB7EYk9M Jv+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tsEGpa4dqu8Xcycnuv/YrEf3ZyFT/539KnPTDuqzdP8=; b=i3kpCiarO6raZ/3l/49r3JFYRH9N0Mc7en1AQO/ZzSDUmgN3tgNVnuWheg+5pMMtCu g2qjIyJ09bY3zg8RRGjkDxG/KnxRtHu9Y0l+7Qlh4jxoJ8q7AXZKYF96xsn7y+Z3BlOe 8ZQ2UZCNpJwrE7FldS0J6Kbm7WxPEk/M9OK5IiwFEP4hD+6A1pf6KIUV4rfX5H5tCnT9 jhbc2DZdbCR3/DBjrP+mPJorwcD/vh2xAbDWIIg5DA8jXZ3DWTbcpU1xUoEqYd/ktxoK kobBpsxUOpx2fb47i4A/tVts7/N094IhYGabNyVRN7t+FFg4s8quGKqMWRJxH68OUbIl 7N3w== X-Gm-Message-State: AOAM530kVd/jdvi2lC/OUOjojcXUmufvm+1DrcQVjEtOwrBwlC+jkOLd OHGhXH9yCSEMMpPmT2zrxmaa6w== X-Google-Smtp-Source: ABdhPJwPqixCXPHpTdqmHxHjcReynBvL6XTAPgly76xA/rzaqs2csiRUYGIcvBS/GHLwKgtcubrbIg== X-Received: by 2002:a17:906:379b:: with SMTP id n27mr5154146ejc.182.1616506534885; Tue, 23 Mar 2021 06:35:34 -0700 (PDT) Received: from localhost.localdomain (hst-221-103.medicom.bg. [84.238.221.103]) by smtp.gmail.com with ESMTPSA id m7sm12627104edp.81.2021.03.23.06.35.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Mar 2021 06:35:34 -0700 (PDT) From: Stanimir Varbanov To: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: hverkuil-cisco@xs4all.nl, Stanimir Varbanov Subject: [PATCH v3 2/2] venus: vdec: Add support for conceal control Date: Tue, 23 Mar 2021 15:35:20 +0200 Message-Id: <20210323133520.943317-3-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210323133520.943317-1-stanimir.varbanov@linaro.org> References: <20210323133520.943317-1-stanimir.varbanov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Adds support for decoder conceal color control. Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/core.h | 1 + drivers/media/platform/qcom/venus/hfi_cmds.c | 18 ++++++++++++++++-- drivers/media/platform/qcom/venus/hfi_helper.h | 10 ++++++++++ drivers/media/platform/qcom/venus/vdec.c | 11 ++++++++++- drivers/media/platform/qcom/venus/vdec_ctrls.c | 9 ++++++++- 5 files changed, 45 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h index 13c18c49714d..177b4abcd3a6 100644 --- a/drivers/media/platform/qcom/venus/core.h +++ b/drivers/media/platform/qcom/venus/core.h @@ -174,6 +174,7 @@ struct vdec_controls { u32 level; u32 display_delay; u32 display_delay_enable; + u64 conceal_color; }; struct venc_controls { diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.c b/drivers/media/platform/qcom/venus/hfi_cmds.c index 4f7565834469..884339aae6a7 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.c +++ b/drivers/media/platform/qcom/venus/hfi_cmds.c @@ -760,7 +760,9 @@ static int pkt_session_set_property_1x(struct hfi_session_set_property_pkt *pkt, struct hfi_conceal_color *color = prop_data; u32 *in = pdata; - color->conceal_color = *in; + color->conceal_color = *in & 0xff; + color->conceal_color |= ((*in >> 10) & 0xff) << 8; + color->conceal_color |= ((*in >> 20) & 0xff) << 16; pkt->shdr.hdr.size += sizeof(u32) + sizeof(*color); break; } @@ -1255,7 +1257,19 @@ pkt_session_set_property_6xx(struct hfi_session_set_property_pkt *pkt, cq->frame_quality = in->frame_quality; pkt->shdr.hdr.size += sizeof(u32) + sizeof(*cq); break; - } default: + } + case HFI_PROPERTY_PARAM_VDEC_CONCEAL_COLOR: { + struct hfi_conceal_color_v4 *color = prop_data; + u32 *in = pdata; + + color->conceal_color_8bit = *in & 0xff; + color->conceal_color_8bit |= ((*in >> 10) & 0xff) << 8; + color->conceal_color_8bit |= ((*in >> 20) & 0xff) << 16; + color->conceal_color_10bit = *in; + pkt->shdr.hdr.size += sizeof(u32) + sizeof(*color); + break; + } + default: return pkt_session_set_property_4xx(pkt, cookie, ptype, pdata); } diff --git a/drivers/media/platform/qcom/venus/hfi_helper.h b/drivers/media/platform/qcom/venus/hfi_helper.h index 6b524c7cde5f..fa49b49170b7 100644 --- a/drivers/media/platform/qcom/venus/hfi_helper.h +++ b/drivers/media/platform/qcom/venus/hfi_helper.h @@ -685,10 +685,20 @@ struct hfi_vc1e_perf_cfg_type { u32 search_range_y_subsampled[3]; }; +/* + * 0 - 7bit -> Luma (def: 16) + * 8 - 15bit -> Chroma (def: 128) + * format is valid up to v4 + */ struct hfi_conceal_color { u32 conceal_color; }; +struct hfi_conceal_color_v4 { + u32 conceal_color_8bit; + u32 conceal_color_10bit; +}; + struct hfi_intra_period { u32 pframes; u32 bframes; diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index c20496a14a55..ecb7deef5785 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -620,7 +620,7 @@ static int vdec_set_properties(struct venus_inst *inst) { struct vdec_controls *ctr = &inst->controls.dec; struct hfi_enable en = { .enable = 1 }; - u32 ptype, decode_order; + u32 ptype, decode_order, conceal; int ret; if (ctr->post_loop_deb_mode) { @@ -638,6 +638,15 @@ static int vdec_set_properties(struct venus_inst *inst) return ret; } + ptype = HFI_PROPERTY_PARAM_VDEC_CONCEAL_COLOR; + conceal = ctr->conceal_color & 0xffff; + conceal |= ((ctr->conceal_color >> 16) & 0xffff) << 10; + conceal |= ((ctr->conceal_color >> 32) & 0xffff) << 20; + + ret = hfi_session_set_property(inst, ptype, &conceal); + if (ret) + return ret; + return 0; } diff --git a/drivers/media/platform/qcom/venus/vdec_ctrls.c b/drivers/media/platform/qcom/venus/vdec_ctrls.c index 07680aae0a36..fbe12a608b21 100644 --- a/drivers/media/platform/qcom/venus/vdec_ctrls.c +++ b/drivers/media/platform/qcom/venus/vdec_ctrls.c @@ -36,6 +36,9 @@ static int vdec_op_s_ctrl(struct v4l2_ctrl *ctrl) case V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY_ENABLE: ctr->display_delay_enable = ctrl->val; break; + case V4L2_CID_MPEG_VIDEO_DEC_CONCEAL_COLOR: + ctr->conceal_color = *ctrl->p_new.p_s64; + break; default: return -EINVAL; } @@ -95,7 +98,7 @@ int vdec_ctrl_init(struct venus_inst *inst) struct v4l2_ctrl *ctrl; int ret; - ret = v4l2_ctrl_handler_init(&inst->ctrl_handler, 11); + ret = v4l2_ctrl_handler_init(&inst->ctrl_handler, 12); if (ret) return ret; @@ -172,6 +175,10 @@ int vdec_ctrl_init(struct venus_inst *inst) V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY_ENABLE, 0, 1, 1, 0); + v4l2_ctrl_new_std(&inst->ctrl_handler, &vdec_ctrl_ops, + V4L2_CID_MPEG_VIDEO_DEC_CONCEAL_COLOR, 0, + 0xffffffffffffLL, 1, 0x8000800010LL); + ret = inst->ctrl_handler.error; if (ret) { v4l2_ctrl_handler_free(&inst->ctrl_handler);