From nobody Sun Feb 8 16:06:08 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 E9AD52FC034 for ; Fri, 17 Oct 2025 18:42:36 +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=1760726558; cv=none; b=ELg7sP09CaK++iR5EW49NQk0uOaBoQCDrRPIbboXb/Rpr4TiF+kzDIdSBfmdkMDnIrQePOuJ2woPZO69zsMRPLVi84xmQERS8pbk+vr1rBqRiIK2NWU3p+m4WOvqsKjnL45/kbOvLxccTrd3b7G1Sgkho94mxKe9gmmpd1qm090= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760726558; c=relaxed/simple; bh=0hCN7qCXSLUAZXIjLrkyQ5Q9apLRdYKGIeQ8hEqHEvA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=HyRrtczpTpungA+JVTx8qxmTq0JNhG+tSaCGg4HNqE5jxLueNQbi/qP4TJ5R5gWFtqvPkNofZ4D36oWKxQzKAna5/du/3zUQlm48HnWwggPoVe20mMpIIws/4/L4qPgdT39cqYCLktuceGFSiAyr+SaHTTtHmOZ+lUQ90k8OREA= 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=MdFACgCJ; 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="MdFACgCJ" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 59HIavFD008297 for ; Fri, 17 Oct 2025 18:42:36 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= K5dffV9vMTN48/Ti+Eh3Xd6lFyWq3KjwFHmjYc0NovU=; b=MdFACgCJjWVuvGZS QeDh2WcNStf5QQtGSxMxdm7zTRaxYS7JmFXP8Cefe5rhET/VQJGGUv53RaxaLdix JbGRTDUQ90gMVFQpKR8I7hreuWCNgqvS3y4g9ZUsnp3UFtCf22T2Cnss7+9szJ3k eXwz4LJVi1GsA92gwcHgHPHz5JMa2xUf//It/O3R5FMnK1U8yvTFsq8Z4Ncv113w ArlJ7gXeTK3+B9kYFAXZJ7PAf3zJkhj1o2s7m5cWQZSfB6B6WgVJccwiTnht8H1x LvEdCB47fFBn4z1Ne+vWB3+MI/NsRot+D4uTm4epYcLrpwu96kLx4LBZ8T8MgXIV iQyUJA== Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 49qfd9deav-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 17 Oct 2025 18:42:36 +0000 (GMT) Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-890c743a001so38028885a.1 for ; Fri, 17 Oct 2025 11:42:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760726555; x=1761331355; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=K5dffV9vMTN48/Ti+Eh3Xd6lFyWq3KjwFHmjYc0NovU=; b=SU7iAr1WZHl8c8lLz2DMSJ6BmA9P/GEXhue/6eq/tYHf+7X+bLnsBEsEofmjPBKWgI f/mIn/dNA048UBsmNbiRY2V1zO38jAvX+wO2F+k6BK4xLBVypK//nJ/7wjJLI8gKn9b2 XDwNesG1w0yQXiwmKm5y6zZTAfq5cbHP8QhsZ5oUIXaMOIivHEZxif/Qk1on78PvL5V6 dg8KpKr3hHAEo5jq1b9TdZ5rSNon/A2zAAyScMxzAlqERdf9nH8OG7nRtaFWns3vp2rZ TiHwScDlE7ZRZXhSIahN5xxzKxZp07CeydffPjQYcLTr9DRBkSkdMrPO8kF0vOuLKBe/ x+dA== X-Forwarded-Encrypted: i=1; AJvYcCVOUVRJQSodZyrbaXxOqpDbWMKueeukgS8BP33hZ1ZyJW5+DqS3SwIhanKsASBFu7BqtRrbvE2wmXz0ooM=@vger.kernel.org X-Gm-Message-State: AOJu0Yyzev58PZVbUTelQgAFIKt5sE/aTZ3YiN5xdYl9hUq62WmRi6RD 4jADk/GD0Ndjm3LV95S2itgiCp4ub0+JjF0NHTT9RfXhdgCjlErfcFU9+IBBU0Ld5HEc6dkEuYb /0v/peBBl37MC4wRVFy1OMvXAkMIz1hzUzla89iWH6uGjxyOqXrJEVylPRZHkEWSNgic= X-Gm-Gg: ASbGncvC1/sf7m37Evic8tCOFn6PESk3ewMvwe18IBNkERANEVtI8immGRNJh98Uhrz ZrDKk6BdNybJ4qWW+QMOWtiutEEUCSxY4qI9nqyIlR7t+0HsGoLkVOwjlEYEBb+MM7tFczvNBBB SJaUww5v0xMAJLee5ZxRMRhTY7v1qL96FgkHgELr2cslUi+4xG/dOvZ5riZ+8f4KWlPpQQIEN+a weyt6JfpBTaffo1PLtqMm4ztsJLzh6eXdVuOBGXjO28Rjp5PACHuWbbuNKIpascyR+5jk3JOP7d YtZNsUEcJm7CW18f+Xpdxn13oYu+st/p5TdsHUfhEjAhHHOi6z4HBH1TLPFB+pKFpece7qXUBlx AmyBLgTo4M4aS3xl3+AHRh8DXYDyL5D9LtTsT2RvUqn0GW3eJl2G5Jl8uJkw= X-Received: by 2002:a05:6a21:32a0:b0:334:8d22:f95d with SMTP id adf61e73a8af0-334a853656fmr3755222637.2.1760726126651; Fri, 17 Oct 2025 11:35:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFmm9s2Z9CdP5xpjHJUp8p4fYTpy+mkia0Il4jJ8DvJs8HvC0urRpa3rj4KvgvAv1rY/sYxCQ== X-Received: by 2002:a05:6a21:32a0:b0:334:8d22:f95d with SMTP id adf61e73a8af0-334a853656fmr3755198637.2.1760726126104; Fri, 17 Oct 2025 11:35:26 -0700 (PDT) Received: from gu-dmadival-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7a2300f24fasm245487b3a.42.2025.10.17.11.35.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Oct 2025 11:35:25 -0700 (PDT) From: Deepa Guthyappa Madivalara Date: Fri, 17 Oct 2025 11:35:15 -0700 Subject: [PATCH v2 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: <20251017-av1_irisdecoder-v2-1-964a5478139e@oss.qualcomm.com> References: <20251017-av1_irisdecoder-v2-0-964a5478139e@oss.qualcomm.com> In-Reply-To: <20251017-av1_irisdecoder-v2-0-964a5478139e@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=1760726124; l=2423; i=deepa.madivalara@oss.qualcomm.com; s=20250814; h=from:subject:message-id; bh=0hCN7qCXSLUAZXIjLrkyQ5Q9apLRdYKGIeQ8hEqHEvA=; b=RGUIsMsESqBt6hXY0FtwCgHQ3CTacRhs+L+y0gnVmPeLhBqSoeivguFT8nRn9HVtwghv0nqUv qy4LpmxRUlqAQf8W0eYj+Od9Nf31cocgjG9o80jfH6I+NCqMwt91laD X-Developer-Key: i=deepa.madivalara@oss.qualcomm.com; a=ed25519; pk=MOEXgyokievn+bgpHdS6Ixh/KQYyS90z2mqIbQ822FQ= X-Proofpoint-ORIG-GUID: ffwmo6SYrUmbQi3yvApiTrn9zzO8NKHG X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMDExMDAxOCBTYWx0ZWRfX4OKqUOUZf5mC m1TwokUUbfmC0sxyEEg13xnq0uT4VhVJu2J/9W2mNt7H4vnDI8eI2Aabtk2Vvf2cD1MO51IRPR1 s4oRRzBN9254ltvDjqmmGD3YVndAuvaXmbt+ZbHZYpGGc4tncnYDXEhtkHjs6Z4LikuIZEHRTg1 goSbubmLTmm8g/5BuWoFiOav33WLlqsvsoLOic8JuQP+vQPm9HPJc6WN20K/R+i2oxFF+zU7Q5S 12ujyQ9Er6rf535gYgVKVDi0Y6+N7noKRja3TTr94eNa4KLRf+Ty6ooUwsXQtgyzE3fvMUIseVP UDyDGontbxRHpp1fLD6AWWFdwNv/gX7Hl8NRuNSt7284AhONWpBE+qHX/9Gd/dw17q4kGvlCArV W5dZlTUn8zBO6aQRbI0OjOt6fMHkzQ== X-Proofpoint-GUID: ffwmo6SYrUmbQi3yvApiTrn9zzO8NKHG X-Authority-Analysis: v=2.4 cv=PdTyRyhd c=1 sm=1 tr=0 ts=68f28e1c cx=c_pps a=hnmNkyzTK/kJ09Xio7VxxA==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=IkcTkHD0fZMA:10 a=x6icFKpwvdMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=5q8hE9cQKCNJD2usWYQA:9 a=QEXdDO2ut3YA:10 a=PEH46H7Ffwr30OY-TuGO:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-10-17_06,2025-10-13_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 phishscore=0 bulkscore=0 clxscore=1015 adultscore=0 lowpriorityscore=0 impostorscore=0 priorityscore=1501 spamscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2510020000 definitions=main-2510110018 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. Signed-off-by: Deepa Guthyappa Madivalara Reviewed-by: Nicolas Dufresne --- 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 806ed73ac474ce0e6df00f902850db9fd0db240e..d82557a6ac30851b4fd432a5cea= b969abaed2e25 100644 --- a/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst +++ b/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst @@ -274,6 +274,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`` + - 'AV10' + - 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 or AnnexB. + 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..e03cfe0a5ae830595f0bf69b951= ca16beaedab72 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', '1', '0') /* 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 Sun Feb 8 16:06:08 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 5B23933290A for ; Fri, 17 Oct 2025 18:35:32 +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=1760726133; cv=none; b=jdTvt264pqCyhuVCmB5OMvH9Ihy55bFemhW7lOMJ8dYpnpENQPHXpuWU3qkKPK4J4FlVj29mpW/qcUoij94VS4JzIluRYmfBOCI8cBe+OQ4v4WlqH05j4JC3iC6d1LR2gBaSzO1CqCzojsMrUgbYU+SYg8W1Jf4M3LZtQ/8N8y0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760726133; c=relaxed/simple; bh=DSP0RYR4BmXibqx7IUSmnSQ47NHXteY7yJtMQO88UP0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gJzHoGkdDhBSsynMaF2FXCFLzFdLc5MDD7HaUzRjYO5cPJv6LP2ESpY0GHHWoDg809IWzDLR5ul/wOYZljKm62E3uRSN8MkW92aQTzpj16FynrVmvpRnmCV/B6f2BRzL1LmmUIH7rHVP7h6wFED1tufubKzkeS1D3B/BC3vSIag= 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=lz1xY2u9; 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="lz1xY2u9" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 59HIRvK7022733 for ; Fri, 17 Oct 2025 18:35: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= HUBZezXctNZUTvhj4jU3CP7PPArzUZna/FMnzKRKs/c=; b=lz1xY2u9tWLZbsp8 CMttYA1PCfiGOdBDBqb210sQNgvttsBAq8sIJ/pwgHkjXi2St4w8hxgMB4aGmfNt H8nuCGou1Z4RLulv5zth3Zg0/lAd7+JOlt+Hs7kk6eg8JtPFzxWlDtcyg2SAVbrB vTtpXDazV4r/lEWzyOMqrGdXYX26ELvrcnZxVREInqrRKFRIT2hAudS6e5zb+fWJ aHmeRkbJpW8ysYxQcf413EbcCg6Ry8FNSwyXCbUTnUqzUVzf7OlSHNBmFl2bfubb S7GJmR7upYEhleAUnexIDzq1J6nnMWPFkgu6GDgC4UkYPjBRD6/myIIJ9xznX2Ar krMBUQ== Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 49qfa8nbpc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 17 Oct 2025 18:35:31 +0000 (GMT) Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-2813879844cso5406025ad.2 for ; Fri, 17 Oct 2025 11:35:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760726127; x=1761330927; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HUBZezXctNZUTvhj4jU3CP7PPArzUZna/FMnzKRKs/c=; b=Apr4dH0ZABu9WLBuDXIIJ45dacDHC7ij99jDxUH+eqRiBRCJfI2xmxSHmSY/G8DthM FLIp+Y12IWgTb6B4A7qlNHMpgHamgYhqEwHaKwNYd/tq0AB4C/2zB4RiAq0/C1CDQUSP ynusJaaN8w46vWfv04U8hQu+6rV4EMdcB8awAKc5evuuzAdesT5UDNs1EElOznqImw8N a5fQqLiBQvt9EAdHAbxWV/fzhVoBtMsH/LS+H2Z9plLxybX7nRg+jVIU80/QJQvOwL1n c2hUEE+anAPvgly4eqE332w/l6xs98Gt8Qo1Xl9NmZuhhNzrdWjr6xVpvpgjhMztiE9o MyLQ== X-Forwarded-Encrypted: i=1; AJvYcCUQ4J0WLRTlX1MO6KcRJZioyIgucPMiA10vADPfCrJjKXMFMoK+9XogbOx2tq5i4b+6Lv7LZOURBa7rfLA=@vger.kernel.org X-Gm-Message-State: AOJu0YyG2hbviZP7GsAjW8vvktpSjcDreDAlDDwkA8fm7W3Vgc0Pl8If pqMW3l3ogpXVCS5oj1a60YimAQdArE0S8Jtb0GBmQq60ivT+HQo38WRVqm9R/pWRnvAq2l8rTNM losCV6W8tGN5//j7z6DnXTllaX38HHsMmphwCqm8N2VxhtyHebszwH2P91ERzuK6Te7Q= X-Gm-Gg: ASbGncscYIYsY80laxJVbMcD/NRagvGQiLYkyB0olb6as7jY9pETZwNIXHAaNZiDX7n 1KIR3LPvOoWn3woZz6LJ+NVYDVdObhS5K3wfv3GycQCqkDFIxnidxaGbx1dzxvjNO0vpb/CaYzt flJvPrNsHvJIPK422AKZ3HLMM8WDX/4eNtwNJmnyraHVZNKiM3E4wv7pkgB2SYPlFJshVxjY2w+ ZVv8qmPQTIJr7t3d5uHUWGV2a2sA4MDExJg+k6GqQCbCgrowBijq1UtQIPqFeJH0NZCrihCcjHr 1GeKEmxx2WHl5GbR3zpkGy8r4MWsG3aiZ0diDCqlTYz/vH0/3dAZQwVmC0ckNTAeJqfEhtcjjk+ ejyU77jmD9G8cdyO4R/WJE4I7/P2LSJYfeLyuBr8clB6H0gWPB5GmSgG1YBc= X-Received: by 2002:a05:6a21:a4a:b0:2f9:74d6:440e with SMTP id adf61e73a8af0-334a8650b5dmr3500583637.8.1760726127504; Fri, 17 Oct 2025 11:35:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHjJuTka6aOUn/1+EvQOCTb/dd0QIHgH8nimjW8CSejnnxGUfAzi2PlSDzmmpz9xhF6KHcOHg== X-Received: by 2002:a05:6a21:a4a:b0:2f9:74d6:440e with SMTP id adf61e73a8af0-334a8650b5dmr3500569637.8.1760726127094; Fri, 17 Oct 2025 11:35:27 -0700 (PDT) Received: from gu-dmadival-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7a2300f24fasm245487b3a.42.2025.10.17.11.35.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Oct 2025 11:35:26 -0700 (PDT) From: Deepa Guthyappa Madivalara Date: Fri, 17 Oct 2025 11:35:16 -0700 Subject: [PATCH v2 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: <20251017-av1_irisdecoder-v2-2-964a5478139e@oss.qualcomm.com> References: <20251017-av1_irisdecoder-v2-0-964a5478139e@oss.qualcomm.com> In-Reply-To: <20251017-av1_irisdecoder-v2-0-964a5478139e@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=1760726124; l=1154; i=deepa.madivalara@oss.qualcomm.com; s=20250814; h=from:subject:message-id; bh=DSP0RYR4BmXibqx7IUSmnSQ47NHXteY7yJtMQO88UP0=; b=YVIU3uQVT3vY83tryQM79WMBy7kN0qCmcc0tjWdsuQWcGktAsfLoI1hVWsGqL0UcNdUsif0LA G7i0qkFf0MzCJrlXhhvqoyFpXgm3pyTr/W80ykD0q0ME4GK06tirg7i X-Developer-Key: i=deepa.madivalara@oss.qualcomm.com; a=ed25519; pk=MOEXgyokievn+bgpHdS6Ixh/KQYyS90z2mqIbQ822FQ= X-Proofpoint-GUID: NOyn5kP-AlFGX4j6zvh4d1CCzDCTwWsT X-Proofpoint-ORIG-GUID: NOyn5kP-AlFGX4j6zvh4d1CCzDCTwWsT X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMDExMDAxNyBTYWx0ZWRfXzqpEGH9zhiil WubJfx4MQbQY+W4D6icpjGjnxKNFgvXolxK1hO0O/NZ+TNueKgNgobBubo2YXlzm1Y/IazrK/m7 ZzCEMUq6/WFBrPj1J58nN86Z/U67fd6kjXaQqkwboGTiWWJJJeBNAKGhBeBXLG7MOrGJkuoHTYJ x4RdEqZQ5sDTjYuVgzetvFRek+nUT7khvZmFlTkpocgo02208hxPPZP22PoOfDE9T2Dt1GWAUax 7TWetbt28xAyDVCzH03AN9sWN72Z3laQedlLWTM1GzU249KAs6u3Td5XuZk89bTmi2gJRjU1LnP E13NNa4QJp0pYBMx30VQSNOKYPgVLAYbLiYq5GsNT3z66EsQ/Ogqtv1MmL4u8fwJ2tN4k2mwHP4 kQujJR7GMvzP5Iu8v+JTJ9C5xKBe6Q== X-Authority-Analysis: v=2.4 cv=JLw2csKb c=1 sm=1 tr=0 ts=68f28c73 cx=c_pps a=JL+w9abYAAE89/QcEU+0QA==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=IkcTkHD0fZMA:10 a=x6icFKpwvdMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=3VFMuRvh7oFGMF0ZDtIA:9 a=QEXdDO2ut3YA:10 a=324X-CrmTo6CU4MGRt3R:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-10-17_06,2025-10-13_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 phishscore=0 adultscore=0 bulkscore=0 priorityscore=1501 impostorscore=0 suspectscore=0 malwarescore=0 spamscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2510020000 definitions=main-2510110017 Add a descriptive string for the AV1 pixel format to v4l_fill_fmtdesc(), enabling proper reporting of AV1 support via VIDIOC_ENUM_FMT. Signed-off-by: Deepa Guthyappa Madivalara Reviewed-by: Nicolas Dufresne --- 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..bdfdf45c5de2f2ce885f2190077= 18a54b5c86251 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 Sun Feb 8 16:06:08 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 3601B257831 for ; Fri, 17 Oct 2025 18:35:30 +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=1760726133; cv=none; b=CT6G8RRK9I0s3EngvK00VxxAbuwmYLEQXt47+DoZbF3tLo/wvds+zsGrxf/UGRBUJOEYxD6VZGLaw4yoFJ3YS7LDFwz8RJNAMxxXQEjvYpfX3uP7lvkuJoDfz+QlQzFGdEx/dGYrl/5qABIC+nD0IAj+imW94+if1baikPL9go8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760726133; c=relaxed/simple; bh=VskuyVOBS7KHlqvDQrpKFvJ4AMjG+tM6ZV54/uqDOk8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=W6ZLKIXsy9bupR59/yrL/NgpVqbuTFg9hOLyco+FotqPt/82F7XWM+eNeOTwy/d26ybEPQIzey0b7aX4FfKeVunRTT9vt2s+5mlPEzRmOTpk9of1SwxZioYmxi+VSDa5jcf3CHsg5NEDvZ4OnXn3pL2PNZMoaeKctjynGsfSoek= 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=BhWTPJuM; 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="BhWTPJuM" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 59HISBLi017891 for ; Fri, 17 Oct 2025 18:35: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= HrIpDsyH3yYUP12GtjfQTL4htgNJ0LU7jZDW8u53XPQ=; b=BhWTPJuMgY0eiOEv bbkpJ2R9/Ejl8pTVCR7HMmlzBpTUPf1M/d+/Fs+ucZvrU3d6tS38ZcueIG+mN4Wp uHTFVlrpDbWUhBXrsazg/ZGErW6kwPPteBBtK7IpDF07LTpLxARmM+0lVI7cCrHo AmqCZTtdjLJo1RobX+GJarBfbZbWyRukigWZNDW8wu5Uf7yWZPlfY2IZRsqaqumU 4k9zLK4A2//BAsQ+k/PMv2GiE/kYZ58jrl3CI9YYiQbuGEWue/3lG43u4iKQBc2h 1gQAyEo2AWYKsn4ZqSvfJe3P5uV/+PBfwGK+IVzZTrVdd1EKD8aopxjD7ScjK0eu KdRQaw== 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 49sua8v2vg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 17 Oct 2025 18:35:29 +0000 (GMT) Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-3327e438680so394546a91.3 for ; Fri, 17 Oct 2025 11:35:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760726129; x=1761330929; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HrIpDsyH3yYUP12GtjfQTL4htgNJ0LU7jZDW8u53XPQ=; b=Dnc34redeyKakE1BlGDxxjQ7UQ13YcC123nO153B4UDU3FrWPm3Yx1jNuyOJWM6Vrs WDpm4Fo2bhnWcTX3neqX88m6nmcG0PG92bYkG7n6ZQRFW0Ol4ZiWWmTL2kgioSLH/qYW JIU2Ae+mT+2Ue0e/zbhZKH9ITR+3K3RVH1yNJgNIOWi3O63g7xYoxHUxOFaM2thG12OG k96pqyFZqQ6EhW4lCsh787YNWTsi3hGwrwmvfPhEwKJLgacypIH55H0ZYwM8ZuvmGTbJ UNzLQZuPacXUd5mKAAfDgj8gwZN24t/UfZfpcksRRsyHMvlI21DP9K0LBcXsWYHxb66I ofHw== X-Forwarded-Encrypted: i=1; AJvYcCULY7hLryXqvnkN8GhUoqoPI91tORwLbAoMmgwzkReJjJQnsWrgnvo/gUvmg9Wp5kz0QrR8JCskkStAOXk=@vger.kernel.org X-Gm-Message-State: AOJu0YxTiOPpGrVK410u3UiASOC0qHDvIhAJOTRD+EdCx+DQOpZ5hSsp r8YheMNxJThgfSijD/zNJRbWtb+pUSqq46sx4n8pjwZhQ0uz4vKvvYUikdoLt32QpC1lrnMtdHU hQRBbxODJ6D8sUCEmGKSgXugqDH7dG0uysIvlvYlrQOjZOAXj7rJYFGHKsNF/tjx2A6o= X-Gm-Gg: ASbGncs81qHYbIpPrm8FD5jqR3dmVugq4dNT858C8lIYTyNYFLQKrRzfIfMe6QKgS1c 1x+wkdUG2YWpTxOG5PtJUY6UDNS8o1GXK3hrWQNGdjWwMtPiXMTqZjbhWbsfCofXs88m3L33nno ++a8IBeKwy+aP3nW/rL3za9T8RL//G5ezgmv5p02atNcNW7dNzlUuMBMYa64jIsPCKvDa/lzFsX 6soysoD/YWPVyXNffL85nkAuWuIfRiORsnmXSE2IB0elu/xS0yd3nw5UEeh8iqLGzN8/CHONkFH z2xIakES2KWGMy2Yp46epdFrqQxODoObPUI86uh/nw1Y5NVeasKsWt3xnlRnq118PJwwPej4GEU p71SA/ZCKWl87QhcCIaC8z9tBrmmst0rCfF2Ne+6o8CRGtQEk9YOUcN5sFkE= X-Received: by 2002:a05:6a21:164a:b0:262:77e0:819d with SMTP id adf61e73a8af0-334a8616f8fmr3509190637.3.1760726128589; Fri, 17 Oct 2025 11:35:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFkEcbmjrj2mihGjJEJfxlADEKhTZnTFKqkqm9TWg1u52h/cBGzwlAA3FOATwYI5ir4jBnP5Q== X-Received: by 2002:a05:6a21:164a:b0:262:77e0:819d with SMTP id adf61e73a8af0-334a8616f8fmr3509170637.3.1760726128085; Fri, 17 Oct 2025 11:35:28 -0700 (PDT) Received: from gu-dmadival-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7a2300f24fasm245487b3a.42.2025.10.17.11.35.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Oct 2025 11:35:27 -0700 (PDT) From: Deepa Guthyappa Madivalara Date: Fri, 17 Oct 2025 11:35:17 -0700 Subject: [PATCH v2 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: <20251017-av1_irisdecoder-v2-3-964a5478139e@oss.qualcomm.com> References: <20251017-av1_irisdecoder-v2-0-964a5478139e@oss.qualcomm.com> In-Reply-To: <20251017-av1_irisdecoder-v2-0-964a5478139e@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=1760726124; l=7503; i=deepa.madivalara@oss.qualcomm.com; s=20250814; h=from:subject:message-id; bh=VskuyVOBS7KHlqvDQrpKFvJ4AMjG+tM6ZV54/uqDOk8=; b=yxND7vtEhiA9/d00RWrvjrNk6qFglVsKHr+QJgF0n0RUr+UjqqonhSasqyZ6auDuSC57yYuZ9 KqQ54qCupYNAfJEQHnZXmP72p05WpZtG3XY/XacNA9ZPCGXNL4nwU18 X-Developer-Key: i=deepa.madivalara@oss.qualcomm.com; a=ed25519; pk=MOEXgyokievn+bgpHdS6Ixh/KQYyS90z2mqIbQ822FQ= X-Proofpoint-GUID: ToIg4K1Z1ynm7203KcP3IGVRIY9NAbFQ X-Authority-Analysis: v=2.4 cv=e5MLiKp/ c=1 sm=1 tr=0 ts=68f28c72 cx=c_pps a=UNFcQwm+pnOIJct1K4W+Mw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=IkcTkHD0fZMA:10 a=x6icFKpwvdMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=KKAkSRfTAAAA:8 a=EUspDBNiAAAA:8 a=Z_4drlmlzYXD-T4lrkMA:9 a=QEXdDO2ut3YA:10 a=uKXjsCUrEbL0IQVhDsJ9:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMDE0MDEzNCBTYWx0ZWRfX5CI8odOT7yJ2 oU2paAz3XsLPNkB4OZxK6fFgdG3kdd2aNiByaROp5YcveWUhdK3M4U3l+lwJJFwlPO729Dc0r7X 8PLdVAEHlpNKC8tOYjjkwpYXVo4NkuRpqMxOuaOrYtdKf1LwG2P8Jknbwhqe/O7hgZI5yvj9Uba hqmE47g+Jf7XC7aBr9dfGhatnP57Ydrf2p/g0CsDRVFq+62rBmpYpA4EuFRY+os7XgTPILmaEW9 TM7O/nRymiENLSClaGRRpn/810P9UuTiUwHw1jgAX5d8mjS+eb+sDtv/jJUTNL6YojAaMX2RfUv PL2Gm68KvY5x0SDbvMKl683/pBGksmIYY4/vEG3vPym/3cD6EEq7chntLBBkKdVrg36r7ZRLMmM xGoVCr4XRFt+qrigZgzyDrf3NwMb9w== X-Proofpoint-ORIG-GUID: ToIg4K1Z1ynm7203KcP3IGVRIY9NAbFQ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-10-17_06,2025-10-13_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 suspectscore=0 spamscore=0 adultscore=0 clxscore=1015 priorityscore=1501 impostorscore=0 malwarescore=0 bulkscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2510020000 definitions=main-2510140134 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 Signed-off-by: Deepa Guthyappa Madivalara Reviewed-by: Dikshita Agarwal --- .../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 | 17 +++++++++++++++ drivers/media/platform/qcom/iris/iris_vdec.c | 25 ++++++------------= ---- 6 files changed, 50 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 aa1f795f5626c1f76a32dd650302633877ce67be..bbfe7a0851ea94fb7041a868b4d= f8b2ec63bf427 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_defines.h +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_defines.h @@ -138,6 +138,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 5982d7adefeab80905478b32cddba7bd4651a691..f1883ffc138fd975fb76d4e4590= 4ee04e196cd20 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 { IRIS_FMT_H264, IRIS_FMT_HEVC, IRIS_FMT_VP9, + IRIS_FMT_AV1, }; =20 struct iris_fmt { 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 36d69cc73986b74534a2912524c8553970fd862e..15a38b7122af6d978fac433e8c0= 2b4da5c141e1a 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, @@ -760,6 +779,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), @@ -852,6 +873,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..8342a0b6f825b385192baedfc67= c50bba7661470 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_sm8250.c +++ b/drivers/media/platform/qcom/iris/iris_platform_sm8250.c @@ -17,6 +17,21 @@ #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 +352,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 ae13c3e1b426bfd81a7b46dc6c3ff5eb5c4860cb..be8d2d48c82f385e4f46807f7e0= dd52e469927cd 100644 --- a/drivers/media/platform/qcom/iris/iris_vdec.c +++ b/drivers/media/platform/qcom/iris/iris_vdec.c @@ -67,26 +67,12 @@ void iris_vdec_inst_deinit(struct iris_inst *inst) kfree(inst->fmt_src); } =20 -static const struct iris_fmt iris_vdec_formats[] =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 * find_format(struct iris_inst *inst, u32 pixfmt, u32 type) { - unsigned int size =3D ARRAY_SIZE(iris_vdec_formats); - const struct iris_fmt *fmt =3D iris_vdec_formats; + unsigned int size =3D inst->core->iris_platform_data->inst_iris_fmts_size; + const struct iris_fmt *fmt =3D + inst->core->iris_platform_data->inst_iris_fmts; unsigned int i; =20 for (i =3D 0; i < size; i++) { @@ -103,8 +89,9 @@ find_format(struct iris_inst *inst, u32 pixfmt, u32 type) static const struct iris_fmt * find_format_by_index(struct iris_inst *inst, u32 index, u32 type) { - const struct iris_fmt *fmt =3D iris_vdec_formats; - unsigned int size =3D ARRAY_SIZE(iris_vdec_formats); + unsigned int size =3D inst->core->iris_platform_data->inst_iris_fmts_size; + const struct iris_fmt *fmt =3D + inst->core->iris_platform_data->inst_iris_fmts; =20 if (index >=3D size || fmt[index].type !=3D type) return NULL; --=20 2.34.1 From nobody Sun Feb 8 16:06:08 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 CA418332917 for ; Fri, 17 Oct 2025 18:35:32 +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=1760726136; cv=none; b=Su0uv+26InD75NabbiI7FQs/XTPiG3CDY8DusrEE6/gu2pLSqOKnX3aEUwTL6H6gqNQaNHNd31fCjWCdgFXMs+jU8H0x9qzfBuEH9srW+8Fz3u9w1aMLePLB2o8xBwkT43MPOgo50t+W1OP3GSVtEYVfQ2ofjvbtFCyBTSqr7P8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760726136; c=relaxed/simple; bh=lG907X91KtVh22HiuDVACaqM0rq3fj55DNlEysjp5yg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ZM+jAzElUZlCbEqnfX2ELcnEA14j6iJP0895q11IMIvKYIb8Ajt5tv7lmaqSH5q9hkfdmyy9oKO1M4Uql6j0f8GfRjdtcJNjWxLs5SbSE1mrLKve/DKCvY8Se6S2XcQpYNYXeUN3/vTu9Kj6bBEhV7fUmw4ABZYyPJnUOph1Oso= 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=AQGG8xeP; 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="AQGG8xeP" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 59HIS4TJ008475 for ; Fri, 17 Oct 2025 18:35: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= coHP0HDEAcPqq2mqwqtf2MVER6L+yMceChey8zGRqc4=; b=AQGG8xePk1Amrz8L xzVx4Wwk6yE+p216ZDumOXyyZLVnVMRln+/OzzNC+WSBcGATWZwOCV09eR535s53 fB7vthC6eAHgqs7fA5rZsFeeMKBwuTxvV/cz9nWXrSKoLWlZDalZ/4Tfj8Z9QE+W qeXzS1jyjZzx8HPpN847laJXK5JJNCop1sJT0QvloG0O26UIwEBgHAgudBySlHpU u7Gj+BrR37UuVXc1idjWMGFCiUJzA0PBDiv9qn9jIRF5+LZptjhOBXWVS+SJTrpE ASuBL+6rCFOi3FkFSU/a5ZvkvzlCe5oqzfmX9lHYMOSVRVKVwjBdP/d3n7N8zLKu nl9qzg== Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 49qfm5wh0a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 17 Oct 2025 18:35:31 +0000 (GMT) Received: by mail-pf1-f197.google.com with SMTP id d2e1a72fcca58-7811aa16c6bso432091b3a.2 for ; Fri, 17 Oct 2025 11:35:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760726130; x=1761330930; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=coHP0HDEAcPqq2mqwqtf2MVER6L+yMceChey8zGRqc4=; b=If739BX5yAsm1GgKVwJIc4vzH/890W8deYdadc8O0Azi0eXk/zH79L3k5vYloZI/Ou v89cXRQ+CV90N8SjyC4CdAbku41fZQrK8N5G9cNKYtfJVRklTGXy9/VHOTLx0fOMBfDz HW/MHyfzIZB724RPOikVsBJisdyQ8Z6wXfGm6q+OqN4hEeOiDcDLfkIoPv+w8C9hdg5i OLGto/j0uTM6mSNtrh+Rz5wCQYGB51BUdixxA3u91htq1DtMZhyBXQMJdjy+Os4VMV8L SnGZG/v+pebeJ0mKGValQYt0PzwsdXyyECjXvBctqkpYiaEHV8uFxioUVXv6WECpPx69 WMyQ== X-Forwarded-Encrypted: i=1; AJvYcCXziseqPyjRKwBCaExqYIc+yPBfdJ8DuL3u4yTHVe9HKDCmvkktEMjmYQShoo61WwlqcrdPuQkM5iKi+dk=@vger.kernel.org X-Gm-Message-State: AOJu0Yyv64ow0Lr4HrjwdCbDmtAZ1zrw4lRdFC/ZD+it8G8CcvMkMV3w sk0fuoTXkeJG9Nw/jNZEMR2GMKQcBTyAoHyJ5wcWNuAm1AhQM/rKYtjxhxPW6TD+xFwzRd32zmw FBssWhLH8xu49ulPSqqPREnl0eYDSd7jt77Xx80lBYQfzDXEDa6nBZ6zg5LnRIGFeKAQ= X-Gm-Gg: ASbGnct1jrdF+A8M38wqLilLpanQAN1yAwVsCzeqgxL8lsEZWzRUBBE/tnrUlDMS2hh 1p5jRRp2gl6a+X9Wyf89HS76COmHj6FSaDcoCC0ySPMDlLp2IzTF51CcYiItn/GsSVavA15nzk5 N/ik1Q6NKnhlyFNunDMBY1jbC/6jQpknFg1BQ/KLv9zrUAS2Z35XCp8+steruipKdxwFJaxVsEk WqWRvBRcNhIhhWur5IE7Tnfh3BWQxmMj30k2uGyFPiM+b4I2EJUfHDYs2mMuNJN+6zKdMDrzMMT bp5t+mqn3jly4XmoXjw/MwvnuvIVqVUJ/JEciCrI42tPqTHAZccKmIgQwwY4nOo5XnXooDH7lR+ 86zBxrSpkytzML9/BPbJqVyBxU9pek9G7tbRRTd6fnM7jF3YX+5YCXRo2Dkg= X-Received: by 2002:a05:6a21:32a0:b0:334:8d22:f95d with SMTP id adf61e73a8af0-334a853656fmr3755341637.2.1760726129872; Fri, 17 Oct 2025 11:35:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGTYhbF4TbOp3d6kTous9fQ8z1QPiCr7j5tiIvjJr699jy7QppViMQ+nlc7ZPq7o7iksjhftQ== X-Received: by 2002:a05:6a21:32a0:b0:334:8d22:f95d with SMTP id adf61e73a8af0-334a853656fmr3755313637.2.1760726129174; Fri, 17 Oct 2025 11:35:29 -0700 (PDT) Received: from gu-dmadival-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7a2300f24fasm245487b3a.42.2025.10.17.11.35.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Oct 2025 11:35:28 -0700 (PDT) From: Deepa Guthyappa Madivalara Date: Fri, 17 Oct 2025 11:35:18 -0700 Subject: [PATCH v2 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: <20251017-av1_irisdecoder-v2-4-964a5478139e@oss.qualcomm.com> References: <20251017-av1_irisdecoder-v2-0-964a5478139e@oss.qualcomm.com> In-Reply-To: <20251017-av1_irisdecoder-v2-0-964a5478139e@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=1760726124; l=25535; i=deepa.madivalara@oss.qualcomm.com; s=20250814; h=from:subject:message-id; bh=lG907X91KtVh22HiuDVACaqM0rq3fj55DNlEysjp5yg=; b=D3LpScOLbGp22PGR3GHQA5b2o7pgOtEIMNfLM5xudL2geiR/NQeTcMMJ8f2UaCMmNLQyRlqxV H766kJ8pFRjBVWg7gYsJyqxpUV5h0uDYjROIqQe9IPYtU0CpWpUwpNU X-Developer-Key: i=deepa.madivalara@oss.qualcomm.com; a=ed25519; pk=MOEXgyokievn+bgpHdS6Ixh/KQYyS90z2mqIbQ822FQ= X-Proofpoint-GUID: ZxCdflKrV1mmTvVGF3WJ6mvfQ65_NG0I X-Proofpoint-ORIG-GUID: ZxCdflKrV1mmTvVGF3WJ6mvfQ65_NG0I X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMDExMDAyMCBTYWx0ZWRfX56mAaZTFjQpI sNz94uwryvBL6pDlId515Frrfbioq+J+kQMPbrSeVSMH5FpGwPRFSuSAwGxRVORdLkpVwwr0o4M +UJQsJdlFhXYVPQyWyA9jNjZP82wCLkXm1Fc9tzhmy4pOaM4R6Tgpla4puEw5MEgXfekQaRBJGP WCUp2RJUFNK3zKoh44dQaEQwJddNgweBIaK0vNiTaO/qTMZ7GJo/rEySnQrZRI26WQeY8RTJK0D xMqIFMPsLdZh8JUkQSwtFnXdH2+lbnbMwvYF+jIn1vJGo/0zSMEqSliweF1pn6289AuAzRngc9B cU1lUQl/9Yz1Wt8kqQU3+sSWX9ccZb2AY8vc2qZX7v6HQWYdp8WyQJF5fWjIfx7COnVqapq+V/9 15IOeW5P1OTkcVNJE7dx1f/StLq+xA== X-Authority-Analysis: v=2.4 cv=V71wEOni c=1 sm=1 tr=0 ts=68f28c73 cx=c_pps a=rEQLjTOiSrHUhVqRoksmgQ==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=IkcTkHD0fZMA:10 a=x6icFKpwvdMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=KKAkSRfTAAAA:8 a=EUspDBNiAAAA:8 a=6GFc9FHXEM_1LolK-DMA:9 a=QEXdDO2ut3YA:10 a=2VI0MkxyNR6bbpdq8BZq: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.80.40 definitions=2025-10-17_06,2025-10-13_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 malwarescore=0 spamscore=0 adultscore=0 suspectscore=0 impostorscore=0 phishscore=0 clxscore=1015 lowpriorityscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2510020000 definitions=main-2510110020 Defining platform specific capabilities specific to AV1 decoder. Set and subscribe to manadatory properties to firmware for AV1. Reviewed-by: Bryan O'Donoghue 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 | 110 ++++++++++++++++- .../platform/qcom/iris/iris_hfi_gen2_defines.h | 9 ++ .../platform/qcom/iris/iris_hfi_gen2_response.c | 22 ++++ .../platform/qcom/iris/iris_platform_common.h | 13 ++ .../media/platform/qcom/iris/iris_platform_gen2.c | 133 +++++++++++++++++= +++- .../platform/qcom/iris/iris_platform_sm8250.c | 1 + drivers/media/platform/qcom/iris/iris_vidc.c | 1 + 10 files changed, 296 insertions(+), 5 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 4ce71a14250832440099e4cf3835b4aedfb749e8..86fa5ab02bfe3701e0c3dd38f1a= 9cadc88f5e4cd 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; @@ -480,10 +488,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, @@ -509,6 +519,56 @@ 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; + + 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; + + 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_set_opb_enable(struct iris_inst *inst, u32 plane) +{ + u32 port =3D iris_hfi_gen2_get_port(inst, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPL= ANE); + u32 opb_enable =3D iris_split_mode_enabled(inst); + + return iris_hfi_gen2_session_set_property(inst, + HFI_PROP_OPB_ENABLE, + HFI_HOST_FLAGS_NONE, + port, + HFI_PAYLOAD_U32, + &opb_enable, + 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; @@ -531,6 +591,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) { @@ -544,12 +607,20 @@ static int iris_hfi_gen2_session_set_config_params(st= ruct 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; } } else { - config_params =3D pdata->dec_output_config_params; - config_params_size =3D pdata->dec_output_config_params_size; + if (inst->codec =3D=3D V4L2_PIX_FMT_AV1) { + config_params =3D pdata->dec_output_config_params_av1; + config_params_size =3D pdata->dec_output_config_params_av1_size; + } else { + config_params =3D pdata->dec_output_config_params; + config_params_size =3D pdata->dec_output_config_params_size; + } } } else { if (V4L2_TYPE_IS_OUTPUT(plane)) { @@ -598,6 +669,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, @@ -763,6 +837,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; @@ -845,6 +924,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; @@ -900,6 +989,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 @@ -1075,6 +1169,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; } @@ -1087,7 +1183,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 bbfe7a0851ea94fb7041a868b4df8b2ec63bf427..9cc0989c67d74a9e051725e9ee5= 71a2ab9160519 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_defines.h +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_defines.h @@ -89,9 +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_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_TOTAL_PEAK_BITRATE 0x0300017C #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..19f0660f0388499ab71a1413b2c= 05f891bd5d511 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,8 +244,12 @@ 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 *dec_output_config_params_av1; + unsigned int dec_output_config_params_av1_size; const u32 *enc_input_config_params; unsigned int enc_input_config_params_size; const u32 *enc_output_config_params; @@ -251,6 +262,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 15a38b7122af6d978fac433e8c02b4da5c141e1a..600664b2aea88067a7f66a20bea= acd42181f9532 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, @@ -714,6 +811,12 @@ static const u32 sm8550_vdec_output_config_params[] = =3D { HFI_PROP_LINEAR_STRIDE_SCANLINE, }; =20 +static const u32 sm8550_vdec_output_config_param_av1[] =3D { + HFI_PROP_OPB_ENABLE, + HFI_PROP_COLOR_FORMAT, + HFI_PROP_LINEAR_STRIDE_SCANLINE, +}; + static const u32 sm8550_venc_output_config_params[] =3D { HFI_PROP_BITSTREAM_RESOLUTION, HFI_PROP_CROP_OFFSETS, @@ -737,11 +840,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 { @@ -806,11 +916,18 @@ 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), - + .dec_output_config_params_av1 =3D + sm8550_vdec_output_config_param_av1, + .dec_output_config_params_av1_size =3D + ARRAY_SIZE(sm8550_vdec_output_config_param_av1), .enc_input_config_params =3D sm8550_venc_input_config_params, .enc_input_config_params_size =3D @@ -831,6 +948,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), @@ -900,10 +1020,18 @@ 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 ARRAY_SIZE(sm8550_vdec_output_config_params), + .dec_output_config_params_av1 =3D + sm8550_vdec_output_config_param_av1, + .dec_output_config_params_av1_size =3D + ARRAY_SIZE(sm8550_vdec_output_config_param_av1), =20 .enc_input_config_params =3D sm8550_venc_input_config_params, @@ -925,6 +1053,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_platform_sm8250.c b/driv= ers/media/platform/qcom/iris/iris_platform_sm8250.c index 8342a0b6f825b385192baedfc67c50bba7661470..0297756a3724181498ed8e5776d= d5b872f1d4304 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_sm8250.c +++ b/drivers/media/platform/qcom/iris/iris_platform_sm8250.c @@ -11,6 +11,7 @@ #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 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 Sun Feb 8 16:06:08 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 117E6335068 for ; Fri, 17 Oct 2025 18:35:33 +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=1760726136; cv=none; b=uKBB8tCj6mGagAUblYCIa3PF4K8OFmRyfzvCFxt9sW13bhFzm/wwnLJYleH0ZwwIENFm/fk+0TxAofAMgA2R7BE1/p2tUYH1qGB0b1M/yShw3Ydbpq2kJsuZ5m9aXbCPt03HKq/wUEKVaCOBbSRmu95PtDi4N2MnC5pmDHavIhY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760726136; c=relaxed/simple; bh=S+5acivFDPDss2eT6QTlb8lGvngveKSDlZ0xQ+Mrgis=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=X4uw8pOLFanZQrsYRk5zBuc0dt1apaO+OxOMxU69mzYg8wqNIzlHxS1B90mSsgkWmw1A5mYHCC39ZYoJUmYRM/73KUpZWrPsem4GEu3hn6TBap8PCcnG/Pe7UCIINHI5GTK6D7tdmVq41UWcGOOc+YqGkRHaYGVZ/zf76FRvKGU= 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=BJbrbr6i; 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="BJbrbr6i" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 59HISIZs026487 for ; Fri, 17 Oct 2025 18:35: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= hkZQPhwF1Gv0W8KLx3oq2Q2hmwCklFwM6AQ77vU+zHI=; b=BJbrbr6ivVy8Ahj5 l+8Zw4FemTBTFdJKv+LF1tSup4ZvUjXJ55FMbiJSTRncbvms3WILWA78IwDP6ssR E2qigoQ8J42iDP5WTMVv8LYxER3sWGe2E2OhgGKlecaoo8uPaxTkVjGpW+Ce47/g goUUoFZsXNVmtL3tBk3D3mv3OHUDqGqBlQiFiyxUfLkdSgBb6k/X6uCxQFfxmnWg /LcDZtZeArLIyt8Fq5scur+r+kfhJ6HyTkDmf7vB+PQbiWniBfZDEoCjG757Vgsa +7yw+mBT3xX2CvOBR8ovNmF2aJM+bGNpxIbWWmERuHJ5DKjta/1R7QWlyOmMei6q azJIaA== Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 49tqvppr9t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 17 Oct 2025 18:35:32 +0000 (GMT) Received: by mail-pf1-f200.google.com with SMTP id d2e1a72fcca58-77f1a7d00c9so633646b3a.0 for ; Fri, 17 Oct 2025 11:35:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760726131; x=1761330931; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hkZQPhwF1Gv0W8KLx3oq2Q2hmwCklFwM6AQ77vU+zHI=; b=eFVTDjpoxa67fjWm8KN6QEmiO5clz9t+AriszxAOgw1HQwVZV+EpO60Gj+3BjlcTHT h63rkorFkMGjQ73yW5mW1FCpF/wZVjtkepBC+8UUZcBNH36W7AMS66VS6PMQnPBkO5dg +Qv+f2u3BNjeLAKiSUo3GUkqwAUjqeEaQnov8zouRrR0HgX12a/M6vBxxxfZLYFWuNJU oYMwwGUWfIeg4n8ERofj4/UTGqU/x1hXlNiT6B2QZN0+g57sN2I7hU7qkivtBxq/TKXI Mil6IPQWnZl9HROHj4RIU33Kt2Nk4/GZ1m74UVMROi/GlylI30bTNc+2IBbmj2oGQss4 Z7eg== X-Forwarded-Encrypted: i=1; AJvYcCWcg5pyA+HNJv6UE9NN3ypiIYhGl93zyj5syh/t5zM0Diy/y475auWAK0qrNtWnj6EkZCdwBINCfaFtD6g=@vger.kernel.org X-Gm-Message-State: AOJu0YwBNBIBq0U0fzrmqxb5fT7ZRhVp2xO7n5JODncmNJr0lDi86E8/ eXKGYobrM9NwTA9IHZkR2o7NMcD7wxffBauBk9cvTB0L/TpyzOnvQ/f8OO49a49YxBaw5bkwrHB 4Gmg4tGO+digTo7E27XGTWDlDntrSqHRwDmwxCwJaQiP3Ljkxd0Y+iFRNJaUElB8M0YE= X-Gm-Gg: ASbGncuStBNVplrkHToV14qtT8j+/yCG6jby/pgbb1LrUEmszxeMLIpx/LKnq+lUI9T FkB4eNw7Wf29l5bNsL1I95dtWLaacCwWxmsWoese6VChZKuBo/145dcNm8+CQrFW+Q0iqacv1+a Bkh2GEqkB99EL0+a5BAAR0hiRvVHZ+VWFlegV+gMnNi+hjZaLmIxhI1DCcYBIjgLrUTzYXxsFYP JEatxM2o6G39ONLmzhHip3xyOKWRob8SBsSWiQGxr4TMlLAhYXK/GQQFlzprNKCqG+arYr0Eikh e4kUp9yynLbIfHLH7xRkURt+n+qmToQJp3u/+o2l7VwmjYLQEnYc3XBEmDmFncirsEMyJRaCtUX 3i52ix12ZmPOXwt0D+csKzY/qsNbEyEdm4nhTU5ZZio3GZZOljA7Djr28hTo= X-Received: by 2002:a05:6a00:2188:b0:755:2c5d:482c with SMTP id d2e1a72fcca58-7a220a82c9emr3009717b3a.4.1760726130929; Fri, 17 Oct 2025 11:35:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHpY1lN/6QkrlbXLeLjhINtb5+wlzaMKIyN8B/Ph5vPl1kWCgWAIwVgLgCSy1KaoBKeq0EVGw== X-Received: by 2002:a05:6a00:2188:b0:755:2c5d:482c with SMTP id d2e1a72fcca58-7a220a82c9emr3009684b3a.4.1760726130205; Fri, 17 Oct 2025 11:35:30 -0700 (PDT) Received: from gu-dmadival-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7a2300f24fasm245487b3a.42.2025.10.17.11.35.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Oct 2025 11:35:29 -0700 (PDT) From: Deepa Guthyappa Madivalara Date: Fri, 17 Oct 2025 11:35:19 -0700 Subject: [PATCH v2 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: <20251017-av1_irisdecoder-v2-5-964a5478139e@oss.qualcomm.com> References: <20251017-av1_irisdecoder-v2-0-964a5478139e@oss.qualcomm.com> In-Reply-To: <20251017-av1_irisdecoder-v2-0-964a5478139e@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=1760726124; l=23174; i=deepa.madivalara@oss.qualcomm.com; s=20250814; h=from:subject:message-id; bh=S+5acivFDPDss2eT6QTlb8lGvngveKSDlZ0xQ+Mrgis=; b=GqDm8P/S2bk2EYrkqru7gkNeYgLqy7h8n4+JMK2NCVKapv+C5+/IuAHlTCvpEY3/aCpzgwpfi ciSIWXlMnBhBR6lUw+IE5E/4FxFzHrWXVpYEKYuX4EC3dxzEPJVM9v1 X-Developer-Key: i=deepa.madivalara@oss.qualcomm.com; a=ed25519; pk=MOEXgyokievn+bgpHdS6Ixh/KQYyS90z2mqIbQ822FQ= X-Authority-Analysis: v=2.4 cv=aPD9aL9m c=1 sm=1 tr=0 ts=68f28c74 cx=c_pps a=mDZGXZTwRPZaeRUbqKGCBw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=IkcTkHD0fZMA:10 a=x6icFKpwvdMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=O9RjQ3k1k3WzeL8qxWgA:9 a=QEXdDO2ut3YA:10 a=zc0IvFSfCIW2DFIPzwfm:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMDE2MDAxNyBTYWx0ZWRfX73uV3/I31TEZ O/hidhtofoU/U4HvG//iTLF89tz5KaxFoTptocg6uH8Onj96ylysC8cShXgZO7LuuDIaE0fB4ZU doW/mEFmaNi2O4dmd9KrnFGcauKvnt0Fh4N+V/Ytmkf6xEbZuiKyAO280RsXeJEVWDIv7Lie0eP clAox24fmEAQ9cAVRhZRjjXndQiXgCHvv9HdLUjrtvy0wrpucAHDCiUbnvpSRinSEpsQm1UWssT QznRVFkc0aGARgWUyFL5lRkdVUZFUeOI9xJbx8n1ipX87NFkKm+Xfuldpzu/4e2dQnPQn92TRSW HvMclHigFqRI/Ivdka85wSYuPSHGz7NuMRxGVK2hK4/YeaWhDB/708CGgMazpFeuFxgJVae105A ME33z8Hp0cUL8On6ANq5hRnYFZpjUw== X-Proofpoint-ORIG-GUID: dsmUZ6hBdf2mOE9vb7SnYKGG3zZCTJGJ X-Proofpoint-GUID: dsmUZ6hBdf2mOE9vb7SnYKGG3zZCTJGJ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-10-17_06,2025-10-13_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 adultscore=0 impostorscore=0 lowpriorityscore=0 clxscore=1015 bulkscore=0 suspectscore=0 malwarescore=0 phishscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2510020000 definitions=main-2510160017 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. Signed-off-by: Deepa Guthyappa Madivalara --- drivers/media/platform/qcom/iris/iris_buffer.h | 1 + drivers/media/platform/qcom/iris/iris_vpu_buffer.c | 298 +++++++++++++++++= +++- drivers/media/platform/qcom/iris/iris_vpu_buffer.h | 116 ++++++++ 3 files changed, 411 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..e03ae7cfc9551dd2450b27d5d19= ef1d23bba4c99 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 + =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); @@ -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 * 256; +} + +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 * 256; +} + +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,33 @@ 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); + } 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 +808,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 +918,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 +1688,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_VP9)) return min_t(u32, 4, inst->fw_min_count); else return inst->fw_min_count; @@ -1422,6 +1698,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 +1722,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 +1789,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 +1821,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 +1835,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..a8ffc1286260bddbf49df18fba0= a23f78056a484 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) * 2304)); +} + +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