From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 895BD606A334 for ; Fri, 4 Dec 2026 23:42:52 +0000 (UTC) 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=B8qZotUI Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 938E710E18A; Fri, 4 Dec 2026 23:42:45 +0000 (UTC) Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by gabe.freedesktop.org (Postfix) with ESMTPS id BA8E710ED01 for ; Fri, 4 Dec 2026 23:42:37 +0000 (UTC) Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-947a607ec40so158411085a.3 for ; Fri, 04 Dec 2026 15:42:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1796427757; x=1797032557; darn=lists.freedesktop.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=06B9lsEJfQBaAaQRCoWHW+BURxK078Gyf28YEwao9wM=; b=B8qZotUIDqDNa0T3S+iMU127E5vFPG6wEbZLdS7wnU1TJ+Jb2SE1sfnAUubcXjVDIr 7fKeovfF/x7yEuRvjbDsVnTnsqvSfl4SOXQtuS5TnzRXxs8URuXIRARD6MeT937R1du0 +d3ImUa3moUqB+fjdYRyANB9xlNtUXLyNTObQiT2icPFC2uAsdGrCXw+dKZVc+D5XF6M +oJlhGzY/QuqF1FmMkUDWgJXILay52bU6K9Y9K0jfkk8d96wSxkhaqIo9c7aGCnQtjzO kTMktuON6lAhm2dCIGL7Mm9SpEDVgpT9DwaAp63E70Mz0+bv4CIyK8gfN4m25RmAD1Nd QoqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796427757; x=1797032557; 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=06B9lsEJfQBaAaQRCoWHW+BURxK078Gyf28YEwao9wM=; b=0iNdS5HuudPiqRtYf0Dd9ODlFsLu4HpogsGRWvj9dHAAse+cYkHrCGQYSiiUHr9+vV 9uChGJJmv9CORqq+Yjy+JrL1rOrUre018nbvhZLvTfDRrOcgUJ3OLbqZFb/S4Q5AAPSF B7PiAg/1eRdgF6aJ8K3VLw2tV0CiqlWuoqeXcQu7Ut5LkWu0pGze/KRWpWWxmn9rRdIQ PP81VcLgAPZHly45Bo/y0PC3bM8aAeX2S3aE7lr85Va1YcipDOAn7ANu38j1SA+HeNrp w/1cGYR8lrG/bhp5tkRbx2/DRlnTAwGBFJWxlYOYbv5nv/p92kvXYl3VVmh8dGeVsYEs 1erA== X-Gm-Message-State: APuU4Z9s18DlJXItlWdcyyf68crb08KdMfqiVX52QmuZf6/i6L9lL7RR A63mCyALOYnqG7wzUghbFejM2nCust0gTpMqQGdKhViobkkHv179d55zg+9Ftskk9dz3Nyt9xWB A4AdQkNTcSyAwzA== X-Received: from qkjb6.prod.google.com ([2002:a05:620a:cc6:b0:94a:58bd:f31a]) (user=gildekel job=prod-delivery.src-stubby-dispatcher) by 2002:a05:620a:6313:10b0:94a:8337:5cb6 with SMTP id af79cd13be357-94a83375f31mr437483685a.45.1796427756606; Fri, 04 Dec 2026 15:42:36 -0800 (PST) Date: Fri, 4 Dec 2026 18:42:35 -0500 In-Reply-To: <20261111160814.21326-9-mwen@igalia.com> X-Archived-By: Mime-Version: 1.0 References: <20261111160814.21326-1-mwen@igalia.com> <20261111160814.21326-9-mwen@igalia.com> X-Mailer: git-send-email 2.56.1.915.g69d5ec7298-goog Message-ID: <20261204234235.2132255-1-gildekel@google.com> Subject: Re: [PATCH v5 08/15] drm/atomic: check if an active colorop has a blob if its type requires one 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" X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "dri-devel" X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Hi Melissa, Enforcing DATA != NULL when !bypass makes sense in core (and by code inspection looks like it also closes a potential NULL blob->length deref on amdgpu, though I have not tested AMD). A few comments inline. > Clarify this in the documentation and reject the atomic commit if > colorop TYPE requires a DATA but set bypass to false and no blob > submitted. Worth briefly noting here that i915 and vkms previously accepted BYPASS=0 + DATA=0 as pass-through and will now return -EINVAL (including on a deactivating commit that clears DATA while leaving BYPASS=0, if this behavior has not changed given the discussion on patch 06/15). > Fixes: e5719e7f1900 ("drm/colorop: Add 3x4 CTM type") Because this patch edits drm_atomic_colorop_check() introduced in 06/15 (which has no Fixes tag), it cannot be cherry-picked to stable on its own for [1]. Introducing drm_atomic_colorop_check() in this patch first (before 06/15), or guarding !blob in drivers for stable, would avoid that dependency. > + if (new_colorop_state->colorop->data_property && > + !new_colorop_state->bypass && !new_colorop_state->data) { > + drm_dbg_atomic(new_colorop_state->colorop->dev, > + "[COLOROP:%d:%d] enabled without a DATA blob\n", > + new_colorop_state->colorop->base.id, > + new_colorop_state->colorop->type); > + return -EINVAL; > + } Two notes here: 1. As noted on 06/15, returning -EINVAL here also triggers the caller's "isn't in an active color pipeline." log in drm_atomic_check_only(). 2. __drm_colorop_state_init() initializes bypass = true unconditionally even when DRM_COLOROP_FLAG_ALLOW_BYPASS is not set, so a future DATA colorop without a BYPASS property would not hit this check. No in-tree driver creates one today, so should we either document that limitation or handle it (e.g. in __drm_colorop_state_init() or by checking !colorop->bypass_property here)? [1] https://lore.kernel.org/dri-devel/20251115000237.3561250-19-alex.hung@amd.com/ Assisted-by: Gemini Assisted-by: Claude:claude-fable-5.2 Thanks, Gil