Commit eab007dd authored by Dave Airlie's avatar Dave Airlie

Merge tag 'drm-misc-fixes-2019-05-22' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes

- sun4i fixes to hdmi phy as well as u16 overflow in dsi (left from -next-fixes)
- gma500 fix to make lvds detection more reliable
- select devfreq for panfrost since it can't probe without it
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>

From: Sean Paul <sean@poorly.run>
Link: https://patchwork.freedesktop.org/patch/msgid/20190522194440.GA22359@art_vandelay
parents 27e248c4 f3617b44
...@@ -594,6 +594,9 @@ void cdv_intel_lvds_init(struct drm_device *dev, ...@@ -594,6 +594,9 @@ void cdv_intel_lvds_init(struct drm_device *dev,
int pipe; int pipe;
u8 pin; u8 pin;
if (!dev_priv->lvds_enabled_in_vbt)
return;
pin = GMBUS_PORT_PANEL; pin = GMBUS_PORT_PANEL;
if (!lvds_is_present_in_vbt(dev, &pin)) { if (!lvds_is_present_in_vbt(dev, &pin)) {
DRM_DEBUG_KMS("LVDS is not present in VBT\n"); DRM_DEBUG_KMS("LVDS is not present in VBT\n");
......
...@@ -436,6 +436,9 @@ parse_driver_features(struct drm_psb_private *dev_priv, ...@@ -436,6 +436,9 @@ parse_driver_features(struct drm_psb_private *dev_priv,
if (driver->lvds_config == BDB_DRIVER_FEATURE_EDP) if (driver->lvds_config == BDB_DRIVER_FEATURE_EDP)
dev_priv->edp.support = 1; dev_priv->edp.support = 1;
dev_priv->lvds_enabled_in_vbt = driver->lvds_config != 0;
DRM_DEBUG_KMS("LVDS VBT config bits: 0x%x\n", driver->lvds_config);
/* This bit means to use 96Mhz for DPLL_A or not */ /* This bit means to use 96Mhz for DPLL_A or not */
if (driver->primary_lfp_id) if (driver->primary_lfp_id)
dev_priv->dplla_96mhz = true; dev_priv->dplla_96mhz = true;
......
...@@ -537,6 +537,7 @@ struct drm_psb_private { ...@@ -537,6 +537,7 @@ struct drm_psb_private {
int lvds_ssc_freq; int lvds_ssc_freq;
bool is_lvds_on; bool is_lvds_on;
bool is_mipi_on; bool is_mipi_on;
bool lvds_enabled_in_vbt;
u32 mipi_ctrl_display; u32 mipi_ctrl_display;
unsigned int core_freq; unsigned int core_freq;
......
...@@ -9,6 +9,7 @@ config DRM_PANFROST ...@@ -9,6 +9,7 @@ config DRM_PANFROST
select IOMMU_SUPPORT select IOMMU_SUPPORT
select IOMMU_IO_PGTABLE_LPAE select IOMMU_IO_PGTABLE_LPAE
select DRM_GEM_SHMEM_HELPER select DRM_GEM_SHMEM_HELPER
select PM_DEVFREQ
help help
DRM driver for ARM Mali Midgard (T6xx, T7xx, T8xx) and DRM driver for ARM Mali Midgard (T6xx, T7xx, T8xx) and
Bifrost (G3x, G5x, G7x) GPUs. Bifrost (G3x, G5x, G7x) GPUs.
...@@ -140,8 +140,8 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev) ...@@ -140,8 +140,8 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev)
return 0; return 0;
ret = dev_pm_opp_of_add_table(&pfdev->pdev->dev); ret = dev_pm_opp_of_add_table(&pfdev->pdev->dev);
if (ret == -ENODEV) /* Optional, continue without devfreq */ if (ret)
return 0; return ret;
panfrost_devfreq_reset(pfdev); panfrost_devfreq_reset(pfdev);
...@@ -170,9 +170,6 @@ void panfrost_devfreq_resume(struct panfrost_device *pfdev) ...@@ -170,9 +170,6 @@ void panfrost_devfreq_resume(struct panfrost_device *pfdev)
{ {
int i; int i;
if (!pfdev->devfreq.devfreq)
return;
panfrost_devfreq_reset(pfdev); panfrost_devfreq_reset(pfdev);
for (i = 0; i < NUM_JOB_SLOTS; i++) for (i = 0; i < NUM_JOB_SLOTS; i++)
pfdev->devfreq.slot[i].busy = false; pfdev->devfreq.slot[i].busy = false;
...@@ -182,9 +179,6 @@ void panfrost_devfreq_resume(struct panfrost_device *pfdev) ...@@ -182,9 +179,6 @@ void panfrost_devfreq_resume(struct panfrost_device *pfdev)
void panfrost_devfreq_suspend(struct panfrost_device *pfdev) void panfrost_devfreq_suspend(struct panfrost_device *pfdev)
{ {
if (!pfdev->devfreq.devfreq)
return;
devfreq_suspend_device(pfdev->devfreq.devfreq); devfreq_suspend_device(pfdev->devfreq.devfreq);
} }
...@@ -194,9 +188,6 @@ static void panfrost_devfreq_update_utilization(struct panfrost_device *pfdev, i ...@@ -194,9 +188,6 @@ static void panfrost_devfreq_update_utilization(struct panfrost_device *pfdev, i
ktime_t now; ktime_t now;
ktime_t last; ktime_t last;
if (!pfdev->devfreq.devfreq)
return;
now = ktime_get(); now = ktime_get();
last = pfdev->devfreq.slot[slot].time_last_update; last = pfdev->devfreq.slot[slot].time_last_update;
......
...@@ -457,8 +457,9 @@ static void sun6i_dsi_setup_inst_loop(struct sun6i_dsi *dsi, ...@@ -457,8 +457,9 @@ static void sun6i_dsi_setup_inst_loop(struct sun6i_dsi *dsi,
u16 delay = 50 - 1; u16 delay = 50 - 1;
if (device->mode_flags & MIPI_DSI_MODE_VIDEO_BURST) { if (device->mode_flags & MIPI_DSI_MODE_VIDEO_BURST) {
delay = (mode->htotal - mode->hdisplay) * 150; u32 hsync_porch = (mode->htotal - mode->hdisplay) * 150;
delay /= (mode->clock / 1000) * 8;
delay = (hsync_porch / ((mode->clock / 1000) * 8));
delay -= 50; delay -= 50;
} }
......
...@@ -293,7 +293,8 @@ static int sun8i_hdmi_phy_config_h3(struct dw_hdmi *hdmi, ...@@ -293,7 +293,8 @@ static int sun8i_hdmi_phy_config_h3(struct dw_hdmi *hdmi,
SUN8I_HDMI_PHY_ANA_CFG2_REG_BIGSW | SUN8I_HDMI_PHY_ANA_CFG2_REG_BIGSW |
SUN8I_HDMI_PHY_ANA_CFG2_REG_SLV(4); SUN8I_HDMI_PHY_ANA_CFG2_REG_SLV(4);
ana_cfg3_init |= SUN8I_HDMI_PHY_ANA_CFG3_REG_AMPCK(9) | ana_cfg3_init |= SUN8I_HDMI_PHY_ANA_CFG3_REG_AMPCK(9) |
SUN8I_HDMI_PHY_ANA_CFG3_REG_AMP(13); SUN8I_HDMI_PHY_ANA_CFG3_REG_AMP(13) |
SUN8I_HDMI_PHY_ANA_CFG3_REG_EMP(3);
} }
regmap_update_bits(phy->regs, SUN8I_HDMI_PHY_ANA_CFG1_REG, regmap_update_bits(phy->regs, SUN8I_HDMI_PHY_ANA_CFG1_REG,
...@@ -672,22 +673,13 @@ int sun8i_hdmi_phy_probe(struct sun8i_dw_hdmi *hdmi, struct device_node *node) ...@@ -672,22 +673,13 @@ int sun8i_hdmi_phy_probe(struct sun8i_dw_hdmi *hdmi, struct device_node *node)
goto err_put_clk_pll0; goto err_put_clk_pll0;
} }
} }
ret = sun8i_phy_clk_create(phy, dev,
phy->variant->has_second_pll);
if (ret) {
dev_err(dev, "Couldn't create the PHY clock\n");
goto err_put_clk_pll1;
}
clk_prepare_enable(phy->clk_phy);
} }
phy->rst_phy = of_reset_control_get_shared(node, "phy"); phy->rst_phy = of_reset_control_get_shared(node, "phy");
if (IS_ERR(phy->rst_phy)) { if (IS_ERR(phy->rst_phy)) {
dev_err(dev, "Could not get phy reset control\n"); dev_err(dev, "Could not get phy reset control\n");
ret = PTR_ERR(phy->rst_phy); ret = PTR_ERR(phy->rst_phy);
goto err_disable_clk_phy; goto err_put_clk_pll1;
} }
ret = reset_control_deassert(phy->rst_phy); ret = reset_control_deassert(phy->rst_phy);
...@@ -708,18 +700,29 @@ int sun8i_hdmi_phy_probe(struct sun8i_dw_hdmi *hdmi, struct device_node *node) ...@@ -708,18 +700,29 @@ int sun8i_hdmi_phy_probe(struct sun8i_dw_hdmi *hdmi, struct device_node *node)
goto err_disable_clk_bus; goto err_disable_clk_bus;
} }
if (phy->variant->has_phy_clk) {
ret = sun8i_phy_clk_create(phy, dev,
phy->variant->has_second_pll);
if (ret) {
dev_err(dev, "Couldn't create the PHY clock\n");
goto err_disable_clk_mod;
}
clk_prepare_enable(phy->clk_phy);
}
hdmi->phy = phy; hdmi->phy = phy;
return 0; return 0;
err_disable_clk_mod:
clk_disable_unprepare(phy->clk_mod);
err_disable_clk_bus: err_disable_clk_bus:
clk_disable_unprepare(phy->clk_bus); clk_disable_unprepare(phy->clk_bus);
err_deassert_rst_phy: err_deassert_rst_phy:
reset_control_assert(phy->rst_phy); reset_control_assert(phy->rst_phy);
err_put_rst_phy: err_put_rst_phy:
reset_control_put(phy->rst_phy); reset_control_put(phy->rst_phy);
err_disable_clk_phy:
clk_disable_unprepare(phy->clk_phy);
err_put_clk_pll1: err_put_clk_pll1:
clk_put(phy->clk_pll1); clk_put(phy->clk_pll1);
err_put_clk_pll0: err_put_clk_pll0:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment