From patchwork Tue Apr 8 15:54:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dikshita Agarwal X-Patchwork-Id: 880298 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 6026C232378; Tue, 8 Apr 2025 15:55:11 +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=1744127712; cv=none; b=UQfxYOzHivirDJiAi6a8B+fSHDgoat1GDuHRGTRyZGkvrZeNt19WKJ7T/Sq8keBgeDbdvnzQ13xSg9n2RfCsndzq20W5eaH3fW/1ONfnZrukvG83PZRH94kV5ZoZaGPH6EGWZxHTJbZer4VyacPc2FeDXXBbvg2uq8lXlcdrc6Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744127712; c=relaxed/simple; bh=d2LD3eRvTP42W4GnPSrUZm1Hc0HCJMimVZKEm10PJgI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=TWCmiEJx89MMU4JKjxjMaIVhGfhp7T0Us+vSPFPg4N9gUO+SUippVQb/Ney/0dP/7lyh253vNWZqmQ93WtxiM+irTkn34TieiBgwUgblfm58V9hhsfLslWZbbaXvmp7stStfQz2IT9I9+oFqOvxQwcm4VzgiocBlv5h7RK8Vilg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=Y7tIW3Gl; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="Y7tIW3Gl" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 538ArCQb019767; Tue, 8 Apr 2025 15:55:07 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= KtTZfc1JeIkD4QXF+5Y3ur7SFQoEKFvOaN+MT3nKQsA=; b=Y7tIW3GlENkwlupj gbmXGFXHT7wynNMXtp6F14z55JBOrXTUm9KXkKQEg2PXH4dhLX3nx8zLbG14MWrQ oe6ovoKCzTQzK+wVX5Yfo55G8aMBQXVVCi0jakPsqFvn+aBUGOTjdeFoYMw7XAZG oGC0Edkx7WjYUy4dsNMfUne6gZetV6hr0fYhUR/vP0/Xi4Sv8Q27NHWlTCS51D/I 2uaLQM6zi+7Aihfva8W0H2bT4IoozFSpMLfTiMQOp4d+eQ8JQvd3MkgfUyZe6chp cNZM4ZbeADaVdszXmxiYxR8YpUGPDly958FPqjmu7De9kTC3xEW93kSPjfKTCuT4 fv1zcA== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 45twg3g9fa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Apr 2025 15:55:07 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA02.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 538Ft63W009035 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 8 Apr 2025 15:55:06 GMT Received: from hu-dikshita-hyd.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Tue, 8 Apr 2025 08:55:01 -0700 From: Dikshita Agarwal Date: Tue, 8 Apr 2025 21:24:19 +0530 Subject: [PATCH 05/20] media: iris: Send V4L2_BUF_FLAG_ERROR for buffers with 0 filled length Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20250408-iris-dec-hevc-vp9-v1-5-acd258778bd6@quicinc.com> References: <20250408-iris-dec-hevc-vp9-v1-0-acd258778bd6@quicinc.com> In-Reply-To: <20250408-iris-dec-hevc-vp9-v1-0-acd258778bd6@quicinc.com> To: Vikash Garodia , Abhinav Kumar , Mauro Carvalho Chehab , Stefan Schmidt , Hans Verkuil , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley CC: Bryan O'Donoghue , Dmitry Baryshkov , Neil Armstrong , , , , , "Dikshita Agarwal" X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1744127674; l=1204; i=quic_dikshita@quicinc.com; s=20240917; h=from:subject:message-id; bh=d2LD3eRvTP42W4GnPSrUZm1Hc0HCJMimVZKEm10PJgI=; b=6NLmZHYyu7SywmhbjBSMf6miatHEX/qoFshaMOj70bo+AKHzl01XfUktjC5VUupd3AYSsI1Os 7PQMAk66UbTCfdNEsZ1FCiA+4hRsOsiF+gREU9cwjIBAimY9cso1zhe X-Developer-Key: i=quic_dikshita@quicinc.com; a=ed25519; pk=EEvKY6Ar1OI5SWf44FJ1Ebo1KuQEVbbf5UNPO+UHVhM= X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: 12WTpQj7euel3-FhrAMlk3mVVXcgOwLO X-Proofpoint-ORIG-GUID: 12WTpQj7euel3-FhrAMlk3mVVXcgOwLO X-Authority-Analysis: v=2.4 cv=I/9lRMgg c=1 sm=1 tr=0 ts=67f546db cx=c_pps a=ouPCqIW2jiPt+lZRy3xVPw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=GEpy-HfZoHoA:10 a=IkcTkHD0fZMA:10 a=XR8D0OoHHMoA:10 a=COk6AnOGAAAA:8 a=nmLn8oLEv6AdYNmoJw4A:9 a=QEXdDO2ut3YA:10 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1095,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-04-08_06,2025-04-08_03,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 mlxlogscore=780 lowpriorityscore=0 spamscore=0 clxscore=1015 malwarescore=0 adultscore=0 priorityscore=1501 impostorscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2502280000 definitions=main-2504080110 Firmware sends buffers with 0 filled length which needs to be dropped, to achieve the same, add V4L2_BUF_FLAG_ERROR to such buffers. Also make sure: - These 0 length buffers are not returned as result of flush. - Its not a buffer with LAST flag enabled which will also have 0 filled length. Signed-off-by: Dikshita Agarwal --- drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c b/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c index b75a01641d5d..91c5f04dd926 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c @@ -377,6 +377,12 @@ static int iris_hfi_gen2_handle_output_buffer(struct iris_inst *inst, buf->flags = iris_hfi_gen2_get_driver_buffer_flags(inst, hfi_buffer->flags); + if (!buf->data_size && inst->state == IRIS_INST_STREAMING && + !(hfi_buffer->flags & HFI_BUF_FW_FLAG_LAST) && + !(inst->sub_state & IRIS_INST_SUB_DRC)) { + buf->flags |= V4L2_BUF_FLAG_ERROR; + } + return 0; }