[PATCH 1/1] drm/mediatek: fine tune the dsi panel's power sequence
kbuild test robot
lkp at intel.com
Fri Nov 8 14:50:18 UTC 2019
Hi Jitao,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linus/master]
[cannot apply to v5.4-rc6 next-20191108]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Jitao-Shi/drm-mediatek-fine-tune-the-dsi-panel-s-power-sequence/20191108-202844
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 847120f859cc45e074204f4cf33c8df069306eb2
config: arm-allmodconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 7.4.0
reproduce:
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
GCC_VERSION=7.4.0 make.cross ARCH=arm
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp at intel.com>
All errors (new ones prefixed by >>):
drivers/gpu/drm/mediatek/mtk_dsi.c: In function 'mtk_dsi_poweron':
>> drivers/gpu/drm/mediatek/mtk_dsi.c:567:7: error: implicit declaration of function 'drm_panel_prepare_power'; did you mean 'drm_panel_prepare'? [-Werror=implicit-function-declaration]
if (drm_panel_prepare_power(dsi->panel))
^~~~~~~~~~~~~~~~~~~~~~~
drm_panel_prepare
>> drivers/gpu/drm/mediatek/mtk_dsi.c:622:7: error: implicit declaration of function 'drm_panel_unprepare_power'; did you mean 'drm_panel_unprepare'? [-Werror=implicit-function-declaration]
if (drm_panel_unprepare_power(dsi->panel))
^~~~~~~~~~~~~~~~~~~~~~~~~
drm_panel_unprepare
cc1: some warnings being treated as errors
vim +567 drivers/gpu/drm/mediatek/mtk_dsi.c
522
523 static int mtk_dsi_poweron(struct mtk_dsi *dsi)
524 {
525 struct device *dev = dsi->dev;
526 int ret;
527 u64 pixel_clock, total_bits;
528 u32 htotal, htotal_bits, bit_per_pixel, overhead_cycles, overhead_bits;
529
530 if (++dsi->refcount != 1)
531 return 0;
532
533 switch (dsi->format) {
534 case MIPI_DSI_FMT_RGB565:
535 bit_per_pixel = 16;
536 break;
537 case MIPI_DSI_FMT_RGB666_PACKED:
538 bit_per_pixel = 18;
539 break;
540 case MIPI_DSI_FMT_RGB666:
541 case MIPI_DSI_FMT_RGB888:
542 default:
543 bit_per_pixel = 24;
544 break;
545 }
546
547 /**
548 * htotal_time = htotal * byte_per_pixel / num_lanes
549 * overhead_time = lpx + hs_prepare + hs_zero + hs_trail + hs_exit
550 * mipi_ratio = (htotal_time + overhead_time) / htotal_time
551 * data_rate = pixel_clock * bit_per_pixel * mipi_ratio / num_lanes;
552 */
553 pixel_clock = dsi->vm.pixelclock;
554 htotal = dsi->vm.hactive + dsi->vm.hback_porch + dsi->vm.hfront_porch +
555 dsi->vm.hsync_len;
556 htotal_bits = htotal * bit_per_pixel;
557
558 overhead_cycles = T_LPX + T_HS_PREP + T_HS_ZERO + T_HS_TRAIL +
559 T_HS_EXIT;
560 overhead_bits = overhead_cycles * dsi->lanes * 8;
561 total_bits = htotal_bits + overhead_bits;
562
563 dsi->data_rate = DIV_ROUND_UP_ULL(pixel_clock * total_bits,
564 htotal * dsi->lanes);
565
566 if (dsi->panel) {
> 567 if (drm_panel_prepare_power(dsi->panel))
568 DRM_INFO("can't prepare power the panel\n");
569 }
570
571 ret = clk_set_rate(dsi->hs_clk, dsi->data_rate);
572 if (ret < 0) {
573 dev_err(dev, "Failed to set data rate: %d\n", ret);
574 goto err_prepare_power;
575 }
576
577 phy_power_on(dsi->phy);
578
579 ret = clk_prepare_enable(dsi->engine_clk);
580 if (ret < 0) {
581 dev_err(dev, "Failed to enable engine clock: %d\n", ret);
582 goto err_phy_power_off;
583 }
584
585 ret = clk_prepare_enable(dsi->digital_clk);
586 if (ret < 0) {
587 dev_err(dev, "Failed to enable digital clock: %d\n", ret);
588 goto err_disable_engine_clk;
589 }
590
591 mtk_dsi_enable(dsi);
592 mtk_dsi_reset_engine(dsi);
593 mtk_dsi_phy_timconfig(dsi);
594
595 mtk_dsi_rxtx_control(dsi);
596 mtk_dsi_ps_control_vact(dsi);
597 mtk_dsi_set_vm_cmd(dsi);
598 mtk_dsi_config_vdo_timing(dsi);
599 mtk_dsi_set_interrupt_enable(dsi);
600
601 mtk_dsi_clk_ulp_mode_leave(dsi);
602 mtk_dsi_lane0_ulp_mode_leave(dsi);
603 mtk_dsi_clk_hs_mode(dsi, 0);
604
605 if (dsi->panel) {
606 if (drm_panel_prepare(dsi->panel)) {
607 DRM_ERROR("failed to prepare the panel\n");
608 goto err_disable_digital_clk;
609 }
610 }
611
612 return 0;
613
614 err_disable_digital_clk:
615 clk_disable_unprepare(dsi->digital_clk);
616 err_disable_engine_clk:
617 clk_disable_unprepare(dsi->engine_clk);
618 err_phy_power_off:
619 phy_power_off(dsi->phy);
620 err_prepare_power:
621 if (dsi->panel) {
> 622 if (drm_panel_unprepare_power(dsi->panel))
623 DRM_INFO("Can't unprepare power the panel\n");
624 }
625 dsi->refcount--;
626 return ret;
627 }
628
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 71982 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20191108/950c54ea/attachment-0001.gz>
More information about the dri-devel
mailing list