Commit 988dbd25 authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge tag 'du-next-20210728' of git://linuxtv.org/pinchartl/media into drm-next



- R-Car DU shutdown fixes
- R-Car DU conversion to bridge connector helper
- Misc small fixes

Signed-off-by: default avatarDave Airlie <airlied@redhat.com>

From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/YQGHjOSOw2G4+A3x@pendragon.ideasonboard.com
parents 15d27b15 6571a76a
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
@@ -1583,7 +1583,6 @@ static int analogix_dp_create_bridge(struct drm_device *drm_dev,
				     struct analogix_dp_device *dp)
{
	struct drm_bridge *bridge;
	int ret;

	bridge = devm_kzalloc(drm_dev->dev, sizeof(*bridge), GFP_KERNEL);
	if (!bridge) {
@@ -1596,13 +1595,7 @@ static int analogix_dp_create_bridge(struct drm_device *drm_dev,
	bridge->driver_private = dp;
	bridge->funcs = &analogix_dp_bridge_funcs;

	ret = drm_bridge_attach(dp->encoder, bridge, NULL, 0);
	if (ret) {
		DRM_ERROR("failed to attach drm bridge\n");
		return -EINVAL;
	}

	return 0;
	return drm_bridge_attach(dp->encoder, bridge, NULL, 0);
}

static int analogix_dp_dt_parse_pdata(struct analogix_dp_device *dp)
+1 −4
Original line number Diff line number Diff line
@@ -1359,12 +1359,9 @@ static int anx7625_bridge_attach(struct drm_bridge *bridge,
		err = drm_bridge_attach(bridge->encoder,
					ctx->pdata.panel_bridge,
					&ctx->bridge, flags);
		if (err) {
			DRM_DEV_ERROR(dev,
				      "Fail to attach panel bridge: %d\n", err);
		if (err)
			return err;
	}
	}

	ctx->bridge_attached = 1;

+53 −2
Original line number Diff line number Diff line
@@ -143,6 +143,7 @@ struct dw_hdmi_phy_data {
struct dw_hdmi {
	struct drm_connector connector;
	struct drm_bridge bridge;
	struct drm_bridge *next_bridge;

	unsigned int version;

@@ -2775,7 +2776,8 @@ static int dw_hdmi_bridge_attach(struct drm_bridge *bridge,
	struct dw_hdmi *hdmi = bridge->driver_private;

	if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)
		return 0;
		return drm_bridge_attach(bridge->encoder, hdmi->next_bridge,
					 bridge, flags);

	return dw_hdmi_connector_create(hdmi);
}
@@ -3160,6 +3162,52 @@ static void dw_hdmi_init_hw(struct dw_hdmi *hdmi)
/* -----------------------------------------------------------------------------
 * Probe/remove API, used from platforms based on the DRM bridge API.
 */

static int dw_hdmi_parse_dt(struct dw_hdmi *hdmi)
{
	struct device_node *endpoint;
	struct device_node *remote;

	if (!hdmi->plat_data->output_port)
		return 0;

	endpoint = of_graph_get_endpoint_by_regs(hdmi->dev->of_node,
						 hdmi->plat_data->output_port,
						 -1);
	if (!endpoint) {
		/*
		 * On platforms whose bindings don't make the output port
		 * mandatory (such as Rockchip) the plat_data->output_port
		 * field isn't set, so it's safe to make this a fatal error.
		 */
		dev_err(hdmi->dev, "Missing endpoint in port@%u\n",
			hdmi->plat_data->output_port);
		return -ENODEV;
	}

	remote = of_graph_get_remote_port_parent(endpoint);
	of_node_put(endpoint);
	if (!remote) {
		dev_err(hdmi->dev, "Endpoint in port@%u unconnected\n",
			hdmi->plat_data->output_port);
		return -ENODEV;
	}

	if (!of_device_is_available(remote)) {
		dev_err(hdmi->dev, "port@%u remote device is disabled\n",
			hdmi->plat_data->output_port);
		of_node_put(remote);
		return -ENODEV;
	}

	hdmi->next_bridge = of_drm_find_bridge(remote);
	of_node_put(remote);
	if (!hdmi->next_bridge)
		return -EPROBE_DEFER;

	return 0;
}

struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev,
			      const struct dw_hdmi_plat_data *plat_data)
{
@@ -3196,6 +3244,10 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev,
	mutex_init(&hdmi->cec_notifier_mutex);
	spin_lock_init(&hdmi->audio_lock);

	ret = dw_hdmi_parse_dt(hdmi);
	if (ret < 0)
		return ERR_PTR(ret);

	ddc_node = of_parse_phandle(np, "ddc-i2c-bus", 0);
	if (ddc_node) {
		hdmi->ddc = of_get_i2c_adapter_by_node(ddc_node);
@@ -3474,7 +3526,6 @@ struct dw_hdmi *dw_hdmi_bind(struct platform_device *pdev,
	ret = drm_bridge_attach(encoder, &hdmi->bridge, NULL, 0);
	if (ret) {
		dw_hdmi_remove(hdmi);
		DRM_ERROR("Failed to initialize bridge with drm\n");
		return ERR_PTR(ret);
	}

+1 −9
Original line number Diff line number Diff line
@@ -1229,15 +1229,7 @@ EXPORT_SYMBOL_GPL(dw_mipi_dsi_remove);
 */
int dw_mipi_dsi_bind(struct dw_mipi_dsi *dsi, struct drm_encoder *encoder)
{
	int ret;

	ret = drm_bridge_attach(encoder, &dsi->bridge, NULL, 0);
	if (ret) {
		DRM_ERROR("Failed to initialize bridge with drm\n");
		return ret;
	}

	return ret;
	return drm_bridge_attach(encoder, &dsi->bridge, NULL, 0);
}
EXPORT_SYMBOL_GPL(dw_mipi_dsi_bind);

+1 −1
Original line number Diff line number Diff line
@@ -291,7 +291,7 @@ static int tc358768_calc_pll(struct tc358768_priv *priv,
			     const struct drm_display_mode *mode,
			     bool verify_only)
{
	const u32 frs_limits[] = {
	static const u32 frs_limits[] = {
		1000000000,
		500000000,
		250000000,
Loading