From patchwork Wed Oct 19 14:37:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Ser X-Patchwork-Id: 13011875 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 7CD61C433FE for ; Wed, 19 Oct 2022 14:38:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3AD8110EAF6; Wed, 19 Oct 2022 14:38:28 +0000 (UTC) Received: from mail-4022.proton.ch (mail-4022.proton.ch [185.70.40.22]) by gabe.freedesktop.org (Postfix) with ESMTPS id 28B8910F24B for ; Wed, 19 Oct 2022 14:38:02 +0000 (UTC) Date: Wed, 19 Oct 2022 14:37:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emersion.fr; s=protonmail3; t=1666190279; x=1666449479; bh=yWsT5OIuzTT+/9FW9RcipjSK+rK1bGFZrVkXMxvvif0=; h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID; b=FLB20bWiFpURDw1n1mhDU/d8P8/LpKOnViGpCc13kOnwWD8mrSFGetc127lGFYqGs dO2E1NBxZugKEcpWTEK+ooKvMfqFjYF/7KbFXds+QW7iEFMtYaiWSYT7xGV2rE/eE4 +Q86SB0GTsHyUS1GJ0BDysbiNVr+JIZVmOIhvavn5Frc35fAOuIhy5Vr3Vb3pHxRWc 2tMRD19bUuwPg23RkKcPpOpy7xAooj+wkv9ckOKpykwKWV+DC4oCGC/3k/d6MhGCGQ qZX+BGQGdi+G3Rlr/YR5FA3zzMlH6BgPaNM3baOz2JozqBlcT/QgKNUuS/gNK/il7k yQl6aIeCkYaOg== To: dri-devel@lists.freedesktop.org From: Simon Ser Subject: [PATCH 1/7] drm/atomic: log drm_atomic_replace_property_blob_from_id() errors Message-ID: <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 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c index c06d0639d552..e659fdae477d 100644 --- a/drivers/gpu/drm/drm_atomic_uapi.c +++ b/drivers/gpu/drm/drm_atomic_uapi.c @@ -374,16 +374,25 @@ drm_atomic_replace_property_blob_from_id(struct drm_device *dev, if (blob_id != 0) { new_blob = drm_property_lookup_blob(dev, blob_id); - if (new_blob == NULL) + if (new_blob == NULL) { + drm_dbg_atomic(dev, + "cannot find blob ID %llu\n", blob_id); return -EINVAL; + } if (expected_size > 0 && new_blob->length != expected_size) { + drm_dbg_atomic(dev, + "[BLOB:%d] length %zu different from expected %zu\n", + new_blob->base.id, new_blob->length, expected_size); drm_property_blob_put(new_blob); return -EINVAL; } if (expected_elem_size > 0 && new_blob->length % expected_elem_size != 0) { + drm_dbg_atomic(dev, + "[BLOB:%d] length %zu not divisible by element size %zu\n", + new_blob->base.id, new_blob->length, expected_elem_size); drm_property_blob_put(new_blob); return -EINVAL; }