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

Commit 18eb2f6e authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge tag 'drm-hisilicon-next-2018-09-26' of github.com:xin3liang/linux into drm-next



- A crash fix founded in recent linux-next from John Garry
- One sparse warning fix from Souptick Joarder
- Some xxx_unref cleanup from Thomas Zimmermann

Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
From: Xinliang Liu <xinliang.liu@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/CAGd==04mXPMjVZ3=cM8r+DSQNM6zy7Anc4T2OsHjZgSsazBTPQ@mail.gmail.com
parents 2e240bee c932c4f8
Loading
Loading
Loading
Loading
+6 −20
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ static const struct file_operations hibmc_fops = {
	.llseek		= no_llseek,
};

irqreturn_t hibmc_drm_interrupt(int irq, void *arg)
static irqreturn_t hibmc_drm_interrupt(int irq, void *arg)
{
	struct drm_device *dev = (struct drm_device *)arg;
	struct hibmc_drm_private *priv =
@@ -74,30 +74,16 @@ static int __maybe_unused hibmc_pm_suspend(struct device *dev)
{
	struct pci_dev *pdev = to_pci_dev(dev);
	struct drm_device *drm_dev = pci_get_drvdata(pdev);
	struct hibmc_drm_private *priv = drm_dev->dev_private;

	drm_kms_helper_poll_disable(drm_dev);
	priv->suspend_state = drm_atomic_helper_suspend(drm_dev);
	if (IS_ERR(priv->suspend_state)) {
		DRM_ERROR("drm_atomic_helper_suspend failed: %ld\n",
			  PTR_ERR(priv->suspend_state));
		drm_kms_helper_poll_enable(drm_dev);
		return PTR_ERR(priv->suspend_state);
	}

	return 0;
	return drm_mode_config_helper_suspend(drm_dev);
}

static int  __maybe_unused hibmc_pm_resume(struct device *dev)
{
	struct pci_dev *pdev = to_pci_dev(dev);
	struct drm_device *drm_dev = pci_get_drvdata(pdev);
	struct hibmc_drm_private *priv = drm_dev->dev_private;

	drm_atomic_helper_resume(drm_dev, priv->suspend_state);
	drm_kms_helper_poll_enable(drm_dev);

	return 0;
	return drm_mode_config_helper_resume(drm_dev);
}

static const struct dev_pm_ops hibmc_pm_ops = {
@@ -387,7 +373,7 @@ static int hibmc_pci_probe(struct pci_dev *pdev,
err_disable:
	pci_disable_device(pdev);
err_free:
	drm_dev_unref(dev);
	drm_dev_put(dev);

	return ret;
}
@@ -398,11 +384,11 @@ static void hibmc_pci_remove(struct pci_dev *pdev)

	drm_dev_unregister(dev);
	hibmc_unload(dev);
	drm_dev_unref(dev);
	drm_dev_put(dev);
}

static struct pci_device_id hibmc_pci_table[] = {
	{0x19e5, 0x1711, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
	{ PCI_VDEVICE(HUAWEI, 0x1711) },
	{0,}
};

+0 −1
Original line number Diff line number Diff line
@@ -47,7 +47,6 @@ struct hibmc_drm_private {
	/* drm */
	struct drm_device  *dev;
	bool mode_config_initialized;
	struct drm_atomic_state *suspend_state;

	/* ttm */
	struct drm_global_reference mem_global_ref;
+1 −1
Original line number Diff line number Diff line
@@ -71,7 +71,6 @@ static int hibmc_drm_fb_create(struct drm_fb_helper *helper,
	DRM_DEBUG_DRIVER("surface width(%d), height(%d) and bpp(%d)\n",
			 sizes->surface_width, sizes->surface_height,
			 sizes->surface_bpp);
	sizes->surface_depth = 32;

	bytes_per_pixel = DIV_ROUND_UP(sizes->surface_bpp, 8);

@@ -122,6 +121,7 @@ static int hibmc_drm_fb_create(struct drm_fb_helper *helper,
	hi_fbdev->fb = hibmc_framebuffer_init(priv->dev, &mode_cmd, gobj);
	if (IS_ERR(hi_fbdev->fb)) {
		ret = PTR_ERR(hi_fbdev->fb);
		hi_fbdev->fb = NULL;
		DRM_ERROR("failed to initialize framebuffer: %d\n", ret);
		goto out_release_fbi;
	}
+1 −1
Original line number Diff line number Diff line
@@ -283,7 +283,7 @@ static void hibmc_bo_unref(struct hibmc_bo **bo)
		return;

	tbo = &((*bo)->bo);
	ttm_bo_unref(&tbo);
	ttm_bo_put(tbo);
	*bo = NULL;
}

+4 −4
Original line number Diff line number Diff line
@@ -193,7 +193,7 @@ static int kirin_drm_bind(struct device *dev)

	ret = kirin_drm_kms_init(drm_dev);
	if (ret)
		goto err_drm_dev_unref;
		goto err_drm_dev_put;

	ret = drm_dev_register(drm_dev, 0);
	if (ret)
@@ -203,8 +203,8 @@ static int kirin_drm_bind(struct device *dev)

err_kms_cleanup:
	kirin_drm_kms_cleanup(drm_dev);
err_drm_dev_unref:
	drm_dev_unref(drm_dev);
err_drm_dev_put:
	drm_dev_put(drm_dev);

	return ret;
}
@@ -215,7 +215,7 @@ static void kirin_drm_unbind(struct device *dev)

	drm_dev_unregister(drm_dev);
	kirin_drm_kms_cleanup(drm_dev);
	drm_dev_unref(drm_dev);
	drm_dev_put(drm_dev);
}

static const struct component_master_ops kirin_drm_ops = {