Skip to content

Commit b931242

Browse files
committed
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Pull drm fixes from Dave Airlie: "Unfortunately this contains no easter eggs, its a bit larger than I'd like, but I included a patch that just moves code from one file to another and I'd like to avoid merge conflicts with that later, so it makes it seem worse than it is, Otherwise: - radeon: fixes to use new microcode to stabilise some cards, use some common displayport code, some runtime pm fixes, pll regression fixes - i915: fix for some context oopses, a warn in a used path, backlight fixes - nouveau: regression fix - omap: a bunch of fixes" * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: (51 commits) drm: bochs: drop unused struct fields drm: bochs: add power management support drm: cirrus: add power management support drm: Split out drm_probe_helper.c from drm_crtc_helper.c drm/plane-helper: Don't fake-implement primary plane disabling drm/ast: fix value check in cbr_scan2 drm/nouveau/bios: fix a bit shift error introduced by 457e77b drm/radeon/ci: make sure mc ucode is loaded before checking the size drm/radeon/si: make sure mc ucode is loaded before checking the size drm/radeon: improve PLL params if we don't match exactly v2 drm/radeon: memory leak on bo reservation failure. v2 drm/radeon: fix VCE fence command drm/radeon: re-enable mclk dpm on R7 260X asics drm/radeon: add support for newer mc ucode on CI (v2) drm/radeon: add support for newer mc ucode on SI (v2) drm/radeon: apply more strict limits for PLL params v2 drm/radeon: update CI DPM powertune settings drm/radeon: fix runpm handling on APUs (v4) drm/radeon: disable mclk dpm on R7 260X drm/tegra: Remove gratuitous pad field ...
2 parents ebfc45e + a42892e commit b931242

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1058
-914
lines changed

Documentation/DocBook/drm.tmpl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2285,6 +2285,11 @@ void intel_crt_init(struct drm_device *dev)
22852285
<sect2>
22862286
<title>Modeset Helper Functions Reference</title>
22872287
!Edrivers/gpu/drm/drm_crtc_helper.c
2288+
</sect2>
2289+
<sect2>
2290+
<title>Output Probing Helper Functions Reference</title>
2291+
!Pdrivers/gpu/drm/drm_probe_helper.c output probing helper overview
2292+
!Edrivers/gpu/drm/drm_probe_helper.c
22882293
</sect2>
22892294
<sect2>
22902295
<title>fbdev Helper Functions Reference</title>

drivers/gpu/drm/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ drm-$(CONFIG_DRM_PANEL) += drm_panel.o
2323

2424
drm-usb-y := drm_usb.o
2525

26-
drm_kms_helper-y := drm_crtc_helper.o drm_dp_helper.o
26+
drm_kms_helper-y := drm_crtc_helper.o drm_dp_helper.o drm_probe_helper.o
2727
drm_kms_helper-$(CONFIG_DRM_LOAD_EDID_FIRMWARE) += drm_edid_load.o
2828
drm_kms_helper-$(CONFIG_DRM_KMS_FB_HELPER) += drm_fb_helper.o
2929
drm_kms_helper-$(CONFIG_DRM_KMS_CMA_HELPER) += drm_fb_cma_helper.o

drivers/gpu/drm/ast/ast_post.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ static u32 cbr_scan2(struct ast_private *ast)
572572
for (loop = 0; loop < CBR_PASSNUM2; loop++) {
573573
if ((data = cbr_test2(ast)) != 0) {
574574
data2 &= data;
575-
if (!data)
575+
if (!data2)
576576
return 0;
577577
break;
578578
}

drivers/gpu/drm/bochs/bochs.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include <linux/io.h>
22
#include <linux/fb.h>
3+
#include <linux/console.h>
34

45
#include <drm/drmP.h>
56
#include <drm/drm_crtc.h>
@@ -87,8 +88,6 @@ struct bochs_device {
8788
struct bochs_framebuffer gfb;
8889
struct drm_fb_helper helper;
8990
int size;
90-
int x1, y1, x2, y2; /* dirty rect */
91-
spinlock_t dirty_lock;
9291
bool initialized;
9392
} fb;
9493
};

drivers/gpu/drm/bochs/bochs_drv.c

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,49 @@ static struct drm_driver bochs_driver = {
9494
.dumb_destroy = drm_gem_dumb_destroy,
9595
};
9696

