From a420ba4397d40c3cc2adea2a9cd4d70922a4a54c Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sun, 11 May 2014 21:17:36 +0200 Subject: [PATCH] 3.10-stable patches added patches: drm-cirrus-add-power-management-support.patch --- ...-cirrus-add-power-management-support.patch | 106 ++++++++++++++++++ queue-3.10/series | 1 + 2 files changed, 107 insertions(+) create mode 100644 queue-3.10/drm-cirrus-add-power-management-support.patch diff --git a/queue-3.10/drm-cirrus-add-power-management-support.patch b/queue-3.10/drm-cirrus-add-power-management-support.patch new file mode 100644 index 00000000000..d88228c9f75 --- /dev/null +++ b/queue-3.10/drm-cirrus-add-power-management-support.patch @@ -0,0 +1,106 @@ +From 2f1e800799bf478494cec3573cd63eb34ca89c9d Mon Sep 17 00:00:00 2001 +From: Gerd Hoffmann +Date: Mon, 14 Apr 2014 11:34:48 +0200 +Subject: drm: cirrus: add power management support + +From: Gerd Hoffmann + +commit 2f1e800799bf478494cec3573cd63eb34ca89c9d upstream. + +cirrus kms driver lacks power management support, thus +the vga display doesn't work any more after S3 resume. + +Fix this by adding suspend and resume functions. +Also make the mode_set function unblank the screen. + +Signed-off-by: Gerd Hoffmann +Signed-off-by: Dave Airlie +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/cirrus/cirrus_drv.c | 42 +++++++++++++++++++++++++++++++++++ + drivers/gpu/drm/cirrus/cirrus_mode.c | 3 ++ + 2 files changed, 45 insertions(+) + +--- a/drivers/gpu/drm/cirrus/cirrus_drv.c ++++ b/drivers/gpu/drm/cirrus/cirrus_drv.c +@@ -11,6 +11,7 @@ + #include + #include + #include ++#include + + #include "cirrus_drv.h" + +@@ -75,6 +76,41 @@ static void cirrus_pci_remove(struct pci + drm_put_dev(dev); + } + ++static int cirrus_pm_suspend(struct device *dev) ++{ ++ struct pci_dev *pdev = to_pci_dev(dev); ++ struct drm_device *drm_dev = pci_get_drvdata(pdev); ++ struct cirrus_device *cdev = drm_dev->dev_private; ++ ++ drm_kms_helper_poll_disable(drm_dev); ++ ++ if (cdev->mode_info.gfbdev) { ++ console_lock(); ++ fb_set_suspend(cdev->mode_info.gfbdev->helper.fbdev, 1); ++ console_unlock(); ++ } ++ ++ return 0; ++} ++ ++static int cirrus_pm_resume(struct device *dev) ++{ ++ struct pci_dev *pdev = to_pci_dev(dev); ++ struct drm_device *drm_dev = pci_get_drvdata(pdev); ++ struct cirrus_device *cdev = drm_dev->dev_private; ++ ++ drm_helper_resume_force_mode(drm_dev); ++ ++ if (cdev->mode_info.gfbdev) { ++ console_lock(); ++ fb_set_suspend(cdev->mode_info.gfbdev->helper.fbdev, 0); ++ console_unlock(); ++ } ++ ++ drm_kms_helper_poll_enable(drm_dev); ++ return 0; ++} ++ + static const struct file_operations cirrus_driver_fops = { + .owner = THIS_MODULE, + .open = drm_open, +@@ -105,11 +141,17 @@ static struct drm_driver driver = { + .dumb_destroy = cirrus_dumb_destroy, + }; + ++static const struct dev_pm_ops cirrus_pm_ops = { ++ SET_SYSTEM_SLEEP_PM_OPS(cirrus_pm_suspend, ++ cirrus_pm_resume) ++}; ++ + static struct pci_driver cirrus_pci_driver = { + .name = DRIVER_NAME, + .id_table = pciidlist, + .probe = cirrus_pci_probe, + .remove = cirrus_pci_remove, ++ .driver.pm = &cirrus_pm_ops, + }; + + static int __init cirrus_init(void) +--- a/drivers/gpu/drm/cirrus/cirrus_mode.c ++++ b/drivers/gpu/drm/cirrus/cirrus_mode.c +@@ -308,6 +308,9 @@ static int cirrus_crtc_mode_set(struct d + + WREG_HDR(hdr); + cirrus_crtc_do_set_base(crtc, old_fb, x, y, 0); ++ ++ /* Unblank (needed on S3 resume, vgabios doesn't do it then) */ ++ outb(0x20, 0x3c0); + return 0; + } + diff --git a/queue-3.10/series b/queue-3.10/series index 491e8b53cd3..3c3619dcf13 100644 --- a/queue-3.10/series +++ b/queue-3.10/series @@ -45,3 +45,4 @@ dm-thin-fix-dangling-bio-in-process_deferred_bios-error-path.patch lockd-ensure-we-tear-down-any-live-sockets-when-socket-creation-fails-during-lockd_up.patch input-synaptics-add-min-max-quirk-for-thinkpad-t431s-l440-l540-s1-yoga-and-x1.patch input-synaptics-add-min-max-quirk-for-thinkpad-edge-e431.patch +drm-cirrus-add-power-management-support.patch -- 2.47.3