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

Commit acb42a3b authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux

* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: (31 commits)
  gma500: Fix suspend/resume functions
  drm/exynos: fixed pm feature for fimd module.
  MAINTAINERS: added maintainer entry for Exynos DRM Driver.
  drm/exynos: fixed build dependency for DRM_EXYNOS_FIMD
  drm/exynos: fix build dependency for DRM_EXYNOS_HDMI
  drm/exynos: use release_mem_region instead of release_resource
  agp: fix scratch page cleanup
  drm/i915: fixup forcewake spinlock fallout in drpc debugfs function
  drm/i915: debugfs: show semaphore registers also on gen7
  drm/i915: allow userspace forcewake references also on gen7
  drm/i915: Re-enable gen7 RC6 and GPU turbo after resume.
  drm/i915: Correct debugfs printout for RC1e.
  Revert "drm/i915: Work around gen7 BLT ring synchronization issues."
  drm/i915: rip out the HWSTAM missed irq workaround
  drm/i915: paper over missed irq issues with force wake voodoo
  drm/i915: Hold gt_lock across forcewake register reads
  drm/i915: Hold gt_lock during reset
  drm/i915: Move reset forcewake processing to gen6_do_reset
  drm/i915: protect force_wake_(get|put) with the gt_lock
  drm/i915: convert force_wake_get to func pointer in the gpu reset code
  ...
parents ea9f7a67 2d8357e6
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2350,6 +2350,9 @@ F: include/drm/i915*

DRM DRIVERS FOR EXYNOS
M:	Inki Dae <inki.dae@samsung.com>
M:	Joonyoung Shim <jy0922.shim@samsung.com>
M:	Seung-Woo Kim <sw0312.kim@samsung.com>
M:	Kyungmin Park <kyungmin.park@samsung.com>
L:	dri-devel@lists.freedesktop.org
S:	Supported
F:	drivers/gpu/drm/exynos
+6 −6
Original line number Diff line number Diff line
@@ -194,10 +194,10 @@ static int agp_backend_initialize(struct agp_bridge_data *bridge)

err_out:
	if (bridge->driver->needs_scratch_page) {
		void *va = page_address(bridge->scratch_page_page);
		struct page *page = bridge->scratch_page_page;

		bridge->driver->agp_destroy_page(va, AGP_PAGE_DESTROY_UNMAP);
		bridge->driver->agp_destroy_page(va, AGP_PAGE_DESTROY_FREE);
		bridge->driver->agp_destroy_page(page, AGP_PAGE_DESTROY_UNMAP);
		bridge->driver->agp_destroy_page(page, AGP_PAGE_DESTROY_FREE);
	}
	if (got_gatt)
		bridge->driver->free_gatt_table(bridge);
@@ -221,10 +221,10 @@ static void agp_backend_cleanup(struct agp_bridge_data *bridge)

	if (bridge->driver->agp_destroy_page &&
	    bridge->driver->needs_scratch_page) {
		void *va = page_address(bridge->scratch_page_page);
		struct page *page = bridge->scratch_page_page;

		bridge->driver->agp_destroy_page(va, AGP_PAGE_DESTROY_UNMAP);
		bridge->driver->agp_destroy_page(va, AGP_PAGE_DESTROY_FREE);
		bridge->driver->agp_destroy_page(page, AGP_PAGE_DESTROY_UNMAP);
		bridge->driver->agp_destroy_page(page, AGP_PAGE_DESTROY_FREE);
	}
}

+2 −2
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ config DRM_EXYNOS

config DRM_EXYNOS_FIMD
	tristate "Exynos DRM FIMD"
	depends on DRM_EXYNOS
	depends on DRM_EXYNOS && !FB_S3C
	default n
	help
	  Choose this option if you want to use Exynos FIMD for DRM.
@@ -21,7 +21,7 @@ config DRM_EXYNOS_FIMD

config DRM_EXYNOS_HDMI
	tristate "Exynos DRM HDMI"
	depends on DRM_EXYNOS
	depends on DRM_EXYNOS && !VIDEO_SAMSUNG_S5P_TV
	help
	  Choose this option if you want to use Exynos HDMI for DRM.
	  If M is selected, the module will be called exynos_drm_hdmi
+59 −50
Original line number Diff line number Diff line
@@ -158,6 +158,7 @@ static void fimd_dpms(struct device *subdrv_dev, int mode)
	case DRM_MODE_DPMS_STANDBY:
	case DRM_MODE_DPMS_SUSPEND:
	case DRM_MODE_DPMS_OFF:
		if (!ctx->suspended)
			pm_runtime_put_sync(subdrv_dev);
		break;
	default:
@@ -734,6 +735,46 @@ static void fimd_clear_win(struct fimd_context *ctx, int win)
	writel(val, ctx->regs + SHADOWCON);
}

