Skip to content

Commit

Permalink
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Browse files Browse the repository at this point in the history
Pull drm fixes from Dave Airlie:
 "This is mostly exynos and intel fixes, along with some vblank patches
  I lost from Rob a few months ago that make wayland work better on lots
  of GPUs, also a qxl kconfig fix."

* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: (22 commits)
  qxl: fix Kconfig deps - select FB_DEFERRED_IO
  drm/exynos: replace request_threaded_irq with devm function
  drm/exynos: remove unnecessary devm_kfree
  drm/exynos: fix build warnings from ipp fimc
  drm/exynos: cleanup device pointer usages
  drm/exynos: wait for the completion of pending page flip
  drm/exynos: use drm_send_vblank_event() helper
  drm/i915: avoid premature DP AUX timeouts
  drm/i915: avoid premature timeouts in __wait_seqno()
  drm/i915: use msecs_to_jiffies_timeout instead of open coding the same
  drm/i915: add msecs_to_jiffies_timeout to guarantee minimum duration
  drm/i915: force full modeset if the connector is in DPMS OFF mode
  drm/exynos: page flip fixes
  drm/exynos: exynos_hdmi: Pass correct pointer to free_irq()
  drm/exynos: exynos_drm_ipp: Fix incorrect usage of IS_ERR_OR_NULL
  drm/exynos: exynos_drm_fbdev: Fix incorrect usage of IS_ERR_OR_NULL
  drm/imx: use drm_send_vblank_event() helper
  drm/shmob: use drm_send_vblank_event() helper
  drm/radeon: use drm_send_vblank_event() helper
  drm/nouveau: use drm_send_vblank_event() helper
  ...
  • Loading branch information
Linus Torvalds committed May 28, 2013
2 parents 30a9e50 + c89b65e commit 58f8bbd
Show file tree
Hide file tree
Showing 23 changed files with 163 additions and 164 deletions.
27 changes: 18 additions & 9 deletions drivers/gpu/drm/exynos/exynos_drm_crtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ struct exynos_drm_crtc {
unsigned int pipe;
unsigned int dpms;
enum exynos_crtc_mode mode;
wait_queue_head_t pending_flip_queue;
atomic_t pending_flip;
};

static void exynos_drm_crtc_dpms(struct drm_crtc *crtc, int mode)
Expand All @@ -61,6 +63,13 @@ static void exynos_drm_crtc_dpms(struct drm_crtc *crtc, int mode)
return;
}

if (mode > DRM_MODE_DPMS_ON) {
/* wait for the completion of page flip. */
wait_event(exynos_crtc->pending_flip_queue,
atomic_read(&exynos_crtc->pending_flip) == 0);
drm_vblank_off(crtc->dev, exynos_crtc->pipe);
}

exynos_drm_fn_encoder(crtc, &mode, exynos_drm_encoder_crtc_dpms);
exynos_crtc->dpms = mode;
}
Expand Down Expand Up @@ -217,14 +226,14 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc,
ret = drm_vblank_get(dev, exynos_crtc->pipe);
if (ret) {
DRM_DEBUG("failed to acquire vblank counter\n");
list_del(&event->base.link);

goto out;
}

spin_lock_irq(&dev->event_lock);
list_add_tail(&event->base.link,
&dev_priv->pageflip_event_list);
atomic_set(&exynos_crtc->pending_flip, 1);
spin_unlock_irq(&dev->event_lock);

crtc->fb = fb;
Expand Down Expand Up @@ -344,6 +353,8 @@ int exynos_drm_crtc_create(struct drm_device *dev, unsigned int nr)

