[PATCH 6/6] drm: vkms: Refactor the plane composer to accept new formats

kernel test robot lkp at intel.com
Tue Oct 5 23:18:30 UTC 2021


Hi Igor,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v5.15-rc3 next-20210922]
[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]

url:    https://github.com/0day-ci/linux/commits/Igor-Matheus-Andrade-Torrente/Refactor-the-vkms-to-accept-new-formats/20211006-042037
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 02d5e016800d082058b3d3b7c3ede136cdc6ddcb
config: x86_64-randconfig-a003-20211004 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project c0039de2953d15815448b4b3c3bafb45607781e0)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/9cd34ac9858091dc06086b2024e8f5f111657d48
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Igor-Matheus-Andrade-Torrente/Refactor-the-vkms-to-accept-new-formats/20211006-042037
        git checkout 9cd34ac9858091dc06086b2024e8f5f111657d48
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=x86_64 

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

All warnings (new ones prefixed by >>):

   In file included from drivers/gpu/drm/vkms/vkms_composer.c:12:
>> drivers/gpu/drm/vkms/vkms_formats.h:24:7: warning: no previous prototype for function 'packed_pixels_addr' [-Wmissing-prototypes]
   void *packed_pixels_addr(struct vkms_composer *composer, int x, int y)
         ^
   drivers/gpu/drm/vkms/vkms_formats.h:24:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void *packed_pixels_addr(struct vkms_composer *composer, int x, int y)
   ^
   static 
>> drivers/gpu/drm/vkms/vkms_formats.h:31:5: warning: no previous prototype for function 'ARGB8888_to_ARGB16161616' [-Wmissing-prototypes]
   u64 ARGB8888_to_ARGB16161616(struct vkms_composer *composer, int x, int y)
       ^
   drivers/gpu/drm/vkms/vkms_formats.h:31:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   u64 ARGB8888_to_ARGB16161616(struct vkms_composer *composer, int x, int y)
   ^
   static 
>> drivers/gpu/drm/vkms/vkms_formats.h:49:5: warning: no previous prototype for function 'XRGB8888_to_ARGB16161616' [-Wmissing-prototypes]
   u64 XRGB8888_to_ARGB16161616(struct vkms_composer *composer, int x, int y)
       ^
   drivers/gpu/drm/vkms/vkms_formats.h:49:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   u64 XRGB8888_to_ARGB16161616(struct vkms_composer *composer, int x, int y)
   ^
   static 
>> drivers/gpu/drm/vkms/vkms_formats.h:63:5: warning: no previous prototype for function 'get_ARGB16161616' [-Wmissing-prototypes]
   u64 get_ARGB16161616(struct vkms_composer *composer, int x, int y)
       ^
   drivers/gpu/drm/vkms/vkms_formats.h:63:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   u64 get_ARGB16161616(struct vkms_composer *composer, int x, int y)
   ^
   static 
