From patchwork Wed Jun 28 12:46:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 9814187 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 AF843603F2 for ; Wed, 28 Jun 2017 12:46:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9ED0E201F3 for ; Wed, 28 Jun 2017 12:46:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 923FD26212; Wed, 28 Jun 2017 12:46:38 +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=-3.7 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM 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 F380B201F3 for ; Wed, 28 Jun 2017 12:46:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 62DD289A32; Wed, 28 Jun 2017 12:46:36 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1B83889A32 for ; Wed, 28 Jun 2017 12:46:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2C9307F3F4; Wed, 28 Jun 2017 12:46:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2C9307F3F4 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=hdegoede@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 2C9307F3F4 Received: from shalem.localdomain (ovpn-116-252.ams2.redhat.com [10.36.116.252]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E13F394C78; Wed, 28 Jun 2017 12:46:31 +0000 (UTC) Subject: Re: [PATCH v4] staging: vboxvideo: Add vboxvideo to drivers/staging To: Michael Thayer References: <201706271214.7Ac3okwa%fengguang.wu@intel.com> From: Hans de Goede Message-ID: <84a782ff-b86a-2617-92b0-90c3dd58094a@redhat.com> Date: Wed, 28 Jun 2017 14:46:30 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <201706271214.7Ac3okwa%fengguang.wu@intel.com> Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Wed, 28 Jun 2017 12:46:34 +0000 (UTC) Cc: devel@driverdev.osuosl.org, vbox-dev@virtualbox.org, Greg Kroah-Hartman , dri-devel@lists.freedesktop.org, kbuild-all@01.org, Daniel Vetter 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 Hi Michael, On 27-06-17 06:25, kbuild test robot wrote: > Hi Hans, > > [auto build test ERROR on staging/staging-testing] > [also build test ERROR on v4.12-rc7 next-20170626] > [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] > > url: https://github.com/0day-ci/linux/commits/Hans-de-Goede/staging-vboxvideo-Add-vboxvideo-to-drivers-staging/20170627-035353 > config: x86_64-randconfig-n0-06270721 (attached as .config) > compiler: gcc-4.8 (Debian 4.8.4-1) 4.8.4 > reproduce: > # save the attached .config to linux build tree > make ARCH=x86_64 > > All errors (new ones prefixed by >>): > >>> ERROR: "framebuffer_release" [drivers/staging/vboxvideo/vboxvideo.ko] undefined! >>> ERROR: "fb_set_suspend" [drivers/staging/vboxvideo/vboxvideo.ko] undefined! >>> ERROR: "fb_dealloc_cmap" [drivers/staging/vboxvideo/vboxvideo.ko] undefined! >>> ERROR: "unregister_framebuffer" [drivers/staging/vboxvideo/vboxvideo.ko] undefined! Hmm, this is likely caused by building with a Kconfig with FBDEV disabled. The attached patch should fix this. I will send out a v5 with this squashed in later today. Regards, Hans From 6bdabcb9945fcd7bfe8424c60f506a147348e6be Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Wed, 28 Jun 2017 14:40:58 +0200 Subject: [PATCH] staging/vboxvideo: Use various drm_fb_helper funcs instead of DIY code Besides being a nice cleanup, this fixes vobxvideo not building when fbdev support is disabled in the Kconfig. Signed-off-by: Hans de Goede --- drivers/staging/vboxvideo/vbox_drv.c | 13 ++++++------- drivers/staging/vboxvideo/vbox_drv.h | 1 - drivers/staging/vboxvideo/vbox_fb.c | 16 +--------------- 3 files changed, 7 insertions(+), 23 deletions(-) diff --git a/drivers/staging/vboxvideo/vbox_drv.c b/drivers/staging/vboxvideo/vbox_drv.c index 05c973db77a4..92ae1560a16d 100644 --- a/drivers/staging/vboxvideo/vbox_drv.c +++ b/drivers/staging/vboxvideo/vbox_drv.c @@ -63,25 +63,24 @@ static void vbox_pci_remove(struct pci_dev *pdev) static int vbox_drm_freeze(struct drm_device *dev) { + struct vbox_private *vbox = dev->dev_private; + drm_kms_helper_poll_disable(dev); pci_save_state(dev->pdev); - console_lock(); - vbox_fbdev_set_suspend(dev, 1); - console_unlock(); + drm_fb_helper_set_suspend_unlocked(&vbox->fbdev->helper, true); return 0; } static int vbox_drm_thaw(struct drm_device *dev) { + struct vbox_private *vbox = dev->dev_private; + drm_mode_config_reset(dev); drm_helper_resume_force_mode(dev); - - console_lock(); - vbox_fbdev_set_suspend(dev, 0); - console_unlock(); + drm_fb_helper_set_suspend_unlocked(&vbox->fbdev->helper, false); return 0; } diff --git a/drivers/staging/vboxvideo/vbox_drv.h b/drivers/staging/vboxvideo/vbox_drv.h index 10da2232079b..4b9302703b36 100644 --- a/drivers/staging/vboxvideo/vbox_drv.h +++ b/drivers/staging/vboxvideo/vbox_drv.h @@ -198,7 +198,6 @@ int vbox_framebuffer_init(struct drm_device *dev, int vbox_fbdev_init(struct drm_device *dev); void vbox_fbdev_fini(struct drm_device *dev); -void vbox_fbdev_set_suspend(struct drm_device *dev, int state); void vbox_fbdev_set_base(struct vbox_private *vbox, unsigned long gpu_addr); struct vbox_bo { diff --git a/drivers/staging/vboxvideo/vbox_fb.c b/drivers/staging/vboxvideo/vbox_fb.c index 3b2657d3b29c..35f6d9f8c203 100644 --- a/drivers/staging/vboxvideo/vbox_fb.c +++ b/drivers/staging/vboxvideo/vbox_fb.c @@ -341,15 +341,8 @@ void vbox_fbdev_fini(struct drm_device *dev) struct vbox_private *vbox = dev->dev_private; struct vbox_fbdev *fbdev = vbox->fbdev; struct vbox_framebuffer *afb = &fbdev->afb; - struct fb_info *info; - if (fbdev->helper.fbdev) { - info = fbdev->helper.fbdev; - unregister_framebuffer(info); - if (info->cmap.len) - fb_dealloc_cmap(&info->cmap); - framebuffer_release(info); - } + drm_fb_helper_unregister_fbi(&fbdev->helper); if (afb->obj) { struct vbox_bo *bo = gem_to_vbox_bo(afb->obj); @@ -410,13 +403,6 @@ int vbox_fbdev_init(struct drm_device *dev) return ret; } -void vbox_fbdev_set_suspend(struct drm_device *dev, int state) -{ - struct vbox_private *vbox = dev->dev_private; - - fb_set_suspend(vbox->fbdev->helper.fbdev, state); -} - void vbox_fbdev_set_base(struct vbox_private *vbox, unsigned long gpu_addr) { struct fb_info *fbdev = vbox->fbdev->helper.fbdev; -- 2.13.0