From patchwork Wed May 7 07:39:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dikshita Agarwal X-Patchwork-Id: 888236 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 1265122488B; Wed, 7 May 2025 07:41:16 +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=1746603679; cv=none; b=L+f7I87IgemhTuwQCqfGoqK4x2cw4gaflL0IRkfS9sM4JpL4Qs7iKfSdva6Z6dp0JPsW+QNm+MTCUCbHZNE4yc9wB1Ep/g1L51LWwE5LGzXZlD+xw382iKW6IkC/RzYjn8Dk0iTOCyey8vIjzRQPwA1MoYl4FlqyPFXxEzcsO5M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746603679; c=relaxed/simple; bh=X/vzQHaS6DgefpOqFlFIrw+4tMhEfEpaC6+Zq8wvhNI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=rcj1lNKLUQdWeUed+BUnficCuP+IAFZi98g5XnzlxAuSqoIGoqqZEUVpoc8f1sFkN64FI1yIj8BC2J94k/IwMfYzKhDA0nD2UE0y9a5dLElX2xLF2YLIXXILLj197kT3LoF+L7zlLwnMHw5ENiN7GoJ3R5F79NJg7ft9gkkpaAU= 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=VHXAbL4g; 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="VHXAbL4g" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 5471Gtfr021946; Wed, 7 May 2025 07:41:12 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= gHO0Wb+zdZi4mybVGi6ytIVDYbZXdbGLTTY+EC8ALck=; b=VHXAbL4gflHK03DA whP7cOTJzYwPetA2CEk/Oh1J91c1Wx+JrKOJjqbyamP2ct2/nv3r+0wJ0y/+Gndw DqFHZpDMizuS4PKdmXSXKNyf+KTTZ7V+FlLVVfYCxt+HdNnjOEToCiHQn92E5sUF GbztJqa6Y6/a7dViFC+uAGOEQbQElS+j0Zm1552xm/dzvrZ6Bzi+RAjzKABSH10j rBaHvLyGzjYkVX1pKYKJHL+S1Z+PxD1qzHzJH0deaGKF5jBUGaIn+7K7cyL9Eczr eA83nkT9MG70QKdq6I7gL9YxiLivVSTeLb1uGoDYVM3IVxFJavqPtd9fzwnS7COK UapLWA== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 46f5uuvwjj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 May 2025 07:41:12 +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 5477fBMs000353 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 7 May 2025 07:41:11 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; Wed, 7 May 2025 00:41:07 -0700 From: Dikshita Agarwal Date: Wed, 7 May 2025 13:09:43 +0530 Subject: [PATCH v4 12/25] media: iris: Fix buffer preparation failure during resolution change Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20250507-video-iris-hevc-vp9-v4-12-58db3660ac61@quicinc.com> References: <20250507-video-iris-hevc-vp9-v4-0-58db3660ac61@quicinc.com> In-Reply-To: <20250507-video-iris-hevc-vp9-v4-0-58db3660ac61@quicinc.com> To: Vikash Garodia , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab , Hans Verkuil , Stefan Schmidt CC: , , , Dmitry Baryshkov , Neil Armstrong , Nicolas Dufresne , Dan Carpenter , Dikshita Agarwal , X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1746603611; l=1873; i=quic_dikshita@quicinc.com; s=20240917; h=from:subject:message-id; bh=X/vzQHaS6DgefpOqFlFIrw+4tMhEfEpaC6+Zq8wvhNI=; b=O6qaxkH+Ax1Znmo1q8/5Lu1T/1y2kNdV6Dtx7DrlEGuNS3H9J857gNllBE/wFKImjJzrhWmAT T4ArEwe2G2eDE9Es/UxdyyPck2KIIsi75BavEi+xZncyG42lb+LSWbw X-Developer-Key: i=quic_dikshita@quicinc.com; a=ed25519; pk=EEvKY6Ar1OI5SWf44FJ1Ebo1KuQEVbbf5UNPO+UHVhM= X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) 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-Authority-Analysis: v=2.4 cv=L9cdQ/T8 c=1 sm=1 tr=0 ts=681b0e98 cx=c_pps a=ouPCqIW2jiPt+lZRy3xVPw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=GEpy-HfZoHoA:10 a=IkcTkHD0fZMA:10 a=dt9VzEwgFbYA:10 a=VwQbUJbxAAAA:8 a=COk6AnOGAAAA:8 a=zM3vVQMSlQkg-yQo1K4A:9 a=QEXdDO2ut3YA:10 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-GUID: iwx11IYNI1U7cCqxx3_QQkK6TBcJBFdJ X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNTA3MDA3MCBTYWx0ZWRfX51nEjmEd9P4Q Y5YNyJa++XLl9G3NheR9BlxcEBoUkEXfFXwkVg9mrD+SIvVjEgjj13S6O2KaXHkc7TAa+G0ChT+ rdaV60w9Wz+1pO+UBAIfXHyrSh7R4ZzGy00YTv+TW5e4jBQLmYCPmi4vdL3nHV8T0+8In6e7zSH 7VCIUfZ4fCNlbQDU4h3fS28Yqhy1zuuLlohsnKCweb+obFQawsWdNYB0tPZyhiddIGtMhaRJMAk wOmoyXT0uiWil0rfumLc57cUQ6+hMk70J5N7GoP4Err+CEpa6qRahP9MGeNS8NVFXI4Ew1ea/X/ we2AYIy50eOwVvHuAU6O+1EMwt/JzYqY8rPp99emaYGlho/68OKMUs5T2sHH8PVUOx7w2OP/BJr phuRCf8j6POIemF1yq/woGiYnpDKRHl9p2XOSjxsMQg7Ox/3vQxyu9B3I/kzcmAvUjKaq534 X-Proofpoint-ORIG-GUID: iwx11IYNI1U7cCqxx3_QQkK6TBcJBFdJ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-05-07_02,2025-05-06_01,2025-02-21_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 mlxlogscore=999 spamscore=0 suspectscore=0 impostorscore=0 mlxscore=0 priorityscore=1501 clxscore=1015 bulkscore=0 lowpriorityscore=0 adultscore=0 malwarescore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2504070000 definitions=main-2505070070 When the resolution changes, the driver internally updates the width and height, but the client continue to queue buffers with the older resolution until the last flag is received. This results in a mismatch when the buffers are prepared, causing failure due to outdated size. Introduce a check to prevent size validation during buffer preparation if a resolution reconfiguration is in progress, to handle this. Cc: stable@vger.kernel.org Fixes: 17f2a485ca67 ("media: iris: implement vb2 ops for buf_queue and firmware response") Reviewed-by: Vikash Garodia Signed-off-by: Dikshita Agarwal --- drivers/media/platform/qcom/iris/iris_vb2.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/media/platform/qcom/iris/iris_vb2.c b/drivers/media/platform/qcom/iris/iris_vb2.c index cdf11feb590b5cb7804db3fcde7282fb1f9f1a1e..b3bde10eb6d2f05696e14fe0e7c44de013bec39e 100644 --- a/drivers/media/platform/qcom/iris/iris_vb2.c +++ b/drivers/media/platform/qcom/iris/iris_vb2.c @@ -259,13 +259,14 @@ int iris_vb2_buf_prepare(struct vb2_buffer *vb) return -EINVAL; } - if (vb->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE && - vb2_plane_size(vb, 0) < iris_get_buffer_size(inst, BUF_OUTPUT)) - return -EINVAL; - if (vb->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE && - vb2_plane_size(vb, 0) < iris_get_buffer_size(inst, BUF_INPUT)) - return -EINVAL; - + if (!(inst->sub_state & IRIS_INST_SUB_DRC)) { + if (vb->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE && + vb2_plane_size(vb, 0) < iris_get_buffer_size(inst, BUF_OUTPUT)) + return -EINVAL; + if (vb->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE && + vb2_plane_size(vb, 0) < iris_get_buffer_size(inst, BUF_INPUT)) + return -EINVAL; + } return 0; }