>> drivers/gpu/drm/vkms/vkms_formats.h:85:6: warning: no previous prototype for function 'convert_to_ARGB8888' [-Wmissing-prototypes]
   void convert_to_ARGB8888(u64 argb_src1, u64 argb_src2, int x, int y,
        ^
   drivers/gpu/drm/vkms/vkms_formats.h:85:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void convert_to_ARGB8888(u64 argb_src1, u64 argb_src2, int x, int y,
   ^
   static 
>> drivers/gpu/drm/vkms/vkms_formats.h:106:6: warning: no previous prototype for function 'convert_to_XRGB8888' [-Wmissing-prototypes]
   void convert_to_XRGB8888(u64 argb_src1, u64 argb_src2, int x, int y,
        ^
   drivers/gpu/drm/vkms/vkms_formats.h:106:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void convert_to_XRGB8888(u64 argb_src1, u64 argb_src2, int x, int y,
   ^
   static 
>> drivers/gpu/drm/vkms/vkms_formats.h:117:6: warning: no previous prototype for function 'convert_to_ARGB16161616' [-Wmissing-prototypes]
   void convert_to_ARGB16161616(u64 argb_src1, u64 argb_src2, int x, int y,
        ^
   drivers/gpu/drm/vkms/vkms_formats.h:117:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void convert_to_ARGB16161616(u64 argb_src1, u64 argb_src2, int x, int y,
   ^
   static 
   7 warnings generated.


vim +/packed_pixels_addr +24 drivers/gpu/drm/vkms/vkms_formats.h

     7	
     8	#define pixel_offset(composer, x, y) \
     9		((composer)->offset + ((y) * (composer)->pitch) + ((x) * (composer)->cpp))
    10	
    11	/*
    12	 * packed_pixels_addr - Get the pointer to pixel of a given pair of coordinates
    13	 *
    14	 * @composer: Buffer metadata
    15	 * @x: The x(width) coordinate of the 2D buffer
    16	 * @y: The y(Heigth) coordinate of the 2D buffer
    17	 *
    18	 * Takes the information stored in the composer, a pair of coordinates, and
    19	 * returns the address of the first color channel.
    20	 * This function assumes the channels are packed together, i.e. a color channel
    21	 * comes immediately after another. And therefore, this function doesn't work
    22	 * for YUV with chroma subsampling (e.g. YUV420 and NV21).
    23	 */
  > 24	void *packed_pixels_addr(struct vkms_composer *composer, int x, int y)
    25	{
    26		int offset = pixel_offset(composer, x, y);
    27	
    28		return (u8 *)composer->map[0].vaddr + offset;
    29	}
    30	
  > 31	u64 ARGB8888_to_ARGB16161616(struct vkms_composer *composer, int x, int y)
    32	{
    33		u8 *pixel_addr = packed_pixels_addr(composer, x, y);
    34	
    35		/*
    36		 * Organizes the channels in their respective positions and converts
    37		 * the 8 bits channel to 16.
    38		 * The 257 is the "conversion ratio". This number is obtained by the
    39		 * (2^16 - 1) / (2^8 - 1) division. Which, in this case, tries to get
    40		 * the best color value in a color space with more possibilities.
    41		 * And a similar idea applies to others RGB color conversions.
    42		 */
    43		return ((u64)pixel_addr[3] * 257) << 48 |
    44		       ((u64)pixel_addr[2] * 257) << 32 |
    45		       ((u64)pixel_addr[1] * 257) << 16 |
    46		       ((u64)pixel_addr[0] * 257);
    47	}
    48	
  > 49	u64 XRGB8888_to_ARGB16161616(struct vkms_composer *composer, int x, int y)
    50	{
    51		u8 *pixel_addr = packed_pixels_addr(composer, x, y);
    52	
    53		/*
    54		 * The same as the ARGB8888 but with the alpha channel as the
    55		 * maximum value as possible.
    56		 */
    57		return 0xffffllu << 48 |
    58		       ((u64)pixel_addr[2] * 257) << 32 |
    59		       ((u64)pixel_addr[1] * 257) << 16 |
    60		       ((u64)pixel_addr[0] * 257);
    61	}
    62	
  > 63	u64 get_ARGB16161616(struct vkms_composer *composer, int x, int y)
    64	{
    65		__le64 *pixel_addr = packed_pixels_addr(composer, x, y);
    66	
    67		/*
    68		 * Because the format byte order is in little-endian and this code
    69		 * needs to run on big-endian machines too, we need modify
    70		 * the byte order from little-endian to the CPU native byte order.
    71		 */
    72		return le64_to_cpu(*pixel_addr);
    73	}
    74	
    75	/*
    76	 * The following functions are used as blend operations. But unlike the
    77	 * `alpha_blend`, these functions take an ARGB16161616 pixel from the
    78	 * source, convert it to a specific format, and store it in the destination.
    79	 *
    80	 * They are used in the `compose_active_planes` and `write_wb_buffer` to
    81	 * copy and convert one pixel from/to the output buffer to/from
    82	 * another buffer (e.g. writeback buffer, primary plane buffer).
    83	 */
    84	
  > 85	void convert_to_ARGB8888(u64 argb_src1, u64 argb_src2, int x, int y,
    86				 struct vkms_composer *dst_composer)
    87	{
    88		u8 *pixel_addr = packed_pixels_addr(dst_composer, x, y);
    89	
    90		/*
    91		 * This sequence below is important because the format's byte order is
    92		 * in little-endian. In the case of the ARGB8888 the memory is
    93		 * organized this way:
    94		 *
    95		 * | Addr     | = blue channel
    96		 * | Addr + 1 | = green channel
    97		 * | Addr + 2 | = Red channel
    98		 * | Addr + 3 | = Alpha channel
    99		 */
   100		pixel_addr[0] = DIV_ROUND_UP(argb_src1 & 0xffffllu, 257);
   101		pixel_addr[1] = DIV_ROUND_UP((argb_src1 & (0xffffllu << 16)) >> 16, 257);
   102		pixel_addr[2] = DIV_ROUND_UP((argb_src1 & (0xffffllu << 32)) >> 32, 257);
   103		pixel_addr[3] = DIV_ROUND_UP((argb_src1 & (0xffffllu << 48)) >> 48, 257);
   104	}
   105	
 > 106	void convert_to_XRGB8888(u64 argb_src1, u64 argb_src2, int x, int y,
   107				 struct vkms_composer *dst_composer)
   108	{
   109		u8 *pixel_addr = packed_pixels_addr(dst_composer, x, y);
   110	
   111		pixel_addr[0] = DIV_ROUND_UP(argb_src1 & 0xffffllu, 257);
   112		pixel_addr[1] = DIV_ROUND_UP((argb_src1 & (0xffffllu << 16)) >> 16, 257);
   113		pixel_addr[2] = DIV_ROUND_UP((argb_src1 & (0xffffllu << 32)) >> 32, 257);
   114		pixel_addr[3] = 0xff;
   115	}
   116	
 > 117	void convert_to_ARGB16161616(u64 argb_src1, u64 argb_src2, int x, int y,
   118				     struct vkms_composer *dst_composer)
   119	{
   120		__le64 *pixel_addr = packed_pixels_addr(dst_composer, x, y);
   121	
   122		*pixel_addr = cpu_to_le64(argb_src1);
   123	}
   124	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 36722 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20211006/9561e79e/attachment-0001.gz>


More information about the dri-devel mailing list