From nobody Mon Feb 9 15:21:05 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7F62734D395 for ; Mon, 10 Nov 2025 05:05:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762751133; cv=none; b=FK7SmE/p8RZWLdR45+4A5WC7BamsTWPygz2ji2dfjcI/SgpNTEhcMukiD6nrjjh1efDHBPgbhgMYwRndC59HvSF3SDVmRexuCYy6giU5dp0uH3dYJrmZ7Pt5CW7dW9FScxdtZmvHB37PR4f/XCA9NldwnwELoz24k1NW99gAymM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762751133; c=relaxed/simple; bh=RzruQ9wp8ycOBWczy25ujS8bJ+hwcf0vs17Xh670YBY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=A4gLnhbHKJ/OjOC6di9b/tR9qhxg7myt6GSQWP+rBDQbc+jab+G8cK1+DG2tbmnnCzB+uV+XbFYz5BQkjgW7Vx07lvUqgLvoLEjBZ9RdUPQPEgmZEDpABDYMzYfXkX1ywq0UHCrvjEXt2UHUoYYE/PHT54sAjdmjxxutwnlMXz8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=EMuU/IP4; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=dmRvWs+7; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="EMuU/IP4"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="dmRvWs+7" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5AA0XKNs1809147 for ; Mon, 10 Nov 2025 05:05:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= +Wn/mGVWsg+Fjxsv+KjjZhfuYj6drt3gZw0kiebo5zY=; b=EMuU/IP4jEEE6YMG o6ilu0Avh5VtITcPcBjdQ2gBE4KAIJPYv+iMYoaWdlPb7vEYFsQl0+oxlLdxMiCV IWB27YOsH9ZOXZjrP/W1cPBfo2gvbTu7o9DjWip3hwNqK47lIp3zKK0HFN1HkGXu hzV0wtVVjFMa/GoeKDsCGfLnRxiYvDHhc35UNqTo0MfO0nmrSXHDdmhLfg1pEPvk F7MbcNHPhn9Z+j3UF+ZDDmqDtbRu8zxo0KGo/AmM+0/qthqgId4+ndYQBfy7tnKl lv48qLrsTfNt65COl78cmy5hiciUD43JVcE1aDQvQcMdyeaMKw2bmLnQQ8cHdnME 4zQ00A== Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ab5m1ghqc-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 10 Nov 2025 05:05:30 +0000 (GMT) Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-34361480f51so735759a91.1 for ; Sun, 09 Nov 2025 21:05:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1762751130; x=1763355930; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=+Wn/mGVWsg+Fjxsv+KjjZhfuYj6drt3gZw0kiebo5zY=; b=dmRvWs+78451jskzQhCNVRO1UXBhuaZhxxKfEMUtZZAUzoPi8wcMuUHgZ40RDhJ2CB UlvThW8FkRH3chvzS7fe21xcToyy/atTm1g6CsUlF4Sj2ivdiEq68o1BYeMg569nZaSY I7aNqbjOea720aBRsrgvh613tqTGocPlvMo39Z9pbC92iYMoJkEEa3wizmbv/wTXTJPM b4iSB6ke+yvOGGEP+DS6PcxV4dMwF1X08M03rE49OG+9w/XW1/hd0iYg8sIMwricIkqq lys1R+AgRCbqs6Rof3JU2KrlWwzlr3ZbbjwoFlT2EzY3ay63nikqhwefUuYGyjv/apdH 2Ltg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762751130; x=1763355930; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=+Wn/mGVWsg+Fjxsv+KjjZhfuYj6drt3gZw0kiebo5zY=; b=bjypdRepaPDVxbdCnBl4OJzYkT8u2OBUHDYLQftp+OBDuR4WBulWwqYx3avY0mpJ5A aQ4sG/PF2/GJdO+P5OpoVOoZWK52RoHaYKfVz3ulZyFnpnjDzuKEgVPs5CPrZXUuDXkl dZh7oVMEo7BzYS5s7nPep1eFXUIopTPk84ii0vNQV4paEs+UnFd24DyEPp5kU45GEbD7 S+BU2+0Li1Y/FPbrnQkx/7uaBl7RQAp6FOu4I592uO3bjxRPUtFltVDygynKon5TjIKM WuzYRUPmY1NUDFVLmUQdiSVpDnWU8/CDq/3Da1eO8EtwH4O0zDqYxl1smRRTnibhytcx Hn3w== X-Forwarded-Encrypted: i=1; AJvYcCXtAlhvjxMNeG7RzHP1w1qV9wcTbf4QKHhXijJgzlYjC8UOZf/ULTaARo0YEfz2t/162g+I7SU4R+Eo4b4=@vger.kernel.org X-Gm-Message-State: AOJu0Yy2RC3SKJtfQgE9SI3qXnVLzN8wFz7GebdGjnCVjq8WrPhO/aLC TAXYzggb2Sr/8RaC4GR61xNktrwP0m/dIw0dnlFVOFOW0hphOApmZi8nAliV6XGGUaQjKXwyDhQ VG0ogT0ixRkiMEYhQg/5OXJ1pccaPMBYZcnbZUI3e2lVrJEWhw6LzIpnTGVNGE5/b4dg= X-Gm-Gg: ASbGnctXPKo/WzTqkaBH5adsU9nYneuj8LusR0TlHkt6H7b4emG2USZ7NcDfVMP8uyD jZNiTBd4zkqAnkhwrLHW9j1fq8XOXrDz/szg+5Fo8PwOkV1bqg+Dw3K6s6oi6jnWxUoCDExlZZu l/VirQBwubdo8wTu0Jf2C7UNFtKy7Ibb+XcMBKSfdOyBlDAqi4mBz8wGY/cyl6nFCIICxg492zA +xse3QcHHdhu3EA9vYKlOHYVvck0FvqcITkKZWCWOOxZS9WkZLtY39UHhUKg9UhxlWlrNfFUruw cjYIpEuiebKeCn95T9I/IKvKqZjd1LTMoCrEJL+PoibIkTb6dRny53R5xTkyz6/u99I5pvj2zlJ KI7hNz6ylovMU+wWF6Lyl2DSgsNDX6CxNnZMF5M1vMIEI4ojU1y6v3MjPoSc= X-Received: by 2002:a17:90b:164a:b0:33d:55b1:e336 with SMTP id 98e67ed59e1d1-3436cbf092emr4859910a91.6.1762751129923; Sun, 09 Nov 2025 21:05:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IGR72/MIEIGKNpXYc7OsoV2hqp53HrJgYOB/4/a56FbPWhcVd5z9h4gzeRMwzF7XO1Ft5WO6Q== X-Received: by 2002:a17:90b:164a:b0:33d:55b1:e336 with SMTP id 98e67ed59e1d1-3436cbf092emr4859886a91.6.1762751129404; Sun, 09 Nov 2025 21:05:29 -0800 (PST) Received: from gu-dmadival-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-343705c1354sm5913748a91.18.2025.11.09.21.05.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Nov 2025 21:05:29 -0800 (PST) From: Deepa Guthyappa Madivalara Date: Sun, 09 Nov 2025 21:05:15 -0800 Subject: [PATCH v6 1/5] media: uapi: videodev2: Add support for AV1 stateful decoder Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251109-av1d_stateful_v3-v6-1-4a9bde86025a@oss.qualcomm.com> References: <20251109-av1d_stateful_v3-v6-0-4a9bde86025a@oss.qualcomm.com> In-Reply-To: <20251109-av1d_stateful_v3-v6-0-4a9bde86025a@oss.qualcomm.com> To: Mauro Carvalho Chehab , Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, kernel test robot , Deepa Guthyappa Madivalara , Bryan O'Donoghue , Nicolas Dufresne X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1762751127; l=2537; i=deepa.madivalara@oss.qualcomm.com; s=20250814; h=from:subject:message-id; bh=RzruQ9wp8ycOBWczy25ujS8bJ+hwcf0vs17Xh670YBY=; b=Ad2uYGRWwrIgdcvhA53FD3hdqFNuQEfvwCq2Ng/hVzZjPBcA7eaITEILB8vrV2IPErkYoV3Q/ Pw+mB4zmzxQDW16+pBmKl+KNDxWif+gPwy0hVVkLjdnzXROTzVOcJ99 X-Developer-Key: i=deepa.madivalara@oss.qualcomm.com; a=ed25519; pk=MOEXgyokievn+bgpHdS6Ixh/KQYyS90z2mqIbQ822FQ= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMTEwMDA0MSBTYWx0ZWRfX0PvHBEGwikS+ shpWBM3kdXEvwlMzhSRs27IMb0CeEOJCHwCxpT8DMjVA3DlGR9pkBBijL+TPafDZmcF+qALmgzl 7GMclbGwFeGzqXOAZYDBRXZEvO/IgAiVIwMZlZPFQnHnVhUG1g6MZ95oFPC8Tg+0k9MHNp/Pu69 l51XHOMy8dpHNxPFdbsjmKEHUTZ6rBwfinuh9dRuueDtpch55KcJsCucV5It6PcXAa8seNaDoaM BzVlmzNMFHF1m3bdz1n2hgRndvp/V02/jV4z9MuBmNatfj2aFFLKHDtHUQAZkty9aOYKx93HUZQ wOwadX/b0ZhgSp2N7cid1+6LTQEW3MjcWDBRGfcylmYXARm0Abl5EPr2rflFf1DKxVHR1N0+sOv gsGltpDRbZU8ht5WEQbX+Sqt/J3/gw== X-Authority-Analysis: v=2.4 cv=TsXrRTXh c=1 sm=1 tr=0 ts=6911729a cx=c_pps a=UNFcQwm+pnOIJct1K4W+Mw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=IkcTkHD0fZMA:10 a=6UeiqGixMTsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=KKAkSRfTAAAA:8 a=QX4gbG5DAAAA:8 a=EUspDBNiAAAA:8 a=5q8hE9cQKCNJD2usWYQA:9 a=QEXdDO2ut3YA:10 a=uKXjsCUrEbL0IQVhDsJ9:22 a=cvBusfyB2V15izCimMoJ:22 a=AbAUZ8qAyYyZVLSsDulk:22 X-Proofpoint-ORIG-GUID: BD59Exi4GEq5P52Twk-xqRd6XmLzPVjo X-Proofpoint-GUID: BD59Exi4GEq5P52Twk-xqRd6XmLzPVjo X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-11-10_02,2025-11-06_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 lowpriorityscore=0 clxscore=1015 phishscore=0 spamscore=0 malwarescore=0 impostorscore=0 priorityscore=1501 bulkscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510240001 definitions=main-2511100041 Introduce a new pixel format, V4L2_PIX_FMT_AV1, to the Video4Linux2(V4L2) API. This format is intended for AV1 bitstreams in stateful decoding/encoding workflows. The fourcc code 'AV10' is used to distinguish this format from the existing V4L2_PIX_FMT_AV1_FRAME, which is used for stateless AV1 decoder implementation. Reviewed-by: Bryan O'Donoghue Reviewed-by: Nicolas Dufresne Signed-off-by: Deepa Guthyappa Madivalara --- Documentation/userspace-api/media/v4l/pixfmt-compressed.rst | 8 ++++++++ include/uapi/linux/videodev2.h | 1 + 2 files changed, 9 insertions(+) diff --git a/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst b/= Documentation/userspace-api/media/v4l/pixfmt-compressed.rst index c7efb0465db6480fe35be8557728c196e0e530f4..6ca63f35b801b8aae142b69eddf= aa549a5568a3f 100644 --- a/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst +++ b/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst @@ -275,6 +275,14 @@ Compressed Formats of macroblocks to decode a full corresponding frame to the matching capture buffer. =20 + * .. _V4L2-PIX-FMT-AV1: + + - ``V4L2_PIX_FMT_AV1`` + - 'AV01' + - AV1 compressed video frame. This format is adapted for implementin= g AV1 + pipeline. The decoder implements stateful video decoder and expect= s one + Temporal Unit per buffer from OBU Stream. + The encoder generates one Temporal Unit per buffer. .. raw:: latex =20 \normalsize diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index becd08fdbddb857f8f2bf205d2164dc6e20e80b2..cf0b71bbe0f9d397e1e6c88433a= 0fc3ba11fb947 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -775,6 +775,7 @@ struct v4l2_pix_format { #define V4L2_PIX_FMT_H264_SLICE v4l2_fourcc('S', '2', '6', '4') /* H264 pa= rsed slices */ #define V4L2_PIX_FMT_HEVC_SLICE v4l2_fourcc('S', '2', '6', '5') /* HEVC pa= rsed slices */ #define V4L2_PIX_FMT_AV1_FRAME v4l2_fourcc('A', 'V', '1', 'F') /* AV1 pars= ed frame */ +#define V4L2_PIX_FMT_AV1 v4l2_fourcc('A', 'V', '0', '1') /* AV1 */ #define V4L2_PIX_FMT_SPK v4l2_fourcc('S', 'P', 'K', '0') /* Sorenson = Spark */ #define V4L2_PIX_FMT_RV30 v4l2_fourcc('R', 'V', '3', '0') /* RealVideo= 8 */ #define V4L2_PIX_FMT_RV40 v4l2_fourcc('R', 'V', '4', '0') /* RealVideo= 9 & 10 */ --=20 2.34.1 From nobody Mon Feb 9 15:21:05 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 771D62E6CA4 for ; Mon, 10 Nov 2025 05:05:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762751134; cv=none; b=eR3URl8c1qTxM6pgAC5zx9HAmIV6QDqOyDfI4J2eW8qzGrsZxD4Iv5+73NTZzSz5ET7LMBIOnbmXRuqo2LlhmMSIksST1IavRgJ3o8SJht3N9I1lTOyWV/DZGKN1doggO9SXGue1KZ3FrlcbkMUY6n61UZPIh7o6aPGiPcyLaMI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762751134; c=relaxed/simple; bh=FzzoO9k4M9sQjlK8nyUnKg9cqOI8/oU0g2MJWe3xnTY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=GqnXV1UFPcIGKSRhsYGZBhri6SPAwhAxA9/cegXoalpGyw+7z7Qz2DqFp+YslO2Vjd8t0VEcAvlToz9K3/RUKEQ4CvJWIIVwLxxpzHka8N9H7fWcrjI5WBlaK/+YBLcJ03x7wJ9/id83GAJtTaUgUdDh5hDIi6AHP9UEHDmeO7E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=Vs3sb3Ef; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=aPPT7CgD; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="Vs3sb3Ef"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="aPPT7CgD" Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5AA2MNUk1882509 for ; Mon, 10 Nov 2025 05:05:31 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= NYWtNOwI1aavZwSln38Rwrj/x9o/h5lzzgA17JpG11A=; b=Vs3sb3Efo4R5Ah3Q MdS9/nWbMapc2thA92+5FGlbbo21lSg5UNlHJ94P91dH63bPYryquLhB6AVSSsV4 JPeCx9iZc6f5mlPmqYljp0pC6NEDkcTacoJtar/4JDVCrvmyRPzS9LORO/kpX5BX 5LWtUrcB8YtUzK3uWSSS9LnWuKJzrTZiKVMBvpcExJeTvhh9VaOOQqkV3ySgMqPK OONgcWd6rmRspt859MRhvAnHjmxjYRf6co8J5TcqbUAAcet6gRMsP04a46ymOrd1 Q5RaewOLP21UXz4qQwgR9Xlg9llq5/PticdruUTfv57+FX7i5yUUu/M0wiFv8j4N +O+7kQ== Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ab76vrbkx-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 10 Nov 2025 05:05:31 +0000 (GMT) Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-34376dd8299so617347a91.0 for ; Sun, 09 Nov 2025 21:05:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1762751131; x=1763355931; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=NYWtNOwI1aavZwSln38Rwrj/x9o/h5lzzgA17JpG11A=; b=aPPT7CgDtGFk/A59OKhwMP3PjViSgvQogH8m12N3H7KgiJcMBNcLT2UKSxVCSLag/z TZ3qPFr+XgogBpxrHttcgXaK6TKKwWvQSPK6kPTobBO/ZUsPvhBhcc5LGVSmY3xk7LJZ 4tCT+8ALra4GAE1yC7XsWZ3oC3XrUXDh7L6h8+qnmKtpPE9YKhkIxjdMXpgwTxs1EeSG pFswcdtO4slsF43VyFA3lW87a1qBY8Gs15rLXDgZ8jRkQ5KaMbdzvFsT04lFTJDRb4vb a2nx5QFmdyqvE9ho7c+Vr8iHUx4Xgj3UFlJC7nt/j/uuURjkFPIYkz6nYsIJNdoAFst3 hpiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762751131; x=1763355931; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=NYWtNOwI1aavZwSln38Rwrj/x9o/h5lzzgA17JpG11A=; b=tekXan4oMkRpHudzslnn8c1JiGUnosCfXMhd8GemPxaaIbcIwghpqcx6FcNDoto5Bt +0qfGIWZ0sSRsooKjOBCDfpDKFGcODh0fbE63lTqU3FSRETBj0qUDzy+w6dCGvfVRtdL dT/Q3h3jtNmlJRY9TAykWcAQ/GQXwHQO8GiK5NtcOXivIYxa0tgQRTfQAogZwsK+WoTN BoJKyUP86lKUEKCFzrpWA9ZT2IWKKttpZaZtgQtaofxkiWbF5INDz9ysdXW+aAW1NGbA b1gqY6SxGqlNQcVoNcj1cc2Mdkj+FTbG3v/f9zA9AvT8WDCFBxnF3T+R/oVsuMxqiJJl wn1A== X-Forwarded-Encrypted: i=1; AJvYcCVlyrkLJeJ8iAwTrbdNkd25JuQ0tpVv4pkDo92GWTpAze0IHH97S+SwQr+cbfi//zo/iaPk5YDC3Jjityc=@vger.kernel.org X-Gm-Message-State: AOJu0YwrvwAAEoVBmVMu3UYUGU7oZVPVi4EGssq7dTDH8NlGdE4cY4s+ azOERMJC/z4Zy2wA4s9Ouvy0RaudVlpGFx/CzXFvBs5KDaf6S4LMhuYMUi6+vSh1l+d5pHOqG/x LBo2ln0G+3yv7dWhS46b9S5/f9sfMMVwDGV5+gqBLEb0e80UPmWMjx2QpKT0jDdF1CxU= X-Gm-Gg: ASbGncvcwxGj7PSmBtYmLPssUDuvZj2WKHwgYz+L75QYGSbvTlAm9uF5sKpvmTpF9iH p2eif37uvizqplN4K6aDhbbeCxUZX9GF8KwTbWFUm1GVpVNHpe/v8ovkkPP9IWDQGJ4t7eqIUgl csox6dzPpzeOm6TIQtzLvVoELwZd2CVurGYxfydg4yZXO46zzy5u4z8AtKykKwsXp8JEPx+Pw5f /ei8IP1o7hIi+817kpxhdS4Nel6oGn3kiOfSKUk4ny6Z5N6NGOOTB9rUGjmjqnDLuva3SYGaAXv XQoVk5yHc0AxhNqnGqyg037rQfUIZJbLOEUJxBYbyBsgdijP/COt0nn47ctKFpNMgXrmTlyjwpX hum1yxb8wQkHITR6DGjWoKZnMyDvYCMj4hoToojgC3zUKpWMeWKRb76Sz82I= X-Received: by 2002:a17:90b:4a0a:b0:341:8491:4734 with SMTP id 98e67ed59e1d1-3436cd06c78mr4896012a91.8.1762751130909; Sun, 09 Nov 2025 21:05:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IH1ZQlaMD2DhRGFL3hJaFUr9NexYv+YtjmuBFDRmdJ5aJYXw4KC0RZBdZvJvpXZg0wWg4HKNA== X-Received: by 2002:a17:90b:4a0a:b0:341:8491:4734 with SMTP id 98e67ed59e1d1-3436cd06c78mr4896001a91.8.1762751130417; Sun, 09 Nov 2025 21:05:30 -0800 (PST) Received: from gu-dmadival-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-343705c1354sm5913748a91.18.2025.11.09.21.05.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Nov 2025 21:05:30 -0800 (PST) From: Deepa Guthyappa Madivalara Date: Sun, 09 Nov 2025 21:05:16 -0800 Subject: [PATCH v6 2/5] media: v4l2: Add description for V4L2_PIX_FMT_AV1 in v4l_fill_fmtdesc() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251109-av1d_stateful_v3-v6-2-4a9bde86025a@oss.qualcomm.com> References: <20251109-av1d_stateful_v3-v6-0-4a9bde86025a@oss.qualcomm.com> In-Reply-To: <20251109-av1d_stateful_v3-v6-0-4a9bde86025a@oss.qualcomm.com> To: Mauro Carvalho Chehab , Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, kernel test robot , Deepa Guthyappa Madivalara , Bryan O'Donoghue , Nicolas Dufresne X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1762751127; l=1278; i=deepa.madivalara@oss.qualcomm.com; s=20250814; h=from:subject:message-id; bh=FzzoO9k4M9sQjlK8nyUnKg9cqOI8/oU0g2MJWe3xnTY=; b=k0yqKF4t9t5rOE2GT72HBsr0YSn3egf6rNBVy5bDeukHAgfg2EhFRirWIbMtyrvTdutW7xyXC NrK+zIfK8pVCBqbu6T/LbUReyhA3R3A0axjZDlMeqpYbV2ziOG7cUMs X-Developer-Key: i=deepa.madivalara@oss.qualcomm.com; a=ed25519; pk=MOEXgyokievn+bgpHdS6Ixh/KQYyS90z2mqIbQ822FQ= X-Proofpoint-ORIG-GUID: vpeB9zlU-3H0KRSFi7DAd5W3gzpFOmx7 X-Proofpoint-GUID: vpeB9zlU-3H0KRSFi7DAd5W3gzpFOmx7 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMTEwMDA0MSBTYWx0ZWRfX1S0hVMBfBgFI U4aJUOZyiYFImQnViNzfuOTy9ijDswLUeFnw0jCd3R5cu38B3eXklWjWan2IcNV88qUNTuj++0Q wOwjZQPNcAnU4PR+dV6wg1r/nY4i/VtsFBbChlyYqHdKtZtOmZO77d/Ppt7At0xeyxcxgxTltHV 8v7lauVT4WPUuIuSTqRYfhigoekUeOehSK4HYagi/RKLDAyyyJld9nIX7sEM+n2HcIaApWCLZtU qwF00RcOLLMko+ztb5e3MwPGgpktboCfDiZUeRfRmNWeGJPUM4M9CcZxRsljM4o+GZLlU5F/N6p B/qEjxmejq0MaO84dzeVii/hEHhXYdBFfjjPoobtVxJhk1Ypzkr160HhOaiYHFZMuuH4kqi0xoz zLgBZrTqQdCPiQRur2O/nqKoNr/CFw== X-Authority-Analysis: v=2.4 cv=LvyfC3dc c=1 sm=1 tr=0 ts=6911729b cx=c_pps a=UNFcQwm+pnOIJct1K4W+Mw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=IkcTkHD0fZMA:10 a=6UeiqGixMTsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=KKAkSRfTAAAA:8 a=QX4gbG5DAAAA:8 a=EUspDBNiAAAA:8 a=3VFMuRvh7oFGMF0ZDtIA:9 a=QEXdDO2ut3YA:10 a=uKXjsCUrEbL0IQVhDsJ9:22 a=cvBusfyB2V15izCimMoJ:22 a=AbAUZ8qAyYyZVLSsDulk:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-11-10_02,2025-11-06_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 suspectscore=0 lowpriorityscore=0 phishscore=0 priorityscore=1501 clxscore=1015 spamscore=0 adultscore=0 impostorscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510240001 definitions=main-2511100041 Add a descriptive string for the AV1 pixel format to v4l_fill_fmtdesc(), enabling proper reporting of AV1 support via VIDIOC_ENUM_FMT. Reviewed-by: Bryan O'Donoghue Reviewed-by: Nicolas Dufresne Signed-off-by: Deepa Guthyappa Madivalara --- drivers/media/v4l2-core/v4l2-ioctl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core= /v4l2-ioctl.c index 01cf52c3ea33e1a01e1b306036ba4e57ef5c95d0..4f4f341c26b0795831dc20941a4= cecc223af7746 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -1542,6 +1542,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt) case V4L2_PIX_FMT_QC10C: descr =3D "QCOM Compressed 10-bit Format"; brea= k; case V4L2_PIX_FMT_AJPG: descr =3D "Aspeed JPEG"; break; case V4L2_PIX_FMT_AV1_FRAME: descr =3D "AV1 Frame"; break; + case V4L2_PIX_FMT_AV1: descr =3D "AV1 OBU Stream"; break; case V4L2_PIX_FMT_MT2110T: descr =3D "Mediatek 10bit Tile Mode"; break; case V4L2_PIX_FMT_MT2110R: descr =3D "Mediatek 10bit Raster Mode"; break; case V4L2_PIX_FMT_HEXTILE: descr =3D "Hextile Compressed Format"; break; --=20 2.34.1 From nobody Mon Feb 9 15:21:05 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6D857278E47 for ; Mon, 10 Nov 2025 05:05:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762751136; cv=none; b=MeL+h3tfJt7dU9NvELH625eHlWYi876wtUxVK3cZTkQC5VpJqcy5PRl4D/XaDDxboKrSudxdBOGfEady/yQ+TMmOtJDo8oSPdTWyiNqIOfwYJCXTxL3C2DWJdD82Zp0aIdZmxdOr/wCIuzSsssb1mnB14ktjne0Grxi1KDqhELw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762751136; c=relaxed/simple; bh=MTKetGDUq1hSPczV9Qy+a8LoeThZE8micx/Gu1Kgh0U=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=phwfF81OJe8xH4NaSb8fClHcUfq5fXsoIp1LWRtVZRxC0amHmbwS/cQMySaY5kVXnvqnkTpnIKA/rCMP5seIyNJLJ82B+VucUBi5iFxwE496vmTd6J8p7kSxFRhSUkxRcurJf09EEd50199DPT2rfEq3IqshXZSnxvrBw0lPIRI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=j0gFEc4I; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=XyEW7Bz/; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="j0gFEc4I"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="XyEW7Bz/" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5A9MRJhc1799077 for ; Mon, 10 Nov 2025 05:05:33 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 0mNABpArBU95Q1JsMouDjK7QLqD19zV1Nh48KrC1tb4=; b=j0gFEc4IiqFwEJAN MRKzBfLXiwtl804EGkQ8oy7Z2YNJjri2r7Trb1FQxugvGYE6rn7AOOzTrTMA5our Usg+b1e1vGEsVEad76lxu/A2rsPTW7HXPAbSrfcjJvNr9C19YAbRJ+FTPcltZW1e BpuIYMMuqirYuhnk8xlk3w0lLLi8T2upFJNjt/Bjz+uCh5IkRpkSCtrZGJ3CWkhK hP7hb2B42vIHe9mNmlx96gZu62zNH4mrFzH0d/G12saLeI8hGeEspMFf1MCstFsc FLm++qi/ns/niF4+U1gkfReptUcNqr/n3Jn9QJw3AAxJ6F162+h+8oqo5aORFKIe eTQMtA== Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com [209.85.216.69]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4a9xuekdhn-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 10 Nov 2025 05:05:32 +0000 (GMT) Received: by mail-pj1-f69.google.com with SMTP id 98e67ed59e1d1-340ec9b90faso937819a91.3 for ; Sun, 09 Nov 2025 21:05:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1762751132; x=1763355932; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=0mNABpArBU95Q1JsMouDjK7QLqD19zV1Nh48KrC1tb4=; b=XyEW7Bz/7KBd+7QW9E5CDCh3zgyzMBOjffRYiGUEeuvLVAofu8DXCX/LRggGPbY+gW +OVjXyeFRDEXxIl0++lm7MM4o0opKKPjaBB6LaLMGhHGD3pQIZyMygOMYWfiVQOXj7it 8xXGtu5MSJ5hZBLbogBrTRfbsPlMfroUctPt9zRBMT8i4sNndGxV+mxV9vUIQdXqAysg z+9DRaNlzbsInJlabxPVgci6Gdm47lGBm6HR0ZWUZSwLCYAqD9KieP6kgMvFAHR0xTB3 dU/r8eWSx/z8jQwPgPfNaI5/ecRGlzzbL+5WUUCdcmjmEI7JlbNk0UJoacvH7CDOo1Cb YjRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762751132; x=1763355932; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=0mNABpArBU95Q1JsMouDjK7QLqD19zV1Nh48KrC1tb4=; b=ervJfryJkgZL4zrFRnLSSWLa2uOIRy/VCPdkb/Tm6QztkzZvo/ERrFCVMY0x8Age5+ vT2CbhnlPz4d+ste2EyVdP13YLx+TlIrnJM6bG25idPPhvHPfAEswqQRKLssEAKHey7P XRNL1KrFsg5Fnt0gVVLMh7adCbmOFG10nFezLDzGvWja/zEk7Cup6QGGP7Pdx3ekkD+U xNXz4bqyWlXtwQPHmVtD7XAH14X57QVwMF9BSTdzlCyrJMgHeZnvx44NpbMrkAiz9Rq6 y5xl6Ap0c0PMmr15hvbtcB2cctOTReJ+eXEMQmbfOS9Z65Xy11t0qGd6amPfxUSMsiaF 7RPw== X-Forwarded-Encrypted: i=1; AJvYcCWg0V7lUj2EvCELQG0SMqSunfoEh5EU1bydmGQ4DBiwfJ069p21l0DfshfC4bUBrZogtsCiobj1rM0lB+4=@vger.kernel.org X-Gm-Message-State: AOJu0Yzu4QaVSK54h2zzYw6bPyePM46lIITOLU4gECEwFCNLsP6ypkmV IucXYRD7Q2kEl0goPOrzIQsmy1sxznESSYmnkJRImaJxavScU7t1Yu/uZm2BhpjmBrsZl5t7OLJ VJ6XUU1QcbjiC3kNMaE+ygJdaVoDAoAayy93TMcf8YrItvssn2frOXRDZVEPzhtswdtk= X-Gm-Gg: ASbGnctwqXrPUM4Itt6fhdFt+n8HAs7cIQVC5lQ+YFPhph8z113xnNBvMqtJDn92/MT vY66xX4EgUDW2EpQdU/9+Y1cRJREzdS8uvQpkYOlyYyPUoG+1ARe6hcb/aEIcOXRYjnzj1wZIvK 2WJTsCwNY5+rI8e7Ogl94Xjijz42XgrTTNOmjg7ifUs3xjn+on7jFBIUfMtUNA94yRxBqxR4nID YZtcSK9DiJKUfr+KShktbCm1rjbzeQGvPxenL8Ch9LU/qtaJJjdYgTfjCBO2EQMdZ/eVoLgitbr dt2Z7h+ErG/0pqpbBf94DNkpfl7BR6F4tLfXzycTLrNiOkLXsCVnFqyMliXm3O2mHdg1+KW4BTO eay5WwghEMQel2nJmrR2urN/SA00J2ftSHIrWsPfKak7RKEeiwMiJKjNnaJU= X-Received: by 2002:a17:90b:4a51:b0:338:3156:fc3f with SMTP id 98e67ed59e1d1-3436cbdb47fmr5137795a91.4.1762751131880; Sun, 09 Nov 2025 21:05:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IG5gC0B90Z5BNAfnYo1/wX7tkdjrMYt6DqcmorXIOLqeMwlvAZprV83hhtfOUGQi6rFoNywgQ== X-Received: by 2002:a17:90b:4a51:b0:338:3156:fc3f with SMTP id 98e67ed59e1d1-3436cbdb47fmr5137783a91.4.1762751131406; Sun, 09 Nov 2025 21:05:31 -0800 (PST) Received: from gu-dmadival-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-343705c1354sm5913748a91.18.2025.11.09.21.05.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Nov 2025 21:05:31 -0800 (PST) From: Deepa Guthyappa Madivalara Date: Sun, 09 Nov 2025 21:05:17 -0800 Subject: [PATCH v6 3/5] media: iris: Add support for AV1 format in iris decoder Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251109-av1d_stateful_v3-v6-3-4a9bde86025a@oss.qualcomm.com> References: <20251109-av1d_stateful_v3-v6-0-4a9bde86025a@oss.qualcomm.com> In-Reply-To: <20251109-av1d_stateful_v3-v6-0-4a9bde86025a@oss.qualcomm.com> To: Mauro Carvalho Chehab , Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, kernel test robot , Deepa Guthyappa Madivalara , Bryan O'Donoghue X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1762751127; l=7851; i=deepa.madivalara@oss.qualcomm.com; s=20250814; h=from:subject:message-id; bh=MTKetGDUq1hSPczV9Qy+a8LoeThZE8micx/Gu1Kgh0U=; b=Zxav/k5fMjUthxz6Zefc36Dy82EwTZdtkOecvJkiSgkgPZL1MfvRF8EweTf4Zcch/hGo7rsmi sOk4iod+EyJDpX69k7Xhj8rFvGbIBEEnYRmY9040jjMxxAM/JDJU9bX X-Developer-Key: i=deepa.madivalara@oss.qualcomm.com; a=ed25519; pk=MOEXgyokievn+bgpHdS6Ixh/KQYyS90z2mqIbQ822FQ= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMTEwMDA0MSBTYWx0ZWRfXzXN1XwjavprJ SPmKWD80jgQrFh82A+Ov2wjJvRECD9sZWbrprNT8HdgJ9gZ708f4zaKpSDFjKsOhuDqZHAmDDkD xKgfIw2zNj6inhQLRawfwWr68bi0z4TLn2Asqi66wct4ZdNKEEOThk4pEYFTgnmNT4bIcwh4jWp YBDzDyQbAzb5b/g1vnNL0MuXvz/iA9fLdqGthEE2C8TCxwzrUUXseicPEp+Ubnps4AwkgIiArYG jPdEumw8UVbHXTPyC/JWuKb9rljLBlJJiwL8qMmMT7ij05xTMTFk4V7hR6jh9A5YnqC5z6DBJrj FVI5VhTHl7Q1Uj/Z9JAv2skbDEl5mw84J1oTw1D/kpRA5SyxW+CCDZc1XNgK8uIe34L7n7nkZ8r X/A0MQkupxrb0u8wMwboeHs0ahtjZQ== X-Proofpoint-GUID: sSQ_T78W2Y02dthI7xheykhl901T001G X-Proofpoint-ORIG-GUID: sSQ_T78W2Y02dthI7xheykhl901T001G X-Authority-Analysis: v=2.4 cv=BOK+bVQG c=1 sm=1 tr=0 ts=6911729d cx=c_pps a=vVfyC5vLCtgYJKYeQD43oA==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=IkcTkHD0fZMA:10 a=6UeiqGixMTsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=KKAkSRfTAAAA:8 a=EUspDBNiAAAA:8 a=Dfn2-qcXI_AzomQv4o8A:9 a=QEXdDO2ut3YA:10 a=rl5im9kqc5Lf4LNbBjHf:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-11-10_02,2025-11-06_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 bulkscore=0 adultscore=0 clxscore=1015 suspectscore=0 priorityscore=1501 spamscore=0 malwarescore=0 phishscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510240001 definitions=main-2511100041 Extend iris decoder driver to support format V4L2_PIX_FMT_AV1. This change updates the format enumeration (VIDIOC_ENUM_FMT) and allows setting AV1 format via VIDIOC_S_FMT for gen2 and beyond. Gen1 iris hardware decoder does not support AV1 format. Reviewed-by: Bryan O'Donoghue Reviewed-by: Dikshita Agarwal Signed-off-by: Deepa Guthyappa Madivalara --- .../platform/qcom/iris/iris_hfi_gen2_defines.h | 1 + drivers/media/platform/qcom/iris/iris_instance.h | 1 + .../platform/qcom/iris/iris_platform_common.h | 2 ++ .../media/platform/qcom/iris/iris_platform_gen2.c | 23 ++++++++++++++++++= ++++ .../platform/qcom/iris/iris_platform_sm8250.c | 18 +++++++++++++++++ drivers/media/platform/qcom/iris/iris_vdec.c | 23 ++++--------------= ---- 6 files changed, 49 insertions(+), 19 deletions(-) diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_defines.h b/dri= vers/media/platform/qcom/iris/iris_hfi_gen2_defines.h index 1b6a4dbac828ffea53c1be0d3624a033c283c972..3d56f257bc5620aacec2bb7e112= 53dc7c83b7db9 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_defines.h +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_defines.h @@ -139,6 +139,7 @@ enum hfi_codec_type { HFI_CODEC_DECODE_HEVC =3D 3, HFI_CODEC_ENCODE_HEVC =3D 4, HFI_CODEC_DECODE_VP9 =3D 5, + HFI_CODEC_DECODE_AV1 =3D 7, }; =20 enum hfi_picture_type { diff --git a/drivers/media/platform/qcom/iris/iris_instance.h b/drivers/med= ia/platform/qcom/iris/iris_instance.h index 62fbb30691ff967212022308fa53ff221fa24ce9..7e4f5f1dd8921c57db039fbd4bc= 2f321891348db 100644 --- a/drivers/media/platform/qcom/iris/iris_instance.h +++ b/drivers/media/platform/qcom/iris/iris_instance.h @@ -19,6 +19,7 @@ enum iris_fmt_type_out { IRIS_FMT_H264, IRIS_FMT_HEVC, IRIS_FMT_VP9, + IRIS_FMT_AV1, }; =20 enum iris_fmt_type_cap { diff --git a/drivers/media/platform/qcom/iris/iris_platform_common.h b/driv= ers/media/platform/qcom/iris/iris_platform_common.h index 58d05e0a112eed25faea027a34c719c89d6c3897..9aca70b4c0690f0d8d799e2a997= 6bd20d6bb8c94 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_common.h +++ b/drivers/media/platform/qcom/iris/iris_platform_common.h @@ -214,6 +214,8 @@ struct iris_platform_data { u64 dma_mask; const char *fwname; u32 pas_id; + struct iris_fmt *inst_iris_fmts; + u32 inst_iris_fmts_size; struct platform_inst_caps *inst_caps; struct platform_inst_fw_cap *inst_fw_caps_dec; u32 inst_fw_caps_dec_size; diff --git a/drivers/media/platform/qcom/iris/iris_platform_gen2.c b/driver= s/media/platform/qcom/iris/iris_platform_gen2.c index 69c952c68e939f305f25511e2e4763487ec8e0de..3b61723dbf27e9ba8d427686e44= cf048a0ab7c5b 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_gen2.c +++ b/drivers/media/platform/qcom/iris/iris_platform_gen2.c @@ -19,6 +19,25 @@ #define VIDEO_ARCH_LX 1 #define BITRATE_MAX 245000000 =20 +static struct iris_fmt platform_fmts_sm8550_dec[] =3D { + [IRIS_FMT_H264] =3D { + .pixfmt =3D V4L2_PIX_FMT_H264, + .type =3D V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, + }, + [IRIS_FMT_HEVC] =3D { + .pixfmt =3D V4L2_PIX_FMT_HEVC, + .type =3D V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, + }, + [IRIS_FMT_VP9] =3D { + .pixfmt =3D V4L2_PIX_FMT_VP9, + .type =3D V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, + }, + [IRIS_FMT_AV1] =3D { + .pixfmt =3D V4L2_PIX_FMT_AV1, + .type =3D V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, + }, +}; + static struct platform_inst_fw_cap inst_fw_cap_sm8550_dec[] =3D { { .cap_id =3D PROFILE_H264, @@ -761,6 +780,8 @@ struct iris_platform_data sm8550_data =3D { .dma_mask =3D 0xe0000000 - 1, .fwname =3D "qcom/vpu/vpu30_p4.mbn", .pas_id =3D IRIS_PAS_ID, + .inst_iris_fmts =3D platform_fmts_sm8550_dec, + .inst_iris_fmts_size =3D ARRAY_SIZE(platform_fmts_sm8550_dec), .inst_caps =3D &platform_inst_cap_sm8550, .inst_fw_caps_dec =3D inst_fw_cap_sm8550_dec, .inst_fw_caps_dec_size =3D ARRAY_SIZE(inst_fw_cap_sm8550_dec), @@ -853,6 +874,8 @@ struct iris_platform_data sm8650_data =3D { .dma_mask =3D 0xe0000000 - 1, .fwname =3D "qcom/vpu/vpu33_p4.mbn", .pas_id =3D IRIS_PAS_ID, + .inst_iris_fmts =3D platform_fmts_sm8550_dec, + .inst_iris_fmts_size =3D ARRAY_SIZE(platform_fmts_sm8550_dec), .inst_caps =3D &platform_inst_cap_sm8550, .inst_fw_caps_dec =3D inst_fw_cap_sm8550_dec, .inst_fw_caps_dec_size =3D ARRAY_SIZE(inst_fw_cap_sm8550_dec), diff --git a/drivers/media/platform/qcom/iris/iris_platform_sm8250.c b/driv= ers/media/platform/qcom/iris/iris_platform_sm8250.c index 16486284f8acccf6a95a27f6003e885226e28f4d..0297756a3724181498ed8e5776d= d5b872f1d4304 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_sm8250.c +++ b/drivers/media/platform/qcom/iris/iris_platform_sm8250.c @@ -11,12 +11,28 @@ #include "iris_hfi_gen1_defines.h" #include "iris_vpu_buffer.h" #include "iris_vpu_common.h" +#include "iris_instance.h" =20 #define BITRATE_MIN 32000 #define BITRATE_MAX 160000000 #define BITRATE_PEAK_DEFAULT (BITRATE_DEFAULT * 2) #define BITRATE_STEP 100 =20 +static struct iris_fmt platform_fmts_sm8250_dec[] =3D { + [IRIS_FMT_H264] =3D { + .pixfmt =3D V4L2_PIX_FMT_H264, + .type =3D V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, + }, + [IRIS_FMT_HEVC] =3D { + .pixfmt =3D V4L2_PIX_FMT_HEVC, + .type =3D V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, + }, + [IRIS_FMT_VP9] =3D { + .pixfmt =3D V4L2_PIX_FMT_VP9, + .type =3D V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, + }, +}; + static struct platform_inst_fw_cap inst_fw_cap_sm8250_dec[] =3D { { .cap_id =3D PIPE, @@ -337,6 +353,8 @@ struct iris_platform_data sm8250_data =3D { .dma_mask =3D 0xe0000000 - 1, .fwname =3D "qcom/vpu-1.0/venus.mbn", .pas_id =3D IRIS_PAS_ID, + .inst_iris_fmts =3D platform_fmts_sm8250_dec, + .inst_iris_fmts_size =3D ARRAY_SIZE(platform_fmts_sm8250_dec), .inst_caps =3D &platform_inst_cap_sm8250, .inst_fw_caps_dec =3D inst_fw_cap_sm8250_dec, .inst_fw_caps_dec_size =3D ARRAY_SIZE(inst_fw_cap_sm8250_dec), diff --git a/drivers/media/platform/qcom/iris/iris_vdec.c b/drivers/media/p= latform/qcom/iris/iris_vdec.c index 69ffe52590d3acf8d595f856fb1dbd81f3073721..bf7b9c621cb7255367c06f144c0= 3c3faa69372e0 100644 --- a/drivers/media/platform/qcom/iris/iris_vdec.c +++ b/drivers/media/platform/qcom/iris/iris_vdec.c @@ -67,21 +67,6 @@ void iris_vdec_inst_deinit(struct iris_inst *inst) kfree(inst->fmt_src); } =20 -static const struct iris_fmt iris_vdec_formats_out[] =3D { - [IRIS_FMT_H264] =3D { - .pixfmt =3D V4L2_PIX_FMT_H264, - .type =3D V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, - }, - [IRIS_FMT_HEVC] =3D { - .pixfmt =3D V4L2_PIX_FMT_HEVC, - .type =3D V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, - }, - [IRIS_FMT_VP9] =3D { - .pixfmt =3D V4L2_PIX_FMT_VP9, - .type =3D V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, - }, -}; - static const struct iris_fmt iris_vdec_formats_cap[] =3D { [IRIS_FMT_NV12] =3D { .pixfmt =3D V4L2_PIX_FMT_NV12, @@ -101,8 +86,8 @@ find_format(struct iris_inst *inst, u32 pixfmt, u32 type) unsigned int i; switch (type) { case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE: - fmt =3D iris_vdec_formats_out; - size =3D ARRAY_SIZE(iris_vdec_formats_out); + fmt =3D inst->core->iris_platform_data->inst_iris_fmts; + size =3D inst->core->iris_platform_data->inst_iris_fmts_size; break; case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE: fmt =3D iris_vdec_formats_cap; @@ -131,8 +116,8 @@ find_format_by_index(struct iris_inst *inst, u32 index,= u32 type) =20 switch (type) { case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE: - fmt =3D iris_vdec_formats_out; - size =3D ARRAY_SIZE(iris_vdec_formats_out); + fmt =3D inst->core->iris_platform_data->inst_iris_fmts; + size =3D inst->core->iris_platform_data->inst_iris_fmts_size; break; case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE: fmt =3D iris_vdec_formats_cap; --=20 2.34.1 From nobody Mon Feb 9 15:21:05 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 47BB62E8DE3 for ; Mon, 10 Nov 2025 05:05:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762751137; cv=none; b=tyXQ5bUQln9/fYubmKhd2LxpT2tbD3PHT2g/z6c85hlv8nmJHq5iBtNe6mQfULwTOpLDxqYy4Vcr0MtebKUCxOPYE4xMKMqLvSJ02E7Fro0LHJdylE8POV8GFNRB7LENN+ZB3gVoBjvCFwweDNkc/G1wwrMUmU1w4Uw8t90HkjE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762751137; c=relaxed/simple; bh=GIq/ALieDHTn0kAp3dCxqYEfnkJvG32eMzAqqCJxPQM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=b/JTKCOL95fI6SW7MpK89Z1zULg177VkKAuswGaN9TxFgl+5I32U2/bjmL2kIBYdZyfMNNhDHNbKBSdn/zxk6ioyc4HSSlPahhyCBOQ7wH5liAJM9D8V13JOnp+m5dPUxO8F47OLlKmwF6KZlLlbJVIrir7Kol6EYl5jUfcTHj8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=kA0jt6ry; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=RN8oTjO6; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="kA0jt6ry"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="RN8oTjO6" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5A9LtG6b1446983 for ; Mon, 10 Nov 2025 05:05:34 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= IzN4CqpgsvylhtI4qECv7V1A8l7g52pVSGdwMJXcnzk=; b=kA0jt6ryaczY/wcT Til03s/AlSXwI93ipQw2X539fQ+5mm/Kh0/bNfnmEojaQqMVYSV5HaNxENSgVBxV bOPxgBd2QGo17IEeEm/jL1gf1fdiDYGrO7Hhm4JlnxELDPxJS2IaVZODtLtrd9We RCnRvD8aK49X1TyuTl8+2IDiag5hqarrPDf6hrs9bj9J8fDZ5BiTribjBjL3a8vi +w1UooBKo/ZFRQwfZEBb5fywRyeo/9r+wOhApp6qh9a2FHMM9HUHQkQpzYHhS3J5 cHhHgKZBA6eCqlw6fdW8ArFZsGKxTzUHZRqPsmFvITgz2+cGECQt9fytcXq7xHAW LSlV+w== Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ab2nxgrsu-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 10 Nov 2025 05:05:34 +0000 (GMT) Received: by mail-pj1-f72.google.com with SMTP id 98e67ed59e1d1-3409d852a5bso1373738a91.3 for ; Sun, 09 Nov 2025 21:05:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1762751133; x=1763355933; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=IzN4CqpgsvylhtI4qECv7V1A8l7g52pVSGdwMJXcnzk=; b=RN8oTjO63tiBCBADqih6eyQCzSTqhcloiw5ACh29HgbQoBFt+RCeinK/Qg9biKmZV0 MPxGyJOWvHkwiPtS8Q1kG/tOr3OXCpS9tz+nxxao91GMXPXpixO1pVlI8J0ixxhCxCec jUrwCkbQMYnh2G16GQgv9+QyYGOYwMj22ENo9Dt7pd+ptluUShqpfcMMRRyJKe17bSdz 2YaIARaMd+qBsQNZ33aq2pk5MgyEmaF7HVyme/2/gW3j5iv2pNUCtPiMVjZLF/KXUgkm E/OFhNDupvQ7k6jWoU+FRBJmrC37BBBY2+MXEFnGD1N2s9ww0NS5yw9YdXFcPB/yHfIl NZeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762751133; x=1763355933; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=IzN4CqpgsvylhtI4qECv7V1A8l7g52pVSGdwMJXcnzk=; b=en2Wn4BS+UKq+Odb6A6dZehoznY0xitqlgYgB4pWmysnJXTnjfRMiZ+0d+a2uMLLw2 R9P2CeGcjCVTxOL6kDCIo1wBNULJYYXe0AFlFN8n5aJ1sFXI3EMyQ1gTfBPNSUqHhOrv j2nZh34ldNjliD/KHTB0KqxAeMTz5SeC+J0mSk9PwLu9SpNWBPGATt2k9KDVCCsvxVan wVBicxzxIjNaxIRW6TzPv32nfkYrcbT7xLcWClVVSEKLjL79RduDg8jTo53olrHO9uqB 3MFG6pd9nfVbrzxJVU+SlFXIGm7zadzWQH9d1TB9cmXqCTXlwVCdLfcfFYvY5v3gaI6E D4bQ== X-Forwarded-Encrypted: i=1; AJvYcCUfdhgjpw8cC1CK7jFrJdR7RxgUwZSlLm8qIadeRtScZT5NYlLVmYCsPFTx7OQ++o4z3dq0HJb9lDaEx4M=@vger.kernel.org X-Gm-Message-State: AOJu0YwjEtJjgtzvUz5TycuAJfFWbFXidnxVXiU/69Bl2D+m0HF5bn5J 1QsM7XtIwAHumNUJE5MDhKskbRPuVnM2fIwyDuJCoJk/ZqHaDp1vD/kho6QKgvnNOGcpUyaewCV UmtDgEALq66OfxW7W2f4TqHD+37Dh5W59jZqrYvfPUwGj7mqNIEJP3rp8c9RHHahbJ/g= X-Gm-Gg: ASbGncsP4YDdPpQC2qIJ4Abs9VG0sqwxfyU60nL2hiJodFTBNUyeLUluYeqRTgf0AbH nOSyyuuG7GeeewqmMyMubCuC2Csex4RX/vzqsJrICbAxZMNvCVbknNFssIYqoTb0OdlPoA1Ty4G 65LkplzBn5PwM+GVtYOLvsp06CugqULYe1TcrcgNnhbexV/dIzHu2Fy9M2YjDxNBVybPanLa+f+ EE+dVeetYJJ3DMABv7SSPJnTy/vQ9cRKa5foJbnJiPT9L2mY6bJTVQEUgq/3I14J7DwW+iQJq1V zKzKViIjJa7bnC4Lc54LMmauqDtbb3UhSZHeTL5cWtHWkYEcqpO3dpiXtp4+ZL9S/cEWs1R+PoF CfY3ukaieFu+dmvTYR/AjwxwBeuFz1cbG1oiQPSg1rowGvpCjMBjh4UNlMs4= X-Received: by 2002:a17:90b:164a:b0:32e:1213:1ec1 with SMTP id 98e67ed59e1d1-3436cb9c0d9mr5190345a91.3.1762751133202; Sun, 09 Nov 2025 21:05:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IEKL3eWvGxjiNgHQgPdXtgYkUf1F7CWL/83pIFFrWgTm+NTNmrNwlp1AeRZeAEJtFhZYRaCzw== X-Received: by 2002:a17:90b:164a:b0:32e:1213:1ec1 with SMTP id 98e67ed59e1d1-3436cb9c0d9mr5190311a91.3.1762751132394; Sun, 09 Nov 2025 21:05:32 -0800 (PST) Received: from gu-dmadival-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-343705c1354sm5913748a91.18.2025.11.09.21.05.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Nov 2025 21:05:32 -0800 (PST) From: Deepa Guthyappa Madivalara Date: Sun, 09 Nov 2025 21:05:18 -0800 Subject: [PATCH v6 4/5] media: iris: Define AV1-specific platform capabilities and properties Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251109-av1d_stateful_v3-v6-4-4a9bde86025a@oss.qualcomm.com> References: <20251109-av1d_stateful_v3-v6-0-4a9bde86025a@oss.qualcomm.com> In-Reply-To: <20251109-av1d_stateful_v3-v6-0-4a9bde86025a@oss.qualcomm.com> To: Mauro Carvalho Chehab , Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, kernel test robot , Deepa Guthyappa Madivalara , Bryan O'Donoghue X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1762751127; l=23025; i=deepa.madivalara@oss.qualcomm.com; s=20250814; h=from:subject:message-id; bh=GIq/ALieDHTn0kAp3dCxqYEfnkJvG32eMzAqqCJxPQM=; b=z9unq0EA8BXDeQIGMpLfpz2vLFa5+HDpmQuynCdU5NUl5MAX1pQitgFhbn0wX3AdVfpC8gZjk rrr3CUTAo8HCWqb1yu8lDhJog4cOxn6NBDCPndZHnpgT4gwOnz4ykn9 X-Developer-Key: i=deepa.madivalara@oss.qualcomm.com; a=ed25519; pk=MOEXgyokievn+bgpHdS6Ixh/KQYyS90z2mqIbQ822FQ= X-Proofpoint-ORIG-GUID: uNPuwnIxlP3wmHnHlCQT93Dcs-wCasnF X-Authority-Analysis: v=2.4 cv=DJSCIiNb c=1 sm=1 tr=0 ts=6911729e cx=c_pps a=RP+M6JBNLl+fLTcSJhASfg==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=IkcTkHD0fZMA:10 a=6UeiqGixMTsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=KKAkSRfTAAAA:8 a=EUspDBNiAAAA:8 a=udLH2Pm8O0Z1g0iT3SAA:9 a=QEXdDO2ut3YA:10 a=iS9zxrgQBfv6-_F4QbHw:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-GUID: uNPuwnIxlP3wmHnHlCQT93Dcs-wCasnF X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMTEwMDA0MSBTYWx0ZWRfX6/JGrTtVyov3 WFSOmbZSWpHcOgC1PYShXu1mc1Yb/LJhT0aiJ8bHGw9I6JcHp5rWl5mB5zsFYX0L8lB2rzqed4e UL79ij1HmuLYHk1KM8l7UB2ZaSJnNr5WfOGWn6Xk8JJA1X/eOlu6DvL7s1490wLvc0R1g2KRYUu 9qq/54T0eiocX77r8ccnYnZT/tX6npSUVdf/dEkqvZT9aGgDB3EZ5rMaN3rQpTrO0sWsx/qIVT6 hwocnzX1rJeBjMW/guv13v5Mt8VirkCr6tUlwq3kOW9HuobNdNviJx9nyW7gsZ68SWsSNZ8rj6a KhikEmWtd3rypVJDYNMOAqHXKorB3iXnhnAumbbszSilPxxjLbAPTYcbQmYnRqDjSpuhctvEW4R b3smD4XNhaAlrPFxwyB6lOu7KkfQIg== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-11-10_02,2025-11-06_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 adultscore=0 spamscore=0 priorityscore=1501 lowpriorityscore=0 malwarescore=0 phishscore=0 impostorscore=0 suspectscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510240001 definitions=main-2511100041 Defining platform specific capabilities specific to AV1 decoder. Set and subscribe to manadatory properties to firmware for AV1. Reviewed-by: Bryan O'Donoghue Reviewed-by: Dikshita Agarwal Signed-off-by: Deepa Guthyappa Madivalara --- drivers/media/platform/qcom/iris/iris_buffer.h | 1 + drivers/media/platform/qcom/iris/iris_ctrls.c | 8 ++ drivers/media/platform/qcom/iris/iris_hfi_common.h | 3 + .../platform/qcom/iris/iris_hfi_gen2_command.c | 85 ++++++++++++++- .../platform/qcom/iris/iris_hfi_gen2_defines.h | 10 +- .../platform/qcom/iris/iris_hfi_gen2_response.c | 22 ++++ .../platform/qcom/iris/iris_platform_common.h | 11 ++ .../media/platform/qcom/iris/iris_platform_gen2.c | 119 +++++++++++++++++= +++- drivers/media/platform/qcom/iris/iris_vidc.c | 1 + 9 files changed, 256 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/qcom/iris/iris_buffer.h b/drivers/media= /platform/qcom/iris/iris_buffer.h index 325d30fce5c99185b61ff989fbfd4de9a56762b2..5ef365d9236c7cbdee24a461478= 9b3191881968b 100644 --- a/drivers/media/platform/qcom/iris/iris_buffer.h +++ b/drivers/media/platform/qcom/iris/iris_buffer.h @@ -42,6 +42,7 @@ enum iris_buffer_type { BUF_SCRATCH_1, BUF_SCRATCH_2, BUF_VPSS, + BUF_PARTIAL, BUF_TYPE_MAX, }; =20 diff --git a/drivers/media/platform/qcom/iris/iris_ctrls.c b/drivers/media/= platform/qcom/iris/iris_ctrls.c index 754a5ad718bc37630bb861012301df7a2e7342a1..620c7e1bd273e25febd8ca70dd1= dcfb0b862692b 100644 --- a/drivers/media/platform/qcom/iris/iris_ctrls.c +++ b/drivers/media/platform/qcom/iris/iris_ctrls.c @@ -98,6 +98,10 @@ static enum platform_inst_fw_cap_type iris_get_cap_id(u3= 2 id) return B_FRAME_QP_H264; case V4L2_CID_MPEG_VIDEO_HEVC_B_FRAME_QP: return B_FRAME_QP_HEVC; + case V4L2_CID_MPEG_VIDEO_AV1_PROFILE: + return PROFILE_AV1; + case V4L2_CID_MPEG_VIDEO_AV1_LEVEL: + return LEVEL_AV1; default: return INST_FW_CAP_MAX; } @@ -185,6 +189,10 @@ static u32 iris_get_v4l2_id(enum platform_inst_fw_cap_= type cap_id) return V4L2_CID_MPEG_VIDEO_H264_B_FRAME_QP; case B_FRAME_QP_HEVC: return V4L2_CID_MPEG_VIDEO_HEVC_B_FRAME_QP; + case PROFILE_AV1: + return V4L2_CID_MPEG_VIDEO_AV1_PROFILE; + case LEVEL_AV1: + return V4L2_CID_MPEG_VIDEO_AV1_LEVEL; default: return 0; } diff --git a/drivers/media/platform/qcom/iris/iris_hfi_common.h b/drivers/m= edia/platform/qcom/iris/iris_hfi_common.h index b51471fb32c70acee44c37f8e9dce0c6bc0b6ccc..3edb5ae582b49bea2e2408c4a5c= fc0a742adc05f 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_common.h +++ b/drivers/media/platform/qcom/iris/iris_hfi_common.h @@ -141,6 +141,9 @@ struct hfi_subscription_params { u32 profile; u32 level; u32 tier; + u32 drap; + u32 film_grain; + u32 super_block; }; =20 u32 iris_hfi_get_v4l2_color_primaries(u32 hfi_primaries); diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c b/dri= vers/media/platform/qcom/iris/iris_hfi_gen2_command.c index 6a772db2ec33fb002d8884753a41dc98b3a8439d..b00594bb3c8871b80a5d7c0e4f4= a84d983fd77e8 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c @@ -10,6 +10,7 @@ =20 #define UNSPECIFIED_COLOR_FORMAT 5 #define NUM_SYS_INIT_PACKETS 8 +#define NUM_COMV_AV1 18 =20 #define SYS_INIT_PKT_SIZE (sizeof(struct iris_hfi_header) + \ NUM_SYS_INIT_PACKETS * (sizeof(struct iris_hfi_packet) + sizeof(u32))) @@ -121,6 +122,7 @@ static u32 iris_hfi_gen2_get_port_from_buf_type(struct = iris_inst *inst, case BUF_COMV: case BUF_NON_COMV: case BUF_LINE: + case BUF_PARTIAL: return HFI_PORT_BITSTREAM; case BUF_OUTPUT: case BUF_DPB: @@ -380,6 +382,9 @@ static int iris_hfi_gen2_set_profile(struct iris_inst *= inst, u32 plane) case V4L2_PIX_FMT_H264: profile =3D inst->fw_caps[PROFILE_H264].value; break; + case V4L2_PIX_FMT_AV1: + profile =3D inst->fw_caps[PROFILE_AV1].value; + break; } =20 inst_hfi_gen2->src_subcr_params.profile =3D profile; @@ -409,6 +414,9 @@ static int iris_hfi_gen2_set_level(struct iris_inst *in= st, u32 plane) case V4L2_PIX_FMT_H264: level =3D inst->fw_caps[LEVEL_H264].value; break; + case V4L2_PIX_FMT_AV1: + level =3D inst->fw_caps[LEVEL_AV1].value; + break; } =20 inst_hfi_gen2->src_subcr_params.level =3D level; @@ -496,10 +504,12 @@ static int iris_hfi_gen2_set_linear_stride_scanline(s= truct iris_inst *inst, u32 =20 static int iris_hfi_gen2_set_tier(struct iris_inst *inst, u32 plane) { - struct iris_inst_hfi_gen2 *inst_hfi_gen2 =3D to_iris_inst_hfi_gen2(inst); u32 port =3D iris_hfi_gen2_get_port(inst, V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLA= NE); + struct iris_inst_hfi_gen2 *inst_hfi_gen2 =3D to_iris_inst_hfi_gen2(inst); u32 tier =3D inst->fw_caps[TIER].value; =20 + tier =3D (inst->codec =3D=3D V4L2_PIX_FMT_AV1) ? inst->fw_caps[TIER_AV1].= value : + inst->fw_caps[TIER].value; inst_hfi_gen2->src_subcr_params.tier =3D tier; =20 return iris_hfi_gen2_session_set_property(inst, @@ -525,6 +535,40 @@ static int iris_hfi_gen2_set_frame_rate(struct iris_in= st *inst, u32 plane) sizeof(u32)); } =20 +static int iris_hfi_gen2_set_film_grain(struct iris_inst *inst, u32 plane) +{ + u32 port =3D iris_hfi_gen2_get_port(inst, V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLA= NE); + struct iris_inst_hfi_gen2 *inst_hfi_gen2 =3D to_iris_inst_hfi_gen2(inst); + u32 film_grain =3D inst->fw_caps[FILM_GRAIN].value; + + inst_hfi_gen2->src_subcr_params.film_grain =3D film_grain; + + return iris_hfi_gen2_session_set_property(inst, + HFI_PROP_AV1_FILM_GRAIN_PRESENT, + HFI_HOST_FLAGS_NONE, + port, + HFI_PAYLOAD_U32_ENUM, + &film_grain, + sizeof(u32)); +} + +static int iris_hfi_gen2_set_super_block(struct iris_inst *inst, u32 plane) +{ + u32 port =3D iris_hfi_gen2_get_port(inst, V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLA= NE); + struct iris_inst_hfi_gen2 *inst_hfi_gen2 =3D to_iris_inst_hfi_gen2(inst); + u32 super_block =3D inst->fw_caps[SUPER_BLOCK].value; + + inst_hfi_gen2->src_subcr_params.super_block =3D super_block; + + return iris_hfi_gen2_session_set_property(inst, + HFI_PROP_AV1_SUPER_BLOCK_ENABLED, + HFI_HOST_FLAGS_NONE, + port, + HFI_PAYLOAD_U32_ENUM, + &super_block, + sizeof(u32)); +} + static int iris_hfi_gen2_session_set_config_params(struct iris_inst *inst,= u32 plane) { const struct iris_platform_data *pdata =3D inst->core->iris_platform_data; @@ -548,6 +592,9 @@ static int iris_hfi_gen2_session_set_config_params(stru= ct iris_inst *inst, u32 p {HFI_PROP_LINEAR_STRIDE_SCANLINE, iris_hfi_gen2_set_linear_stride_sc= anline }, {HFI_PROP_TIER, iris_hfi_gen2_set_tier = }, {HFI_PROP_FRAME_RATE, iris_hfi_gen2_set_frame_rate = }, + {HFI_PROP_AV1_FILM_GRAIN_PRESENT, iris_hfi_gen2_set_film_grain = }, + {HFI_PROP_AV1_SUPER_BLOCK_ENABLED, iris_hfi_gen2_set_super_block = }, + {HFI_PROP_OPB_ENABLE, iris_hfi_gen2_set_opb_enable = }, }; =20 if (inst->domain =3D=3D DECODER) { @@ -561,6 +608,9 @@ static int iris_hfi_gen2_session_set_config_params(stru= ct iris_inst *inst, u32 p } else if (inst->codec =3D=3D V4L2_PIX_FMT_VP9) { config_params =3D pdata->dec_input_config_params_vp9; config_params_size =3D pdata->dec_input_config_params_vp9_size; + } else if (inst->codec =3D=3D V4L2_PIX_FMT_AV1) { + config_params =3D pdata->dec_input_config_params_av1; + config_params_size =3D pdata->dec_input_config_params_av1_size; } else { return -EINVAL; } @@ -615,6 +665,9 @@ static int iris_hfi_gen2_session_set_codec(struct iris_= inst *inst) break; case V4L2_PIX_FMT_VP9: codec =3D HFI_CODEC_DECODE_VP9; + break; + case V4L2_PIX_FMT_AV1: + codec =3D HFI_CODEC_DECODE_AV1; } =20 iris_hfi_gen2_packet_session_property(inst, @@ -780,6 +833,11 @@ static int iris_hfi_gen2_subscribe_change_param(struct= iris_inst *inst, u32 plan change_param_size =3D core->iris_platform_data->dec_input_config_params_vp9_size; break; + case V4L2_PIX_FMT_AV1: + change_param =3D core->iris_platform_data->dec_input_config_params_av1; + change_param_size =3D + core->iris_platform_data->dec_input_config_params_av1_size; + break; } =20 payload[0] =3D HFI_MODE_PORT_SETTINGS_CHANGE; @@ -862,6 +920,16 @@ static int iris_hfi_gen2_subscribe_change_param(struct= iris_inst *inst, u32 plan payload_size =3D sizeof(u32); payload_type =3D HFI_PAYLOAD_U32; break; + case HFI_PROP_AV1_FILM_GRAIN_PRESENT: + payload[0] =3D subsc_params.film_grain; + payload_size =3D sizeof(u32); + payload_type =3D HFI_PAYLOAD_U32; + break; + case HFI_PROP_AV1_SUPER_BLOCK_ENABLED: + payload[0] =3D subsc_params.super_block; + payload_size =3D sizeof(u32); + payload_type =3D HFI_PAYLOAD_U32; + break; default: prop_type =3D 0; ret =3D -EINVAL; @@ -917,6 +985,11 @@ static int iris_hfi_gen2_subscribe_property(struct iri= s_inst *inst, u32 plane) subscribe_prop_size =3D core->iris_platform_data->dec_output_prop_vp9_size; break; + case V4L2_PIX_FMT_AV1: + subcribe_prop =3D core->iris_platform_data->dec_output_prop_av1; + subscribe_prop_size =3D + core->iris_platform_data->dec_output_prop_av1_size; + break; } } =20 @@ -1092,6 +1165,8 @@ static u32 iris_hfi_gen2_buf_type_from_driver(u32 dom= ain, enum iris_buffer_type return HFI_BUFFER_ARP; case BUF_VPSS: return HFI_BUFFER_VPSS; + case BUF_PARTIAL: + return HFI_BUFFER_PARTIAL_DATA; default: return 0; } @@ -1104,7 +1179,13 @@ static int iris_set_num_comv(struct iris_inst *inst) u32 num_comv; =20 caps =3D core->iris_platform_data->inst_caps; - num_comv =3D caps->num_comv; + + /* + * AV1 needs more comv buffers than other codecs. + * Update accordingly. + */ + num_comv =3D (inst->codec =3D=3D V4L2_PIX_FMT_AV1) ? + NUM_COMV_AV1 : caps->num_comv; =20 return core->hfi_ops->session_set_property(inst, HFI_PROP_COMV_BUFFER_COUNT, diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_defines.h b/dri= vers/media/platform/qcom/iris/iris_hfi_gen2_defines.h index 3d56f257bc5620aacec2bb7e11253dc7c83b7db9..12b4c6517bf094e3e98332a1b2b= 70ac5a349b863 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_defines.h +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_defines.h @@ -89,10 +89,18 @@ enum hfi_seq_header_mode { #define HFI_PROP_DEC_START_FROM_RAP_FRAME 0x03000169 #define HFI_PROP_NO_OUTPUT 0x0300016a #define HFI_PROP_BUFFER_MARK 0x0300016c +#define HFI_PROP_WORST_COMPRESSION_RATIO 0x03000174 +#define HFI_PROP_WORST_COMPLEXITY_FACTOR 0x03000175 #define HFI_PROP_RAW_RESOLUTION 0x03000178 #define HFI_PROP_TOTAL_PEAK_BITRATE 0x0300017C -#define HFI_PROP_OPB_ENABLE 0x03000184 +#define HFI_PROP_AV1_FILM_GRAIN_PRESENT 0x03000180 +#define HFI_PROP_AV1_SUPER_BLOCK_ENABLED 0x03000181 +#define HFI_PROP_AV1_OP_POINT 0x03000182 +#define HFI_PROP_OPB_ENABLE 0x03000184 +#define HFI_PROP_AV1_TILE_ROWS_COLUMNS 0x03000187 +#define HFI_PROP_AV1_DRAP_CONFIG 0x03000189 #define HFI_PROP_COMV_BUFFER_COUNT 0x03000193 +#define HFI_PROP_AV1_UNIFORM_TILE_SPACING 0x03000197 #define HFI_PROP_END 0x03FFFFFF =20 #define HFI_SESSION_ERROR_BEGIN 0x04000000 diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c b/dr= ivers/media/platform/qcom/iris/iris_hfi_gen2_response.c index 2f1f118eae4f6462ab1aa1d16844b34e6e699f1e..eb3373f0ad4a1b26fb847db0244= 9ec8d8cb3bdbb 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c @@ -54,6 +54,8 @@ static u32 iris_hfi_gen2_buf_type_to_driver(struct iris_i= nst *inst, return BUF_SCRATCH_2; case HFI_BUFFER_PERSIST: return BUF_PERSIST; + case HFI_BUFFER_PARTIAL_DATA: + return BUF_PARTIAL; default: return 0; } @@ -72,6 +74,7 @@ static bool iris_hfi_gen2_is_valid_hfi_buffer_type(u32 bu= ffer_type) case HFI_BUFFER_DPB: case HFI_BUFFER_PERSIST: case HFI_BUFFER_VPSS: + case HFI_BUFFER_PARTIAL_DATA: return true; default: return false; @@ -596,6 +599,10 @@ static void iris_hfi_gen2_read_input_subcr_params(stru= ct iris_inst *inst) inst->fw_caps[PROFILE_H264].value =3D subsc_params.profile; inst->fw_caps[LEVEL_H264].value =3D subsc_params.level; break; + case V4L2_PIX_FMT_AV1: + inst->fw_caps[PROFILE_AV1].value =3D subsc_params.profile; + inst->fw_caps[LEVEL_AV1].value =3D subsc_params.level; + break; } =20 inst->fw_caps[POC].value =3D subsc_params.pic_order_cnt; @@ -608,6 +615,11 @@ static void iris_hfi_gen2_read_input_subcr_params(stru= ct iris_inst *inst) iris_inst_change_state(inst, IRIS_INST_ERROR); } =20 + if (inst->codec =3D=3D V4L2_PIX_FMT_AV1) { + inst->fw_caps[FILM_GRAIN].value =3D subsc_params.film_grain; + inst->fw_caps[SUPER_BLOCK].value =3D subsc_params.super_block; + } + inst->fw_min_count =3D subsc_params.fw_min_count; inst->buffers[BUF_OUTPUT].min_count =3D iris_vpu_buf_count(inst, BUF_OUTP= UT); inst->buffers[BUF_OUTPUT].size =3D pixmp_op->plane_fmt[0].sizeimage; @@ -711,6 +723,12 @@ static int iris_hfi_gen2_handle_session_property(struc= t iris_inst *inst, case HFI_PROP_NO_OUTPUT: inst_hfi_gen2->hfi_frame_info.no_output =3D 1; break; + case HFI_PROP_AV1_FILM_GRAIN_PRESENT: + inst_hfi_gen2->src_subcr_params.film_grain =3D pkt->payload[0]; + break; + case HFI_PROP_AV1_SUPER_BLOCK_ENABLED: + inst_hfi_gen2->src_subcr_params.super_block =3D pkt->payload[0]; + break; case HFI_PROP_QUALITY_MODE: case HFI_PROP_STAGE: case HFI_PROP_PIPE: @@ -841,6 +859,10 @@ static void iris_hfi_gen2_init_src_change_param(struct= iris_inst *inst) subsc_params->profile =3D inst->fw_caps[PROFILE_H264].value; subsc_params->level =3D inst->fw_caps[LEVEL_H264].value; break; + case V4L2_PIX_FMT_AV1: + subsc_params->profile =3D inst->fw_caps[PROFILE_AV1].value; + subsc_params->level =3D inst->fw_caps[LEVEL_AV1].value; + break; } =20 subsc_params->pic_order_cnt =3D inst->fw_caps[POC].value; diff --git a/drivers/media/platform/qcom/iris/iris_platform_common.h b/driv= ers/media/platform/qcom/iris/iris_platform_common.h index 9aca70b4c0690f0d8d799e2a9976bd20d6bb8c94..9b9eccc639338e617ee859993de= 5efa0fce6ae74 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_common.h +++ b/drivers/media/platform/qcom/iris/iris_platform_common.h @@ -100,6 +100,13 @@ enum platform_inst_fw_cap_type { LEVEL_H264, LEVEL_HEVC, LEVEL_VP9, + PROFILE_AV1, + LEVEL_AV1, + TIER_AV1, + DRAP, + FILM_GRAIN, + SUPER_BLOCK, + ENH_LAYER_COUNT, INPUT_BUF_HOST_MAX_COUNT, OUTPUT_BUF_HOST_MAX_COUNT, STAGE, @@ -237,6 +244,8 @@ struct iris_platform_data { unsigned int dec_input_config_params_hevc_size; const u32 *dec_input_config_params_vp9; unsigned int dec_input_config_params_vp9_size; + const u32 *dec_input_config_params_av1; + unsigned int dec_input_config_params_av1_size; const u32 *dec_output_config_params; unsigned int dec_output_config_params_size; const u32 *enc_input_config_params; @@ -251,6 +260,8 @@ struct iris_platform_data { unsigned int dec_output_prop_hevc_size; const u32 *dec_output_prop_vp9; unsigned int dec_output_prop_vp9_size; + const u32 *dec_output_prop_av1; + unsigned int dec_output_prop_av1_size; const u32 *dec_ip_int_buf_tbl; unsigned int dec_ip_int_buf_tbl_size; const u32 *dec_op_int_buf_tbl; diff --git a/drivers/media/platform/qcom/iris/iris_platform_gen2.c b/driver= s/media/platform/qcom/iris/iris_platform_gen2.c index 3b61723dbf27e9ba8d427686e44cf048a0ab7c5b..58ef29bc31aa8b907a09b770874= 75a34b77e9654 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_gen2.c +++ b/drivers/media/platform/qcom/iris/iris_platform_gen2.c @@ -64,6 +64,16 @@ static struct platform_inst_fw_cap inst_fw_cap_sm8550_de= c[] =3D { .flags =3D CAP_FLAG_OUTPUT_PORT | CAP_FLAG_MENU, .set =3D iris_set_u32_enum, }, + { + .cap_id =3D PROFILE_AV1, + .min =3D V4L2_MPEG_VIDEO_AV1_PROFILE_MAIN, + .max =3D V4L2_MPEG_VIDEO_AV1_PROFILE_MAIN, + .step_or_mask =3D BIT(V4L2_MPEG_VIDEO_AV1_PROFILE_MAIN), + .value =3D V4L2_MPEG_VIDEO_AV1_PROFILE_MAIN, + .hfi_id =3D HFI_PROP_PROFILE, + .flags =3D CAP_FLAG_OUTPUT_PORT | CAP_FLAG_MENU, + .set =3D iris_set_u32_enum, + }, { .cap_id =3D PROFILE_VP9, .min =3D V4L2_MPEG_VIDEO_VP9_PROFILE_0, @@ -147,6 +157,33 @@ static struct platform_inst_fw_cap inst_fw_cap_sm8550_= dec[] =3D { .flags =3D CAP_FLAG_OUTPUT_PORT | CAP_FLAG_MENU, .set =3D iris_set_u32_enum, }, + { + .cap_id =3D LEVEL_AV1, + .min =3D V4L2_MPEG_VIDEO_AV1_LEVEL_2_0, + .max =3D V4L2_MPEG_VIDEO_AV1_LEVEL_6_1, + .step_or_mask =3D BIT(V4L2_MPEG_VIDEO_AV1_LEVEL_2_0) | + BIT(V4L2_MPEG_VIDEO_AV1_LEVEL_2_1) | + BIT(V4L2_MPEG_VIDEO_AV1_LEVEL_2_2) | + BIT(V4L2_MPEG_VIDEO_AV1_LEVEL_2_3) | + BIT(V4L2_MPEG_VIDEO_AV1_LEVEL_3_0) | + BIT(V4L2_MPEG_VIDEO_AV1_LEVEL_3_1) | + BIT(V4L2_MPEG_VIDEO_AV1_LEVEL_3_2) | + BIT(V4L2_MPEG_VIDEO_AV1_LEVEL_3_3) | + BIT(V4L2_MPEG_VIDEO_AV1_LEVEL_4_0) | + BIT(V4L2_MPEG_VIDEO_AV1_LEVEL_4_1) | + BIT(V4L2_MPEG_VIDEO_AV1_LEVEL_4_2) | + BIT(V4L2_MPEG_VIDEO_AV1_LEVEL_4_3) | + BIT(V4L2_MPEG_VIDEO_AV1_LEVEL_5_0) | + BIT(V4L2_MPEG_VIDEO_AV1_LEVEL_5_1) | + BIT(V4L2_MPEG_VIDEO_AV1_LEVEL_5_2) | + BIT(V4L2_MPEG_VIDEO_AV1_LEVEL_5_3) | + BIT(V4L2_MPEG_VIDEO_AV1_LEVEL_6_0) | + BIT(V4L2_MPEG_VIDEO_AV1_LEVEL_6_1), + .value =3D V4L2_MPEG_VIDEO_AV1_LEVEL_6_1, + .hfi_id =3D HFI_PROP_LEVEL, + .flags =3D CAP_FLAG_OUTPUT_PORT | CAP_FLAG_MENU, + .set =3D iris_set_u32_enum, + }, { .cap_id =3D TIER, .min =3D V4L2_MPEG_VIDEO_HEVC_TIER_MAIN, @@ -158,6 +195,53 @@ static struct platform_inst_fw_cap inst_fw_cap_sm8550_= dec[] =3D { .flags =3D CAP_FLAG_OUTPUT_PORT | CAP_FLAG_MENU, .set =3D iris_set_u32_enum, }, + { + .cap_id =3D TIER_AV1, + .min =3D 0, + .max =3D 1, + .step_or_mask =3D 1, + .value =3D 0, + .hfi_id =3D HFI_PROP_TIER, + .flags =3D CAP_FLAG_INPUT_PORT, + .set =3D iris_set_u32, + }, + { + .cap_id =3D DRAP, + .min =3D 0, + .max =3D 1, + .step_or_mask =3D 1, + .value =3D 0, + .hfi_id =3D HFI_PROP_AV1_DRAP_CONFIG, + .flags =3D CAP_FLAG_INPUT_PORT, + .set =3D iris_set_u32, + }, + { + .cap_id =3D FILM_GRAIN, + .min =3D 0, + .max =3D 1, + .step_or_mask =3D 1, + .value =3D 0, + .hfi_id =3D HFI_PROP_AV1_FILM_GRAIN_PRESENT, + .flags =3D CAP_FLAG_VOLATILE, + }, + { + .cap_id =3D SUPER_BLOCK, + .min =3D 0, + .max =3D 1, + .step_or_mask =3D 1, + .value =3D 0, + .hfi_id =3D HFI_PROP_AV1_SUPER_BLOCK_ENABLED, + }, + { + .cap_id =3D ENH_LAYER_COUNT, + .min =3D 0, + .max =3D 1, + .step_or_mask =3D 1, + .value =3D 0, + .hfi_id =3D HFI_PROP_AV1_OP_POINT, + .flags =3D CAP_FLAG_INPUT_PORT, + .set =3D iris_set_u32, + }, { .cap_id =3D INPUT_BUF_HOST_MAX_COUNT, .min =3D DEFAULT_MAX_HOST_BUF_COUNT, @@ -701,6 +785,19 @@ static const u32 sm8550_vdec_input_config_param_vp9[] = =3D { HFI_PROP_LEVEL, }; =20 +static const u32 sm8550_vdec_input_config_param_av1[] =3D { + HFI_PROP_BITSTREAM_RESOLUTION, + HFI_PROP_CROP_OFFSETS, + HFI_PROP_LUMA_CHROMA_BIT_DEPTH, + HFI_PROP_BUFFER_FW_MIN_OUTPUT_COUNT, + HFI_PROP_PROFILE, + HFI_PROP_LEVEL, + HFI_PROP_TIER, + HFI_PROP_AV1_FILM_GRAIN_PRESENT, + HFI_PROP_AV1_SUPER_BLOCK_ENABLED, + HFI_PROP_SIGNAL_COLOR_INFO, +}; + static const u32 sm8550_venc_input_config_params[] =3D { HFI_PROP_COLOR_FORMAT, HFI_PROP_RAW_RESOLUTION, @@ -738,11 +835,18 @@ static const u32 sm8550_vdec_subscribe_output_propert= ies_vp9[] =3D { HFI_PROP_PICTURE_TYPE, }; =20 +static const u32 sm8550_vdec_subscribe_output_properties_av1[] =3D { + HFI_PROP_PICTURE_TYPE, + HFI_PROP_WORST_COMPRESSION_RATIO, + HFI_PROP_WORST_COMPLEXITY_FACTOR, +}; + static const u32 sm8550_dec_ip_int_buf_tbl[] =3D { BUF_BIN, BUF_COMV, BUF_NON_COMV, BUF_LINE, + BUF_PARTIAL, }; =20 static const u32 sm8550_dec_op_int_buf_tbl[] =3D { @@ -807,11 +911,14 @@ struct iris_platform_data sm8550_data =3D { sm8550_vdec_input_config_param_vp9, .dec_input_config_params_vp9_size =3D ARRAY_SIZE(sm8550_vdec_input_config_param_vp9), + .dec_input_config_params_av1 =3D + sm8550_vdec_input_config_param_av1, + .dec_input_config_params_av1_size =3D + ARRAY_SIZE(sm8550_vdec_input_config_param_av1), .dec_output_config_params =3D sm8550_vdec_output_config_params, .dec_output_config_params_size =3D ARRAY_SIZE(sm8550_vdec_output_config_params), - .enc_input_config_params =3D sm8550_venc_input_config_params, .enc_input_config_params_size =3D @@ -832,6 +939,9 @@ struct iris_platform_data sm8550_data =3D { .dec_output_prop_vp9 =3D sm8550_vdec_subscribe_output_properties_vp9, .dec_output_prop_vp9_size =3D ARRAY_SIZE(sm8550_vdec_subscribe_output_properties_vp9), + .dec_output_prop_av1 =3D sm8550_vdec_subscribe_output_properties_av1, + .dec_output_prop_av1_size =3D + ARRAY_SIZE(sm8550_vdec_subscribe_output_properties_av1), =20 .dec_ip_int_buf_tbl =3D sm8550_dec_ip_int_buf_tbl, .dec_ip_int_buf_tbl_size =3D ARRAY_SIZE(sm8550_dec_ip_int_buf_tbl), @@ -901,6 +1011,10 @@ struct iris_platform_data sm8650_data =3D { sm8550_vdec_input_config_param_vp9, .dec_input_config_params_vp9_size =3D ARRAY_SIZE(sm8550_vdec_input_config_param_vp9), + .dec_input_config_params_av1 =3D + sm8550_vdec_input_config_param_av1, + .dec_input_config_params_av1_size =3D + ARRAY_SIZE(sm8550_vdec_input_config_param_av1), .dec_output_config_params =3D sm8550_vdec_output_config_params, .dec_output_config_params_size =3D @@ -926,6 +1040,9 @@ struct iris_platform_data sm8650_data =3D { .dec_output_prop_vp9 =3D sm8550_vdec_subscribe_output_properties_vp9, .dec_output_prop_vp9_size =3D ARRAY_SIZE(sm8550_vdec_subscribe_output_properties_vp9), + .dec_output_prop_av1 =3D sm8550_vdec_subscribe_output_properties_av1, + .dec_output_prop_av1_size =3D + ARRAY_SIZE(sm8550_vdec_subscribe_output_properties_av1), =20 .dec_ip_int_buf_tbl =3D sm8550_dec_ip_int_buf_tbl, .dec_ip_int_buf_tbl_size =3D ARRAY_SIZE(sm8550_dec_ip_int_buf_tbl), diff --git a/drivers/media/platform/qcom/iris/iris_vidc.c b/drivers/media/p= latform/qcom/iris/iris_vidc.c index d38d0f6961cd5cb9929e2aecbec7353dcc2d4a7d..05eec18f937a51d3c081d0f98a8= ffa6bbd30d166 100644 --- a/drivers/media/platform/qcom/iris/iris_vidc.c +++ b/drivers/media/platform/qcom/iris/iris_vidc.c @@ -178,6 +178,7 @@ int iris_open(struct file *filp) INIT_LIST_HEAD(&inst->buffers[BUF_SCRATCH_1].list); INIT_LIST_HEAD(&inst->buffers[BUF_SCRATCH_2].list); INIT_LIST_HEAD(&inst->buffers[BUF_VPSS].list); + INIT_LIST_HEAD(&inst->buffers[BUF_PARTIAL].list); init_completion(&inst->completion); init_completion(&inst->flush_completion); =20 --=20 2.34.1 From nobody Mon Feb 9 15:21:05 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AF6BC2EA72A for ; Mon, 10 Nov 2025 05:05:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762751141; cv=none; b=etz3L/j/WfG9hKEb8yqHDztHyrpPqXMUTqmjwc2aQtL9pnzVP/EH2GdTK8SmwZ/ChSmyfaRb3f/aJ+vHFxGOpx0VtvgYI9UJf3A4hNd7VETbOlvAloTo1KAHGHrY3NNKc9T/zPLdlAm84zPokhkgds2MkSeE+CzqiuYXQhotkNI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762751141; c=relaxed/simple; bh=fTkurkuNrJZkDzeoFQ0NTL4A3MjLIBcgXI+/4voJeAQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=KjEI4/dOgmYU7Gcar0MvsTsn2CdEa5SxhF7t4LXIRUM3zFgSn532DrTmQ2kEraLvc2omFGAdJzMcjq4zt+jb2L2P1ztGt8EaU1MbBOzjYvf1GyZ5ahXdCTHRJ/icvFJMvh2vNHgfukiE0MkoI+82CNb2UtYSKhUImoYRUECfyow= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=XVBtR6u1; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=CJv9lS98; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="XVBtR6u1"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="CJv9lS98" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5A9Ko28W1522149 for ; Mon, 10 Nov 2025 05:05:37 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= cEcsYsit1dRgvZ0wf/p/8EfE3Mkov766qHMPRrIP/sY=; b=XVBtR6u1Xqyynnjf 9c/FFyqyFrnkeOFKXJBHWOFAttGacpLOtg1M+StIArIWpyELiFX5M3OLadg8y0U0 5cIoDS0+kEkO1aKIJZqYuADFcU3Pf6K4x7i/YE7iXcUJU5EcilZ8Zl+G602gLSVK q4nNaWzYllNxPIZtXCM5T/f5npIx+JvmUEyMH3D5YX3oKDPQckIJCHfXWjSSiDW4 xRyWQ66VsauAywEDKUJFzaz8r9nt229eQUSpjv2OKUcUyMC+nDR7jr5KfVHpygk0 ee3VgOpNfz/vJKE6lXXIHvc/fuJ0ngh8nPl52kOLS4KiRla3qqZ5oRromtvQ73n+ bIcshQ== Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4a9xvjbe4x-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 10 Nov 2025 05:05:37 +0000 (GMT) Received: by mail-pg1-f200.google.com with SMTP id 41be03b00d2f7-b6cdfb42466so718007a12.0 for ; Sun, 09 Nov 2025 21:05:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1762751136; x=1763355936; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=cEcsYsit1dRgvZ0wf/p/8EfE3Mkov766qHMPRrIP/sY=; b=CJv9lS98xuNIMmRsmi/WWOoeGWwU/YMHBPpIocgyKTAbXu34BVlpZdSG0XFNlXG25H vSsSrsEigdqM9YnL7n1fUu53ca1xGvX6rwy+3M0lkjcKPIFeQywTszQAAfw307s1wNcz dd1wr5uyVr/RDgwzPK98fRbqgc0TWAyqUjDHp5t1Fs1pKqPXEY3eGUDGm12lD3av70s0 GWeUdaay5tcussvdTBMGF1Xd7X65OGFPj12Y5PWlglAm6y4GbqooOF/hLwdlpXy+mWZl A615ymY6nmipkOBQUVS3SNnfLxL8/n5NN4J6cTRLhX/mmEzcRlDyxM+65nJWdKmeT/k7 PLmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762751136; x=1763355936; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=cEcsYsit1dRgvZ0wf/p/8EfE3Mkov766qHMPRrIP/sY=; b=d2IQY7BbBMHsJ/Q9/iFMZRheRLB0pzNAgZA3VHDi5BK3NwLqB0ICs9TvhFxWyHJWFg nbtc+NEoMH/zQgCyNjxKpJrUeCZG9R93T4DEscrKQHkndAqTPL26FHXILVKucljKoe1h RyWjhDdZazsGDE77tLDYSYtDTjCwWVhxtGkx6RbFgjIR0Oocl6Hl4HyRUazQzCKPAdn6 PqgLcgKy/QaRo6ba1656Z2xvRVigURIs+YYGf8RNP+Env7lK3VUJQZnTGCnn7dCvg0UB EThXYYoe4cGPhZ/76dFc6bGx5nlPXG6/sepM9Z9/rQYc7cfKkraKn8qXSGlxLaR5a0Yk lqrg== X-Forwarded-Encrypted: i=1; AJvYcCVC+GUyRSCxBM9tW1pWr/+b2Nn8SgOES/Kjp8qyLZXmtv5aYPlMA9ARhcHf9cQGugDb3T4Zzl0gBjhiTRQ=@vger.kernel.org X-Gm-Message-State: AOJu0YzKTOPzBZNsIHJuaMGkoXHjrJINLca9h06AbTGIgy6f5U9L/maD +R/vjMwodY7lQB6FUs2UJXBZ+PlATdbM9mcOIpe2t0pEm9InGQWHZUk6sTuvJBym8Vg8nDfFOGi nQS9696SujbzhW290tzl9IorOpw02IL2x88FjUYUiS6osouzkNzPznSP+H4Sht+TK5YI= X-Gm-Gg: ASbGnctfPEXv7Y7cRNojYKm4q4y4866yRBk4lRqZiQse+0A/IIvn9FKVZ7qKncRkpXj PfkHaIqo7t1fPJDglfxmCSdIRVv7jaxQNm5CQBm9vA9meeJvVv8S0NSObF2yRnQRXYT9NU32UZ/ 0aVskLBU9Y/GKbeCbBV3bUXcBUXa0K85M6Gtjv263tDHxg2M9R9+194Ec1YOsDNEZie7A9bmvHt 7t7dANpn/4JpcueRADA3DDB+UvcZJjaBGZydy0oWqTi1KJYv54x/kjMp0XlN6gRHhCy+KUWn/FF wGWMp83tN+d6UzqBKGYBRJgVGGxeBATx83uav+K/5sw82JiYfW/fH2HMOFqFZ3Unv1ESSst3WuW Ww6m97aWiEDPx/rSjfxp/M86oUW2a9Kp4W3FxuGXosgMh9jfQQRj1b+HSeYE= X-Received: by 2002:a17:90b:4f46:b0:340:5834:39ad with SMTP id 98e67ed59e1d1-3436cd1c091mr5061138a91.7.1762751133996; Sun, 09 Nov 2025 21:05:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IGz2W1qyl2zS8UCNlQihsX5D5bEAzHgN6r+J0KQz9nETG9KgW018FWF6hhGUfS5P1V70gijcQ== X-Received: by 2002:a17:90b:4f46:b0:340:5834:39ad with SMTP id 98e67ed59e1d1-3436cd1c091mr5061116a91.7.1762751133387; Sun, 09 Nov 2025 21:05:33 -0800 (PST) Received: from gu-dmadival-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-343705c1354sm5913748a91.18.2025.11.09.21.05.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Nov 2025 21:05:33 -0800 (PST) From: Deepa Guthyappa Madivalara Date: Sun, 09 Nov 2025 21:05:19 -0800 Subject: [PATCH v6 5/5] media: iris: Add internal buffer calculation for AV1 decoder Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251109-av1d_stateful_v3-v6-5-4a9bde86025a@oss.qualcomm.com> References: <20251109-av1d_stateful_v3-v6-0-4a9bde86025a@oss.qualcomm.com> In-Reply-To: <20251109-av1d_stateful_v3-v6-0-4a9bde86025a@oss.qualcomm.com> To: Mauro Carvalho Chehab , Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, kernel test robot , Deepa Guthyappa Madivalara X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1762751127; l=23772; i=deepa.madivalara@oss.qualcomm.com; s=20250814; h=from:subject:message-id; bh=fTkurkuNrJZkDzeoFQ0NTL4A3MjLIBcgXI+/4voJeAQ=; b=4W7u5FK635GxZ5onZWEDU5kx3EBzUpkJKo+pbbAyCsAhDP65Iete9yvrKUgFhysspLGpGs6t4 368XYl4oGbbDhG4Ouxv8bJTCNnAiPcud/SKQ8GzqMzdkrHHaWodHHw+ X-Developer-Key: i=deepa.madivalara@oss.qualcomm.com; a=ed25519; pk=MOEXgyokievn+bgpHdS6Ixh/KQYyS90z2mqIbQ822FQ= X-Authority-Analysis: v=2.4 cv=QuxTHFyd c=1 sm=1 tr=0 ts=691172a1 cx=c_pps a=oF/VQ+ItUULfLr/lQ2/icg==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=IkcTkHD0fZMA:10 a=6UeiqGixMTsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=3eCS73FKbHPN4UNaIXEA:9 a=QEXdDO2ut3YA:10 a=3WC7DwWrALyhR5TkjVHa:22 X-Proofpoint-ORIG-GUID: pb30LSWre-kT5fxqcflno8WSVu8NfUi- X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMTEwMDA0MSBTYWx0ZWRfXw7I2G4iz+19j RLeGCB/dhT7YeaHj2jseCWgRaJ7fkfOXvGL8a1KY5jpoU42Aqp8AHgVaNDj8MESOaKmZQQie8Sd 4uzzvZxbWBpU3r6CN6dgHp1IXqI0pBYTCXQ8hQIr6wQjCg8Y9cnEBrQcv1sA/SprxB/1X6+EgBs 2ii7OXDh5WflkB6ZR/mGyUjl6eETaFVRQTxaJLkAyVuysw3tQftDLE1aMvTVG9a1BRQQ7mO6cxR JsKNYSOtHWQKxhR6m8hH6Za+qeWnih6SCRhMzMzGs8G9gY3sgyHLiF531rB8L8v47TEUf+nKXoU PxwKbuK7IyNtbqzpRBPfUmwaCcPQD4N9Iixmy+sI6hzwT+iUlB9V+oK+lhyal04HMCQLgiycJ+E lHTfm/g7OO+FqBYF/5yN2AwbVf9mQA== X-Proofpoint-GUID: pb30LSWre-kT5fxqcflno8WSVu8NfUi- X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-11-10_02,2025-11-06_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 clxscore=1015 priorityscore=1501 adultscore=0 phishscore=0 spamscore=0 impostorscore=0 malwarescore=0 lowpriorityscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510240001 definitions=main-2511100041 Implement internal buffer count and size calculations for AV1 decoder for all the buffer types required by the AV1 decoder, including BIN, COMV, PERSIST, LINE, and PARTIAL. This ensures the hardware decoder has properly allocated memory for AV1 decoding operations, enabling correct AV1 video playback. Reviewed-by: Dikshita Agarwal Signed-off-by: Deepa Guthyappa Madivalara --- drivers/media/platform/qcom/iris/iris_buffer.h | 1 + drivers/media/platform/qcom/iris/iris_vpu_buffer.c | 299 +++++++++++++++++= +++- drivers/media/platform/qcom/iris/iris_vpu_buffer.h | 116 ++++++++ 3 files changed, 412 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/qcom/iris/iris_buffer.h b/drivers/media= /platform/qcom/iris/iris_buffer.h index 5ef365d9236c7cbdee24a4614789b3191881968b..75bb767761824c4c02e0df9b765= 896cc093be333 100644 --- a/drivers/media/platform/qcom/iris/iris_buffer.h +++ b/drivers/media/platform/qcom/iris/iris_buffer.h @@ -27,6 +27,7 @@ struct iris_inst; * @BUF_SCRATCH_1: buffer to store decoding/encoding context data for HW * @BUF_SCRATCH_2: buffer to store encoding context data for HW * @BUF_VPSS: buffer to store VPSS context data for HW + * @BUF_PARTIAL: buffer for AV1 IBC data * @BUF_TYPE_MAX: max buffer types */ enum iris_buffer_type { diff --git a/drivers/media/platform/qcom/iris/iris_vpu_buffer.c b/drivers/m= edia/platform/qcom/iris/iris_vpu_buffer.c index 4463be05ce165adef6b152eb0c155d2e6a7b3c36..f4985790bae4104ec5769e2de16= a56727af462ba 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu_buffer.c +++ b/drivers/media/platform/qcom/iris/iris_vpu_buffer.c @@ -9,6 +9,17 @@ #include "iris_hfi_gen2_defines.h" =20 #define HFI_MAX_COL_FRAME 6 +#define HFI_COLOR_FORMAT_YUV420_NV12_UBWC_Y_TILE_HEIGHT (8) +#define HFI_COLOR_FORMAT_YUV420_NV12_UBWC_Y_TILE_WIDTH (32) +#define HFI_COLOR_FORMAT_YUV420_NV12_UBWC_UV_TILE_HEIGHT (8) +#define HFI_COLOR_FORMAT_YUV420_NV12_UBWC_UV_TILE_WIDTH (16) +#define HFI_COLOR_FORMAT_YUV420_TP10_UBWC_Y_TILE_HEIGHT (4) +#define HFI_COLOR_FORMAT_YUV420_TP10_UBWC_Y_TILE_WIDTH (48) +#define HFI_COLOR_FORMAT_YUV420_TP10_UBWC_UV_TILE_HEIGHT (4) +#define HFI_COLOR_FORMAT_YUV420_TP10_UBWC_UV_TILE_WIDTH (24) +#define AV1D_SIZE_BSE_COL_MV_64x64 512 +#define AV1D_SIZE_BSE_COL_MV_128x128 2816 +#define UBWC_TILE_SIZE 256 =20 #ifndef SYSTEM_LAL_TILE10 #define SYSTEM_LAL_TILE10 192 @@ -39,6 +50,31 @@ static u32 hfi_buffer_bin_h264d(u32 frame_width, u32 fra= me_height, u32 num_vpp_p return size_h264d_hw_bin_buffer(n_aligned_w, n_aligned_h, num_vpp_pipes); } =20 +static u32 size_av1d_hw_bin_buffer(u32 frame_width, u32 frame_height, u32 = num_vpp_pipes) +{ + u32 size_yuv, size_bin_hdr, size_bin_res; + + size_yuv =3D ((frame_width * frame_height) <=3D BIN_BUFFER_THRESHOLD) ? + ((BIN_BUFFER_THRESHOLD * 3) >> 1) : + ((frame_width * frame_height * 3) >> 1); + size_bin_hdr =3D size_yuv * AV1_CABAC_HDR_RATIO_HD_TOT; + size_bin_res =3D size_yuv * AV1_CABAC_RES_RATIO_HD_TOT; + size_bin_hdr =3D ALIGN(size_bin_hdr / num_vpp_pipes, + DMA_ALIGNMENT) * num_vpp_pipes; + size_bin_res =3D ALIGN(size_bin_res / num_vpp_pipes, + DMA_ALIGNMENT) * num_vpp_pipes; + + return size_bin_hdr + size_bin_res; +} + +static u32 hfi_buffer_bin_av1d(u32 frame_width, u32 frame_height, u32 num_= vpp_pipes) +{ + u32 n_aligned_h =3D ALIGN(frame_height, 16); + u32 n_aligned_w =3D ALIGN(frame_width, 16); + + return size_av1d_hw_bin_buffer(n_aligned_w, n_aligned_h, num_vpp_pipes); +} + static u32 size_h265d_hw_bin_buffer(u32 frame_width, u32 frame_height, u32= num_vpp_pipes) { u32 product =3D frame_width * frame_height; @@ -110,6 +146,26 @@ static u32 hfi_buffer_comv_h265d(u32 frame_width, u32 = frame_height, u32 _comv_bu return (_size * (_comv_bufcount)) + 512; } =20 +static u32 num_lcu(u32 frame_width, u32 frame_height, u32 lcu_size) +{ + return ((frame_width + lcu_size - 1) / lcu_size) * + ((frame_height + lcu_size - 1) / lcu_size); +} + +static u32 hfi_buffer_comv_av1d(u32 frame_width, u32 frame_height, u32 com= v_bufcount) +{ + u32 size; + + size =3D 2 * ALIGN(max(num_lcu(frame_width, frame_height, 64) * + AV1D_SIZE_BSE_COL_MV_64x64, + num_lcu(frame_width, frame_height, 128) * + AV1D_SIZE_BSE_COL_MV_128x128), + DMA_ALIGNMENT); + size *=3D comv_bufcount; + + return size; +} + static u32 size_h264d_bse_cmd_buf(u32 frame_height) { u32 height =3D ALIGN(frame_height, 32); @@ -122,7 +178,7 @@ static u32 size_h265d_bse_cmd_buf(u32 frame_width, u32 = frame_height) { u32 _size =3D ALIGN(((ALIGN(frame_width, LCU_MAX_SIZE_PELS) / LCU_MIN_SIZ= E_PELS) * (ALIGN(frame_height, LCU_MAX_SIZE_PELS) / LCU_MIN_SIZE_PELS)) * - NUM_HW_PIC_BUF, DMA_ALIGNMENT); + NUM_HW_PIC_BUF, DMA_ALIGNMENT); _size =3D min_t(u32, _size, H265D_MAX_SLICE + 1); _size =3D 2 * _size * SIZE_H265D_BSE_CMD_PER_BUF; =20 @@ -174,6 +230,20 @@ static u32 hfi_buffer_persist_h264d(void) DMA_ALIGNMENT); } =20 +static u32 hfi_buffer_persist_av1d(u32 max_width, u32 max_height, u32 tota= l_ref_count) +{ + u32 comv_size, size; + + comv_size =3D hfi_buffer_comv_av1d(max_width, max_height, total_ref_coun= t); + size =3D ALIGN((SIZE_AV1D_SEQUENCE_HEADER * 2 + SIZE_AV1D_METADATA + + AV1D_NUM_HW_PIC_BUF * (SIZE_AV1D_TILE_OFFSET + SIZE_AV1D_QM) + + AV1D_NUM_FRAME_HEADERS * (SIZE_AV1D_FRAME_HEADER + + 2 * SIZE_AV1D_PROB_TABLE) + comv_size + HDR10_HIST_EXTRADATA_SIZE + + SIZE_AV1D_METADATA * AV1D_NUM_HW_PIC_BUF), DMA_ALIGNMENT); + + return ALIGN(size, DMA_ALIGNMENT); +} + static u32 hfi_buffer_non_comv_h264d(u32 frame_width, u32 frame_height, u3= 2 num_vpp_pipes) { u32 size_bse =3D size_h264d_bse_cmd_buf(frame_height); @@ -459,6 +529,182 @@ static u32 hfi_buffer_line_h264d(u32 frame_width, u32= frame_height, return ALIGN((size + vpss_lb_size), DMA_ALIGNMENT); } =20 +static u32 size_av1d_lb_opb_wr1_nv12_ubwc(u32 frame_width, u32 frame_heigh= t) +{ + u32 size, y_width, y_width_a =3D 128; + + y_width =3D ALIGN(frame_width, y_width_a); + + size =3D ((y_width + HFI_COLOR_FORMAT_YUV420_NV12_UBWC_Y_TILE_WIDTH - 1) / + HFI_COLOR_FORMAT_YUV420_NV12_UBWC_Y_TILE_WIDTH + + (AV1D_MAX_TILE_COLS - 1)); + return size * UBWC_TILE_SIZE; +} + +static u32 size_av1d_lb_opb_wr1_tp10_ubwc(u32 frame_width, u32 frame_heigh= t) +{ + u32 size, y_width, y_width_a =3D 256; + + y_width =3D ALIGN(frame_width, y_width_a); + + size =3D ((y_width + HFI_COLOR_FORMAT_YUV420_TP10_UBWC_Y_TILE_WIDTH - 1) / + HFI_COLOR_FORMAT_YUV420_TP10_UBWC_Y_TILE_WIDTH + + (AV1D_MAX_TILE_COLS - 1)); + + return size * UBWC_TILE_SIZE; +} + +static u32 hfi_buffer_line_av1d(u32 frame_width, u32 frame_height, + bool is_opb, u32 num_vpp_pipes) +{ + u32 size, vpss_lb_size, opbwrbufsize, opbwr8, opbwr10; + + size =3D ALIGN(size_av1d_lb_fe_top_data(frame_width, frame_height), + DMA_ALIGNMENT) + + ALIGN(size_av1d_lb_fe_top_ctrl(frame_width, frame_height), + DMA_ALIGNMENT) + + ALIGN(size_av1d_lb_fe_left_data(frame_width, frame_height), + DMA_ALIGNMENT) * num_vpp_pipes + + ALIGN(size_av1d_lb_fe_left_ctrl(frame_width, frame_height), + DMA_ALIGNMENT) * num_vpp_pipes + + ALIGN(size_av1d_lb_se_left_ctrl(frame_width, frame_height), + DMA_ALIGNMENT) * num_vpp_pipes + + ALIGN(size_av1d_lb_se_top_ctrl(frame_width, frame_height), + DMA_ALIGNMENT) + + ALIGN(size_av1d_lb_pe_top_data(frame_width, frame_height), + DMA_ALIGNMENT) + + ALIGN(size_av1d_lb_vsp_top(frame_width, frame_height), + DMA_ALIGNMENT) + + ALIGN(size_av1d_lb_recon_dma_metadata_wr + (frame_width, frame_height), DMA_ALIGNMENT) * 2 + + ALIGN(size_av1d_qp(frame_width, frame_height), DMA_ALIGNMENT); + opbwr8 =3D size_av1d_lb_opb_wr1_nv12_ubwc(frame_width, frame_height); + opbwr10 =3D size_av1d_lb_opb_wr1_tp10_ubwc(frame_width, frame_height); + opbwrbufsize =3D opbwr8 >=3D opbwr10 ? opbwr8 : opbwr10; + size =3D ALIGN((size + opbwrbufsize), DMA_ALIGNMENT); + if (is_opb) { + vpss_lb_size =3D size_vpss_lb(frame_width, frame_height); + size =3D ALIGN((size + vpss_lb_size) * 2, DMA_ALIGNMENT); + } + + return size; +} + +static u32 size_av1d_ibc_nv12_ubwc(u32 frame_width, u32 frame_height) +{ + u32 size; + u32 y_width_a =3D 128, y_height_a =3D 32; + u32 uv_width_a =3D 128, uv_height_a =3D 32; + u32 ybufsize, uvbufsize, y_width, y_height, uv_width, uv_height; + u32 y_meta_width_a =3D 64, y_meta_height_a =3D 16; + u32 uv_meta_width_a =3D 64, uv_meta_height_a =3D 16; + u32 meta_height, meta_stride, meta_size; + u32 tile_width_y =3D HFI_COLOR_FORMAT_YUV420_NV12_UBWC_Y_TILE_WIDTH; + u32 tile_height_y =3D HFI_COLOR_FORMAT_YUV420_NV12_UBWC_Y_TILE_HEIGHT; + u32 tile_width_uv =3D HFI_COLOR_FORMAT_YUV420_NV12_UBWC_UV_TILE_WIDTH; + u32 tile_height_uv =3D HFI_COLOR_FORMAT_YUV420_NV12_UBWC_UV_TILE_HEIGHT; + + y_width =3D ALIGN(frame_width, y_width_a); + y_height =3D ALIGN(frame_height, y_height_a); + uv_width =3D ALIGN(frame_width, uv_width_a); + uv_height =3D ALIGN(((frame_height + 1) >> 1), uv_height_a); + ybufsize =3D ALIGN((y_width * y_height), HFI_ALIGNMENT_4096); + uvbufsize =3D ALIGN(uv_width * uv_height, HFI_ALIGNMENT_4096); + size =3D ybufsize + uvbufsize; + meta_stride =3D ALIGN(((frame_width + (tile_width_y - 1)) / tile_width_y), + y_meta_width_a); + meta_height =3D ALIGN(((frame_height + (tile_height_y - 1)) / tile_height= _y), + y_meta_height_a); + meta_size =3D ALIGN(meta_stride * meta_height, HFI_ALIGNMENT_4096); + size +=3D meta_size; + meta_stride =3D ALIGN(((((frame_width + 1) >> 1) + (tile_width_uv - 1)) / + tile_width_uv), uv_meta_width_a); + meta_height =3D ALIGN(((((frame_height + 1) >> 1) + (tile_height_uv - 1))= / + tile_height_uv), uv_meta_height_a); + meta_size =3D ALIGN(meta_stride * meta_height, HFI_ALIGNMENT_4096); + size +=3D meta_size; + + return size; +} + +static u32 hfi_yuv420_tp10_calc_y_stride(u32 frame_width, u32 stride_multi= ple) +{ + u32 stride; + + stride =3D ALIGN(frame_width, 192); + stride =3D ALIGN(stride * 4 / 3, stride_multiple); + + return stride; +} + +static u32 hfi_yuv420_tp10_calc_y_bufheight(u32 frame_height, u32 min_buf_= height_multiple) +{ + return ALIGN(frame_height, min_buf_height_multiple); +} + +static u32 hfi_yuv420_tp10_calc_uv_stride(u32 frame_width, u32 stride_mult= iple) +{ + u32 stride; + + stride =3D ALIGN(frame_width, 192); + stride =3D ALIGN(stride * 4 / 3, stride_multiple); + + return stride; +} + +static u32 hfi_yuv420_tp10_calc_uv_bufheight(u32 frame_height, u32 min_buf= _height_multiple) +{ + return ALIGN(((frame_height + 1) >> 1), min_buf_height_multiple); +} + +static u32 size_av1d_ibc_tp10_ubwc(u32 frame_width, u32 frame_height) +{ + u32 size; + u32 y_width_a =3D 256, y_height_a =3D 16, + uv_width_a =3D 256, uv_height_a =3D 16; + u32 ybufsize, uvbufsize, y_width, y_height, uv_width, uv_height; + u32 y_meta_width_a =3D 64, y_meta_height_a =3D 16, + uv_meta_width_a =3D 64, uv_meta_height_a =3D 16; + u32 meta_height, meta_stride, meta_size; + u32 tile_width_y =3D HFI_COLOR_FORMAT_YUV420_TP10_UBWC_Y_TILE_WIDTH; + u32 tile_height_y =3D HFI_COLOR_FORMAT_YUV420_TP10_UBWC_Y_TILE_HEIGHT; + u32 tile_width_uv =3D HFI_COLOR_FORMAT_YUV420_TP10_UBWC_UV_TILE_WIDTH; + u32 tile_height_uv =3D HFI_COLOR_FORMAT_YUV420_TP10_UBWC_UV_TILE_HEIGHT; + + y_width =3D hfi_yuv420_tp10_calc_y_stride(frame_width, y_width_a); + y_height =3D hfi_yuv420_tp10_calc_y_bufheight(frame_height, y_height_a); + uv_width =3D hfi_yuv420_tp10_calc_uv_stride(frame_width, uv_width_a); + uv_height =3D hfi_yuv420_tp10_calc_uv_bufheight(frame_height, uv_height_a= ); + ybufsize =3D ALIGN(y_width * y_height, HFI_ALIGNMENT_4096); + uvbufsize =3D ALIGN(uv_width * uv_height, HFI_ALIGNMENT_4096); + size =3D ybufsize + uvbufsize; + meta_stride =3D ALIGN(((frame_width + (tile_width_y - 1)) / tile_width_y), + y_meta_width_a); + meta_height =3D ALIGN(((frame_height + (tile_height_y - 1)) / tile_height= _y), + y_meta_height_a); + meta_size =3D ALIGN(meta_stride * meta_height, HFI_ALIGNMENT_4096); + size +=3D meta_size; + meta_stride =3D ALIGN(((((frame_width + 1) >> 1) + (tile_width_uv - 1)) / + tile_width_uv), uv_meta_width_a); + meta_height =3D ALIGN(((((frame_height + 1) >> 1) + (tile_height_uv - 1))= / + tile_height_uv), uv_meta_height_a); + meta_size =3D ALIGN(meta_stride * meta_height, HFI_ALIGNMENT_4096); + size +=3D meta_size; + + return size; +} + +static u32 hfi_buffer_ibc_av1d(u32 frame_width, u32 frame_height) +{ + u32 size, ibc8, ibc10; + + ibc8 =3D size_av1d_ibc_nv12_ubwc(frame_width, frame_height); + ibc10 =3D size_av1d_ibc_tp10_ubwc(frame_width, frame_height); + size =3D ibc8 >=3D ibc10 ? ibc8 : ibc10; + + return ALIGN(size, DMA_ALIGNMENT); +} + static u32 iris_vpu_dec_bin_size(struct iris_inst *inst) { u32 num_vpp_pipes =3D inst->core->iris_platform_data->num_vpp_pipe; @@ -472,6 +718,8 @@ static u32 iris_vpu_dec_bin_size(struct iris_inst *inst) return hfi_buffer_bin_h265d(width, height, num_vpp_pipes); else if (inst->codec =3D=3D V4L2_PIX_FMT_VP9) return hfi_buffer_bin_vp9d(width, height, num_vpp_pipes); + else if (inst->codec =3D=3D V4L2_PIX_FMT_AV1) + return hfi_buffer_bin_av1d(width, height, num_vpp_pipes); =20 return 0; } @@ -487,18 +735,34 @@ static u32 iris_vpu_dec_comv_size(struct iris_inst *i= nst) return hfi_buffer_comv_h264d(width, height, num_comv); else if (inst->codec =3D=3D V4L2_PIX_FMT_HEVC) return hfi_buffer_comv_h265d(width, height, num_comv); + else if (inst->codec =3D=3D V4L2_PIX_FMT_AV1) { + if (inst->fw_caps[DRAP].value) + return 0; + else + return hfi_buffer_comv_av1d(width, height, num_comv); + } =20 return 0; } =20 static u32 iris_vpu_dec_persist_size(struct iris_inst *inst) { + struct platform_inst_caps *caps; + if (inst->codec =3D=3D V4L2_PIX_FMT_H264) return hfi_buffer_persist_h264d(); else if (inst->codec =3D=3D V4L2_PIX_FMT_HEVC) return hfi_buffer_persist_h265d(0); else if (inst->codec =3D=3D V4L2_PIX_FMT_VP9) return hfi_buffer_persist_vp9d(); + else if (inst->codec =3D=3D V4L2_PIX_FMT_AV1) { + caps =3D inst->core->iris_platform_data->inst_caps; + if (inst->fw_caps[DRAP].value) + return hfi_buffer_persist_av1d(caps->max_frame_width, + caps->max_frame_height, 16); + else + return hfi_buffer_persist_av1d(0, 0, 0); + } =20 return 0; } @@ -545,6 +809,8 @@ static u32 iris_vpu_dec_line_size(struct iris_inst *ins= t) else if (inst->codec =3D=3D V4L2_PIX_FMT_VP9) return hfi_buffer_line_vp9d(width, height, out_min_count, is_opb, num_vpp_pipes); + else if (inst->codec =3D=3D V4L2_PIX_FMT_AV1) + return hfi_buffer_line_av1d(width, height, is_opb, num_vpp_pipes); =20 return 0; } @@ -653,6 +919,15 @@ static u32 iris_vpu_enc_bin_size(struct iris_inst *ins= t) num_vpp_pipes, inst->hfi_rc_type); } =20 +static u32 iris_vpu_dec_partial_size(struct iris_inst *inst) +{ + struct v4l2_format *f =3D inst->fmt_src; + u32 height =3D f->fmt.pix_mp.height; + u32 width =3D f->fmt.pix_mp.width; + + return hfi_buffer_ibc_av1d(width, height); +} + static inline u32 hfi_buffer_comv_enc(u32 frame_width, u32 frame_height, u32 lcu_size, u32 num_recon, u32 standard) @@ -1414,7 +1689,9 @@ static int output_min_count(struct iris_inst *inst) =20 /* fw_min_count > 0 indicates reconfig event has already arrived */ if (inst->fw_min_count) { - if (iris_split_mode_enabled(inst) && inst->codec =3D=3D V4L2_PIX_FMT_VP9) + if (iris_split_mode_enabled(inst) && + (inst->codec =3D=3D V4L2_PIX_FMT_VP9 || + inst->codec =3D=3D V4L2_PIX_FMT_AV1)) return min_t(u32, 4, inst->fw_min_count); else return inst->fw_min_count; @@ -1422,6 +1699,8 @@ static int output_min_count(struct iris_inst *inst) =20 if (inst->codec =3D=3D V4L2_PIX_FMT_VP9) output_min_count =3D 9; + else if (inst->codec =3D=3D V4L2_PIX_FMT_AV1) + output_min_count =3D 11; =20 return output_min_count; } @@ -1444,6 +1723,7 @@ u32 iris_vpu_buf_size(struct iris_inst *inst, enum ir= is_buffer_type buffer_type) {BUF_PERSIST, iris_vpu_dec_persist_size }, {BUF_DPB, iris_vpu_dec_dpb_size }, {BUF_SCRATCH_1, iris_vpu_dec_scratch1_size }, + {BUF_PARTIAL, iris_vpu_dec_partial_size }, }; =20 static const struct iris_vpu_buf_type_handle enc_internal_buf_type_handle= [] =3D { @@ -1510,14 +1790,20 @@ static u32 internal_buffer_count(struct iris_inst *= inst, buffer_type =3D=3D BUF_PERSIST) { return 1; } else if (buffer_type =3D=3D BUF_COMV || buffer_type =3D=3D BUF_NON_COMV= ) { - if (inst->codec =3D=3D V4L2_PIX_FMT_H264 || inst->codec =3D=3D V4L2_PIX_= FMT_HEVC) + if (inst->codec =3D=3D V4L2_PIX_FMT_H264 || + inst->codec =3D=3D V4L2_PIX_FMT_HEVC || + inst->codec =3D=3D V4L2_PIX_FMT_AV1) return 1; } + return 0; } =20 static inline int iris_vpu_dpb_count(struct iris_inst *inst) { + if (inst->codec =3D=3D V4L2_PIX_FMT_AV1) + return 11; + if (iris_split_mode_enabled(inst)) { return inst->fw_min_count ? inst->fw_min_count : inst->buffers[BUF_OUTPUT].min_count; @@ -1536,9 +1822,13 @@ int iris_vpu_buf_count(struct iris_inst *inst, enum = iris_buffer_type buffer_type return MIN_BUFFERS; else return output_min_count(inst); + case BUF_NON_COMV: + if (inst->codec =3D=3D V4L2_PIX_FMT_AV1) + return 0; + else + return 1; case BUF_BIN: case BUF_COMV: - case BUF_NON_COMV: case BUF_LINE: case BUF_PERSIST: return internal_buffer_count(inst, buffer_type); @@ -1546,6 +1836,7 @@ int iris_vpu_buf_count(struct iris_inst *inst, enum i= ris_buffer_type buffer_type case BUF_SCRATCH_2: case BUF_VPSS: case BUF_ARP: + case BUF_PARTIAL: return 1; /* internal buffer count needed by firmware is 1 */ case BUF_DPB: return iris_vpu_dpb_count(inst); diff --git a/drivers/media/platform/qcom/iris/iris_vpu_buffer.h b/drivers/m= edia/platform/qcom/iris/iris_vpu_buffer.h index 04f0b7400a1e4e1d274d690a2761b9e57778e8b7..13c7199fcf351cac5f01c0d1ca2= 0c093b1e62234 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu_buffer.h +++ b/drivers/media/platform/qcom/iris/iris_vpu_buffer.h @@ -11,6 +11,7 @@ struct iris_inst; #define MIN_BUFFERS 4 =20 #define DMA_ALIGNMENT 256 +#define HFI_ALIGNMENT_4096 4096 =20 #define NUM_HW_PIC_BUF 32 #define LCU_MAX_SIZE_PELS 64 @@ -81,6 +82,22 @@ struct iris_inst; #define MAX_PE_NBR_DATA_LCU64_LINE_BUFFER_SIZE 384 #define MAX_FE_NBR_DATA_LUMA_LINE_BUFFER_SIZE 640 =20 +#define AV1_CABAC_HDR_RATIO_HD_TOT 2 +#define AV1_CABAC_RES_RATIO_HD_TOT 2 +#define AV1D_LCU_MAX_SIZE_PELS 128 +#define AV1D_LCU_MIN_SIZE_PELS 64 +#define AV1D_MAX_TILE_COLS 64 +#define MAX_PE_NBR_DATA_LCU32_LINE_BUFFER_SIZE 192 +#define MAX_PE_NBR_DATA_LCU16_LINE_BUFFER_SIZE 96 +#define AV1D_NUM_HW_PIC_BUF 16 +#define AV1D_NUM_FRAME_HEADERS 16 +#define SIZE_AV1D_SEQUENCE_HEADER 768 +#define SIZE_AV1D_METADATA 512 +#define SIZE_AV1D_FRAME_HEADER 1280 +#define SIZE_AV1D_TILE_OFFSET 65536 +#define SIZE_AV1D_QM 3328 +#define SIZE_AV1D_PROB_TABLE 22784 + #define SIZE_SLICE_CMD_BUFFER (ALIGN(20480, 256)) #define SIZE_SPS_PPS_SLICE_HDR (2048 + 4096) #define SIZE_BSE_SLICE_CMD_BUF ((((8192 << 2) + 7) & (~7)) * 3) @@ -101,6 +118,15 @@ struct iris_inst; #define NUM_MBS_4K (DIV_ROUND_UP(MAX_WIDTH, 16) * DIV_ROUND_UP(MAX_HEIGHT,= 16)) #define NUM_MBS_720P (((ALIGN(1280, 16)) >> 4) * ((ALIGN(736, 16)) >> 4)) =20 +#define BITS_PER_PIX 16 +#define NUM_LINES_LUMA 10 +#define NUM_LINES_CHROMA 6 +#define AV1D_LCU_MAX_SIZE_PELS 128 +#define AV1D_LCU_MIN_SIZE_PELS 64 +#define AV1D_MAX_TILE_COLS 64 +#define BITS_PER_CTRL_PACK 128 +#define NUM_CTRL_PACK_LCU 10 + static inline u32 size_h264d_lb_fe_top_data(u32 frame_width) { return MAX_FE_NBR_DATA_LUMA_LINE_BUFFER_SIZE * ALIGN(frame_width, 16) * 3; @@ -146,6 +172,96 @@ static inline u32 size_h264d_qp(u32 frame_width, u32 f= rame_height) return DIV_ROUND_UP(frame_width, 64) * DIV_ROUND_UP(frame_height, 64) * 1= 28; } =20 +static inline u32 size_av1d_lb_fe_top_data(u32 frame_width, u32 frame_heig= ht) +{ + return (ALIGN(frame_width, AV1D_LCU_MAX_SIZE_PELS) * + ((BITS_PER_PIX * NUM_LINES_LUMA) >> 3) + + ALIGN(frame_width, AV1D_LCU_MAX_SIZE_PELS) / 2 * + ((BITS_PER_PIX * NUM_LINES_CHROMA) >> 3) * 2); +} + +static inline u32 size_av1d_lb_fe_left_data(u32 frame_width, u32 frame_hei= ght) +{ + return (32 * (ALIGN(frame_height, AV1D_LCU_MAX_SIZE_PELS) + + ALIGN(frame_height, AV1D_LCU_MAX_SIZE_PELS) / + AV1D_LCU_MIN_SIZE_PELS * 16) + + 16 * (ALIGN(frame_height, AV1D_LCU_MAX_SIZE_PELS) / 2 + + ALIGN(frame_height, AV1D_LCU_MAX_SIZE_PELS) / + AV1D_LCU_MIN_SIZE_PELS * 8) * 2 + + 24 * (ALIGN(frame_height, AV1D_LCU_MAX_SIZE_PELS) + + ALIGN(frame_height, AV1D_LCU_MAX_SIZE_PELS) / + AV1D_LCU_MIN_SIZE_PELS * 16) + + 24 * (ALIGN(frame_height, AV1D_LCU_MAX_SIZE_PELS) / 2 + + ALIGN(frame_height, AV1D_LCU_MAX_SIZE_PELS) / + AV1D_LCU_MIN_SIZE_PELS * 12) * 2 + + 24 * (ALIGN(frame_height, AV1D_LCU_MAX_SIZE_PELS) + + ALIGN(frame_height, AV1D_LCU_MAX_SIZE_PELS) / + AV1D_LCU_MIN_SIZE_PELS * 16) + + 16 * (ALIGN(frame_height, AV1D_LCU_MAX_SIZE_PELS) + + ALIGN(frame_height, AV1D_LCU_MAX_SIZE_PELS) / + AV1D_LCU_MIN_SIZE_PELS * 16) + + 16 * (ALIGN(frame_height, AV1D_LCU_MAX_SIZE_PELS) / 2 + + ALIGN(frame_height, AV1D_LCU_MAX_SIZE_PELS) / + AV1D_LCU_MIN_SIZE_PELS * 12) * 2); +} + +static inline u32 size_av1d_lb_fe_top_ctrl(u32 frame_width, u32 frame_heig= ht) +{ + return (NUM_CTRL_PACK_LCU * ((frame_width + AV1D_LCU_MIN_SIZE_PELS - 1) / + AV1D_LCU_MIN_SIZE_PELS) * BITS_PER_CTRL_PACK / 8); +} + +static inline u32 size_av1d_lb_fe_left_ctrl(u32 frame_width, u32 frame_hei= ght) +{ + return (16 * ((ALIGN(frame_height, AV1D_LCU_MAX_SIZE_PELS) / 16) + + (ALIGN(frame_height, AV1D_LCU_MAX_SIZE_PELS) / + AV1D_LCU_MIN_SIZE_PELS)) + + 3 * 16 * (ALIGN(frame_height, AV1D_LCU_MAX_SIZE_PELS) / + AV1D_LCU_MIN_SIZE_PELS)); +} + +static inline u32 size_av1d_lb_se_top_ctrl(u32 frame_width, u32 frame_heig= ht) +{ + return (((frame_width + 7) / 8) * MAX_SE_NBR_CTRL_LCU16_LINE_BUFFER_SIZE); +} + +static inline u32 size_av1d_lb_se_left_ctrl(u32 frame_width, u32 frame_hei= ght) +{ + return (max(((frame_height + 15) / 16) * + MAX_SE_NBR_CTRL_LCU16_LINE_BUFFER_SIZE, + max(((frame_height + 31) / 32) * + MAX_SE_NBR_CTRL_LCU32_LINE_BUFFER_SIZE, + ((frame_height + 63) / 64) * + MAX_SE_NBR_CTRL_LCU64_LINE_BUFFER_SIZE))); +} + +static inline u32 size_av1d_lb_pe_top_data(u32 frame_width, u32 frame_heig= ht) +{ + return (max(((frame_width + 15) / 16) * + MAX_PE_NBR_DATA_LCU16_LINE_BUFFER_SIZE, + max(((frame_width + 31) / 32) * + MAX_PE_NBR_DATA_LCU32_LINE_BUFFER_SIZE, + ((frame_width + 63) / 64) * + MAX_PE_NBR_DATA_LCU64_LINE_BUFFER_SIZE))); +} + +static inline u32 size_av1d_lb_vsp_top(u32 frame_width, u32 frame_height) +{ + return (max(((frame_width + 63) / 64) * 1280, + ((frame_width + 127) / 128) * MAX_HEIGHT)); +} + +static inline u32 size_av1d_lb_recon_dma_metadata_wr(u32 frame_width, + u32 frame_height) +{ + return ((ALIGN(frame_height, 8) / (4 / 2)) * 64); +} + +static inline u32 size_av1d_qp(u32 frame_width, u32 frame_height) +{ + return size_h264d_qp(frame_width, frame_height); +} + u32 iris_vpu_buf_size(struct iris_inst *inst, enum iris_buffer_type buffer= _type); u32 iris_vpu33_buf_size(struct iris_inst *inst, enum iris_buffer_type buff= er_type); int iris_vpu_buf_count(struct iris_inst *inst, enum iris_buffer_type buffe= r_type); --=20 2.34.1