Skip to content

Commit

Permalink
Merge tag 'drm-fixes-for-4.8-rc7' of git://people.freedesktop.org/~ai…
Browse files Browse the repository at this point in the history
…rlied/linux

Pull exynos and one stable ABI fix from Dave Airlie:
 "One important drm 32/64 ABI fix came in so I'll dequeue what I have,
  the rest is just exynos runtime pm fixes, but the net removal of code
  seems like a win to me.

  I'm going to be sporadic this week due to school holidays, so if
  anything urgent turns up, Daniel will take care of it"

* tag 'drm-fixes-for-4.8-rc7' of git://people.freedesktop.org/~airlied/linux:
  drm: Only use compat ioctl for addfb2 on X86/IA64
  Subject: [PATCH, RESEND] drm: exynos: avoid unused function warning
  drm/exynos: g2d: fix system and runtime pm integration
  drm/exynos: rotator: fix system and runtime pm integration
  drm/exynos: gsc: fix system and runtime pm integration
  drm/exynos: fimc: fix system and runtime pm integration
  exynos-drm: Fix unsupported GEM memory type error message to be clear
  • Loading branch information
Linus Torvalds committed Sep 19, 2016
2 parents 6732666 + 47a66e4 commit 8ff7720
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 107 deletions.
4 changes: 4 additions & 0 deletions drivers/gpu/drm/drm_ioc32.c
Original file line number Diff line number Diff line change
Expand Up @@ -1015,6 +1015,7 @@ static int compat_drm_wait_vblank(struct file *file, unsigned int cmd,
return 0;
}

#if defined(CONFIG_X86) || defined(CONFIG_IA64)
typedef struct drm_mode_fb_cmd232 {
u32 fb_id;
u32 width;
Expand Down Expand Up @@ -1071,6 +1072,7 @@ static int compat_drm_mode_addfb2(struct file *file, unsigned int cmd,

return 0;
}
#endif

static drm_ioctl_compat_t *drm_compat_ioctls[] = {
[DRM_IOCTL_NR(DRM_IOCTL_VERSION32)] = compat_drm_version,
Expand Down Expand Up @@ -1104,7 +1106,9 @@ static drm_ioctl_compat_t *drm_compat_ioctls[] = {
[DRM_IOCTL_NR(DRM_IOCTL_UPDATE_DRAW32)] = compat_drm_update_draw,
#endif
[DRM_IOCTL_NR(DRM_IOCTL_WAIT_VBLANK32)] = compat_drm_wait_vblank,
#if defined(CONFIG_X86) || defined(CONFIG_IA64)
[DRM_IOCTL_NR(DRM_IOCTL_MODE_ADDFB232)] = compat_drm_mode_addfb2,
#endif
};

/**
Expand Down
6 changes: 3 additions & 3 deletions drivers/gpu/drm/exynos/exynos_drm_fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ static int check_fb_gem_memory_type(struct drm_device *drm_dev,
flags = exynos_gem->flags;

/*
* without iommu support, not support physically non-continuous memory
* for framebuffer.
* Physically non-contiguous memory type for framebuffer is not
* supported without IOMMU.
*/
if (IS_NONCONTIG_BUFFER(flags)) {
DRM_ERROR("cannot use this gem memory type for fb.\n");
DRM_ERROR("Non-contiguous GEM memory is not supported.\n");
return -EINVAL;
}

Expand Down
29 changes: 2 additions & 27 deletions drivers/gpu/drm/exynos/exynos_drm_fimc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1753,32 +1753,6 @@ static int fimc_clk_ctrl(struct fimc_context *ctx, bool enable)
return 0;
}

#ifdef CONFIG_PM_SLEEP
static int fimc_suspend(struct device *dev)
{
struct fimc_context *ctx = get_fimc_context(dev);

DRM_DEBUG_KMS("id[%d]\n", ctx->id);

if (pm_runtime_suspended(dev))
return 0;

return fimc_clk_ctrl(ctx, false);
}

static int fimc_resume(struct device *dev)
{
struct fimc_context *ctx = get_fimc_context(dev);

DRM_DEBUG_KMS("id[%d]\n", ctx->id);

if (!pm_runtime_suspended(dev))
return fimc_clk_ctrl(ctx, true);

return 0;
}
#endif

static int fimc_runtime_suspend(struct device *dev)
{
struct fimc_context *ctx = get_fimc_context(dev);
Expand All @@ -1799,7 +1773,8 @@ static int fimc_runtime_resume(struct device *dev)
#endif

static const struct dev_pm_ops fimc_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(fimc_suspend, fimc_resume)
SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
pm_runtime_force_resume)
SET_RUNTIME_PM_OPS(fimc_runtime_suspend, fimc_runtime_resume, NULL)
};

