From patchwork Thu Apr 29 10:58:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 429220 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp1461983jao; Thu, 29 Apr 2021 03:58:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1hH1CPaDuDNJ2tvLiFJoTow+AcGuZnXIS9m9JQryrgD2TpuBflY/Tb2VQ0jL16wlXzZh0 X-Received: by 2002:aa7:d9cf:: with SMTP id v15mr17352674eds.358.1619693914974; Thu, 29 Apr 2021 03:58:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619693914; cv=none; d=google.com; s=arc-20160816; b=Y/OksyfT00uH1/Ugug4Wt1C4f68xJbuJj7kEclNGSdijtcaeT/39Rje2tnZngbOU4f DlzkD/VY1F2yCF6I1f0pCRPXJvweG/6L/f9KJ3rPAKUBasPIbOaIpFsgYcmAWV7lqCiv CLOUUs52Ld2OPzriIb/xKr5r+zDva8u+H+JeZ/Ma3K05zR+e0O74ZAgfc+u1J0Sll10a zwpTz+TL1JV91xJyKQe/GO8zrGpxfpUWHNsod2h2PW9HekldMy+IC9j/YRmzkakwP9jk 5Bgygw+KHgNA9VsPi8DqTJ2+Ji4aP7m85faXTwhZGgjYZw/3WgkdFRtCkvgh4pssjqJj YWsA== 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=nBXsu4hoUYVEN5DNp1Kv5q5f0FvqemBCsQCdEh5XBkc=; b=v2hxhqKWb8dztIk16fBqoTrVOR5QbvMj9RzLL/mLfShjnfgf0t6KFPmuglTWNqXRaN YZI47RRALFfk0BPGK4DqYqh90VfWnP56y348tQMVL28eXSByAo41JBSTmLuSWnM1xC5Q MHrwpcI8d3c93BWeC5cJ+anWTaBhzpCN9IEZSUsdpeWx+qM9BgKz0DFlf2yUiOOxkj+/ HkP771bgxu+UbtFcEA4Yuez13wXaxxDpBNj22d6w1N2mFSCK93E+sIph0yEGYbzeqjSq 6EVsHhEcqOChxxDfCdOaJE4E47QWhOpBgM1Ni3ROKtWHYqgtR/jRNYu4S5XAfH8yak2k IWeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ySv6XmAm; 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 c9si2712416edv.186.2021.04.29.03.58.34; Thu, 29 Apr 2021 03:58:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ySv6XmAm; 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 S240517AbhD2K7M (ORCPT + 17 others); Thu, 29 Apr 2021 06:59:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232108AbhD2K7J (ORCPT ); Thu, 29 Apr 2021 06:59:09 -0400 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 9F3F2C06138C for ; Thu, 29 Apr 2021 03:58:22 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id n2so13263135wrm.0 for ; Thu, 29 Apr 2021 03:58:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nBXsu4hoUYVEN5DNp1Kv5q5f0FvqemBCsQCdEh5XBkc=; b=ySv6XmAm+iC7pw2L7aHI8nQI+7E7BOcbBzQ6MllFX9piRQF3WBxMNgc91BcQzStqOi OBaZ3syju5vPQmmoH6Of9wZOmgB2tpPW48/DkjKv5ZAZf+srv6/EgcRDgyhEKpqM/ymo GR6GByYgtM7wvpM9c3R0WmX+H6BPJ/1icbtwD/ZTv9u5Ajy8V0BjGhPjI/96b5fKRQZd x/UXUjevLcL5qkWeOYtKlk3cF9qRuQTVBQ1l9Rmrt6+b2B0K4kUCw3rf/JaXLU+it4pe KVAbg7gFpbFljqSc2ulL0ZZSZuFbaF0SK0TV3+y8W+z7waamShaXc9VL5r/NVzsx0nMB Wewg== 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=nBXsu4hoUYVEN5DNp1Kv5q5f0FvqemBCsQCdEh5XBkc=; b=OIhkHYeJ2r/3AV07DwqWP1FOkUXAQDaQN4+7csvmov1VuMyhSsQ8op1X4XmKy50cjO t3XDy9srvDUv8yS/ZGIgOVbc4IFlPk9i5fyivdAs6/huzRur8uP5gefBId2U4UfRlLE2 LI0qjArNVp1qmjwBx6KjpKrTqy3Ay2dXJihtM9962kvwK0YSG6voV4za99QqqucQ6tZz SSc5WnPvg+HXidLs8/agfVrIG3SLVYTKi0iiS+oXEDmWFs8AVmgZbG+/5zOG0/Eng5ik NGu+uPqxBc+kEmGE8jWQJlwrc4xTrYWCo7rHqyL+LpJdHcSiH/fQipHr9u5fn/Dnyecn ckjQ== X-Gm-Message-State: AOAM533GPMPe+Ih0jPE0XWtrlue+O1ghr/4w75ruVNK0sNr6U8grU6l6 kT9AD2E8JZPBDc87EPkRDGvtUQ== X-Received: by 2002:a5d:43c1:: with SMTP id v1mr24404406wrr.248.1619693901308; Thu, 29 Apr 2021 03:58:21 -0700 (PDT) Received: from localhost.localdomain (hst-221-29.medicom.bg. [84.238.221.29]) by smtp.gmail.com with ESMTPSA id a9sm3372903wmj.1.2021.04.29.03.58.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Apr 2021 03:58:21 -0700 (PDT) From: Stanimir Varbanov To: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-api@vger.kernel.org Cc: Hans Verkuil , Mauro Carvalho Chehab , Stanimir Varbanov Subject: [PATCH 1/3] v4l: Add Qualcomm custom compressed pixel formats Date: Thu, 29 Apr 2021 13:58:13 +0300 Message-Id: <20210429105815.2790770-2-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210429105815.2790770-1-stanimir.varbanov@linaro.org> References: <20210429105815.2790770-1-stanimir.varbanov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Here we add custom Qualcomm raw compressed pixel formats. They are used in Qualcomm SoCs to optimaize the interconnect bandwidth. Signed-off-by: Stanimir Varbanov --- .../userspace-api/media/v4l/pixfmt-reserved.rst | 12 ++++++++++++ drivers/media/v4l2-core/v4l2-ioctl.c | 2 ++ include/uapi/linux/videodev2.h | 2 ++ 3 files changed, 16 insertions(+) -- 2.25.1 diff --git a/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst b/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst index 0b879c0da713..30b9cef4cbf0 100644 --- a/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst +++ b/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst @@ -260,6 +260,18 @@ please make a proposal on the linux-media mailing list. of tiles, resulting in 32-aligned resolutions for the luminance plane and 16-aligned resolutions for the chrominance plane (with 2x2 subsampling). + * .. _V4L2-PIX-FMT-QC8C: + + - ``V4L2_PIX_FMT_QC8C`` + - 'QC8C' + - Compressed Macro-tile 8Bit YUV420 format used by Qualcomm platforms. + The compression is lossless. It contains four planes. + * .. _V4L2-PIX-FMT-QC10C: + + - ``V4L2_PIX_FMT_QC10C`` + - 'QC10C' + - Compressed Macro-tile 10Bit YUV420 format used by Qualcomm platforms. + The compression is lossless. It contains four planes. .. raw:: latex diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c index 6a5d1c6d11d6..33ee12b97aa0 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -1455,6 +1455,8 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt) 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_SUNXI_TILED_NV12: descr = "Sunxi Tiled NV12 Format"; break; + case V4L2_PIX_FMT_QC8C: descr = "QCOM Compressed 8bit Format"; break; + case V4L2_PIX_FMT_QC10C: descr = "QCOM Compressed 10bit Format"; break; default: if (fmt->description[0]) return; diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 311a01cc5775..c57628a16cf4 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -737,6 +737,8 @@ struct v4l2_pix_format { #define V4L2_PIX_FMT_SUNXI_TILED_NV12 v4l2_fourcc('S', 'T', '1', '2') /* Sunxi Tiled NV12 Format */ #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_QC8C v4l2_fourcc('Q', '0', '8', 'C') /* Qualcomm 8-bit compressed */ +#define V4L2_PIX_FMT_QC10C v4l2_fourcc('Q', '1', '0', 'C') /* Qualcomm 10-bit compresed */ /* 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 Apr 29 10:58:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 429221 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp1461996jao; Thu, 29 Apr 2021 03:58:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwElQOwZxazEpCTUvx1v3XCsIHMkt1tt8JKvvXrv47207VcUyjy33/dUnzg2CqWUob9VlAl X-Received: by 2002:a17:906:c1c9:: with SMTP id bw9mr34600425ejb.239.1619693916356; Thu, 29 Apr 2021 03:58:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619693916; cv=none; d=google.com; s=arc-20160816; b=DNMmstQMmdlWU64Xe8PD/F6f1DSccgjs5EAlsrWfh1njrUGcZnJLjrmjvEX1hDUS0a nRuqQkFtHmKkBPwFqBL05LSPLOkj2mqtqZSNXr+jbIPeAjFka2pse3KaG+pDUS5SW3I0 9zCqxThEjGWPNGz7hCoPD/d8aKYhGjg+LjYtUwTA0+LIq7LYMWJTlAC6VAUYmqtIPDNE kqkk3bVv2Hv3o3GIBwjWD98TCU9/hglySqx9AHyO/iDCrnFwsaMaIUMelHaJBmUQKSyG b9lGCfonmcnD9q9lO22GJzYMI5+JT0JVavWkOEaqIQxiZsxORG3aYjxIMhbnTuPAq9BD vX+g== 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=jYGJrgcD3VZ6SXpUQWlC7sPvB5W5iGe6cdJ7Wlftem4=; b=w62IYA3HSjQyGrMTxQhG3IHRzVuTu7bMprJoMWJSC689jOrKh9D7+bdSDs+KlSyS1T M0y0W+nJyRDIg4L/f01jD0Ln4MojFaTx2UAP43sWircSUqs/uycDzFTF1r7Hef9ix870 L4Z+HSiEmnP9Rw+m3uJsfmN1yLA+dV1RlAjiYsQ5YxiTM7aSFucpaBayA+cCsD+VvmrJ s2NjEjyn7G8Q+OQnmWw3I6AolRPZ28PAtl5lClWo5kdH0lR+Pb6KN22fmLqL+QYghd4f bcajlJmPxoToOf6rXTFrKMMAFVhp0Pnwrpny7+aZCZgQWbTxwoPyip2p0hCu1qoWt8q4 CsXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ADIoes40; 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 c9si2712416edv.186.2021.04.29.03.58.36; Thu, 29 Apr 2021 03:58:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ADIoes40; 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 S240561AbhD2K7N (ORCPT + 17 others); Thu, 29 Apr 2021 06:59:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240469AbhD2K7L (ORCPT ); Thu, 29 Apr 2021 06:59:11 -0400 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6AE18C061343 for ; Thu, 29 Apr 2021 03:58:23 -0700 (PDT) Received: by mail-wr1-x42e.google.com with SMTP id k14so16497964wrv.5 for ; Thu, 29 Apr 2021 03:58:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jYGJrgcD3VZ6SXpUQWlC7sPvB5W5iGe6cdJ7Wlftem4=; b=ADIoes40mv9HPIIbqdGFoDHMemrLKFIIoekd16bjNbrdN0jTPOABBHL6aVDrZtbFQu 7yk3Ot02f5nje4Dfdavqy/n6jXkmJhVsKKM6ODhMiL4XHbz18aF6X0PQo9i6ImbgrUyD OjgKTI+8ledcS6TazyTztiodS79qw9g4xLDhe69oI54YQ33KjU2eGgHAXnqiXBDxJDja lTDSTikmPZZFnJLmwdgeHTAuOzpg6iUEsfE5yipAg1HwUKST/Iud/WqweIL2UAP4Ih7C P2s0cC/MdYNPRPMR19Z782MZ2QXyr0NLZjHVfHlld6ZW9Vn3zqkRax4EK4gJaM0rJfOX 4uNg== 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=jYGJrgcD3VZ6SXpUQWlC7sPvB5W5iGe6cdJ7Wlftem4=; b=iNQ2QIxD/xP1Wwegms5HoG3fviqJ1UFl3X7c9vNv5psudXN/dKL6yFIr1/xrS6rugq Sv0ANLZqyiu3K7x+vCe9pXs3uB5aYLvjX+m/OzEIIK5+65NH2uPvz8+hKbwaFdiMmsoB gevvu9dmag8Vbta/wsH+RH6/dEukpH+GbwbF61VSZ5dKlPtTTYNJk8T/RYpP4+hZyX2E IjBJHY/NbGcNe4u8sa5QBClbxmXBFpKAGmrmJwl2+4hTJqv39WvlqDtEOLhs32J16gZP ndwiSQ5Ao2pAzG5SXEOJNkgJ9koMYOLxmZ4Gc1nulwTaFEgrIV3358Wb42lSmqmf4H61 ywqA== X-Gm-Message-State: AOAM530EsPEeEwgXf2C8VneoaGjRsAadwOIpK4X2LvtobPlS/OZKyVtn RG1pj4eRlO5VKEp9KioC3Jn49w== X-Received: by 2002:a05:6000:2c6:: with SMTP id o6mr164098wry.203.1619693902137; Thu, 29 Apr 2021 03:58:22 -0700 (PDT) Received: from localhost.localdomain (hst-221-29.medicom.bg. [84.238.221.29]) by smtp.gmail.com with ESMTPSA id a9sm3372903wmj.1.2021.04.29.03.58.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Apr 2021 03:58:21 -0700 (PDT) From: Stanimir Varbanov To: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-api@vger.kernel.org Cc: Hans Verkuil , Mauro Carvalho Chehab , Stanimir Varbanov Subject: [PATCH 2/3] venus: Add a handling of QC8C compressed format Date: Thu, 29 Apr 2021 13:58:14 +0300 Message-Id: <20210429105815.2790770-3-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210429105815.2790770-1-stanimir.varbanov@linaro.org> References: <20210429105815.2790770-1-stanimir.varbanov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org This adds QC8C compressed pixel format in the Venus driver, and make it enumeratable from v4l2 clients. Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/helpers.c | 2 ++ drivers/media/platform/qcom/venus/vdec.c | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) -- 2.25.1 diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index 9b8ff76e3c43..3a0b07d237a5 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -561,6 +561,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_QC8C: + 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 5e5584fc21e9..d4cc51fc019c 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_QC8C, + .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, @@ -696,7 +700,13 @@ static int vdec_output_conf(struct venus_inst *inst) inst->output2_buf_size = venus_helper_get_framesz_raw(out2_fmt, width, height); - if (is_ubwc_fmt(out_fmt)) { + if (is_ubwc_fmt(out_fmt) && is_ubwc_fmt(out2_fmt)) { + inst->output2_buf_size = 0; + inst->opb_buftype = HFI_BUFFER_OUTPUT; + inst->opb_fmt = out_fmt; + inst->dpb_buftype = 0; + inst->dpb_fmt = 0; + } else if (is_ubwc_fmt(out_fmt)) { inst->opb_buftype = HFI_BUFFER_OUTPUT2; inst->opb_fmt = out2_fmt; inst->dpb_buftype = HFI_BUFFER_OUTPUT; From patchwork Thu Apr 29 10:58:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 429941 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 68708C43603 for ; Thu, 29 Apr 2021 10:58:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2BEEF613B4 for ; Thu, 29 Apr 2021 10:58:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240587AbhD2K7R (ORCPT ); Thu, 29 Apr 2021 06:59:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240530AbhD2K7N (ORCPT ); Thu, 29 Apr 2021 06:59:13 -0400 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35D0DC061347 for ; Thu, 29 Apr 2021 03:58:24 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id k14so16498007wrv.5 for ; Thu, 29 Apr 2021 03:58:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yX68PnWt82JqqvaIeLqptsXuqqdgzkaoY2lNx9HH3fE=; b=YnzwceP8U0S+indgF5DyHzwNq2c7+3xad5HCdpCKnt9ggc3qbEePi6z1EFXJw8euGh NFrMIWqPIsbzGJRD38ByKvpOupj7Z1WYwU7/6mZQ4Y5izinBcVqtloOPrA69PGA0Grn+ nXejj9KUG8Sd2BuF0VPqQJiQ2SYDH1tS20jqgZ5nAwYv6fPNSO44jCUGxXhcGvw+3fUw qysIYirnk50gA/MrIaAwR+F69aXvKVae9x28EomHs6q6xCp5pXKU6EU/ZU41saoMkoGm AzLiZTUtsdoieqlqd2GGbaIWLwHo+IcwwlhmTBLKV602ZMe5aehkTnDbHJGQ1JkR+525 XMfQ== 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=yX68PnWt82JqqvaIeLqptsXuqqdgzkaoY2lNx9HH3fE=; b=dI4Y7fJKCTXuB97xBQ1f+tRhsK41EBftfbK46XT0YfV2WRElBHcV2LWVicLT/dv0IH +DldfEhfUyKj3fKASUhmUkmXFcyJ/qipMYUEWw3ZsMe8jliWrH/TC13zm5t9O6mfAjNP 0Y5UyoI1xMQwqy0gukwT86/CE6hBKalKPqN3H24w8X9tKbD7f1qypWyoOzRRqIuYe5kT XUeLYL27fwMQ9OxabUZ80u29f+zBO9Pl4k2BonVlZJA2sEPTI7Y2ZEIKuU91WfFr5Yng dxUKQCdZ2F2PO1UIMHEgG2BtMtIjix2Eqt3CyYL99xQce2w4M+RZcktNUNu+AO014tvw HlIA== X-Gm-Message-State: AOAM533JSylPt5mZ8+hDvbpd8e5iZXETQM7DQZtseqm5eAb37xvCHNIz qZB/Gip35hPcs7CXNCNzqu4TMg== X-Google-Smtp-Source: ABdhPJxXJXDxOHijYlO7spKrJea1/3bsj+kN2SnW3zigQTep6fakuBiYSEjQQQxJWRqUb4UZBa/WWg== X-Received: by 2002:a5d:60cd:: with SMTP id x13mr21575236wrt.377.1619693902996; Thu, 29 Apr 2021 03:58:22 -0700 (PDT) Received: from localhost.localdomain (hst-221-29.medicom.bg. [84.238.221.29]) by smtp.gmail.com with ESMTPSA id a9sm3372903wmj.1.2021.04.29.03.58.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Apr 2021 03:58:22 -0700 (PDT) From: Stanimir Varbanov To: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-api@vger.kernel.org Cc: Hans Verkuil , Mauro Carvalho Chehab , Stanimir Varbanov Subject: [PATCH 3/3] venus: Add a handling of QC10C compressed format Date: Thu, 29 Apr 2021 13:58:15 +0300 Message-Id: <20210429105815.2790770-4-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210429105815.2790770-1-stanimir.varbanov@linaro.org> References: <20210429105815.2790770-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 enumeratable from v4l2 clients. Note: The QC10C format shouldn't be possible to enumerate by the client if the decoded bitstream is not 10bits. This is not implemented in this patch yet. Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/helpers.c | 2 ++ drivers/media/platform/qcom/venus/vdec.c | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index 3a0b07d237a5..58bf2e0654ce 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -563,6 +563,8 @@ static u32 to_hfi_raw_fmt(u32 v4l2_fmt) return HFI_COLOR_FORMAT_NV21; case V4L2_PIX_FMT_QC8C: return HFI_COLOR_FORMAT_NV12_UBWC; + case V4L2_PIX_FMT_QC10C: + return HFI_COLOR_FORMAT_YUV420_TP10_UBWC; default: break; } diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index d4cc51fc019c..7ad8cd66b8bc 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, @@ -1508,7 +1512,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[8]; inst->fmt_cap = &vdec_formats[0]; inst->width = frame_width_min(inst); inst->height = ALIGN(frame_height_min(inst), 32);