From patchwork Tue Feb 9 09:45:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 379301 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp66715jah; Tue, 9 Feb 2021 01:50:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJw5Cws2mDTmOYt8q91zg7ldw35r3QUdPgvMR/VUoFepKJ7om0A12/XnxQd3D7IfFDdzqPt3 X-Received: by 2002:a17:906:5e59:: with SMTP id b25mr21522599eju.536.1612864227927; Tue, 09 Feb 2021 01:50:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612864227; cv=none; d=google.com; s=arc-20160816; b=sScBHoHYjkGPALKcKY5M/N830l5JGoH3xDomwZKCNN2soYo85cizg2aU/mCK5kVDP0 B+5dKV9/5iBqyp1x7P351HLW8+yW2vG7PU//pjVLSfzPBmv0Ksd59s1Di2tuFSIFwjj5 rZb3fQloTQ9mAwMwCMtS1/GJSrNC7QbjIjBMz34QnrCfOUPcV8dHPBqKbVY0xzz7z/TM iSm+xRg0+eKPN1Tgv3i51iqmZU81VLLg6J+uEtCI47Lm/NuZqL0fv8lOZXdLSIXz1P0F tlRaAeIdEco3nKhaTD/1jWqmBGqW6CxeULtRdHpmJzP4rjBXIxPjLW4nAGx26nKgbsw7 5fhw== 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=1MJqHrGnM0dQu0DigyaEySsKOikDfnTwALiwB12s0IA=; b=He9Yxa3XNn47HAsND2s5ncWIYsbzqfTabzghNvQq8H1jIsNQdf7td8CBIY4uPH6MSg RKNLWj3I+YVGwtBQZBsQex0PAvEEMHtJpSFHo74iEQxNtHf0zleXeN5/VOc7Es6aBVp+ qC0/VqBXgoMiR5G1mZCbQPeJSUtkJeskuIsIjXS4YLwOo3t7zsNQUsrh4ASEutgO1rPv fowm9FV4hUYHlIVQbd+01zW4D7L82LGskY9fFQfH/S8pNVzWfmLOwOYqZJcndbHovXTu DvDPNmwWmx3FgVKX3vt2cc3xH9HfwY++eGWeBk3SdrPgSZ0y1WOOdeCkvKDmiV2sKQqm L/vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sdkcqo0A; 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 eb13si16489259edb.538.2021.02.09.01.50.27; Tue, 09 Feb 2021 01:50:27 -0800 (PST) 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=sdkcqo0A; 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 S231231AbhBIJtF (ORCPT + 16 others); Tue, 9 Feb 2021 04:49:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230385AbhBIJrD (ORCPT ); Tue, 9 Feb 2021 04:47:03 -0500 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76598C06178A for ; Tue, 9 Feb 2021 01:46:23 -0800 (PST) Received: by mail-wm1-x32a.google.com with SMTP id m1so2828576wml.2 for ; Tue, 09 Feb 2021 01:46:23 -0800 (PST) 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=1MJqHrGnM0dQu0DigyaEySsKOikDfnTwALiwB12s0IA=; b=sdkcqo0A9Izowz51J/Xl+MxE07qepu1wSn5rnIPp42yTTyJ7qzmmNeOWlam7RKWHEC nl/TbLDmBiFb8Cdjjc6V5UWn2uSK3dbTi8af6JvRi2g6AgQGTbzoUF3UrRHAPvSYzruc OjyC4lCRLth7+k5RxxPWNOxs4iANp+M7rJM9xhCty8UocfdC9VjYEgeIHW9CzH95suKc j2zPZscmfLgMQ0xAbeuMYSUyBcq8L9qBXxldj99Ae5UfBuT+HpOb7E+d5uz/puXKCW5e a0NnmLBPbD2dV+U0lxvJXs3MEaCERp8l0klwOZpBP7hc6p2Pfv4a7QWHhqGn+JK33hrE pXAw== 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=1MJqHrGnM0dQu0DigyaEySsKOikDfnTwALiwB12s0IA=; b=En1OJk3X4JIFIz8I241OHFFU4xOTp5TUj0raBClNNvtWGXIWicrwGFD00D/TevBvKj W8cyyuI3lH9fvH6t9o+XNJWU1jdhkj2IbnXyLIPSxPcjRJPdvbfnBr6PrrbvzSxoP+5N u9aHrsAhaafRvtQSjh9rugF5sSb6uQEFgYh7NuiYoztQTBeOqpso+a9vVDtspG9peKkm ci+2MIz1dRJiTekvnBr1/M8x08CGWxTEydspDrpD4mbfMp7GX27OOK9Y0QEcS1NUtsXF JRSKAk6IwCx4zRngaub8Xx81XeHgx4YbwJFy6JoYyl5leZS2SPN35ug25m8gfdWt5CTS wQnA== X-Gm-Message-State: AOAM533mqpI7SuSIJsbII3E32nXNikutvN3BqvqeIlF2HVBHq6hV0IxL MxqEoUfti9ia4Mr5Fnfswd1pq0oknkGeO1+9 X-Received: by 2002:a1c:e90d:: with SMTP id q13mr2581018wmc.136.1612863982243; Tue, 09 Feb 2021 01:46:22 -0800 (PST) Received: from localhost.localdomain (hst-221-63.medicom.bg. [84.238.221.63]) by smtp.gmail.com with ESMTPSA id u14sm1509627wro.10.2021.02.09.01.46.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Feb 2021 01:46:21 -0800 (PST) From: Stanimir Varbanov To: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: Hans Verkuil , Stanimir Varbanov Subject: [PATCH 1/2] v4l2-ctrl: Add decoder conceal color control Date: Tue, 9 Feb 2021 11:45:26 +0200 Message-Id: <20210209094527.2173690-2-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210209094527.2173690-1-stanimir.varbanov@linaro.org> References: <20210209094527.2173690-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 --- .../media/v4l/ext-ctrls-codec.rst | 20 +++++++++++++++++++ drivers/media/v4l2-core/v4l2-ctrls.c | 9 +++++++++ include/uapi/linux/v4l2-controls.h | 1 + 3 files changed, 30 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 00944e97d638..994650052333 100644 --- a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst @@ -674,6 +674,26 @@ 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 conceal color in YUV color space. It describes the + client preference of error conceal color in case of error where + reference frame is missing. The decoder would paint the reference + buffer with preferred color and use it for future decoding. + Applicable to decoders. + +.. flat-table:: + :header-rows: 0 + :stub-columns: 0 + + * - Bit 0:15 + - Y luminance + * - Bit 16:31 + - Cb chrominance + * - Bit 32:47 + - Cr chrominance + * - Bit 48:63 + - Must be zero + ``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 016cf6204cbb..a3b9d28a00b7 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls.c +++ b/drivers/media/v4l2-core/v4l2-ctrls.c @@ -945,6 +945,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"; @@ -1430,6 +1431,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 8bit 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 039c0d7add1b..5e5a3068be2d 100644 --- a/include/uapi/linux/v4l2-controls.h +++ b/include/uapi/linux/v4l2-controls.h @@ -428,6 +428,7 @@ enum v4l2_mpeg_video_multi_slice_mode { #define V4L2_CID_MPEG_VIDEO_MV_V_SEARCH_RANGE (V4L2_CID_CODEC_BASE+228) #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_DEC_CONCEAL_COLOR (V4L2_CID_CODEC_BASE+231) /* 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 Feb 9 09:45:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 379299 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp65879jah; Tue, 9 Feb 2021 01:48:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJwxfKaNBCv7/JKirF5NkO8nvag1BWq+IrcCsyyJM3Lyy+gSo8kGDSz763vy2h7FILHxdHR1 X-Received: by 2002:a50:fa93:: with SMTP id w19mr20326618edr.211.1612864131578; Tue, 09 Feb 2021 01:48:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612864131; cv=none; d=google.com; s=arc-20160816; b=QUjbfCt+UHWbm5vAztjMcFBbbCiGEOgeyNX0zwqaFloj9tolSfvQf0MzrjwYN3q4zj AyQr9CX73sV2D7qAKpCD4bZ1JkWOv72nMDSfp9A23BLjLziYI+vwJGrmvCgZrMOsL9Ls GqaPOAcR9qym2ZwBuiPMYoDKPC79cMt2ywjt3GXM28bMpuFxUnkbHe9aUSUY/suxxxyI yQ6tMNkn+FcvXlVD3QOugxXN/qbo6qzpiBPREom/80oLCfmwvJAVn7uC9/bnzXIunxMm By+4pLb4WdKd0y7hs9w4KA85H03fzWhYACjHeilkINM2Ng6YzTP1IqNMfOb0FWDGQ2z/ y4Kw== 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=fSiros/bpA33DrxLIopBprg2PSwxl41ia1ZrqmhCZho=; b=tqtVMBlT3E7UDPww/fuBPy2+0MKp1ClXiwxD/SnwWH2grmUBarSIZJL1JRR1OqFSE6 fXkjILg7UfAfbtgQQqaDT0k/wVWKs7ANWK+WD5gjvnu+Wm+v0XufS1hRFVtZfeteYwSO G80ohR3FGSk30MTNPg+O8zQTEJLCaoGSUfGl7TBOcdrIHXyO9ew86Kd2QHr9PY65DScX SMkMNNOb8iDQxvGoP8pf/ORKGaywTck3l0I6GYk9XKKgPTB7yEfA6Z22T8oG670SBlZQ oEwUU8f7kkhkULS+/jvEoA/p583lhJz/MzJyBaP0u7STRr4rk9qP55t+/HZt+stMUk/9 auMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vuymAfDy; 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 hq38si12262318ejc.21.2021.02.09.01.48.51; Tue, 09 Feb 2021 01:48:51 -0800 (PST) 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=vuymAfDy; 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 S230283AbhBIJss (ORCPT + 16 others); Tue, 9 Feb 2021 04:48:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230229AbhBIJqq (ORCPT ); Tue, 9 Feb 2021 04:46:46 -0500 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23F53C0617AA for ; Tue, 9 Feb 2021 01:46:30 -0800 (PST) Received: by mail-wr1-x433.google.com with SMTP id h12so4535790wrw.6 for ; Tue, 09 Feb 2021 01:46:30 -0800 (PST) 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=fSiros/bpA33DrxLIopBprg2PSwxl41ia1ZrqmhCZho=; b=vuymAfDyb9XWQJGjC4tFRu9OpDkqZ6wpjb+3cg+oJtEvl6F3yIguUVh2zjmPp0e/vk +glgf+5EvIHURqr9BnMpmoPB3fyPZQFNXrox+OkaUC/8lHwp8GbR+37c/V04gVQS0AvI 5YYUbIf2uAq+uXt1vWaOU9wMWhxFNFF+YRfmDhqcPILso0AfKV3pRkZBSElXEhHe155H jBL15Mghp1LSsKAjzZbHsuHGTjGGgCuWq+S7cWKzaAG8eB9l6fX9bOioNgVUCM4owsG5 3wskIW5DkZ78EPcPvchpZecKfdvbcu/u5vf/0DMGA/faJOnaoe8krNwjgKAZNPyKt7O+ YrkA== 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=fSiros/bpA33DrxLIopBprg2PSwxl41ia1ZrqmhCZho=; b=Fz2l3BA2v5G6A2gGZHqLwlwS39ELth8/+EsExnLID8eP5CPWSbUu25d3UqPsxFvc3J lHUbYNJDWBZATu9nWVGV9v7etssAgcnBxHsPg64OJX7MZsaCmujsNBYBvYl2tQJYfQ6r zGhmhlswpEqNGUjm0c57yxPa7NMgJTgoecWP587vg7qP0/+qpQVej6sa/gUG47yGcHsG qKkylzBhOf0odY5c/qh5zq262BZ/+WAEGPP3CRyI2mRn9UPitbKuHaxPG9mGXPk4mIuA puf1rgyxCyrDf7dJYYb/TmrL1FgCCJctTBXxJ2l9ntik/p6Q1KPgyf2vH+FKYQG2B1Uw dMsQ== X-Gm-Message-State: AOAM532UlG283AvEM0Gx/1BwlC64fIiyy3hNpy2xdybDxsJ10GkMpKij mHGGFkYbcMs6BaXe2l0/mg9XtOoL8hHnYBdm X-Received: by 2002:adf:f749:: with SMTP id z9mr23848375wrp.327.1612863983827; Tue, 09 Feb 2021 01:46:23 -0800 (PST) Received: from localhost.localdomain (hst-221-63.medicom.bg. [84.238.221.63]) by smtp.gmail.com with ESMTPSA id u14sm1509627wro.10.2021.02.09.01.46.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Feb 2021 01:46:23 -0800 (PST) From: Stanimir Varbanov To: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: Hans Verkuil , Stanimir Varbanov Subject: [PATCH 2/2] venus: vdec: Add support for conceal control Date: Tue, 9 Feb 2021 11:45:27 +0200 Message-Id: <20210209094527.2173690-3-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210209094527.2173690-1-stanimir.varbanov@linaro.org> References: <20210209094527.2173690-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 | 7 +++++++ 5 files changed, 44 insertions(+), 3 deletions(-) -- 2.25.1 diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h index a252ed32cc14..b70ff14e5a5b 100644 --- a/drivers/media/platform/qcom/venus/core.h +++ b/drivers/media/platform/qcom/venus/core.h @@ -172,6 +172,7 @@ struct vdec_controls { u32 post_loop_deb_mode; u32 profile; u32 level; + 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 e4dc97f00fc3..8d98fca55db1 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; + u32 ptype, conceal; int ret; if (ctr->post_loop_deb_mode) { @@ -630,6 +630,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 974110b75b93..9ff3db1c4a0f 100644 --- a/drivers/media/platform/qcom/venus/vdec_ctrls.c +++ b/drivers/media/platform/qcom/venus/vdec_ctrls.c @@ -30,6 +30,9 @@ static int vdec_op_s_ctrl(struct v4l2_ctrl *ctrl) case V4L2_CID_MPEG_VIDEO_VP9_LEVEL: ctr->level = ctrl->val; break; + case V4L2_CID_MPEG_VIDEO_DEC_CONCEAL_COLOR: + ctr->conceal_color = *ctrl->p_new.p_s64; + break; default: return -EINVAL; } @@ -158,6 +161,10 @@ int vdec_ctrl_init(struct venus_inst *inst) if (ctrl) ctrl->flags |= V4L2_CTRL_FLAG_VOLATILE; + 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);