Hi Alex,

kernel test robot noticed the following build errors:

[auto build test ERROR on drm-exynos/exynos-drm-next]
[also build test ERROR on linus/master v6.17-rc1 next-20250815]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    
https://github.com/intel-lab-lkp/linux/commits/Alex-Hung/drm-Add-helper-for-conversion-from-signed-magnitude/20250815-120435
base:   https://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos.git 
exynos-drm-next
patch link:    
https://lore.kernel.org/r/20250815035047.3319284-3-alex.hung%40amd.com
patch subject: [PATCH V11 02/47] drm/vkms: Add kunit tests for VKMS LUT handling
config: arc-randconfig-001-20250816 
(https://download.01.org/0day-ci/archive/20250816/202508160245.qvehx6yb-...@intel.com/config)
compiler: arc-linux-gcc (GCC) 8.5.0
reproduce (this is a W=1 build): 
(https://download.01.org/0day-ci/archive/20250816/202508160245.qvehx6yb-...@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <l...@intel.com>
| Closes: 
https://lore.kernel.org/oe-kbuild-all/202508160245.qvehx6yb-...@intel.com/

All error/warnings (new ones prefixed by >>):

   In file included from drivers/gpu/drm/vkms/vkms_composer.c:15:
>> drivers/gpu/drm/vkms/vkms_composer.h:10:32: warning: 'struct vkms_color_lut' 
>> declared inside parameter list will not be visible outside of this 
>> definition or declaration
    s64 get_lut_index(const struct vkms_color_lut *lut, u16 channel_value);
                                   ^~~~~~~~~~~~~~
>> drivers/gpu/drm/vkms/vkms_composer.c:76:22: error: conflicting types for 
>> 'get_lut_index'
    VISIBLE_IF_KUNIT s64 get_lut_index(const struct vkms_color_lut *lut, u16 
channel_value)
                         ^~~~~~~~~~~~~
   In file included from drivers/gpu/drm/vkms/vkms_composer.c:15:
   drivers/gpu/drm/vkms/vkms_composer.h:10:5: note: previous declaration of 
'get_lut_index' was here
    s64 get_lut_index(const struct vkms_color_lut *lut, u16 channel_value);
        ^~~~~~~~~~~~~
   In file included from include/linux/linkage.h:7,
                    from include/linux/preempt.h:10,
                    from include/linux/spinlock.h:56,
                    from include/drm/drm_crtc.h:28,
                    from include/drm/drm_atomic.h:31,
                    from drivers/gpu/drm/vkms/vkms_composer.c:5:
   drivers/gpu/drm/vkms/vkms_composer.c:82:24: error: conflicting types for 
'get_lut_index'
    EXPORT_SYMBOL_IF_KUNIT(get_lut_index);
                           ^~~~~~~~~~~~~
   include/linux/export.h:76:21: note: in definition of macro '__EXPORT_SYMBOL'
     extern typeof(sym) sym;     \
                        ^~~
   include/kunit/visibility.h:27:44: note: in expansion of macro 
'EXPORT_SYMBOL_NS'
        #define EXPORT_SYMBOL_IF_KUNIT(symbol) EXPORT_SYMBOL_NS(symbol, 
"EXPORTED_FOR_KUNIT_TESTING")
                                               ^~~~~~~~~~~~~~~~
   drivers/gpu/drm/vkms/vkms_composer.c:82:1: note: in expansion of macro 
'EXPORT_SYMBOL_IF_KUNIT'
    EXPORT_SYMBOL_IF_KUNIT(get_lut_index);
    ^~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/gpu/drm/vkms/vkms_composer.c:15:
   drivers/gpu/drm/vkms/vkms_composer.h:10:5: note: previous declaration of 
'get_lut_index' was here
    s64 get_lut_index(const struct vkms_color_lut *lut, u16 channel_value);
        ^~~~~~~~~~~~~


vim +/get_lut_index +76 drivers/gpu/drm/vkms/vkms_composer.c

    14  
  > 15  #include "vkms_composer.h"
    16  #include "vkms_drv.h"
    17  
    18  static u16 pre_mul_blend_channel(u16 src, u16 dst, u16 alpha)
    19  {
    20          u32 new_color;
    21  
    22          new_color = (src * 0xffff + dst * (0xffff - alpha));
    23  
    24          return DIV_ROUND_CLOSEST(new_color, 0xffff);
    25  }
    26  
    27  /**
    28   * pre_mul_alpha_blend - alpha blending equation
    29   * @stage_buffer: The line with the pixels from src_plane
    30   * @output_buffer: A line buffer that receives all the blends output
    31   * @x_start: The start offset
    32   * @pixel_count: The number of pixels to blend
    33   *
    34   * The pixels [@x_start;@x_start+@pixel_count) in stage_buffer are 
blended at
    35   * [@x_start;@x_start+@pixel_count) in output_buffer.
    36   *
    37   * The current DRM assumption is that pixel color values have been 
already
    38   * pre-multiplied with the alpha channel values. See more
    39   * drm_plane_create_blend_mode_property(). Also, this formula assumes a
    40   * completely opaque background.
    41   */
    42  static void pre_mul_alpha_blend(const struct line_buffer *stage_buffer,
    43                                  struct line_buffer *output_buffer, int 
x_start, int pixel_count)
    44  {
    45          struct pixel_argb_u16 *out = &output_buffer->pixels[x_start];
    46          const struct pixel_argb_u16 *in = 
&stage_buffer->pixels[x_start];
    47  
    48          for (int i = 0; i < pixel_count; i++) {
    49                  out[i].a = (u16)0xffff;
    50                  out[i].r = pre_mul_blend_channel(in[i].r, out[i].r, 
in[i].a);
    51                  out[i].g = pre_mul_blend_channel(in[i].g, out[i].g, 
in[i].a);
    52                  out[i].b = pre_mul_blend_channel(in[i].b, out[i].b, 
in[i].a);
    53          }
    54  }
    55  
    56  
    57  static void fill_background(const struct pixel_argb_u16 
*background_color,
    58                              struct line_buffer *output_buffer)
    59  {
    60          for (size_t i = 0; i < output_buffer->n_pixels; i++)
    61                  output_buffer->pixels[i] = *background_color;
    62  }
    63  
    64  // lerp(a, b, t) = a + (b - a) * t
    65  VISIBLE_IF_KUNIT u16 lerp_u16(u16 a, u16 b, s64 t)
    66  {
    67          s64 a_fp = drm_int2fixp(a);
    68          s64 b_fp = drm_int2fixp(b);
    69  
    70          s64 delta = drm_fixp_mul(b_fp - a_fp, t);
    71  
    72          return drm_fixp2int_round(a_fp + delta);
    73  }
    74  EXPORT_SYMBOL_IF_KUNIT(lerp_u16);
    75  
  > 76  VISIBLE_IF_KUNIT s64 get_lut_index(const struct vkms_color_lut *lut, 
u16 channel_value)
    77  {
    78          s64 color_channel_fp = drm_int2fixp(channel_value);
    79  
    80          return drm_fixp_mul(color_channel_fp, 
lut->channel_value2index_ratio);
    81  }
    82  EXPORT_SYMBOL_IF_KUNIT(get_lut_index);
    83  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

Reply via email to