From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.52 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796252614; b=u8lY4ZnxK979JLgUhcOV9MY3Rb68QLQ7iV7ANpe9bgXbXF1CkkGLWJII7pNHA8HCSTdh nbgxgwdPmJvVXPPSmHeyFu25Sse4QqR50x5+rEBDFDYT8M86Srov2oTw63FVqHzUlIKHz jlIeGV+K6c3QginF0iy9u0wyayyVVJxZb53IO99hrM2HBHHQmxVf/OJiYgS7LriWQDpdd 1zeduSnjjk4m0NWhA/TfBDxdrcYfLnL+yEEU/HrMfsWMZT+vIWJ2oiCqOXJs/pEyVXppG 8BtaEz+oajAjYMBxMTvNI+dkgnAiUlm6pHg5Fiw/FlDrDKJUKUJA5K2TEDgizbZXt0w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796252614; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; bh=lQIXKgfw5Tc861Yh3ggEBqvCfz597aQMM2frFNhzB0o=; b=l0GABM8FA2lY1LmhWACa9CvHvneqjUGQtMdt8CSv9uitOz0h1z+viIezf3B1wPNnMrcH pF8mhUSzi8UDcxw9w4LpbOML7QUiMGZgyOwk+yQJ5wjIOLpAvd5gWb65u+sFjZUmSBfXa RLkunDEKQrl4OtsOECgJDt+32cx1v/onKwOZyrQhQKw4q3REpJrqcBzP+aFycZ8Rp7mKA rc9VK1mVd/mVr/OaLGJaxoHRqy21I47HNzpAWUQCyZ5R7bNAJ8BsIEqnaPmzM9zKflhRA Wxrk+fpomQEZoOOXZIrbu7tQ853C73UgUTGi49Hk4WbRRtDmlSUenEhXM9AJxdKx+rg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=JidamSwU; arc=none smtp.remote-ip=209.85.221.52 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A00C6606A692 for ; Wed, 2 Dec 2026 23:03:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A00C6606A692 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.a=rsa-sha256 header.s=20260707 header.b=JidamSwU Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-48e20ed3b9dso12202046f8f.2 for ; Wed, 02 Dec 2026 15:03:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796252612; x=1796857412; 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:content-type; bh=lQIXKgfw5Tc861Yh3ggEBqvCfz597aQMM2frFNhzB0o=; b=JidamSwUw772kmTr10ZjW9ksikTNlLW/mka9GINWlPL2+Y1t5tjojtFCh810lUsrBm yvC/nJfWn3rNlg9JRWiJmZ6/sI8MoV0gJqa06nPaTPCKjyaj6rGrhtbt/o8QoXwpZqav zCIdhLQWmEM9/clc9Oyc0svB4OpdrA0hdUrW2pQDuPCK/rUbkUByrgW0n0/mvbqs0KmJ fr/y04Xuf6tyhkfBT7XgSxVpRTENMGS5rD/ri8B4SiOhtYiwXGjBp206BSY/hCU3YI5c 5SyX1F7cN8ZF2548DOe2zyhc3SaiAr1+N1ePronRXCGEHjOpa7+N/FSwMFDN2UEVzkvR 6skg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796252612; x=1796857412; 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:content-type; bh=lQIXKgfw5Tc861Yh3ggEBqvCfz597aQMM2frFNhzB0o=; b=jfi3oXPRWrXycsKOeHzEWvdGCLvfuwRQsqFyXohAoVEUUrzjgNmVwJ3qLdsWIV5fz6 Z1U43FqA4+pZIcR1fJXhZov5DQFj4qTLUM9ow6O5LciR1NyYti/ATn1PxpHNt2zOZZ5w S7IyEZPVW5vnU6jnnD5AL+cK7+/iXsE5vfXkg08neLvqgD7TtryYJiz2kasJxfXTyHJo Oi10U+g0F2TXHRHhcUXHpSpGNMd8FLmyhHuVgr/jb82kdxZC5YIAZK5rXl8T/HlTScZL N2LH+f16XBvstt5xNXoK5CxDXwvDZvH9UEo6+uaeWL3ZzdfBa6b8I2LwALpYdbyu2zTb az5Q== X-Forwarded-Encrypted: i=1; AL+hErF/B7UY6MV95/4wZ6g0206es/YnzqfmISSburrHA8/BB/hfPpsPX559CygBjQnb9uWMUZs4JCwssb17Qeo=@vger.kernel.org X-Gm-Message-State: APuU4Z9JeuTlo/AtYkZ/taVPfaKl7fhsGGZ6iMyybGaR5u/D7xUC2Edy 2ndxGiIVPO0cxEhc+j8r6R275Yn6ihWonRKti+X1PMYm9EpAwAVZSIEuDWwEJ069 X-Gm-Gg: AZFdTZe43+XDm+2hdoBA1bUW8zlhUTL7WnGlEpqkdSE7FOEg55yxtpZW9Zc/ZZTjmhW mkUP2W5DFcLMzea725zWj23WNnhogjBSKVjueWwAjne4cytDXxfTWZcckzuyFe4uzIoF/4tbS/6 4NzZpTx7d79PpP1g0XuZI1+rDRrvb3DDjVfrFIVxiWVJM+UgEOA6d0yUlvZfERzleiS7jOp7xL0 H9FpfulpNfh4oZ/LFgfZTT4zlXSuLm/Mcjjm6pZjwn3b0pollpjEfQyUaSzphIwD10ugm2/L/X4 vCv8rH19XWcK0LinoV06tRAQG4kwU5+b53e6JeIJCbNX85pqp+JTQTj5SDGotETM8m0qyEptou8 Trwc2riCEG3J6Hq7NKENsHg5nQ5objJyJmXZ1LFMv3sORBjrn6uRCtghaGrAWUOT2N9uQiJsXjn kjD+3EPOsJ9Jy2INcLsKi2pRo24FqQMRfEQ/yHpfEE3z8BM8JMUyhM1V4MZvlKFful6njEhvq6T wvDmNPMk8w4ljwwBQDY5SigM5GzC7G/dGoian2bXX/FIUcYG1r0IDEAaCeYgHOdE6kY4xzMYwlD meN/u6HrnvCmHP7UvIc5Y100HbkvoR0cosSpuR1oTIjtUMhuUcLp7cBmJXi30Q== X-Received: by 2002:adf:ee47:0:b0:4aa:5396:a792 with SMTP id ffacd0b85a97d-4abb514608bmr63497820f8f.23.1796252611894; Wed, 02 Dec 2026 15:03:31 -0800 (PST) Received: from unknown.m0rf30.ray ([2a02:b021:8011:256b:d13a:b0f2:c168:28e9]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-4ab658e2c8csm81180838f8f.2.2026.12.02.15.03.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2026 15:03:31 -0800 (PST) From: Gianluca Boiano To: Bryan O'Donoghue , Vladimir Zapolskiy , Loic Poulain , Mauro Carvalho Chehab , Sakari Ailus Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, phone-devel@vger.kernel.org, David Heidelberg , stable@vger.kernel.org, Gianluca Boiano Subject: [PATCH v2 3/5] media: ccs: Store the format set on a sink pad Date: Thu, 3 Dec 2026 00:03:00 +0100 Message-ID: X-Mailer: git-send-email 2.56.1 In-Reply-To: References: X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Setting the format on the sink pad of the binner or the scaler only updated the crop and compose rectangles of the sub-device and its source pad, the format itself was never stored in the sub-device state. Reading the format back returned the one set up by ccs_init_state(), i.e. the size of the pixel array, and the selection rectangles, which depend on the size of the sink pad format, were bounded by it. Link validation then fails with -EPIPE for any readout mode that does not output the full pixel array: the scaler's sink pad format is the pixel array size whereas the binner's source pad format is the binned size, and there is no way to make the two match from user space since setting the sink format has no effect. Before the sub-device active state was used, the active sink format was stored in struct ccs_subdev (sink_fmt) in ccs_set_format(). The switch to the sub-device state dropped storing it. Store it in the state again. Fixes: d8bca3ed1d70 ("media: ccs: Use sub-device active state") Cc: stable@vger.kernel.org Signed-off-by: Gianluca Boiano --- drivers/media/i2c/ccs/ccs-core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/media/i2c/ccs/ccs-core.c b/drivers/media/i2c/ccs/ccs-core.c index 1cc435085..a4af27de5 100644 --- a/drivers/media/i2c/ccs/ccs-core.c +++ b/drivers/media/i2c/ccs/ccs-core.c @@ -2275,6 +2275,9 @@ static int ccs_set_format(struct v4l2_subdev *subdev, CCS_LIM(sensor, MIN_Y_OUTPUT_SIZE), CCS_LIM(sensor, MAX_Y_OUTPUT_SIZE)); + *v4l2_subdev_state_get_format(sd_state, ssd->sink_pad, + CCS_STREAM_PIXEL) = fmt->format; + crop = v4l2_subdev_state_get_crop(sd_state, ssd->sink_pad, CCS_STREAM_PIXEL); -- 2.56.1