Hi Kevin, [FYI, it's a private test report for your RFC patch.] [auto build test WARNING on robh/for-next] [also build test WARNING on linus/master v5.8-rc7] [cannot apply to next-20200728] [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/Kevin-Tang/Add-Unisoc-s-drm-kms-module/20200728-181033 base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next config: arc-allyesconfig (attached as .config) compiler: arc-elf-gcc (GCC) 9.3.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 # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arc If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All warnings (new ones prefixed by >>): >> drivers/gpu/drm/sprd/dsi/sprd_dsi_api.c:163:6: warning: no previous prototype for 'sprd_dsi_power_on' [-Wmissing-prototypes] 163 | void sprd_dsi_power_on(struct sprd_dsi *dsi) | ^~~~~~~~~~~~~~~~~ >> drivers/gpu/drm/sprd/dsi/sprd_dsi_api.c:206:6: warning: no previous prototype for 'sprd_dsi_power_off' [-Wmissing-prototypes] 206 | void sprd_dsi_power_off(struct sprd_dsi *dsi) | ^~~~~~~~~~~~~~~~~~ >> drivers/gpu/drm/sprd/dsi/sprd_dsi_api.c:225:5: warning: no previous prototype for 'sprd_dsi_dpi_video' [-Wmissing-prototypes] 225 | int sprd_dsi_dpi_video(struct sprd_dsi *dsi) | ^~~~~~~~~~~~~~~~~~ >> drivers/gpu/drm/sprd/dsi/sprd_dsi_api.c:355:5: warning: no previous prototype for 'sprd_dsi_edpi_video' [-Wmissing-prototypes] 355 | int sprd_dsi_edpi_video(struct sprd_dsi *dsi) | ^~~~~~~~~~~~~~~~~~~ >> drivers/gpu/drm/sprd/dsi/sprd_dsi_api.c:400:5: warning: no previous prototype for 'sprd_dsi_wr_pkt' [-Wmissing-prototypes] 400 | int sprd_dsi_wr_pkt(struct sprd_dsi *dsi, u8 vc, u8 type, | ^~~~~~~~~~~~~~~ >> drivers/gpu/drm/sprd/dsi/sprd_dsi_api.c:463:5: warning: no previous prototype for 'sprd_dsi_rd_pkt' [-Wmissing-prototypes] 463 | int sprd_dsi_rd_pkt(struct sprd_dsi *dsi, u8 vc, u8 type, | ^~~~~~~~~~~~~~~ >> drivers/gpu/drm/sprd/dsi/sprd_dsi_api.c:517:6: warning: no previous prototype for 'sprd_dsi_set_work_mode' [-Wmissing-prototypes] 517 | void sprd_dsi_set_work_mode(struct sprd_dsi *dsi, u8 mode) | ^~~~~~~~~~~~~~~~~~~~~~ >> drivers/gpu/drm/sprd/dsi/sprd_dsi_api.c:527:5: warning: no previous prototype for 'sprd_dsi_get_work_mode' [-Wmissing-prototypes] 527 | int sprd_dsi_get_work_mode(struct sprd_dsi *dsi) | ^~~~~~~~~~~~~~~~~~~~~~ >> drivers/gpu/drm/sprd/dsi/sprd_dsi_api.c:537:6: warning: no previous prototype for 'sprd_dsi_lp_cmd_enable' [-Wmissing-prototypes] 537 | void sprd_dsi_lp_cmd_enable(struct sprd_dsi *dsi, bool enable) | ^~~~~~~~~~~~~~~~~~~~~~ >> drivers/gpu/drm/sprd/dsi/sprd_dsi_api.c:547:6: warning: no previous prototype for 'sprd_dsi_nc_clk_en' [-Wmissing-prototypes] 547 | void sprd_dsi_nc_clk_en(struct sprd_dsi *dsi, bool enable) | ^~~~~~~~~~~~~~~~~~ >> drivers/gpu/drm/sprd/dsi/sprd_dsi_api.c:554:6: warning: no previous prototype for 'sprd_dsi_state_reset' [-Wmissing-prototypes] 554 | void sprd_dsi_state_reset(struct sprd_dsi *dsi) | ^~~~~~~~~~~~~~~~~~~~ >> drivers/gpu/drm/sprd/dsi/sprd_dsi_api.c:563:5: warning: no previous prototype for 'sprd_dsi_int_status' [-Wmissing-prototypes] 563 | u32 sprd_dsi_int_status(struct sprd_dsi *dsi, int index) | ^~~~~~~~~~~~~~~~~~~ >> drivers/gpu/drm/sprd/dsi/sprd_dsi_api.c:580:6: warning: no previous prototype for 'sprd_dsi_int_mask' [-Wmissing-prototypes] 580 | void sprd_dsi_int_mask(struct sprd_dsi *dsi, int index) | ^~~~~~~~~~~~~~~~~ vim +/sprd_dsi_power_on +163 drivers/gpu/drm/sprd/dsi/sprd_dsi_api.c 159 160 #define ns_to_cycle(ns, byte_clk) \ 161 DIV_ROUND_UP((ns) * (byte_clk), 1000000) 162 > 163 void sprd_dsi_power_on(struct sprd_dsi *dsi) 164 { 165 int div; 166 struct dsi_context *ctx = &dsi->ctx; 167 u16 max_rd_time; 168 u16 data_hs2lp, data_lp2hs, clk_hs2lp, clk_lp2hs; 169 170 dsi_power_enable(ctx, 0); 171 dsi_int0_mask(ctx, 0xffffffff); 172 dsi_int1_mask(ctx, 0xffffffff); 173 dsi_cmd_mode(ctx); 174 dsi_eotp_rx_en(ctx, 0); 175 dsi_eotp_tx_en(ctx, 0); 176 dsi_ecc_rx_en(ctx, 1); 177 dsi_crc_rx_en(ctx, 1); 178 dsi_bta_en(ctx, 1); 179 dsi_video_vcid(ctx, 0); 180 dsi_rx_vcid(ctx, 0); 181 182 div = DIV_ROUND_UP(ctx->byte_clk, ctx->esc_clk); 183 dsi_tx_escape_division(ctx, div); 184 185 max_rd_time = ns_to_cycle(ctx->max_rd_time, ctx->byte_clk); 186 dsi_max_read_time(ctx, max_rd_time); 187 188 data_hs2lp = ns_to_cycle(ctx->data_hs2lp, ctx->byte_clk); 189 data_lp2hs = ns_to_cycle(ctx->data_lp2hs, ctx->byte_clk); 190 clk_hs2lp = ns_to_cycle(ctx->clk_hs2lp, ctx->byte_clk); 191 clk_lp2hs = ns_to_cycle(ctx->clk_lp2hs, ctx->byte_clk); 192 dsi_datalane_hs2lp_config(ctx, data_hs2lp); 193 dsi_datalane_lp2hs_config(ctx, data_lp2hs); 194 dsi_clklane_hs2lp_config(ctx, clk_hs2lp); 195 dsi_clklane_lp2hs_config(ctx, clk_lp2hs); 196 197 dsi_power_enable(ctx, 1); 198 } 199 200 /** 201 * Close DSI Host driver 202 * - Free up resources and shutdown host controller and PHY 203 * @param dsi pointer to structure holding the DSI Host core information 204 * @return 205 */ > 206 void sprd_dsi_power_off(struct sprd_dsi *dsi) 207 { 208 struct dsi_context *ctx = &dsi->ctx; 209 210 dsi_int0_mask(ctx, 0xffffffff); 211 dsi_int1_mask(ctx, 0xffffffff); 212 dsi_power_enable(ctx, 0); 213 } 214 215 /** 216 * Configure DPI video interface 217 * - If not in burst mode, it will compute the video and null packet sizes 218 * according to necessity 219 * - Configure timers for data lanes and/or clock lane to return to LP when 220 * bandwidth is not filled by data 221 * @param dsi pointer to structure holding the DSI Host core information 222 * @param param pointer to video stream-to-send information 223 * @return error code 224 */ > 225 int sprd_dsi_dpi_video(struct sprd_dsi *dsi) 226 { 227 struct dsi_context *ctx = &dsi->ctx; 228 struct videomode *vm = &dsi->ctx.vm; 229 u16 Bpp_x100; 230 u16 video_size; 231 u32 ratio_x1000; 232 u16 null_pkt_size = 0; 233 u8 video_size_step; 234 u32 hs_to; 235 u32 total_bytes; 236 u32 bytes_per_chunk; 237 u32 chunks = 0; 238 u32 bytes_left = 0; 239 u32 chunk_overhead; 240 const u8 pkt_header = 6; 241 u8 coding; 242 int div; 243 u16 hline; 244 245 coding = fmt_to_coding(ctx->format); 246 video_size = round_video_size(coding, vm->hactive); 247 Bpp_x100 = calc_bytes_per_pixel_x100(coding); 248 video_size_step = calc_video_size_step(coding); 249 ratio_x1000 = ctx->byte_clk * 1000 / (vm->pixelclock / 1000); 250 hline = vm->hactive + vm->hsync_len + vm->hfront_porch + 251 vm->hback_porch; 252 253 dsi_power_enable(ctx, 0); 254 dsi_dpi_frame_ack_en(ctx, ctx->frame_ack_en); 255 dsi_dpi_color_coding(ctx, coding); 256 dsi_dpi_video_burst_mode(ctx, ctx->burst_mode); 257 dsi_dpi_sig_delay(ctx, 95 * hline * ratio_x1000 / 100000); 258 dsi_dpi_hline_time(ctx, hline * ratio_x1000 / 1000); 259 dsi_dpi_hsync_time(ctx, vm->hsync_len * ratio_x1000 / 1000); 260 dsi_dpi_hbp_time(ctx, vm->hback_porch * ratio_x1000 / 1000); 261 dsi_dpi_vact(ctx, vm->vactive); 262 dsi_dpi_vfp(ctx, vm->vfront_porch); 263 dsi_dpi_vbp(ctx, vm->vback_porch); 264 dsi_dpi_vsync(ctx, vm->vsync_len); 265 dsi_dpi_hporch_lp_en(ctx, 1); 266 dsi_dpi_vporch_lp_en(ctx, 1); 267 268 hs_to = (hline * vm->vactive) + (2 * Bpp_x100) / 100; 269 for (div = 0x80; (div < hs_to) && (div > 2); div--) { 270 if ((hs_to % div) == 0) { 271 dsi_timeout_clock_division(ctx, div); 272 dsi_lp_rx_timeout(ctx, hs_to / div); 273 dsi_hs_tx_timeout(ctx, hs_to / div); 274 break; 275 } 276 } 277 278 if (ctx->burst_mode == VIDEO_BURST_WITH_SYNC_PULSES) { 279 dsi_dpi_video_packet_size(ctx, video_size); 280 dsi_dpi_null_packet_size(ctx, 0); 281 dsi_dpi_chunk_num(ctx, 0); 282 } else { 283 /* non burst transmission */ 284 null_pkt_size = 0; 285 286 /* bytes to be sent - first as one chunk */ 287 bytes_per_chunk = vm->hactive * Bpp_x100 / 100 + pkt_header; 288 289 /* hline total bytes from the DPI interface */ 290 total_bytes = (vm->hactive + vm->hfront_porch) * 291 ratio_x1000 / ctx->lanes / 1000; 292 293 /* check if the pixels actually fit on the DSI link */ 294 if (total_bytes < bytes_per_chunk) { 295 DRM_ERROR("current resolution can not be set\n"); 296 return -EINVAL; 297 } 298 299 chunk_overhead = total_bytes - bytes_per_chunk; 300 301 /* overhead higher than 1 -> enable multi packets */ 302 if (chunk_overhead > 1) { 303 304 /* multi packets */ 305 for (video_size = video_size_step; 306 video_size < vm->hactive; 307 video_size += video_size_step) { 308 309 if (vm->hactive * 1000 / video_size % 1000) 310 continue; 311 312 chunks = vm->hactive / video_size; 313 bytes_per_chunk = Bpp_x100 * video_size / 100 314 + pkt_header; 315 if (total_bytes >= (bytes_per_chunk * chunks)) { 316 bytes_left = total_bytes - 317 bytes_per_chunk * chunks; 318 break; 319 } 320 } 321 322 /* prevent overflow (unsigned - unsigned) */ 323 if (bytes_left > (pkt_header * chunks)) { 324 null_pkt_size = (bytes_left - 325 pkt_header * chunks) / chunks; 326 /* avoid register overflow */ 327 if (null_pkt_size > 1023) 328 null_pkt_size = 1023; 329 } 330 331 } else { 332 333 /* single packet */ 334 chunks = 1; 335 336 /* must be a multiple of 4 except 18 loosely */ 337 for (video_size = vm->hactive; 338 (video_size % video_size_step) != 0; 339 video_size++) 340 ; 341 } 342 343 dsi_dpi_video_packet_size(ctx, video_size); 344 dsi_dpi_null_packet_size(ctx, null_pkt_size); 345 dsi_dpi_chunk_num(ctx, chunks); 346 } 347 348 dsi_int0_mask(ctx, ctx->int0_mask); 349 dsi_int1_mask(ctx, ctx->int1_mask); 350 dsi_power_enable(ctx, 1); 351 352 return 0; 353 } 354 > 355 int sprd_dsi_edpi_video(struct sprd_dsi *dsi) 356 { 357 struct dsi_context *ctx = &dsi->ctx; 358 const u32 fifo_depth = 1096; 359 const u32 word_length = 4; 360 u32 hactive = ctx->vm.hactive; 361 u32 Bpp_x100; 362 u32 max_fifo_len; 363 u8 coding; 364 365 coding = fmt_to_coding(ctx->format); 366 Bpp_x100 = calc_bytes_per_pixel_x100(coding); 367 max_fifo_len = word_length * fifo_depth * 100 / Bpp_x100; 368 369 dsi_power_enable(ctx, 0); 370 dsi_dpi_color_coding(ctx, coding); 371 dsi_tear_effect_ack_en(ctx, ctx->te_ack_en); 372 373 if (max_fifo_len > hactive) 374 dsi_edpi_max_pkt_size(ctx, hactive); 375 else 376 dsi_edpi_max_pkt_size(ctx, max_fifo_len); 377 378 dsi_int0_mask(ctx, ctx->int0_mask); 379 dsi_int1_mask(ctx, ctx->int1_mask); 380 dsi_power_enable(ctx, 1); 381 382 return 0; 383 } 384 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org