From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.222.200 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796427755; b=ouH+aicItfquURTQwAnicndDyt1XZBAkcyxs3YZly873C8Pt8Ka/PLiIpxf5S/0jgRA+ oOm4sEk4Lky98uPYIKtWqSxX+2x9ZY1XcXPl3LiDQf4rxb1e5yVIq2VWkzUOJOo3Dk7QC Yc5Zd1c7cgXWpbSNZ+TJ6pn/WY8olRGWppKX6fi6zY08TmWG1p0Y5lZq+D8bqNnkWKrnn S9oh4MG1Jt3dzBk3mRg8Wj8IaSzX6OAiju34ldTAFJLaa1q//BMxQCv+OCd2IKTC+8ka/ zTo0RaNyiDtDglf6DmJfZCbQTOik/+dyPEG/aLiHjnw3ai7VklXQqOWF360ftVaqC/A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796427755; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Received:Date:In-Reply-To: Mime-Version:References:X-Mailer:Message-ID:Subject:From:To:Cc: Content-Type; bh=UpMPfQzmVHcC9OX0S+yi9hDhiK2ykWfpVWlcCF6mWyE=; b=UpIlo7Aey0hAQnujItKtfHUI5C+Oett+KsUywrwHdCjSZvOv7gwlPDUxp5H493E4wRFp 32ms0vnlM/BhP5JKYWMnKhmb8NTozS6sxS3S53WHQl7IGcIfAgsqINvVUPo6BhsWNMsdl nsCyb6mBAZz/iXHRHOVyCEOgSTHSKrbXs7gfXmzZL0EKu783WwEkRVY5FVqrb+cjl2ed7 h/2o/cxcD2tYMtHMUQIG4FNnIwtBK0z5cv8Ns5LdgNV7lwCkQ+vhQLPUiss+xSyTjCbYN UadGoAxjNL7Oy7wYwCZfpKnWf3wqhTP1aTSQDe4PUFjF7fS9R460PArgdbksmfxEy4A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=google.com; spf=pass smtp.mailfrom=flex--gildekel.bounces.google.com; dkim=pass header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=XYkXoLpg; arc=none smtp.remote-ip=209.85.222.200 Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) (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 EF96F606A322 for ; Fri, 4 Dec 2026 23:42:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org EF96F606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--gildekel.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=XYkXoLpg Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-93f20addba1so230818185a.1 for ; Fri, 04 Dec 2026 15:42:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1796427754; x=1797032554; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=UpMPfQzmVHcC9OX0S+yi9hDhiK2ykWfpVWlcCF6mWyE=; b=XYkXoLpgkzjtB5LVCTmQZfyosfR/oxmsdqxk1vFXid5jYsPZXzQFmhpbt2nImXqAeP iu0L0HjslCMxYTmtT6pPc9FL2NZdnjVNNc4/nwiNTMbP2cr4lgD7kGbP472N1RRNei9a Oonu/gt0qalmh1aYaV347q8fEVwsBIScSHpWMTMXy0V+3fhBWxv7xhn8zJNL5pKT9WRD adydKE9/HrysjK1xW4u6P1Vusu54jMSc0sf8FdDizg3oc6xQI9y/2Xevoh8ikddf3Epr sdRoozRMRjrBH/MmiCiJwoTvDMm+iQ8g0sEJfFptJIYCyXuW+vcKtaTtGzicwwkm+Cge 39xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796427754; x=1797032554; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=UpMPfQzmVHcC9OX0S+yi9hDhiK2ykWfpVWlcCF6mWyE=; b=c7YbL21ZMqZ2hbPmbhosErSACxuTX0Kh62gVpRRrAn2VCUXHTSlF2EAFyIdvM5O6RE DyaIpmJsCtDcUgzxLdAXyxvGe9wgN0yGgPiyDBxh3/AzlP94hF8YzWaVTs3RuI9ev23B AExSrpdq3eqbEQmKzckJH8SfHQ8f4N7uFVNtQ7Lh8mrRWNNbMgqIAjbpjoHvzPKiDjv/ sHO+D3mo95OtVn71S2tDRGrXoY6O2NTk2gbWeYtCNGb8FNuLoA9e0bZOTqtOTS76W8AM FvjmSPtOuTX5Yagmsg47ZGBZL8v1LjsrhGTTNJWKBS3EmysuCjdtAIzCEQ7vUjDHH+rJ 6IUg== X-Forwarded-Encrypted: i=1; AL+hErHReBgp1sRFQflF7fgkRUdmWNcgsb34xU1fCN35gSSR/G4PdvGCLvm0cptBcnRex1cLEOB4JMwdpxUY+2f1@vger.kernel.org X-Gm-Message-State: APuU4Z/3nZMPbW0T4EB7nw9mhkgBVmbL6HwarsCPnZXufIQ+BdF5ID6N 1CLp2UrlCXOdQD8hUMRGLxi6cvc+StOutS2DwehGwM7rZg2bp/rhxvlftoRHFWCRKGCgJqHHfHB osvnZZRm2QE+ACA== X-Received: from qknto7.prod.google.com ([2002:a05:620a:4c87:b0:949:4c6b:168d]) (user=gildekel job=prod-delivery.src-stubby-dispatcher) by 2002:a05:620a:1794:b0:93f:2bca:2cd8 with SMTP id af79cd13be357-94a82dda07bmr586346185a.57.1796427753703; Fri, 04 Dec 2026 15:42:33 -0800 (PST) Date: Fri, 4 Dec 2026 18:42:32 -0500 In-Reply-To: <20261111160814.21326-7-mwen@igalia.com> X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 References: <20261111160814.21326-1-mwen@igalia.com> <20261111160814.21326-7-mwen@igalia.com> X-Mailer: git-send-email 2.56.1.915.g69d5ec7298-goog Message-ID: <20261204234232.2131698-1-gildekel@google.com> Subject: Re: [PATCH v5 06/15] drm/atomic: reject colorop update from inactive color pipeline From: Gil Dekel To: Melissa Wen Cc: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, Uma Shankar , Chaitanya Kumar Borah , Sean Paul , airlied@gmail.com, simona@ffwll.ch, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, alexander.deucher@amd.com, alex.hung@amd.com, aurabindo.pillai@amd.com, christian.koenig@amd.com, harry.wentland@amd.com, sunpeng.li@amd.com, contact@emersion.fr, daniels@collabora.com, sebastian.wick@redhat.com, siqueira@igalia.com, Xaver Hugl , Pekka Paalanen , Matthew Schwartz , kernel-dev@igalia.com, Rob Clark , Dmitry Baryshkov , Marijn Suijten , linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, louis.chauvet@bootlin.com, John Harrison Content-Type: text/plain; charset="UTF-8" Hi Melissa, Checked this against i915/xe and userspace behavior. Main question inline is whether rejecting idempotent no-op writes on inactive colorops is actually intended by the uAPI contract, plus a couple of smaller items. > A colorop can only be changed while it is part of an active color > pipeline, or in the same commit that activates or deactivates that > pipeline. Enforce this contract by checking that the colorop belongs to > the color pipeline of a plane in its current, new or old state, and > rejecting the state change otherwise. Unlike patch 08/15, this patch does not update DOC: overview in drm_colorop.c. Documenting the active/transitioning-only update rule, the -EINVAL behavior, and inactive-state persistence there would make the uAPI contract clear to userspace. > + /* No changes in the plane state. Check current-committed plane state */ > + if (!new_plane_state) { > + drm_for_each_colorop_in_pipeline(colorop, plane->state->color_pipeline) > + if (colorop == new_colorop_state->colorop) > + return 0; > + return -EINVAL; > + } drm_atomic_get_colorop_state() already holds plane->mutex, so reading plane->state here is safe; adding drm_modeset_lock_assert_held(&plane->mutex) would make that invariant explicit. > + /* Same color pipeline as new; no point walking old. Colorop isn't active */ > + if (new_plane_state->color_pipeline == old_plane_state->color_pipeline) > + return -EINVAL; Because drm_atomic_set_property() calls drm_atomic_get_colorop_state() before checking whether the property value changed, even an idempotent no-op write (e.g. BYPASS=1 when already 1, DATA=0 when already 0) adds the colorop to state->colorops[] and fails the entire commit here (and in the !new_plane_state branch above) with -EINVAL. The commit message and contract forbid changing properties of an inactive colorop, and drm_atomic_uapi.c already treats unchanged writes as no-ops (!replaced). Unless the uAPI contract explicitly forbids even mentioning an inactive colorop in a commit, shouldn't unchanged/no-op writes keep succeeding rather than failing the commit? > + for_each_new_colorop_in_state(state, colorop, new_colorop_state, i) { > + ret = drm_atomic_colorop_check(new_colorop_state); > + if (ret) { > + drm_dbg_atomic(dev, "[COLOROP:%d:%d] isn't in an active color pipeline.\n", > + colorop->base.id, colorop->type); > + return ret; > + } > + } Once patch 08/15 adds the missing-DATA check inside drm_atomic_colorop_check(), failing that check prints both "enabled without a DATA blob" and the false "isn't in an active color pipeline." message here. Moving the inactive-pipeline log into drm_atomic_colorop_check() and logging "[COLOROP:%d:%d] atomic core check failed" here would match the plane/crtc/connector checks below. (Side note on IGT: tests/kms_colorop_helper.c:279 still calls mutative igt_colorop_try_prop_enum() for KMS_COLOROP_FIXED_MATRIX instead of igt_colorop_has_prop_enum_value(), which looks like it will hit -EINVAL here during YUV subtest probing. Happy to send a 1-line fix on igt-dev.) Assisted-by: Gemini Assisted-by: Claude:claude-fable-5.2 Thanks, Gil