aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2017-11-30 18:14:18 -0500
committerDave Airlie <airlied@redhat.com>2017-11-30 18:14:18 -0500
commita42ea78f5b73d8aba9665ad34fb88e483f442f6f (patch)
tree49be4dcce8f9ff879a45808cd9140dedab1b9127
parent8503a4c1e3fffe548443e390ac6cc93a2e7f3c77 (diff)
parentf73e8b82531573a198a4d0e5bff0d3256cbbd1d8 (diff)
Merge branch 'for-upstream/hdlcd' of git://linux-arm.org/linux-ld into drm-fixes
3 hdlcd fixes/cleanups * 'for-upstream/hdlcd' of git://linux-arm.org/linux-ld: drm/arm: Replace instances of drm_dev_unref with drm_dev_put. drm: Fix checkpatch issue: "WARNING: braces {} are not necessary for single statement blocks." drm: hdlcd: Update PM code to save/restore console.
-rw-r--r--drivers/gpu/drm/arm/hdlcd_crtc.c3
-rw-r--r--drivers/gpu/drm/arm/hdlcd_drv.c9
2 files changed, 7 insertions, 5 deletions
diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c b/drivers/gpu/drm/arm/hdlcd_crtc.c
index 72b22b805412..5a5427bbd70e 100644
--- a/drivers/gpu/drm/arm/hdlcd_crtc.c
+++ b/drivers/gpu/drm/arm/hdlcd_crtc.c
@@ -317,9 +317,8 @@ static struct drm_plane *hdlcd_plane_init(struct drm_device *drm)
317 formats, ARRAY_SIZE(formats), 317 formats, ARRAY_SIZE(formats),
318 NULL, 318 NULL,
319 DRM_PLANE_TYPE_PRIMARY, NULL); 319 DRM_PLANE_TYPE_PRIMARY, NULL);
320 if (ret) { 320 if (ret)
321 return ERR_PTR(ret); 321 return ERR_PTR(ret);
322 }
323 322
324 drm_plane_helper_add(plane, &hdlcd_plane_helper_funcs); 323 drm_plane_helper_add(plane, &hdlcd_plane_helper_funcs);
325 hdlcd->plane = plane; 324 hdlcd->plane = plane;
diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c
index 764d0c83710c..0afb53b1f4e9 100644
--- a/drivers/gpu/drm/arm/hdlcd_drv.c
+++ b/drivers/gpu/drm/arm/hdlcd_drv.c
@@ -13,6 +13,7 @@
13#include <linux/spinlock.h> 13#include <linux/spinlock.h>
14#include <linux/clk.h> 14#include <linux/clk.h>
15#include <linux/component.h> 15#include <linux/component.h>
16#include <linux/console.h>
16#include <linux/list.h> 17#include <linux/list.h>
17#include <linux/of_graph.h> 18#include <linux/of_graph.h>
18#include <linux/of_reserved_mem.h> 19#include <linux/of_reserved_mem.h>
@@ -354,7 +355,7 @@ err_unload:
354err_free: 355err_free:
355 drm_mode_config_cleanup(drm); 356 drm_mode_config_cleanup(drm);
356 dev_set_drvdata(dev, NULL); 357 dev_set_drvdata(dev, NULL);
357 drm_dev_unref(drm); 358 drm_dev_put(drm);
358 359
359 return ret; 360 return ret;
360} 361}
@@ -379,7 +380,7 @@ static void hdlcd_drm_unbind(struct device *dev)
379 pm_runtime_disable(drm->dev); 380 pm_runtime_disable(drm->dev);
380 of_reserved_mem_device_release(drm->dev); 381 of_reserved_mem_device_release(drm->dev);
381 drm_mode_config_cleanup(drm); 382 drm_mode_config_cleanup(drm);
382 drm_dev_unref(drm); 383 drm_dev_put(drm);
383 drm->dev_private = NULL; 384 drm->dev_private = NULL;
384 dev_set_drvdata(dev, NULL); 385 dev_set_drvdata(dev, NULL);
385} 386}
@@ -432,9 +433,11 @@ static int __maybe_unused hdlcd_pm_suspend(struct device *dev)
432 return 0; 433 return 0;
433 434
434 drm_kms_helper_poll_disable(drm); 435 drm_kms_helper_poll_disable(drm);
436 drm_fbdev_cma_set_suspend_unlocked(hdlcd->fbdev, 1);
435 437
436 hdlcd->state = drm_atomic_helper_suspend(drm); 438 hdlcd->state = drm_atomic_helper_suspend(drm);
437 if (IS_ERR(hdlcd->state)) { 439 if (IS_ERR(hdlcd->state)) {
440 drm_fbdev_cma_set_suspend_unlocked(hdlcd->fbdev, 0);
438 drm_kms_helper_poll_enable(drm); 441 drm_kms_helper_poll_enable(drm);
439 return PTR_ERR(hdlcd->state); 442 return PTR_ERR(hdlcd->state);
440 } 443 }
@@ -451,8 +454,8 @@ static int __maybe_unused hdlcd_pm_resume(struct device *dev)
451 return 0; 454 return 0;
452 455
453 drm_atomic_helper_resume(drm, hdlcd->state); 456 drm_atomic_helper_resume(drm, hdlcd->state);
457 drm_fbdev_cma_set_suspend_unlocked(hdlcd->fbdev, 0);
454 drm_kms_helper_poll_enable(drm); 458 drm_kms_helper_poll_enable(drm);
455 pm_runtime_set_active(dev);
456 459
457 return 0; 460 return 0;
458} 461}