From patchwork Tue Jul 6 12:40:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 470445 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp4958672jao; Tue, 6 Jul 2021 05:46:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2md20JuDU/sdnHgQ6SiRS7p8lXjzRB4b4hreQJx5l/fEn6KDbJrap1p2rfU3yFs+TdROG X-Received: by 2002:a92:3647:: with SMTP id d7mr14264159ilf.231.1625575589078; Tue, 06 Jul 2021 05:46:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625575589; cv=none; d=google.com; s=arc-20160816; b=wceuDf2zwR9dwgwv9wJtBlZFavJO9GgypF63Z3r0Rd9sHh9+92GDKeT7yk12dn2YZi WJ2pj+UyjHXXohuLSmHOf24yOc7oXKGgK+z7OhF5LS9sSTMWVSa10afV7KX8oxwNk5+3 F3S4i2cXGSjaG2PHqkA3H/Osn5hfE1AyoEaL71TqLgGg5CvZjxEtVCisYt25mGIgTE9b t1M1Q1U8cKhwB2HndXiou95yiTnnBaZHQoM+GV/qlT2KsTKZAVesnvRzdxomu4aE0SdL U05R6QHJwR5tXPCd4UnJIDclt9AU/QJ5de0ybcd8dsI8j83PjzxcBKR7YfPMDFQxhNYA 2hZg== 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=+SyzOju9StSJiRZ9iNcKKAv9UQxdJlfQPJ4E1Oc7MQ0=; b=etGcuuhGlZlcQByDDyp5lnepuaJcjYKOesxU4+u53wrufRqrDZUZIGwmPASARq/vS8 F9cpgLpjeWTt/a3Q6XiTj6ZYrHzOk1VHWfKLqYvtNCLjfeCIh6B13vTH7ieVQCurI8/l AX+0WeVBkHOgM8cwRr7B1qvI42Iwt8+pfsykTTEuWzeMVg7eXviEecnFLlf/WplbDrda TQW91oEV2lUPIH/nf1ObVFvwdiSVB/MloTnowCjWsCpTsWDt+nBhXaMwHOfz+nEg9JPo OC88Ux1mPZ6FswIBzwhObULj1Tr4VtH0wRmQO6Gnp+doU0QXcPDSlg2u6gg9GtVtXZ2w qvQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=URrdGVCp; 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 v10si142748jal.77.2021.07.06.05.46.23; Tue, 06 Jul 2021 05:46:29 -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=URrdGVCp; 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 S240829AbhGFMsn (ORCPT + 17 others); Tue, 6 Jul 2021 08:48:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239541AbhGFMsk (ORCPT ); Tue, 6 Jul 2021 08:48:40 -0400 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCF62C05BD3D for ; Tue, 6 Jul 2021 05:41:08 -0700 (PDT) Received: by mail-wm1-x335.google.com with SMTP id g10so7626711wmh.2 for ; Tue, 06 Jul 2021 05:41:08 -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=+SyzOju9StSJiRZ9iNcKKAv9UQxdJlfQPJ4E1Oc7MQ0=; b=URrdGVCp9ySEpG+9Y+/25CGI7NcB4VqFscKTYtl081JVonpaKzsZeph7TlfLu7uG7n YBcSaDrY0AIUjvtCmGY6Luge6RIu0OZr4R5uLW9ArPDJpE67OJD2vVpSEEar70C3Ga/l TPLR9DiyOI0AcCNJhUAPJFEj1MXNMsMskNSzySORWA4liooFpd+/3MaaCyNoCqb4aVB9 3i7REh4Vop83cgFqpgS7gUxxeEe295iNAlnjHQcnrGlD7zqk5y33tvO1tpHB/cVJaKkI cmx9r9NhXoWPGxeF61POe3OvY3aC1OgadR6cv4u+xDXym7iOYHTtoBX8Af1ao6LNeEgJ 44xg== 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=+SyzOju9StSJiRZ9iNcKKAv9UQxdJlfQPJ4E1Oc7MQ0=; b=hckuskKnzV4qxp/MAGofMF6ybEnhE7Z0caOXQQjDtfSRZjAQqLV9mL1l66MIoUSONX CiwaiZUFsLseUtkdkDSW/rgZ4UtG9XvR6gQLoco5kv7RgjSYsS1jLPCrxYucHedIBU4w iB6DB0EHvzSOWxEkXnoAIkalaOhPGn9nBV+CsS8101pAcNNzDMGMUNb4pWmrv9u2JECW CjLvGzqG693ffHesc8dBucfXNR6lWBnrSRe7dnMvit25pIpVFbQycIn1hgmeAduyxYhg Dxhrre/tXfiE++bWq91B/wxTZ3k95oHoGOW4Zk8NaQbL2VbptzZIb0BGR1aAkcQsv1lU utIg== X-Gm-Message-State: AOAM533maoQ0HNbrorO/uOcAJHaWID7Btim6tJqnvC5B89Ml+2TS62ut CpJ/5yZzBI/tail1v+DgkQUc8HE32KYp/Q== X-Received: by 2002:a1c:2985:: with SMTP id p127mr20480595wmp.165.1625575267353; Tue, 06 Jul 2021 05:41:07 -0700 (PDT) Received: from localhost.localdomain (hst-221-27.medicom.bg. [84.238.221.27]) by smtp.gmail.com with ESMTPSA id n18sm2585979wms.3.2021.07.06.05.41.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 05:41:07 -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 , Stanimir Varbanov Subject: [PATCH v2 1/5] v4l: Add Qualcomm custom compressed pixel formats Date: Tue, 6 Jul 2021 15:40:30 +0300 Message-Id: <20210706124034.773503-2-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210706124034.773503-1-stanimir.varbanov@linaro.org> References: <20210706124034.773503-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 | 18 ++++++++++++++++++ drivers/media/v4l2-core/v4l2-ioctl.c | 2 ++ include/uapi/linux/videodev2.h | 2 ++ 3 files changed, 22 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..136e9832db0c 100644 --- a/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst +++ b/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst @@ -260,6 +260,24 @@ 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-QC08C: + + - ``V4L2_PIX_FMT_QC08C`` + - 'QC08C' + - Compressed Macro-tile 8-Bit YUV420 format used by Qualcomm platforms. + 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. + The used compression is lossless and it is used by various multimedia + hardware blocks like GPU, display controllers, ISP and video. + It contains four planes for progressive video and eight planes for + interlaced video. .. raw:: latex diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c index 05d5db3d85e5..76d4e4ac18e8 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -1416,6 +1416,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_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 9260791b8438..dc1b714ccf6b 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_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 Tue Jul 6 12:40:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 470444 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp4958599jao; Tue, 6 Jul 2021 05:46:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGzk8pgab9EgD4IxhjrqWC3qUBRLb9yCCoyvvMnFfd/H4IRASmvuVvcJ92ZJu47OGgMDU1 X-Received: by 2002:a6b:d20c:: with SMTP id q12mr15272993iob.59.1625575583013; Tue, 06 Jul 2021 05:46:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625575583; cv=none; d=google.com; s=arc-20160816; b=JAg+NOJpb1/9kSF6axxgC1ktn/C7/Ok8RJQnEQ2+gjWmB70jRfqVpE2VA69GWg5stp s0b7KyNF04RiY5HCpdYgSCn8968l+b5hKMDXFhWVwObIq0eYmPGkKNMRLO4c1hsbjNG9 gjVy8R+Wveg1yxnUa2Mp17yRW5yyS1Jm5HL8paYsyr22tSdcpEAKV3Hr/5C+qj1ReKL8 UBHboodLaBbq+QDcLvgvzqcILFR+mFnMqtFjt3Gpv7RJwb2BIDFyR0wPcN7774I8ahSM K3v3DaWS02AFiH7t59MeIZT0hwCIXH7txJDsluCWQkQCbwL5yyf28Z28eOkfluju+kcV LUlw== 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=co2CdYXFE7Ol3YA8dMqb29CNEHa7yCiGPitI5faXCjs=; b=l+rSByr3D6ajE4ANDfB6rnHIpom6yg4nJimz/MF8FC673N+1uAukEQM68uw7PbR74Y lDiVOLG+E4XatVZ8JE8xF2ui8/kxYrr9TyNmutxmXQDggYMHoeTVX0h9XM/SRN9PWePh 4OHj3jfF2Zua1+xVY1BIWKBWIbOADftZ2Guw3eJwWKbyPbnqESzP+OKT3FMn4dJoDX9n 5kyi/6oBOOxUmXE/uo5OUfLRPfF7ZObl7otE7p66M9pT8N9QRC1ddgr1iK8AircHEQvq lzr/xAhDxi0D2dXwSacI31lMSl5Z1yvLP3F5cJSjU9DluOOYMw5I1oqZepHN8ht1SXRF 9XXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VSX7etRg; 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 v10si142748jal.77.2021.07.06.05.46.08; Tue, 06 Jul 2021 05:46:23 -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=VSX7etRg; 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 S239676AbhGFMsm (ORCPT + 17 others); Tue, 6 Jul 2021 08:48:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239254AbhGFMsk (ORCPT ); Tue, 6 Jul 2021 08:48:40 -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 B438EC08E88C for ; Tue, 6 Jul 2021 05:41:09 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id a8so14227393wrp.5 for ; Tue, 06 Jul 2021 05:41:09 -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=co2CdYXFE7Ol3YA8dMqb29CNEHa7yCiGPitI5faXCjs=; b=VSX7etRg+C/iteL/+Pb2AdgcflfCAwFn3ui7ugZTOUwrS12OZTDV9tPDDN2wwwCh6w bgyrJ6QxxX4XD2miuFTTcHYoqtHcqhQNqN2PUWR+ztdNuTjSBc/I0W/Ftbi03lSNGG5s hD9/kqv5ph+ayeA83Je8wsNvLkFRLOpF57+yE82a6/2XRW6TVghkWgyj25p07Rc6ZuVO 0yK6WbZclRm0qm/xszR+c8Nrk6EAi1J7itus+tEqU5vVBUj7yYft3VlFzPtFJkm5VVxc GQFFyA0DLA7It2XZU/oaPq+2A4Gp86jQFWZeYfepa9sY0TSbwEvSqrZSSJqQ9t5wI+41 JDug== 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=co2CdYXFE7Ol3YA8dMqb29CNEHa7yCiGPitI5faXCjs=; b=qYQca4hLZsxBKw9tmI+hSPm1C+yRjrHsF1BTO0YU7hvAJSPFuwUHII317DGnPhE1ZL jrT3KiKo6gqw8vwOMX3GXGQonvCcHQFzrpEzCtYj09JfMyszobRrW5iPTf8gJLfB/uWz 318vp12aRYr/3oUNG2i0y5fA0/ZBGIvo9NGgaNQZbNBPU0IK6gNirIEprlFD7yv748Tv N4wyQfAL6OzNLzMLRdufiJNB7lX/uLpgNOJd9qNqKbfzg6NImnaTY2Rp0q4l1NWPKQsQ 9+GwI50ZJ8yXrmrlB+Uo6tm8CXp9Tcu+OU/bj+0tRpVE5O06RSSkbneIoP2PCv0szgtM OSzw== X-Gm-Message-State: AOAM533oduwAhYgvgf/ZdRYJ7hEmDVqwG7pX2N/YYb32NzBkfYPmN6z1 xlub8Ljx2x100Xir2IfNZayP9A== X-Received: by 2002:adf:f642:: with SMTP id x2mr17929574wrp.37.1625575268165; Tue, 06 Jul 2021 05:41:08 -0700 (PDT) Received: from localhost.localdomain (hst-221-27.medicom.bg. [84.238.221.27]) by smtp.gmail.com with ESMTPSA id n18sm2585979wms.3.2021.07.06.05.41.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 05:41:07 -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 , Stanimir Varbanov Subject: [PATCH v2 2/5] venus: helpers: Add helper to check supported pixel formats Date: Tue, 6 Jul 2021 15:40:31 +0300 Message-Id: <20210706124034.773503-3-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210706124034.773503-1-stanimir.varbanov@linaro.org> References: <20210706124034.773503-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(+) -- 2.25.1 diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index 1fe6d463dc99..48da88d21ccd 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -1725,6 +1725,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 e6269b4be3af..00ecb39d7f6b 100644 --- a/drivers/media/platform/qcom/venus/helpers.h +++ b/drivers/media/platform/qcom/venus/helpers.h @@ -51,6 +51,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 Tue Jul 6 12:40:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 470446 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp4959383jao; Tue, 6 Jul 2021 05:47:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKgl9ylggoGerQjF7NcQATSc/DV+f7OZOCZ4kSMnpNecHOTFuGqurtFGw68SBqfT91xIi5 X-Received: by 2002:a92:d10:: with SMTP id 16mr14237975iln.189.1625575641892; Tue, 06 Jul 2021 05:47:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625575641; cv=none; d=google.com; s=arc-20160816; b=JhLngyLmeVb3HKsHGwQEay2LRmwau6E5Kq7KiI/IZmFIhAB82ih3CxJv4XNMYIPtPx qIVU7XTV8thWGbiZrjXNBdB1JZvQebkz6SHLXq0tRmNd6f4DfH+OgJXHgnejb/KYc+4U wXEubsn8TdkniLweaKJf1uQR3IuweSTi4pQvQRv6fAJzxV/iErgeHNfFNGlZBVyRz0D3 XsQSr5xLaHx1cXRaVuH7aazgGllh4f69JGv6cXdTwQY9CsSieL6fmsOfb/4S6ir6ygme 6TkmVmrAhzQ8hBT4WvluhZz2qB1W35Jnqa0bbqj8RE8AZeqdwT2mXv15ab7DaEOS+FEn abNQ== 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=ecjW3cRWAEIfndFoVo8BkYktDhdK0gMxQVqk7QqJZj0=; b=o//7IeFwaURU87S+1oYGcubO3HdXZ8QONxrPKsxVqtqzV9odwM0x4ZBuCBSQst3X+z lNj/Uir8GxBmfIsypDlAPEXx+tX7cz+w9xwEptj5yrO9XnPQF3eDBFIcJhL1gWi2sjVX Pcahi9UaI3xa/G4fswd9HhT1QUa3n0dZjQrYqQ8SgCOaCEcB0/dZt8csEPLWewDmTMPw tScpkHliWizBmbYpmQHtaHPhEXURtTBpUwHIfzUMr4MR6Sjb9MHcBRYYjDvvOz/8DOyP WMIEcgdylw0VpAQpC+mtWpxUA1Zezfi18jGeR+yWCkGmMU5XQHssFJtr+xAxde8y9aXI gyVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SM3N6mKr; 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 v10si142748jal.77.2021.07.06.05.47.14; Tue, 06 Jul 2021 05:47:21 -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=SM3N6mKr; 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 S237464AbhGFMsx (ORCPT + 17 others); Tue, 6 Jul 2021 08:48:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240808AbhGFMsl (ORCPT ); Tue, 6 Jul 2021 08:48:41 -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 5BF5EC08E8AE for ; Tue, 6 Jul 2021 05:41:10 -0700 (PDT) Received: by mail-wr1-x42e.google.com with SMTP id q17so5522587wrv.2 for ; Tue, 06 Jul 2021 05:41:10 -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=ecjW3cRWAEIfndFoVo8BkYktDhdK0gMxQVqk7QqJZj0=; b=SM3N6mKrFJk7cd4eql+zVJ3BOe/UnA9Das8uViuXyhODKR80MNDJFZJanZStMVvJpk r8RRG9bUGR1fFTOmLpQbRBoumGQC63LBe2A1RnHZoQnxbQhymxtxikH2NVZsoY4MaoA9 sqyoZI627kQEc0sc/LrSo29XoLeoUrg028GTSrOlw9tfX7gjq6hAKf3isu4cP5toBchM 5AN5ISa/BOazTUMWYHirDsLIC7eNeorzOt/SWbILOMMlg7hnhp5+81/P/0pSPtK5SKxq ODvrrGe6PEMpclgZrIonMs0i5Y39dLbCAkx9ztnrSgXORgpVNrOtjp/Rt2BphRhv1/C8 pPlQ== 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=ecjW3cRWAEIfndFoVo8BkYktDhdK0gMxQVqk7QqJZj0=; b=ChyFlM3d/bMOSP1gRyj4o3m/d3F1FizHSoiZumNjvfnlHGJfjaExhz8EaZeO0v+uq9 lKQH6V3qRjHD/JvAeDaS6wHQSvb3dEh1/tIgji9FfUwySz0m9bMD8YQpZWOD3Z3aYnv8 abtcF6SA37mHRuKc3HCDcW1qseY70D1FrCnsbbXk7pVN0y2kNHMltBfIUE8wa9vd4uqH d3dQ3GWpyygt+nSkDrnmiRHpy7BWvr19GbHh/dbN6XZTcFKl9hgRXyDNTAk6V7TtektK io00uO5llbQzB2ISGdcp0z1dn+IVEaIR/502Tm1xOETJ4oSX2XPegFluTL0eFSa06NEw VvWw== X-Gm-Message-State: AOAM530NfHhUmlFc3TRSaTeTfBNZD8RcwRnYMkZRQHOrjIQHzUvxiH91 sZJum/LXgVUTnZlu+KqqKOaIkw== X-Received: by 2002:a5d:530f:: with SMTP id e15mr21151955wrv.217.1625575268875; Tue, 06 Jul 2021 05:41:08 -0700 (PDT) Received: from localhost.localdomain (hst-221-27.medicom.bg. [84.238.221.27]) by smtp.gmail.com with ESMTPSA id n18sm2585979wms.3.2021.07.06.05.41.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 05:41:08 -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 , Stanimir Varbanov Subject: [PATCH v2 3/5] venus: Add a handling of QC08C compressed format Date: Tue, 6 Jul 2021 15:40:32 +0300 Message-Id: <20210706124034.773503-4-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210706124034.773503-1-stanimir.varbanov@linaro.org> References: <20210706124034.773503-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(-) -- 2.25.1 diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index 48da88d21ccd..49d720fd9a9d 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_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 198e47eb63f4..989a75dc5bf0 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) @@ -1484,7 +1496,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 Tue Jul 6 12:40:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 470516 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, 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 D66DFC11F69 for ; Tue, 6 Jul 2021 12:46:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C4EB261D49 for ; Tue, 6 Jul 2021 12:46:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237661AbhGFMsy (ORCPT ); Tue, 6 Jul 2021 08:48:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239223AbhGFMsl (ORCPT ); Tue, 6 Jul 2021 08:48:41 -0400 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64D48C0225A4 for ; Tue, 6 Jul 2021 05:41:11 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id p8so25932679wrr.1 for ; Tue, 06 Jul 2021 05:41:11 -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=iQ3yOn/VjqEGKTdI++jjchtNRpo4xx2SRNzVvDxUg3A=; b=NkKdOFgL/b5cHNIFxbGHFGF/hyb+j3sLHFwCNN/eZlDyMXf/e/BCK6o88C2Fc7Jh9G UWBUXL4BheLJhdJmlYaVr+Ld0BoZsfvHAO+BX8xkA4MjNFR01MNSMNiY0IE/DoHwo+wW T6tDIO7ApOlpR35YKGOMzmNHsF6ojw49fInCnUIMmgxUkLNmtSlXG0IP5aE4TEfjs7w1 BUVF+KRfB63HPmLB5y+MrPBtoJ7Qi8l5QrC0jMJMp1bVT7AS6kjnxiLJCom0GEGW24x+ NRQDUu2Cxv5yg4VJxAhOlz48yab5eEFjQsOwD+GL0AwwtSDD+BsUh2ba4NFvodtLDAoo HOxQ== 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=iQ3yOn/VjqEGKTdI++jjchtNRpo4xx2SRNzVvDxUg3A=; b=PyzAyIVJatQiP8ib90MtWDyr10XuzAccH/wQe/muW2BnZyf7coEpvLKT8BzTevix1d h35tzvUo/NWMmFALgX1RpOqmcScZTfxCvhBPRiHpKxHfBmuMHkE+Pwq++kmSBpS7T8y3 Ya0Tra8o/lIenAgim1qAsDGReodd5V5HoEuu8j5scipQheDaEyYOjK5OTyGXTwrkyluF fRd4d6J9kvK4S1L/mLaUeoMuKFyxCNNUVhnxOhEmEc9N+MPKxLYZnCRaDhH9eWIlTQyw qUZx401/ZP2i2qRd/VTgMBqU+/Xt3lo5g9lypARDDwg8gP6GLv4lDMacx0Ep0mMhmvT/ OTpA== X-Gm-Message-State: AOAM531p0g3gZSqJypL7dTYtSVEYeqP7fHlVKTAZ0xnGnMBA+4nG1lCC 3G+mTsCn3jDSQkkYjETwYmbOZw== X-Google-Smtp-Source: ABdhPJy++XUxB7OhDLu0uCfjmQhtluIZGVNcY/UIg91uyEcaL+ImrvqcUrTsPv/AyLsfxLPEL78b6g== X-Received: by 2002:a05:6000:18a7:: with SMTP id b7mr21762185wri.348.1625575269997; Tue, 06 Jul 2021 05:41:09 -0700 (PDT) Received: from localhost.localdomain (hst-221-27.medicom.bg. [84.238.221.27]) by smtp.gmail.com with ESMTPSA id n18sm2585979wms.3.2021.07.06.05.41.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 05:41:09 -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 , Stanimir Varbanov Subject: [PATCH v2 4/5] venus: hfi_platform: Correct supported compressed format Date: Tue, 6 Jul 2021 15:40:33 +0300 Message-Id: <20210706124034.773503-5-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210706124034.773503-1-stanimir.varbanov@linaro.org> References: <20210706124034.773503-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 d8243b22568a..d98caa6f1011 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 Tue Jul 6 12:40:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 470447 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp4959446jao; Tue, 6 Jul 2021 05:47:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzusU9FjZi9nlYFLao1eIRujGfHsivyaIX88sjVqonP4+Vk5ay4vWcaQ7g4OHphdTdaHkiy X-Received: by 2002:a92:d246:: with SMTP id v6mr13553283ilg.191.1625575647006; Tue, 06 Jul 2021 05:47:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625575647; cv=none; d=google.com; s=arc-20160816; b=IJX0zMWRdr6DLZiClWU+v7eXNWLPNvoem4uhh2knrtWmGVRKUJPjJPrYNidubFFTQi xOs64qGyZrn6GUK5uP+FWw/GMraJMUBx2J1+oaRvNQl/WsLrOIpx4LAt4czgaUJzU+It AHX52zGEFwTTMllt1os0ujakcejgdHNCIrnBIj9nnFmRIzyFApxTlT1p9hDVfC6dBK4c IRPt0EWV9ffH+FkwJ6s2jfmN7znEmeA25wxvCAxq6SRXLAvbfGqFRdDFPM+ba7aWly+9 /YfH1vSxsYYL7Lb/nTeIYMxfjlb1DfmI7mSczJMujnAXNr7aLCVHSG83blgFebUX0Uak G92w== 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=hRu/rrECnrx/6rDYLkqHGSqwS0EdaL46bywJDkHS8nI=; b=XrTWQ4s2Iq4Ku+XuXxqEA227lpFTQ+1Kpc74+FNY8iw6/mL1M7vUym9ef/k6e1sNGF sGOZ2aA1ARSgTxTFs+P4IO+M+jYgOl15Y9ZE/i4S+vRfkQB8lGVDSQ8s1JgNt68yZ9XM KRVmp+GUYzRcS+Il4Jd3ykJ+1oIv7czloXMYHHFv3Nx0VQ3S0jKvcTosrpZzn3ah/KII hRnvUzIcWEb2kMJu7sLu//WuS87ubj0BTiihUUE6jyEG2VqjfTUBC450E29oeGI39Md1 6Rj32RhMZZ6WVbCyyO3mGkHhFEUCshDc8wiYYcGqxt3Ec8ZDalRjTWcuFmbvoa9uuewl OUxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="A/Mi8xG/"; 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 v10si142748jal.77.2021.07.06.05.47.22; Tue, 06 Jul 2021 05:47:26 -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="A/Mi8xG/"; 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 S236741AbhGFMsy (ORCPT + 17 others); Tue, 6 Jul 2021 08:48:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240788AbhGFMsl (ORCPT ); Tue, 6 Jul 2021 08:48:41 -0400 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58020C0225A9 for ; Tue, 6 Jul 2021 05:41:12 -0700 (PDT) Received: by mail-wm1-x32a.google.com with SMTP id k16-20020a05600c1c90b02901f4ed0fcfe7so2152398wms.5 for ; Tue, 06 Jul 2021 05:41:12 -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=hRu/rrECnrx/6rDYLkqHGSqwS0EdaL46bywJDkHS8nI=; b=A/Mi8xG/jIlYJ+6yfkfZ/NNXm7mu7DHNJaeqjA+dLchP0zt4JrHU9eIL3h+/nvEr79 T1rC+ILs46rmaj89/17s9Bg+OsODYSOuDRDNtkcF6rFcBoW3uKNU9YiyG2DL79HEwatj 7d4EVG1bqR3Dxi8vxrTYFK9aBpJIqLS1+Zi2HeiO1KXQOXJvx8P7gZm3I1ekA/rGBMn+ Rq8KoRCf9vd7rZk/4eWP5MBLWASDB77A1UsDSsoo7eeAnIfH6MV8UTStV1FvV9X4bb+J nSHPdPYcWYbHd6lO57Bgi8cZuUSWvN5fk7B+JkXC7f+6W7u+rPkQ3pqYxNp0JKRPUKbK Mmag== 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=hRu/rrECnrx/6rDYLkqHGSqwS0EdaL46bywJDkHS8nI=; b=IRuDiQ8GTEy7Mq4ICINJmyEuryxRDD1dyxmZlHT8E9PKpcMYHFAVn8ji3zB9e7QpHm ArFKSaBRQGZ3CKq9GXYy5FiFRerspH2qCfRdoojIV0vjKw/BM1v2HbHVN2Irw9PuXV2x Z9Wew3HtX7kAi2qMIrtgcFe0UixaoD0kpeIJf6BnReNEeec76KgA7UT3UBz0DfycmEoU 8KnNYvrDSwXP8L3wcu5DpeM6jFYO2VrRHgj0ftzvmu4mQ5ihpUgTYV6BwNEmUJP76rhw ezfrzs/Zx2TZ1oxrYvI5+WBUHPNi8T+ZPx1d0XXN0HlfRhmaZRDpz/adFxYV2n9MMTr0 ARJQ== X-Gm-Message-State: AOAM530lhQceLg2HB1dDOhA2dywJTMgj554KU/csZgJfwD/Be4BLb0VY yuO920ZJw+7wOxc4zrClBPf1oQ== X-Received: by 2002:a05:600c:2f17:: with SMTP id r23mr168794wmn.185.1625575270808; Tue, 06 Jul 2021 05:41:10 -0700 (PDT) Received: from localhost.localdomain (hst-221-27.medicom.bg. [84.238.221.27]) by smtp.gmail.com with ESMTPSA id n18sm2585979wms.3.2021.07.06.05.41.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 05:41:10 -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 , Stanimir Varbanov Subject: [PATCH v2 5/5] venus: Add a handling of QC10C compressed format Date: Tue, 6 Jul 2021 15:40:34 +0300 Message-Id: <20210706124034.773503-6-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210706124034.773503-1-stanimir.varbanov@linaro.org> References: <20210706124034.773503-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 | 23 ++------------------- drivers/media/platform/qcom/venus/vdec.c | 19 ++++++++++++++--- 2 files changed, 18 insertions(+), 24 deletions(-) -- 2.25.1 diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index 49d720fd9a9d..b48bf52481ba 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_QC08C: return HFI_COLOR_FORMAT_NV12_UBWC; + case V4L2_PIX_FMT_QC10C: + return HFI_COLOR_FORMAT_YUV420_TP10_UBWC; default: break; } @@ -1675,27 +1677,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 989a75dc5bf0..c4d5bde860d7 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) @@ -1496,7 +1509,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);