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:
 "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
  ...
  • Loading branch information
torvalds committed Apr 19, 2014
2 parents ebfc45e + a42892e commit b931242
Show file tree
Hide file tree
Showing 53 changed files with 1,058 additions and 914 deletions.
5 changes: 5 additions & 0 deletions Documentation/DocBook/drm.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2285,6 +2285,11 @@ void intel_crt_init(struct drm_device *dev)
<sect2>
<title>Modeset Helper Functions Reference</title>
!Edrivers/gpu/drm/drm_crtc_helper.c
</sect2>
<sect2>
<title>Output Probing Helper Functions Reference</title>
!Pdrivers/gpu/drm/drm_probe_helper.c output probing helper overview
!Edrivers/gpu/drm/drm_probe_helper.c
</sect2>
<sect2>
<title>fbdev Helper Functions Reference</title>
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ drm-$(CONFIG_DRM_PANEL) += drm_panel.o

drm-usb-y := drm_usb.o

drm_kms_helper-y := drm_crtc_helper.o drm_dp_helper.o
drm_kms_helper-y := drm_crtc_helper.o drm_dp_helper.o drm_probe_helper.o
drm_kms_helper-$(CONFIG_DRM_LOAD_EDID_FIRMWARE) += drm_edid_load.o
drm_kms_helper-$(CONFIG_DRM_KMS_FB_HELPER) += drm_fb_helper.o
drm_kms_helper-$(CONFIG_DRM_KMS_CMA_HELPER) += drm_fb_cma_helper.o
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/ast/ast_post.c
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ static u32 cbr_scan2(struct ast_private *ast)
for (loop = 0; loop < CBR_PASSNUM2; loop++) {
if ((data = cbr_test2(ast)) != 0) {
data2 &= data;
if (!data)
if (!data2)
return 0;
break;
}
Expand Down
3 changes: 1 addition & 2 deletions drivers/gpu/drm/bochs/bochs.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <linux/io.h>
#include <linux/fb.h>
#include <linux/console.h>

#include <drm/drmP.h>
#include <drm/drm_crtc.h>
Expand Down Expand Up @@ -87,8 +88,6 @@ struct bochs_device {
struct bochs_framebuffer gfb;
struct drm_fb_helper helper;
int size;
int x1, y1, x2, y2; /* dirty rect */
spinlock_t dirty_lock;
bool initialized;
} fb;
};
Expand Down
44 changes: 44 additions & 0 deletions drivers/gpu/drm/bochs/bochs_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,49 @@ static struct drm_driver bochs_driver = {
.dumb_destroy = drm_gem_dumb_destroy,
};

/* ---------------------------------------------------------------------- */
/* pm interface */

static int bochs_pm_suspend(struct device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev);
struct drm_device *drm_dev = pci_get_drvdata(pdev);
struct bochs_device *bochs = drm_dev->dev_private;

drm_kms_helper_poll_disable(drm_dev);

if (bochs->fb.initialized) {
console_lock();
fb_set_suspend(bochs->fb.helper.fbdev, 1);
console_unlock();
}

return 0;
}

static int bochs_pm_resume(struct device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev);
struct drm_device *drm_dev = pci_get_drvdata(pdev);
struct bochs_device *bochs = drm_dev->dev_private;

drm_helper_resume_force_mode(drm_dev);

if (bochs->fb.initialized) {
console_lock();
fb_set_suspend(bochs->fb.helper.fbdev, 0);
console_unlock();
}

drm_kms_helper_poll_enable(drm_dev);
return 0;
}

static const struct dev_pm_ops bochs_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(bochs_pm_suspend,
bochs_pm_resume)
};

/* ---------------------------------------------------------------------- */
/* pci interface */

Expand Down Expand Up @@ -155,6 +198,7 @@ static struct pci_driver bochs_pci_driver = {
.id_table = bochs_pci_tbl,
.probe = bochs_pci_probe,
.remove = bochs_pci_remove,
.driver.pm = &bochs_pm_ops,
};

/* ---------------------------------------------------------------------- */
Expand Down
1 change: 0 additions & 1 deletion drivers/gpu/drm/bochs/bochs_fbdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ int bochs_fbdev_init(struct bochs_device *bochs)
int ret;

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

ret = drm_fb_helper_init(bochs->dev, &bochs->fb.helper,
1, 1);
Expand Down
42 changes: 42 additions & 0 deletions drivers/gpu/drm/cirrus/cirrus_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <linux/module.h>
#include <linux/console.h>
#include <drm/drmP.h>
#include <drm/drm_crtc_helper.h>

#include "cirrus_drv.h"

Expand Down Expand Up @@ -75,6 +76,41 @@ static void cirrus_pci_remove(struct pci_dev *pdev)
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,
Expand Down Expand Up @@ -103,11 +139,17 @@ static struct drm_driver driver = {
.dumb_destroy = drm_gem_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)
Expand Down
3 changes: 3 additions & 0 deletions drivers/gpu/drm/cirrus/cirrus_mode.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,9 @@ static int cirrus_crtc_mode_set(struct drm_crtc *crtc,

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;
}

Expand Down
Loading

0 comments on commit b931242

Please sign in to comment.