exynos_crtc->pipe = nr;
exynos_crtc->dpms = DRM_MODE_DPMS_OFF;
init_waitqueue_head(&exynos_crtc->pending_flip_queue);
atomic_set(&exynos_crtc->pending_flip, 0);
exynos_crtc->plane = exynos_plane_init(dev, 1 << nr, true);
if (!exynos_crtc->plane) {
kfree(exynos_crtc);
Expand Down Expand Up @@ -398,7 +409,8 @@ void exynos_drm_crtc_finish_pageflip(struct drm_device *dev, int crtc)
{
struct exynos_drm_private *dev_priv = dev->dev_private;
struct drm_pending_vblank_event *e, *t;
struct timeval now;
struct drm_crtc *drm_crtc = dev_priv->crtc[crtc];
struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(drm_crtc);
unsigned long flags;

DRM_DEBUG_KMS("%s\n", __FILE__);
Expand All @@ -411,14 +423,11 @@ void exynos_drm_crtc_finish_pageflip(struct drm_device *dev, int crtc)
if (crtc != e->pipe)
continue;

do_gettimeofday(&now);
e->event.sequence = 0;
e->event.tv_sec = now.tv_sec;
e->event.tv_usec = now.tv_usec;

list_move_tail(&e->base.link, &e->base.file_priv->event_list);
wake_up_interruptible(&e->base.file_priv->event_wait);
list_del(&e->base.link);
drm_send_vblank_event(dev, -1, e);
drm_vblank_put(dev, crtc);
atomic_set(&exynos_crtc->pending_flip, 0);
wake_up(&exynos_crtc->pending_flip_queue);
}

spin_unlock_irqrestore(&dev->event_lock, flags);
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/exynos/exynos_drm_fbdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ static int exynos_drm_fbdev_create(struct drm_fb_helper *helper,

helper->fb = exynos_drm_framebuffer_init(dev, &mode_cmd,
&exynos_gem_obj->base);
if (IS_ERR_OR_NULL(helper->fb)) {
if (IS_ERR(helper->fb)) {
DRM_ERROR("failed to create drm framebuffer.\n");
ret = PTR_ERR(helper->fb);
goto err_destroy_gem;
Expand Down
12 changes: 4 additions & 8 deletions drivers/gpu/drm/exynos/exynos_drm_fimc.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
*
*/
#include <linux/kernel.h>
#include <linux/mfd/syscon.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/mfd/syscon.h>
#include <linux/regmap.h>
#include <linux/clk.h>
#include <linux/pm_runtime.h>
Expand Down Expand Up @@ -1845,7 +1845,7 @@ static int fimc_probe(struct platform_device *pdev)
}

ctx->irq = res->start;
ret = request_threaded_irq(ctx->irq, NULL, fimc_irq_handler,
ret = devm_request_threaded_irq(dev, ctx->irq, NULL, fimc_irq_handler,
IRQF_ONESHOT, "drm_fimc", ctx);
if (ret < 0) {
dev_err(dev, "failed to request irq.\n");
Expand All @@ -1854,7 +1854,7 @@ static int fimc_probe(struct platform_device *pdev)

ret = fimc_setup_clocks(ctx);
if (ret < 0)
goto err_free_irq;
return ret;

ippdrv = &ctx->ippdrv;
ippdrv->ops[EXYNOS_DRM_OPS_SRC] = &fimc_src_ops;
Expand Down Expand Up @@ -1884,16 +1884,14 @@ static int fimc_probe(struct platform_device *pdev)
goto err_pm_dis;
}

dev_info(&pdev->dev, "drm fimc registered successfully.\n");
dev_info(dev, "drm fimc registered successfully.\n");

return 0;

err_pm_dis:
pm_runtime_disable(dev);
err_put_clk:
fimc_put_clocks(ctx);
err_free_irq:
free_irq(ctx->irq, ctx);

return ret;
}
Expand All @@ -1911,8 +1909,6 @@ static int fimc_remove(struct platform_device *pdev)
pm_runtime_set_suspended(dev);
pm_runtime_disable(dev);

free_irq(ctx->irq, ctx);

return 0;
}

Expand Down
10 changes: 5 additions & 5 deletions drivers/gpu/drm/exynos/exynos_drm_fimd.c
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ static int fimd_probe(struct platform_device *pdev)

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

if (pdev->dev.of_node) {
if (dev->of_node) {
pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
if (!pdata) {
DRM_ERROR("memory allocation for pdata failed\n");
Expand All @@ -899,7 +899,7 @@ static int fimd_probe(struct platform_device *pdev)
return ret;
}
} else {
pdata = pdev->dev.platform_data;
pdata = dev->platform_data;
if (!pdata) {
DRM_ERROR("no platform data specified\n");
return -EINVAL;
Expand All @@ -912,7 +912,7 @@ static int fimd_probe(struct platform_device *pdev)
return -EINVAL;
}

ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
if (!ctx)
return -ENOMEM;

Expand All @@ -930,7 +930,7 @@ static int fimd_probe(struct platform_device *pdev)

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);

ctx->regs = devm_ioremap_resource(&pdev->dev, res);
ctx->regs = devm_ioremap_resource(dev, res);
if (IS_ERR(ctx->regs))
return PTR_ERR(ctx->regs);

Expand All @@ -942,7 +942,7 @@ static int fimd_probe(struct platform_device *pdev)

ctx->irq = res->start;

ret = devm_request_irq(&pdev->dev, ctx->irq, fimd_irq_handler,
ret = devm_request_irq(dev, ctx->irq, fimd_irq_handler,
0, "drm_fimd", ctx);
if (ret) {
dev_err(dev, "irq request failed.\n");
Expand Down
6 changes: 3 additions & 3 deletions drivers/gpu/drm/exynos/exynos_drm_g2d.c
Original file line number Diff line number Diff line change
Expand Up @@ -1379,7 +1379,7 @@ static int g2d_probe(struct platform_device *pdev)
struct exynos_drm_subdrv *subdrv;
int ret;

g2d = devm_kzalloc(&pdev->dev, sizeof(*g2d), GFP_KERNEL);
g2d = devm_kzalloc(dev, sizeof(*g2d), GFP_KERNEL);
if (!g2d) {
dev_err(dev, "failed to allocate driver data\n");
return -ENOMEM;
Expand Down Expand Up @@ -1417,7 +1417,7 @@ static int g2d_probe(struct platform_device *pdev)

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);

g2d->regs = devm_ioremap_resource(&pdev->dev, res);
g2d->regs = devm_ioremap_resource(dev, res);
if (IS_ERR(g2d->regs)) {
ret = PTR_ERR(g2d->regs);
goto err_put_clk;
Expand All @@ -1430,7 +1430,7 @@ static int g2d_probe(struct platform_device *pdev)
goto err_put_clk;
}

ret = devm_request_irq(&pdev->dev, g2d->irq, g2d_irq_handler, 0,
ret = devm_request_irq(dev, g2d->irq, g2d_irq_handler, 0,
"drm_g2d", g2d);
if (ret < 0) {
dev_err(dev, "irq request failed\n");
Expand Down
12 changes: 3 additions & 9 deletions drivers/gpu/drm/exynos/exynos_drm_gsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1704,7 +1704,7 @@ static int gsc_probe(struct platform_device *pdev)
}

ctx->irq = res->start;
ret = request_threaded_irq(ctx->irq, NULL, gsc_irq_handler,
ret = devm_request_threaded_irq(dev, ctx->irq, NULL, gsc_irq_handler,
IRQF_ONESHOT, "drm_gsc", ctx);
if (ret < 0) {
dev_err(dev, "failed to request irq.\n");
Expand All @@ -1725,7 +1725,7 @@ static int gsc_probe(struct platform_device *pdev)
ret = gsc_init_prop_list(ippdrv);
if (ret < 0) {
dev_err(dev, "failed to init property list.\n");
goto err_get_irq;
return ret;
}

DRM_DEBUG_KMS("%s:id[%d]ippdrv[0x%x]\n", __func__, ctx->id,
Expand All @@ -1743,15 +1743,12 @@ static int gsc_probe(struct platform_device *pdev)
goto err_ippdrv_register;
}

dev_info(&pdev->dev, "drm gsc registered successfully.\n");
dev_info(dev, "drm gsc registered successfully.\n");

return 0;

err_ippdrv_register:
devm_kfree(dev, ippdrv->prop_list);
pm_runtime_disable(dev);
err_get_irq:
free_irq(ctx->irq, ctx);
return ret;
}

Expand All @@ -1761,15 +1758,12 @@ static int gsc_remove(struct platform_device *pdev)
struct gsc_context *ctx = get_gsc_context(dev);
struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;

devm_kfree(dev, ippdrv->prop_list);
exynos_drm_ippdrv_unregister(ippdrv);
mutex_destroy(&ctx->lock);

pm_runtime_set_suspended(dev);
pm_runtime_disable(dev);

free_irq(ctx->irq, ctx);

return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/exynos/exynos_drm_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ static int exynos_drm_hdmi_probe(struct platform_device *pdev)

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

ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
if (!ctx) {
DRM_LOG_KMS("failed to alloc common hdmi context.\n");
return -ENOMEM;
Expand Down
18 changes: 9 additions & 9 deletions drivers/gpu/drm/exynos/exynos_drm_ipp.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ static struct exynos_drm_ippdrv *ipp_find_driver(struct ipp_context *ctx,
/* find ipp driver using idr */
ippdrv = ipp_find_obj(&ctx->ipp_idr, &ctx->ipp_lock,
ipp_id);
if (IS_ERR_OR_NULL(ippdrv)) {
if (IS_ERR(ippdrv)) {
DRM_ERROR("not found ipp%d driver.\n", ipp_id);
return ippdrv;
}
Expand Down Expand Up @@ -388,7 +388,7 @@ static int ipp_find_and_set_property(struct drm_exynos_ipp_property *property)
DRM_DEBUG_KMS("%s:prop_id[%d]\n", __func__, prop_id);

ippdrv = ipp_find_drv_by_handle(prop_id);
if (IS_ERR_OR_NULL(ippdrv)) {
if (IS_ERR(ippdrv)) {
DRM_ERROR("failed to get ipp driver.\n");
return -EINVAL;
}
Expand Down Expand Up @@ -492,7 +492,7 @@ int exynos_drm_ipp_set_property(struct drm_device *drm_dev, void *data,

/* find ipp driver using ipp id */
ippdrv = ipp_find_driver(ctx, property);
if (IS_ERR_OR_NULL(ippdrv)) {
if (IS_ERR(ippdrv)) {
DRM_ERROR("failed to get ipp driver.\n");
return -EINVAL;
}
Expand Down Expand Up @@ -521,19 +521,19 @@ int exynos_drm_ipp_set_property(struct drm_device *drm_dev, void *data,
c_node->state = IPP_STATE_IDLE;

c_node->start_work = ipp_create_cmd_work();
if (IS_ERR_OR_NULL(c_node->start_work)) {
if (IS_ERR(c_node->start_work)) {
DRM_ERROR("failed to create start work.\n");
goto err_clear;
}

c_node->stop_work = ipp_create_cmd_work();
if (IS_ERR_OR_NULL(c_node->stop_work)) {
if (IS_ERR(c_node->stop_work)) {
DRM_ERROR("failed to create stop work.\n");
goto err_free_start;
}

c_node->event_work = ipp_create_event_work();
if (IS_ERR_OR_NULL(c_node->event_work)) {
if (IS_ERR(c_node->event_work)) {
DRM_ERROR("failed to create event work.\n");
goto err_free_stop;
}
Expand Down Expand Up @@ -915,7 +915,7 @@ static int ipp_queue_buf_with_run(struct device *dev,
DRM_DEBUG_KMS("%s\n", __func__);

ippdrv = ipp_find_drv_by_handle(qbuf->prop_id);
if (IS_ERR_OR_NULL(ippdrv)) {
if (IS_ERR(ippdrv)) {
DRM_ERROR("failed to get ipp driver.\n");
return -EFAULT;
}
Expand Down Expand Up @@ -1909,7 +1909,7 @@ static int ipp_probe(struct platform_device *pdev)
struct exynos_drm_subdrv *subdrv;
int ret;

ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
if (!ctx)
return -ENOMEM;

Expand Down Expand Up @@ -1963,7 +1963,7 @@ static int ipp_probe(struct platform_device *pdev)
goto err_cmd_workq;
}

dev_info(&pdev->dev, "drm ipp registered successfully.\n");
dev_info(dev, "drm ipp registered successfully.\n");

return 0;

Expand Down
13 changes: 3 additions & 10 deletions drivers/gpu/drm/exynos/exynos_drm_rotator.c
Original file line number Diff line number Diff line change
Expand Up @@ -666,8 +666,8 @@ static int rotator_probe(struct platform_device *pdev)
return rot->irq;
}

ret = request_threaded_irq(rot->irq, NULL, rotator_irq_handler,
IRQF_ONESHOT, "drm_rotator", rot);
ret = devm_request_threaded_irq(dev, rot->irq, NULL,
rotator_irq_handler, IRQF_ONESHOT, "drm_rotator", rot);
if (ret < 0) {
dev_err(dev, "failed to request irq\n");
return ret;
Expand All @@ -676,8 +676,7 @@ static int rotator_probe(struct platform_device *pdev)
rot->clock = devm_clk_get(dev, "rotator");
if (IS_ERR(rot->clock)) {
dev_err(dev, "failed to get clock\n");
ret = PTR_ERR(rot->clock);
goto err_clk_get;
return PTR_ERR(rot->clock);
}

pm_runtime_enable(dev);
Expand Down Expand Up @@ -709,10 +708,7 @@ static int rotator_probe(struct platform_device *pdev)
return 0;

err_ippdrv_register:
devm_kfree(dev, ippdrv->prop_list);
pm_runtime_disable(dev);
err_clk_get:
free_irq(rot->irq, rot);
return ret;
}

Expand All @@ -722,13 +718,10 @@ static int rotator_remove(struct platform_device *pdev)
struct rot_context *rot = dev_get_drvdata(dev);
struct exynos_drm_ippdrv *ippdrv = &rot->ippdrv;

devm_kfree(dev, ippdrv->prop_list);
exynos_drm_ippdrv_unregister(ippdrv);

pm_runtime_disable(dev);

free_irq(rot->irq, rot);

return 0;
}

Expand Down
Loading

0 comments on commit 58f8bbd

Please sign in to comment.