From patchwork Tue Aug 9 17:45:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Noralf_Tr=C3=B8nnes?= X-Patchwork-Id: 9271967 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7EF176075A for ; Tue, 9 Aug 2016 17:46:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 74D6528364 for ; Tue, 9 Aug 2016 17:46:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6973C2838C; Tue, 9 Aug 2016 17:46:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CA2BA28364 for ; Tue, 9 Aug 2016 17:46:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8F4686E60D; Tue, 9 Aug 2016 17:46:00 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from smtp.domeneshop.no (smtp.domeneshop.no [IPv6:2a01:5b40:0:3005::1]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0E8BD6E61C for ; Tue, 9 Aug 2016 17:46:00 +0000 (UTC) Received: from 211.81-166-168.customer.lyse.net ([81.166.168.211]:7996 helo=localhost.localdomain) by smtp.domeneshop.no with esmtpsa (TLS1.1:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1bXB6E-0002JN-Gk; Tue, 09 Aug 2016 19:45:58 +0200 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= To: dri-devel@lists.freedesktop.org Subject: [RFC 3/3] drm: simpledrm: Add panic handling Date: Tue, 9 Aug 2016 19:45:42 +0200 Message-Id: <1470764742-20323-4-git-send-email-noralf@tronnes.org> X-Mailer: git-send-email 2.8.2 In-Reply-To: <1470764742-20323-1-git-send-email-noralf@tronnes.org> References: <1470764742-20323-1-git-send-email-noralf@tronnes.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 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" X-Virus-Scanned: ClamAV using ClamSMTP This enables panic message output support in simpledrm. simpledrm has a fixed buffer that is set up to be scanned out and the virtual address is already available. Signed-off-by: Noralf Trønnes --- drivers/gpu/drm/simpledrm/simpledrm_drv.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/gpu/drm/simpledrm/simpledrm_drv.c b/drivers/gpu/drm/simpledrm/simpledrm_drv.c index a329e4c..ceff617 100644 --- a/drivers/gpu/drm/simpledrm/simpledrm_drv.c +++ b/drivers/gpu/drm/simpledrm/simpledrm_drv.c @@ -23,6 +23,29 @@ #include #include "simpledrm.h" +static struct drm_framebuffer sdrm_panic_fb; + +struct drm_framebuffer *sdrm_panic(struct drm_device *dev, void **vmem) +{ + struct sdrm_device *sdrm = dev->dev_private; + struct drm_framebuffer *fb = &sdrm_panic_fb; + + if (!sdrm) + return NULL; + + fb->dev = dev; + fb->width = sdrm->fb_width; + fb->height = sdrm->fb_height; + fb->pixel_format = sdrm->fb_format; + drm_fb_get_bpp_depth(fb->pixel_format, &fb->depth, + &fb->bits_per_pixel); + fb->pitches[0] = sdrm->fb_stride; + + *vmem = sdrm->fb_map; + + return fb; +} + static const struct file_operations sdrm_drm_fops = { .owner = THIS_MODULE, .open = drm_open, @@ -42,6 +65,7 @@ static struct drm_driver sdrm_drm_driver = { DRIVER_ATOMIC, .fops = &sdrm_drm_fops, .lastclose = sdrm_lastclose, + .panic = sdrm_panic, .gem_free_object = sdrm_gem_free_object, .prime_fd_to_handle = drm_gem_prime_fd_to_handle,