Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4d0982c6 authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge branch 'drm-next0401' of git://github.com/markyzq/kernel-drm-rockchip into drm-next

   These are based on drm-next branch, fix some drm/rockchip problem.
   Please pull them.

* 'drm-next0401' of git://github.com/markyzq/kernel-drm-rockchip:
  drm/rockchip: vop: add vop power domain support
  drm: rockchip: Turn off VT switching on suspend
  drm/rockchip: register all connectors after bind
  drm/rockchip: fix clk enable disable mismatch in vop_crtc_mode_set
parents 502e95c6 5d82d1a7
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -129,6 +129,7 @@ static int rockchip_drm_load(struct drm_device *drm_dev, unsigned long flags)
	struct rockchip_drm_private *private;
	struct dma_iommu_mapping *mapping;
	struct device *dev = drm_dev->dev;
	struct drm_connector *connector;
	int ret;

	private = devm_kzalloc(drm_dev->dev, sizeof(*private), GFP_KERNEL);
@@ -171,6 +172,23 @@ static int rockchip_drm_load(struct drm_device *drm_dev, unsigned long flags)
	if (ret)
		goto err_detach_device;

	/*
	 * All components are now added, we can publish the connector sysfs
	 * entries to userspace.  This will generate hotplug events and so
	 * userspace will expect to be able to access DRM at this point.
	 */
	list_for_each_entry(connector, &drm_dev->mode_config.connector_list,
			head) {
		ret = drm_connector_register(connector);
		if (ret) {
			dev_err(drm_dev->dev,
				"[CONNECTOR:%d:%s] drm_connector_register failed: %d\n",
				connector->base.id,
				connector->name, ret);
			goto err_unbind;
		}
	}

	/* init kms poll for handling hpd */
	drm_kms_helper_poll_init(drm_dev);

@@ -200,6 +218,7 @@ static int rockchip_drm_load(struct drm_device *drm_dev, unsigned long flags)
	drm_vblank_cleanup(drm_dev);
err_kms_helper_poll_fini:
	drm_kms_helper_poll_fini(drm_dev);
err_unbind:
	component_unbind_all(dev, drm_dev);
err_detach_device:
	arm_iommu_detach_device(dev);
+3 −0
Original line number Diff line number Diff line
@@ -119,6 +119,9 @@ static int rockchip_drm_fbdev_create(struct drm_fb_helper *helper,
	DRM_DEBUG_KMS("FB [%dx%d]-%d kvaddr=%p offset=%ld size=%d\n",
		      fb->width, fb->height, fb->depth, rk_obj->kvaddr,
		      offset, size);

	fbi->skip_vt_switch = true;

	return 0;

err_drm_framebuffer_unref:
+17 −8
Original line number Diff line number Diff line
@@ -421,6 +421,12 @@ static void vop_enable(struct drm_crtc *crtc)
	if (vop->is_enabled)
		return;

	ret = pm_runtime_get_sync(vop->dev);
	if (ret < 0) {
		dev_err(vop->dev, "failed to get pm runtime: %d\n", ret);
		return;
	}

	ret = clk_enable(vop->hclk);
	if (ret < 0) {
		dev_err(vop->dev, "failed to enable hclk - %d\n", ret);
@@ -517,6 +523,7 @@ static void vop_disable(struct drm_crtc *crtc)
	clk_disable(vop->dclk);
	clk_disable(vop->aclk);
	clk_disable(vop->hclk);
	pm_runtime_put(vop->dev);
}

/*
@@ -893,7 +900,7 @@ static int vop_crtc_mode_set(struct drm_crtc *crtc,
	u16 vsync_len = adjusted_mode->vsync_end - adjusted_mode->vsync_start;
	u16 vact_st = adjusted_mode->vtotal - adjusted_mode->vsync_start;
	u16 vact_end = vact_st + vdisplay;
	int ret;
	int ret, ret_clk;
	uint32_t val;

	/*
@@ -915,7 +922,8 @@ static int vop_crtc_mode_set(struct drm_crtc *crtc,
	default:
		DRM_ERROR("unsupport connector_type[%d]\n",
			  vop->connector_type);
		return -EINVAL;
		ret = -EINVAL;
		goto out;
	};
	VOP_CTRL_SET(vop, out_mode, vop->connector_out_mode);

@@ -938,7 +946,7 @@ static int vop_crtc_mode_set(struct drm_crtc *crtc,

	ret = vop_crtc_mode_set_base(crtc, x, y, fb);
	if (ret)
		return ret;
		goto out;

	/*
	 * reset dclk, take all mode config affect, so the clk would run in
@@ -949,13 +957,14 @@ static int vop_crtc_mode_set(struct drm_crtc *crtc,
	reset_control_deassert(vop->dclk_rst);

	clk_set_rate(vop->dclk, adjusted_mode->clock * 1000);
	ret = clk_enable(vop->dclk);
	if (ret < 0) {
		dev_err(vop->dev, "failed to enable dclk - %d\n", ret);
		return ret;
out:
	ret_clk = clk_enable(vop->dclk);
	if (ret_clk < 0) {
		dev_err(vop->dev, "failed to enable dclk - %d\n", ret_clk);
		return ret_clk;
	}

	return 0;
	return ret;
}

static void vop_crtc_commit(struct drm_crtc *crtc)