From patchwork Mon Jan 17 15:55:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 532679 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8996EC433EF for ; Mon, 17 Jan 2022 15:56:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240682AbiAQP4a (ORCPT ); Mon, 17 Jan 2022 10:56:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240674AbiAQP4a (ORCPT ); Mon, 17 Jan 2022 10:56:30 -0500 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78F4FC061751 for ; Mon, 17 Jan 2022 07:56:28 -0800 (PST) Received: by mail-wm1-x329.google.com with SMTP id p18so21349730wmg.4 for ; Mon, 17 Jan 2022 07:56:28 -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=QqfCOsJJeq7IcCNYO2ZlgBvYhrdH5GFyJuz369ymuIc=; b=DSF1gkNeQSuUqMQxP5iUYajJ7w/rOCri//LZWbLAA0cnvcOFNQ+hODNTnVPmaqVt7M IVtS5PKLr3lxUB8xSl4AJe9Bnd9Xw7xEyQJxnWnaKabVB7DvT54VYwn4HjHUaOG21JOK rP0PkXgl8e56CTul6K4rh3a4IYj25W32xfL+mIvEuY/Q0Sck02ghpfzyepnmzlB/66TL 0Vmve7pjdnCXxl47Eax7xJkY11jxpto09heWzKnw2Bf42ZSSk4zu+Rf/eEq3e+hWt4My TgN6U3FRaIeiYRDx0LzNAF6TCn4xW84c6rkgG08568Yefs9PniutpNbwBmXC1NQxNMGN 7TQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QqfCOsJJeq7IcCNYO2ZlgBvYhrdH5GFyJuz369ymuIc=; b=DoSM9rorJ+cyis4gMgqK7JLVAJhrPozOh1I6igJw7K6wmVM5H1UmrlxKoF3+MMKalD 2lG0QYZCyNbBa8BBuk/DZRf2WfTL0dBrwGExOPnxZyhM4VUUdy83XtBIvjbmknFA4aAy R8eDywfB+9+pRDoisJ42Ov1fQj15O9CadV+a6La5wHjXiL/JPX60T2Vs9d17qxcYehdW Ah63U8hXxXSbIPgL38N8cDtQnVjmzmX18SggGgxFffooAQmfHe4lPJHYlv5IOiDNWO/O bG44sRSNchnv4JjXurk4le6SHwP9EDDuEyH30Zi6S2/CxMKdUH38pYivmY803BXAI2n/ MGlA== X-Gm-Message-State: AOAM533lEz5/7lRKzPuARXbK8Q0j5eSHgQQ1qqBhtbC8uxq6snzqgGA7 /9XVb0y02Kxe3iSu3UCR4Scx4Ja9VqO58A== X-Google-Smtp-Source: ABdhPJxB5FGOm56NaILRrSD2XTX0NwqN/GJFwx4nLmFqOJTvGj9mtxXt+CyR64HNpF1mwOUpzwiwCg== X-Received: by 2002:adf:ef8d:: with SMTP id d13mr20272179wro.556.1642434987101; Mon, 17 Jan 2022 07:56:27 -0800 (PST) Received: from localhost.localdomain (hst-221-60.medicom.bg. [84.238.221.60]) by smtp.gmail.com with ESMTPSA id i82sm15542900wma.23.2022.01.17.07.56.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jan 2022 07:56:26 -0800 (PST) From: Stanimir Varbanov To: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org Cc: hverkuil-cisco@xs4all.nl, Stanimir Varbanov Subject: [PATCH v3 1/6] v4l: Add Qualcomm custom compressed pixel formats Date: Mon, 17 Jan 2022 17:55:54 +0200 Message-Id: <20220117155559.234026-2-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220117155559.234026-1-stanimir.varbanov@linaro.org> References: <20220117155559.234026-1-stanimir.varbanov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add custom Qualcomm raw compressed pixel formats. They are used in Qualcomm SoCs to optimize the interconnect bandwidth. Signed-off-by: Stanimir Varbanov --- .../media/v4l/pixfmt-reserved.rst | 19 +++++++++++++++++++ drivers/media/v4l2-core/v4l2-ioctl.c | 2 ++ include/uapi/linux/videodev2.h | 2 ++ 3 files changed, 23 insertions(+) diff --git a/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst b/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst index 2f2133b4cd9c..929bd0dc0ba3 100644 --- a/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst +++ b/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst @@ -245,6 +245,25 @@ please make a proposal on the linux-media mailing list. - Non-compressed, tiled two-planar format used by Mediatek MT8183. This is an opaque intermediate format and the MDP3 hardware can be used to convert it to other formats. + * .. _V4L2-PIX-FMT-QC08C: + + - ``V4L2_PIX_FMT_QC08C`` + - 'QC08C' + - Compressed Macro-tile 8-Bit YUV420 format used by Qualcomm platforms. + It is an opaque intermediate format. The used compression is lossless + and it is used by various multimedia hardware blocks like GPU, display + controllers, ISP and video accelerators. + It contains four planes for progressive video and eight planes for + interlaced video. + * .. _V4L2-PIX-FMT-QC10C: + + - ``V4L2_PIX_FMT_QC10C`` + - 'QC10C' + - Compressed Macro-tile 10-Bit YUV420 format used by Qualcomm platforms. + It is an opaque intermediate format. The used compression is lossless + and it is used by various multimedia hardware blocks like GPU, display + controllers, ISP and video accelerators. + It contains four planes for progressive video. .. raw:: latex diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c index 9ac557b8e146..1b6462f9ad7e 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -1437,6 +1437,8 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt) case V4L2_PIX_FMT_SE401: descr = "GSPCA SE401"; break; case V4L2_PIX_FMT_S5C_UYVY_JPG: descr = "S5C73MX interleaved UYVY/JPEG"; break; case V4L2_PIX_FMT_MT21C: descr = "Mediatek Compressed Format"; break; + case V4L2_PIX_FMT_QC08C: descr = "QCOM Compressed 8-bit Format"; break; + case V4L2_PIX_FMT_QC10C: descr = "QCOM Compressed 10-bit Format"; break; default: if (fmt->description[0]) return; diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index df8b9c486ba1..e710903185bd 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -744,6 +744,8 @@ struct v4l2_pix_format { #define V4L2_PIX_FMT_INZI v4l2_fourcc('I', 'N', 'Z', 'I') /* Intel Planar Greyscale 10-bit and Depth 16-bit */ #define V4L2_PIX_FMT_CNF4 v4l2_fourcc('C', 'N', 'F', '4') /* Intel 4-bit packed depth confidence information */ #define V4L2_PIX_FMT_HI240 v4l2_fourcc('H', 'I', '2', '4') /* BTTV 8-bit dithered RGB */ +#define V4L2_PIX_FMT_QC08C v4l2_fourcc('Q', '0', '8', 'C') /* Qualcomm 8-bit compressed */ +#define V4L2_PIX_FMT_QC10C v4l2_fourcc('Q', '1', '0', 'C') /* Qualcomm 10-bit compressed */ /* 10bit raw bayer packed, 32 bytes for every 25 pixels, last LSB 6 bits unused */ #define V4L2_PIX_FMT_IPU3_SBGGR10 v4l2_fourcc('i', 'p', '3', 'b') /* IPU3 packed 10-bit BGGR bayer */ From patchwork Mon Jan 17 15:55:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 532938 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5E93C4332F for ; Mon, 17 Jan 2022 15:56:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240698AbiAQP4b (ORCPT ); Mon, 17 Jan 2022 10:56:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240605AbiAQP4a (ORCPT ); Mon, 17 Jan 2022 10:56:30 -0500 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFC78C061747 for ; Mon, 17 Jan 2022 07:56:29 -0800 (PST) Received: by mail-wm1-x331.google.com with SMTP id 25-20020a05600c231900b003497473a9c4so25415778wmo.5 for ; Mon, 17 Jan 2022 07:56:29 -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=17LNy9CZCP/+ZCdmdAFt4lcNroP4x+vbh8EUReOHAKQ=; b=myzg5tHLPabWaZfbAFNqhMc5tgs6CACzdGcvLA+m1kDstDrK8nQWPQkzoDNMtDYf6L yFgffmK7U/OjMUNCP9iQkf0IVI8tuFdsfbYke8xMnp4a4WFDGW7AGLqoggHvpLUUiLIf 0+sGkvCWroLz9UUWXBS16UGeSlgPtUb5KhhC2NFAwEU5YvlJFOJ8zCPGFf6yMA/zaA9B nJfrLqh4iQFndhY0RD6SgXSW2tHvAAC2xpUBVZaAg2PPshrR37yjLObNgt7UpU59aLC6 8pvccvU0yC1GqeE/wdCUVQOCJ4LwSNk7JXY5iZ7U6/CEw5OCkNZAIAtVCb/uw4j+eh15 tUEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=17LNy9CZCP/+ZCdmdAFt4lcNroP4x+vbh8EUReOHAKQ=; b=MKDJRDbFI0zpG96M+oFa0R8J7XS/zk7XHws1p+YXEgJGAIUUXGVzyHXoJd0tPc6MXy VifYymUSSMkkj5Bwls/H3KUIO0J7cCkVcHo1FDfzIiFXwrjU+Dn4ogjNv+DQqFC0ESAB Lut6QXze1JJhnrZpJ4owIL0GWAUBhxZL0g7CssbvvihQaK1WhjlFknRLHZdiLgag5cut csDXimhZz2KdHc10g4k37MGPj4GDidWwJbpAzdSvuQiXW5kJLs6OSBs5BPoXqLgv3e+u HhLi/Ip6qfk7GCmgIHAgnXpguTrdu1OiRcLtzHAnkS3Dl8uVAubvLIaNzHKKnYX2bgpc eBIA== X-Gm-Message-State: AOAM530iaFiMkIWcHpcWrg5r8xbi3jdTN5jDMjJ8Bi3KftABABZ0LTOX Sd/6qZCFuZaxECgz7741B7YB4Q== X-Google-Smtp-Source: ABdhPJyDp87Po46VaGOl6acuVZtXN+Q1xZ5oDZxrG5yNSi308OV+MzOqT4zgSdan/g2SlMojqms2Lw== X-Received: by 2002:a5d:59ac:: with SMTP id p12mr8800161wrr.9.1642434988332; Mon, 17 Jan 2022 07:56:28 -0800 (PST) Received: from localhost.localdomain (hst-221-60.medicom.bg. [84.238.221.60]) by smtp.gmail.com with ESMTPSA id i82sm15542900wma.23.2022.01.17.07.56.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jan 2022 07:56:27 -0800 (PST) From: Stanimir Varbanov To: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org Cc: hverkuil-cisco@xs4all.nl, Stanimir Varbanov Subject: [PATCH v3 2/6] venus: helpers: Add helper to check supported pixel formats Date: Mon, 17 Jan 2022 17:55:55 +0200 Message-Id: <20220117155559.234026-3-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220117155559.234026-1-stanimir.varbanov@linaro.org> References: <20220117155559.234026-1-stanimir.varbanov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add a helper to check supported pixel format per codec and session type. Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/helpers.c | 23 +++++++++++++++++++++ drivers/media/platform/qcom/venus/helpers.h | 1 + 2 files changed, 24 insertions(+) diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index 84c3a511ec31..a5464385a716 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -1797,6 +1797,29 @@ int venus_helper_get_out_fmts(struct venus_inst *inst, u32 v4l2_fmt, } EXPORT_SYMBOL_GPL(venus_helper_get_out_fmts); +bool venus_helper_check_format(struct venus_inst *inst, u32 v4l2_pixfmt) +{ + struct venus_core *core = inst->core; + u32 fmt = to_hfi_raw_fmt(v4l2_pixfmt); + struct hfi_plat_caps *caps; + u32 buftype; + + if (!fmt) + return false; + + caps = venus_caps_by_codec(core, inst->hfi_codec, inst->session_type); + if (!caps) + return false; + + if (inst->session_type == VIDC_SESSION_TYPE_DEC) + buftype = HFI_BUFFER_OUTPUT2; + else + buftype = HFI_BUFFER_OUTPUT; + + return find_fmt_from_caps(caps, buftype, fmt); +} +EXPORT_SYMBOL_GPL(venus_helper_check_format); + int venus_helper_set_stride(struct venus_inst *inst, unsigned int width, unsigned int height) { diff --git a/drivers/media/platform/qcom/venus/helpers.h b/drivers/media/platform/qcom/venus/helpers.h index 32619c3e8c97..358e4f39c9c0 100644 --- a/drivers/media/platform/qcom/venus/helpers.h +++ b/drivers/media/platform/qcom/venus/helpers.h @@ -55,6 +55,7 @@ void venus_helper_init_instance(struct venus_inst *inst); int venus_helper_session_init(struct venus_inst *inst); int venus_helper_get_out_fmts(struct venus_inst *inst, u32 fmt, u32 *out_fmt, u32 *out2_fmt, bool ubwc); +bool venus_helper_check_format(struct venus_inst *inst, u32 v4l2_pixfmt); int venus_helper_alloc_dpb_bufs(struct venus_inst *inst); int venus_helper_free_dpb_bufs(struct venus_inst *inst); int venus_helper_intbufs_alloc(struct venus_inst *inst); From patchwork Mon Jan 17 15:55:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 532678 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37EE8C433FE for ; Mon, 17 Jan 2022 15:56:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240718AbiAQP4c (ORCPT ); Mon, 17 Jan 2022 10:56:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240689AbiAQP4b (ORCPT ); Mon, 17 Jan 2022 10:56:31 -0500 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4302C061574 for ; Mon, 17 Jan 2022 07:56:30 -0800 (PST) Received: by mail-wm1-x332.google.com with SMTP id bg19-20020a05600c3c9300b0034565e837b6so171500wmb.1 for ; Mon, 17 Jan 2022 07:56: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=u9C5eDXIt2JgC7f+jIHCQcIVT6TGBlNH+TmJyzYUodM=; b=OdCqkOj4K90mnj5dm3duSXPek6dgVb5LEjJtgmAXFsCUstfgZIgkL28sB2bwtDwXwe 8MT82sm2vqzLK1lIFNm6bJ7PC6OZu1ZFmMLhFHmmukgix4slEwRllFRqMjMxi3s1Uo+f 82hUfVR/C/tCPoQTs7BYoinPllnplmOYAMF4AUTjDetX21Nd582emqILyXL1qkseUbrF H/QIH82XBqjLjjKXjo1KvE1Phmb3UzPrdkPCRE00FY+a2Q2IDDBKI3Pqg2deh52M1lRr HbAaBx8QB9PJoF5FbNYvQWUCN/6fGzZ3v+i4Qt47J/iukCylWgKGgf2y8BK9ZeiEDn46 0B+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=u9C5eDXIt2JgC7f+jIHCQcIVT6TGBlNH+TmJyzYUodM=; b=O+72tHaATSNYEFlhEJQjQyVBKwMJ/zazddg3ycI6926LJXZgAzaIFP2va3JwS3wHS7 iQCpomdVq38zSpT5/AHz8S5tFShZL/zIhn9UfopT0BWnFZu6Mol3i2LVZt86hi7JpCfK 6nC7ebzMltfiRg6z4V+kWK7MWU83Td6K/TU4b0/P4dz2bI7/vQxXWTnHETEA+km/Sogo bgxPL0i0Gvkz1YSzn/JHQNpVLMdl9L2vQ+OtqHkt0XT27X677u2Kul/7+vqJf0jWDHJ9 srUnJXRssTy/ffpdd3PG6FFd9hkAdESkzgnaCn4bwuowAtaD53lY2S68RqO322uFEeQ+ x0KA== X-Gm-Message-State: AOAM532ogOw21GcMHMkywJRN1Z1Pc14qbjP3p+Kn/6G8ztNf8GUcu9w1 GfEu91umXSdZwtFKyma4HaDO0g== X-Google-Smtp-Source: ABdhPJyNrlg1CEHuchAifM/k9e7/o2NvgG+Y4sNgoOIRDRpbH99Avz/yXfx9+SWEEVnGDqHJz/Oh0Q== X-Received: by 2002:a5d:4c4d:: with SMTP id n13mr20277570wrt.641.1642434989257; Mon, 17 Jan 2022 07:56:29 -0800 (PST) Received: from localhost.localdomain (hst-221-60.medicom.bg. [84.238.221.60]) by smtp.gmail.com with ESMTPSA id i82sm15542900wma.23.2022.01.17.07.56.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jan 2022 07:56:28 -0800 (PST) From: Stanimir Varbanov To: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org Cc: hverkuil-cisco@xs4all.nl, Stanimir Varbanov Subject: [PATCH v3 3/6] venus: Add a handling of QC08C compressed format Date: Mon, 17 Jan 2022 17:55:56 +0200 Message-Id: <20220117155559.234026-4-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220117155559.234026-1-stanimir.varbanov@linaro.org> References: <20220117155559.234026-1-stanimir.varbanov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org This adds QC08C compressed pixel format in the Venus driver, and make it possible to discover from v4l2 clients. Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/helpers.c | 2 ++ drivers/media/platform/qcom/venus/vdec.c | 18 +++++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index a5464385a716..adbfa4fbe139 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -592,6 +592,8 @@ static u32 to_hfi_raw_fmt(u32 v4l2_fmt) return HFI_COLOR_FORMAT_NV12; case V4L2_PIX_FMT_NV21: return HFI_COLOR_FORMAT_NV21; + case V4L2_PIX_FMT_QC08C: + return HFI_COLOR_FORMAT_NV12_UBWC; default: break; } diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index 91da3f509724..eb02e45a512b 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -31,6 +31,10 @@ */ static const struct venus_format vdec_formats[] = { { + .pixfmt = V4L2_PIX_FMT_QC08C, + .num_planes = 1, + .type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, + }, { .pixfmt = V4L2_PIX_FMT_NV12, .num_planes = 1, .type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, @@ -106,6 +110,10 @@ find_format(struct venus_inst *inst, u32 pixfmt, u32 type) !venus_helper_check_codec(inst, fmt[i].pixfmt)) return NULL; + if (V4L2_TYPE_IS_CAPTURE(type) && + !venus_helper_check_format(inst, fmt[i].pixfmt)) + return NULL; + return &fmt[i]; } @@ -124,8 +132,12 @@ find_format_by_index(struct venus_inst *inst, unsigned int index, u32 type) if (fmt[i].type != type) continue; - valid = type != V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE || - venus_helper_check_codec(inst, fmt[i].pixfmt); + + if (V4L2_TYPE_IS_OUTPUT(type)) + valid = venus_helper_check_codec(inst, fmt[i].pixfmt); + else if (V4L2_TYPE_IS_CAPTURE(type)) + valid = venus_helper_check_format(inst, fmt[i].pixfmt); + if (k == index && valid) break; if (valid) @@ -1525,7 +1537,7 @@ static const struct hfi_inst_ops vdec_hfi_ops = { static void vdec_inst_init(struct venus_inst *inst) { inst->hfi_codec = HFI_VIDEO_CODEC_H264; - inst->fmt_out = &vdec_formats[6]; + inst->fmt_out = &vdec_formats[7]; inst->fmt_cap = &vdec_formats[0]; inst->width = frame_width_min(inst); inst->height = ALIGN(frame_height_min(inst), 32); From patchwork Mon Jan 17 15:55:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 532936 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 95C1BC433EF for ; Mon, 17 Jan 2022 15:56:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240754AbiAQP4i (ORCPT ); Mon, 17 Jan 2022 10:56:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240677AbiAQP4c (ORCPT ); Mon, 17 Jan 2022 10:56:32 -0500 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9220AC06161C for ; Mon, 17 Jan 2022 07:56:31 -0800 (PST) Received: by mail-wm1-x32b.google.com with SMTP id c2so15840143wml.1 for ; Mon, 17 Jan 2022 07:56:31 -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=yAEFbpvN98ptmknkKWl0O8Ur86W+dj9ENZyY+Bs86R0=; b=R8t67VZFO1HmMGwZdmiWdCI77MtFkggjVAOUfJdmvVBjfSveEvCbzvA5UJ5rIDDNRL zRD3XKbZOaQJTs+DLOjBtyT09CdCloFMpIcVlIcaPrR0URZ6l2qenVfs/nYEiGf9cDDP sHkjHQkD+KBy4FlyH5qP2gJu7ikwmLErNC4j6yGVTYzZS0iY0rv9X/ITiH8OSC0m4+2O I2+IQc/bvYEgzVBPu+wEHfpOH6wQk2nQEjYWPgEfNFlYC7ASaTfigk7oSQD5sZa1L5oY 2KlRFgLpbTJ0dMSs8w+S8OxEuSi2wJEsAbnBKQncMeS2GpvGrsbNl/ZTyFSWd3s2cvvA M3SQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yAEFbpvN98ptmknkKWl0O8Ur86W+dj9ENZyY+Bs86R0=; b=bn2xGSTZzCH1+BFYcYea1iHBJWFlrNVZrvk3eBd6FBKAn8/5uK9mBKG9Lgc75yi5mK KRPZcGfGRsNj3wghLBln5vpGbh1+ldABDCvx4HPuPR46JuMvpLH3m1YTIiEm30q+AMhA jt7c2L+PPUGNvl2hO8lGR0prgJKHPVnQEj5MYQkcrlcejZfK4BJfqCwMDZtyMmXKjGCz GDCHaZ8kaYDPX5Iqyjoi/Lee+syHudG4umVcEqmg3uJx6xWO1P9ASolHxCrtGGbO7MtN GRvNbi1PKIA+gpPiCDMHYWngNxqISojNDRedVRPRdyRMQP0aS8ICgGFKA+/8ATEY/Jpa RfYw== X-Gm-Message-State: AOAM530d4fyOMSATLrVYPkiWTYPq0KoTCkTo8l4Mip2xOyjF1yzhoVZJ 295mXBtHJwSr6lb8/qnv7Ipx2A== X-Google-Smtp-Source: ABdhPJxssGRFtEfBg+qs3azsypjah1T2IIm3nCOdTDeyxCScEhd8CcnlYtS3APqaq+oljHqWGZ9SUg== X-Received: by 2002:adf:de84:: with SMTP id w4mr20285440wrl.64.1642434990194; Mon, 17 Jan 2022 07:56:30 -0800 (PST) Received: from localhost.localdomain (hst-221-60.medicom.bg. [84.238.221.60]) by smtp.gmail.com with ESMTPSA id i82sm15542900wma.23.2022.01.17.07.56.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jan 2022 07:56:29 -0800 (PST) From: Stanimir Varbanov To: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org Cc: hverkuil-cisco@xs4all.nl, Stanimir Varbanov Subject: [PATCH v3 4/6] venus: hfi_platform: Correct supported compressed format Date: Mon, 17 Jan 2022 17:55:57 +0200 Message-Id: <20220117155559.234026-5-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220117155559.234026-1-stanimir.varbanov@linaro.org> References: <20220117155559.234026-1-stanimir.varbanov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org In multistream mode HFI supports TP10_UBWC on output2. Correct this in supported formats capabilities list. Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/hfi_platform_v4.c | 4 ++-- drivers/media/platform/qcom/venus/hfi_platform_v6.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/qcom/venus/hfi_platform_v4.c b/drivers/media/platform/qcom/venus/hfi_platform_v4.c index 3f7f5277a50e..e3f0a90a567b 100644 --- a/drivers/media/platform/qcom/venus/hfi_platform_v4.c +++ b/drivers/media/platform/qcom/venus/hfi_platform_v4.c @@ -55,7 +55,7 @@ static const struct hfi_plat_caps caps[] = { .fmts[3] = {HFI_BUFFER_OUTPUT2, HFI_COLOR_FORMAT_NV12}, .fmts[4] = {HFI_BUFFER_OUTPUT2, HFI_COLOR_FORMAT_NV21}, .fmts[5] = {HFI_BUFFER_OUTPUT2, HFI_COLOR_FORMAT_P010}, - .fmts[6] = {HFI_BUFFER_OUTPUT2, HFI_COLOR_FORMAT_YUV420_TP10}, + .fmts[6] = {HFI_BUFFER_OUTPUT2, HFI_COLOR_FORMAT_YUV420_TP10_UBWC}, .num_fmts = 7, }, { .codec = HFI_VIDEO_CODEC_VP8, @@ -106,7 +106,7 @@ static const struct hfi_plat_caps caps[] = { .fmts[3] = {HFI_BUFFER_OUTPUT2, HFI_COLOR_FORMAT_NV12}, .fmts[4] = {HFI_BUFFER_OUTPUT2, HFI_COLOR_FORMAT_NV21}, .fmts[5] = {HFI_BUFFER_OUTPUT2, HFI_COLOR_FORMAT_P010}, - .fmts[6] = {HFI_BUFFER_OUTPUT2, HFI_COLOR_FORMAT_YUV420_TP10}, + .fmts[6] = {HFI_BUFFER_OUTPUT2, HFI_COLOR_FORMAT_YUV420_TP10_UBWC}, .num_fmts = 7, }, { .codec = HFI_VIDEO_CODEC_MPEG2, diff --git a/drivers/media/platform/qcom/venus/hfi_platform_v6.c b/drivers/media/platform/qcom/venus/hfi_platform_v6.c index c10618e44f5d..4e8af645f8b9 100644 --- a/drivers/media/platform/qcom/venus/hfi_platform_v6.c +++ b/drivers/media/platform/qcom/venus/hfi_platform_v6.c @@ -55,7 +55,7 @@ static const struct hfi_plat_caps caps[] = { .fmts[3] = {HFI_BUFFER_OUTPUT2, HFI_COLOR_FORMAT_NV12}, .fmts[4] = {HFI_BUFFER_OUTPUT2, HFI_COLOR_FORMAT_NV21}, .fmts[5] = {HFI_BUFFER_OUTPUT2, HFI_COLOR_FORMAT_P010}, - .fmts[6] = {HFI_BUFFER_OUTPUT2, HFI_COLOR_FORMAT_YUV420_TP10}, + .fmts[6] = {HFI_BUFFER_OUTPUT2, HFI_COLOR_FORMAT_YUV420_TP10_UBWC}, .num_fmts = 7, }, { .codec = HFI_VIDEO_CODEC_VP8, @@ -106,7 +106,7 @@ static const struct hfi_plat_caps caps[] = { .fmts[3] = {HFI_BUFFER_OUTPUT2, HFI_COLOR_FORMAT_NV12}, .fmts[4] = {HFI_BUFFER_OUTPUT2, HFI_COLOR_FORMAT_NV21}, .fmts[5] = {HFI_BUFFER_OUTPUT2, HFI_COLOR_FORMAT_P010}, - .fmts[6] = {HFI_BUFFER_OUTPUT2, HFI_COLOR_FORMAT_YUV420_TP10}, + .fmts[6] = {HFI_BUFFER_OUTPUT2, HFI_COLOR_FORMAT_YUV420_TP10_UBWC}, .num_fmts = 7, }, { .codec = HFI_VIDEO_CODEC_MPEG2, From patchwork Mon Jan 17 15:55:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 532937 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A3BB1C43217 for ; Mon, 17 Jan 2022 15:56:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240605AbiAQP4e (ORCPT ); Mon, 17 Jan 2022 10:56:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240723AbiAQP4d (ORCPT ); Mon, 17 Jan 2022 10:56:33 -0500 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B313C061749 for ; Mon, 17 Jan 2022 07:56:32 -0800 (PST) Received: by mail-wm1-x329.google.com with SMTP id o7-20020a05600c510700b00347e10f66d1so207481wms.0 for ; Mon, 17 Jan 2022 07:56:32 -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=rvqvbFyOWR+3Qbb+TyNxDJR2+Ud4ue5zSaWeMig95K0=; b=BBtxp+pFpSM0neI/2Z1rX825zs5Up8KTErFQcKENOjeYS4tOucfqiafDxafovFP7Ci JDV6F5Zngga7EZ8fn0uPM9RpCb0c8I7g0923iT2tsWXzrsn2Y8sOTFUHacc5IZUfa1Fb 1iYFyjJSvjcv2Z+90hTkK0d15++AlUSm/5EPTe4IrZBQTijGZWryFd4FUIwGqBCHEA2W ynPZ1RLfjKkF32T0Lv6/yQ6yn7X7dT4gp8T/3mIH4MNC1P7PepRjR+8rsWSc0/vY/tC0 /JabFPPPwFlxGCBkI1QccLVt1BeozOVNWsTsOJ2uQNRhwvc0cBH7hHg/DDMNbAE+AGo9 TRHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rvqvbFyOWR+3Qbb+TyNxDJR2+Ud4ue5zSaWeMig95K0=; b=O8EKaousOg/ubiltPnXdJbDvtfdrBfA+YuKKTacRXOBjxX8DpPHMwd85fyadt8j+3x WQbShkFMgnSvs7VwZswIT825th2Iak1emSttNKkrE6mUIGtUufQ9lec3BodkcYbKfTYy dQQtonkWU32C/A7KqBhvBo41Ju4kWdwFLF0YzHE359ksgVPkSVPweLJ8GaLloXEzSu5D kcyFWdMnKUloUNGWBHR5VwGxG4CuLLqgRe1pWknLxXcCvh02W9fYnmwfRI4a8meXZeko SufgqimWP1INKJjxrwMkwr6w97/wzutGxiG9pkcQaD96FUC51afZbxiGnMsmeBYxb15R 5O6w== X-Gm-Message-State: AOAM531eBSFZrklm4VevBT9onb20mgSzmxYDLdem3oFxmCtVAWDwRznY eCVpiXdh6o5fJl6THRNB3xrTew== X-Google-Smtp-Source: ABdhPJx+fjM8V4va8nZ7VMuYU+q6SyNy+4blveDGFF38Rw0mM4rY26o1C5AAnxWNi86ndCHqWHMIBg== X-Received: by 2002:a1c:1d17:: with SMTP id d23mr20564746wmd.46.1642434991195; Mon, 17 Jan 2022 07:56:31 -0800 (PST) Received: from localhost.localdomain (hst-221-60.medicom.bg. [84.238.221.60]) by smtp.gmail.com with ESMTPSA id i82sm15542900wma.23.2022.01.17.07.56.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jan 2022 07:56:30 -0800 (PST) From: Stanimir Varbanov To: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org Cc: hverkuil-cisco@xs4all.nl, Stanimir Varbanov Subject: [PATCH v3 5/6] venus: Add a handling of QC10C compressed format Date: Mon, 17 Jan 2022 17:55:58 +0200 Message-Id: <20220117155559.234026-6-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220117155559.234026-1-stanimir.varbanov@linaro.org> References: <20220117155559.234026-1-stanimir.varbanov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org This adds QC10C compressed pixel format in the Venus driver, and make it possible to discover from v4l2 clients. Note: The QC10C format shouldn't be possible to discpver by the client if the decoded bitstream is not 10-bits. Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/helpers.c | 26 ++++----------------- drivers/media/platform/qcom/venus/vdec.c | 19 ++++++++++++--- 2 files changed, 20 insertions(+), 25 deletions(-) diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index adbfa4fbe139..69a9a9471a27 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -594,6 +594,8 @@ static u32 to_hfi_raw_fmt(u32 v4l2_fmt) return HFI_COLOR_FORMAT_NV21; case V4L2_PIX_FMT_QC08C: return HFI_COLOR_FORMAT_NV12_UBWC; + case V4L2_PIX_FMT_QC10C: + return HFI_COLOR_FORMAT_YUV420_TP10_UBWC; default: break; } @@ -1176,7 +1178,8 @@ int venus_helper_set_format_constraints(struct venus_inst *inst) if (!IS_V6(inst->core)) return 0; - if (inst->opb_fmt == HFI_COLOR_FORMAT_NV12_UBWC) + if (inst->opb_fmt == HFI_COLOR_FORMAT_NV12_UBWC || + inst->opb_fmt == HFI_COLOR_FORMAT_YUV420_TP10_UBWC) return 0; pconstraint.buffer_type = HFI_BUFFER_OUTPUT2; @@ -1747,27 +1750,6 @@ int venus_helper_get_out_fmts(struct venus_inst *inst, u32 v4l2_fmt, if (!caps) return -EINVAL; - if (inst->bit_depth == VIDC_BITDEPTH_10 && - inst->session_type == VIDC_SESSION_TYPE_DEC) { - found_ubwc = - find_fmt_from_caps(caps, HFI_BUFFER_OUTPUT, - HFI_COLOR_FORMAT_YUV420_TP10_UBWC); - found = find_fmt_from_caps(caps, HFI_BUFFER_OUTPUT2, - HFI_COLOR_FORMAT_NV12); - if (found_ubwc && found) { - /* - * Hard-code DPB buffers to be 10bit UBWC and decoder - * output buffers in 8bit NV12 until V4L2 is able to - * expose compressed/tiled formats to applications. - */ - *out_fmt = HFI_COLOR_FORMAT_YUV420_TP10_UBWC; - *out2_fmt = HFI_COLOR_FORMAT_NV12; - return 0; - } - - return -EINVAL; - } - if (ubwc) { ubwc_fmt = fmt | HFI_COLOR_FORMAT_UBWC_BASE; found_ubwc = find_fmt_from_caps(caps, HFI_BUFFER_OUTPUT, diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index eb02e45a512b..c8261c6cb0fb 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -35,6 +35,10 @@ static const struct venus_format vdec_formats[] = { .num_planes = 1, .type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, }, { + .pixfmt = V4L2_PIX_FMT_QC10C, + .num_planes = 1, + .type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, + },{ .pixfmt = V4L2_PIX_FMT_NV12, .num_planes = 1, .type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, @@ -114,6 +118,10 @@ find_format(struct venus_inst *inst, u32 pixfmt, u32 type) !venus_helper_check_format(inst, fmt[i].pixfmt)) return NULL; + if (V4L2_TYPE_IS_CAPTURE(type) && fmt[i].pixfmt == V4L2_PIX_FMT_QC10C && + !(inst->bit_depth == VIDC_BITDEPTH_10)) + return NULL; + return &fmt[i]; } @@ -133,11 +141,16 @@ find_format_by_index(struct venus_inst *inst, unsigned int index, u32 type) if (fmt[i].type != type) continue; - if (V4L2_TYPE_IS_OUTPUT(type)) + if (V4L2_TYPE_IS_OUTPUT(type)) { valid = venus_helper_check_codec(inst, fmt[i].pixfmt); - else if (V4L2_TYPE_IS_CAPTURE(type)) + } else if (V4L2_TYPE_IS_CAPTURE(type)) { valid = venus_helper_check_format(inst, fmt[i].pixfmt); + if (fmt[i].pixfmt == V4L2_PIX_FMT_QC10C && + !(inst->bit_depth == VIDC_BITDEPTH_10)) + valid = false; + } + if (k == index && valid) break; if (valid) @@ -1537,7 +1550,7 @@ static const struct hfi_inst_ops vdec_hfi_ops = { static void vdec_inst_init(struct venus_inst *inst) { inst->hfi_codec = HFI_VIDEO_CODEC_H264; - inst->fmt_out = &vdec_formats[7]; + inst->fmt_out = &vdec_formats[8]; inst->fmt_cap = &vdec_formats[0]; inst->width = frame_width_min(inst); inst->height = ALIGN(frame_height_min(inst), 32); From patchwork Mon Jan 17 15:55:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 532677 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CC815C433F5 for ; Mon, 17 Jan 2022 15:56:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240723AbiAQP4g (ORCPT ); Mon, 17 Jan 2022 10:56:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240725AbiAQP4d (ORCPT ); Mon, 17 Jan 2022 10:56:33 -0500 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69B22C06173E for ; Mon, 17 Jan 2022 07:56:33 -0800 (PST) Received: by mail-wm1-x333.google.com with SMTP id s6-20020a7bc386000000b0034a89445406so559028wmj.2 for ; Mon, 17 Jan 2022 07:56:33 -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=bgKGUZV9Ow5lTkYXyL6TgBgt5kr++QVKt0rnOqG3iUs=; b=hPKEO6RbEwtanUyhH29rvXKo7a1lDWirpsEPcwqroYORwk+SWdfHWYOXwGMT8nZI6y 1vVWcA91VsvtCa37CzG6TguLIZEU1BCUS9vbcN1YBZ60OgrWdL67IDUi9aoQH63yK3a4 FX+cYYf3/dryh3+4w8aHRaXMiklOxdeu/wF8cw1FjWUiJtk/dy4jajBQp9F/wvMV3DGj M7K5H/o/nQLx3B3Kqb6dEKDvDdanuvbwLm+x0vvxU+FLZ9nRQiW+IzGRQFPZZ0m1FhJC hq/nD44am+dUSAAc4k+POFiojdxs9Wgkr5V1AxF1HrQzVebKwZa9MadF+6aatbKZVC8v qG2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bgKGUZV9Ow5lTkYXyL6TgBgt5kr++QVKt0rnOqG3iUs=; b=XJAKU27s3RhKclMROaBF2ZSg4eva6c8a6sLMedWzwfQVIBtCzFWpGVlteFDHhRzENp efCxZXDel/l6LAIYsAQRpgy7mcz9y4DLmya8ik9EfF5ASW4GS+XtBraqScjPPldXXWab d8RlfSVd/GNoe3fn8FMrZyjxMtLv7IuRnH53HqerbdYCyCAq1jGUZDO8zOLdMDw4jmzG aCCbxVV8Qry1Rz1x5JowHY5gKyC9VSsGVwnGF+J8y+2rRnAF+iG1CkuOtI7y8/n1cNYa X9TzAnOCtSBP8E6PIjiGWMY1s9aFe4/hHQ6WUwiqq8is5VUdsdBXAYjdPPtldZVfCQsm E+pg== X-Gm-Message-State: AOAM530rGsg8xFaHMkAKEI3OFzlrSqrjI+HtNTTOF35KCvp+UdRrkWeQ 9XqZRl2FLeOjH9PT4Bu9MDltHA== X-Google-Smtp-Source: ABdhPJzr/7XZi6aFKSP/M/VHidCWixLwsc5ZmN0nt/bU2gTkObXMHon4UFpIO4YvoQL8GzsP2aNqSQ== X-Received: by 2002:a5d:4bd2:: with SMTP id l18mr19767924wrt.445.1642434992091; Mon, 17 Jan 2022 07:56:32 -0800 (PST) Received: from localhost.localdomain (hst-221-60.medicom.bg. [84.238.221.60]) by smtp.gmail.com with ESMTPSA id i82sm15542900wma.23.2022.01.17.07.56.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jan 2022 07:56:31 -0800 (PST) From: Stanimir Varbanov To: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org Cc: hverkuil-cisco@xs4all.nl, Stanimir Varbanov Subject: [PATCH v3 6/6] venus: vdec: Use output resolution on reconfigure Date: Mon, 17 Jan 2022 17:55:59 +0200 Message-Id: <20220117155559.234026-7-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220117155559.234026-1-stanimir.varbanov@linaro.org> References: <20220117155559.234026-1-stanimir.varbanov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org When recalculate output buffer size we have to take into account the output resolution from the firmware received during event change notification. Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/vdec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index c8261c6cb0fb..76716ceb3e18 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -701,8 +701,8 @@ static int vdec_output_conf(struct venus_inst *inst) struct venus_core *core = inst->core; struct hfi_enable en = { .enable = 1 }; struct hfi_buffer_requirements bufreq; - u32 width = inst->out_width; - u32 height = inst->out_height; + u32 width = inst->width; + u32 height = inst->height; u32 out_fmt, out2_fmt; bool ubwc = false; u32 ptype;