Hi Igor, Thank you for the patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR 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: riscv-buildonly-randconfig-r005-20211004 (attached as .config) compiler: riscv32-linux-gcc (GCC) 11.2.0 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=gcc-11.2.0 make.cross ARCH=riscv If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <lkp@xxxxxxxxx> All errors (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: error: no previous prototype for 'packed_pixels_addr' [-Werror=missing-prototypes] 24 | void *packed_pixels_addr(struct vkms_composer *composer, int x, int y) | ^~~~~~~~~~~~~~~~~~ >> drivers/gpu/drm/vkms/vkms_formats.h:31:5: error: no previous prototype for 'ARGB8888_to_ARGB16161616' [-Werror=missing-prototypes] 31 | u64 ARGB8888_to_ARGB16161616(struct vkms_composer *composer, int x, int y) | ^~~~~~~~~~~~~~~~~~~~~~~~ >> drivers/gpu/drm/vkms/vkms_formats.h:49:5: error: no previous prototype for 'XRGB8888_to_ARGB16161616' [-Werror=missing-prototypes] 49 | u64 XRGB8888_to_ARGB16161616(struct vkms_composer *composer, int x, int y) | ^~~~~~~~~~~~~~~~~~~~~~~~ >> drivers/gpu/drm/vkms/vkms_formats.h:63:5: error: no previous prototype for 'get_ARGB16161616' [-Werror=missing-prototypes] 63 | u64 get_ARGB16161616(struct vkms_composer *composer, int x, int y) | ^~~~~~~~~~~~~~~~ >> drivers/gpu/drm/vkms/vkms_formats.h:85:6: error: no previous prototype for 'convert_to_ARGB8888' [-Werror=missing-prototypes] 85 | void convert_to_ARGB8888(u64 argb_src1, u64 argb_src2, int x, int y, | ^~~~~~~~~~~~~~~~~~~ >> drivers/gpu/drm/vkms/vkms_formats.h:106:6: error: no previous prototype for 'convert_to_XRGB8888' [-Werror=missing-prototypes] 106 | void convert_to_XRGB8888(u64 argb_src1, u64 argb_src2, int x, int y, | ^~~~~~~~~~~~~~~~~~~ >> drivers/gpu/drm/vkms/vkms_formats.h:117:6: error: no previous prototype for 'convert_to_ARGB16161616' [-Werror=missing-prototypes] 117 | void convert_to_ARGB16161616(u64 argb_src1, u64 argb_src2, int x, int y, | ^~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors 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@xxxxxxxxxxxx
Attachment:
.config.gz
Description: application/gzip