[drm-misc:drm-misc-next 2/4] drivers/gpu/drm/hyperv/hyperv_drm_modeset.c:25:48: error: invalid use of undefined type 'struct drm_framebuffer'

kernel test robot lkp at intel.com
Wed Jun 22 21:21:13 UTC 2022


tree:   git://anongit.freedesktop.org/drm/drm-misc drm-misc-next
head:   009a3a52791f31c57d755a73f6bc66fbdd8bd76c
commit: 720cf96d8fecde29b72e1101f8a567a0ce99594f [2/4] drm: Drop drm_framebuffer.h from drm_crtc.h
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20220623/202206230540.nPlOQSBG-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-3) 11.3.0
reproduce (this is a W=1 build):
        git remote add drm-misc git://anongit.freedesktop.org/drm/drm-misc
        git fetch --no-tags drm-misc drm-misc-next
        git checkout 720cf96d8fecde29b72e1101f8a567a0ce99594f
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp at intel.com>

Note: the drm-misc/drm-misc-next HEAD 009a3a52791f31c57d755a73f6bc66fbdd8bd76c builds fine.
      It only hurts bisectability.

All errors (new ones prefixed by >>):

   In file included from include/linux/list.h:5,
                    from include/linux/preempt.h:11,
                    from include/linux/spinlock.h:55,
                    from include/linux/mmzone.h:8,
                    from include/linux/gfp.h:6,
                    from include/linux/mm.h:7,
                    from include/linux/hyperv.h:17,
                    from drivers/gpu/drm/hyperv/hyperv_drm_modeset.c:6:
   drivers/gpu/drm/hyperv/hyperv_drm_modeset.c: In function 'hyperv_blit_to_vram_rect':
>> drivers/gpu/drm/hyperv/hyperv_drm_modeset.c:25:48: error: invalid use of undefined type 'struct drm_framebuffer'
      25 |         struct hyperv_drm_device *hv = to_hv(fb->dev);
         |                                                ^~
   include/linux/container_of.h:18:33: note: in definition of macro 'container_of'
      18 |         void *__mptr = (void *)(ptr);                                   \
         |                                 ^~~
   drivers/gpu/drm/hyperv/hyperv_drm_modeset.c:25:40: note: in expansion of macro 'to_hv'
      25 |         struct hyperv_drm_device *hv = to_hv(fb->dev);
         |                                        ^~~~~
   In file included from include/linux/bits.h:22,
                    from include/linux/ratelimit_types.h:5,
                    from include/linux/printk.h:9,
                    from include/asm-generic/bug.h:22,
                    from arch/x86/include/asm/bug.h:87,
                    from include/linux/bug.h:5,
                    from include/linux/mmdebug.h:5,
                    from include/linux/mm.h:6,
                    from include/linux/hyperv.h:17,
                    from drivers/gpu/drm/hyperv/hyperv_drm_modeset.c:6:
