From patchwork Wed Aug 7 13:36:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jocelyn Falempe X-Patchwork-Id: 13756322 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 6029DC3DA7F for ; Wed, 7 Aug 2024 13:49:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CCEF710E523; Wed, 7 Aug 2024 13:49:25 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="FOoGjA0a"; 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 4F56910E522 for ; Wed, 7 Aug 2024 13:49:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1723038563; 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=B09kSIbYSApgPI0VjEak3TdklWaHKDsh4z8WexGbhwU=; b=FOoGjA0aw/eqP+6NN/bMssZmS5Gu7BGhiAsWD0yOD7do/8+StUDvyaKyNQRnvdf5wWgh5R DOofhSCJifKvmplrP/U2jRfD8zk3fXMFlul+GHhNXY+sGa8UxSRlMsmLQSsDItsYNg6SuX kQrvbHfgzATXp7Tf7PIqeltrGFjLoVU= 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-548-0-1MwgaHNfqXutWNZ9pOrQ-1; Wed, 07 Aug 2024 09:49:17 -0400 X-MC-Unique: 0-1MwgaHNfqXutWNZ9pOrQ-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 E44C61955D63; Wed, 7 Aug 2024 13:49:14 +0000 (UTC) Received: from hydra.redhat.com (unknown [10.39.193.86]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D7C3219560AE; Wed, 7 Aug 2024 13:49: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 , Daniel Vetter Subject: [PATCH v2 1/5] drm/panic: Remove space before "!" in panic message Date: Wed, 7 Aug 2024 15:36:10 +0200 Message-ID: <20240807134902.458669-2-jfalempe@redhat.com> In-Reply-To: <20240807134902.458669-1-jfalempe@redhat.com> References: <20240807134902.458669-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 Reviewed-by: Daniel Vetter Reviewed-by: Thomas Zimmermann --- 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 Wed Aug 7 13:36:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jocelyn Falempe X-Patchwork-Id: 13756321 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 5726DC52D71 for ; Wed, 7 Aug 2024 13:49:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BC90310E524; Wed, 7 Aug 2024 13:49:23 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="IC17fZqa"; 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 547A110E523 for ; Wed, 7 Aug 2024 13:49:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1723038561; 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=Khc6yrD/Cd8ni5cEcvIDASmi4Tvsj/tC6KpvFYM8uG4=; b=IC17fZqak0OW4bHQt/wbAxJ6Y3oPKrvkSlgfa4x/ccqREJ8NMnaQClyisavVrewi2LKaMy 8QYc7mlX/jtDpTEIPmIVsHybGAhl1qchkNoUvpG7jOtI/8Nvl4am3G6sk8CstO578Duh+Q bBXyT3ZFudKSQexshSIXudsjXZXERBA= Received: from mx-prod-mc-04.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-422-KxL9sa_kPAy3QEnxWX2J9g-1; Wed, 07 Aug 2024 09:49:19 -0400 X-MC-Unique: KxL9sa_kPAy3QEnxWX2J9g-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-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3B4DB19560B3; Wed, 7 Aug 2024 13:49:18 +0000 (UTC) Received: from hydra.redhat.com (unknown [10.39.193.86]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 528D619560A3; Wed, 7 Aug 2024 13:49: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 v2 2/5] drm/panic: Remove useless export symbols Date: Wed, 7 Aug 2024 15:36:11 +0200 Message-ID: <20240807134902.458669-3-jfalempe@redhat.com> In-Reply-To: <20240807134902.458669-1-jfalempe@redhat.com> References: <20240807134902.458669-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 Reviewed-by: Daniel Vetter Reviewed-by: Thomas Zimmermann --- 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 Wed Aug 7 13:36:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jocelyn Falempe X-Patchwork-Id: 13756323 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 DE110C3DA7F for ; Wed, 7 Aug 2024 13:49:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5785E10E525; Wed, 7 Aug 2024 13:49:29 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="BnUhp8Fw"; 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 9D34310E525 for ; Wed, 7 Aug 2024 13:49:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1723038567; 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=IrUocjfsbNoAKvJEN1ProPTmd4/7S4Ety1s1oHvu/m8=; b=BnUhp8FwJPXtxlwyKn4heohjRXUr9oakstHllWUe68hOI2HfScKgzWDrOfue5gAGHzPvcv s6elreslZdAo10RDyE1e/Y9bHkKWkxBAP3wIkL8Dz2E9EgAJ9y3TDI98XRh47MGrt4pnXS dACCpkQpEyeY01qu25syJzgYECbjAMw= 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-547-kd0mlL4PMjWFcjWvKTTuww-1; Wed, 07 Aug 2024 09:49:23 -0400 X-MC-Unique: kd0mlL4PMjWFcjWvKTTuww-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 53522195423B; Wed, 7 Aug 2024 13:49:21 +0000 (UTC) Received: from hydra.redhat.com (unknown [10.39.193.86]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9DC4A19560A3; Wed, 7 Aug 2024 13:49:18 +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 v2 3/5] drm/panic: Move drm_panic_register prototype to drm_crtc_internal.h Date: Wed, 7 Aug 2024 15:36:12 +0200 Message-ID: <20240807134902.458669-4-jfalempe@redhat.com> In-Reply-To: <20240807134902.458669-1-jfalempe@redhat.com> References: <20240807134902.458669-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 Reviewed-by: Daniel Vetter Reviewed-by: Thomas Zimmermann --- 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 061436361998..251ff7bba40d 100644 --- a/drivers/gpu/drm/drm_crtc_internal.h +++ b/drivers/gpu/drm/drm_crtc_internal.h @@ -318,8 +318,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 Wed Aug 7 13:36:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jocelyn Falempe X-Patchwork-Id: 13756324 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 A3093C3DA7F for ; Wed, 7 Aug 2024 13:49:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 28C8010E522; Wed, 7 Aug 2024 13:49:39 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="Q8afEhAy"; 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 CE17610E531 for ; Wed, 7 Aug 2024 13:49:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1723038577; 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=vzrbNPGiVM9XAiLYV2Z4F/zW98nee/i25MdjPmBQvbo=; b=Q8afEhAylt0tt5vON0wR/KeDvIYaBXb6veHrakLI+VGbBeMdDPtdGm41MyWhNFlex/e7aN 5bB8eY4UJOa6SL+L4iB0QUveqdyh7BatiHyIGTXJDDfTzbSsRS8RUtHaGFCof/8TYtRWoL d22hCLojd6UBTwAfYqc/9kThJyYCfDo= 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-398-XI4Bnp0xNPGgrQxitILvEw-1; Wed, 07 Aug 2024 09:49:32 -0400 X-MC-Unique: XI4Bnp0xNPGgrQxitILvEw-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 7A2F7195609E; Wed, 7 Aug 2024 13:49:24 +0000 (UTC) Received: from hydra.redhat.com (unknown [10.39.193.86]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id ACE0819560AA; Wed, 7 Aug 2024 13:49:21 +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 v2 4/5] drm/panic: Move copyright notice to the top Date: Wed, 7 Aug 2024 15:36:13 +0200 Message-ID: <20240807134902.458669-5-jfalempe@redhat.com> In-Reply-To: <20240807134902.458669-1-jfalempe@redhat.com> References: <20240807134902.458669-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 Reviewed-by: Daniel Vetter Reviewed-by: Thomas Zimmermann --- 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 Wed Aug 7 13:36:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jocelyn Falempe X-Patchwork-Id: 13756325 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 84C8EC52D71 for ; Wed, 7 Aug 2024 13:49:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DFBA710E52D; Wed, 7 Aug 2024 13:49:40 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="hblxWrKO"; 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 C0F1410E522 for ; Wed, 7 Aug 2024 13:49:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1723038578; 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=NBNl/uKTb0VAIatCXvsL+x69azoHWXH1eRzKUWOvGQU=; b=hblxWrKOnaVItUrcwp7cKepm9oW7l/RkdOIVHOqrKXvYaqRQ41mzBW6gbJY08ns2ytxWSL mjDBp64C7ZwRvkcd4Eg/PFIbb8Jmz5exQ/QO6wbANkDEaDF0sGsKEhLCXwr+QhYccJyT0d BP2Km71rOHy5XloTZXE5GvLJfOb5eOI= 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-r1TVruunO5igBRqHYIvCQA-1; Wed, 07 Aug 2024 09:49:34 -0400 X-MC-Unique: r1TVruunO5igBRqHYIvCQA-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 721CE196CDDF; Wed, 7 Aug 2024 13:49:29 +0000 (UTC) Received: from hydra.redhat.com (unknown [10.39.193.86]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C708319560AE; Wed, 7 Aug 2024 13:49:24 +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 v2 5/5] drm/panic: Add panic description Date: Wed, 7 Aug 2024 15:36:14 +0200 Message-ID: <20240807134902.458669-6-jfalempe@redhat.com> In-Reply-To: <20240807134902.458669-1-jfalempe@redhat.com> References: <20240807134902.458669-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 Reviewed-by: Thomas Zimmermann Reviewed-by: Daniel Vetter --- v2: * Use a macro PANIC_MSG_LINES, instead of directly using the indice in drm_panic_set_description() (Sima) * Add drm_panic_clear_description() to make sure the stack allocated pointer won't be used. (Sima) * use the macro PANIC_MSG_LINES also in draw_panic_static_user() drivers/gpu/drm/drm_panic.c | 56 ++++++++++++++++++++++++++++--------- 1 file changed, 43 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/drm_panic.c b/drivers/gpu/drm/drm_panic.c index 2efede7fa23a..c7d9f3a9e30d 100644 --- a/drivers/gpu/drm/drm_panic.c +++ b/drivers/gpu/drm/drm_panic.c @@ -81,7 +81,10 @@ 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 */ }; +#define PANIC_MSG_LINES ARRAY_SIZE(panic_msg) static const struct drm_panic_line logo_ascii[] = { PANIC_LINE(" .--. _"), @@ -92,6 +95,7 @@ static const struct drm_panic_line logo_ascii[] = { PANIC_LINE(" /'\\_ _/`\\ (_)"), PANIC_LINE(" \\___)=(___/"), }; +#define PANIC_LOGO_LINES ARRAY_SIZE(logo_ascii) #if defined(CONFIG_LOGO) && !defined(MODULE) static const struct linux_logo *logo_mono; @@ -487,13 +491,12 @@ static void draw_txt_rectangle(struct drm_scanout_buffer *sb, static void draw_panic_static_user(struct drm_scanout_buffer *sb) { - size_t msg_lines = ARRAY_SIZE(panic_msg); - size_t logo_ascii_lines = ARRAY_SIZE(logo_ascii); u32 fg_color = convert_from_xrgb8888(CONFIG_DRM_PANIC_FOREGROUND_COLOR, sb->format->format); u32 bg_color = convert_from_xrgb8888(CONFIG_DRM_PANIC_BACKGROUND_COLOR, sb->format->format); const struct font_desc *font = get_default_font(sb->width, sb->height, NULL, NULL); struct drm_rect r_screen, r_logo, r_msg; unsigned int logo_width, logo_height; + unsigned int msg_width, msg_height; if (!font) return; @@ -504,14 +507,14 @@ static void draw_panic_static_user(struct drm_scanout_buffer *sb) logo_width = logo_mono->width; logo_height = logo_mono->height; } else { - logo_width = get_max_line_len(logo_ascii, logo_ascii_lines) * font->width; - logo_height = logo_ascii_lines * font->height; + logo_width = get_max_line_len(logo_ascii, PANIC_LOGO_LINES) * font->width; + logo_height = PANIC_LOGO_LINES * font->height; } - r_logo = DRM_RECT_INIT(0, 0, logo_width, logo_height); - r_msg = DRM_RECT_INIT(0, 0, - min(get_max_line_len(panic_msg, msg_lines) * font->width, sb->width), - min(msg_lines * font->height, sb->height)); + + msg_width = min(get_max_line_len(panic_msg, PANIC_MSG_LINES) * font->width, sb->width); + msg_height = min(PANIC_MSG_LINES * font->height, sb->height); + r_msg = DRM_RECT_INIT(0, 0, msg_width, msg_height); /* Center the panic message */ drm_rect_translate(&r_msg, (sb->width - r_msg.x2) / 2, (sb->height - r_msg.y2) / 2); @@ -525,10 +528,10 @@ static void draw_panic_static_user(struct drm_scanout_buffer *sb) drm_panic_blit(sb, &r_logo, logo_mono->data, DIV_ROUND_UP(logo_width, 8), fg_color); else - draw_txt_rectangle(sb, font, logo_ascii, logo_ascii_lines, false, &r_logo, + draw_txt_rectangle(sb, font, logo_ascii, PANIC_LOGO_LINES, false, &r_logo, fg_color); } - draw_txt_rectangle(sb, font, panic_msg, msg_lines, true, &r_msg, fg_color); + draw_txt_rectangle(sb, font, panic_msg, PANIC_MSG_LINES, true, &r_msg, fg_color); } /* @@ -633,7 +636,31 @@ 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) { + struct drm_panic_line *desc_line = &panic_msg[PANIC_MSG_LINES - 1]; + + desc_line->txt = description; + len = strlen(description); + /* ignore the last newline character */ + if (len && description[len - 1] == '\n') + len -= 1; + desc_line->len = len; + } +} + +static void drm_panic_clear_description(void) +{ + struct drm_panic_line *desc_line = &panic_msg[PANIC_MSG_LINES - 1]; + + desc_line->len = 0; + desc_line->txt = NULL; +} + +static void draw_panic_plane(struct drm_plane *plane, const char *description) { struct drm_scanout_buffer sb = { }; int ret; @@ -642,6 +669,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)) { @@ -649,6 +678,7 @@ static void draw_panic_plane(struct drm_plane *plane) if (plane->helper_private->panic_flush) plane->helper_private->panic_flush(plane); } + drm_panic_clear_description(); drm_panic_unlock(plane->dev, flags); } @@ -662,7 +692,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 +712,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; }