Re: [PATCH] bochs: convert to drm_fb_helper_fbdev_setup/teardown

From: kbuild test robot
Date: Fri Sep 07 2018 - 04:10:52 EST


Hi Peter,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v4.19-rc2 next-20180906]
[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/Peter-Wu/bochs-convert-to-drm_fb_helper_fbdev_setup-teardown/20180907-154819
config: i386-randconfig-x006-201835 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
# save the attached .config to linux build tree
make ARCH=i386

All warnings (new ones prefixed by >>):

In file included from include/asm-generic/bug.h:5:0,
from arch/x86/include/asm/bug.h:83,
from include/linux/bug.h:5,
from include/linux/mmdebug.h:5,
from include/linux/mm.h:9,
from drivers/gpu/drm/bochs/bochs_drv.c:8:
drivers/gpu/drm/bochs/bochs_drv.c: In function 'bochs_pm_suspend':
drivers/gpu/drm/bochs/bochs_drv.c:110:15: error: 'struct <anonymous>' has no member named 'initialized'
if (bochs->fb.initialized) {
^
include/linux/compiler.h:58:30: note: in definition of macro '__trace_if'
if (__builtin_constant_p(!!(cond)) ? !!(cond) : \
^~~~
>> drivers/gpu/drm/bochs/bochs_drv.c:110:2: note: in expansion of macro 'if'
if (bochs->fb.initialized) {
^~
drivers/gpu/drm/bochs/bochs_drv.c:110:15: error: 'struct <anonymous>' has no member named 'initialized'
if (bochs->fb.initialized) {
^
include/linux/compiler.h:58:42: note: in definition of macro '__trace_if'
if (__builtin_constant_p(!!(cond)) ? !!(cond) : \
^~~~
>> drivers/gpu/drm/bochs/bochs_drv.c:110:2: note: in expansion of macro 'if'
if (bochs->fb.initialized) {
^~
drivers/gpu/drm/bochs/bochs_drv.c:110:15: error: 'struct <anonymous>' has no member named 'initialized'
if (bochs->fb.initialized) {
^
include/linux/compiler.h:69:16: note: in definition of macro '__trace_if'
______r = !!(cond); \
^~~~
>> drivers/gpu/drm/bochs/bochs_drv.c:110:2: note: in expansion of macro 'if'
if (bochs->fb.initialized) {
^~
drivers/gpu/drm/bochs/bochs_drv.c: In function 'bochs_pm_resume':
drivers/gpu/drm/bochs/bochs_drv.c:127:15: error: 'struct <anonymous>' has no member named 'initialized'
if (bochs->fb.initialized) {
^
include/linux/compiler.h:58:30: note: in definition of macro '__trace_if'
if (__builtin_constant_p(!!(cond)) ? !!(cond) : \
^~~~
drivers/gpu/drm/bochs/bochs_drv.c:127:2: note: in expansion of macro 'if'
if (bochs->fb.initialized) {
^~
drivers/gpu/drm/bochs/bochs_drv.c:127:15: error: 'struct <anonymous>' has no member named 'initialized'
if (bochs->fb.initialized) {
^
include/linux/compiler.h:58:42: note: in definition of macro '__trace_if'
if (__builtin_constant_p(!!(cond)) ? !!(cond) : \
^~~~
drivers/gpu/drm/bochs/bochs_drv.c:127:2: note: in expansion of macro 'if'
if (bochs->fb.initialized) {
^~
drivers/gpu/drm/bochs/bochs_drv.c:127:15: error: 'struct <anonymous>' has no member named 'initialized'
if (bochs->fb.initialized) {
^
include/linux/compiler.h:69:16: note: in definition of macro '__trace_if'
______r = !!(cond); \
^~~~
drivers/gpu/drm/bochs/bochs_drv.c:127:2: note: in expansion of macro 'if'
if (bochs->fb.initialized) {
^~

vim +/if +110 drivers/gpu/drm/bochs/bochs_drv.c

0a6659bd Gerd Hoffmann 2013-12-17 @8 #include <linux/mm.h>
0a6659bd Gerd Hoffmann 2013-12-17 9 #include <linux/module.h>
0a6659bd Gerd Hoffmann 2013-12-17 10 #include <linux/slab.h>
44adece5 Daniel Vetter 2016-08-10 11 #include <drm/drm_fb_helper.h>
0a6659bd Gerd Hoffmann 2013-12-17 12
0a6659bd Gerd Hoffmann 2013-12-17 13 #include "bochs.h"
0a6659bd Gerd Hoffmann 2013-12-17 14
1acf5661 Max Staudt 2017-01-18 15 static int bochs_modeset = -1;
1acf5661 Max Staudt 2017-01-18 16 module_param_named(modeset, bochs_modeset, int, 0444);
1acf5661 Max Staudt 2017-01-18 17 MODULE_PARM_DESC(modeset, "enable/disable kernel modesetting");
1acf5661 Max Staudt 2017-01-18 18
0a6659bd Gerd Hoffmann 2013-12-17 19 static bool enable_fbdev = true;
0a6659bd Gerd Hoffmann 2013-12-17 20 module_param_named(fbdev, enable_fbdev, bool, 0444);
0a6659bd Gerd Hoffmann 2013-12-17 21 MODULE_PARM_DESC(fbdev, "register fbdev device");
0a6659bd Gerd Hoffmann 2013-12-17 22
0a6659bd Gerd Hoffmann 2013-12-17 23 /* ---------------------------------------------------------------------- */
0a6659bd Gerd Hoffmann 2013-12-17 24 /* drm interface */
0a6659bd Gerd Hoffmann 2013-12-17 25
11b3c20b Gabriel Krisman Bertazi 2017-01-06 26 static void bochs_unload(struct drm_device *dev)
0a6659bd Gerd Hoffmann 2013-12-17 27 {
0a6659bd Gerd Hoffmann 2013-12-17 28 struct bochs_device *bochs = dev->dev_private;
0a6659bd Gerd Hoffmann 2013-12-17 29
0a6659bd Gerd Hoffmann 2013-12-17 30 bochs_fbdev_fini(bochs);
0a6659bd Gerd Hoffmann 2013-12-17 31 bochs_kms_fini(bochs);
0a6659bd Gerd Hoffmann 2013-12-17 32 bochs_mm_fini(bochs);
0a6659bd Gerd Hoffmann 2013-12-17 33 bochs_hw_fini(dev);
0a6659bd Gerd Hoffmann 2013-12-17 34 kfree(bochs);
0a6659bd Gerd Hoffmann 2013-12-17 35 dev->dev_private = NULL;
0a6659bd Gerd Hoffmann 2013-12-17 36 }
0a6659bd Gerd Hoffmann 2013-12-17 37
0a6659bd Gerd Hoffmann 2013-12-17 38 static int bochs_load(struct drm_device *dev, unsigned long flags)
0a6659bd Gerd Hoffmann 2013-12-17 39 {
0a6659bd Gerd Hoffmann 2013-12-17 40 struct bochs_device *bochs;
0a6659bd Gerd Hoffmann 2013-12-17 41 int ret;
0a6659bd Gerd Hoffmann 2013-12-17 42
0a6659bd Gerd Hoffmann 2013-12-17 43 bochs = kzalloc(sizeof(*bochs), GFP_KERNEL);
0a6659bd Gerd Hoffmann 2013-12-17 44 if (bochs == NULL)
0a6659bd Gerd Hoffmann 2013-12-17 45 return -ENOMEM;
0a6659bd Gerd Hoffmann 2013-12-17 46 dev->dev_private = bochs;
0a6659bd Gerd Hoffmann 2013-12-17 47 bochs->dev = dev;
0a6659bd Gerd Hoffmann 2013-12-17 48
0a6659bd Gerd Hoffmann 2013-12-17 49 ret = bochs_hw_init(dev, flags);
0a6659bd Gerd Hoffmann 2013-12-17 50 if (ret)
0a6659bd Gerd Hoffmann 2013-12-17 51 goto err;
0a6659bd Gerd Hoffmann 2013-12-17 52
0a6659bd Gerd Hoffmann 2013-12-17 53 ret = bochs_mm_init(bochs);
0a6659bd Gerd Hoffmann 2013-12-17 54 if (ret)
0a6659bd Gerd Hoffmann 2013-12-17 55 goto err;
0a6659bd Gerd Hoffmann 2013-12-17 56
0a6659bd Gerd Hoffmann 2013-12-17 57 ret = bochs_kms_init(bochs);
0a6659bd Gerd Hoffmann 2013-12-17 58 if (ret)
0a6659bd Gerd Hoffmann 2013-12-17 59 goto err;
0a6659bd Gerd Hoffmann 2013-12-17 60
0a6659bd Gerd Hoffmann 2013-12-17 61 if (enable_fbdev)
0a6659bd Gerd Hoffmann 2013-12-17 62 bochs_fbdev_init(bochs);
0a6659bd Gerd Hoffmann 2013-12-17 63
0a6659bd Gerd Hoffmann 2013-12-17 64 return 0;
0a6659bd Gerd Hoffmann 2013-12-17 65
0a6659bd Gerd Hoffmann 2013-12-17 66 err:
0a6659bd Gerd Hoffmann 2013-12-17 67 bochs_unload(dev);
0a6659bd Gerd Hoffmann 2013-12-17 68 return ret;
0a6659bd Gerd Hoffmann 2013-12-17 69 }
0a6659bd Gerd Hoffmann 2013-12-17 70
0a6659bd Gerd Hoffmann 2013-12-17 71 static const struct file_operations bochs_fops = {
0a6659bd Gerd Hoffmann 2013-12-17 72 .owner = THIS_MODULE,
0a6659bd Gerd Hoffmann 2013-12-17 73 .open = drm_open,
0a6659bd Gerd Hoffmann 2013-12-17 74 .release = drm_release,
0a6659bd Gerd Hoffmann 2013-12-17 75 .unlocked_ioctl = drm_ioctl,
0a6659bd Gerd Hoffmann 2013-12-17 76 .compat_ioctl = drm_compat_ioctl,
0a6659bd Gerd Hoffmann 2013-12-17 77 .poll = drm_poll,
0a6659bd Gerd Hoffmann 2013-12-17 78 .read = drm_read,
0a6659bd Gerd Hoffmann 2013-12-17 79 .llseek = no_llseek,
0a6659bd Gerd Hoffmann 2013-12-17 80 .mmap = bochs_mmap,
0a6659bd Gerd Hoffmann 2013-12-17 81 };
0a6659bd Gerd Hoffmann 2013-12-17 82
0a6659bd Gerd Hoffmann 2013-12-17 83 static struct drm_driver bochs_driver = {
0a6659bd Gerd Hoffmann 2013-12-17 84 .driver_features = DRIVER_GEM | DRIVER_MODESET,
0a6659bd Gerd Hoffmann 2013-12-17 85 .load = bochs_load,
0a6659bd Gerd Hoffmann 2013-12-17 86 .unload = bochs_unload,
0a6659bd Gerd Hoffmann 2013-12-17 87 .fops = &bochs_fops,
0a6659bd Gerd Hoffmann 2013-12-17 88 .name = "bochs-drm",
0a6659bd Gerd Hoffmann 2013-12-17 89 .desc = "bochs dispi vga interface (qemu stdvga)",
0a6659bd Gerd Hoffmann 2013-12-17 90 .date = "20130925",
0a6659bd Gerd Hoffmann 2013-12-17 91 .major = 1,
0a6659bd Gerd Hoffmann 2013-12-17 92 .minor = 0,
6f2c1c15 Daniel Vetter 2016-05-30 93 .gem_free_object_unlocked = bochs_gem_free_object,
0a6659bd Gerd Hoffmann 2013-12-17 94 .dumb_create = bochs_dumb_create,
0a6659bd Gerd Hoffmann 2013-12-17 95 .dumb_map_offset = bochs_dumb_mmap_offset,
0a6659bd Gerd Hoffmann 2013-12-17 96 };
0a6659bd Gerd Hoffmann 2013-12-17 97
0a6659bd Gerd Hoffmann 2013-12-17 98 /* ---------------------------------------------------------------------- */
b8ccd70f Gerd Hoffmann 2014-04-14 99 /* pm interface */
b8ccd70f Gerd Hoffmann 2014-04-14 100
150cee9c Russell King 2014-07-12 101 #ifdef CONFIG_PM_SLEEP
b8ccd70f Gerd Hoffmann 2014-04-14 102 static int bochs_pm_suspend(struct device *dev)
b8ccd70f Gerd Hoffmann 2014-04-14 103 {
b8ccd70f Gerd Hoffmann 2014-04-14 104 struct pci_dev *pdev = to_pci_dev(dev);
b8ccd70f Gerd Hoffmann 2014-04-14 105 struct drm_device *drm_dev = pci_get_drvdata(pdev);
b8ccd70f Gerd Hoffmann 2014-04-14 106 struct bochs_device *bochs = drm_dev->dev_private;
b8ccd70f Gerd Hoffmann 2014-04-14 107
b8ccd70f Gerd Hoffmann 2014-04-14 108 drm_kms_helper_poll_disable(drm_dev);
b8ccd70f Gerd Hoffmann 2014-04-14 109
b8ccd70f Gerd Hoffmann 2014-04-14 @110 if (bochs->fb.initialized) {
b8ccd70f Gerd Hoffmann 2014-04-14 111 console_lock();
6a752972 Archit Taneja 2015-07-31 112 drm_fb_helper_set_suspend(&bochs->fb.helper, 1);
b8ccd70f Gerd Hoffmann 2014-04-14 113 console_unlock();
b8ccd70f Gerd Hoffmann 2014-04-14 114 }
b8ccd70f Gerd Hoffmann 2014-04-14 115
b8ccd70f Gerd Hoffmann 2014-04-14 116 return 0;
b8ccd70f Gerd Hoffmann 2014-04-14 117 }
b8ccd70f Gerd Hoffmann 2014-04-14 118

:::::: The code at line 110 was first introduced by commit
:::::: b8ccd70f1363f7d4e49219dbc46ec973a14f49cd drm: bochs: add power management support

:::::: TO: Gerd Hoffmann <kraxel@xxxxxxxxxx>
:::::: CC: Dave Airlie <airlied@xxxxxxxxxx>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

Attachment: .config.gz
Description: application/gzip