diff mbox series

[v4,2/7] drm/msm/dsi: add three helper functions

Message ID 20210717124016.316020-3-dmitry.baryshkov@linaro.org
State New
Headers show
Series drm/msm/dpu: add support for independent DSI config | expand

Commit Message

Dmitry Baryshkov July 17, 2021, 12:40 p.m. UTC
Add three helper functions to be used by display drivers for setting up
encoders.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

Reviewed-by: Abhinav Kumar <abhinavk@codeaurora.org>

---
 drivers/gpu/drm/msm/dsi/dsi.c         |  7 +++++++
 drivers/gpu/drm/msm/dsi/dsi_manager.c | 19 +++++++++++--------
 drivers/gpu/drm/msm/msm_drv.h         | 17 +++++++++++++++--
 3 files changed, 33 insertions(+), 10 deletions(-)

-- 
2.30.2

Comments

kernel test robot July 19, 2021, 10:31 a.m. UTC | #1
Hi Dmitry,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v5.14-rc2 next-20210716]
[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/Dmitry-Baryshkov/drm-msm-dpu-add-support-for-independent-DSI-config/20210718-094538
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git d936eb23874433caa3e3d841cfa16f5434b85dcf
config: arm64-randconfig-p002-20210719 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 10.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
        # https://github.com/0day-ci/linux/commit/ea28949dc5d332496016a7d53a45015fda469e23
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Dmitry-Baryshkov/drm-msm-dpu-add-support-for-independent-DSI-config/20210718-094538
        git checkout ea28949dc5d332496016a7d53a45015fda469e23
        # save the attached .config to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross O=build_dir ARCH=arm64 SHELL=/bin/bash

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

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

   In file included from drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.h:12,
                    from drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c:11:
>> drivers/gpu/drm/msm/msm_drv.h:380:6: warning: no previous prototype for 'msm_dsi_is_master_dsi' [-Wmissing-prototypes]

     380 | bool msm_dsi_is_master_dsi(struct msm_dsi *msm_dsi)
         |      ^~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/msm/msm_drv.h:376:13: warning: 'msm_dsi_is_bonded_dsi' defined but not used [-Wunused-function]
     376 | static bool msm_dsi_is_bonded_dsi(struct msm_dsi *msm_dsi)
         |             ^~~~~~~~~~~~~~~~~~~~~
--
   In file included from drivers/gpu/drm/msm/msm_fence.c:9:
>> drivers/gpu/drm/msm/msm_drv.h:380:6: warning: no previous prototype for 'msm_dsi_is_master_dsi' [-Wmissing-prototypes]

     380 | bool msm_dsi_is_master_dsi(struct msm_dsi *msm_dsi)
         |      ^~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/msm/msm_drv.h:376:13: warning: 'msm_dsi_is_bonded_dsi' defined but not used [-Wunused-function]
     376 | static bool msm_dsi_is_bonded_dsi(struct msm_dsi *msm_dsi)
         |             ^~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/msm/msm_fence.c: In function 'msm_fence_context_alloc':
   drivers/gpu/drm/msm/msm_fence.c:23:2: warning: 'strncpy' specified bound 32 equals destination size [-Wstringop-truncation]
      23 |  strncpy(fctx->name, name, sizeof(fctx->name));
         |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
   aarch64-linux-ld: drivers/gpu/drm/msm/adreno/adreno_gpu.o: in function `msm_dsi_is_master_dsi':
>> adreno_gpu.c:(.text+0x440): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here

   aarch64-linux-ld: drivers/gpu/drm/msm/adreno/a2xx_gpu.o: in function `msm_dsi_is_master_dsi':
   a2xx_gpu.c:(.text+0xe40): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/adreno/a3xx_gpu.o: in function `msm_dsi_is_master_dsi':
   a3xx_gpu.c:(.text+0x1240): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/adreno/a4xx_gpu.o: in function `msm_dsi_is_master_dsi':
   a4xx_gpu.c:(.text+0x1300): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/adreno/a5xx_gpu.o: in function `msm_dsi_is_master_dsi':
   a5xx_gpu.c:(.text+0x1380): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/adreno/a5xx_power.o: in function `msm_dsi_is_master_dsi':
   a5xx_power.c:(.text+0x740): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/adreno/a5xx_preempt.o: in function `msm_dsi_is_master_dsi':
   a5xx_preempt.c:(.text+0x400): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/adreno/a6xx_gpu.o: in function `msm_dsi_is_master_dsi':
   a6xx_gpu.c:(.text+0x2ac0): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/adreno/a6xx_gmu.o: in function `msm_dsi_is_master_dsi':
   a6xx_gmu.c:(.text+0x19c0): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/adreno/a6xx_hfi.o: in function `msm_dsi_is_master_dsi':
   a6xx_hfi.c:(.text+0xf40): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/hdmi/hdmi.o: in function `msm_dsi_is_master_dsi':
   hdmi.c:(.text+0xbc0): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/hdmi/hdmi_audio.o: in function `msm_dsi_is_master_dsi':
   hdmi_audio.c:(.text+0x0): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/hdmi/hdmi_bridge.o: in function `msm_dsi_is_master_dsi':
   hdmi_bridge.c:(.text+0x840): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/hdmi/hdmi_connector.o: in function `msm_dsi_is_master_dsi':
   hdmi_connector.c:(.text+0x800): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/hdmi/hdmi_i2c.o: in function `msm_dsi_is_master_dsi':
   hdmi_i2c.c:(.text+0x640): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/hdmi/hdmi_phy.o: in function `msm_dsi_is_master_dsi':
   hdmi_phy.c:(.text+0x200): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/hdmi/hdmi_phy_8960.o: in function `msm_dsi_is_master_dsi':
   hdmi_phy_8960.c:(.text+0x180): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/hdmi/hdmi_phy_8x60.o: in function `msm_dsi_is_master_dsi':
   hdmi_phy_8x60.c:(.text+0x240): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/hdmi/hdmi_phy_8x74.o: in function `msm_dsi_is_master_dsi':
   hdmi_phy_8x74.c:(.text+0x100): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/edp/edp.o: in function `msm_dsi_is_master_dsi':
   edp.c:(.text+0x2c0): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/edp/edp_aux.o: in function `msm_dsi_is_master_dsi':
   edp_aux.c:(.text+0x0): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/edp/edp_bridge.o: in function `msm_dsi_is_master_dsi':
   edp_bridge.c:(.text+0x2c0): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/edp/edp_connector.o: in function `msm_dsi_is_master_dsi':
   edp_connector.c:(.text+0x280): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/edp/edp_ctrl.o: in function `msm_dsi_is_master_dsi':
   edp_ctrl.c:(.text+0xe40): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/edp/edp_phy.o: in function `msm_dsi_is_master_dsi':
   edp_phy.c:(.text+0x0): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/disp/mdp_format.o: in function `msm_dsi_is_master_dsi':
   mdp_format.c:(.text+0x0): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/disp/mdp_kms.o: in function `msm_dsi_is_master_dsi':
   mdp_kms.c:(.text+0x300): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.o: in function `msm_dsi_is_master_dsi':
   mdp4_crtc.c:(.text+0x1640): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/disp/mdp4/mdp4_dtv_encoder.o: in function `msm_dsi_is_master_dsi':
   mdp4_dtv_encoder.c:(.text+0x540): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/disp/mdp4/mdp4_lcdc_encoder.o: in function `msm_dsi_is_master_dsi':
   mdp4_lcdc_encoder.c:(.text+0x880): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/disp/mdp4/mdp4_lvds_connector.o: in function `msm_dsi_is_master_dsi':
   mdp4_lvds_connector.c:(.text+0x180): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/disp/mdp4/mdp4_irq.o: in function `msm_dsi_is_master_dsi':
   mdp4_irq.c:(.text+0x100): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.o: in function `msm_dsi_is_master_dsi':
   mdp4_kms.c:(.text+0x900): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.o: in function `msm_dsi_is_master_dsi':
   mdp4_plane.c:(.text+0xac0): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.o: in function `msm_dsi_is_master_dsi':
   mdp5_cfg.c:(.text+0x0): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/disp/mdp5/mdp5_ctl.o: in function `msm_dsi_is_master_dsi':
   mdp5_ctl.c:(.text+0x980): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.o: in function `msm_dsi_is_master_dsi':
   mdp5_crtc.c:(.text+0x44c0): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/disp/mdp5/mdp5_encoder.o: in function `msm_dsi_is_master_dsi':
   mdp5_encoder.c:(.text+0x1b40): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/disp/mdp5/mdp5_irq.o: in function `msm_dsi_is_master_dsi':
   mdp5_irq.c:(.text+0x100): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/disp/mdp5/mdp5_mdss.o: in function `msm_dsi_is_master_dsi':
   mdp5_mdss.c:(.text+0x440): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.o: in function `msm_dsi_is_master_dsi':
   mdp5_kms.c:(.text+0x1dc0): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/disp/mdp5/mdp5_pipe.o: in function `msm_dsi_is_master_dsi':
   mdp5_pipe.c:(.text+0x0): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/disp/mdp5/mdp5_mixer.o: in function `msm_dsi_is_master_dsi':
   mdp5_mixer.c:(.text+0x0): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.o: in function `msm_dsi_is_master_dsi':
   mdp5_plane.c:(.text+0x7ac0): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.o: in function `msm_dsi_is_master_dsi':
   mdp5_smp.c:(.text+0xa80): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/disp/dpu1/dpu_core_irq.o: in function `msm_dsi_is_master_dsi':
   dpu_core_irq.c:(.text+0x240): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.o: in function `msm_dsi_is_master_dsi':
   dpu_core_perf.c:(.text+0x440): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.o: in function `msm_dsi_is_master_dsi':
   dpu_crtc.c:(.text+0x2ec0): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.o: in function `msm_dsi_is_master_dsi':
   dpu_encoder.c:(.text+0x3080): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.o: in function `msm_dsi_is_master_dsi':
   dpu_encoder_phys_cmd.c:(.text+0x1c00): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here
   aarch64-linux-ld: drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.o: in function `msm_dsi_is_master_dsi':
   dpu_encoder_phys_vid.c:(.text+0x18c0): multiple definition of `msm_dsi_is_master_dsi'; drivers/gpu/drm/msm/adreno/adreno_device.o:adreno_device.c:(.text+0x3c0): first defined here

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Bjorn Andersson July 25, 2021, 4:05 a.m. UTC | #2
On Sat 17 Jul 07:40 CDT 2021, Dmitry Baryshkov wrote:

> Add three helper functions to be used by display drivers for setting up
> encoders.
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> Reviewed-by: Abhinav Kumar <abhinavk@codeaurora.org>
> ---
>  drivers/gpu/drm/msm/dsi/dsi.c         |  7 +++++++
>  drivers/gpu/drm/msm/dsi/dsi_manager.c | 19 +++++++++++--------
>  drivers/gpu/drm/msm/msm_drv.h         | 17 +++++++++++++++--
>  3 files changed, 33 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c
> index 75afc12a7b25..5201d7eb0490 100644
> --- a/drivers/gpu/drm/msm/dsi/dsi.c
> +++ b/drivers/gpu/drm/msm/dsi/dsi.c
> @@ -13,6 +13,13 @@ struct drm_encoder *msm_dsi_get_encoder(struct msm_dsi *msm_dsi)
>  	return msm_dsi->encoder;
>  }
>  
> +bool msm_dsi_is_cmd_mode(struct msm_dsi *msm_dsi)
> +{
> +	unsigned long host_flags = msm_dsi_host_get_mode_flags(msm_dsi->host);
> +
> +	return !(host_flags & MIPI_DSI_MODE_VIDEO);
> +}
> +
>  static int dsi_get_phy(struct msm_dsi *msm_dsi)
>  {
>  	struct platform_device *pdev = msm_dsi->pdev;
> diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c
> index b20645ab279b..27d3b9ebf831 100644
> --- a/drivers/gpu/drm/msm/dsi/dsi_manager.c
> +++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c
> @@ -216,12 +216,6 @@ static int dsi_mgr_bridge_get_id(struct drm_bridge *bridge)
>  	return dsi_bridge->id;
>  }
>  
> -static bool dsi_mgr_is_cmd_mode(struct msm_dsi *msm_dsi)
> -{
> -	unsigned long host_flags = msm_dsi_host_get_mode_flags(msm_dsi->host);
> -	return !(host_flags & MIPI_DSI_MODE_VIDEO);
> -}
> -
>  void msm_dsi_manager_setup_encoder(int id)
>  {
>  	struct msm_dsi *msm_dsi = dsi_mgr_get_dsi(id);
> @@ -231,7 +225,7 @@ void msm_dsi_manager_setup_encoder(int id)
>  
>  	if (encoder && kms->funcs->set_encoder_mode)
>  		kms->funcs->set_encoder_mode(kms, encoder,
> -					     dsi_mgr_is_cmd_mode(msm_dsi));
> +					     msm_dsi_is_cmd_mode(msm_dsi));
>  }
>  
>  static int msm_dsi_manager_panel_init(struct drm_connector *conn, u8 id)
> @@ -276,7 +270,7 @@ static int msm_dsi_manager_panel_init(struct drm_connector *conn, u8 id)
>  	if (other_dsi && other_dsi->panel && kms->funcs->set_split_display) {
>  		kms->funcs->set_split_display(kms, master_dsi->encoder,
>  					      slave_dsi->encoder,
> -					      dsi_mgr_is_cmd_mode(msm_dsi));
> +					      msm_dsi_is_cmd_mode(msm_dsi));
>  	}
>  
>  out:
> @@ -839,3 +833,12 @@ void msm_dsi_manager_unregister(struct msm_dsi *msm_dsi)
>  		msm_dsim->dsi[msm_dsi->id] = NULL;
>  }
>  
> +bool msm_dsi_is_bonded_dsi(struct msm_dsi *msm_dsi)
> +{
> +	return IS_BONDED_DSI();
> +}
> +
> +bool msm_dsi_is_master_dsi(struct msm_dsi *msm_dsi)
> +{
> +	return IS_MASTER_DSI_LINK(msm_dsi->id);
> +}
> diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h
> index 1a48a709ffb3..9bfd37855969 100644
> --- a/drivers/gpu/drm/msm/msm_drv.h
> +++ b/drivers/gpu/drm/msm/msm_drv.h
> @@ -350,7 +350,9 @@ void __exit msm_dsi_unregister(void);
>  int msm_dsi_modeset_init(struct msm_dsi *msm_dsi, struct drm_device *dev,
>  			 struct drm_encoder *encoder);
>  void msm_dsi_snapshot(struct msm_disp_state *disp_state, struct msm_dsi *msm_dsi);
> -
> +bool msm_dsi_is_cmd_mode(struct msm_dsi *msm_dsi);
> +bool msm_dsi_is_bonded_dsi(struct msm_dsi *msm_dsi);
> +bool msm_dsi_is_master_dsi(struct msm_dsi *msm_dsi);
>  #else
>  static inline void __init msm_dsi_register(void)
>  {
> @@ -367,7 +369,18 @@ static inline int msm_dsi_modeset_init(struct msm_dsi *msm_dsi,
>  static inline void msm_dsi_snapshot(struct msm_disp_state *disp_state, struct msm_dsi *msm_dsi)
>  {
>  }
> -
> +static inline bool msm_dsi_is_cmd_mode(struct msm_dsi *msm_dsi)
> +{
> +	return false;
> +}
> +static bool msm_dsi_is_bonded_dsi(struct msm_dsi *msm_dsi)

Missing "inline"

> +{
> +	return false;
> +}
> +bool msm_dsi_is_master_dsi(struct msm_dsi *msm_dsi)

Same.

Looks good otherwise!

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

Regards,
Bjorn

> +{
> +	return false;
> +}
>  #endif
>  
>  #ifdef CONFIG_DRM_MSM_DP
> -- 
> 2.30.2
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c
index 75afc12a7b25..5201d7eb0490 100644
--- a/drivers/gpu/drm/msm/dsi/dsi.c
+++ b/drivers/gpu/drm/msm/dsi/dsi.c
@@ -13,6 +13,13 @@  struct drm_encoder *msm_dsi_get_encoder(struct msm_dsi *msm_dsi)
 	return msm_dsi->encoder;
 }
 
+bool msm_dsi_is_cmd_mode(struct msm_dsi *msm_dsi)
+{
+	unsigned long host_flags = msm_dsi_host_get_mode_flags(msm_dsi->host);
+
+	return !(host_flags & MIPI_DSI_MODE_VIDEO);
+}
+
 static int dsi_get_phy(struct msm_dsi *msm_dsi)
 {
 	struct platform_device *pdev = msm_dsi->pdev;
diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c
index b20645ab279b..27d3b9ebf831 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_manager.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c
@@ -216,12 +216,6 @@  static int dsi_mgr_bridge_get_id(struct drm_bridge *bridge)
 	return dsi_bridge->id;
 }
 
-static bool dsi_mgr_is_cmd_mode(struct msm_dsi *msm_dsi)
-{
-	unsigned long host_flags = msm_dsi_host_get_mode_flags(msm_dsi->host);
-	return !(host_flags & MIPI_DSI_MODE_VIDEO);
-}
-
 void msm_dsi_manager_setup_encoder(int id)
 {
 	struct msm_dsi *msm_dsi = dsi_mgr_get_dsi(id);
@@ -231,7 +225,7 @@  void msm_dsi_manager_setup_encoder(int id)
 
 	if (encoder && kms->funcs->set_encoder_mode)
 		kms->funcs->set_encoder_mode(kms, encoder,
-					     dsi_mgr_is_cmd_mode(msm_dsi));
+					     msm_dsi_is_cmd_mode(msm_dsi));
 }
 
 static int msm_dsi_manager_panel_init(struct drm_connector *conn, u8 id)
