From patchwork Thu Mar 3 15:06:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 547879 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 DAA4BC43217 for ; Thu, 3 Mar 2022 15:06:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234283AbiCCPHa (ORCPT ); Thu, 3 Mar 2022 10:07:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234271AbiCCPH3 (ORCPT ); Thu, 3 Mar 2022 10:07:29 -0500 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4A731903FB for ; Thu, 3 Mar 2022 07:06:43 -0800 (PST) Received: by mail-wr1-x42d.google.com with SMTP id ay10so8303547wrb.6 for ; Thu, 03 Mar 2022 07:06:43 -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=rQ54PimOa9JA0PjxA9klTjXL5mIT6EoCvMFNlDkpoz0=; b=EiqkcueE7gsmrKt7OzyIXsnSf9qqkyvZ000cMatAKsHOlcK04TysYrt9+L1DDm2K9J uAQNKatyln8o345a/9vZuweQKIJNRuqH/oz4N53/kWYYHPusgRueY8/SoD71zdB5fTG3 554Zkt9aPuAle+EdY64Bv4Z3GgzZtbJYgpv19c5pdGdRajdZeMBOwUGgAhYtQkqJMcsc 0Cxrvias7rdf1c+l67rynX7TisjLnMerFwK9Z/0MlJ9H0pPdC7qkT/mWdxK8Jt61D7lR r7GcDzPSrPUZHyw6K+ga1CbI6+4GEpzNTObdAUXRK2zNgTz2Auum6rcsNPOXKFCCddoE D8VQ== 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=rQ54PimOa9JA0PjxA9klTjXL5mIT6EoCvMFNlDkpoz0=; b=TxAuh+GaVQuSseTVLcvS5XFv/qGmGCS/VBU3uI0fUCGINgSGEFexut/UgwvNIXTRNv Yr1zf6azPabJa66ksL5fGnM+ipDQz/Bz4cWuK3qxpN+CZoI1hS3Ym1ajWzg9my/6+WCV kkstrpEqtEAwkf4zhWJjnt/3HRRlkYk5OxzKLEuTbcHlmTvvenD/akyAtIUlFU9CqzSV 1k7tKMNTlKZSp8SbrB4LAKGaDigTgHKhrjWvdltNNYn+dKMXrvN7RtnaACegU3MO8g5B hnj0D0j8TnYeSqbD7dodpF1OlHdJTUgEc6HjypkFd8YI2rEkZdl56Gjfh2wzrvb3TO0j CRKQ== X-Gm-Message-State: AOAM533rk8zBGpN+aGhPbkgP5y2yOmYRzp/qJYMjurWOoIBtaHZSJ8Xo 7VCqOHNYKx5W9KjhIIzQV7p0/Q== X-Google-Smtp-Source: ABdhPJybx3yj8om8NebDZZaiHVbt388RYGiyXHwMMRg8WhzQotdbNH4Zh12X3DiwH1zR0c6TbZ42lw== X-Received: by 2002:a5d:4a45:0:b0:1f0:5e70:1088 with SMTP id v5-20020a5d4a45000000b001f05e701088mr2024924wrs.258.1646320002269; Thu, 03 Mar 2022 07:06:42 -0800 (PST) Received: from localhost.localdomain (hst-221-14.medicom.bg. [84.238.221.14]) by smtp.gmail.com with ESMTPSA id o16-20020a05600c511000b0038141b4a4edsm10757072wms.38.2022.03.03.07.06.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Mar 2022 07:06:41 -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, Nicolas Dufresne , Stanimir Varbanov Subject: [PATCH v4 1/6] v4l: Add Qualcomm custom compressed pixel formats Date: Thu, 3 Mar 2022 17:06:31 +0200 Message-Id: <20220303150636.577063-2-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220303150636.577063-1-stanimir.varbanov@linaro.org> References: <20220303150636.577063-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 Acked-by: Hans Verkuil --- .../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 642cb90f457c..b20ef7989ab8 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -1439,6 +1439,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 Thu Mar 3 15:06:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 548180 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 AADC1C433FE for ; Thu, 3 Mar 2022 15:06:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234063AbiCCPHb (ORCPT ); Thu, 3 Mar 2022 10:07:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234222AbiCCPHa (ORCPT ); Thu, 3 Mar 2022 10:07:30 -0500 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B798A190B43 for ; Thu, 3 Mar 2022 07:06:44 -0800 (PST) Received: by mail-wr1-x436.google.com with SMTP id bk29so8314223wrb.4 for ; Thu, 03 Mar 2022 07:06:44 -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=KmYcedTQoSyAqjz5oetiys3ZELl3vsdNtkFgjZlFb18=; b=ZDQ5LnWgv99ECsMqA2bZoVRRKKLc2/GI3k2R8y1d3BIId9HfJEx9R3/obf6DnMfvJp F6wAUJI8lufeIPgzkmiCtums00UVs6EQmNghSdNNfnM/ChXXYMRcGW/2F/EyQmeIulxa PlPBOG+6pY2MWdTKdF1dxEW1JOREA0MGiLLmFgZKTOfqDnjmwhIqjANqJyMQEN2uxC1z tWvTxL3rhWddFD+4+FIRlx1TQcop7eo2HH7A5b9wBQZEEW9FxWneJ9XAtkMnEtGOM5af xToK6jfwX5zgM1TF7sY4mBUmCG+WuMt7e99p14fymzcus/JnMFIzMLrMRDX89YCqU3nP py8Q== 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=KmYcedTQoSyAqjz5oetiys3ZELl3vsdNtkFgjZlFb18=; b=wy6zRXi4dfQhEx7kD3nUIVVne7tGjjApYly9gTdlzWzhPdr/6bLKCBMEFc1bzHfogD unN/eIoufuVRyIGh+lszGhzGfCyqCI2mR1d4EgkB1MkbuOXxtEfvLiN6+NzZyvNA0pyI dRBege/TgTL6CUPf3WWdNa8cWyT1gOWTLADu0KBfFtTcNtFprH1MNSSQ4Ho9HcKmBniM AttIyeK2klKDehpniBtWrJUHaDzCkhHmo63WVOS15rngnZQALSri+ltZ3UAtW0wGYiNE RevMK4yn/PpUhtYUFAYzINHXNm0pDJo13gowv0oa8ZI+Rd0Sx/HJS0WQMtMuLhOsC6dW +wzQ== X-Gm-Message-State: AOAM532OpZiOLssCqJpL3DCoCnywlfRC9XqZmT77MRacYzT6uDumMzSw 9AWzSu6bG+s9leIwC1Oybw3hCw== X-Google-Smtp-Source: ABdhPJy3AvLCQnaka630O6+QzMT92wO8uOcRIXkU98w9RvIajiEp6AN75CjyRTj55SJZjkvHOzW/Cw== X-Received: by 2002:a5d:64e9:0:b0:1f0:3580:98c9 with SMTP id g9-20020a5d64e9000000b001f0358098c9mr5792218wri.716.1646320003246; Thu, 03 Mar 2022 07:06:43 -0800 (PST) Received: from localhost.localdomain (hst-221-14.medicom.bg. [84.238.221.14]) by smtp.gmail.com with ESMTPSA id o16-20020a05600c511000b0038141b4a4edsm10757072wms.38.2022.03.03.07.06.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Mar 2022 07:06:42 -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, Nicolas Dufresne , Stanimir Varbanov Subject: [PATCH v4 2/6] venus: helpers: Add helper to check supported pixel formats Date: Thu, 3 Mar 2022 17:06:32 +0200 Message-Id: <20220303150636.577063-3-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220303150636.577063-1-stanimir.varbanov@linaro.org> References: <20220303150636.577063-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 0bca95d01650..52b198a194b3 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 Thu Mar 3 15:06:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 547878 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 1370EC4332F for ; Thu, 3 Mar 2022 15:06:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234298AbiCCPHc (ORCPT ); Thu, 3 Mar 2022 10:07:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234292AbiCCPHb (ORCPT ); Thu, 3 Mar 2022 10:07:31 -0500 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B623E1903F3 for ; Thu, 3 Mar 2022 07:06:45 -0800 (PST) Received: by mail-wr1-x431.google.com with SMTP id x15so8275616wru.13 for ; Thu, 03 Mar 2022 07:06:45 -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=ZDbc5Zu6HoRaLo+/k8LqLkoHIjXtL1mJtM5q0u7i6VE=; b=BxAxXeY1f1ADhiPhtuRlC/hwavrnHQcrnvdwNpsdzXhkg+L8/B2T6XnUehvOZMugPm CMULrUjdeAa0EIqUjxYyWRZLb5BOIrFtGmDCQTyZ3ctMxaq4yX+hq12kMIznq6KRGAei aPXq3G3a3pvGqbGyFzMe/6MrlkDY0eHrSOf3qlXnut8RBNnOX8Z0WLoXsqPcYTJmsmGc BSYFDmdoIMh6GYhEn7OB3r4KXjxKDPF2Sx9ay9SpgPjcQvc6rUkAz8mZT5OE++Kan6Ir OZEJ1dRgqNA8bK4XCtxKzrZggCAcKup65pfHwffjQ8y0jDrFKkxkzw7wRB+lcqEqP5B0 GuxQ== 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=ZDbc5Zu6HoRaLo+/k8LqLkoHIjXtL1mJtM5q0u7i6VE=; b=zGmx98jgub83hCsmalDtmB56XPmyvTMcBsTnmNwlwTmNyJJ/dbzTCELJRzd7+6DbWG CAc+lXH3iIs2nY0INdTcnqM4bBhhE0GXr4ZDny3mRLhqNeuIXYs3ti3Lev77dP5F35MK JJfVOmO7GfZAVPsjH1Qbnsj8Rps7TeIH149esx+0AzZA9l/jZIx81GyY1bc3X1Api5yb RQxsmOMxTVuBLAPg/PpUgswuo5ddHv9G1Io/IxzrJFuyx/m7f5GY/w8QQlvYMmpn/Twq VxPuQ1w0qfG2D8iWH5cwHeRnHj1BCBGIt3RO/jJLLtll1Jna2afx5EKnCEfA0a8hY+3c Ky+w== X-Gm-Message-State: AOAM533hXsBnY2EMkzoz1kWQWjdt6zQ2Vkv7Xy6XCQitmZe33hcr8M4W gXMdx1KWdmErnfQIrF8D+e3kvgpz0w+MzRQK X-Google-Smtp-Source: ABdhPJxBRKLqO16sjNcuPajVoBu0TZBU8lW7PmHbVGZM2P61uskvrbftLaDOs0G6+4sPQzZHYsi0Xw== X-Received: by 2002:adf:df0a:0:b0:1f0:2140:1b41 with SMTP id y10-20020adfdf0a000000b001f021401b41mr8357683wrl.94.1646320004260; Thu, 03 Mar 2022 07:06:44 -0800 (PST) Received: from localhost.localdomain (hst-221-14.medicom.bg. [84.238.221.14]) by smtp.gmail.com with ESMTPSA id o16-20020a05600c511000b0038141b4a4edsm10757072wms.38.2022.03.03.07.06.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Mar 2022 07:06:43 -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, Nicolas Dufresne , Stanimir Varbanov Subject: [PATCH v4 3/6] venus: Add a handling of QC08C compressed format Date: Thu, 3 Mar 2022 17:06:33 +0200 Message-Id: <20220303150636.577063-4-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220303150636.577063-1-stanimir.varbanov@linaro.org> References: <20220303150636.577063-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 52b198a194b3..7144747398b6 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 Thu Mar 3 15:06:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 548179 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 B0635C43217 for ; Thu, 3 Mar 2022 15:06:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234292AbiCCPHd (ORCPT ); Thu, 3 Mar 2022 10:07:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234222AbiCCPHc (ORCPT ); Thu, 3 Mar 2022 10:07:32 -0500 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA98F1903EF for ; Thu, 3 Mar 2022 07:06:46 -0800 (PST) Received: by mail-wm1-x32c.google.com with SMTP id l2-20020a7bc342000000b0037fa585de26so4059715wmj.1 for ; Thu, 03 Mar 2022 07:06:46 -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=o0pUsgTFfo0mMtoKAT6V2y6BbiJGS+D4eRwMFOQ3RVlyAN5pQgIOWsTGvLg6/NuKQi kbvz0eEqR0aDrvgCXts5123oTxoIu91hg5E8ZCEb5OiomSuIE9d+W8IMcDR6r2xf1Mz0 Yty5i/UOYoj+1yj7SD6xjoyzwRsCxrrHQVoZljv+Jcmt0VNw4WXjrmfG2kpj7gJJyDvX LJbzgi/F79jhBdDtpIkoOJiTr+l//Eu1PpySZnDzENY1rLpztIf2azft/NmplAY3Pn7i K0kW6IzaFpZQDiunYOohxvHnuIe+ANIHvdYzhT4nq2UEe2hMYXlBiFqbtK392P/9SEvc 3eHA== 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=agPa5LvAmLWS3aLaStbJpYx+uqYs5VNzIOCZybALbQvVxQptVgTNU6YXglrR2Vpx3S 6e6Cwiq/bXuUlbFKkcvj7x8ArPjbjWVtnzeHXAtxc54ypTtVO+2yB3gYkNGvYR7/vVkf lBU3CYj1q+ohWgQh7zi0Z8vnr+3b5SmOUyOj64zaUGMsvOeRXqEBIplzTTMy0OLTGW3j F1YUjuVeOSiGWrOn+2oPdnXJ0l+UsklIiRAn/ZfYBr2wpeRuJHpCHO4TsMZswYG4cAFo /k3x0ndEg9KDgwk7J0BsEiYWjKCZJsnqFM714sWhmFrlnlUrDG+U3Fr8J1h0YgsFR0lr 9ssw== X-Gm-Message-State: AOAM530GW8Tz3ag78dFHPoKu9ppRETSkBNZOQh9w7oIu7lRcHQXFTLgx l27WuRoZs5tbtmE1JhkBx2CkCg== X-Google-Smtp-Source: ABdhPJxJh+wjb/RhDLyVmVFa0rNu+SxFuWa1mMy7fQFAVaLREDjlrqbwyIo4DN/yfR6L1iyH6bpRnA== X-Received: by 2002:a05:600c:1552:b0:381:c7ac:84b1 with SMTP id f18-20020a05600c155200b00381c7ac84b1mr3956478wmg.77.1646320005316; Thu, 03 Mar 2022 07:06:45 -0800 (PST) Received: from localhost.localdomain (hst-221-14.medicom.bg. [84.238.221.14]) by smtp.gmail.com with ESMTPSA id o16-20020a05600c511000b0038141b4a4edsm10757072wms.38.2022.03.03.07.06.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Mar 2022 07:06:44 -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, Nicolas Dufresne , Stanimir Varbanov Subject: [PATCH v4 4/6] venus: hfi_platform: Correct supported compressed format Date: Thu, 3 Mar 2022 17:06:34 +0200 Message-Id: <20220303150636.577063-5-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220303150636.577063-1-stanimir.varbanov@linaro.org> References: <20220303150636.577063-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 Thu Mar 3 15:06:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 548178 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 29B79C43219 for ; Thu, 3 Mar 2022 15:06:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234321AbiCCPHl (ORCPT ); Thu, 3 Mar 2022 10:07:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234259AbiCCPHe (ORCPT ); Thu, 3 Mar 2022 10:07:34 -0500 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E05721903EF for ; Thu, 3 Mar 2022 07:06:47 -0800 (PST) Received: by mail-wm1-x336.google.com with SMTP id c192so3318094wma.4 for ; Thu, 03 Mar 2022 07:06:47 -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=RaGrefX44rEm0wu9mMJuIgGrRaikvNDSwTTA6I5onmc=; b=iQLNGn0tWI4UbbLemKwJopKnPXIK6nheNzTzHrT8vkbpBGYU/hUG56HnYeriqvXwBn ukQV4uk2XqPg1IYY2gQ7dA7zCxVQA9VAefi89ro1B74a8yukKgHhylzRLQKi4rcVh6UF NI7bvak1fBKABNQHpdM+MqV1a3R0qX/5xamzlcsDctZNb6jr+eOuwxgjOMdkwfwM+iRg otvzcIZJ05YXu31osASP0SQH4UAI5x4W7rmj74EOPCvO5edl6eofBwlPdZ4J7DyWdZ7t sIxsnRYXia+pZlL6teoLO4fjKrIP1P7cG+q/Qv/Zac7Tnd+79P1RnByWsBuSUnoodgW2 hvPQ== 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=RaGrefX44rEm0wu9mMJuIgGrRaikvNDSwTTA6I5onmc=; b=m9oNy44gSzkzFBMW/aCas3Yd+f2ngLW4bQoPApD35wfnUqM243uNK9Cn/mzSlixn1H xbvsSG2K4LSx9iefOkPo4jwovbAXLdVMEncm4vSxm29ILFYWAx33euhantxiOKkeyAUQ WVmCGOpZC83UbmSebU9TOvZxTWw47t25ybZux4ubPvptNGx8IZ+OzNve2H6p6zTlIcqA QptQ3MCYiQGRExhEE523BC5bpdsc2jHZqHYM4k+w/v6N93HX4sKzz8kRR2vG9V00c2Kq +sDBg4+BAKffKsO1lTl1kTJttkLjklKU9+hsR4X4gOVp5EDwXv6CqPBydBSL6hJiRN/b /UHw== X-Gm-Message-State: AOAM533+8NPP8Cip9p5QzHzmN+YXixl7fCiGmva7ylC21SQLizz899dS L9iLHo/wSjZeddIZdljzeKtWIQ== X-Google-Smtp-Source: ABdhPJyeVXsvKvr0st8E02wJKuejqcviu/T7Pj+MD4OwIM0plwJp9ylK47fRvkVMZ/n3NArQdUWyfg== X-Received: by 2002:a05:600c:35c4:b0:381:782e:9645 with SMTP id r4-20020a05600c35c400b00381782e9645mr4130136wmq.63.1646320006414; Thu, 03 Mar 2022 07:06:46 -0800 (PST) Received: from localhost.localdomain (hst-221-14.medicom.bg. [84.238.221.14]) by smtp.gmail.com with ESMTPSA id o16-20020a05600c511000b0038141b4a4edsm10757072wms.38.2022.03.03.07.06.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Mar 2022 07:06:45 -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, Nicolas Dufresne , Stanimir Varbanov Subject: [PATCH v4 5/6] venus: Add a handling of QC10C compressed format Date: Thu, 3 Mar 2022 17:06:35 +0200 Message-Id: <20220303150636.577063-6-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220303150636.577063-1-stanimir.varbanov@linaro.org> References: <20220303150636.577063-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 will be enumerable via VIDIOC_ENUM_FMT when the bitstream is 10-bits and the headers are parsed. 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 7144747398b6..f5a938455d7c 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 Thu Mar 3 15:06:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 547877 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 037CBC433F5 for ; Thu, 3 Mar 2022 15:06:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234306AbiCCPHk (ORCPT ); Thu, 3 Mar 2022 10:07:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234318AbiCCPHi (ORCPT ); Thu, 3 Mar 2022 10:07:38 -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 155B2190B42 for ; Thu, 3 Mar 2022 07:06:48 -0800 (PST) Received: by mail-wm1-x332.google.com with SMTP id 7-20020a05600c228700b00385fd860f49so2582633wmf.0 for ; Thu, 03 Mar 2022 07:06:48 -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=TWIVaeFLPw3aJf4W+SVAkQayYuhXJUaCDckHLmfl2sqjIvYVf7A5d2VIxXHhUEbctG /0CAr73TCB/72Sal9mTRhAM9U9G8N1SnJYOPhYZBW0WFoKlNirW+FCHEHz5490eWcJK/ fvms0rlfWgRfM/E+E2ImynSk5ar/CoKEqmCzqm68l0T64lMASIOCEDDEbC33Ju9BCn99 3ouJryNh373bn7HuUoSXXp25UZUl7HEocdQhGvcfbqUrMH1BZQr/7eG5R6jalEeIsyPl ZOFk75SPzWG1hf/PJ2fu63xfirLVFvv/hPBxLvIRpOdKBEHX0FvPRY2/5xuW5t5/VeBX FZIA== 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=EJ7rtbBkxHeIrHO//8L4Zk9AGGD71+V8JEo8SznCh/okDnuPU8Emljw5D1B5SL4WI1 c3eoM26TxxvFRsZzZtvSZr1AeDJ1sLDwRxRfZ6C0Nac3q1Rk0wgoeKp++9U1o+9Dg0Ao OwUJOqOMYBArNvBxxpQRSiUggEhf6MPDJ6Hz8KVrQLcZaH9t+cdappOOUmyImFpglsL8 U2Gmnny8XBDTP4FfUyK7jt/gWnR77j+0FgEgKas0c1YGsBOP9um7CnDRiUnGt8eq0qHa d5sXhYTxon7NFVZ6C5c+qVWmA30i7kjYoBs9g8NCDBw7thGJvBlXaX8xQxxxPbBQY6Fa TwNA== X-Gm-Message-State: AOAM530qQPpwSrjnti8Af/2cOYisf7EcmrEWP6j2VuGpwgTQ/fKDndbE CHePvW/UzztLreBNnBeVuNpK6Q== X-Google-Smtp-Source: ABdhPJy6646N9PvrrPbXQM8ipQCvbMf0hssT95yZgxvuSuRwDiiqUx2o6vNW51KmBI2R1A0OXZFDDQ== X-Received: by 2002:a1c:f70a:0:b0:37c:533d:d296 with SMTP id v10-20020a1cf70a000000b0037c533dd296mr4022986wmh.147.1646320007507; Thu, 03 Mar 2022 07:06:47 -0800 (PST) Received: from localhost.localdomain (hst-221-14.medicom.bg. [84.238.221.14]) by smtp.gmail.com with ESMTPSA id o16-20020a05600c511000b0038141b4a4edsm10757072wms.38.2022.03.03.07.06.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Mar 2022 07:06:47 -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, Nicolas Dufresne , Stanimir Varbanov Subject: [PATCH v4 6/6] venus: vdec: Use output resolution on reconfigure Date: Thu, 3 Mar 2022 17:06:36 +0200 Message-Id: <20220303150636.577063-7-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220303150636.577063-1-stanimir.varbanov@linaro.org> References: <20220303150636.577063-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;