From nobody Sun Jun 14 12:44:27 2026 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (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 614862FFDCB for ; Sun, 5 Apr 2026 09:31:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775381472; cv=none; b=saSOpyXPbGxY3E7O9dzuAZbTl9W9ysFNm4imr6NWoB7InZ3Z6dH7MEHW0WdbCTgjwr3nXnGQ5nwsaKNfarfJRm1VFhHrr/lU5czfkYEa5ym9IMITcEv1A7Z5pYMN7lvjsfWmvQgh8/0XD2l8/IVnKxEovb2nbWNSbUKNlAHS5fA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775381472; c=relaxed/simple; bh=wyq5W/u57ccvu5nuOwIucSKyF20x4rNLLNnxHJNFwaI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kPTXzo1co0qQ0o9YpPr3yzstqg9r2RQhyoFzKNm/KaIKbWA8B4PIUpgOMmoy80/JB3oRPfJLPmui0af4VjRoHkKsJOc3r2BGj71YSVLqdisBvWPdrHW6nAubCWHUaPwZRuFnKI6go5SgXXLdu0QFlvc6wNjXQy+vAYIDsX54zbM= 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=bTdFoDdk; arc=none smtp.client-ip=209.85.128.44 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="bTdFoDdk" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-4887fd35e60so19754035e9.2 for ; Sun, 05 Apr 2026 02:31:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775381469; x=1775986269; 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=+HPdsHvT9b8ErzkI6+gScL5hWU8x38ZFsJYEpzY5RL0=; b=bTdFoDdkEI22Cm1/VU0majykNDeGkouRIYQSDzBRasWXt5fd9DScmuoS6To+gZ5p31 mtG66aidA1VhgsFTdnkX9aZ5laJRkAloEjFWeoheOJNeUMvL7iqRgJ5vqvhDgQKq9q8t 0sZ1EymHdKUU6rDhhPCyJagHqqRbepB/9oEP7a8otCGJe5MCbupNLgLndN6OPYsf1f2M J6fHhYwC4dbhZ16NCzEGIprh8O5g+JRFrDnsuLZl3WZ2HbSOa0ssdSH4V2GY6ZXb66hN ni0AsRp3QC7o7Bi+UpN2gIlVSUE+z2oWmAWznkmVWteQxCbd/Jeus2iqNIDQ45K8rsya LzcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775381469; x=1775986269; 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=+HPdsHvT9b8ErzkI6+gScL5hWU8x38ZFsJYEpzY5RL0=; b=AushTAOh38q+p+dpfFk4yEoCNGIg6A6ZUX7Fp8uojEC0OMQxBTDtetZc4L5xOU6roG rASAZhCa8eUhsjP++rKjQ0HJGXGu1Zl6Q6sm58qPvyapI23fMlIJLa01pcjVb95QT8p/ ARE2pKcja+XcbuCZnve69xK+2hz643WTiHfPu4jZdmjIRLqhdjnyYADUf8VjV03mkd/u BU0t8Qxzp09/4UE9cwdsy6z1nPVK15dEYHN+YMbWjctFnyRX0v/NTE6cEKYuhmB/cgQY Z6jg6eLygGOC5hfSCbQxbDuJ+Nyq1PpwAQ2v378ua/z6JTeQJxJR/pXfWJlbxJhflkDz FBCg== X-Forwarded-Encrypted: i=1; AJvYcCXW9CMlgCo+vOZ2nTKTj1ZJcAOm0voYSCrcCFnd2QF98d/92aGtPJTihcUBwdBrffth5/g8G8B+SX7Gu+g=@vger.kernel.org X-Gm-Message-State: AOJu0YxYA0I2a9mLzzQXjHCHET9Gfo46AeAEIkyzuPqpAMKg0xTaL2aL hRnKo3NcAyLqnewNGsSSK15tc/1+Nantv8YTD8i+A4sgMs8MWmGvesMf X-Gm-Gg: AeBDieuP2ZwBWcfTMFEbT0yeYXCx3atITJ7rCsA4/llS9pDHh3/UFHgX6P+w4O7evu4 1fWItwl348HDpYazztjznYRAoUgAGudMaj9T76IG38BEQ5y3JdXVEj8gawqs7RdkmJ6/47lAFXp w93tat7BSKTa6rV4e8ML1PLaH1StWQrrze0u50rzYDABVDj3I7Y+RuXahWDgGxtQDwTk19fOhwN Q1sOoA7PrKZ1/sM/BkQM2LSsz2QomzV56uX5tszzz3XHLWJGbcWTzrkmzu/plOatWNaYQr+AZlt izRgVEGbqQU24dRBNt7PrgcuT8qou4hkRJihrZ97spdd62HmthjqYZA69T/kMlMWZLdP5tIBH2U Z0zJaD9KsuNjbNNBr9WHAUTaEOI7Y9fHGkFy4DIgIxs/yeE23ksVK8vqbPtzEgM0XiW1KuRmWDa 6SOoTjAqH6gfhLc1X/4CL7SuOQ14MVSk5GtkulP0EQs91DFA== X-Received: by 2002:a05:600c:a4a:b0:488:904b:f31 with SMTP id 5b1f17b1804b1-488997a44e2mr135868585e9.22.1775381468491; Sun, 05 Apr 2026 02:31:08 -0700 (PDT) Received: from localhost.localdomain ([2a00:f41:1c83:b0bd:2a0c:50ff:fe2f:36f4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43d1e4e221bsm29156707f8f.29.2026.04.05.02.31.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Apr 2026 02:31:08 -0700 (PDT) From: "Jose A. Perez de Azpillaga" To: linux-staging@lists.linux.dev Cc: Andy Shevchenko , Hans de Goede , Mauro Carvalho Chehab , Sakari Ailus , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v4 1/2] media: atomisp: gate ref and tnr frame config behind ISP enable flags Date: Sun, 5 Apr 2026 11:30:43 +0200 Message-ID: <20260405093051.515222-2-azpijr@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260405093051.515222-1-azpijr@gmail.com> References: <20260405093051.515222-1-azpijr@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The FIXME comment noted that delay_frames can be NULL for certain pipeline configurations, without knowing why. The reason is that when a binary does not enable ref_frame, delay frame allocation is intentionally skipped to save memory, leaving the pointers NULL by design. The ISP feature flags in binary->info->sp.enable accurately reflect which features are active for a given binary. Using enable.ref_frame and enable.tnr as the predicate for their respective configuration steps ensures the configuration path stays in sync with what was actually built into the pipeline Signed-off-by: Jose A. Perez de Azpillaga Reviewed-by: Andy Shevchenko --- drivers/staging/media/atomisp/pci/sh_css_sp.c | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/sh_css_sp.c b/drivers/stagin= g/media/atomisp/pci/sh_css_sp.c index 6da151e7a873..abdffff41ae2 100644 --- a/drivers/staging/media/atomisp/pci/sh_css_sp.c +++ b/drivers/staging/media/atomisp/pci/sh_css_sp.c @@ -775,9 +775,13 @@ static int configure_isp_from_args(const struct sh_css= _sp_pipeline *pipeline, ret =3D ia_css_fpn_configure(binary, &binary->in_frame_info); if (ret) return ret; - ret =3D ia_css_crop_configure(binary, ia_css_frame_get_info(args->delay_f= rames[0])); - if (ret) - return ret; + + if (binary->info->sp.enable.ref_frame) { + ret =3D ia_css_crop_configure(binary, ia_css_frame_get_info(args->delay_= frames[0])); + if (ret) + return ret; + } + ret =3D ia_css_qplane_configure(pipeline, binary, &binary->in_frame_info); if (ret) return ret; @@ -807,22 +811,18 @@ static int configure_isp_from_args(const struct sh_cs= s_sp_pipeline *pipeline, if (ret) return ret; - /* - * FIXME: args->delay_frames can be NULL here - * - * Somehow, the driver at the Intel Atom Yocto tree doesn't seem to - * suffer from the same issue. - * - * Anyway, the function below should now handle a NULL delay_frames - * without crashing, but the pipeline should likely be built without - * adding it at the first place (or there are a hidden bug somewhere) - */ - ret =3D ia_css_ref_configure(binary, args->delay_frames, pipeline->dvs_fr= ame_delay); - if (ret) - return ret; - ret =3D ia_css_tnr_configure(binary, args->tnr_frames); - if (ret) - return ret; + if (binary->info->sp.enable.ref_frame) { + ret =3D ia_css_ref_configure(binary, args->delay_frames, pipeline->dvs_f= rame_delay); + if (ret) + return ret; + } + + if (binary->info->sp.enable.tnr) { + ret =3D ia_css_tnr_configure(binary, args->tnr_frames); + if (ret) + return ret; + } + return ia_css_bayer_io_config(binary, args); } -- 2.53.0 From nobody Sun Jun 14 12:44:27 2026 Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (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 B36ED303A0A for ; Sun, 5 Apr 2026 09:31:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775381477; cv=none; b=jlQd7uQVeyQgnrhYcsW3egLzQ/KOmU//A9GPNf1cUmYM64xSX2MiRpS94njv5uIudbmMVZzU/V03JfK270cyW3Xwg0a3/aNx6v238oYY3pTKFJySb3sjciKfGtY+f1Q9P7aVV5CPlWbbxA98rvlnQnefpXptFN8nSuelqGClz34= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775381477; c=relaxed/simple; bh=ErK4cyjYPm91+zNjvpGOJAvbVwIvmcEeItVbsI1yMSY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KUGOllP6KoOY7maPV2vmwxk9fl1Tuk5Wz1jH1T5ISstUJiOJAlD7X+k4tJ2LPAxbHXqX1F18q1PzNX3X5PHLrLftycBALjfwrxzSyOTuINKk8lQ06s+72IioNiKAtQOZbaSUP7UboeiKgyW/YNUsSc5dVvAgstikMeLfLrzVfBI= 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=MZC9p03R; arc=none smtp.client-ip=209.85.221.51 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="MZC9p03R" Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-43cf906b007so1666438f8f.0 for ; Sun, 05 Apr 2026 02:31:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775381474; x=1775986274; 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=bXMWNVHfumBchZlq3WtoZ97ns5eMXe5atHuWyp6eKiE=; b=MZC9p03RD6+X91pi1MzkSwpjjoHE+3kgHjomxJKGungMN1zNxzWIdD2Eo2L3DXD4Gr 41zoBFQ65ODFk93qS97bZg55ud6iMMiE9ylAR3yMr+2u/A5VpLX/9io3lFx4cx5QaPjF FGo+AzpZmIICF5+489MD0/WNxIypXZZDyJGLT1r76RbE9VyZFx1g1PZ6bx922aM/HKUZ 6V9SK+03gEH6CiVOPKIgbAYoBwjeh+sW/M8ulSLyJX6V0H/I3VGxZMXxWUMgXc/4vtXK Z44Pl7/fKMt+JwJvOWQIzFpcqKv+/17Gwe8Zh0Qki3OZFMItvqxrDPc6rEz9w9KVCO0Y aRZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775381474; x=1775986274; 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=bXMWNVHfumBchZlq3WtoZ97ns5eMXe5atHuWyp6eKiE=; b=sQwrnm3LAVKSOQlsu91sdxovYzYRHi930+g1BlDrWZpdauReFUuUUxf63yAlHhGl5x otWwMQDRZW3XyjeO3URJQmRmZxEWoMalkfSc1wSxIYC1TioGqyZocrQ7m/KAmop7IxFG ZnJ5dJ044X/Dt05doM5pS52QRyWOO/fJj0EMYijNK2a2YrpmVztc8n58ZFLKrxoYtq6r zcjVaKAjC8EeG18XzSiFJEmY6utiO2COx1opaqSdnx2BnTn9kIA7GXiTloLPVK4NRD1e 9It0hbHw5YfpSxkm0uO7WkaapIk2K3Ovg+GyZrM2TuDnOCQo3lHe/rcOeiTpbDXn+uoi yR+w== X-Forwarded-Encrypted: i=1; AJvYcCUFWCdyPO3B4aNU5C9ftq0lkWhkNYP0dx/It6FuVeYfbpWlx+EC494ynFwb5AXF7pV209n1gbthvInnwe0=@vger.kernel.org X-Gm-Message-State: AOJu0Yxc0tEBYns54bLblosTX8ZlxuiqSnwd12m4OWL60HYDsvOQKdN8 kYV6+2dfHvEjFV0CFTxurl3WCF2tY7V1WJD7qemXCdSOKQgqzsrvhE4t X-Gm-Gg: AeBDieuVlw+usjpnSL0FvD4rCVMxMyP/JTbsIw+MWvZh77HBi8zeQEid5Ox/fMN+vtT ZnkkKwYH4S59IFGxgfGtDJ9ONBPQtxzhZYMzrBPIrmgA+WjVM5cD8qzPoSDNM9MSl6gNbaa1x9E RBUt87GOFzCweR0SpoQPgWU2X+mnfCbmn6JnM0iCv5kHNVzJ/MwpkfqkNUAwG8P7Zp19H/ZDWlu xp9isVrSYi53Yuvfg+IURWtKcfCx0oObiT9p4+LidoK2XIUX8Szd+mMuuLojfzxwzkg3dK8ny7T RmGpbabpbNMcxy1m/1jNw02PUoV9LrnObAT3XxouRcyZOyTlJTeQjJb6ADFz9EEVI7e+VOzy1Qi c4poihtdkz8Tf7F+1Er3cwdpE6nFejUxwXGcAiLzk7s3zpRG1GpZ6C2hMN8cl/SdBq0L0J9sPGX SRb3z6tvdUYkhECp8OG9n5PYIQzs85dPEcWOF3R3FFSaxKRA== X-Received: by 2002:a05:6000:40dd:b0:43b:8858:1146 with SMTP id ffacd0b85a97d-43d292e7fd9mr14331002f8f.41.1775381473697; Sun, 05 Apr 2026 02:31:13 -0700 (PDT) Received: from localhost.localdomain ([2a00:f41:1c83:b0bd:2a0c:50ff:fe2f:36f4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43d1e4e221bsm29156707f8f.29.2026.04.05.02.31.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Apr 2026 02:31:13 -0700 (PDT) From: "Jose A. Perez de Azpillaga" To: linux-staging@lists.linux.dev Cc: Andy Shevchenko , Hans de Goede , Mauro Carvalho Chehab , Sakari Ailus , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v4 2/2] media: atomisp: remove redundant call to ia_css_output0_configure() Date: Sun, 5 Apr 2026 11:30:44 +0200 Message-ID: <20260405093051.515222-3-azpijr@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260405093051.515222-1-azpijr@gmail.com> References: <20260405093051.515222-1-azpijr@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The function configure_isp_from_args() contained a duplicate call to ia_css_output0_configure() using the same output frame index. Remove the redundant call to simplify the configuration path. The ia_css_output0_configure() function acts as a configuration setter. It populates a struct ia_css_output0_configuration from the frame info and caches it in the binary parameters. Calling it twice with the same out_frame[0] pointer merely overwrites the exact same state with identical values. It has no cumulative state, neither does its order matter relative to ia_css_copy_output_configure(). ia_css_configure_output0() writes into binary->mem_params.params[], a software-side DMEM parameter buffer in kernel memory. The ISP firmware receives these parameters later as a batch, not at the time of the call. Calling a pure memory write twice with the same pointer and same value simply overwrites the same location with identical data, there is no hardware interaction that could require repetition. Signed-off-by: Jose A. Perez de Azpillaga Reviewed-by: Andy Shevchenko --- drivers/staging/media/atomisp/pci/sh_css_sp.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/sh_css_sp.c b/drivers/stagin= g/media/atomisp/pci/sh_css_sp.c index abdffff41ae2..2beb7168517f 100644 --- a/drivers/staging/media/atomisp/pci/sh_css_sp.c +++ b/drivers/staging/media/atomisp/pci/sh_css_sp.c @@ -792,9 +792,6 @@ static int configure_isp_from_args(const struct sh_css_= sp_pipeline *pipeline, if (ret) return ret; ret =3D ia_css_copy_output_configure(binary, args->copy_output); - if (ret) - return ret; - ret =3D ia_css_output0_configure(binary, ia_css_frame_get_info(args->out_= frame[0])); if (ret) return ret; ret =3D ia_css_iterator_configure(binary, ia_css_frame_get_info(args->in_= frame)); -- 2.53.0