>> drivers/gpu/drm/hyperv/hyperv_drm_modeset.c:25:48: error: invalid use of undefined type 'struct drm_framebuffer'
      25 |         struct hyperv_drm_device *hv = to_hv(fb->dev);
         |                                                ^~
   include/linux/build_bug.h:78:56: note: in definition of macro '__static_assert'
      78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
         |                                                        ^~~~
   include/linux/container_of.h:19:9: note: in expansion of macro 'static_assert'
      19 |         static_assert(__same_type(*(ptr), ((type *)0)->member) ||       \
         |         ^~~~~~~~~~~~~
   include/linux/container_of.h:19:23: note: in expansion of macro '__same_type'
      19 |         static_assert(__same_type(*(ptr), ((type *)0)->member) ||       \
         |                       ^~~~~~~~~~~
   drivers/gpu/drm/hyperv/hyperv_drm.h:40:21: note: in expansion of macro 'container_of'
      40 | #define to_hv(_dev) container_of(_dev, struct hyperv_drm_device, dev)
         |                     ^~~~~~~~~~~~
   drivers/gpu/drm/hyperv/hyperv_drm_modeset.c:25:40: note: in expansion of macro 'to_hv'
      25 |         struct hyperv_drm_device *hv = to_hv(fb->dev);
         |                                        ^~~~~
>> drivers/gpu/drm/hyperv/hyperv_drm_modeset.c:25:48: error: invalid use of undefined type 'struct drm_framebuffer'
      25 |         struct hyperv_drm_device *hv = to_hv(fb->dev);
         |                                                ^~
   include/linux/build_bug.h:78:56: note: in definition of macro '__static_assert'
      78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
         |                                                        ^~~~
   include/linux/container_of.h:19:9: note: in expansion of macro 'static_assert'
      19 |         static_assert(__same_type(*(ptr), ((type *)0)->member) ||       \
         |         ^~~~~~~~~~~~~
   include/linux/container_of.h:20:23: note: in expansion of macro '__same_type'
      20 |                       __same_type(*(ptr), void),                        \
         |                       ^~~~~~~~~~~
   drivers/gpu/drm/hyperv/hyperv_drm.h:40:21: note: in expansion of macro 'container_of'
      40 | #define to_hv(_dev) container_of(_dev, struct hyperv_drm_device, dev)
         |                     ^~~~~~~~~~~~
   drivers/gpu/drm/hyperv/hyperv_drm_modeset.c:25:40: note: in expansion of macro 'to_hv'
      25 |         struct hyperv_drm_device *hv = to_hv(fb->dev);
         |                                        ^~~~~
   include/linux/compiler_types.h:293:27: error: expression in static assertion is not an integer
     293 | #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
         |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:78:56: note: in definition of macro '__static_assert'
      78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
         |                                                        ^~~~
   include/linux/container_of.h:19:9: note: in expansion of macro 'static_assert'
      19 |         static_assert(__same_type(*(ptr), ((type *)0)->member) ||       \
         |         ^~~~~~~~~~~~~
   include/linux/container_of.h:19:23: note: in expansion of macro '__same_type'
      19 |         static_assert(__same_type(*(ptr), ((type *)0)->member) ||       \
         |                       ^~~~~~~~~~~
   drivers/gpu/drm/hyperv/hyperv_drm.h:40:21: note: in expansion of macro 'container_of'
      40 | #define to_hv(_dev) container_of(_dev, struct hyperv_drm_device, dev)
         |                     ^~~~~~~~~~~~
   drivers/gpu/drm/hyperv/hyperv_drm_modeset.c:25:40: note: in expansion of macro 'to_hv'
      25 |         struct hyperv_drm_device *hv = to_hv(fb->dev);
         |                                        ^~~~~
   drivers/gpu/drm/hyperv/hyperv_drm_modeset.c:33:37: error: invalid use of undefined type 'struct drm_framebuffer'
      33 |         dst += drm_fb_clip_offset(fb->pitches[0], fb->format, rect);
         |                                     ^~
   drivers/gpu/drm/hyperv/hyperv_drm_modeset.c:33:53: error: invalid use of undefined type 'struct drm_framebuffer'
      33 |         dst += drm_fb_clip_offset(fb->pitches[0], fb->format, rect);
         |                                                     ^~
   drivers/gpu/drm/hyperv/hyperv_drm_modeset.c:34:35: error: invalid use of undefined type 'struct drm_framebuffer'
      34 |         drm_fb_memcpy_toio(dst, fb->pitches[0], vmap, fb, rect);
         |                                   ^~
   drivers/gpu/drm/hyperv/hyperv_drm_modeset.c: In function 'hyperv_blit_to_vram_fullscreen':
   drivers/gpu/drm/hyperv/hyperv_drm_modeset.c:46:25: error: invalid use of undefined type 'struct drm_framebuffer'
      46 |                 .x2 = fb->width,
         |                         ^~
   drivers/gpu/drm/hyperv/hyperv_drm_modeset.c:48:25: error: invalid use of undefined type 'struct drm_framebuffer'
      48 |                 .y2 = fb->height,
         |                         ^~
   drivers/gpu/drm/hyperv/hyperv_drm_modeset.c: In function 'hyperv_connector_get_modes':
   drivers/gpu/drm/hyperv/hyperv_drm_modeset.c:58:17: error: implicit declaration of function 'drm_add_modes_noedid' [-Werror=implicit-function-declaration]
      58 |         count = drm_add_modes_noedid(connector,
         |                 ^~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/hyperv/hyperv_drm_modeset.c:61:9: error: implicit declaration of function 'drm_set_preferred_mode'; did you mean 'drm_mm_reserve_node'? [-Werror=implicit-function-declaration]
      61 |         drm_set_preferred_mode(connector, hv->preferred_width,
         |         ^~~~~~~~~~~~~~~~~~~~~~
         |         drm_mm_reserve_node
   drivers/gpu/drm/hyperv/hyperv_drm_modeset.c: In function 'hyperv_check_size':
   drivers/gpu/drm/hyperv/hyperv_drm_modeset.c:93:27: error: invalid use of undefined type 'struct drm_framebuffer'
      93 |                 pitch = fb->pitches[0];
         |                           ^~
   drivers/gpu/drm/hyperv/hyperv_drm_modeset.c: In function 'hyperv_pipe_enable':
   drivers/gpu/drm/hyperv/hyperv_drm_modeset.c:112:48: error: invalid use of undefined type 'struct drm_framebuffer'
     112 |                                 plane_state->fb->pitches[0]);
         |                                                ^~
   drivers/gpu/drm/hyperv/hyperv_drm_modeset.c: In function 'hyperv_pipe_check':
   drivers/gpu/drm/hyperv/hyperv_drm_modeset.c:123:15: error: invalid use of undefined type 'struct drm_framebuffer'
     123 |         if (fb->format->format != DRM_FORMAT_XRGB8888)
         |               ^~
   drivers/gpu/drm/hyperv/hyperv_drm_modeset.c:126:15: error: invalid use of undefined type 'struct drm_framebuffer'
     126 |         if (fb->pitches[0] * fb->height > hv->fb_size) {
         |               ^~
   drivers/gpu/drm/hyperv/hyperv_drm_modeset.c:126:32: error: invalid use of undefined type 'struct drm_framebuffer'
     126 |         if (fb->pitches[0] * fb->height > hv->fb_size) {
         |                                ^~
   In file included from include/linux/device.h:15,
                    from include/linux/hyperv.h:23,
                    from drivers/gpu/drm/hyperv/hyperv_drm_modeset.c:6:
   drivers/gpu/drm/hyperv/hyperv_drm_modeset.c:128:42: error: invalid use of undefined type 'struct drm_framebuffer'
     128 |                         current->comm, fb->width, fb->height, fb->pitches[0], hv->fb_size);
         |                                          ^~
   include/linux/dev_printk.h:110:37: note: in definition of macro 'dev_printk_index_wrap'
     110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
         |                                     ^~~~~~~~~~~
   include/drm/drm_print.h:425:9: note: in expansion of macro 'dev_err'
     425 |         dev_##level##type((drm)->dev, "[drm] " fmt, ##__VA_ARGS__)
         |         ^~~~
   include/drm/drm_print.h:438:9: note: in expansion of macro '__drm_printk'
     438 |         __drm_printk((drm), err,, "*ERROR* " fmt, ##__VA_ARGS__)
         |         ^~~~~~~~~~~~
   drivers/gpu/drm/hyperv/hyperv_drm_modeset.c:127:17: note: in expansion of macro 'drm_err'
     127 |                 drm_err(&hv->dev, "fb size requested by %s for %dX%d (pitch %d) greater than %ld\n",
         |                 ^~~~~~~
   drivers/gpu/drm/hyperv/hyperv_drm_modeset.c:128:53: error: invalid use of undefined type 'struct drm_framebuffer'
     128 |                         current->comm, fb->width, fb->height, fb->pitches[0], hv->fb_size);
         |                                                     ^~
   include/linux/dev_printk.h:110:37: note: in definition of macro 'dev_printk_index_wrap'
     110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \


vim +25 drivers/gpu/drm/hyperv/hyperv_drm_modeset.c

76c56a5affeba1 Deepak Rawat      2021-05-27  @6  #include <linux/hyperv.h>
76c56a5affeba1 Deepak Rawat      2021-05-27   7  
76c56a5affeba1 Deepak Rawat      2021-05-27   8  #include <drm/drm_damage_helper.h>
76c56a5affeba1 Deepak Rawat      2021-05-27   9  #include <drm/drm_drv.h>
76c56a5affeba1 Deepak Rawat      2021-05-27  10  #include <drm/drm_fb_helper.h>
76c56a5affeba1 Deepak Rawat      2021-05-27  11  #include <drm/drm_format_helper.h>
76c56a5affeba1 Deepak Rawat      2021-05-27  12  #include <drm/drm_fourcc.h>
76c56a5affeba1 Deepak Rawat      2021-05-27  13  #include <drm/drm_gem_atomic_helper.h>
76c56a5affeba1 Deepak Rawat      2021-05-27  14  #include <drm/drm_gem_framebuffer_helper.h>
76c56a5affeba1 Deepak Rawat      2021-05-27  15  #include <drm/drm_gem_shmem_helper.h>
76c56a5affeba1 Deepak Rawat      2021-05-27  16  #include <drm/drm_probe_helper.h>
76c56a5affeba1 Deepak Rawat      2021-05-27  17  #include <drm/drm_simple_kms_helper.h>
76c56a5affeba1 Deepak Rawat      2021-05-27  18  
76c56a5affeba1 Deepak Rawat      2021-05-27  19  #include "hyperv_drm.h"
76c56a5affeba1 Deepak Rawat      2021-05-27  20  
76c56a5affeba1 Deepak Rawat      2021-05-27  21  static int hyperv_blit_to_vram_rect(struct drm_framebuffer *fb,
7938f4218168ae Lucas De Marchi   2022-02-04  22  				    const struct iosys_map *map,
76c56a5affeba1 Deepak Rawat      2021-05-27  23  				    struct drm_rect *rect)
76c56a5affeba1 Deepak Rawat      2021-05-27  24  {
76c56a5affeba1 Deepak Rawat      2021-05-27 @25  	struct hyperv_drm_device *hv = to_hv(fb->dev);
27bd66dd6419c4 Thomas Zimmermann 2021-11-10  26  	void __iomem *dst = hv->vram;
76c56a5affeba1 Deepak Rawat      2021-05-27  27  	void *vmap = map->vaddr; /* TODO: Use mapping abstraction properly */
76c56a5affeba1 Deepak Rawat      2021-05-27  28  	int idx;
76c56a5affeba1 Deepak Rawat      2021-05-27  29  
76c56a5affeba1 Deepak Rawat      2021-05-27  30  	if (!drm_dev_enter(&hv->dev, &idx))
76c56a5affeba1 Deepak Rawat      2021-05-27  31  		return -ENODEV;
76c56a5affeba1 Deepak Rawat      2021-05-27  32  
27bd66dd6419c4 Thomas Zimmermann 2021-11-10  33  	dst += drm_fb_clip_offset(fb->pitches[0], fb->format, rect);
27bd66dd6419c4 Thomas Zimmermann 2021-11-10  34  	drm_fb_memcpy_toio(dst, fb->pitches[0], vmap, fb, rect);
27bd66dd6419c4 Thomas Zimmermann 2021-11-10  35  
76c56a5affeba1 Deepak Rawat      2021-05-27  36  	drm_dev_exit(idx);
76c56a5affeba1 Deepak Rawat      2021-05-27  37  
76c56a5affeba1 Deepak Rawat      2021-05-27  38  	return 0;
76c56a5affeba1 Deepak Rawat      2021-05-27  39  }
76c56a5affeba1 Deepak Rawat      2021-05-27  40  

:::::: The code at line 25 was first introduced by commit
:::::: 76c56a5affeba1e163b66b9d8cc192e6154466f0 drm/hyperv: Add DRM driver for hyperv synthetic video device

:::::: TO: Deepak Rawat <drawat.floss at gmail.com>
:::::: CC: Deepak Rawat <drawat.floss at gmail.com>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp


More information about the dri-devel mailing list