From nobody Sun Dec 14 05:53:41 2025 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 261502DA742 for ; Wed, 10 Dec 2025 18:59:10 +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=1765393155; cv=none; b=JSNYUS+9v7U/ba1HzP9dVb2zImp2KkiosM2U9b6LWKeCFUJLXb8/heyxsfBzz5hRMjII9d8ZKdedri02insOIir5pzceaYebyZTXFVjaLfBZ/F7UPGPsyeRJYajdRJVBNgVM1Lhl50SmZaiNTq14StxFZkox1XHDX21BEXbu9GE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765393155; c=relaxed/simple; bh=LM5cLcvrL97GVflWOVSbpoD+zNNmsN4BqP7GlTU2puY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SNn/eU3eviPSRbf644+ENh47PChws8C+xZYN8V1y9H0Rf6908zYNMMtH0ZEGsxKilcsp/uXGRGyFAAb1kxYAg1EeiONJLeBH8e7eD2+RVCJZpr+DkJfHVcsgdlbCd/0hrZ6rk6qolSV/KjguAkG7qqf987HHzMHE1dOcO7yrdVc= 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=cNLajhpQ; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=KTHq8e63; 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="cNLajhpQ"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="KTHq8e63" Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5BAIRFnj3358658 for ; Wed, 10 Dec 2025 18:59:10 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= 15Q9ck6ovkYMJTPJoDc2Dx9iK+2vuB4WM6abfMTFsKQ=; b=cNLajhpQxYwx8IGy 3VUuW2sqT6bFN0+n8VQpgG2Q9Aj/K7M/oIuCXaYFmAszSgtdUSGwOW9BEasPwq5C UBz1xkvcGtNuuAncLE+4zRttUzpiJcAmxo3A6A09ho/tS1NVebMvTlAxHran/e0p vHakOFPm7Wy6TncTFTxZfnvDQE34jiuPSa5pi/GvZaRqOGzAMvnsKoq1WwRLopAi iYAjCQJldsuRcJafpUhVPLoLvO1j8Eq8YLsx+Up3y18609K4Ev6Er+Z/YRO0O4bY zIA+dBfDL+T2EnTLeGJgjfYoVX6YlEx2Ngc9xuTtAYza9uF6caeYV2QA+FKhMg/k 5AOypQ== Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ay7pp1kfw-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 10 Dec 2025 18:59:10 +0000 (GMT) Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-29844d9e030so372245ad.2 for ; Wed, 10 Dec 2025 10:59:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1765393149; x=1765997949; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=15Q9ck6ovkYMJTPJoDc2Dx9iK+2vuB4WM6abfMTFsKQ=; b=KTHq8e63ygjvB/Cd4tROymN4ZLz2CpRe86Qk6QQjEL8qOTe5ou7bpka7UIOkBEKrLc ORYWKV8+c7wH8QTvngEGlKutNUR0hvGXco6VSqyBZKTJ2XJ8almTCNgWXZBOveD1RJae VtsVWFEpSMOjZ3XKjrgfnVbEWZvauuvDfOps/WZuZOcqPqMhVe/l/JgUdUdmKlc7UkpZ zB6m5tqD4ER5usEPUpdoAZtBfLFPOs4B6x7RxGXIPTYipdy+dM4aKPDEP9EFXax4sGb3 iqqerutiwMzK/IO1gioUQx2hdNpzrtJUpkEPNPMw3v9icwHe+TaPMH3+O2r+GmnUxpMy AQ7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765393149; x=1765997949; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=15Q9ck6ovkYMJTPJoDc2Dx9iK+2vuB4WM6abfMTFsKQ=; b=FyDy9VOfwJABcCOvz7scjxk4e2pPs9LQl9pktpouy22hovsyKLFWeA+Q3XPWSd+Lm2 tFEmi3oSJ8jL4igR6zYcnDA7j/9xyZyaoDZeTHovp7W5hX7SM7KozGjS5LNFMNCK+MYv 0Eqc6w27Og1Jj+cHIsfow+QaCjIV6EKp1ckspj6+hSwU/s1UyZfb1lWA9hbIjoP4+/N/ SyuJauFKVOWa0Qolx6nIW+U5IS3mvuxVe7zJlUIsH1PvYjegZ/0EQ067yeyvVrzwTrV+ +PKyyZ1nBeOejUm3s72mCfiYh1tUPjodmgn/DYjZe4D6SljnQav9WqNgfJoA3WtU85J5 lQew== X-Forwarded-Encrypted: i=1; AJvYcCU1ddlYuqO49wn+KnSty+dS8s3y0EY42B9hhrmxtPI3tegCAgoKCFfSoGELapdvl2BixrkeuwG+o1YBctY=@vger.kernel.org X-Gm-Message-State: AOJu0Yw5pmBqQty0fhXB8FWVKBXn84x8DNgLADXwNNYchCaPElF0Dm1S usxfXh+njDKlTkBZRiVDR8tB2u68sAoYXGiBIZGypcY4r9eyWAos5I+oHd3E/fnDb0D1jsEPako 0kwCJ464hi33vFimU4UMfcnBK5drPYAbezX/BUTPsBxQCHRBzuyet7X9rX+8OMAI84jc= X-Gm-Gg: ASbGnctXENF9uRb3qb6EvjVTopF3JRu0vP+txQ2joA0HjnsrrJ3UFHUzj5WUZFuxhIF MHZ/05/GsGHpGFhLYTznbrO3BPpEEYeOqv2uLxEevdaIA77ZcOQesVmxg4TKcT4781Nr4WcrnhI eKFcyD5KW2956x4oEvmR6wmVsUjSRatmSB7DYBihMQo7uuT0u/hHF1c3n0wQKtpcXimgia565Y2 Vd3bac5BJZTLu7r4LKCBUk1zmuxZo6FPLEN14Qm1bi2Pd3mAJFBGpjUZg+qtGgv1dnxH5RW8D8r M5zrYug7p6/nAsGlE5BMwpdOmw2tweoS5xFPKHk4ZY8eoyCLXQ5dgt1c1/PJl/hVqd4u1vUpagV ZnwY9ZF8qU3Ob+qO2gvcssoXvox2RCltPVewVKooSrE+evGAfBaQQg5a891gUqwUgsfRp5A== X-Received: by 2002:a05:7022:3847:b0:119:e56a:4fff with SMTP id a92af1059eb24-11f296c903fmr1367470c88.4.1765393149457; Wed, 10 Dec 2025 10:59:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IHmm7TOqb5Wsr9vjMnsG/AxVUxUEuqG+eQa6sUBm/Oe4q0VNYvOhbHKhM0y1KW6fNblIaPANQ== X-Received: by 2002:a05:7022:3847:b0:119:e56a:4fff with SMTP id a92af1059eb24-11f296c903fmr1367455c88.4.1765393148912; Wed, 10 Dec 2025 10:59:08 -0800 (PST) Received: from gu-dmadival-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-11f2e1bb45csm778008c88.1.2025.12.10.10.59.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Dec 2025 10:59:08 -0800 (PST) From: Deepa Guthyappa Madivalara Date: Wed, 10 Dec 2025 10:59:04 -0800 Subject: [PATCH v10 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: <20251210-av1d_stateful_v3-v10-1-cf4379a3dcff@oss.qualcomm.com> References: <20251210-av1d_stateful_v3-v10-0-cf4379a3dcff@oss.qualcomm.com> In-Reply-To: <20251210-av1d_stateful_v3-v10-0-cf4379a3dcff@oss.qualcomm.com> To: Mauro Carvalho Chehab , Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, kernel test robot , Deepa Guthyappa Madivalara , Bryan O'Donoghue , Nicolas Dufresne , Hans Verkuil X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1765393147; l=2597; i=deepa.madivalara@oss.qualcomm.com; s=20250814; h=from:subject:message-id; bh=LM5cLcvrL97GVflWOVSbpoD+zNNmsN4BqP7GlTU2puY=; b=Mc9ERiswvO7xPCDBJYucmt77ZdjvAUaLqQj25sFvp5KoxkrExFdX90DFU0El3qUbLeO+gw4KH yaMS62n24d+AUPz6lgcCBs+VUqV/EdIjdfK1OI+rbW8ek8Vy2QqSzdO X-Developer-Key: i=deepa.madivalara@oss.qualcomm.com; a=ed25519; pk=MOEXgyokievn+bgpHdS6Ixh/KQYyS90z2mqIbQ822FQ= X-Proofpoint-GUID: fcN9DTo8XtTpn79LaAzoZL8xzbUq6XEp X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMjEwMDE1NSBTYWx0ZWRfX3qK2P4sxc/Hb SoAsMlzF/0UjOnFtiJm2OmJThHXp8kHTYiVSspaiJ4nwnL32e18DD6iJjgisjnYnE+A6wd6VQHi qmwTDZ28PL9rmXlVsGEZt65et1TuDWjIYOXnrP0efvpGmj48+2iPVLuYyTPAv0C2l52Z7SnbXzP BLrNAgIikvf4lNjz34NprepnZtaWG35I8Ex2a+yIkHZX4KftJmpZbISpnx9vEQkziJZ9gGxWI9p Yk6hx5wuaAzJAMKq/LqI+KuF4PKcdWbp7HR+n58Bf/yEAC9R/rYqQbc8Z9JSknVnuO5vmp3GN9R H2QvNqoQHDpAitTJsRk40BX+YnHfKmBsqcNG40GAr3FzMOurGsuY9D5uESDkuIhI0XFGlDx0VWN 28ujTbY1aVFiFzpcMEalrFD1Xz+Bjw== X-Proofpoint-ORIG-GUID: fcN9DTo8XtTpn79LaAzoZL8xzbUq6XEp X-Authority-Analysis: v=2.4 cv=WaMBqkhX c=1 sm=1 tr=0 ts=6939c2fe cx=c_pps a=MTSHoo12Qbhz2p7MsH1ifg==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=IkcTkHD0fZMA:10 a=wP3pNCr1ah4A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=KKAkSRfTAAAA:8 a=QX4gbG5DAAAA:8 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=5q8hE9cQKCNJD2usWYQA:9 a=QEXdDO2ut3YA:10 a=GvdueXVYPmCkWapjIL-Q:22 a=cvBusfyB2V15izCimMoJ:22 a=AbAUZ8qAyYyZVLSsDulk:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-12-10_02,2025-12-09_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 clxscore=1015 impostorscore=0 spamscore=0 priorityscore=1501 phishscore=0 bulkscore=0 adultscore=0 suspectscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510240001 definitions=main-2512100155 Introduce a new pixel format, V4L2_PIX_FMT_AV1, to the Video4Linux2(V4L2) API. This format is intended for AV1 bitstreams in stateful decoding/encoding workflows. The fourcc code 'AV10' is used to distinguish this format from the existing V4L2_PIX_FMT_AV1_FRAME, which is used for stateless AV1 decoder implementation. Reviewed-by: Bryan O'Donoghue Reviewed-by: Nicolas Dufresne Reviewed-by: Hans Verkuil Signed-off-by: Deepa Guthyappa Madivalara --- Documentation/userspace-api/media/v4l/pixfmt-compressed.rst | 8 ++++++++ include/uapi/linux/videodev2.h | 1 + 2 files changed, 9 insertions(+) diff --git a/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst b/= Documentation/userspace-api/media/v4l/pixfmt-compressed.rst index c7efb0465db6480fe35be8557728c196e0e530f4..235f955d3cd5cfc83b0d3d424e6= 625b14c07266c 100644 --- a/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst +++ b/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst @@ -275,6 +275,14 @@ Compressed Formats of macroblocks to decode a full corresponding frame to the matching capture buffer. =20 + * .. _V4L2-PIX-FMT-AV1: + + - ``V4L2_PIX_FMT_AV1`` + - 'AV01' + - AV1 compressed video frame. This format is adapted for implementin= g AV1 + pipeline. The decoder implements stateful video decoder and expect= s one + temporal unit per buffer in OBU stream format. + 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 add08188f06890182a5c399a223c1ab0a546cae1..848e86617d5c87d76f15663403c= 2f3f0e709073b 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -775,6 +775,7 @@ struct v4l2_pix_format { #define V4L2_PIX_FMT_H264_SLICE v4l2_fourcc('S', '2', '6', '4') /* H264 pa= rsed slices */ #define V4L2_PIX_FMT_HEVC_SLICE v4l2_fourcc('S', '2', '6', '5') /* HEVC pa= rsed slices */ #define V4L2_PIX_FMT_AV1_FRAME v4l2_fourcc('A', 'V', '1', 'F') /* AV1 pars= ed frame */ +#define V4L2_PIX_FMT_AV1 v4l2_fourcc('A', 'V', '0', '1') /* AV1 */ #define V4L2_PIX_FMT_SPK v4l2_fourcc('S', 'P', 'K', '0') /* Sorenson = Spark */ #define V4L2_PIX_FMT_RV30 v4l2_fourcc('R', 'V', '3', '0') /* RealVideo= 8 */ #define V4L2_PIX_FMT_RV40 v4l2_fourcc('R', 'V', '4', '0') /* RealVideo= 9 & 10 */ --=20 2.34.1 From nobody Sun Dec 14 05:53:41 2025 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 10CDB329385 for ; Wed, 10 Dec 2025 18:59:11 +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=1765393153; cv=none; b=AYMQCLjVvZ8PZNjvt0BfSrUnhmLZbZ0N07Qk/zomT/9mWk9z4BlP+EV/H6p3s2UwTvU296ioe3HN1XelWsii5sIKb8Kh1sqGj18F02DSgys+cfzRjcTiGSZ+PhORWW2eYYbBOqGYjDKRCUClCj0oz5XlHkxPxbYB0ZkT+PX+VgU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765393153; c=relaxed/simple; bh=ShXSwBiBFlrxCS8qy3BkVJmHbLDT1NGKrhctV5UO0Ns=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=twTPGcyh4bOu8u36n0AKblgnJraqBHrfEX45BekvNJyIbZq/tKUnQTdM+oIy65HmcZs3q/8evPniO+GnEuB/zPv4amlr1Sdxfdy+MpUAhdnLjHHwHY3RFSE9/RtTV31QYm69WpjGsSRWh3Z91kcWBU57n521q/2e44tFT7dnD68= 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=he2I8Sv0; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=kDc+Q/pP; 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="he2I8Sv0"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="kDc+Q/pP" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5BAIRT3R3178110 for ; Wed, 10 Dec 2025 18:59:11 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= m5XieH/3awDfs/tFlFkM5r9w59nwt/TmWB9woGSGWLc=; b=he2I8Sv020anQ1xj EAXH4UC9qOQbFPoDHg1foM8g4hHclcQcrarF94OrSmYw5Utkp88zo6eJZsr02LpN At0q8JRl8IZsjQgH/eCeUD1DKUN/yYzblQL0P2cy4vURMkyO3OGFeMeMlMIsfUX9 WUXUhjldT0DKgQnigoeJaM56MrqLX4BTHdIVbFRxH4NQn+oIvRuLJO9ku3ZsvUiP gxOEE8eSlBNhVPhWtmJt+zL2pln6ybCHq/fvjYvikajl8VYEPUWEk0RDxHZnoH4I fPW+bCaIOwGzs3V8hXytPJqpw+5hWoWaxMkYpHh5+ItO328I94BQmSCenReRjfy9 AApugQ== Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ay1xp2s01-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 10 Dec 2025 18:59:11 +0000 (GMT) Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-349ad0019e6so37572a91.2 for ; Wed, 10 Dec 2025 10:59:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1765393150; x=1765997950; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=m5XieH/3awDfs/tFlFkM5r9w59nwt/TmWB9woGSGWLc=; b=kDc+Q/pPNvlon6WK00Whk4SUj4pY9IrrPMIbnUBiOveRBOoP2a2r1XrRROx1C/8zQJ oZzcSMRIzVvur+PwIu0xkN5WwsvhBe0wFT/HT+t0QVBD8u0zIvURCd6MooM4i7XG/r5Y Zhn7dQSyTCaTZbReAGohUH4abOkv3n/pp0SLVMjdv2jzbzgw8KbpWa7vW7y4UF/PX8jy wl2ceefeehXal4OaDpflFE7G3uyqQXjNS++Z4JQJ4tsy3hZ9igJg6+yUHw5UVzzL9WFu ys/lH39Uk6SpNbnj+yTHbsEo8LtfCEz0IwgSd0dlEHH+Yt6ipkGPhnBAQgacFDZlSAZJ vMEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765393150; x=1765997950; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=m5XieH/3awDfs/tFlFkM5r9w59nwt/TmWB9woGSGWLc=; b=X0lfE/Qa1SRUUKYhNaLYRp6+3R7keOE1BOZYNfh2BJaYbFjNb9UQEICIBGMLlHqSv6 iFIu9sGY+Ob09Cg64gIw/YgRLj3AYPaeutdG6MiJHmDaMBcEd9LWBbzOucJfVvGQjr0W g5wLN8sssx8MDFvReIxf2d90FKaLeeluqZPxSsmz9k4IApoKnaKkDjQ2WsVSVtqXH37O vsp4EFMzk9EDztAOfJGJLIH+THgsobaYg3Pk3uy2Jg5jpgowKEudvhvNV0JhCLMPJn5L XUjBOkkdVUDoe073U4zQ4OxE4LzkZhqaD49ofeAcplhbxMc89R3NLDFhuZePvTYC+RwZ zlJA== X-Forwarded-Encrypted: i=1; AJvYcCXW5+NPZyETmuF3suk6+B3PqPQagThFxEG7jHtk7PCQ7NABMZDz6MDFYKKp6kzgptXfluxLmU5CEJaHj18=@vger.kernel.org X-Gm-Message-State: AOJu0YwGSkJ/Ji3l9gpAtDdhIXLSueFJl2Gupo4dEYjj3IBrIR5PWovB C22suTQ0XTeJ0XWXo85BmihXysixLtFev92veggsocc4Qw64/O5QxuYX3KSIleqT2YDwWGbI0pY YfE+Jog5Z355nZXw3y/bK4/Vh0O9chUHmT16GR63ZK60je6D84ytmdPyqeubEBTb18zg= X-Gm-Gg: ASbGncuZBw3F1UNZSRL87SATnMD9eEaNNfd6cU0BSKqnAysugsZxoPBp5P44Ht1JvYc uyQaMiYROEmKPGDW+PZy/pl53bk1uyOBbeJuz0rSiEq1X1kq6nV7rDXwCWvD9ovhvUIOf5Mp9pv RJSh2BmhR/7ua+ms8uvSzx1f703uVDqjY4aAHQO5xAI7Og5R57ZEVSVHSICND/j2MzilGaeOElN bthRKbuuGYxVHB3N9Nfy/9LcINCznn47b2GAkDiCp61O8LrAxjRxoWmXgosMER355aTDNxQE3WL wG1pYDRyWOzdiAYOV3t2Ga7X6GMREnAarwcn/VwMqh0PzyP4Nhw3Y0pB4Ge8smRk/22Fc5jzgng DBGZafogc7sofghk6Yk90KF7jfnUBJqnpcKMHOIn2Mua8qYLVqahVC2XJ26PiFFadXubARg== X-Received: by 2002:a05:7022:6199:b0:11b:862d:8031 with SMTP id a92af1059eb24-11f295a78e1mr1412512c88.0.1765393150297; Wed, 10 Dec 2025 10:59:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IFDUVy4v2ck8fG4ASyXLL0u5NGQmJAA4GYlMhKQutxRxjlpvz+rDslvPmHmqJUAPRUaIyhO/A== X-Received: by 2002:a05:7022:6199:b0:11b:862d:8031 with SMTP id a92af1059eb24-11f295a78e1mr1412486c88.0.1765393149703; Wed, 10 Dec 2025 10:59:09 -0800 (PST) Received: from gu-dmadival-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-11f2e1bb45csm778008c88.1.2025.12.10.10.59.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Dec 2025 10:59:09 -0800 (PST) From: Deepa Guthyappa Madivalara Date: Wed, 10 Dec 2025 10:59:05 -0800 Subject: [PATCH v10 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: <20251210-av1d_stateful_v3-v10-2-cf4379a3dcff@oss.qualcomm.com> References: <20251210-av1d_stateful_v3-v10-0-cf4379a3dcff@oss.qualcomm.com> In-Reply-To: <20251210-av1d_stateful_v3-v10-0-cf4379a3dcff@oss.qualcomm.com> To: Mauro Carvalho Chehab , Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, kernel test robot , Deepa Guthyappa Madivalara , Bryan O'Donoghue , Nicolas Dufresne , Hans Verkuil X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1765393147; l=1333; i=deepa.madivalara@oss.qualcomm.com; s=20250814; h=from:subject:message-id; bh=ShXSwBiBFlrxCS8qy3BkVJmHbLDT1NGKrhctV5UO0Ns=; b=cWZGZ5dfpD+JXutJnSGEF7+dwjGHRCJ/eKBewagAakBh5FrzhTJEpxaCKUDKLboQPSYjvo0N2 R5fbyrWTiDVDCRzmpNAEBDbcWdA/kXSG1wfd/ZzShjYblSI0QDB03NW X-Developer-Key: i=deepa.madivalara@oss.qualcomm.com; a=ed25519; pk=MOEXgyokievn+bgpHdS6Ixh/KQYyS90z2mqIbQ822FQ= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMjEwMDE1NSBTYWx0ZWRfX3BZiQQaseeR9 mdWrXE3+DNXvsEkqdcV4zsqnW90RsV1OAjX3Oml8f0tEYEros7L3+6U5oy872x20hGgdGpi/741 3vM8nr4Fs8cBSszuoR+SJ1r+ZKr6gEZtuWJoOwURB3H0rGshXrb0Fvg8BFCFkH1/lR12xURN/OQ OTWiEQBBoVeAywom/6hq9gMbdzevisvWHjnLKqC1WJYhL3aLURaG+2lyy9xCL51XLbETkIxxM0C +EPrQMyUx2Yp9OnkaAuD4vUdjEUDBh4h0pAOu2araSYzQe+KYdax21kBGk9Dt4kxw7VesIfvvBV yAXCoSlOKya2DcpNzIkJPxCtDAqqvnWRqwLaAAtaPjvFw7vHxaK4LoYaKe49PkndbrelDEXhOAc jhA25jPlQozuFUFuMBZdjkuLZQ3lAw== X-Proofpoint-ORIG-GUID: b42H3rT3TN5C8vsQtTzHpjImrvgwVL1h X-Proofpoint-GUID: b42H3rT3TN5C8vsQtTzHpjImrvgwVL1h X-Authority-Analysis: v=2.4 cv=A/Zh/qWG c=1 sm=1 tr=0 ts=6939c2ff cx=c_pps a=0uOsjrqzRL749jD1oC5vDA==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=IkcTkHD0fZMA:10 a=wP3pNCr1ah4A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=KKAkSRfTAAAA:8 a=QX4gbG5DAAAA:8 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=3VFMuRvh7oFGMF0ZDtIA:9 a=QEXdDO2ut3YA:10 a=mQ_c8vxmzFEMiUWkPHU9:22 a=cvBusfyB2V15izCimMoJ:22 a=AbAUZ8qAyYyZVLSsDulk:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-12-10_02,2025-12-09_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 adultscore=0 spamscore=0 malwarescore=0 bulkscore=0 lowpriorityscore=0 phishscore=0 suspectscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510240001 definitions=main-2512100155 Add a descriptive string for the AV1 pixel format to v4l_fill_fmtdesc(), enabling proper reporting of AV1 support via VIDIOC_ENUM_FMT. Reviewed-by: Bryan O'Donoghue Reviewed-by: Nicolas Dufresne Reviewed-by: Hans Verkuil Signed-off-by: Deepa Guthyappa Madivalara --- drivers/media/v4l2-core/v4l2-ioctl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core= /v4l2-ioctl.c index 98512ea4cc5b9d725e1851af2ed38df85bb4fa8c..37d33d4a363d7eb02119b84bf36= 8dac8e7a8bd8e 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -1544,6 +1544,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 Dec 14 05:53:41 2025 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 D4F9032938D for ; Wed, 10 Dec 2025 18:59:12 +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=1765393154; cv=none; b=JiVRAm8oua/fiVvGrlQaxAa/pcPYwc4wFGLQhfuIv0YjKktYB9fXmvO0krC+4bWfHvLQ60OEAYQK3bE/g0LgOPa3dYG7T7IPRh3w7POVs/Cz1XJ/JzGfPzROs0BshIynz5wZ8pyqkjM9/A+a9a/RqsgHhzDKApr9MrHKEuV/MR8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765393154; c=relaxed/simple; bh=ZzLWnQqjoAVg12SIvNuW50tWkuSYyh0LEHEq8s/ae88=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=oPjosdNqQuPuaJzBrHPKMXQ0HXA4GLE7cheJPAzRsBMzUlpAwCkxswq2J72eTNxf2MFdwB0vEDhHADXJ8l93VdD0phgpMds2gw7iRxJpKUYb1oJj+Ompx6WrnxITc+x4RSL0Chf+jHyCROUkle7YPUcc2rEL0XuiFQSlG1/cPoQ= 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=KRGmBN0a; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=FLOCUImM; 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="KRGmBN0a"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="FLOCUImM" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5BAIRSf93192571 for ; Wed, 10 Dec 2025 18:59:12 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= q3EutyLeiYCI3bG9eXMAuR5758pTs9yVzHame8NFSjg=; b=KRGmBN0agug7XPrp Zusw4fecQvstIyIYnAaIFMx+xCbyzCuJ0tlF0DCCwQAgOMdlku6dtW7WHZDKVJBw naSfMxAoX2u+ieOeYhOMNCNAUe7f7ffN+qwoORhU0DhnbDrdBfSc//Os/8ua+7JB HbYCAyMf8lw/BL+mtriqwEJlXdgPJ8rerwmIqUtVYgJlXGgiEjjks1nZZmU1Rodd Ms6NaB+z14iNTIHU2nc3gaLaorJB3dt4T0erEcQM+Hws7KZbUJmcVJOoAqLutWu6 2tEx8hYg8P12K3tZPlRTcb7bf+ik7Jp/3fmC9k4Ad5KjxyjNOQ5R8fTnNDWl5yhc kwiw9Q== 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 4ay505j5gk-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 10 Dec 2025 18:59:12 +0000 (GMT) Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-297df5c10ffso672305ad.1 for ; Wed, 10 Dec 2025 10:59:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1765393151; x=1765997951; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=q3EutyLeiYCI3bG9eXMAuR5758pTs9yVzHame8NFSjg=; b=FLOCUImMsSZmBkjsmd7LGyed3uPV7Hr/IbGknLvJedTSS9aDuXjr+6J5NDRvsKTL4E bLy9k+ZGRF8UvRaraYiX/leCKCZz+wFtY57xS6vFPwPg6lJ1KudOE44g/FXAl6VLSGOy IF2tSAPmNLnIPhsieZWfKfwaFmvaZQP0QM7ofqvK2BpRfnyFbDpOfvBIRzr+RSyM88oy bgS4h2GYFAVam0Yyz94bEp2vnGmQlLVE5uS1FCJuS8hJyKSm54L9QUhdS8vOijpK862I UYih60SpiUmhNQl9Oc1o79qDPnr0Uz3sylKW7nvhMsyq0cm0rtqP9gq/HrIRvXzPEELx 9QKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765393151; x=1765997951; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=q3EutyLeiYCI3bG9eXMAuR5758pTs9yVzHame8NFSjg=; b=ZstSewGAXRJuyecBJwdRmVWIuqTxyh9kXSU425fYJd1eTOVMhMcpP1QCDHVAi2Q5J0 /XzwqzOpAwIMHsDP5sO6NeVzexJg3V1KoKIs6X/7nxhKYakoDNqP1lqa8zH7gZ5r1YyJ 0STQ2W8cKK0fEa7LXNGpLwdmHMomMBIrO9/jjj8uQz4SssfhLN1D4IQ+go0O7dU/heS5 S6WXj3KQEc64cAvpJ4N78j2+aP34018c6dnZTmntVu0cR9HgiE+cE0/diDN13rKIhHBi iWcDCmVQxZ+iGn7N2RNBl2EzW3a4dVhqCk1ayvXpynbbupWWDSoq9Yd/R1u2QrS+ymYN Ovcw== X-Forwarded-Encrypted: i=1; AJvYcCV8wX7Yslw9i/zgZIsR/k2I6P9YO6p3HCJApu0ZYxHtxWUyfpgq54/N/GcVW6lQbrPYXgCyBzNXqQIyk3E=@vger.kernel.org X-Gm-Message-State: AOJu0Yy3+iwSn59QV8OkW/2fYdY9b1afrF7nO6eVckENGgZTDImJMHLy BNkpg/3c8rYIAKQ/fxLXVpxkgn8r4VvaT7OWHm1PZGOG32Q66lMZAEZWPQgLshQ1rCOOSiSiOQM rV9dfVdx5WZn0Di0769Ic2ZHTssh3uk+Kv5RPOaAthsBthMkJmx2thAT+WRZLVwHnCVQ= X-Gm-Gg: ASbGncu2J3FOyged+zlOBYZ631Vkr9s3VWFDtkHBbmWdCO9otvCBmcqSypIeTH+ysHP Ykd56lMF7xnFSGpTYzc4lBOmvU8kxOQ5/QaNlTkIK2OfEkPEKUbQCQz4SdBrJP3KSGIzHy8B90s O5EWN0QXDLmBSW1hlcxiBMx7E7l5MRWvZJtPzneAWVPeaghWiE65hKf/IZAB5QsxL633Qv/Gb1E V/GCDIo4DcrYcT/Q95LmBP5eQPcNF2B6PowHnttUOkugldgDVmPhtJAZvMOLyHuRlDp7Kz22pJQ XydyjKqLHBXVxrAofOQOhYGcxDbqBoQr2+cjLV6wc24uKW656nAx3eg2RVYCkGAakKHWXEXzRBk n6FEjNvJEmmhxUIBZt2lWisPmpGn7TXx5RUy5sMh2oV+y/1BihO5Ps0G8tWSFkODTssFSog== X-Received: by 2002:a05:7022:6292:b0:11e:3e9:3e89 with SMTP id a92af1059eb24-11f296f137cmr1453929c88.7.1765393151033; Wed, 10 Dec 2025 10:59:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IHbxQ9s+ELF48zWl604gUsHP3kqvTJH7OXh1g8BFJ5lVqMdgh33Kglkcx5bo+5tKwPAqzWqxQ== X-Received: by 2002:a05:7022:6292:b0:11e:3e9:3e89 with SMTP id a92af1059eb24-11f296f137cmr1453916c88.7.1765393150420; Wed, 10 Dec 2025 10:59:10 -0800 (PST) Received: from gu-dmadival-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-11f2e1bb45csm778008c88.1.2025.12.10.10.59.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Dec 2025 10:59:10 -0800 (PST) From: Deepa Guthyappa Madivalara Date: Wed, 10 Dec 2025 10:59:06 -0800 Subject: [PATCH v10 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: <20251210-av1d_stateful_v3-v10-3-cf4379a3dcff@oss.qualcomm.com> References: <20251210-av1d_stateful_v3-v10-0-cf4379a3dcff@oss.qualcomm.com> In-Reply-To: <20251210-av1d_stateful_v3-v10-0-cf4379a3dcff@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=1765393147; l=9696; i=deepa.madivalara@oss.qualcomm.com; s=20250814; h=from:subject:message-id; bh=ZzLWnQqjoAVg12SIvNuW50tWkuSYyh0LEHEq8s/ae88=; b=1ImWw0ibYyPSrDyizN5tteezougkA0Gs38+PKOAPZyd1F7iXRrNNmsBl+EvVFo8XNvMMIsRqY 5vfGq0FpGzcCLw0OWHDLEjRXV+z1jsrsFVCuuFjXECgNvgP9tgZwKIT X-Developer-Key: i=deepa.madivalara@oss.qualcomm.com; a=ed25519; pk=MOEXgyokievn+bgpHdS6Ixh/KQYyS90z2mqIbQ822FQ= X-Proofpoint-ORIG-GUID: BsDY_4X0D30e6lEn-IWJJ0MWLJTPzqQQ X-Authority-Analysis: v=2.4 cv=Bu2QAIX5 c=1 sm=1 tr=0 ts=6939c300 cx=c_pps a=JL+w9abYAAE89/QcEU+0QA==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=IkcTkHD0fZMA:10 a=wP3pNCr1ah4A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=KKAkSRfTAAAA:8 a=EUspDBNiAAAA:8 a=bBoHIU1i-hzBuKh-O0cA:9 a=QEXdDO2ut3YA:10 a=324X-CrmTo6CU4MGRt3R:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-GUID: BsDY_4X0D30e6lEn-IWJJ0MWLJTPzqQQ X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMjEwMDE1NSBTYWx0ZWRfX6HhYzFge73IB xhCMANabCJvp7iNJ/1ornZp0vcQjpGcUN5PHs46PIosfl7WinlZ4AU2vo2cLlIzSSf7SbVstOpl u31qfDMskCXJtBX4WrUeFfgdvlWGjs0X4rJD+v5O6G5PODgR9HQTATU3Lcwd/Y/06yVcCPhtAMP 7as1erBszmDpj9+I/BTOvEL6AVoGxYV2+K2QYZXFLBJmWtwMEJhbcd73dt2v6iSqqZUB5lPtFtd IF1uDhKXQIcvd0bLS+Dsw98i0o/p2z4OB6qIH4e/5lf1CWg3V9llrc0gj+YoT+MtuU4rkmZWhdd ugWttn6Vg2ooMT9m5/OXzqJbl2bMwX4m1x6uqzbMRsHZWVHApMdAariBjBvlvPLWgdl2/anE07j s3BupV5azgTMmDr6juaVl5uCHR1bLA== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-12-10_02,2025-12-09_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 spamscore=0 phishscore=0 bulkscore=0 impostorscore=0 suspectscore=0 malwarescore=0 priorityscore=1501 clxscore=1015 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510240001 definitions=main-2512100155 Extend iris decoder driver to support format V4L2_PIX_FMT_AV1. This change updates the format enumeration (VIDIOC_ENUM_FMT) and allows setting AV1 format via VIDIOC_S_FMT for gen2 and beyond. Gen1 iris hardware decoder does not support AV1 format. Reviewed-by: Bryan O'Donoghue Reviewed-by: Dikshita Agarwal Signed-off-by: Deepa Guthyappa Madivalara --- .../platform/qcom/iris/iris_hfi_gen2_defines.h | 1 + drivers/media/platform/qcom/iris/iris_instance.h | 1 + .../platform/qcom/iris/iris_platform_common.h | 2 ++ .../media/platform/qcom/iris/iris_platform_gen1.c | 22 ++++++++++++++++- .../media/platform/qcom/iris/iris_platform_gen2.c | 28 ++++++++++++++++++= +++- drivers/media/platform/qcom/iris/iris_vdec.c | 23 ++++-------------- 6 files changed, 56 insertions(+), 21 deletions(-) diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_defines.h b/dri= vers/media/platform/qcom/iris/iris_hfi_gen2_defines.h index 1b6a4dbac828ffea53c1be0d3624a033c283c972..3d56f257bc5620aacec2bb7e112= 53dc7c83b7db9 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_defines.h +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_defines.h @@ -139,6 +139,7 @@ enum hfi_codec_type { HFI_CODEC_DECODE_HEVC =3D 3, HFI_CODEC_ENCODE_HEVC =3D 4, HFI_CODEC_DECODE_VP9 =3D 5, + HFI_CODEC_DECODE_AV1 =3D 7, }; =20 enum hfi_picture_type { diff --git a/drivers/media/platform/qcom/iris/iris_instance.h b/drivers/med= ia/platform/qcom/iris/iris_instance.h index 62fbb30691ff967212022308fa53ff221fa24ce9..7e4f5f1dd8921c57db039fbd4bc= 2f321891348db 100644 --- a/drivers/media/platform/qcom/iris/iris_instance.h +++ b/drivers/media/platform/qcom/iris/iris_instance.h @@ -19,6 +19,7 @@ enum iris_fmt_type_out { IRIS_FMT_H264, IRIS_FMT_HEVC, IRIS_FMT_VP9, + IRIS_FMT_AV1, }; =20 enum iris_fmt_type_cap { diff --git a/drivers/media/platform/qcom/iris/iris_platform_common.h b/driv= ers/media/platform/qcom/iris/iris_platform_common.h index 8d8cdb56a3c7722c06287d4d10feed14ba2b254c..6e8e762bd5cf704d7932536bea5= 6d4bdfc1bc598 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_common.h +++ b/drivers/media/platform/qcom/iris/iris_platform_common.h @@ -217,6 +217,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; const 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_gen1.c b/driver= s/media/platform/qcom/iris/iris_platform_gen1.c index 34cbeb8f52e248b6aec3e0ee911e14d50df07cce..712515b0f32942a55f3c9f392e6= 95a91bc2f475e 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_gen1.c +++ b/drivers/media/platform/qcom/iris/iris_platform_gen1.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 #include "iris_platform_sc7280.h" =20 @@ -19,7 +20,22 @@ #define BITRATE_PEAK_DEFAULT (BITRATE_DEFAULT * 2) #define BITRATE_STEP 100 =20 -static const struct platform_inst_fw_cap inst_fw_cap_sm8250_dec[] =3D { +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, /* .max, .min and .value are set via platform data */ @@ -337,6 +353,8 @@ const 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), @@ -386,6 +404,8 @@ const struct iris_platform_data sc7280_data =3D { .dma_mask =3D 0xe0000000 - 1, .fwname =3D "qcom/vpu/vpu20_p1.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_platform_gen2.c b/driver= s/media/platform/qcom/iris/iris_platform_gen2.c index c1989240c248601c34b84f508f1b72d72f81260a..010f6b804e0a516429ed49db7b2= ed227a1e2c3be 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 const struct platform_inst_fw_cap inst_fw_cap_sm8550_dec[] =3D { { .cap_id =3D PROFILE_H264, @@ -759,6 +778,8 @@ const 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), @@ -809,7 +830,6 @@ const 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_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), .dec_op_int_buf_tbl =3D sm8550_dec_op_int_buf_tbl, @@ -851,6 +871,8 @@ const 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), @@ -933,6 +955,8 @@ const struct iris_platform_data sm8750_data =3D { .dma_mask =3D 0xe0000000 - 1, .fwname =3D "qcom/vpu/vpu35_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), @@ -1019,6 +1043,8 @@ const struct iris_platform_data qcs8300_data =3D { .dma_mask =3D 0xe0000000 - 1, .fwname =3D "qcom/vpu/vpu30_p4_s6.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_qcs8300, .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_vdec.c b/drivers/media/p= latform/qcom/iris/iris_vdec.c index 69ffe52590d3acf8d595f856fb1dbd81f3073721..bf7b9c621cb7255367c06f144c0= 3c3faa69372e0 100644 --- a/drivers/media/platform/qcom/iris/iris_vdec.c +++ b/drivers/media/platform/qcom/iris/iris_vdec.c @@ -67,21 +67,6 @@ void iris_vdec_inst_deinit(struct iris_inst *inst) kfree(inst->fmt_src); } =20 -static const struct iris_fmt iris_vdec_formats_out[] =3D { - [IRIS_FMT_H264] =3D { - .pixfmt =3D V4L2_PIX_FMT_H264, - .type =3D V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, - }, - [IRIS_FMT_HEVC] =3D { - .pixfmt =3D V4L2_PIX_FMT_HEVC, - .type =3D V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, - }, - [IRIS_FMT_VP9] =3D { - .pixfmt =3D V4L2_PIX_FMT_VP9, - .type =3D V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, - }, -}; - static const struct iris_fmt iris_vdec_formats_cap[] =3D { [IRIS_FMT_NV12] =3D { .pixfmt =3D V4L2_PIX_FMT_NV12, @@ -101,8 +86,8 @@ find_format(struct iris_inst *inst, u32 pixfmt, u32 type) unsigned int i; switch (type) { case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE: - fmt =3D iris_vdec_formats_out; - size =3D ARRAY_SIZE(iris_vdec_formats_out); + fmt =3D inst->core->iris_platform_data->inst_iris_fmts; + size =3D inst->core->iris_platform_data->inst_iris_fmts_size; break; case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE: fmt =3D iris_vdec_formats_cap; @@ -131,8 +116,8 @@ find_format_by_index(struct iris_inst *inst, u32 index,= u32 type) =20 switch (type) { case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE: - fmt =3D iris_vdec_formats_out; - size =3D ARRAY_SIZE(iris_vdec_formats_out); + fmt =3D inst->core->iris_platform_data->inst_iris_fmts; + size =3D inst->core->iris_platform_data->inst_iris_fmts_size; break; case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE: fmt =3D iris_vdec_formats_cap; --=20 2.34.1 From nobody Sun Dec 14 05:53:41 2025 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 6A165329E42 for ; Wed, 10 Dec 2025 18:59:14 +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=1765393157; cv=none; b=C93G19JxsIPSZojSvTTlE7cqTF91JRAqlnYtofBBy2POmCSwzwHBZyUpLenYzIOxjq5xkFQC6HCpydFmWW9QbMJ66D7hzVLAZ0QIacYL1x1wEcIsfyhEo6BdTj7db4RUrTldZW9AyhR0fjVrNAo6CJyKBjzrM476X1mxU5Of54A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765393157; c=relaxed/simple; bh=+Jevinkxi8RYxQw9HTFdjzX33xVD84HmiKFXLRnC7YM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=OBuHCr+nKe/bZG0xy5T2+TE0G1yM0tVMnD0CyjG5fHJ3ZxWqBjtiYTmpVfmQiOTOUgdR2bKm6vg0l6B3aVkYGtDv2LTgsW6nor8/zng5RP7ozHgh5S80TrIj15C0ZmQkSoS14EVbiflapoxfpzpSo6pZ5IgzSAtKQd3KlhiA7mc= 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=jb0vJBLg; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=UJJx1IE7; 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="jb0vJBLg"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="UJJx1IE7" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5BAIR9uR4034130 for ; Wed, 10 Dec 2025 18:59:13 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= UzGTmLY3q6IZ3g4mj0QW2dO30teXdwjlp8jHYhLjNYY=; b=jb0vJBLgUl0UK0X5 2zlnYx2FrXV01ysVdtcM2YLXRiJgiYYuD9RaVlht4+X0uc1BfBLhX40noR9GuXsu FMXmGxEzhBAkumz9F2PlRv2i4HrNHkHf849m5JU83BXgt72nVjcb5aBO0aKS9FD7 VzLmz+7GAOSdWOZO4v4H7optWP4WW221fKeJM/s/3B/YVWqfcQbVW3t9Kk/WQB54 Zie/3hsP7S0vtTI4zHgM32RxKo1EPog2wnFXBVBdUBK5sHgMZYkCdetwQLzjqPCW irFhqb/uIAWQrn1r47ni8HzErq+BZF8REBt47Jb2iXYRbp4Eq3q0PWe+Dlo/mSSR taZumg== Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ay63fstv2-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 10 Dec 2025 18:59:13 +0000 (GMT) Received: by mail-pj1-f72.google.com with SMTP id 98e67ed59e1d1-3436265c11aso48152a91.1 for ; Wed, 10 Dec 2025 10:59:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1765393152; x=1765997952; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=UzGTmLY3q6IZ3g4mj0QW2dO30teXdwjlp8jHYhLjNYY=; b=UJJx1IE7dujnIQ3Q/AwtPYMc9ExIw7B7bfCkiOsSz2f2R3pfqqd5XGHybAAABruDm4 n+6gbyqC5LiuQA5eNOxRIbhIRpnSBGaQxqKGKusG6gyRRMBPGBGYVYYSNim/ublv5EFQ 0iLut3YcasmaSX7GsW24XpOcy0Og6txTYbrqVsGnfl3DFzK6GCLPu/ixIuTh8XB6zfhg M1OS0/36QRdAAW6ZDPVJdHWKKuQBRuLELMRWNtCixXgpq5VhqKN9MH/u2Km/Nml634VU 0JN0585xdn/zjgFvtnOXK+WPqOLAMf6sTnnlUlM7Ft9Aq3qYeCut/OjG8EzxmOFUC5xr l4EQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765393152; x=1765997952; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=UzGTmLY3q6IZ3g4mj0QW2dO30teXdwjlp8jHYhLjNYY=; b=TqYNP9KOJTFgeZMQPuHNrkwJwbOEBnD3RD97p2IOmlLv+GrFZUiyt3bQVjFEB6wh3e inTnWT/sS7UwGC53waOSgrROKD8DZxzcp5JRD+GF1rvBt0G4TxmTmaIMe7hFwgxNn8Xu JpkSN+Ms9f8oNOGzlryy0gozcsYnxV+UenexqXuHoS7B4FtriuLBFk2lcaUGexCfvgiJ nDjMbtjxpQ8luVPSLbRlo89xB4JcyTaKDF+QXPpMroPoYUGPrsUF/p7MQ6JDQ9c9hQ/p 55TjlXwoqorCzesfoidRC+c48rW6R+w6X62uQNed4aw9D/ZySBVgoP+bBzskPDg7h+NZ A4KA== X-Forwarded-Encrypted: i=1; AJvYcCX78msUhT5vJGN+2h0HJc23hXRcfYGrqcefS3rdiMlzyPF6JkoTLWNXEgTs8HNTCgs/qy2HPnqNWyrJkdY=@vger.kernel.org X-Gm-Message-State: AOJu0Yys4Z8M6g23wL2ps/y/U8pydb5WRlNKKf2vpTRCm35WPf7rqTSE 7tCiPvH+Yz9JSnxr+9bhAuRzf+fhkch9l2K5LfpEp+/ChGlU8/1MQdzrHcyNcAQFAuS2vTXPP0G 5qh7KQbfonw/qss0HrUk1Q/nMP4tlDqEmV5264lgsm1jVaOLs9ad0wU/mBDD7bJpzRm4= X-Gm-Gg: ASbGnct4xW7HPi9JfOAe0KYhdwVM0sXJF79NjSyIjxnM6KkAR9a+hGOM8edVAFgt0Cd 5B4h4IGoVSrjl+43dJqxCD7o+MrckboG4YTbVKPpe76VRPnT4kViDt57RCbnPQS3VyNdYgKY0QA qIMyHC3UaWfyY0tcMT9/V6iJczL9bqZOJP4oiYKjTQQxhm2lp4oMmWJaL8M/0S401rO+dJgnk15 BWoAr7vvBfFJhS3tLxGbCb6Voda7UjdYZopee69bcTu5PmHC9oRU3iHDzPgNg4UPagVV+s3zfMp FhEB9OdG1hnwclUVPzgBn2eoPvZoigdlDDWx8KRDCn4MUn5bH31OtrYiPsIPBFf6ifSO5Z/9y8s l06+Ob9zjABGmCJp+RxBQZDjcFQHdU3zGqyl07KONl7zXACQJDGFuAQeQNqvlEW4vOn5BOg== X-Received: by 2002:a05:7022:f89:b0:11e:3e9:3e9b with SMTP id a92af1059eb24-11f296d755dmr1488911c88.6.1765393151834; Wed, 10 Dec 2025 10:59:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IEg0uWhHxhZxwCLnac0yyLix+2pwT+/v6qB1mb9OI/KC+PxORhBDm4NtGc1hArnDLuUUOsdmw== X-Received: by 2002:a05:7022:f89:b0:11e:3e9:3e9b with SMTP id a92af1059eb24-11f296d755dmr1488900c88.6.1765393151212; Wed, 10 Dec 2025 10:59:11 -0800 (PST) Received: from gu-dmadival-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-11f2e1bb45csm778008c88.1.2025.12.10.10.59.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Dec 2025 10:59:10 -0800 (PST) From: Deepa Guthyappa Madivalara Date: Wed, 10 Dec 2025 10:59:07 -0800 Subject: [PATCH v10 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: <20251210-av1d_stateful_v3-v10-4-cf4379a3dcff@oss.qualcomm.com> References: <20251210-av1d_stateful_v3-v10-0-cf4379a3dcff@oss.qualcomm.com> In-Reply-To: <20251210-av1d_stateful_v3-v10-0-cf4379a3dcff@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=1765393147; l=24878; i=deepa.madivalara@oss.qualcomm.com; s=20250814; h=from:subject:message-id; bh=+Jevinkxi8RYxQw9HTFdjzX33xVD84HmiKFXLRnC7YM=; b=coQ4d2HA0T32WeyMeSfGdGD/Zc4zYkcjL6lLbXa9582sEE5xxU8RyUs3adfMPSWUJ0devVOx6 pmfs9VJDdIVBjfBAevhb+3e84E9XqzRFq9oZVAm25w4mR439sg/eM3g X-Developer-Key: i=deepa.madivalara@oss.qualcomm.com; a=ed25519; pk=MOEXgyokievn+bgpHdS6Ixh/KQYyS90z2mqIbQ822FQ= X-Proofpoint-GUID: ipJ6NfP-3wlIxRjLpvUjeHV_fSsnARit X-Authority-Analysis: v=2.4 cv=Y6P1cxeN c=1 sm=1 tr=0 ts=6939c301 cx=c_pps a=RP+M6JBNLl+fLTcSJhASfg==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=IkcTkHD0fZMA:10 a=wP3pNCr1ah4A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=KKAkSRfTAAAA:8 a=EUspDBNiAAAA:8 a=6GFc9FHXEM_1LolK-DMA:9 a=QEXdDO2ut3YA:10 a=iS9zxrgQBfv6-_F4QbHw:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-ORIG-GUID: ipJ6NfP-3wlIxRjLpvUjeHV_fSsnARit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMjEwMDE1NSBTYWx0ZWRfX4vbOendc2w1X Y0AZtaLHOaNhMVLrftCZMSxg86rOCO1T0aaKd+uSYwfClN+ZXuEikbwSX13K7WH8WLM1EYvMt5K n8ihujTzleGEfGDTH8UjbxvnWVyp6Jo6zPilxang1wgs0SZDO+JnNoAdJlnSLnRTlsyUjOYkr/y NJrMea1TMaaCW7B7lwhqKl8yHcDddA1+/3Peu6CfpG3gC6u8yyQmkSsZFRMtcjhvNzf1zjZDNwD WNxQDbKA5j8MUzdxKAraDTZkPFP/NnRQNGGQl3qgDSz11lyxAUGesNviwrYdLLt9UHveL5CvV4u 8Vj7UaekUZi3WmRMYYhjJlckM7VDfStdrOGDWwQr0aoXZaKXP8AY7MbFVyvra/O4jC8l68/USKk GXBgfNP6nGH6GpToyqEgLu8IdXvFsw== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-12-10_02,2025-12-09_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 adultscore=0 spamscore=0 lowpriorityscore=0 suspectscore=0 clxscore=1015 phishscore=0 bulkscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510240001 definitions=main-2512100155 Defining platform specific capabilities specific to AV1 decoder. Set and subscribe to manadatory properties to firmware for AV1. Reviewed-by: Bryan O'Donoghue Reviewed-by: Dikshita Agarwal Signed-off-by: Deepa Guthyappa Madivalara --- drivers/media/platform/qcom/iris/iris_buffer.h | 1 + drivers/media/platform/qcom/iris/iris_ctrls.c | 8 ++ drivers/media/platform/qcom/iris/iris_hfi_common.h | 3 + .../platform/qcom/iris/iris_hfi_gen2_command.c | 85 ++++++++++++- .../platform/qcom/iris/iris_hfi_gen2_defines.h | 8 ++ .../platform/qcom/iris/iris_hfi_gen2_response.c | 22 ++++ .../platform/qcom/iris/iris_platform_common.h | 11 ++ .../media/platform/qcom/iris/iris_platform_gen2.c | 133 +++++++++++++++++= ++++ drivers/media/platform/qcom/iris/iris_vidc.c | 1 + 9 files changed, 270 insertions(+), 2 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 c0b3a09ad3e3dfb0a47e3603a8089cf61390fda8..87f929442ec658f5d17646698f0= bfa2acfe420d9 100644 --- a/drivers/media/platform/qcom/iris/iris_ctrls.c +++ b/drivers/media/platform/qcom/iris/iris_ctrls.c @@ -98,6 +98,10 @@ static enum platform_inst_fw_cap_type iris_get_cap_id(u3= 2 id) return B_FRAME_QP_H264; case V4L2_CID_MPEG_VIDEO_HEVC_B_FRAME_QP: return B_FRAME_QP_HEVC; + case V4L2_CID_MPEG_VIDEO_AV1_PROFILE: + return PROFILE_AV1; + case V4L2_CID_MPEG_VIDEO_AV1_LEVEL: + return LEVEL_AV1; default: return INST_FW_CAP_MAX; } @@ -185,6 +189,10 @@ static u32 iris_get_v4l2_id(enum platform_inst_fw_cap_= type cap_id) return V4L2_CID_MPEG_VIDEO_H264_B_FRAME_QP; case B_FRAME_QP_HEVC: return V4L2_CID_MPEG_VIDEO_HEVC_B_FRAME_QP; + case PROFILE_AV1: + return V4L2_CID_MPEG_VIDEO_AV1_PROFILE; + case LEVEL_AV1: + return V4L2_CID_MPEG_VIDEO_AV1_LEVEL; default: return 0; } diff --git a/drivers/media/platform/qcom/iris/iris_hfi_common.h b/drivers/m= edia/platform/qcom/iris/iris_hfi_common.h index b51471fb32c70acee44c37f8e9dce0c6bc0b6ccc..3edb5ae582b49bea2e2408c4a5c= fc0a742adc05f 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_common.h +++ b/drivers/media/platform/qcom/iris/iris_hfi_common.h @@ -141,6 +141,9 @@ struct hfi_subscription_params { u32 profile; u32 level; u32 tier; + u32 drap; + u32 film_grain; + u32 super_block; }; =20 u32 iris_hfi_get_v4l2_color_primaries(u32 hfi_primaries); diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c b/dri= vers/media/platform/qcom/iris/iris_hfi_gen2_command.c index 6a772db2ec33fb002d8884753a41dc98b3a8439d..b00594bb3c8871b80a5d7c0e4f4= a84d983fd77e8 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c @@ -10,6 +10,7 @@ =20 #define UNSPECIFIED_COLOR_FORMAT 5 #define NUM_SYS_INIT_PACKETS 8 +#define NUM_COMV_AV1 18 =20 #define SYS_INIT_PKT_SIZE (sizeof(struct iris_hfi_header) + \ NUM_SYS_INIT_PACKETS * (sizeof(struct iris_hfi_packet) + sizeof(u32))) @@ -121,6 +122,7 @@ static u32 iris_hfi_gen2_get_port_from_buf_type(struct = iris_inst *inst, case BUF_COMV: case BUF_NON_COMV: case BUF_LINE: + case BUF_PARTIAL: return HFI_PORT_BITSTREAM; case BUF_OUTPUT: case BUF_DPB: @@ -380,6 +382,9 @@ static int iris_hfi_gen2_set_profile(struct iris_inst *= inst, u32 plane) case V4L2_PIX_FMT_H264: profile =3D inst->fw_caps[PROFILE_H264].value; break; + case V4L2_PIX_FMT_AV1: + profile =3D inst->fw_caps[PROFILE_AV1].value; + break; } =20 inst_hfi_gen2->src_subcr_params.profile =3D profile; @@ -409,6 +414,9 @@ static int iris_hfi_gen2_set_level(struct iris_inst *in= st, u32 plane) case V4L2_PIX_FMT_H264: level =3D inst->fw_caps[LEVEL_H264].value; break; + case V4L2_PIX_FMT_AV1: + level =3D inst->fw_caps[LEVEL_AV1].value; + break; } =20 inst_hfi_gen2->src_subcr_params.level =3D level; @@ -496,10 +504,12 @@ static int iris_hfi_gen2_set_linear_stride_scanline(s= truct iris_inst *inst, u32 =20 static int iris_hfi_gen2_set_tier(struct iris_inst *inst, u32 plane) { - struct iris_inst_hfi_gen2 *inst_hfi_gen2 =3D to_iris_inst_hfi_gen2(inst); u32 port =3D iris_hfi_gen2_get_port(inst, V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLA= NE); + struct iris_inst_hfi_gen2 *inst_hfi_gen2 =3D to_iris_inst_hfi_gen2(inst); u32 tier =3D inst->fw_caps[TIER].value; =20 + tier =3D (inst->codec =3D=3D V4L2_PIX_FMT_AV1) ? inst->fw_caps[TIER_AV1].= value : + inst->fw_caps[TIER].value; inst_hfi_gen2->src_subcr_params.tier =3D tier; =20 return iris_hfi_gen2_session_set_property(inst, @@ -525,6 +535,40 @@ static int iris_hfi_gen2_set_frame_rate(struct iris_in= st *inst, u32 plane) sizeof(u32)); } =20 +static int iris_hfi_gen2_set_film_grain(struct iris_inst *inst, u32 plane) +{ + u32 port =3D iris_hfi_gen2_get_port(inst, V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLA= NE); + struct iris_inst_hfi_gen2 *inst_hfi_gen2 =3D to_iris_inst_hfi_gen2(inst); + u32 film_grain =3D inst->fw_caps[FILM_GRAIN].value; + + inst_hfi_gen2->src_subcr_params.film_grain =3D film_grain; + + return iris_hfi_gen2_session_set_property(inst, + HFI_PROP_AV1_FILM_GRAIN_PRESENT, + HFI_HOST_FLAGS_NONE, + port, + HFI_PAYLOAD_U32_ENUM, + &film_grain, + sizeof(u32)); +} + +static int iris_hfi_gen2_set_super_block(struct iris_inst *inst, u32 plane) +{ + u32 port =3D iris_hfi_gen2_get_port(inst, V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLA= NE); + struct iris_inst_hfi_gen2 *inst_hfi_gen2 =3D to_iris_inst_hfi_gen2(inst); + u32 super_block =3D inst->fw_caps[SUPER_BLOCK].value; + + inst_hfi_gen2->src_subcr_params.super_block =3D super_block; + + return iris_hfi_gen2_session_set_property(inst, + HFI_PROP_AV1_SUPER_BLOCK_ENABLED, + HFI_HOST_FLAGS_NONE, + port, + HFI_PAYLOAD_U32_ENUM, + &super_block, + sizeof(u32)); +} + static int iris_hfi_gen2_session_set_config_params(struct iris_inst *inst,= u32 plane) { const struct iris_platform_data *pdata =3D inst->core->iris_platform_data; @@ -548,6 +592,9 @@ static int iris_hfi_gen2_session_set_config_params(stru= ct iris_inst *inst, u32 p {HFI_PROP_LINEAR_STRIDE_SCANLINE, iris_hfi_gen2_set_linear_stride_sc= anline }, {HFI_PROP_TIER, iris_hfi_gen2_set_tier = }, {HFI_PROP_FRAME_RATE, iris_hfi_gen2_set_frame_rate = }, + {HFI_PROP_AV1_FILM_GRAIN_PRESENT, iris_hfi_gen2_set_film_grain = }, + {HFI_PROP_AV1_SUPER_BLOCK_ENABLED, iris_hfi_gen2_set_super_block = }, + {HFI_PROP_OPB_ENABLE, iris_hfi_gen2_set_opb_enable = }, }; =20 if (inst->domain =3D=3D DECODER) { @@ -561,6 +608,9 @@ static int iris_hfi_gen2_session_set_config_params(stru= ct iris_inst *inst, u32 p } else if (inst->codec =3D=3D V4L2_PIX_FMT_VP9) { config_params =3D pdata->dec_input_config_params_vp9; config_params_size =3D pdata->dec_input_config_params_vp9_size; + } else if (inst->codec =3D=3D V4L2_PIX_FMT_AV1) { + config_params =3D pdata->dec_input_config_params_av1; + config_params_size =3D pdata->dec_input_config_params_av1_size; } else { return -EINVAL; } @@ -615,6 +665,9 @@ static int iris_hfi_gen2_session_set_codec(struct iris_= inst *inst) break; case V4L2_PIX_FMT_VP9: codec =3D HFI_CODEC_DECODE_VP9; + break; + case V4L2_PIX_FMT_AV1: + codec =3D HFI_CODEC_DECODE_AV1; } =20 iris_hfi_gen2_packet_session_property(inst, @@ -780,6 +833,11 @@ static int iris_hfi_gen2_subscribe_change_param(struct= iris_inst *inst, u32 plan change_param_size =3D core->iris_platform_data->dec_input_config_params_vp9_size; break; + case V4L2_PIX_FMT_AV1: + change_param =3D core->iris_platform_data->dec_input_config_params_av1; + change_param_size =3D + core->iris_platform_data->dec_input_config_params_av1_size; + break; } =20 payload[0] =3D HFI_MODE_PORT_SETTINGS_CHANGE; @@ -862,6 +920,16 @@ static int iris_hfi_gen2_subscribe_change_param(struct= iris_inst *inst, u32 plan payload_size =3D sizeof(u32); payload_type =3D HFI_PAYLOAD_U32; break; + case HFI_PROP_AV1_FILM_GRAIN_PRESENT: + payload[0] =3D subsc_params.film_grain; + payload_size =3D sizeof(u32); + payload_type =3D HFI_PAYLOAD_U32; + break; + case HFI_PROP_AV1_SUPER_BLOCK_ENABLED: + payload[0] =3D subsc_params.super_block; + payload_size =3D sizeof(u32); + payload_type =3D HFI_PAYLOAD_U32; + break; default: prop_type =3D 0; ret =3D -EINVAL; @@ -917,6 +985,11 @@ static int iris_hfi_gen2_subscribe_property(struct iri= s_inst *inst, u32 plane) subscribe_prop_size =3D core->iris_platform_data->dec_output_prop_vp9_size; break; + case V4L2_PIX_FMT_AV1: + subcribe_prop =3D core->iris_platform_data->dec_output_prop_av1; + subscribe_prop_size =3D + core->iris_platform_data->dec_output_prop_av1_size; + break; } } =20 @@ -1092,6 +1165,8 @@ static u32 iris_hfi_gen2_buf_type_from_driver(u32 dom= ain, enum iris_buffer_type return HFI_BUFFER_ARP; case BUF_VPSS: return HFI_BUFFER_VPSS; + case BUF_PARTIAL: + return HFI_BUFFER_PARTIAL_DATA; default: return 0; } @@ -1104,7 +1179,13 @@ static int iris_set_num_comv(struct iris_inst *inst) u32 num_comv; =20 caps =3D core->iris_platform_data->inst_caps; - num_comv =3D caps->num_comv; + + /* + * AV1 needs more comv buffers than other codecs. + * Update accordingly. + */ + num_comv =3D (inst->codec =3D=3D V4L2_PIX_FMT_AV1) ? + NUM_COMV_AV1 : caps->num_comv; =20 return core->hfi_ops->session_set_property(inst, HFI_PROP_COMV_BUFFER_COUNT, diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_defines.h b/dri= vers/media/platform/qcom/iris/iris_hfi_gen2_defines.h index 3d56f257bc5620aacec2bb7e11253dc7c83b7db9..5f1f1a7eb91f3827bb85a703199= efd04c6dfc116 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_defines.h +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_defines.h @@ -89,10 +89,18 @@ enum hfi_seq_header_mode { #define HFI_PROP_DEC_START_FROM_RAP_FRAME 0x03000169 #define HFI_PROP_NO_OUTPUT 0x0300016a #define HFI_PROP_BUFFER_MARK 0x0300016c +#define HFI_PROP_WORST_COMPRESSION_RATIO 0x03000174 +#define HFI_PROP_WORST_COMPLEXITY_FACTOR 0x03000175 #define HFI_PROP_RAW_RESOLUTION 0x03000178 #define HFI_PROP_TOTAL_PEAK_BITRATE 0x0300017C +#define HFI_PROP_AV1_FILM_GRAIN_PRESENT 0x03000180 +#define HFI_PROP_AV1_SUPER_BLOCK_ENABLED 0x03000181 +#define HFI_PROP_AV1_OP_POINT 0x03000182 #define HFI_PROP_OPB_ENABLE 0x03000184 +#define HFI_PROP_AV1_TILE_ROWS_COLUMNS 0x03000187 +#define HFI_PROP_AV1_DRAP_CONFIG 0x03000189 #define HFI_PROP_COMV_BUFFER_COUNT 0x03000193 +#define HFI_PROP_AV1_UNIFORM_TILE_SPACING 0x03000197 #define HFI_PROP_END 0x03FFFFFF =20 #define HFI_SESSION_ERROR_BEGIN 0x04000000 diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c b/dr= ivers/media/platform/qcom/iris/iris_hfi_gen2_response.c index 2f1f118eae4f6462ab1aa1d16844b34e6e699f1e..eb3373f0ad4a1b26fb847db0244= 9ec8d8cb3bdbb 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c @@ -54,6 +54,8 @@ static u32 iris_hfi_gen2_buf_type_to_driver(struct iris_i= nst *inst, return BUF_SCRATCH_2; case HFI_BUFFER_PERSIST: return BUF_PERSIST; + case HFI_BUFFER_PARTIAL_DATA: + return BUF_PARTIAL; default: return 0; } @@ -72,6 +74,7 @@ static bool iris_hfi_gen2_is_valid_hfi_buffer_type(u32 bu= ffer_type) case HFI_BUFFER_DPB: case HFI_BUFFER_PERSIST: case HFI_BUFFER_VPSS: + case HFI_BUFFER_PARTIAL_DATA: return true; default: return false; @@ -596,6 +599,10 @@ static void iris_hfi_gen2_read_input_subcr_params(stru= ct iris_inst *inst) inst->fw_caps[PROFILE_H264].value =3D subsc_params.profile; inst->fw_caps[LEVEL_H264].value =3D subsc_params.level; break; + case V4L2_PIX_FMT_AV1: + inst->fw_caps[PROFILE_AV1].value =3D subsc_params.profile; + inst->fw_caps[LEVEL_AV1].value =3D subsc_params.level; + break; } =20 inst->fw_caps[POC].value =3D subsc_params.pic_order_cnt; @@ -608,6 +615,11 @@ static void iris_hfi_gen2_read_input_subcr_params(stru= ct iris_inst *inst) iris_inst_change_state(inst, IRIS_INST_ERROR); } =20 + if (inst->codec =3D=3D V4L2_PIX_FMT_AV1) { + inst->fw_caps[FILM_GRAIN].value =3D subsc_params.film_grain; + inst->fw_caps[SUPER_BLOCK].value =3D subsc_params.super_block; + } + inst->fw_min_count =3D subsc_params.fw_min_count; inst->buffers[BUF_OUTPUT].min_count =3D iris_vpu_buf_count(inst, BUF_OUTP= UT); inst->buffers[BUF_OUTPUT].size =3D pixmp_op->plane_fmt[0].sizeimage; @@ -711,6 +723,12 @@ static int iris_hfi_gen2_handle_session_property(struc= t iris_inst *inst, case HFI_PROP_NO_OUTPUT: inst_hfi_gen2->hfi_frame_info.no_output =3D 1; break; + case HFI_PROP_AV1_FILM_GRAIN_PRESENT: + inst_hfi_gen2->src_subcr_params.film_grain =3D pkt->payload[0]; + break; + case HFI_PROP_AV1_SUPER_BLOCK_ENABLED: + inst_hfi_gen2->src_subcr_params.super_block =3D pkt->payload[0]; + break; case HFI_PROP_QUALITY_MODE: case HFI_PROP_STAGE: case HFI_PROP_PIPE: @@ -841,6 +859,10 @@ static void iris_hfi_gen2_init_src_change_param(struct= iris_inst *inst) subsc_params->profile =3D inst->fw_caps[PROFILE_H264].value; subsc_params->level =3D inst->fw_caps[LEVEL_H264].value; break; + case V4L2_PIX_FMT_AV1: + subsc_params->profile =3D inst->fw_caps[PROFILE_AV1].value; + subsc_params->level =3D inst->fw_caps[LEVEL_AV1].value; + break; } =20 subsc_params->pic_order_cnt =3D inst->fw_caps[POC].value; diff --git a/drivers/media/platform/qcom/iris/iris_platform_common.h b/driv= ers/media/platform/qcom/iris/iris_platform_common.h index 6e8e762bd5cf704d7932536bea56d4bdfc1bc598..14a2f4dbe38ab271c30df301e20= b78b20ac08f12 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_common.h +++ b/drivers/media/platform/qcom/iris/iris_platform_common.h @@ -103,6 +103,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, @@ -241,6 +248,8 @@ struct iris_platform_data { unsigned int dec_input_config_params_hevc_size; const u32 *dec_input_config_params_vp9; unsigned int dec_input_config_params_vp9_size; + const u32 *dec_input_config_params_av1; + unsigned int dec_input_config_params_av1_size; const u32 *dec_output_config_params; unsigned int dec_output_config_params_size; const u32 *enc_input_config_params; @@ -255,6 +264,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 010f6b804e0a516429ed49db7b2ed227a1e2c3be..b2d8559dd2b85dbc6aa427c15dd= 665d8d355f177 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 const struct platform_inst_fw_cap inst_fw_cap_sm8= 550_dec[] =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 const struct platform_inst_fw_cap inst_fw_cap_s= m8550_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 const struct platform_inst_fw_cap inst_fw_cap_s= m8550_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, @@ -699,6 +783,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, @@ -736,11 +833,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 { @@ -805,6 +909,10 @@ const 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 @@ -830,6 +938,10 @@ const 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), + .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), .dec_op_int_buf_tbl =3D sm8550_dec_op_int_buf_tbl, @@ -898,6 +1010,10 @@ const 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 @@ -923,6 +1039,9 @@ const 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), @@ -981,6 +1100,10 @@ const struct iris_platform_data sm8750_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 @@ -1006,6 +1129,9 @@ const struct iris_platform_data sm8750_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), @@ -1070,6 +1196,10 @@ const struct iris_platform_data qcs8300_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 @@ -1095,6 +1225,9 @@ const struct iris_platform_data qcs8300_data =3D { .dec_output_prop_vp9 =3D sm8550_vdec_subscribe_output_properties_vp9, .dec_output_prop_vp9_size =3D ARRAY_SIZE(sm8550_vdec_subscribe_output_properties_vp9), + .dec_output_prop_av1 =3D sm8550_vdec_subscribe_output_properties_av1, + .dec_output_prop_av1_size =3D + ARRAY_SIZE(sm8550_vdec_subscribe_output_properties_av1), =20 .dec_ip_int_buf_tbl =3D sm8550_dec_ip_int_buf_tbl, .dec_ip_int_buf_tbl_size =3D ARRAY_SIZE(sm8550_dec_ip_int_buf_tbl), diff --git a/drivers/media/platform/qcom/iris/iris_vidc.c b/drivers/media/p= latform/qcom/iris/iris_vidc.c index c9b881923ef1831baaa86bea7c13c9734dbe6e4b..dfd94f4a84a9410d1e6b6a7c503= c9d7bc4c7a1af 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 Dec 14 05:53:41 2025 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 49A55329C77 for ; Wed, 10 Dec 2025 18:59:14 +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=1765393157; cv=none; b=m9ZFw5rCZX/BQNCAw2mi7YJjY2wLYt/d63sCAaSdf8GxzeIRGgo0Jmrf4onOys0NTK1DvkNufoQTJI8rFIrLXrPmYj6SYkE7yK0RRIhm9rzGa+HpvbL5tN6fV7IORP41sYh/1bR/JPGdTcYIFilJLUOb0/CbLzua6dDfbWlwulU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765393157; c=relaxed/simple; bh=fTkurkuNrJZkDzeoFQ0NTL4A3MjLIBcgXI+/4voJeAQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ba+QI2Cgz18V+eJihjJR6NF/XtnzFUF022RM3euIIFr4wElYmgP97hD+EUjr+hvgKVKlUMrravdC9VCg/HDH1LkgJrZxXrAO//ALVLRblL6ypYTD2DhkSuPQexVicJmxWmgXY5c/+yaPbnk9q/09IRA22IUFNZu0d28NRdcbxPI= 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=Yd9vqakR; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=X5UJ9xac; 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="Yd9vqakR"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="X5UJ9xac" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5BAIRT3U3178110 for ; Wed, 10 Dec 2025 18:59:13 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= cEcsYsit1dRgvZ0wf/p/8EfE3Mkov766qHMPRrIP/sY=; b=Yd9vqakRAQEgS0aq Q/BBoN5+g0aemAFp+ZaPhrlwXQgd4BVgOJZ4MKLPbPm54VtVtA6d/p92Ii9Sc8xm DsKmlKa2tsW9+GWjZGrorjuo68IW5P6D8dSFNO57IZtcmKiA3kV3tvaD8dKRV0Dr n828GG1wm9SHrJjWCmj3JI23XUvVmLMn569vBcIO7OeRhgBAmdsi8RIMDkBnM9zL soZ2wfDzSy05Qlyj3i7G9a6IS8/zteJXnmQsWTL0L0JmZfDK6FyhBn4YdHITSpxi oCRiaaO5daPQ/2Bc3yjk3D80dvahU+qz/3Cgrrr4Hnb9eoZsQi6O2VwdNyefLOey o/kXCg== Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ay1xp2s0a-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 10 Dec 2025 18:59:13 +0000 (GMT) Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-297fc324999so464325ad.3 for ; Wed, 10 Dec 2025 10:59:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1765393153; x=1765997953; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=cEcsYsit1dRgvZ0wf/p/8EfE3Mkov766qHMPRrIP/sY=; b=X5UJ9xacn5E439j++4W8vQR2M4j1Mu1vX4r2Gn9x+wOUXQi7Kybo7AkLOYDVyRPIHO TK7xBs/FbmWp1Bo22TtNTYlF7F5/j+BXPOQxGO/nvgML07Q8ggyaG18XC4/AxuIAXEIk xul4KbguyvXcoTHiM7jswEm8vrToF2JVxpGsDlSR/AKDWHYAY0S75fRt6wcduoHXQJuU bvg8y3D54BLVVBbCBd5yeL5JrhcitoC77jb/taIotVtAVB0wmZJiVnXbF3fqOT+1RMFO YhrI6QwmEO7QRApZgOZ+uN/vNLwX/tb7YBTnU/V6jzTMrjG3FEfLqwlBsr3OS9n4/jOk nsoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765393153; x=1765997953; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=cEcsYsit1dRgvZ0wf/p/8EfE3Mkov766qHMPRrIP/sY=; b=rvtVVDVNcpBFG85v7rgBLmkI1BBmPbgpRm7a/n478Db06pU2VHKw4AP9c/vx7I8A7T H5EzsmE1SO2gQKMdNYA77WsWbbI7dK51A3xpO/gvYTMH7ZcZWH9unM4HUcJkfud2R9mT 2ocU7hKmwmXjO5P2OPYZjMi/Rs5oP77rfMpIZ4Z0FXoaulhctxNM6zIyCqPyLO5g6Mg/ K1+J2QzZafnVR0CkaKC1dD4fCF9fYF5Z55OuaYB6kWQs/B5AEYZnxGQSNr4eragOYVQe 0q+Jzb/s+PL3ATKkFofdZMJLt9AOVNX6+NwWdrmFiHDtvJCjSayQCs++MLqpqoPHyc4+ 1wlw== X-Forwarded-Encrypted: i=1; AJvYcCVNe7YsdW/6BFMneGZ8SeLenR27xx99vLPz1Erk4udEYWYu8VLwgIyS67CARkgB1eDvhbpWPKuG7ElRBwM=@vger.kernel.org X-Gm-Message-State: AOJu0YxDPYZWJayv9ZoPy+q11rZJT7vrc/rLjHiDrt4EMztBnK+5nfIA kyctOMcVmYPOAzdjuy+ZpWBzB4kGR51tMFyJ1ZLHfBbH7BXMQMrw29dY8VH1teInMSZUcmnt2Fe rzl/8sTQ6hP1xTKuVPRhOpOgA64/bAtuoug9ptnHjkzuLfJ9TAqbhrI8PuaEnUEVS+kc= X-Gm-Gg: AY/fxX4v7bceIbQNc/AGTyp7iUFX5bJO3FjiBxp+fr6uJRXdjEoaEA/l+rOili8LFIC UzfC5pcxypa9zduHz2EZZonA5Y8VtkIHrQfUESjMTSqUZEmKy2hAOEZeOvv+uNDtMA6Of02PLPq KD7u9a2D0msinQI6VBxlLv5G+hNcy4HcG1S8QrZ9eJyKQ+LIPgmKlTh4XIUHOxgjpbYW8/xWAvC M1dyUia0EkXg6kJTyH/8nbzxTyMspinPJGLK1B4bq0L5d9iYwiGiBEPyZ5m/9bYhPnk1P4jzYWT iFCFyJshL5Hhsce8G8hM50EB3p/iIkseFigZ5TUgVFmEMwlyXNWvu63a2K+flyLIjTLlmoSBLJ8 kQgoFUdNFhN6pWOUgC1yA+8X7trKdCC/jeTXT6lJDGz3HU10ZOcDdq7/NJYbbNgXdF28aGQ== X-Received: by 2002:a05:7300:72d0:b0:2ab:ca55:89bd with SMTP id 5a478bee46e88-2ac0555c9ebmr1640617eec.4.1765393152711; Wed, 10 Dec 2025 10:59:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IGVmxXFq2VQyVHJFbe5OEtCpodNvzO6/ifOwp8RYXF4OeDLGSxYPgoShWziNHP+WDm+cLyKxg== X-Received: by 2002:a05:7300:72d0:b0:2ab:ca55:89bd with SMTP id 5a478bee46e88-2ac0555c9ebmr1640608eec.4.1765393152091; Wed, 10 Dec 2025 10:59:12 -0800 (PST) Received: from gu-dmadival-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-11f2e1bb45csm778008c88.1.2025.12.10.10.59.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Dec 2025 10:59:11 -0800 (PST) From: Deepa Guthyappa Madivalara Date: Wed, 10 Dec 2025 10:59:08 -0800 Subject: [PATCH v10 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: <20251210-av1d_stateful_v3-v10-5-cf4379a3dcff@oss.qualcomm.com> References: <20251210-av1d_stateful_v3-v10-0-cf4379a3dcff@oss.qualcomm.com> In-Reply-To: <20251210-av1d_stateful_v3-v10-0-cf4379a3dcff@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=1765393147; l=23772; i=deepa.madivalara@oss.qualcomm.com; s=20250814; h=from:subject:message-id; bh=fTkurkuNrJZkDzeoFQ0NTL4A3MjLIBcgXI+/4voJeAQ=; b=kEkBXV+NfFfTG23RzaQL/ZZG/CmrCgMpWM2B9FXgzzjxKyNoSVoSV0MPASgxk8fIqg5wECZNF T9K0mpEwaotArx2ftuOiZlDF2Ow5SUyj9jz0MYIMKwtiBvZ8QvJR4mo X-Developer-Key: i=deepa.madivalara@oss.qualcomm.com; a=ed25519; pk=MOEXgyokievn+bgpHdS6Ixh/KQYyS90z2mqIbQ822FQ= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMjEwMDE1NSBTYWx0ZWRfXz4FlBR2wCw49 7XvCxp0hsOhOvwMMEW5Fzwiq4e6JBk0pbQYchXp6Myne50cUTaKTvdkALJHQXt0fp+sIGS61rYr 6R6SxksJv2oD8+KwSAIeypTqsyffFL7id/pHS0tMavrcyyJlOdQQri1edIEXONdYBqpvgpt31kO eqmG0x2KOU6ynMJ7sL0Kd07l8V5jM4JnjQHP5UJgn0iSGVDoBm43SsR1gwkjz7O7p9GLMpraG0J beD9iTDOuM7h0VQGQaUOqasVl8WMjiaS0Cai3G2HHe7kF0/Pfs2Q0E6MTknlKeYLi01DZJlfTpQ IbjWmt9wcvERggXmMa9rVJmeb2KaqcF3TDMwViKdg1lSDgYbnY/p3PS1MFTn1IgkUFRNwtDYm2b E0FrMSjOLmBFR4NmPUILFUFrVGD8jw== X-Proofpoint-ORIG-GUID: 4_O7XfW391awTDgfzKmouXqm4x65IXO5 X-Proofpoint-GUID: 4_O7XfW391awTDgfzKmouXqm4x65IXO5 X-Authority-Analysis: v=2.4 cv=A/Zh/qWG c=1 sm=1 tr=0 ts=6939c301 cx=c_pps a=MTSHoo12Qbhz2p7MsH1ifg==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=IkcTkHD0fZMA:10 a=wP3pNCr1ah4A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=3eCS73FKbHPN4UNaIXEA:9 a=QEXdDO2ut3YA:10 a=GvdueXVYPmCkWapjIL-Q:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-12-10_02,2025-12-09_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 adultscore=0 spamscore=0 malwarescore=0 bulkscore=0 lowpriorityscore=0 phishscore=0 suspectscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510240001 definitions=main-2512100155 Implement internal buffer count and size calculations for AV1 decoder for all the buffer types required by the AV1 decoder, including BIN, COMV, PERSIST, LINE, and PARTIAL. This ensures the hardware decoder has properly allocated memory for AV1 decoding operations, enabling correct AV1 video playback. Reviewed-by: Dikshita Agarwal Signed-off-by: Deepa Guthyappa Madivalara --- drivers/media/platform/qcom/iris/iris_buffer.h | 1 + drivers/media/platform/qcom/iris/iris_vpu_buffer.c | 299 +++++++++++++++++= +++- drivers/media/platform/qcom/iris/iris_vpu_buffer.h | 116 ++++++++ 3 files changed, 412 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/qcom/iris/iris_buffer.h b/drivers/media= /platform/qcom/iris/iris_buffer.h index 5ef365d9236c7cbdee24a4614789b3191881968b..75bb767761824c4c02e0df9b765= 896cc093be333 100644 --- a/drivers/media/platform/qcom/iris/iris_buffer.h +++ b/drivers/media/platform/qcom/iris/iris_buffer.h @@ -27,6 +27,7 @@ struct iris_inst; * @BUF_SCRATCH_1: buffer to store decoding/encoding context data for HW * @BUF_SCRATCH_2: buffer to store encoding context data for HW * @BUF_VPSS: buffer to store VPSS context data for HW + * @BUF_PARTIAL: buffer for AV1 IBC data * @BUF_TYPE_MAX: max buffer types */ enum iris_buffer_type { diff --git a/drivers/media/platform/qcom/iris/iris_vpu_buffer.c b/drivers/m= edia/platform/qcom/iris/iris_vpu_buffer.c index 4463be05ce165adef6b152eb0c155d2e6a7b3c36..f4985790bae4104ec5769e2de16= a56727af462ba 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu_buffer.c +++ b/drivers/media/platform/qcom/iris/iris_vpu_buffer.c @@ -9,6 +9,17 @@ #include "iris_hfi_gen2_defines.h" =20 #define HFI_MAX_COL_FRAME 6 +#define HFI_COLOR_FORMAT_YUV420_NV12_UBWC_Y_TILE_HEIGHT (8) +#define HFI_COLOR_FORMAT_YUV420_NV12_UBWC_Y_TILE_WIDTH (32) +#define HFI_COLOR_FORMAT_YUV420_NV12_UBWC_UV_TILE_HEIGHT (8) +#define HFI_COLOR_FORMAT_YUV420_NV12_UBWC_UV_TILE_WIDTH (16) +#define HFI_COLOR_FORMAT_YUV420_TP10_UBWC_Y_TILE_HEIGHT (4) +#define HFI_COLOR_FORMAT_YUV420_TP10_UBWC_Y_TILE_WIDTH (48) +#define HFI_COLOR_FORMAT_YUV420_TP10_UBWC_UV_TILE_HEIGHT (4) +#define HFI_COLOR_FORMAT_YUV420_TP10_UBWC_UV_TILE_WIDTH (24) +#define AV1D_SIZE_BSE_COL_MV_64x64 512 +#define AV1D_SIZE_BSE_COL_MV_128x128 2816 +#define UBWC_TILE_SIZE 256 =20 #ifndef SYSTEM_LAL_TILE10 #define SYSTEM_LAL_TILE10 192 @@ -39,6 +50,31 @@ static u32 hfi_buffer_bin_h264d(u32 frame_width, u32 fra= me_height, u32 num_vpp_p return size_h264d_hw_bin_buffer(n_aligned_w, n_aligned_h, num_vpp_pipes); } =20 +static u32 size_av1d_hw_bin_buffer(u32 frame_width, u32 frame_height, u32 = num_vpp_pipes) +{ + u32 size_yuv, size_bin_hdr, size_bin_res; + + size_yuv =3D ((frame_width * frame_height) <=3D BIN_BUFFER_THRESHOLD) ? + ((BIN_BUFFER_THRESHOLD * 3) >> 1) : + ((frame_width * frame_height * 3) >> 1); + size_bin_hdr =3D size_yuv * AV1_CABAC_HDR_RATIO_HD_TOT; + size_bin_res =3D size_yuv * AV1_CABAC_RES_RATIO_HD_TOT; + size_bin_hdr =3D ALIGN(size_bin_hdr / num_vpp_pipes, + DMA_ALIGNMENT) * num_vpp_pipes; + size_bin_res =3D ALIGN(size_bin_res / num_vpp_pipes, + DMA_ALIGNMENT) * num_vpp_pipes; + + return size_bin_hdr + size_bin_res; +} + +static u32 hfi_buffer_bin_av1d(u32 frame_width, u32 frame_height, u32 num_= vpp_pipes) +{ + u32 n_aligned_h =3D ALIGN(frame_height, 16); + u32 n_aligned_w =3D ALIGN(frame_width, 16); + + return size_av1d_hw_bin_buffer(n_aligned_w, n_aligned_h, num_vpp_pipes); +} + static u32 size_h265d_hw_bin_buffer(u32 frame_width, u32 frame_height, u32= num_vpp_pipes) { u32 product =3D frame_width * frame_height; @@ -110,6 +146,26 @@ static u32 hfi_buffer_comv_h265d(u32 frame_width, u32 = frame_height, u32 _comv_bu return (_size * (_comv_bufcount)) + 512; } =20 +static u32 num_lcu(u32 frame_width, u32 frame_height, u32 lcu_size) +{ + return ((frame_width + lcu_size - 1) / lcu_size) * + ((frame_height + lcu_size - 1) / lcu_size); +} + +static u32 hfi_buffer_comv_av1d(u32 frame_width, u32 frame_height, u32 com= v_bufcount) +{ + u32 size; + + size =3D 2 * ALIGN(max(num_lcu(frame_width, frame_height, 64) * + AV1D_SIZE_BSE_COL_MV_64x64, + num_lcu(frame_width, frame_height, 128) * + AV1D_SIZE_BSE_COL_MV_128x128), + DMA_ALIGNMENT); + size *=3D comv_bufcount; + + return size; +} + static u32 size_h264d_bse_cmd_buf(u32 frame_height) { u32 height =3D ALIGN(frame_height, 32); @@ -122,7 +178,7 @@ static u32 size_h265d_bse_cmd_buf(u32 frame_width, u32 = frame_height) { u32 _size =3D ALIGN(((ALIGN(frame_width, LCU_MAX_SIZE_PELS) / LCU_MIN_SIZ= E_PELS) * (ALIGN(frame_height, LCU_MAX_SIZE_PELS) / LCU_MIN_SIZE_PELS)) * - NUM_HW_PIC_BUF, DMA_ALIGNMENT); + NUM_HW_PIC_BUF, DMA_ALIGNMENT); _size =3D min_t(u32, _size, H265D_MAX_SLICE + 1); _size =3D 2 * _size * SIZE_H265D_BSE_CMD_PER_BUF; =20 @@ -174,6 +230,20 @@ static u32 hfi_buffer_persist_h264d(void) DMA_ALIGNMENT); } =20 +static u32 hfi_buffer_persist_av1d(u32 max_width, u32 max_height, u32 tota= l_ref_count) +{ + u32 comv_size, size; + + comv_size =3D hfi_buffer_comv_av1d(max_width, max_height, total_ref_coun= t); + size =3D ALIGN((SIZE_AV1D_SEQUENCE_HEADER * 2 + SIZE_AV1D_METADATA + + AV1D_NUM_HW_PIC_BUF * (SIZE_AV1D_TILE_OFFSET + SIZE_AV1D_QM) + + AV1D_NUM_FRAME_HEADERS * (SIZE_AV1D_FRAME_HEADER + + 2 * SIZE_AV1D_PROB_TABLE) + comv_size + HDR10_HIST_EXTRADATA_SIZE + + SIZE_AV1D_METADATA * AV1D_NUM_HW_PIC_BUF), DMA_ALIGNMENT); + + return ALIGN(size, DMA_ALIGNMENT); +} + static u32 hfi_buffer_non_comv_h264d(u32 frame_width, u32 frame_height, u3= 2 num_vpp_pipes) { u32 size_bse =3D size_h264d_bse_cmd_buf(frame_height); @@ -459,6 +529,182 @@ static u32 hfi_buffer_line_h264d(u32 frame_width, u32= frame_height, return ALIGN((size + vpss_lb_size), DMA_ALIGNMENT); } =20 +static u32 size_av1d_lb_opb_wr1_nv12_ubwc(u32 frame_width, u32 frame_heigh= t) +{ + u32 size, y_width, y_width_a =3D 128; + + y_width =3D ALIGN(frame_width, y_width_a); + + size =3D ((y_width + HFI_COLOR_FORMAT_YUV420_NV12_UBWC_Y_TILE_WIDTH - 1) / + HFI_COLOR_FORMAT_YUV420_NV12_UBWC_Y_TILE_WIDTH + + (AV1D_MAX_TILE_COLS - 1)); + return size * UBWC_TILE_SIZE; +} + +static u32 size_av1d_lb_opb_wr1_tp10_ubwc(u32 frame_width, u32 frame_heigh= t) +{ + u32 size, y_width, y_width_a =3D 256; + + y_width =3D ALIGN(frame_width, y_width_a); + + size =3D ((y_width + HFI_COLOR_FORMAT_YUV420_TP10_UBWC_Y_TILE_WIDTH - 1) / + HFI_COLOR_FORMAT_YUV420_TP10_UBWC_Y_TILE_WIDTH + + (AV1D_MAX_TILE_COLS - 1)); + + return size * UBWC_TILE_SIZE; +} + +static u32 hfi_buffer_line_av1d(u32 frame_width, u32 frame_height, + bool is_opb, u32 num_vpp_pipes) +{ + u32 size, vpss_lb_size, opbwrbufsize, opbwr8, opbwr10; + + size =3D ALIGN(size_av1d_lb_fe_top_data(frame_width, frame_height), + DMA_ALIGNMENT) + + ALIGN(size_av1d_lb_fe_top_ctrl(frame_width, frame_height), + DMA_ALIGNMENT) + + ALIGN(size_av1d_lb_fe_left_data(frame_width, frame_height), + DMA_ALIGNMENT) * num_vpp_pipes + + ALIGN(size_av1d_lb_fe_left_ctrl(frame_width, frame_height), + DMA_ALIGNMENT) * num_vpp_pipes + + ALIGN(size_av1d_lb_se_left_ctrl(frame_width, frame_height), + DMA_ALIGNMENT) * num_vpp_pipes + + ALIGN(size_av1d_lb_se_top_ctrl(frame_width, frame_height), + DMA_ALIGNMENT) + + ALIGN(size_av1d_lb_pe_top_data(frame_width, frame_height), + DMA_ALIGNMENT) + + ALIGN(size_av1d_lb_vsp_top(frame_width, frame_height), + DMA_ALIGNMENT) + + ALIGN(size_av1d_lb_recon_dma_metadata_wr + (frame_width, frame_height), DMA_ALIGNMENT) * 2 + + ALIGN(size_av1d_qp(frame_width, frame_height), DMA_ALIGNMENT); + opbwr8 =3D size_av1d_lb_opb_wr1_nv12_ubwc(frame_width, frame_height); + opbwr10 =3D size_av1d_lb_opb_wr1_tp10_ubwc(frame_width, frame_height); + opbwrbufsize =3D opbwr8 >=3D opbwr10 ? opbwr8 : opbwr10; + size =3D ALIGN((size + opbwrbufsize), DMA_ALIGNMENT); + if (is_opb) { + vpss_lb_size =3D size_vpss_lb(frame_width, frame_height); + size =3D ALIGN((size + vpss_lb_size) * 2, DMA_ALIGNMENT); + } + + return size; +} + +static u32 size_av1d_ibc_nv12_ubwc(u32 frame_width, u32 frame_height) +{ + u32 size; + u32 y_width_a =3D 128, y_height_a =3D 32; + u32 uv_width_a =3D 128, uv_height_a =3D 32; + u32 ybufsize, uvbufsize, y_width, y_height, uv_width, uv_height; + u32 y_meta_width_a =3D 64, y_meta_height_a =3D 16; + u32 uv_meta_width_a =3D 64, uv_meta_height_a =3D 16; + u32 meta_height, meta_stride, meta_size; + u32 tile_width_y =3D HFI_COLOR_FORMAT_YUV420_NV12_UBWC_Y_TILE_WIDTH; + u32 tile_height_y =3D HFI_COLOR_FORMAT_YUV420_NV12_UBWC_Y_TILE_HEIGHT; + u32 tile_width_uv =3D HFI_COLOR_FORMAT_YUV420_NV12_UBWC_UV_TILE_WIDTH; + u32 tile_height_uv =3D HFI_COLOR_FORMAT_YUV420_NV12_UBWC_UV_TILE_HEIGHT; + + y_width =3D ALIGN(frame_width, y_width_a); + y_height =3D ALIGN(frame_height, y_height_a); + uv_width =3D ALIGN(frame_width, uv_width_a); + uv_height =3D ALIGN(((frame_height + 1) >> 1), uv_height_a); + ybufsize =3D ALIGN((y_width * y_height), HFI_ALIGNMENT_4096); + uvbufsize =3D ALIGN(uv_width * uv_height, HFI_ALIGNMENT_4096); + size =3D ybufsize + uvbufsize; + meta_stride =3D ALIGN(((frame_width + (tile_width_y - 1)) / tile_width_y), + y_meta_width_a); + meta_height =3D ALIGN(((frame_height + (tile_height_y - 1)) / tile_height= _y), + y_meta_height_a); + meta_size =3D ALIGN(meta_stride * meta_height, HFI_ALIGNMENT_4096); + size +=3D meta_size; + meta_stride =3D ALIGN(((((frame_width + 1) >> 1) + (tile_width_uv - 1)) / + tile_width_uv), uv_meta_width_a); + meta_height =3D ALIGN(((((frame_height + 1) >> 1) + (tile_height_uv - 1))= / + tile_height_uv), uv_meta_height_a); + meta_size =3D ALIGN(meta_stride * meta_height, HFI_ALIGNMENT_4096); + size +=3D meta_size; + + return size; +} + +static u32 hfi_yuv420_tp10_calc_y_stride(u32 frame_width, u32 stride_multi= ple) +{ + u32 stride; + + stride =3D ALIGN(frame_width, 192); + stride =3D ALIGN(stride * 4 / 3, stride_multiple); + + return stride; +} + +static u32 hfi_yuv420_tp10_calc_y_bufheight(u32 frame_height, u32 min_buf_= height_multiple) +{ + return ALIGN(frame_height, min_buf_height_multiple); +} + +static u32 hfi_yuv420_tp10_calc_uv_stride(u32 frame_width, u32 stride_mult= iple) +{ + u32 stride; + + stride =3D ALIGN(frame_width, 192); + stride =3D ALIGN(stride * 4 / 3, stride_multiple); + + return stride; +} + +static u32 hfi_yuv420_tp10_calc_uv_bufheight(u32 frame_height, u32 min_buf= _height_multiple) +{ + return ALIGN(((frame_height + 1) >> 1), min_buf_height_multiple); +} + +static u32 size_av1d_ibc_tp10_ubwc(u32 frame_width, u32 frame_height) +{ + u32 size; + u32 y_width_a =3D 256, y_height_a =3D 16, + uv_width_a =3D 256, uv_height_a =3D 16; + u32 ybufsize, uvbufsize, y_width, y_height, uv_width, uv_height; + u32 y_meta_width_a =3D 64, y_meta_height_a =3D 16, + uv_meta_width_a =3D 64, uv_meta_height_a =3D 16; + u32 meta_height, meta_stride, meta_size; + u32 tile_width_y =3D HFI_COLOR_FORMAT_YUV420_TP10_UBWC_Y_TILE_WIDTH; + u32 tile_height_y =3D HFI_COLOR_FORMAT_YUV420_TP10_UBWC_Y_TILE_HEIGHT; + u32 tile_width_uv =3D HFI_COLOR_FORMAT_YUV420_TP10_UBWC_UV_TILE_WIDTH; + u32 tile_height_uv =3D HFI_COLOR_FORMAT_YUV420_TP10_UBWC_UV_TILE_HEIGHT; + + y_width =3D hfi_yuv420_tp10_calc_y_stride(frame_width, y_width_a); + y_height =3D hfi_yuv420_tp10_calc_y_bufheight(frame_height, y_height_a); + uv_width =3D hfi_yuv420_tp10_calc_uv_stride(frame_width, uv_width_a); + uv_height =3D hfi_yuv420_tp10_calc_uv_bufheight(frame_height, uv_height_a= ); + ybufsize =3D ALIGN(y_width * y_height, HFI_ALIGNMENT_4096); + uvbufsize =3D ALIGN(uv_width * uv_height, HFI_ALIGNMENT_4096); + size =3D ybufsize + uvbufsize; + meta_stride =3D ALIGN(((frame_width + (tile_width_y - 1)) / tile_width_y), + y_meta_width_a); + meta_height =3D ALIGN(((frame_height + (tile_height_y - 1)) / tile_height= _y), + y_meta_height_a); + meta_size =3D ALIGN(meta_stride * meta_height, HFI_ALIGNMENT_4096); + size +=3D meta_size; + meta_stride =3D ALIGN(((((frame_width + 1) >> 1) + (tile_width_uv - 1)) / + tile_width_uv), uv_meta_width_a); + meta_height =3D ALIGN(((((frame_height + 1) >> 1) + (tile_height_uv - 1))= / + tile_height_uv), uv_meta_height_a); + meta_size =3D ALIGN(meta_stride * meta_height, HFI_ALIGNMENT_4096); + size +=3D meta_size; + + return size; +} + +static u32 hfi_buffer_ibc_av1d(u32 frame_width, u32 frame_height) +{ + u32 size, ibc8, ibc10; + + ibc8 =3D size_av1d_ibc_nv12_ubwc(frame_width, frame_height); + ibc10 =3D size_av1d_ibc_tp10_ubwc(frame_width, frame_height); + size =3D ibc8 >=3D ibc10 ? ibc8 : ibc10; + + return ALIGN(size, DMA_ALIGNMENT); +} + static u32 iris_vpu_dec_bin_size(struct iris_inst *inst) { u32 num_vpp_pipes =3D inst->core->iris_platform_data->num_vpp_pipe; @@ -472,6 +718,8 @@ static u32 iris_vpu_dec_bin_size(struct iris_inst *inst) return hfi_buffer_bin_h265d(width, height, num_vpp_pipes); else if (inst->codec =3D=3D V4L2_PIX_FMT_VP9) return hfi_buffer_bin_vp9d(width, height, num_vpp_pipes); + else if (inst->codec =3D=3D V4L2_PIX_FMT_AV1) + return hfi_buffer_bin_av1d(width, height, num_vpp_pipes); =20 return 0; } @@ -487,18 +735,34 @@ static u32 iris_vpu_dec_comv_size(struct iris_inst *i= nst) return hfi_buffer_comv_h264d(width, height, num_comv); else if (inst->codec =3D=3D V4L2_PIX_FMT_HEVC) return hfi_buffer_comv_h265d(width, height, num_comv); + else if (inst->codec =3D=3D V4L2_PIX_FMT_AV1) { + if (inst->fw_caps[DRAP].value) + return 0; + else + return hfi_buffer_comv_av1d(width, height, num_comv); + } =20 return 0; } =20 static u32 iris_vpu_dec_persist_size(struct iris_inst *inst) { + struct platform_inst_caps *caps; + if (inst->codec =3D=3D V4L2_PIX_FMT_H264) return hfi_buffer_persist_h264d(); else if (inst->codec =3D=3D V4L2_PIX_FMT_HEVC) return hfi_buffer_persist_h265d(0); else if (inst->codec =3D=3D V4L2_PIX_FMT_VP9) return hfi_buffer_persist_vp9d(); + else if (inst->codec =3D=3D V4L2_PIX_FMT_AV1) { + caps =3D inst->core->iris_platform_data->inst_caps; + if (inst->fw_caps[DRAP].value) + return hfi_buffer_persist_av1d(caps->max_frame_width, + caps->max_frame_height, 16); + else + return hfi_buffer_persist_av1d(0, 0, 0); + } =20 return 0; } @@ -545,6 +809,8 @@ static u32 iris_vpu_dec_line_size(struct iris_inst *ins= t) else if (inst->codec =3D=3D V4L2_PIX_FMT_VP9) return hfi_buffer_line_vp9d(width, height, out_min_count, is_opb, num_vpp_pipes); + else if (inst->codec =3D=3D V4L2_PIX_FMT_AV1) + return hfi_buffer_line_av1d(width, height, is_opb, num_vpp_pipes); =20 return 0; } @@ -653,6 +919,15 @@ static u32 iris_vpu_enc_bin_size(struct iris_inst *ins= t) num_vpp_pipes, inst->hfi_rc_type); } =20 +static u32 iris_vpu_dec_partial_size(struct iris_inst *inst) +{ + struct v4l2_format *f =3D inst->fmt_src; + u32 height =3D f->fmt.pix_mp.height; + u32 width =3D f->fmt.pix_mp.width; + + return hfi_buffer_ibc_av1d(width, height); +} + static inline u32 hfi_buffer_comv_enc(u32 frame_width, u32 frame_height, u32 lcu_size, u32 num_recon, u32 standard) @@ -1414,7 +1689,9 @@ static int output_min_count(struct iris_inst *inst) =20 /* fw_min_count > 0 indicates reconfig event has already arrived */ if (inst->fw_min_count) { - if (iris_split_mode_enabled(inst) && inst->codec =3D=3D V4L2_PIX_FMT_VP9) + if (iris_split_mode_enabled(inst) && + (inst->codec =3D=3D V4L2_PIX_FMT_VP9 || + inst->codec =3D=3D V4L2_PIX_FMT_AV1)) return min_t(u32, 4, inst->fw_min_count); else return inst->fw_min_count; @@ -1422,6 +1699,8 @@ static int output_min_count(struct iris_inst *inst) =20 if (inst->codec =3D=3D V4L2_PIX_FMT_VP9) output_min_count =3D 9; + else if (inst->codec =3D=3D V4L2_PIX_FMT_AV1) + output_min_count =3D 11; =20 return output_min_count; } @@ -1444,6 +1723,7 @@ u32 iris_vpu_buf_size(struct iris_inst *inst, enum ir= is_buffer_type buffer_type) {BUF_PERSIST, iris_vpu_dec_persist_size }, {BUF_DPB, iris_vpu_dec_dpb_size }, {BUF_SCRATCH_1, iris_vpu_dec_scratch1_size }, + {BUF_PARTIAL, iris_vpu_dec_partial_size }, }; =20 static const struct iris_vpu_buf_type_handle enc_internal_buf_type_handle= [] =3D { @@ -1510,14 +1790,20 @@ static u32 internal_buffer_count(struct iris_inst *= inst, buffer_type =3D=3D BUF_PERSIST) { return 1; } else if (buffer_type =3D=3D BUF_COMV || buffer_type =3D=3D BUF_NON_COMV= ) { - if (inst->codec =3D=3D V4L2_PIX_FMT_H264 || inst->codec =3D=3D V4L2_PIX_= FMT_HEVC) + if (inst->codec =3D=3D V4L2_PIX_FMT_H264 || + inst->codec =3D=3D V4L2_PIX_FMT_HEVC || + inst->codec =3D=3D V4L2_PIX_FMT_AV1) return 1; } + return 0; } =20 static inline int iris_vpu_dpb_count(struct iris_inst *inst) { + if (inst->codec =3D=3D V4L2_PIX_FMT_AV1) + return 11; + if (iris_split_mode_enabled(inst)) { return inst->fw_min_count ? inst->fw_min_count : inst->buffers[BUF_OUTPUT].min_count; @@ -1536,9 +1822,13 @@ int iris_vpu_buf_count(struct iris_inst *inst, enum = iris_buffer_type buffer_type return MIN_BUFFERS; else return output_min_count(inst); + case BUF_NON_COMV: + if (inst->codec =3D=3D V4L2_PIX_FMT_AV1) + return 0; + else + return 1; case BUF_BIN: case BUF_COMV: - case BUF_NON_COMV: case BUF_LINE: case BUF_PERSIST: return internal_buffer_count(inst, buffer_type); @@ -1546,6 +1836,7 @@ int iris_vpu_buf_count(struct iris_inst *inst, enum i= ris_buffer_type buffer_type case BUF_SCRATCH_2: case BUF_VPSS: case BUF_ARP: + case BUF_PARTIAL: return 1; /* internal buffer count needed by firmware is 1 */ case BUF_DPB: return iris_vpu_dpb_count(inst); diff --git a/drivers/media/platform/qcom/iris/iris_vpu_buffer.h b/drivers/m= edia/platform/qcom/iris/iris_vpu_buffer.h index 04f0b7400a1e4e1d274d690a2761b9e57778e8b7..13c7199fcf351cac5f01c0d1ca2= 0c093b1e62234 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu_buffer.h +++ b/drivers/media/platform/qcom/iris/iris_vpu_buffer.h @@ -11,6 +11,7 @@ struct iris_inst; #define MIN_BUFFERS 4 =20 #define DMA_ALIGNMENT 256 +#define HFI_ALIGNMENT_4096 4096 =20 #define NUM_HW_PIC_BUF 32 #define LCU_MAX_SIZE_PELS 64 @@ -81,6 +82,22 @@ struct iris_inst; #define MAX_PE_NBR_DATA_LCU64_LINE_BUFFER_SIZE 384 #define MAX_FE_NBR_DATA_LUMA_LINE_BUFFER_SIZE 640 =20 +#define AV1_CABAC_HDR_RATIO_HD_TOT 2 +#define AV1_CABAC_RES_RATIO_HD_TOT 2 +#define AV1D_LCU_MAX_SIZE_PELS 128 +#define AV1D_LCU_MIN_SIZE_PELS 64 +#define AV1D_MAX_TILE_COLS 64 +#define MAX_PE_NBR_DATA_LCU32_LINE_BUFFER_SIZE 192 +#define MAX_PE_NBR_DATA_LCU16_LINE_BUFFER_SIZE 96 +#define AV1D_NUM_HW_PIC_BUF 16 +#define AV1D_NUM_FRAME_HEADERS 16 +#define SIZE_AV1D_SEQUENCE_HEADER 768 +#define SIZE_AV1D_METADATA 512 +#define SIZE_AV1D_FRAME_HEADER 1280 +#define SIZE_AV1D_TILE_OFFSET 65536 +#define SIZE_AV1D_QM 3328 +#define SIZE_AV1D_PROB_TABLE 22784 + #define SIZE_SLICE_CMD_BUFFER (ALIGN(20480, 256)) #define SIZE_SPS_PPS_SLICE_HDR (2048 + 4096) #define SIZE_BSE_SLICE_CMD_BUF ((((8192 << 2) + 7) & (~7)) * 3) @@ -101,6 +118,15 @@ struct iris_inst; #define NUM_MBS_4K (DIV_ROUND_UP(MAX_WIDTH, 16) * DIV_ROUND_UP(MAX_HEIGHT,= 16)) #define NUM_MBS_720P (((ALIGN(1280, 16)) >> 4) * ((ALIGN(736, 16)) >> 4)) =20 +#define BITS_PER_PIX 16 +#define NUM_LINES_LUMA 10 +#define NUM_LINES_CHROMA 6 +#define AV1D_LCU_MAX_SIZE_PELS 128 +#define AV1D_LCU_MIN_SIZE_PELS 64 +#define AV1D_MAX_TILE_COLS 64 +#define BITS_PER_CTRL_PACK 128 +#define NUM_CTRL_PACK_LCU 10 + static inline u32 size_h264d_lb_fe_top_data(u32 frame_width) { return MAX_FE_NBR_DATA_LUMA_LINE_BUFFER_SIZE * ALIGN(frame_width, 16) * 3; @@ -146,6 +172,96 @@ static inline u32 size_h264d_qp(u32 frame_width, u32 f= rame_height) return DIV_ROUND_UP(frame_width, 64) * DIV_ROUND_UP(frame_height, 64) * 1= 28; } =20 +static inline u32 size_av1d_lb_fe_top_data(u32 frame_width, u32 frame_heig= ht) +{ + return (ALIGN(frame_width, AV1D_LCU_MAX_SIZE_PELS) * + ((BITS_PER_PIX * NUM_LINES_LUMA) >> 3) + + ALIGN(frame_width, AV1D_LCU_MAX_SIZE_PELS) / 2 * + ((BITS_PER_PIX * NUM_LINES_CHROMA) >> 3) * 2); +} + +static inline u32 size_av1d_lb_fe_left_data(u32 frame_width, u32 frame_hei= ght) +{ + return (32 * (ALIGN(frame_height, AV1D_LCU_MAX_SIZE_PELS) + + ALIGN(frame_height, AV1D_LCU_MAX_SIZE_PELS) / + AV1D_LCU_MIN_SIZE_PELS * 16) + + 16 * (ALIGN(frame_height, AV1D_LCU_MAX_SIZE_PELS) / 2 + + ALIGN(frame_height, AV1D_LCU_MAX_SIZE_PELS) / + AV1D_LCU_MIN_SIZE_PELS * 8) * 2 + + 24 * (ALIGN(frame_height, AV1D_LCU_MAX_SIZE_PELS) + + ALIGN(frame_height, AV1D_LCU_MAX_SIZE_PELS) / + AV1D_LCU_MIN_SIZE_PELS * 16) + + 24 * (ALIGN(frame_height, AV1D_LCU_MAX_SIZE_PELS) / 2 + + ALIGN(frame_height, AV1D_LCU_MAX_SIZE_PELS) / + AV1D_LCU_MIN_SIZE_PELS * 12) * 2 + + 24 * (ALIGN(frame_height, AV1D_LCU_MAX_SIZE_PELS) + + ALIGN(frame_height, AV1D_LCU_MAX_SIZE_PELS) / + AV1D_LCU_MIN_SIZE_PELS * 16) + + 16 * (ALIGN(frame_height, AV1D_LCU_MAX_SIZE_PELS) + + ALIGN(frame_height, AV1D_LCU_MAX_SIZE_PELS) / + AV1D_LCU_MIN_SIZE_PELS * 16) + + 16 * (ALIGN(frame_height, AV1D_LCU_MAX_SIZE_PELS) / 2 + + ALIGN(frame_height, AV1D_LCU_MAX_SIZE_PELS) / + AV1D_LCU_MIN_SIZE_PELS * 12) * 2); +} + +static inline u32 size_av1d_lb_fe_top_ctrl(u32 frame_width, u32 frame_heig= ht) +{ + return (NUM_CTRL_PACK_LCU * ((frame_width + AV1D_LCU_MIN_SIZE_PELS - 1) / + AV1D_LCU_MIN_SIZE_PELS) * BITS_PER_CTRL_PACK / 8); +} + +static inline u32 size_av1d_lb_fe_left_ctrl(u32 frame_width, u32 frame_hei= ght) +{ + return (16 * ((ALIGN(frame_height, AV1D_LCU_MAX_SIZE_PELS) / 16) + + (ALIGN(frame_height, AV1D_LCU_MAX_SIZE_PELS) / + AV1D_LCU_MIN_SIZE_PELS)) + + 3 * 16 * (ALIGN(frame_height, AV1D_LCU_MAX_SIZE_PELS) / + AV1D_LCU_MIN_SIZE_PELS)); +} + +static inline u32 size_av1d_lb_se_top_ctrl(u32 frame_width, u32 frame_heig= ht) +{ + return (((frame_width + 7) / 8) * MAX_SE_NBR_CTRL_LCU16_LINE_BUFFER_SIZE); +} + +static inline u32 size_av1d_lb_se_left_ctrl(u32 frame_width, u32 frame_hei= ght) +{ + return (max(((frame_height + 15) / 16) * + MAX_SE_NBR_CTRL_LCU16_LINE_BUFFER_SIZE, + max(((frame_height + 31) / 32) * + MAX_SE_NBR_CTRL_LCU32_LINE_BUFFER_SIZE, + ((frame_height + 63) / 64) * + MAX_SE_NBR_CTRL_LCU64_LINE_BUFFER_SIZE))); +} + +static inline u32 size_av1d_lb_pe_top_data(u32 frame_width, u32 frame_heig= ht) +{ + return (max(((frame_width + 15) / 16) * + MAX_PE_NBR_DATA_LCU16_LINE_BUFFER_SIZE, + max(((frame_width + 31) / 32) * + MAX_PE_NBR_DATA_LCU32_LINE_BUFFER_SIZE, + ((frame_width + 63) / 64) * + MAX_PE_NBR_DATA_LCU64_LINE_BUFFER_SIZE))); +} + +static inline u32 size_av1d_lb_vsp_top(u32 frame_width, u32 frame_height) +{ + return (max(((frame_width + 63) / 64) * 1280, + ((frame_width + 127) / 128) * MAX_HEIGHT)); +} + +static inline u32 size_av1d_lb_recon_dma_metadata_wr(u32 frame_width, + u32 frame_height) +{ + return ((ALIGN(frame_height, 8) / (4 / 2)) * 64); +} + +static inline u32 size_av1d_qp(u32 frame_width, u32 frame_height) +{ + return size_h264d_qp(frame_width, frame_height); +} + u32 iris_vpu_buf_size(struct iris_inst *inst, enum iris_buffer_type buffer= _type); u32 iris_vpu33_buf_size(struct iris_inst *inst, enum iris_buffer_type buff= er_type); int iris_vpu_buf_count(struct iris_inst *inst, enum iris_buffer_type buffe= r_type); --=20 2.34.1