@@ -276,7 +270,7 @@  static int msm_dsi_manager_panel_init(struct drm_connector *conn, u8 id)
 	if (other_dsi && other_dsi->panel && kms->funcs->set_split_display) {
 		kms->funcs->set_split_display(kms, master_dsi->encoder,
 					      slave_dsi->encoder,
-					      dsi_mgr_is_cmd_mode(msm_dsi));
+					      msm_dsi_is_cmd_mode(msm_dsi));
 	}
 
 out:
@@ -839,3 +833,12 @@  void msm_dsi_manager_unregister(struct msm_dsi *msm_dsi)
 		msm_dsim->dsi[msm_dsi->id] = NULL;
 }
 
+bool msm_dsi_is_bonded_dsi(struct msm_dsi *msm_dsi)
+{
+	return IS_BONDED_DSI();
+}
+
+bool msm_dsi_is_master_dsi(struct msm_dsi *msm_dsi)
+{
+	return IS_MASTER_DSI_LINK(msm_dsi->id);
+}
diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h
index 1a48a709ffb3..9bfd37855969 100644
--- a/drivers/gpu/drm/msm/msm_drv.h
+++ b/drivers/gpu/drm/msm/msm_drv.h
@@ -350,7 +350,9 @@  void __exit msm_dsi_unregister(void);
 int msm_dsi_modeset_init(struct msm_dsi *msm_dsi, struct drm_device *dev,
 			 struct drm_encoder *encoder);
 void msm_dsi_snapshot(struct msm_disp_state *disp_state, struct msm_dsi *msm_dsi);
-
+bool msm_dsi_is_cmd_mode(struct msm_dsi *msm_dsi);
+bool msm_dsi_is_bonded_dsi(struct msm_dsi *msm_dsi);
+bool msm_dsi_is_master_dsi(struct msm_dsi *msm_dsi);
 #else
 static inline void __init msm_dsi_register(void)
 {
@@ -367,7 +369,18 @@  static inline int msm_dsi_modeset_init(struct msm_dsi *msm_dsi,
 static inline void msm_dsi_snapshot(struct msm_disp_state *disp_state, struct msm_dsi *msm_dsi)
 {
 }
-
+static inline bool msm_dsi_is_cmd_mode(struct msm_dsi *msm_dsi)
+{
+	return false;
+}
+static bool msm_dsi_is_bonded_dsi(struct msm_dsi *msm_dsi)
+{
+	return false;
+}
+bool msm_dsi_is_master_dsi(struct msm_dsi *msm_dsi)
+{
+	return false;
+}
 #endif
 
 #ifdef CONFIG_DRM_MSM_DP