From patchwork Wed Oct 19 14:38:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Ser X-Patchwork-Id: 13011878 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0D7C8C4332F for ; Wed, 19 Oct 2022 14:38:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5632010EAFA; Wed, 19 Oct 2022 14:38:38 +0000 (UTC) Received: from mail-4323.proton.ch (mail-4323.proton.ch [185.70.43.23]) by gabe.freedesktop.org (Postfix) with ESMTPS id AEBDE10F246 for ; Wed, 19 Oct 2022 14:38:15 +0000 (UTC) Date: Wed, 19 Oct 2022 14:38:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emersion.fr; s=protonmail3; t=1666190294; x=1666449494; bh=AJ/NhkKI17Ftil+Sy94WvvfneYSB2CFlvcaabqi8NjY=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID; b=fAqjS9KF+nV2DKrSKTp03jcytUjhsoRbeqy4UK3QGxzKlzg7wH4tJJ49u8BbnYiu7 VzQwovnTyj244NxclseYSjMrLX+SigvVQYkZRq1llKb3e151vdpeHzmdEjo2hpmY7b 59CF6AVZsrh0Mc5DELSgdprESa/dfnrAALFQp9+TgE9hcyTCABlEE77dBOYTe0rKw8 A2iyLi/KmEnjfLvwgwsFrL//NY4du1IW4YDT6J6u+r/fIULs9Vb0PecG6EURLqI5/b dV4WGtO+gOZB+/QPTpr0V5VMYYZYuv5QIgxwhbLqU5yZ31SZXzQy9jUdIgLciv3FXm hc2AjrbKVsgHw== To: dri-devel@lists.freedesktop.org From: Simon Ser Subject: [PATCH 4/7] drm/atomic: log when CRTC_ID prop value is invalid Message-ID: <20221019143736.267324-4-contact@emersion.fr> In-Reply-To: <20221019143736.267324-1-contact@emersion.fr> References: <20221019143736.267324-1-contact@emersion.fr> Feedback-ID: 1358184:user:proton MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jani Nikula , Daniel Vetter Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Signed-off-by: Simon Ser Cc: Daniel Vetter Cc: Jani Nikula --- drivers/gpu/drm/drm_atomic_uapi.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c index 39f3f491c148..5aa2ecd1af3d 100644 --- a/drivers/gpu/drm/drm_atomic_uapi.c +++ b/drivers/gpu/drm/drm_atomic_uapi.c @@ -539,8 +539,12 @@ static int drm_atomic_plane_set_property(struct drm_plane *plane, } else if (property == config->prop_crtc_id) { struct drm_crtc *crtc = drm_crtc_find(dev, file_priv, val); - if (val && !crtc) + if (val && !crtc) { + drm_dbg_atomic(dev, + "[PROP:%d:%s] cannot find CRTC with ID %llu\n", + property->base.id, property->name, val); return -EACCES; + } return drm_atomic_set_crtc_for_plane(state, crtc); } else if (property == config->prop_crtc_x) { state->crtc_x = U642I64(val); @@ -695,8 +699,12 @@ static int drm_atomic_connector_set_property(struct drm_connector *connector, if (property == config->prop_crtc_id) { struct drm_crtc *crtc = drm_crtc_find(dev, file_priv, val); - if (val && !crtc) + if (val && !crtc) { + drm_dbg_atomic(dev, + "[PROP:%d:%s] cannot find CRTC with ID %llu\n", + property->base.id, property->name, val); return -EACCES; + } return drm_atomic_set_crtc_for_connector(state, crtc); } else if (property == config->dpms_property) { /* setting DPMS property requires special handling, which