static int fimd_power_on(struct fimd_context *ctx, bool enable)
{
	struct exynos_drm_subdrv *subdrv = &ctx->subdrv;
	struct device *dev = subdrv->manager.dev;

	DRM_DEBUG_KMS("%s\n", __FILE__);

	if (enable != false && enable != true)
		return -EINVAL;

	if (enable) {
		int ret;

		ret = clk_enable(ctx->bus_clk);
		if (ret < 0)
			return ret;

		ret = clk_enable(ctx->lcd_clk);
		if  (ret < 0) {
			clk_disable(ctx->bus_clk);
			return ret;
		}

		ctx->suspended = false;

		/* if vblank was enabled status, enable it again. */
		if (test_and_clear_bit(0, &ctx->irq_flags))
			fimd_enable_vblank(dev);

		fimd_apply(dev);
	} else {
		clk_disable(ctx->lcd_clk);
		clk_disable(ctx->bus_clk);

		ctx->suspended = true;
	}

	return 0;
}

static int __devinit fimd_probe(struct platform_device *pdev)
{
	struct device *dev = &pdev->dev;
@@ -911,39 +952,30 @@ static int __devexit fimd_remove(struct platform_device *pdev)
#ifdef CONFIG_PM_SLEEP
static int fimd_suspend(struct device *dev)
{
	int ret;
	struct fimd_context *ctx = get_fimd_context(dev);

	if (pm_runtime_suspended(dev))
		return 0;

	ret = pm_runtime_suspend(dev);
	if (ret < 0)
		return ret;

	return 0;
	/*
	 * do not use pm_runtime_suspend(). if pm_runtime_suspend() is
	 * called here, an error would be returned by that interface
	 * because the usage_count of pm runtime is more than 1.
	 */
	return fimd_power_on(ctx, false);
}

static int fimd_resume(struct device *dev)
{
	int ret;

	ret = pm_runtime_resume(dev);
	if (ret < 0) {
		DRM_ERROR("failed to resume runtime pm.\n");
		return ret;
	}

	pm_runtime_disable(dev);

	ret = pm_runtime_set_active(dev);
	if (ret < 0) {
		DRM_ERROR("failed to active runtime pm.\n");
		pm_runtime_enable(dev);
		pm_runtime_suspend(dev);
		return ret;
	}
	struct fimd_context *ctx = get_fimd_context(dev);

	pm_runtime_enable(dev);
	/*
	 * if entered to sleep when lcd panel was on, the usage_count
	 * of pm runtime would still be 1 so in this case, fimd driver
	 * should be on directly not drawing on pm runtime interface.
	 */
	if (!pm_runtime_suspended(dev))
		return fimd_power_on(ctx, true);

	return 0;
}
@@ -956,39 +988,16 @@ static int fimd_runtime_suspend(struct device *dev)

	DRM_DEBUG_KMS("%s\n", __FILE__);

	clk_disable(ctx->lcd_clk);
	clk_disable(ctx->bus_clk);

	ctx->suspended = true;
	return 0;
	return fimd_power_on(ctx, false);
}

static int fimd_runtime_resume(struct device *dev)
{
	struct fimd_context *ctx = get_fimd_context(dev);
	int ret;

	DRM_DEBUG_KMS("%s\n", __FILE__);

	ret = clk_enable(ctx->bus_clk);
	if (ret < 0)
		return ret;

	ret = clk_enable(ctx->lcd_clk);
	if  (ret < 0) {
		clk_disable(ctx->bus_clk);
		return ret;
	}

	ctx->suspended = false;

	/* if vblank was enabled status, enable it again. */
	if (test_and_clear_bit(0, &ctx->irq_flags))
		fimd_enable_vblank(dev);

	fimd_apply(dev);

	return 0;
	return fimd_power_on(ctx, true);
}
#endif

+4 −4
Original line number Diff line number Diff line
@@ -1116,8 +1116,8 @@ static int __devinit hdmi_probe(struct platform_device *pdev)
err_iomap:
	iounmap(hdata->regs);
err_req_region:
	release_resource(hdata->regs_res);
	kfree(hdata->regs_res);
	release_mem_region(hdata->regs_res->start,
			resource_size(hdata->regs_res));
err_resource:
	hdmi_resources_cleanup(hdata);
err_data:
@@ -1145,8 +1145,8 @@ static int __devexit hdmi_remove(struct platform_device *pdev)

	iounmap(hdata->regs);

	release_resource(hdata->regs_res);
	kfree(hdata->regs_res);
	release_mem_region(hdata->regs_res->start,
			resource_size(hdata->regs_res));

	/* hdmiphy i2c driver */
	i2c_del_driver(&hdmiphy_driver);
Loading