Expand Down
29 changes: 7 additions & 22 deletions drivers/gpu/drm/exynos/exynos_drm_g2d.c
Original file line number Diff line number Diff line change
Expand Up @@ -1475,8 +1475,8 @@ static int g2d_remove(struct platform_device *pdev)
return 0;
}

#ifdef CONFIG_PM_SLEEP
static int g2d_suspend(struct device *dev)
#ifdef CONFIG_PM
static int g2d_runtime_suspend(struct device *dev)
{
struct g2d_data *g2d = dev_get_drvdata(dev);

Expand All @@ -1490,25 +1490,6 @@ static int g2d_suspend(struct device *dev)

flush_work(&g2d->runqueue_work);

return 0;
}

static int g2d_resume(struct device *dev)
{
struct g2d_data *g2d = dev_get_drvdata(dev);

g2d->suspended = false;
g2d_exec_runqueue(g2d);

return 0;
}
#endif

#ifdef CONFIG_PM
static int g2d_runtime_suspend(struct device *dev)
{
struct g2d_data *g2d = dev_get_drvdata(dev);

clk_disable_unprepare(g2d->gate_clk);

return 0;
Expand All @@ -1523,12 +1504,16 @@ static int g2d_runtime_resume(struct device *dev)
if (ret < 0)
dev_warn(dev, "failed to enable clock.\n");

g2d->suspended = false;
g2d_exec_runqueue(g2d);

return ret;
}
#endif

static const struct dev_pm_ops g2d_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(g2d_suspend, g2d_resume)
SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
pm_runtime_force_resume)
SET_RUNTIME_PM_OPS(g2d_runtime_suspend, g2d_runtime_resume, NULL)
};

Expand Down
35 changes: 4 additions & 31 deletions drivers/gpu/drm/exynos/exynos_drm_gsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1760,34 +1760,7 @@ static int gsc_remove(struct platform_device *pdev)
return 0;
}

#ifdef CONFIG_PM_SLEEP
static int gsc_suspend(struct device *dev)
{
struct gsc_context *ctx = get_gsc_context(dev);

DRM_DEBUG_KMS("id[%d]\n", ctx->id);

if (pm_runtime_suspended(dev))
return 0;

return gsc_clk_ctrl(ctx, false);
}

static int gsc_resume(struct device *dev)
{
struct gsc_context *ctx = get_gsc_context(dev);

DRM_DEBUG_KMS("id[%d]\n", ctx->id);

if (!pm_runtime_suspended(dev))
return gsc_clk_ctrl(ctx, true);

return 0;
}
#endif

#ifdef CONFIG_PM
static int gsc_runtime_suspend(struct device *dev)
static int __maybe_unused gsc_runtime_suspend(struct device *dev)
{
struct gsc_context *ctx = get_gsc_context(dev);

Expand All @@ -1796,18 +1769,18 @@ static int gsc_runtime_suspend(struct device *dev)
return gsc_clk_ctrl(ctx, false);
}

static int gsc_runtime_resume(struct device *dev)
static int __maybe_unused gsc_runtime_resume(struct device *dev)
{
struct gsc_context *ctx = get_gsc_context(dev);

DRM_DEBUG_KMS("id[%d]\n", ctx->id);

return gsc_clk_ctrl(ctx, true);
}
#endif

static const struct dev_pm_ops gsc_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(gsc_suspend, gsc_resume)
SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
pm_runtime_force_resume)
SET_RUNTIME_PM_OPS(gsc_runtime_suspend, gsc_runtime_resume, NULL)
};

Expand Down
26 changes: 2 additions & 24 deletions drivers/gpu/drm/exynos/exynos_drm_rotator.c
Original file line number Diff line number Diff line change
Expand Up @@ -794,29 +794,6 @@ static int rotator_clk_crtl(struct rot_context *rot, bool enable)
return 0;
}


#ifdef CONFIG_PM_SLEEP
static int rotator_suspend(struct device *dev)
{
struct rot_context *rot = dev_get_drvdata(dev);

if (pm_runtime_suspended(dev))
return 0;

return rotator_clk_crtl(rot, false);
}

static int rotator_resume(struct device *dev)
{
struct rot_context *rot = dev_get_drvdata(dev);

if (!pm_runtime_suspended(dev))
return rotator_clk_crtl(rot, true);

return 0;
}
#endif

static int rotator_runtime_suspend(struct device *dev)
{
struct rot_context *rot = dev_get_drvdata(dev);
Expand All @@ -833,7 +810,8 @@ static int rotator_runtime_resume(struct device *dev)
#endif

static const struct dev_pm_ops rotator_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(rotator_suspend, rotator_resume)
SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
pm_runtime_force_resume)
SET_RUNTIME_PM_OPS(rotator_runtime_suspend, rotator_runtime_resume,
NULL)
};
Expand Down

0 comments on commit 8ff7720

Please sign in to comment.