diff mbox

[v4] staging: vboxvideo: Add vboxvideo to drivers/staging

Message ID 84a782ff-b86a-2617-92b0-90c3dd58094a@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Hans de Goede June 28, 2017, 12:46 p.m. UTC
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

Comments

Daniel Vetter June 28, 2017, 1:05 p.m. UTC | #1
On Wed, Jun 28, 2017 at 2:46 PM, Hans de Goede <hdegoede@redhat.com> wrote:
> 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.

If you use the drm fbdev helper library (all of it) then this should
all Just Work. Calling any fb core function from a drm driver directly
is a bug most likely.
-Daniel
diff mbox

Patch

From 6bdabcb9945fcd7bfe8424c60f506a147348e6be Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
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 <hdegoede@redhat.com>
---
 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