From mboxrd@z Thu Jan 1 00:00:00 1970 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 00C93314A7E for ; Tue, 28 Oct 2025 11:57:28 +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=1761652650; cv=none; b=dfR/YZy1C7xe90Dtzmx5iQKDX5Ok2YtAaEb4setVzAT18zZKe8Hr13CljGyS9rVWNKel52DMAjqIdKPPjdwVwsgUkJJ8nPqnIFkheM+6JKa2XGr+UsjPQ0hrTwAtbdjvKqUUbSjYq1hAGcU6Tte6y0Ee2vqwvFgwLhJKsxvofa8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761652650; c=relaxed/simple; bh=9xkHgYIC5kr9w1gwfKZuklAm0CvF7Aip9Ua4e6pxhbQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=qyq9Xce8Vv+vBOfbuEk1R0KufVl7QGM6v/oLhKhKF70X79EtFtoeNQx8fgZZHqDLMFYSBRcrJaCZkByJ7XT695Te3BGmiPfxP+2FjCvyM4+qk4Bbco3HVKNIUyebR13kmw7PFAmfsOmNnpDltkfLNAtqrRzV8mjoR3UNOuKiD/8= 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=C/mwc5Fb; 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="C/mwc5Fb" Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 59S7RbIu3813263 for ; Tue, 28 Oct 2025 11:57:28 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= M0hz2jfODAAr0ZC0/E+I8v4TQoFcW072mTuJka4S2b0=; b=C/mwc5Fb2cQ+6xaL wjAp2lunp/miyzgNWXDSFcR3p4Nrifhgw+I6WwDaJedPu6bE5RiEAVdx0n6EvKPJ +E6tjXSynFEkiqOJXRHwkM/xLU2u92rJUNHaGHM1HfEnUj0ommhkY99fa5w37ZHt 8YziXsoUpfbT9FzUa8MUTGU0vO9EGb51E+y/WNK+qkQcG5Nhvo06Ibo+/uC4pn1I KcvQI8bSQOUxhU/rsd1TaoKFqe0oCXdi+Hpz+QDgLwWzzSdEysDo1CVOulrB6Tso 30o98jmMmOsiaVPMt5r3p9nDVYf/QRwixVsOZ8LlnKJaG04QBjIn2tzQ2GJyZao5 51/M5Q== Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4a2g2ft9rp-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 28 Oct 2025 11:57:28 +0000 (GMT) Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-277f0ea6ee6so52069565ad.0 for ; Tue, 28 Oct 2025 04:57:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761652647; x=1762257447; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=M0hz2jfODAAr0ZC0/E+I8v4TQoFcW072mTuJka4S2b0=; b=Exp9sGbVoNapgrq5w5pLzRguJ4c9h7R4N6K0C3BGwB4NiJu8F8ODV9V1eMaaquPLmT +iVgIaCGKSeGmmDB21WL+nZOv+TyvOgpml6xHL6gTLZuevNUuV/4eujE1VOI7eCFkZ1r ZVOV4B5rfai4widPyLvKydTvtlG/IUB6jBHuhM1w9jAhoWETEAyqKCWM4SyCsxOIQPLl NtdaglJovF3RHT6DkEnJn76xBZKIlBPOKWlcxd1PCqDur1qoRbqTkPvfEIHDVaeddQ5Y WMJrFnAJjojtb2xeti1lxS01ASjkTdxiTFhPpl0Xep2qbhMQwyMcI0RICi/P6m9Blt7P GV7Q== X-Forwarded-Encrypted: i=1; AJvYcCWXXnw8zBM1EZEmHYGD9NA/Nag3vwjFv8G7bTmAX5g4U8zWelctUdmrjKJ+UCd/FxayBI/Av+OPHC2bT+Q=@vger.kernel.org X-Gm-Message-State: AOJu0YxXCwsOx5QXwbIF/8TBiKNffPJdY5iupHAAr9DE7vsjjLyPRGwe i17Gt6+Slx3D8NmNBWJ+AVw86gcSor02qt0vhEKHxPypXupbkqqg/M+2bvTtKQxr+1B6eCACTlX nBBI3dQ5//DBg9jnzUOvunhmcW+IK7Rfzw4hT99JF8BZkN3FnhV7/u80yeOPvEeWP0pY= X-Gm-Gg: ASbGncthl8gbS1zQkMom3bhaHofOHFlnYjz+/wAFNjLUh0hQGq5GDiknXip0fyi9BDQ 8c3KEKWAerWTkBledoEqvDsDLA03XhhGcE6ISlxAie84M5JW5Ul0NdqDKli4x587xP2gt5KhL5Q myWizRYpbzAcCkL+XigVCkycf7JF6Wkd/kJXj5AVaXtiwh1eHOcYUAIpeDuXPO/sfhoSBT2YAdC Rgpc0tL5QDmbOPjCscPN9fzQ+ZdcHAjysnuYNQs9dFw+0/Aq+JDTASPoBJTOWsfGJD+BIeZ60U7 DwNl9H04raUcEB4ozGEk86Qv/Hgv9IkAX24el4fqGkTXsfZX9sH8yt7iYlqgN7VMKc54UCf9Mvs F1MIJO6s+herq+DucndLqRvQXaRFIU5s= X-Received: by 2002:a17:903:1b6e:b0:294:ccc6:cd31 with SMTP id d9443c01a7336-294ccc6cf68mr33391085ad.16.1761652647450; Tue, 28 Oct 2025 04:57:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF6NHHgc+bevFWOYNTOyhx/IK9uUVX3a2+fvaHYWDRweyl69NQatdOfr8zuxd8txq1BmuzJ7g== X-Received: by 2002:a17:903:1b6e:b0:294:ccc6:cd31 with SMTP id d9443c01a7336-294ccc6cf68mr33390665ad.16.1761652646962; Tue, 28 Oct 2025 04:57:26 -0700 (PDT) Received: from [10.0.0.3] ([106.222.229.252]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-29498e42f34sm113081035ad.106.2025.10.28.04.57.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 28 Oct 2025 04:57:26 -0700 (PDT) Message-ID: <34097d61-ce31-0ea9-bb89-7b91162a0c71@oss.qualcomm.com> Date: Tue, 28 Oct 2025 17:27:22 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH] media: iris: set default size when S_FMT is called with zero size Content-Language: en-US To: Val Packett , Vikash Garodia , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab , Hans Verkuil , Stefan Schmidt , Vedang Nagar Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org References: <20251012235330.20897-1-val@packett.cool> From: Dikshita Agarwal In-Reply-To: <20251012235330.20897-1-val@packett.cool> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMDI4MDEwMCBTYWx0ZWRfX/EfZtDynlhsU XhQXo1YY9vgqs93FQ2N54abtiF/zNvbutg5RsGvBaC8b1o+khFlrgHEtzcH+Z0MMwYQrQKMaU8J tXawrC6rZcUAEyC+jEXAas8hWZVwaH+EdV6OveUXRHvTizeQDE3yNjG2CxtGjOsNnpyrRxeP32Q W/Xi4RShUGbzhNvRxYmquvtEbWw3l8cU/njO0byT8rmoRC4pYZwXfVrotRCfgot8D8aweYsl0lV BDVid61Ar2XotB6R2Z4qNlgwwijhISRsVioXUaBTUkSLg6Jb3yp96sbSKKs9X/DuQ9CWf4+yoaw JQNz0uINuoKtG9exbOErPEXscgCrjN8R5Tte2KHXhB5XO6Ow3v+dYGXkX97Ma4vG1kAVg1iOkkN RpP8Sz8izc2BdIdznfiTiDqF4wQzow== X-Proofpoint-ORIG-GUID: uBlURZDcebjQOFTP2NkCYuEPHJiDJPgz X-Proofpoint-GUID: uBlURZDcebjQOFTP2NkCYuEPHJiDJPgz X-Authority-Analysis: v=2.4 cv=FIMWBuos c=1 sm=1 tr=0 ts=6900afa8 cx=c_pps a=cmESyDAEBpBGqyK7t0alAg==:117 a=L4UNg9I9cQSOxNpRiiGXlA==:17 a=IkcTkHD0fZMA:10 a=x6icFKpwvdMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=NEAV23lmAAAA:8 a=EUspDBNiAAAA:8 a=R56oJKbAf1OrWRSGOwIA:9 a=QEXdDO2ut3YA:10 a=1OuFwYUASf3TG4hYMiVC:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-10-28_04,2025-10-22_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 priorityscore=1501 lowpriorityscore=0 bulkscore=0 clxscore=1015 malwarescore=0 adultscore=0 impostorscore=0 spamscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510020000 definitions=main-2510280100 On 10/13/2025 5:20 AM, Val Packett wrote: > According to 4.5.1.5 of the M2M stateful decoder UAPI documentation, > providing the width and the height is "required only if it cannot be > parsed from the stream", otherwise zero can be passed. > > The iris driver would only set the state fields to DEFAULT_WIDTH/HEIGHT > once upon init, but they would get overwritten with zeroes from one S_FMT > call and the next S_FMT call would already see zeroes in place of the > defaults. For clients that used that sequence and did not pass a size, > such as rpi-ffmpeg, this would then result in REQBUFS failing due to > the zero size remembered in the state. > > Fix by explicitly falling back to the defaults in S_FMT. > > Fixes: b530b95de22c ("media: iris: implement s_fmt, g_fmt and try_fmt ioctls") > Link: https://github.com/jc-kynesim/rpi-ffmpeg/issues/103 > Signed-off-by: Val Packett > --- > Somehow Venus didn't have this issue and didn't explicitly handle this.. In venus driver, try_fmt is clamping the resolution between min and max supported which might be handling this case. > > I'm not familiar with this code so if there's a better way to comply > with the UAPI requirements by just not even getting to overwrite the > state with the provided 0 size, I could not figure it out. > > Still, let's get this fixed one way or another. > > Thanks, > ~val > --- > drivers/media/platform/qcom/iris/iris_vdec.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/media/platform/qcom/iris/iris_vdec.c b/drivers/media/platform/qcom/iris/iris_vdec.c > index ae13c3e1b426..6be09d82e24d 100644 > --- a/drivers/media/platform/qcom/iris/iris_vdec.c > +++ b/drivers/media/platform/qcom/iris/iris_vdec.c > @@ -196,6 +196,11 @@ int iris_vdec_s_fmt(struct iris_inst *inst, struct v4l2_format *f) > if (vb2_is_busy(q)) > return -EBUSY; > Can you pls add a small comment here. with that, Reviewed-by: Dikshita Agarwal > + if (f->fmt.pix_mp.width == 0 && f->fmt.pix_mp.height == 0) { > + f->fmt.pix_mp.width = DEFAULT_WIDTH; > + f->fmt.pix_mp.height = DEFAULT_HEIGHT; > + } > + > iris_vdec_try_fmt(inst, f); > > switch (f->type) {