From patchwork Tue Jul 23 09:11:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jocelyn Falempe X-Patchwork-Id: 13739757 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 D3C5DC3DA63 for ; Tue, 23 Jul 2024 09:16:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7BAA910E4F7; Tue, 23 Jul 2024 09:16:25 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="WNj4+nzf"; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id 17BE510E4F5 for ; Tue, 23 Jul 2024 09:16:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721726180; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gU9+gZiE5oVEkqc3et6QvO+7ZIKLD03WM8foawkR9eo=; b=WNj4+nzfVvEJH4IiCmR7shRNlL8QSTT8M+63fZVFk3knJ90WGvn5mw1SeFrZQ31jDEGA51 1xoYmXArC5vqGmTup3J2l6OV6Xk+pAyIe8zssttStbG7OTdMV7F9PLqwyoIq0ilzVijsYe T4v4MoEl/89Z8QFzcDTECW6MDHUvl/s= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-604-9AEEXmb-P_O0bEqjeCH6LA-1; Tue, 23 Jul 2024 05:16:17 -0400 X-MC-Unique: 9AEEXmb-P_O0bEqjeCH6LA-1 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 558B61956048; Tue, 23 Jul 2024 09:16:15 +0000 (UTC) Received: from hydra.redhat.com (unknown [10.39.192.165]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 49A21195605A; Tue, 23 Jul 2024 09:16:11 +0000 (UTC) From: Jocelyn Falempe To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Javier Martinez Canillas , Michal Wajdeczko , dri-devel@lists.freedesktop.org Cc: Jocelyn Falempe , Diego Viola Subject: [PATCH 1/5] drm/panic: Remove space before "!" in panic message Date: Tue, 23 Jul 2024 11:11:30 +0200 Message-ID: <20240723091553.286844-2-jfalempe@redhat.com> In-Reply-To: <20240723091553.286844-1-jfalempe@redhat.com> References: <20240723091553.286844-1-jfalempe@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" There is no space between the last word, and the punctuation mark in English. Suggested-by: Diego Viola Signed-off-by: Jocelyn Falempe --- drivers/gpu/drm/drm_panic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_panic.c b/drivers/gpu/drm/drm_panic.c index 072752b658f0..5e873469856f 100644 --- a/drivers/gpu/drm/drm_panic.c +++ b/drivers/gpu/drm/drm_panic.c @@ -78,7 +78,7 @@ struct drm_panic_line { #define PANIC_LINE(s) {.len = sizeof(s) - 1, .txt = s} static struct drm_panic_line panic_msg[] = { - PANIC_LINE("KERNEL PANIC !"), + PANIC_LINE("KERNEL PANIC!"), PANIC_LINE(""), PANIC_LINE("Please reboot your computer."), }; From patchwork Tue Jul 23 09:11:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jocelyn Falempe X-Patchwork-Id: 13739758 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 EA3E0C3DA63 for ; Tue, 23 Jul 2024 09:16:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3338310E4F5; Tue, 23 Jul 2024 09:16:31 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="QCvEPPB4"; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id E8E7010E4F5 for ; Tue, 23 Jul 2024 09:16:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721726184; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=F57EKXk6FDu4YhRuE3Smj1gi6pv6W/J2EckcoqOPHwY=; b=QCvEPPB4Fpe7K2jwH+ebV5oQe5LR6qPNGgt9+OXCOlgfU494gKfTRVjnJKaFoKXzkewStM 0NowBLURDtfXQRn77PaeZuuACH1PwEWCmxyS1D1hLi5eSfwsB/rVKS+XOlZd/ICCBW6eLp eTpfjy0au+Q1+SOQRzWoWlOcLL/tW6A= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-113-lUgxc2qzOu2XXvAQt40W7w-1; Tue, 23 Jul 2024 05:16:20 -0400 X-MC-Unique: lUgxc2qzOu2XXvAQt40W7w-1 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0B6501955D47; Tue, 23 Jul 2024 09:16:19 +0000 (UTC) Received: from hydra.redhat.com (unknown [10.39.192.165]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A7BEB1955D45; Tue, 23 Jul 2024 09:16:15 +0000 (UTC) From: Jocelyn Falempe To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Javier Martinez Canillas , Michal Wajdeczko , dri-devel@lists.freedesktop.org Cc: Jocelyn Falempe , Daniel Vetter Subject: [PATCH 2/5] drm/panic: Remove useless export symbols Date: Tue, 23 Jul 2024 11:11:31 +0200 Message-ID: <20240723091553.286844-3-jfalempe@redhat.com> In-Reply-To: <20240723091553.286844-1-jfalempe@redhat.com> References: <20240723091553.286844-1-jfalempe@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" drm_panic_[un]register() are called only from the core drm, so there is no need to export them. Suggested-by: Daniel Vetter Signed-off-by: Jocelyn Falempe --- drivers/gpu/drm/drm_panic.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/drm_panic.c b/drivers/gpu/drm/drm_panic.c index 5e873469856f..2efede7fa23a 100644 --- a/drivers/gpu/drm/drm_panic.c +++ b/drivers/gpu/drm/drm_panic.c @@ -752,7 +752,6 @@ void drm_panic_register(struct drm_device *dev) if (registered_plane) drm_info(dev, "Registered %d planes with drm panic\n", registered_plane); } -EXPORT_SYMBOL(drm_panic_register); /** * drm_panic_unregister() @@ -771,4 +770,3 @@ void drm_panic_unregister(struct drm_device *dev) kmsg_dump_unregister(&plane->kmsg_panic); } } -EXPORT_SYMBOL(drm_panic_unregister); From patchwork Tue Jul 23 09:11:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jocelyn Falempe X-Patchwork-Id: 13739759 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 D99C7C3DA63 for ; Tue, 23 Jul 2024 09:16:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 41F7110E501; Tue, 23 Jul 2024 09:16:37 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="Oe0IzYVH"; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id F244210E4F5 for ; Tue, 23 Jul 2024 09:16:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721726189; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=q4Aiz0OWR2v2XuVbT9aw5lELLi/JCZElHyeF6wJfdk8=; b=Oe0IzYVHlon0JrqaHNJNER9bWSr1JmimuEBb3d1HmgGzfzCMAxRUul+Zw7jzCRIN+ZHhg+ XB4e0hCyV2uC8JaM9BbsNWcXJfaRXZ7oF0Hl7bReRPKA99jPZdrqlQgyMFmhMxTxyRfFnD 2cmbTF/X2oCMmYPRsnGkOrMLKqujhAg= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-192-OM3RpahIOgmi4UW5j1LUPQ-1; Tue, 23 Jul 2024 05:16:24 -0400 X-MC-Unique: OM3RpahIOgmi4UW5j1LUPQ-1 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D38601955D4C; Tue, 23 Jul 2024 09:16:22 +0000 (UTC) Received: from hydra.redhat.com (unknown [10.39.192.165]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 5CF21195605A; Tue, 23 Jul 2024 09:16:19 +0000 (UTC) From: Jocelyn Falempe To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Javier Martinez Canillas , Michal Wajdeczko , dri-devel@lists.freedesktop.org Cc: Jocelyn Falempe , Daniel Vetter Subject: [PATCH 3/5] drm/panic: Move drm_panic_register prototype to drm_crtc_internal.h Date: Tue, 23 Jul 2024 11:11:32 +0200 Message-ID: <20240723091553.286844-4-jfalempe@redhat.com> In-Reply-To: <20240723091553.286844-1-jfalempe@redhat.com> References: <20240723091553.286844-1-jfalempe@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" drm_panic_[un]register() are only used by the core drm, and are not intended to be called by other drm drivers, so move their prototypes to drm_crtc_internal.h. Suggested-by: Daniel Vetter Signed-off-by: Jocelyn Falempe --- drivers/gpu/drm/drm_crtc_internal.h | 4 ++++ include/drm/drm_panic.h | 12 ------------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc_internal.h b/drivers/gpu/drm/drm_crtc_internal.h index 4314274c5e40..3090f8ce92fe 100644 --- a/drivers/gpu/drm/drm_crtc_internal.h +++ b/drivers/gpu/drm/drm_crtc_internal.h @@ -320,8 +320,12 @@ drm_edid_load_firmware(struct drm_connector *connector) /* drm_panic.c */ #ifdef CONFIG_DRM_PANIC bool drm_panic_is_enabled(struct drm_device *dev); +void drm_panic_register(struct drm_device *dev); +void drm_panic_unregister(struct drm_device *dev); #else static inline bool drm_panic_is_enabled(struct drm_device *dev) { return false; } +static inline void drm_panic_register(struct drm_device *dev) {} +static inline void drm_panic_unregister(struct drm_device *dev) {} #endif #endif /* __DRM_CRTC_INTERNAL_H__ */ diff --git a/include/drm/drm_panic.h b/include/drm/drm_panic.h index 73bb3f3d9ed9..a4bd3681920d 100644 --- a/include/drm/drm_panic.h +++ b/include/drm/drm_panic.h @@ -146,16 +146,4 @@ struct drm_scanout_buffer { #define drm_panic_unlock(dev, flags) \ raw_spin_unlock_irqrestore(&(dev)->mode_config.panic_lock, flags) -#ifdef CONFIG_DRM_PANIC - -void drm_panic_register(struct drm_device *dev); -void drm_panic_unregister(struct drm_device *dev); - -#else - -static inline void drm_panic_register(struct drm_device *dev) {} -static inline void drm_panic_unregister(struct drm_device *dev) {} - -#endif - #endif /* __DRM_PANIC_H__ */ From patchwork Tue Jul 23 09:11:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jocelyn Falempe X-Patchwork-Id: 13739760 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 6C85BC3DA7E for ; Tue, 23 Jul 2024 09:16:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C13AC10E4FB; Tue, 23 Jul 2024 09:16:38 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="H2XV7Nlk"; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5DA4310E4FB for ; Tue, 23 Jul 2024 09:16:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721726190; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NCVCr9g5S6O78ocEstThgsQomHjIoELf5RRZdphKH5E=; b=H2XV7NlkG3IYxZPBqQF1VJL4XQ+Z6m9tgcOcHzVsqBqs9dY2ztKydB+jKUCzeKtOlft4VR btnyod7ZcMuGGzcnhW2h0CG6WHSeMhrg9P9EWz4rcRQSP3YhYAbwXnALVAOqJCCU86n8Hg 1ExoCZfgecOjGj7k0WQ+4RscnM4BA7s= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-395-mMiO3yCzNsm9uW0JQOMdlg-1; Tue, 23 Jul 2024 05:16:27 -0400 X-MC-Unique: mMiO3yCzNsm9uW0JQOMdlg-1 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E9A871955F2B; Tue, 23 Jul 2024 09:16:25 +0000 (UTC) Received: from hydra.redhat.com (unknown [10.39.192.165]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 09AC51955D45; Tue, 23 Jul 2024 09:16:22 +0000 (UTC) From: Jocelyn Falempe To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Javier Martinez Canillas , Michal Wajdeczko , dri-devel@lists.freedesktop.org Cc: Jocelyn Falempe Subject: [PATCH 4/5] drm/panic: Move copyright notice to the top Date: Tue, 23 Jul 2024 11:11:33 +0200 Message-ID: <20240723091553.286844-5-jfalempe@redhat.com> In-Reply-To: <20240723091553.286844-1-jfalempe@redhat.com> References: <20240723091553.286844-1-jfalempe@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Move the copyright notice to the top of drm_panic.h, and add the missing Red Hat copyright notice. Suggested-by: Thomas Zimmermann Signed-off-by: Jocelyn Falempe --- include/drm/drm_panic.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/include/drm/drm_panic.h b/include/drm/drm_panic.h index a4bd3681920d..54085d5d05c3 100644 --- a/include/drm/drm_panic.h +++ b/include/drm/drm_panic.h @@ -1,4 +1,10 @@ /* SPDX-License-Identifier: GPL-2.0 or MIT */ + +/* + * Copyright (c) 2024 Intel + * Copyright (c) 2024 Red Hat + */ + #ifndef __DRM_PANIC_H__ #define __DRM_PANIC_H__ @@ -8,9 +14,6 @@ #include #include -/* - * Copyright (c) 2024 Intel - */ /** * struct drm_scanout_buffer - DRM scanout buffer From patchwork Tue Jul 23 09:11:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jocelyn Falempe X-Patchwork-Id: 13739761 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 1B147C3DA49 for ; Tue, 23 Jul 2024 09:16:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 36B7210E508; Tue, 23 Jul 2024 09:16:39 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="bQb7Bvgb"; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2DA6810E4FB for ; Tue, 23 Jul 2024 09:16:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721726195; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TefpIFM/hYJAhndMJumSf9gCCpA96xbCMh0IQFzWh0M=; b=bQb7BvgbdFIDQMFAjYbs5v0Fw37sZNeRAy+SaE4ifiOHZAyZd/WVEhzJS0Cr9UgHmC2/aC h3Pumx8iXY2zUm8TvHvgAUQQjDzNoRDtOg5zELoFdWa+UrAIlyk0lj/sHTZ9OVH8BTYJgA /A2YffXod5pydEqh11/PJ8LXdWTA7rc= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-450-NLfWdbPXPOeqdg_Giun6lg-1; Tue, 23 Jul 2024 05:16:30 -0400 X-MC-Unique: NLfWdbPXPOeqdg_Giun6lg-1 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6D299195608A; Tue, 23 Jul 2024 09:16:29 +0000 (UTC) Received: from hydra.redhat.com (unknown [10.39.192.165]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 744C41955D48; Tue, 23 Jul 2024 09:16:26 +0000 (UTC) From: Jocelyn Falempe To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Javier Martinez Canillas , Michal Wajdeczko , dri-devel@lists.freedesktop.org Cc: Jocelyn Falempe Subject: [PATCH 5/5] drm/panic: Add panic description Date: Tue, 23 Jul 2024 11:11:34 +0200 Message-ID: <20240723091553.286844-6-jfalempe@redhat.com> In-Reply-To: <20240723091553.286844-1-jfalempe@redhat.com> References: <20240723091553.286844-1-jfalempe@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Now that kmsg dump callback has the description parameter, use it in the user panic screen. This is the string passed to panic(), like "VFS: Unable to mount root fs on xxx" or "Attempted to kill init! exitcode=0xxxx". It gives a hint on why the panic occurred, without being too cryptic. Signed-off-by: Jocelyn Falempe --- drivers/gpu/drm/drm_panic.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_panic.c b/drivers/gpu/drm/drm_panic.c index 2efede7fa23a..fb283695f50e 100644 --- a/drivers/gpu/drm/drm_panic.c +++ b/drivers/gpu/drm/drm_panic.c @@ -81,6 +81,8 @@ static struct drm_panic_line panic_msg[] = { PANIC_LINE("KERNEL PANIC!"), PANIC_LINE(""), PANIC_LINE("Please reboot your computer."), + PANIC_LINE(""), + PANIC_LINE(""), /* will be replaced by the panic description */ }; static const struct drm_panic_line logo_ascii[] = { @@ -633,7 +635,20 @@ static void draw_panic_dispatch(struct drm_scanout_buffer *sb) } } -static void draw_panic_plane(struct drm_plane *plane) +static void drm_panic_set_description(const char *description) +{ + u32 len; + if (description) { + panic_msg[4].txt = description; + len = strlen(description); + /* ignore the last newline character */ + if (len && description[len - 1] == '\n') + len -= 1; + panic_msg[4].len = len; + } +} + +static void draw_panic_plane(struct drm_plane *plane, const char *description) { struct drm_scanout_buffer sb = { }; int ret; @@ -642,6 +657,8 @@ static void draw_panic_plane(struct drm_plane *plane) if (!drm_panic_trylock(plane->dev, flags)) return; + drm_panic_set_description(description); + ret = plane->helper_private->get_scanout_buffer(plane, &sb); if (!ret && drm_panic_is_format_supported(sb.format)) { @@ -662,7 +679,7 @@ static void drm_panic(struct kmsg_dumper *dumper, struct kmsg_dump_detail *detai struct drm_plane *plane = to_drm_plane(dumper); if (detail->reason == KMSG_DUMP_PANIC) - draw_panic_plane(plane); + draw_panic_plane(plane, detail->description); } @@ -682,7 +699,7 @@ static ssize_t debugfs_trigger_write(struct file *file, const char __user *user_ if (kstrtobool_from_user(user_buf, count, &run) == 0 && run) { struct drm_plane *plane = file->private_data; - draw_panic_plane(plane); + draw_panic_plane(plane, "Test from debugfs"); } return count; }