From mboxrd@z Thu Jan 1 00:00:00 1970 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 782D43BF69A for ; Thu, 9 Jul 2026 19:37:12 +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=1783625836; cv=none; b=GjLFo/dJ8vGNa7cY/4WFHz4mfN8HU6vg4WJ+1tLEBgYGDY2z5Pl9W5gEF3OS2p3+t0Nhm5mbS8IR+gy5dviD8/waLkqaEi4YZZjezV7VM8uvxERdTbCyXY5k3hdKkH18zZHLhyuX8U6hdkmctGqg+wBXScY25U2k+6Uv/bzuLeU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783625836; c=relaxed/simple; bh=/yX5qqwc0FwDwfzLIeoMUNSa8oPTYi1YpRWwIMheozQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=koJV7tDH+M5qe99ANjCRvTjQ4wnPLIK6+/yQ0pOc68//h7Ktui1jIepuGXzD/38HLaUGhAwMx5CzFNl1URQ8x+dmDc8gjyQWRfchBoiBmzhxSLco6xdbQ9qZThbwKLLciNKtikufg/MOwuVLsM/jSXJE7HmDJfKTjLsV6abJDqo= 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=gu4wnLBc; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=iSo2vQTw; 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="gu4wnLBc"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="iSo2vQTw" 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 669HXKlL2517315 for ; Thu, 9 Jul 2026 19:37: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= /h0in8AC8WcWs2ubAUt9BJaWYQrytkWk3f4Tb9JaVLE=; b=gu4wnLBcZZpzd1Ze nC5EAL9kZv65BfGn81Jfw7dOslfSI1FvG+FDOz24FF3nxgFlH1G91RzBRy0ffrGV CYBuYk9qO/aDI9ldVdMB9Pg1LItNOADBGaUSTb+e6mdu2wN+c66vqDjQDQYFAk0Y NzG9xbmVmBt6EiBJepP89ae1uGboDrZTLenyOzx9QZQiiYNsMvbcc6yctUKdwUDJ CYu19R82uUmYW2JnvTKnPX7QHgrfc7pizmvIyBPZdAZRq1i6WPfbEzORvJdLY87B NQ2B1oRzVJ04CICmHmAxwu4axwXTls4dNDH2RT3Ccu/sWZ91Iv0i/0RBCouC8568 fKOUxA== Received: from mail-vs1-f69.google.com (mail-vs1-f69.google.com [209.85.217.69]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4faeess4py-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 09 Jul 2026 19:37:10 +0000 (GMT) Received: by mail-vs1-f69.google.com with SMTP id ada2fe7eead31-744e806f474so43296137.3 for ; Thu, 09 Jul 2026 12:37:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1783625830; x=1784230630; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=/h0in8AC8WcWs2ubAUt9BJaWYQrytkWk3f4Tb9JaVLE=; b=iSo2vQTw/ayPRBr9aK+gcre6dNlAVRqt53U4Ay6RK1FB9OxMW9JteNZYTtbg+FiiRR +9r+YYk2lOlQKB21+CwWE5AyBdaO9kdzHsGeZEhRoTo1MPLKAEhlcvRxR0vhGrR8BCfM ZnjaoIEymydkkxUQg37nQ+kGvCALkSw+kv2T+WhCf81fKg0Foa0PQRnYsfRk645ZInTk gR9I01jai/7v9f3W6PaYEk3ym5Dfvyq2OL5zuQe3AFccsJxPizp2o9RUW7UEO3UdScLm Uo8kJf7ULkbbuBf+3McVKG5JPqNK3FMNScSxiag75B4uRlP35I+L/PCoFPUfVgMZ2zLV q3vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783625830; x=1784230630; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=/h0in8AC8WcWs2ubAUt9BJaWYQrytkWk3f4Tb9JaVLE=; b=n1ZxJItj/ahXaxPrk7lDGvEexnaEISE68Cgzl7WpgP/2EwUgA1pMxfuS0rGLIvWrqk YkjcUy5BFMCgqybnobGelH3URI/hjhCAhDQXT7hHheRpkNF/dKY7sIyCPvYwVUT1TAkA VI5hejB/juwxsCfoKlYeNpZMeO3SUhNIctOXv2VsnKgs3nAuATT9HWcJ46Lj5+RD/7wr y/IE6H/7PqRNxoDhV6elkREyW1Vvwd1vVN11H7mypHuE8LKLJmJYs5/g+trBgYwzas0E bLy7wzgZMrVvlxjC+69rBFHJKRFrc8hHkpE5YHOwh0JO4M2Jso0ovEySaO0JEZmJwhgS SKDA== X-Forwarded-Encrypted: i=1; AHgh+Rp4dMpLRbrDkLqfTngF14AsLoF+iqLj4K+2O9atXjpVFBXHvM18PuNq4bs+4gdhzNnavKI94yaAPULfzXY=@vger.kernel.org X-Gm-Message-State: AOJu0YyBQ86FSwggAlePT1YjIOnm7SZOyCZ2emnqSRc/Cp64XGmU5lwD 7njIbfUvreRX/DSo5DgYVJdze9I0NVfdoYlUNbnrTvWjopeNB0ZTOcNdJPTePhZK3UA4yxwmvs0 +YRNtKL6SEY+yEVJz/5kVou+bN1zi8x1TC3tWO0PG8gJ9KnznKN3tCUla5feKeaCEE6g= X-Gm-Gg: AfdE7cnjkj9eeAJ6yTpco1gww1M3xkNtB5cYHTXB830hfEEeu5XZ3Ju9JO+4W3vtDDN GMgkme1fSwWf0cWp/sx4DNNwSlN8kwBoRYKw6tc0UWMpwZCp5A7uHznFvo7IWf90B8vsy0hKO0i uOmXzQcJR/xGsMCnbDQwjwDyqY55umNdsI549+IsABr7tpdz2GfiNkLAPL+erV7N7b26jMTFEaQ YYhdUyd5ggbpXmJICtlSqBDcYOePaTifN5BLbAliByBLOjqnpy881rr4GVA0d9+EmHyhL02Gq0Z /408raJSigq21Mjc7sCwqD8XmCCVdCjgxd5G1i6eJHknAwIPrwK7FINFS4TkxiwT6sbMgf7ugFB c1ihZNEi9gwd7ogIaKlU8KFZoFqCjlGwzsl5eDyWO1EHlK1fwPA3Nh3pcJk+enB/V89ncvU7uwj Asxw4Z0vq1JWat36Ct13V31Kyb X-Received: by 2002:a05:6102:8019:b0:744:dc62:55ae with SMTP id ada2fe7eead31-744e00d15d0mr5415326137.16.1783625830161; Thu, 09 Jul 2026 12:37:10 -0700 (PDT) X-Received: by 2002:a05:6102:8019:b0:744:dc62:55ae with SMTP id ada2fe7eead31-744e00d15d0mr5415302137.16.1783625829641; Thu, 09 Jul 2026 12:37:09 -0700 (PDT) Received: from umbar.lan (2001-14ba-a073-af00-264b-feff-fe8b-be8a.rev.dnainternet.fi. [2001:14ba:a073:af00:264b:feff:fe8b:be8a]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5b01caa635dsm46400e87.62.2026.07.09.12.37.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jul 2026 12:37:08 -0700 (PDT) From: Dmitry Baryshkov Date: Thu, 09 Jul 2026 22:37:00 +0300 Subject: [PATCH 3/9] media: iris: add support for interlaced decoded content 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: 7bit Message-Id: <20260709-iris-vp8-v1-3-6af3ab578a7c@oss.qualcomm.com> References: <20260709-iris-vp8-v1-0-6af3ab578a7c@oss.qualcomm.com> In-Reply-To: <20260709-iris-vp8-v1-0-6af3ab578a7c@oss.qualcomm.com> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=6795; i=dmitry.baryshkov@oss.qualcomm.com; h=from:subject:message-id; bh=/yX5qqwc0FwDwfzLIeoMUNSa8oPTYi1YpRWwIMheozQ=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBqT/hd/dkVhmw79DxeguEZlzh3VAfnVKsMVsTmU 4JlU+hRdIeJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCak/4XQAKCRCLPIo+Aiko 1RhbB/4lWopNP5iVxyB8+1/qsq1f15PEbkFe4MI/OonE85gIpTrHFLs42E+OXGZCBfVL90HoG/+ qQYSIPYvJxlrgn93j136/co1cZ9jHyLQG8adAEyYi8wQfRi6mbJ5hPaHUpM+fGc30H6pmpuYtpK 77+Hf+D3W6tKgEqTkUOqtFW05jo2ftrXUEk9e/kGXzERVCDACUm4hPeB+QlwOixNB2Dq1TSmvD5 zc17gHyl4ipDtja/3rHwtPoT8N1e9A8pnJht9eXnshUF7d7z0/qCLRBpZVZmtIAgANkNUFZkP9E bhWQ3njanj5LE2rUqQZ7MBHL5JZzjeRZ3S5O0x+fibAsp1zg X-Developer-Key: i=dmitry.baryshkov@oss.qualcomm.com; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A X-Proofpoint-GUID: 9w3QA6HPsRnU07ZJ1QI0g7ulN1kKb0uh X-Authority-Analysis: v=2.4 cv=bbpbluPB c=1 sm=1 tr=0 ts=6a4ff867 cx=c_pps a=5HAIKLe1ejAbszaTRHs9Ug==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=EUspDBNiAAAA:8 a=5v90hXcHZB-AQrEjmJcA:9 a=QEXdDO2ut3YA:10 a=gYDTvv6II1OnSo0itH1n:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwNzA5MDE5MyBTYWx0ZWRfXzDNjOXKwp4un OUMOsoONlkn6qy7EXRujXkzMYs0974j6y65LzH2+UUKT34Otwp5ADw0qksFGZzi0QYr0J+V3gqn zUz9p2AWuuYf0En0D5OL34avDMB6pIw= X-Proofpoint-ORIG-GUID: 9w3QA6HPsRnU07ZJ1QI0g7ulN1kKb0uh X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzA5MDE5MyBTYWx0ZWRfX3+a3O10/Lqts Cx3GjmE3duAChdPFQ6SMS8INSuX8rXbum8FOCHKRXl93OV5LvRR2E5Tz3P0Sz0VeEbuoVqciMn6 /XUdk3Gz/NGeCNTbRMzteBDAsV4qhZ6ZojEf9p3LqZETVjcfGSAn9HxuQE/IWyimOtMvT4ssDY5 9uhJsPhJNTxukp+Md5eDgCDV5L54qW9f3f6GtQG0snouaXWzoCOdd5dIIfn/ZUB9WQDgDajohkO 0Ut0BiEsH1PpdJ+cQ/HFL//KlaOQzqtziA8x6JUNPSmnReMQneSB2NBPGvP8HId2U5u+OB3pZ5K 11pKvP19R8M2sW0nlDVp9r7LEasjoCqlp4OhFutX2ndXILrtnI5izJmEuTLSIcPo3B+F38xZLD7 cOEpLfJglnsGHeWT9icia3R2zWxEJyn93eB6cU/w6X8dWfjm+FzczTFmtrtgEMdeFPSv3xlMnWR Q9sdkxdEIo0uc4Pa1WQ== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-09_04,2026-07-09_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 priorityscore=1501 malwarescore=0 bulkscore=0 suspectscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607090193 The Gen1 firmware can report that a decoded stream is interlaced through the progressive_only field of HFI_PROPERTY_PARAM_VDEC_PIC_STRUCT. So far the driver treated any interlaced content as unsupported and moved the instance to the error state, rejecting otherwise decodable streams. Stop rejecting interlaced content. Track the interlaced state on the instance, report V4L2_FIELD_INTERLACED on the capture queue when the content is interlaced, and skip allocation of the bin (scratch) buffer in that case, matching the venus driver behaviour. Only genuinely unsupported content (non-8-bit depth) is still rejected. Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Dmitry Baryshkov --- drivers/media/platform/qcom/iris/iris_ctrls.c | 8 +++++++- drivers/media/platform/qcom/iris/iris_hfi_gen1_response.c | 6 +++++- drivers/media/platform/qcom/iris/iris_instance.h | 2 ++ drivers/media/platform/qcom/iris/iris_vb2.c | 2 -- drivers/media/platform/qcom/iris/iris_vdec.c | 2 ++ drivers/media/platform/qcom/iris/iris_vpu_buffer.c | 7 +++++++ 6 files changed, 23 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/qcom/iris/iris_ctrls.c b/drivers/media/platform/qcom/iris/iris_ctrls.c index 33a34573391a..c12fe724dfb8 100644 --- a/drivers/media/platform/qcom/iris/iris_ctrls.c +++ b/drivers/media/platform/qcom/iris/iris_ctrls.c @@ -517,7 +517,13 @@ int iris_set_stage(struct iris_inst *inst, enum platform_inst_fw_cap_type cap_id u32 work_mode = STAGE_2; if (inst->domain == DECODER) { - if (iris_res_is_less_than(width, height, 1280, 720)) + /* + * The two-stage pipeline cannot decode interlaced or MPEG2 + * content, so fall back to a single stage. Low resolution + * content also uses a single stage. + */ + if (inst->is_interlaced || + iris_res_is_less_than(width, height, 1280, 720)) work_mode = STAGE_1; } diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen1_response.c b/drivers/media/platform/qcom/iris/iris_hfi_gen1_response.c index 7ad6f0bb4677..cf2cf31d5b61 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_gen1_response.c +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen1_response.c @@ -103,11 +103,15 @@ static void iris_hfi_gen1_read_changed_params(struct iris_inst *inst, num_properties_changed--; } while (num_properties_changed > 0); + /* pic_struct carries progressive_only: 0 means the content is interlaced */ + inst->is_interlaced = !event.pic_struct; + pixmp_ip->width = event.width; pixmp_ip->height = event.height; pixmp_op->width = ALIGN(event.width, 128); pixmp_op->height = ALIGN(event.height, 32); + pixmp_op->field = inst->is_interlaced ? V4L2_FIELD_INTERLACED : V4L2_FIELD_NONE; pixmp_op->plane_fmt[0].bytesperline = ALIGN(event.width, 128); pixmp_op->plane_fmt[0].sizeimage = iris_get_buffer_size(inst, BUF_OUTPUT); @@ -165,7 +169,7 @@ static void iris_hfi_gen1_read_changed_params(struct iris_inst *inst, dst_q = v4l2_m2m_get_dst_vq(inst->m2m_ctx); dst_q->min_reqbufs_allocation = inst->buffers[BUF_OUTPUT].min_count; - if (event.bit_depth || !event.pic_struct) { + if (event.bit_depth) { dev_err(core->dev, "unsupported content, bit depth: %x, pic_struct = %x\n", event.bit_depth, event.pic_struct); iris_inst_change_state(inst, IRIS_INST_ERROR); diff --git a/drivers/media/platform/qcom/iris/iris_instance.h b/drivers/media/platform/qcom/iris/iris_instance.h index ffdbbd20901a..67466b4d0896 100644 --- a/drivers/media/platform/qcom/iris/iris_instance.h +++ b/drivers/media/platform/qcom/iris/iris_instance.h @@ -53,6 +53,7 @@ struct iris_hfi_session_ops; * @metadata_idx: index for metadata buffer * @codec: codec type * @last_buffer_dequeued: a flag to indicate that last buffer is sent by driver + * @is_interlaced: a flag to indicate that decoded content is interlaced * @last_buf_ns: start time of received input buffer for current one second FPS window * @frame_counter: input buffer counter for current one second FPS window * @frame_rate: frame rate of current instance @@ -100,6 +101,7 @@ struct iris_inst { u32 metadata_idx; u32 codec; bool last_buffer_dequeued; + bool is_interlaced; u64 last_buf_ns; u32 frame_counter; u32 frame_rate; diff --git a/drivers/media/platform/qcom/iris/iris_vb2.c b/drivers/media/platform/qcom/iris/iris_vb2.c index a2ea2d67f60d..28dc269dcf0b 100644 --- a/drivers/media/platform/qcom/iris/iris_vb2.c +++ b/drivers/media/platform/qcom/iris/iris_vb2.c @@ -260,8 +260,6 @@ int iris_vb2_buf_prepare(struct vb2_buffer *vb) if (V4L2_TYPE_IS_OUTPUT(vb->vb2_queue->type)) { if (vbuf->field == V4L2_FIELD_ANY) vbuf->field = V4L2_FIELD_NONE; - if (vbuf->field != V4L2_FIELD_NONE) - return -EINVAL; } if (!(inst->sub_state & IRIS_INST_SUB_DRC)) { diff --git a/drivers/media/platform/qcom/iris/iris_vdec.c b/drivers/media/platform/qcom/iris/iris_vdec.c index 9fee5f28097d..9169b1335b5c 100644 --- a/drivers/media/platform/qcom/iris/iris_vdec.c +++ b/drivers/media/platform/qcom/iris/iris_vdec.c @@ -251,6 +251,7 @@ int iris_vdec_s_fmt(struct iris_inst *inst, struct v4l2_format *f) fmt = inst->fmt_src; fmt->type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; fmt->fmt.pix_mp.pixelformat = f->fmt.pix_mp.pixelformat; + fmt->fmt.pix_mp.field = f->fmt.pix_mp.field; inst->codec = fmt->fmt.pix_mp.pixelformat; codec_align = inst->codec == V4L2_PIX_FMT_HEVC ? 32 : 16; fmt->fmt.pix_mp.width = ALIGN(f->fmt.pix_mp.width, codec_align); @@ -290,6 +291,7 @@ int iris_vdec_s_fmt(struct iris_inst *inst, struct v4l2_format *f) fmt = inst->fmt_dst; fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; fmt->fmt.pix_mp.pixelformat = f->fmt.pix_mp.pixelformat; + fmt->fmt.pix_mp.field = f->fmt.pix_mp.field; fmt->fmt.pix_mp.num_planes = 1; switch (f->fmt.pix_mp.pixelformat) { case V4L2_PIX_FMT_P010: diff --git a/drivers/media/platform/qcom/iris/iris_vpu_buffer.c b/drivers/media/platform/qcom/iris/iris_vpu_buffer.c index 00dbb091c54e..88f130d09a6e 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu_buffer.c +++ b/drivers/media/platform/qcom/iris/iris_vpu_buffer.c @@ -937,6 +937,13 @@ static u32 iris_vpu_dec_bin_size(struct iris_inst *inst) u32 height = f->fmt.pix_mp.height; u32 width = f->fmt.pix_mp.width; + /* + * The bin (scratch) buffer is not used when decoding interlaced + * content. + */ + if (inst->is_interlaced) + return 0; + if (inst->codec == V4L2_PIX_FMT_H264) return hfi_buffer_bin_h264d(width, height, num_vpp_pipes); else if (inst->codec == V4L2_PIX_FMT_HEVC) -- 2.47.3