97+
/* ---------------------------------------------------------------------- */
98+
/* pm interface */
99+
100+
static int bochs_pm_suspend(struct device *dev)
101+
{
102+
struct pci_dev *pdev = to_pci_dev(dev);
103+
struct drm_device *drm_dev = pci_get_drvdata(pdev);
104+
struct bochs_device *bochs = drm_dev->dev_private;
105+
106+
drm_kms_helper_poll_disable(drm_dev);
107+
108+
if (bochs->fb.initialized) {
109+
console_lock();
110+
fb_set_suspend(bochs->fb.helper.fbdev, 1);
111+
console_unlock();
112+
}
113+
114+
return 0;
115+
}
116+
117+
static int bochs_pm_resume(struct device *dev)
118+
{
119+
struct pci_dev *pdev = to_pci_dev(dev);
120+
struct drm_device *drm_dev = pci_get_drvdata(pdev);
121+
struct bochs_device *bochs = drm_dev->dev_private;
122+
123+
drm_helper_resume_force_mode(drm_dev);
124+
125+
if (bochs->fb.initialized) {
126+
console_lock();
127+
fb_set_suspend(bochs->fb.helper.fbdev, 0);
128+
console_unlock();
129+
}
130+
131+
drm_kms_helper_poll_enable(drm_dev);
132+
return 0;
133+
}
134+
135+
static const struct dev_pm_ops bochs_pm_ops = {
136+
SET_SYSTEM_SLEEP_PM_OPS(bochs_pm_suspend,
137+
bochs_pm_resume)
138+
};
139+
97140
/* ---------------------------------------------------------------------- */
98141
/* pci interface */
99142

@@ -155,6 +198,7 @@ static struct pci_driver bochs_pci_driver = {
155198
.id_table = bochs_pci_tbl,
156199
.probe = bochs_pci_probe,
157200
.remove = bochs_pci_remove,
201+
.driver.pm = &bochs_pm_ops,
158202
};
159203

160204
/* ---------------------------------------------------------------------- */

drivers/gpu/drm/bochs/bochs_fbdev.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,6 @@ int bochs_fbdev_init(struct bochs_device *bochs)
190190
int ret;
191191

192192
bochs->fb.helper.funcs = &bochs_fb_helper_funcs;
193-
spin_lock_init(&bochs->fb.dirty_lock);
194193

195194
ret = drm_fb_helper_init(bochs->dev, &bochs->fb.helper,
196195
1, 1);

drivers/gpu/drm/cirrus/cirrus_drv.c

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <linux/module.h>
1212
#include <linux/console.h>
1313
#include <drm/drmP.h>
14+
#include <drm/drm_crtc_helper.h>
1415

1516
#include "cirrus_drv.h"
1617

@@ -75,6 +76,41 @@ static void cirrus_pci_remove(struct pci_dev *pdev)
7576
drm_put_dev(dev);
7677
}
7778

79+
static int cirrus_pm_suspend(struct device *dev)
80+
{
81+
struct pci_dev *pdev = to_pci_dev(dev);
82+
struct drm_device *drm_dev = pci_get_drvdata(pdev);
83+
struct cirrus_device *cdev = drm_dev->dev_private;
84+
85+
drm_kms_helper_poll_disable(drm_dev);
86+
87+
if (cdev->mode_info.gfbdev) {
88+
console_lock();
89+
fb_set_suspend(cdev->mode_info.gfbdev->helper.fbdev, 1);
90+
console_unlock();
91+
}
92+
93+
return 0;
94+
}
95+
96+
static int cirrus_pm_resume(struct device *dev)
97+
{
98+
struct pci_dev *pdev = to_pci_dev(dev);
99+
struct drm_device *drm_dev = pci_get_drvdata(pdev);
100+
struct cirrus_device *cdev = drm_dev->dev_private;
101+
102+
drm_helper_resume_force_mode(drm_dev);
103+
104+
if (cdev->mode_info.gfbdev) {
105+
console_lock();
106+
fb_set_suspend(cdev->mode_info.gfbdev->helper.fbdev, 0);
107+
console_unlock();
108+
}
109+
110+
drm_kms_helper_poll_enable(drm_dev);
111+
return 0;
112+
}
113+
78114
static const struct file_operations cirrus_driver_fops = {
79115
.owner = THIS_MODULE,
80116
.open = drm_open,
@@ -103,11 +139,17 @@ static struct drm_driver driver = {
103139
.dumb_destroy = drm_gem_dumb_destroy,
104140
};
105141

142+
static const struct dev_pm_ops cirrus_pm_ops = {
143+
SET_SYSTEM_SLEEP_PM_OPS(cirrus_pm_suspend,
144+
cirrus_pm_resume)
145+
};
146+
106147
static struct pci_driver cirrus_pci_driver = {
107148
.name = DRIVER_NAME,
108149
.id_table = pciidlist,
109150
.probe = cirrus_pci_probe,
110151
.remove = cirrus_pci_remove,
152+
.driver.pm = &cirrus_pm_ops,
111153
};
112154

113155
static int __init cirrus_init(void)

drivers/gpu/drm/cirrus/cirrus_mode.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,9 @@ static int cirrus_crtc_mode_set(struct drm_crtc *crtc,
308308

309309
WREG_HDR(hdr);
310310
cirrus_crtc_do_set_base(crtc, old_fb, x, y, 0);
311+
312+
/* Unblank (needed on S3 resume, vgabios doesn't do it then) */
313+
outb(0x20, 0x3c0);
311314
return 0;
312315
}
313316

0 commit comments

Comments
 (0)