linux_dsm_epyc7002/drivers/gpu/drm/msm/dsi
Stephan Gerhold e5400750fa drm/msm/dsi: Delay drm_panel_enable() until dsi_mgr_bridge_enable()
At the moment, the MSM DSI driver calls drm_panel_enable() rather early
from the DSI bridge pre_enable() function. At this point, the encoder
(e.g. MDP5) is not enabled, so we have not started transmitting
video data.

However, the drm_panel_funcs documentation states that enable()
should be called on the panel *after* video data is being transmitted:

  The .prepare() function is typically called before the display controller
  starts to transmit video data. [...] After the display controller has
  started transmitting video data, it's safe to call the .enable() function.
  This will typically enable the backlight to make the image on screen visible.

Calling drm_panel_enable() too early causes problems for some panels:
The TFT LCD panel used in the Samsung Galaxy Tab A 9.7 (2015) (APQ8016)
uses the MIPI_DCS_SET_DISPLAY_BRIGHTNESS command to control
backlight/brightness of the screen. The enable sequence is therefore:

  drm_panel_enable()
    drm_panel_funcs.enable():
      backlight_enable()
        backlight_ops.update_status():
          mipi_dsi_dcs_set_display_brightness(dsi, bl->props.brightness);

The panel seems to silently ignore the MIPI_DCS_SET_DISPLAY_BRIGHTNESS
command if it is sent too early. This prevents setting the initial brightness,
causing the display to be enabled with minimum brightness instead.
Adding various delays in the panel initialization code does not result
in any difference.

On the other hand, moving drm_panel_enable() to dsi_mgr_bridge_enable()
fixes the problem, indicating that the panel requires the video stream
to be active before the brightness command is accepted.

Therefore: Move drm_panel_enable() to dsi_mgr_bridge_enable() to
delay calling it until video data is being transmitted.

Move drm_panel_disable() to dsi_mgr_bridge_disable() for similar reasons.
(This is not strictly required for the panel affected above...)

Tested-by: Jasper Korten <jja2000@gmail.com>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Tested-by: Jeffrey Hugo <jeffrey.l.hugo@gmail.com>
Reviewed-by: Jeffrey Hugo <jeffrey.l.hugo@gmail.com>
Signed-off-by: Rob Clark <robdclark@chromium.org>
2020-01-02 16:01:30 -08:00
..
phy drm/msm/dsi: Add configuration for 28nm PLL on family B 2019-11-04 13:17:42 -08:00
pll drm/msm: drop use of drmP.h 2019-09-03 16:16:57 -07:00
dsi_cfg.c drm/msm/dsi: Add configuration for 8x76 2019-11-04 13:18:31 -08:00
dsi_cfg.h drm/msm/dsi: Add configuration for 8x76 2019-11-04 13:18:31 -08:00
dsi_host.c Merge tag 'drm-msm-next-2019-11-05' of https://gitlab.freedesktop.org/drm/msm into drm-next 2019-12-02 10:21:12 +10:00
dsi_manager.c drm/msm/dsi: Delay drm_panel_enable() until dsi_mgr_bridge_enable() 2020-01-02 16:01:30 -08:00
dsi.c Merge tag 'drm-msm-next-2019-06-25' of https://gitlab.freedesktop.org/drm/msm into drm-next 2019-06-28 10:16:40 +10:00
dsi.h drm: Stop including drm_bridge.h from drm_crtc.h 2019-08-28 22:11:03 +02:00
dsi.xml.h drm/msm: update generated headers 2018-08-10 18:49:18 -04:00
mmss_cc.xml.h drm/msm: update generated headers 2018-08-10 18:49:18 -04:00
sfpb.xml.h drm/msm: update generated headers 2018-08-10 18:49:18 -04:00