From nobody Sun Feb 8 05:29:36 2026 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7369437E312 for ; Fri, 30 Jan 2026 12:49:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769777400; cv=none; b=Niw/o6/NHyPxoxCRUKStlmCs/Lry1wBPH50JEX6x5V2k/yApye3qtJkg7DNzWRf7pPphY1FMHrR+fVYXdAAp4sDvsX2Hyra2Yak+/XNFYhCy0I9SBLgj/rwiGhq86by0Rqglkj6RpRW59z73IVKt0W30SxS7QbUrbcael4lcx/M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769777400; c=relaxed/simple; bh=/SlcgcoXh6qESEbxV+NcpVqvXpkWkqApdJg+bzGWNTg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=OxvKMBzFpJ78Sk8Pz9eL3J88Rnjh4+FGVhUrYiySvwjgCkh6aoV411QxFpdjkF/psxMLX+z2sMvXcO61sTNDG5gAPYGnq6yyK2bGHh1TdvR9bOCXYt4yXrbiNzs2q7PvjJ7NJ+tRM9q4e5FZKZe3P0/zZ3xfp40+Y03Q1hpPFDg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=QIf2q0LT; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QIf2q0LT" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-47edd9024b1so17226555e9.3 for ; Fri, 30 Jan 2026 04:49:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769777397; x=1770382197; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FDyuTxJQ2wPWDIlHnScBHP39ldpO6z/HRmLWZsSUiWM=; b=QIf2q0LTJikh21uLKDT1MMoq0ewo3Fi0t2yjMv+M1Yj/t+pNu7VGQK61Bfd2GH1+s9 bHKEF0NzMYHX7kmjWnWHy62tYfBEFvbVofvRS+9mgkI+0kY2JoLslZf9TgrXwGfI9szY w+bxkBWihfkTUtrYqAtchcCEdA78cbi+05fLyPYkxYTDcWA47uBWmXuGg5TgXeNaxxGz Lbih4T8X9fDIm+dSkFHKhvo0G1/04KOeusmcF2kPoZcVnd+hd3F2ratVsuOV7AyD9Z51 OoEZLClTc3KOr9d/LOCEYOi57k0MWfRAt8XWc1FVUPTJQm6T/uSnM4d4vx8FxIhc/l5H C4zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769777397; x=1770382197; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=FDyuTxJQ2wPWDIlHnScBHP39ldpO6z/HRmLWZsSUiWM=; b=MaVn5MI0LOwS46gpaX6IcHTAXPtsvBHtIeupa+6GJrmA5DvOjTH987LgDUHg0Isaz0 xwq/6ZCTpOMzNOVms5onJh1osWRm6sRnHtfc/ps9SMZ1RYfYlUGKULBJkqG3dNMo9/t9 4NPicAgFi6aGy/jIC2FxQptMA0TZWlVoSFe6Nefcv/q4OoO1gE8eF9HV3rHAzA7drj8Q QP/fmPbjq29HmLyqsl811++H5tF4DysQKnOunqd3cM6H/Iavd3uvYE5lUG2CGMhdc7vD kYAs0Y6RYxwCF1R+x148sjmlOhPqrTLGS9UWYfrm8Wxr4cMkAZk1cKBzrSalfsaV7Vxi 1q9w== X-Gm-Message-State: AOJu0Yw3gYKFgvJh8sVtdgZwozTHa5BfmhTgUbzkAmGa7TasulQpBId4 3hMCvUCfuKPyvhxAIXfdeVUqeb39+7sDBenfufTD0+3/BDXQQOqVgNH6 X-Gm-Gg: AZuq6aKEBWEWz1MRfoE1DklpBIYCwarPh3N8/5SXJ85NRHUaxtQ29lkF8AZHQKMKJgP 2aw5HVI5ILMxxRG7cS5XTA1YFxIu1UVxoB3PSd49Z609LPDnE6TiXqDY1RJXtbxnEs4BOl3rJvM ixuAx/XZqSV0gZ3Nh66n1CllsJBsyedzIJRA15tGN+eguJW2suvmZFmm8+/r+eAfbAYrCs7lvgd Io9zaHMBnl+2ldvzD1Rc85SD7FVJvDw9CB5mc7gyQmUacEm0/pWfoNC79PBFl6+Cwwx2U8PaZPT eo72Fyc8TvHfbattAOPasx4lOFXYh7812gOpcI/yOunc6d2oPFmBRQd37VLUHveOPP+pceyW8po 5yEjQrI8BkLcHGaCSasnl6VLqbfVakwmuFSAN1bTcQcRdKMFuyL1P5X+vtVVIAVtTBLjUF3t8aX O7Z5CRbElKe8o= X-Received: by 2002:a05:600c:a00e:b0:477:63db:c718 with SMTP id 5b1f17b1804b1-482db4bda8dmr37743845e9.16.1769777396741; Fri, 30 Jan 2026 04:49:56 -0800 (PST) Received: from xeon ([188.163.112.49]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-435e10e4757sm22738783f8f.5.2026.01.30.04.49.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jan 2026 04:49:56 -0800 (PST) From: Svyatoslav Ryhel To: Thierry Reding , Mikko Perttunen , David Airlie , Simona Vetter , Jonathan Hunter , Sowjanya Komatineni , Luca Ceresoli , Mauro Carvalho Chehab , Greg Kroah-Hartman , Hans Verkuil , Svyatoslav Ryhel Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH v6 02/15] staging: media: tegra-video: vi: adjust get_selection operation check Date: Fri, 30 Jan 2026 14:49:19 +0200 Message-ID: <20260130124932.351328-3-clamor95@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260130124932.351328-1-clamor95@gmail.com> References: <20260130124932.351328-1-clamor95@gmail.com> 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 During __tegra_channel_try_format, the VI (Video Input) checks if the camera sensor driver provides a get_selection operation. If this operation is unavailable, the crop is set to 0. However, if the operation is available but returns an error, the VI currently fails. While this works for simple cameras with a single pad, it creates a corner case for sensors like the mt9m114. This sensor provides the same operation set for both IFP pads, but returns an error when get_selection is called on an unsupported pad (such as the source pad), causing the aforementioned behavior. To resolve this, if get_selection is implemented but returns an error, try_crop is now set to 0 =E2=80=94 treating it as if the operation was not implemented =E2=80=94 instead of returning a failure. Tested-by: Luca Ceresoli # tegra20, parallel ca= mera Signed-off-by: Svyatoslav Ryhel --- drivers/staging/media/tegra-video/vi.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/staging/media/tegra-video/vi.c b/drivers/staging/media= /tegra-video/vi.c index 4b80086f8c05..70a84158b589 100644 --- a/drivers/staging/media/tegra-video/vi.c +++ b/drivers/staging/media/tegra-video/vi.c @@ -476,17 +476,11 @@ static int __tegra_channel_try_format(struct tegra_vi= _channel *chan, fse.code =3D fmtinfo->code; ret =3D v4l2_subdev_call(subdev, pad, enum_frame_size, sd_state, &fse); if (ret) { - if (!v4l2_subdev_has_op(subdev, pad, get_selection)) { + if (!v4l2_subdev_has_op(subdev, pad, get_selection) || + v4l2_subdev_call(subdev, pad, get_selection, NULL, &sdsel)) { try_crop->width =3D 0; try_crop->height =3D 0; } else { - ret =3D v4l2_subdev_call(subdev, pad, get_selection, - NULL, &sdsel); - if (ret) { - ret =3D -EINVAL; - goto out_free; - } - try_crop->width =3D sdsel.r.width; try_crop->height =3D sdsel.r.height; } --=20 2.51.0