[Bug 68451] Texture flicker in native Dota2 in mesa 9.2.0rc1

2013-09-20 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=68451 --- Comment #20 from Peter Kraus peter.kr...@geeksonbikes.net --- Hello, I wont be able to test it until October. Will update then, unless someone else can test it instead. Peter -- You are receiving this mail because: You are the assignee for

RE: Regression: bisected: commit 7c510133d93 breaks video

2013-09-20 Thread Paul Zimmerman
From: Paul Zimmerman Sent: Thursday, September 19, 2013 11:21 AM From: Dave Airlie [mailto:airl...@gmail.com] Sent: Wednesday, September 18, 2013 7:40 PM On Thu, Sep 19, 2013 at 12:02 PM, Paul Zimmerman paul.zimmer...@synopsys.com wrote: I have an ASUS P6X58D-Premium mobo with a

RE: Regression: bisected: commit 7c510133d93 breaks video

2013-09-20 Thread Paul Zimmerman
From: Dave Airlie [mailto:airl...@gmail.com] Sent: Thursday, September 19, 2013 1:15 PM On Fri, Sep 20, 2013 at 6:10 AM, Daniel Vetter dan...@ffwll.ch wrote: On Thu, Sep 19, 2013 at 06:32:47PM +, Paul Zimmerman wrote: From: Paul Zimmerman Sent: Thursday, September 19, 2013 11:21

[PATCH 00/51] DMA mask changes

2013-09-20 Thread Russell King - ARM Linux
This started out as a request to look at the DMA mask situation, and how to solve the issues which we have on ARM - notably how the DMA mask should be setup. However, I started off reviewing how the dma_mask and coherent_dma_mask was being used, and what I found was rather messy, and in some

[PATCH 08/51] DMA-API: net: intel/ixgbevf: fix 32-bit DMA mask handling

2013-09-20 Thread Russell King
The fallback to 32-bit DMA mask is rather odd: if (!dma_set_mask(pdev-dev, DMA_BIT_MASK(64)) !dma_set_coherent_mask(pdev-dev, DMA_BIT_MASK(64))) { pci_using_dac = 1; } else { err = dma_set_mask(pdev-dev, DMA_BIT_MASK(32));

[PATCH 07/51] DMA-API: net: intel/ixgbe: fix 32-bit DMA mask handling

2013-09-20 Thread Russell King
The fallback to 32-bit DMA mask is rather odd: if (!dma_set_mask(pdev-dev, DMA_BIT_MASK(64)) !dma_set_coherent_mask(pdev-dev, DMA_BIT_MASK(64))) { pci_using_dac = 1; } else { err = dma_set_mask(pdev-dev, DMA_BIT_MASK(32));

[PATCH 03/51] DMA-API: net: intel/e1000e: fix 32-bit DMA mask handling

2013-09-20 Thread Russell King
The fallback to 32-bit DMA mask is rather odd: err = dma_set_mask(pdev-dev, DMA_BIT_MASK(64)); if (!err) { err = dma_set_coherent_mask(pdev-dev, DMA_BIT_MASK(64)); if (!err) pci_using_dac = 1; } else {

[PATCH 04/51] DMA-API: net: intel/igb: fix 32-bit DMA mask handling

2013-09-20 Thread Russell King
The fallback to 32-bit DMA mask is rather odd: err = dma_set_mask(pdev-dev, DMA_BIT_MASK(64)); if (!err) { err = dma_set_coherent_mask(pdev-dev, DMA_BIT_MASK(64)); if (!err) pci_using_dac = 1; } else {

[PATCH 49/51] ARM: 7796/1: scsi: Use dma_max_pfn(dev) helper for bounce_limit calculations

2013-09-20 Thread Russell King
From: Santosh Shilimkar santosh.shilim...@ti.com DMA bounce limit is the maximum direct DMA'able memory beyond which bounce buffers has to be used to perform dma operations. SCSI driver relies on dma_mask but its calculation is based on max_*pfn which don't have uniform meaning across

[PATCH 47/51] ARM: 7794/1: block: Rename parameter dma_mask to max_addr for blk_queue_bounce_limit()

2013-09-20 Thread Russell King
From: Santosh Shilimkar santosh.shilim...@ti.com The blk_queue_bounce_limit() API parameter 'dma_mask' is actually the maximum address the device can handle rather than a dma_mask. Rename it accordingly to avoid it being interpreted as dma_mask. No functional change. The idea is to fix the bad

[Bug 68451] Texture flicker in native Dota2 in mesa 9.2.0rc1

2013-09-20 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=68451 --- Comment #21 from Alexandre Demers alexandre.f.dem...@gmail.com --- (In reply to comment #20) Hello, I wont be able to test it until October. Will update then, unless someone else can test it instead. Peter I may give it a try this

[PATCH 05/51] DMA-API: net: intel/igbvf: fix 32-bit DMA mask handling

2013-09-20 Thread Russell King
The fallback to 32-bit DMA mask is rather odd: err = dma_set_mask(pdev-dev, DMA_BIT_MASK(64)); if (!err) { err = dma_set_coherent_mask(pdev-dev, DMA_BIT_MASK(64)); if (!err) pci_using_dac = 1; } else {

[PATCH 02/51] DMA-API: net: brocade/bna/bnad.c: fix 32-bit DMA mask handling

2013-09-20 Thread Russell King
The fallback to 32-bit DMA mask is rather odd: if (!dma_set_mask(pdev-dev, DMA_BIT_MASK(64)) !dma_set_coherent_mask(pdev-dev, DMA_BIT_MASK(64))) { *using_dac = true; } else { err = dma_set_mask(pdev-dev, DMA_BIT_MASK(32));

Re: drm/radeon: ring test failed on PA-RISC Linux

2013-09-20 Thread Alex Ivanov
17.09.2013, в 23:33, Alex Ivanov gnido...@p0n4ik.tk написал(а): 17.09.2013, в 18:24, Alex Deucher alexdeuc...@gmail.com написал(а): On Tue, Sep 17, 2013 at 5:23 AM, Alex Ivanov gnido...@p0n4ik.tk wrote: Alex, 10.09.2013, в 16:37, Alex Deucher alexdeuc...@gmail.com написал(а): The dummy

Re: [PATCH v2 3/3] ACPI / video: Do not register backlight if win8 and native interface exists

2013-09-20 Thread Jani Nikula
On Tue, 17 Sep 2013, Aaron Lu aaron...@intel.com wrote: According to Matthew Garrett, Windows 8 leaves backlight control up to individual graphics drivers rather than making ACPI calls itself. There's plenty of evidence to suggest that the Intel driver for Windows 8 doesn't use the ACPI

[Bug 60182] X.Org Server terminate when I close video player

2013-09-20 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=60182 --- Comment #34 from Michel Dänzer mic...@daenzer.net --- (In reply to comment #33) (which AFAIK is normal, but didn't happen before). Yes, that's normal and not related to this problem. Note that the 'Attempted to destroy previously destroyed

[Bug 54381] [drm:radeon_atom_pick_pll] *ERROR* unable to allocate a PPLL

2013-09-20 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=54381 --- Comment #15 from Andrew Stubbs a...@codesourcery.com --- I fixed the problem now! (At least, for my own needs.) The patch turns out to be very simple. 1. Disregard the mode setting (why does the PPLL care?) 2. Allow a little leeway in the

[Bug 54381] [drm:radeon_atom_pick_pll] *ERROR* unable to allocate a PPLL

2013-09-20 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=54381 --- Comment #16 from Andrew Stubbs a...@codesourcery.com --- Created attachment 108951 -- https://bugzilla.kernel.org/attachment.cgi?id=108951action=edit Proposed patch -- You are receiving this mail because: You are watching the assignee of

[edid-decode] Finish the list of 3D layouts 3D_Structure_ALL can code for

2013-09-20 Thread Damien Lespiau
Signed-off-by: Damien Lespiau damien.lesp...@intel.com --- edid-decode.c | 20 +--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/edid-decode.c b/edid-decode.c index bf0c3da..d3e3118 100644 --- a/edid-decode.c +++ b/edid-decode.c @@ -829,12 +829,26 @@

[patch] drm/i915: cleanup a min_t() cast

2013-09-20 Thread Dan Carpenter
The lower layers of sysfs will not allow an offset of more than GEN7_L3LOG_SIZE and also l3_access_valid() caps it a second time. But it's a little easier to audit if we don't have to worry that the subtraction will result in negative values. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com

[Bug 69463] RadeonSI : xserver crashes with Segmentation Fault

2013-09-20 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=69463 --- Comment #7 from samit vats hysv...@gmail.com --- The Debug output with EGL_DRIVER=egl_dri2 II) [KMS] Kernel modesetting enabled. libEGL debug: Native platform type: drm (environment overwrite) libEGL debug: ignore EGL_DRIVERS_PATH for

Re: [git pull] drm radeon/nouveau/core fixes

2013-09-20 Thread Dieter Nützel
Am 19.09.2013 04:07, schrieb Dave Airlie: Hi Linus, mostly radeon fixes, with some nouveau bios parser, ttm fix and a fix for AST driver. Dave. The following changes since commit 01172772c7c973debf5b4881fcb9463891ea97ec: drm/nouveau: fix oops on runtime suspend/resume (2013-09-10

Re: [git pull] drm radeon/nouveau/core fixes

2013-09-20 Thread Alex Deucher
On Fri, Sep 20, 2013 at 8:01 AM, Dieter Nützel die...@nuetzel-hh.de wrote: Am 19.09.2013 04:07, schrieb Dave Airlie: Hi Linus, mostly radeon fixes, with some nouveau bios parser, ttm fix and a fix for AST driver. Dave. The following changes since commit

[PATCH 1/1] drm/radeon: Make r100_cp_ring_info() and radeon_ring_gfx() safe

2013-09-20 Thread Alex Ivanov
Prevent NULL pointer dereference in case when radeon_ring_fini() did it's job. Reading of r100_cp_ring_info and radeon_ring_gfx debugfs entries will lead to a KP if ring buffer was deallocated, e.g. on failed ring test. Seen on PA-RISC machine having radeon: ring test failed

Re: [PATCH 14/20] drm: Implement timings adjustments for frame packing

2013-09-20 Thread Ville Syrjälä
On Thu, Sep 19, 2013 at 05:40:29PM +0100, Damien Lespiau wrote: When using the frame packing and a single big framebuffer, some hardware requires that we do everything like if we were scanning out the big buffer itself. Let's instrument drm_mode_set_crtcinfo() to be able to do this adjustement

[Bug 69463] RadeonSI : xserver crashes with Segmentation Fault

2013-09-20 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=69463 --- Comment #8 from Michel Dänzer mic...@daenzer.net --- (In reply to comment #7) The Debug output with EGL_DRIVER=egl_dri2 Yet another crash... Can you get a backtrace for this one with gdb? You'll need to do that from a remote shell, e.g.

gma500: remove double free in psbfb_create

2013-09-20 Thread Dave Jones
This code appears to be calling psb_gtt_free_range twice with the same args. (The second call didn't appear in the diff output, it's right after the mutex_unlock) Spotted with Coverity, not tested due to lack of hardware. Signed-off-by: Dave Jones da...@fedoraproject.org diff --git

Re: [PATCH] radeon: fix pitch alignment for non-power-of-two mipmaps on SI

2013-09-20 Thread Michel Dänzer
On Don, 2013-09-19 at 18:37 +0200, Marek Olšák wrote: On Thu, Sep 19, 2013 at 4:41 PM, Michel Dänzer mic...@daenzer.net wrote: On Don, 2013-09-19 at 14:33 +0200, Marek Olšák wrote: This fixes VM protection faults. I have a new piglit test which can iterate over all possible widths,

Re: [PATCH 17/20] drm/i915: Use adjusted_mode in the fastboot hack to disable pfit

2013-09-20 Thread Ville Syrjälä
On Thu, Sep 19, 2013 at 05:40:32PM +0100, Damien Lespiau wrote: When booting with i915.fastboot=1, we always take tha code path and end up undoing what we're trying to do with adjusted_mode. Hopefully, as the fastboot hardware readout code is using adjusted_mode as well, it should be

Re: [PATCH 17/20] drm/i915: Use adjusted_mode in the fastboot hack to disable pfit

2013-09-20 Thread Damien Lespiau
On Fri, Sep 20, 2013 at 05:54:55PM +0300, Ville Syrjälä wrote: On Thu, Sep 19, 2013 at 05:40:32PM +0100, Damien Lespiau wrote: When booting with i915.fastboot=1, we always take tha code path and end up undoing what we're trying to do with adjusted_mode. Hopefully, as the fastboot

Re: [PATCH] radeon: fix pitch alignment for non-power-of-two mipmaps on SI

2013-09-20 Thread Marek Olšák
I agree we should make npix_x/y/z more useful, but at the same time it's a public interface and current and old Mesa depends on the seemingly incorrect values we set there. This wouldn't be an issue if we merged the allocator to Mesa, along with xf86-video-ati. Who's with me? :) In particular, I

[Bug 64810] EGL/Gles/Weston give segfault on RADEONSI with egl_gallium.so

2013-09-20 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=64810 --- Comment #27 from Rafael Castillo jrch2...@gmail.com --- many thanks for your hard work, ill test it tonight and report back -- You are receiving this mail because: You are the assignee for the bug.

Re: HDMI stereo support v5

2013-09-20 Thread Ville Syrjälä
On Thu, Sep 19, 2013 at 05:40:15PM +0100, Damien Lespiau wrote: v4 was: http://lists.freedesktop.org/archives/dri-devel/2013-September/045340.html Changes from v4: - The kernel is now in charge of adjusting the stereo mode timings. - There is a per-connector opt-in boolean to expose

Re: [PATCH 17/20] drm/i915: Use adjusted_mode in the fastboot hack to disable pfit

2013-09-20 Thread Jesse Barnes
On Fri, 20 Sep 2013 16:33:47 +0100 Damien Lespiau damien.lesp...@intel.com wrote: On Fri, Sep 20, 2013 at 05:54:55PM +0300, Ville Syrjälä wrote: On Thu, Sep 19, 2013 at 05:40:32PM +0100, Damien Lespiau wrote: When booting with i915.fastboot=1, we always take tha code path and end up

[Bug 69623] Pink Pony misrenders - - shader requires 126 registers

2013-09-20 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=69623 Laurent carlier lordhea...@gmail.com changed: What|Removed |Added Attachment #86224|text/plain |image/png

[Bug 60182] X.Org Server terminate when I close video player

2013-09-20 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=60182 --- Comment #35 from Jose P. lbdkm...@sharklasers.com --- (In reply to comment #34) (In reply to comment #33) (which AFAIK is normal, but didn't happen before). Yes, that's normal and not related to this problem. Note that the 'Attempted

Re: [PATCH 1/1] drm/radeon: Make r100_cp_ring_info() and radeon_ring_gfx() safe

2013-09-20 Thread Alex Deucher
On Fri, Sep 20, 2013 at 9:36 AM, Alex Ivanov gnido...@p0n4ik.tk wrote: Prevent NULL pointer dereference in case when radeon_ring_fini() did it's job. Reading of r100_cp_ring_info and radeon_ring_gfx debugfs entries will lead to a KP if ring buffer was deallocated, e.g. on failed ring test.

[PATCH 0/2] Add runtime PM support to radeon

2013-09-20 Thread Alex Deucher
This is a minor cleanup of Dave's initial patches to add runtime PM to radeon powerxpress laptops. It seems to work well on PX laptop I have access to at the moment. This patch set requires kernel 3.12. Dave Airlie (2): drm/radeon: convert to pmops drm/radeon: add runtime PM support (v2)

[PATCH 1/2] drm/radeon: convert to pmops

2013-09-20 Thread Alex Deucher
From: Dave Airlie airl...@redhat.com This is a pre-requisite for runtime pm on powerxpress systems. Signed-off-by: Alex Deucher alexander.deuc...@amd.com --- drivers/gpu/drm/radeon/radeon.h| 4 +-- drivers/gpu/drm/radeon/radeon_device.c | 27 +--

Re: gma500: remove double free in psbfb_create

2013-09-20 Thread Patrik Jakobsson
On Fri, Sep 20, 2013 at 3:56 PM, Dave Jones da...@redhat.com wrote: This code appears to be calling psb_gtt_free_range twice with the same args. (The second call didn't appear in the diff output, it's right after the mutex_unlock) Spotted with Coverity, not tested due to lack of hardware.

Re: [patch] drm/i915: cleanup a min_t() cast

2013-09-20 Thread Daniel Vetter
On Fri, Sep 20, 2013 at 02:20:18PM +0300, Dan Carpenter wrote: The lower layers of sysfs will not allow an offset of more than GEN7_L3LOG_SIZE and also l3_access_valid() caps it a second time. But it's a little easier to audit if we don't have to worry that the subtraction will result in

[Bug 66738] System freeze randomly with latest kernel 3.10 (also 3.11-rc4)

2013-09-20 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=66738 --- Comment #14 from lh jarry...@gmail.com --- problem still exist in kernel git 20130918 -- You are receiving this mail because: You are the assignee for the bug. ___ dri-devel mailing list

Re: [PATCH 2/2] drm/radeon: add runtime PM support (v2)

2013-09-20 Thread Alex Deucher
On Fri, Sep 20, 2013 at 4:25 PM, Mike Lothian m...@fireburn.co.uk wrote: Hi Is there an easy way to check this is on? It's on by default if your system is a powerxpress system (hybrid laptop). I have radeon.dynpm=1 in grub but usually when I use switcheroo I see messages saying the card if

Re: drm/radeon: ring test failed on PA-RISC Linux

2013-09-20 Thread Alex Deucher
On Tue, Sep 17, 2013 at 3:33 PM, Alex Ivanov gnido...@p0n4ik.tk wrote: 17.09.2013, в 18:24, Alex Deucher alexdeuc...@gmail.com написал(а): On Tue, Sep 17, 2013 at 5:23 AM, Alex Ivanov gnido...@p0n4ik.tk wrote: Alex, 10.09.2013, в 16:37, Alex Deucher alexdeuc...@gmail.com написал(а): The

[PATCH 2/2] drm/radeon: add runtime PM support (v2)

2013-09-20 Thread Alex Deucher
From: Dave Airlie airl...@redhat.com This hooks radeon up to the runtime PM system to enable dynamic power management for secondary GPUs in switchable and powerxpress laptops. v2: agd5f: clean up, add module parameter Signed-off-by: Dave Airlie airl...@redhat.com Signed-off-by: Alex Deucher

[Bug 69623] New: Pink Pony misrenders - - shader requires 126 registers

2013-09-20 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=69623 Priority: medium Bug ID: 69623 Assignee: dri-devel@lists.freedesktop.org Summary: Pink Pony misrenders - - shader requires 126 registers Severity: normal Classification: Unclassified

[Bug 55951] [regression] Torchlight segfault at start with Mesa 9.0/git

2013-09-20 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=55951 --- Comment #1 from Sven Arvidsson s...@whiz.se --- This is still a problem with Mesa 9.2 and the game build from 2013-05-21, but something has changed, now I get a BadDrawable error and the game exits so there's no crash or backtrace to get: X

Re: [PATCH 2/2] drm/radeon: add runtime PM support (v2)

2013-09-20 Thread Alex Deucher
On Fri, Sep 20, 2013 at 6:10 PM, Mike Lothian m...@fireburn.co.uk wrote: Sorry that was a typo on my part. I'm using radeon.runpm=1 I can see audio is switched off [drm] Disabling audio 0 support When I use DRI_PRIME=1 I see the DRM initialisation for my card each time I fire up an

Re: [PATCH 2/2] drm/radeon: add runtime PM support (v2)

2013-09-20 Thread Dave Airlie
On Sat, Sep 21, 2013 at 8:30 AM, Mike Lothian m...@fireburn.co.uk wrote: It's probably easier if I just show you this: http://pastebin.com/xpBJkZDw Is that expected behaviour? I'm used to seeing something more definite when echoing OFF into /sys/kernel/debug/vgaswitcheroo/switch I've just

Re: [PATCH] drm/edid: compare actual vrefresh for all modes for quirks

2013-09-20 Thread Alex Deucher
On Thu, Aug 15, 2013 at 11:48 AM, Alex Deucher alexdeuc...@gmail.com wrote: The vrefresh field of the mode is 0 for most modes fetched from the EDID (e.g., established timings). When dealing with monitors that have a bogus preferred mode, we may not always select the mode we want because we

[Bug 64810] EGL/Gles/Weston give segfault on RADEONSI with egl_gallium.so

2013-09-20 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=64810 --- Comment #28 from Rafael Castillo jrch2...@gmail.com --- Sadly this patch breaks mesa to the point glamor/xinit/weston hangs my 7770 -- You are receiving this mail because: You are the assignee for the bug.

[Bug 37117] configure fails in git/master

2013-09-20 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=37117 --- Comment #2 from Antonio Alecrim Jr antonio.alec...@gmail.com --- Just for records: Check the the comment bug 57018#c3 -- You are receiving this mail because: You are the assignee for the bug. ___

[Bug 68451] Texture flicker in native Dota2 in mesa 9.2.0rc1

2013-09-20 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=68451 --- Comment #22 from Alexandre Demers alexandre.f.dem...@gmail.com --- Doesn't seem to fix anything over here. -- You are receiving this mail because: You are the assignee for the bug. ___ dri-devel

[Bug 66067] Trine 2's fragment normal buffer is mixtextured on Radeon HD 6770 (Juniper)

2013-09-20 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=66067 --- Comment #13 from Roland Scheidegger srol...@vmware.com --- (In reply to comment #12) (In reply to comment #11) ARB_fragment_program_shadow may leave it undefined, but the GL spec ... Which spec exactly? GL specifications only cover

Re: drm/radeon: ring test failed on PA-RISC Linux

2013-09-20 Thread Alex Ivanov
21.09.2013, в 1:27, Alex Deucher alexdeuc...@gmail.com написал(а): On Tue, Sep 17, 2013 at 3:33 PM, Alex Ivanov gnido...@p0n4ik.tk wrote: 17.09.2013, в 18:24, Alex Deucher alexdeuc...@gmail.com написал(а): On Tue, Sep 17, 2013 at 5:23 AM, Alex Ivanov gnido...@p0n4ik.tk wrote: Alex,

[Bug 68802] Blu-ray playback fine on UVD in mplayer2, but stutter in XBMC

2013-09-20 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=68802 --- Comment #2 from russianneuroman...@ya.ru --- Probably should be solved by this: http://cgit.freedesktop.org/~deathsimple/mesa/commit/?id=9334f7d0f16738b4817e853d6d8cb1432953abfb -- You are receiving this mail because: You are the assignee

[PATCH 2/2] drm/radeon: add runtime PM support (v2)

2013-09-20 Thread Mike Lothian
ler_kms(DRM_IRQ_ARGS) > { > struct drm_device *dev = (struct drm_device *) arg; > struct radeon_device *rdev = dev->dev_private; > + irqreturn_t ret; > > - return radeon_irq_process(rdev); > + ret = radeon_irq_process(rdev); > + if (ret == IRQ_HANDLED) > + pm_runtime_mark_last_busy(dev->dev); > + return ret; > } > > /* > diff --git a/drivers/gpu/drm/radeon/radeon_kms.c > b/drivers/gpu/drm/radeon/radeon_kms.c > index 61580dd..b51 100644 > --- a/drivers/gpu/drm/radeon/radeon_kms.c > +++ b/drivers/gpu/drm/radeon/radeon_kms.c > @@ -32,7 +32,7 @@ > > #include > #include > - > +#include > /** > * radeon_driver_unload_kms - Main unload function for KMS. > * > @@ -50,9 +50,14 @@ int radeon_driver_unload_kms(struct drm_device *dev) > > if (rdev == NULL) > return 0; > + > if (rdev->rmmio == NULL) > goto done_free; > + > + pm_runtime_get_sync(dev->dev); > + > radeon_acpi_fini(rdev); > + > radeon_modeset_fini(rdev); > radeon_device_fini(rdev); > > @@ -125,9 +130,20 @@ int radeon_driver_load_kms(struct drm_device *dev, > unsigned long flags) > "Error during ACPI methods call\n"); > } > > + if (radeon_runtime_pm != 0) { > + pm_runtime_use_autosuspend(dev->dev); > + pm_runtime_set_autosuspend_delay(dev->dev, 5000); > + pm_runtime_set_active(dev->dev); > + pm_runtime_allow(dev->dev); > + pm_runtime_mark_last_busy(dev->dev); > + pm_runtime_put_autosuspend(dev->dev); > + } > + > out: > if (r) > radeon_driver_unload_kms(dev); > + > + > return r; > } > > @@ -475,9 +491,14 @@ void radeon_driver_lastclose_kms(struct drm_device > *dev) > int radeon_driver_open_kms(struct drm_device *dev, struct drm_file > *file_priv) > { > struct radeon_device *rdev = dev->dev_private; > + int r; > > file_priv->driver_priv = NULL; > > + r = pm_runtime_get_sync(dev->dev); > + if (r < 0) > + return r; > + > /* new gpu have virtual address space support */ > if (rdev->family >= CHIP_CAYMAN) { > struct radeon_fpriv *fpriv; > @@ -506,6 +527,9 @@ int radeon_driver_open_kms(struct drm_device *dev, > struct drm_file *file_priv) > > file_priv->driver_priv = fpriv; > } > + > + pm_runtime_mark_last_busy(dev->dev); > + pm_runtime_put_autosuspend(dev->dev); > return 0; > } > > -- > 1.8.3.1 > > ___ > dri-devel mailing list > dri-devel at lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/dri-devel > -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20130920/cb790232/attachment-0001.html>

[PATCH 2/2] drm/radeon: add runtime PM support (v2)

2013-09-20 Thread Mike Lothian
crtc > >> active\n"); > >> + return -EBUSY; > >> + } > >> + } > >> + > >> + pm_runtime_mark_last_busy(dev); > >> + pm_runtime_autosuspend(dev); > >> + /* we don't want the main rpm_idle to call suspend - we want to > >> autosuspend */ > >> + return 1; > >> +} > >> + > >> +long radeon_drm_ioctl(struct file *filp, > >> + unsigned int cmd, unsigned long arg) > >> +{ > >> + struct drm_file *file_priv = filp->private_data; > >> + struct drm_device *dev; > >> + long ret; > >> + dev = file_priv->minor->dev; > >> + ret = pm_runtime_get_sync(dev->dev); > >> + if (ret < 0) > >> + return ret; > >> + > >> + ret = drm_ioctl(filp, cmd, arg); > >> + > >> + pm_runtime_mark_last_busy(dev->dev); > >> + pm_runtime_put_autosuspend(dev->dev); > >> + return ret; > >> } > >> > >> static const struct dev_pm_ops radeon_pm_ops = { > >> @@ -388,13 +489,16 @@ static const struct dev_pm_ops radeon_pm_ops = { > >> .thaw = radeon_pmops_thaw, > >> .poweroff = radeon_pmops_freeze, > >> .restore = radeon_pmops_resume, > >> + .runtime_suspend = radeon_pmops_runtime_suspend, > >> + .runtime_resume = radeon_pmops_runtime_resume, > >> + .runtime_idle = radeon_pmops_runtime_idle, > >> }; > >> > >> static const struct file_operations radeon_driver_kms_fops = { > >> .owner = THIS_MODULE, > >> .open = drm_open, > >> .release = drm_release, > >> - .unlocked_ioctl = drm_ioctl, > >> + .unlocked_ioctl = radeon_drm_ioctl, > >> .mmap = radeon_mmap, > >> .poll = drm_poll, > >> .read = drm_read, > >> diff --git a/drivers/gpu/drm/radeon/radeon_drv.h > >> b/drivers/gpu/drm/radeon/radeon_drv.h > >> index b369d42..543dcfa 100644 > >> --- a/drivers/gpu/drm/radeon/radeon_drv.h > >> +++ b/drivers/gpu/drm/radeon/radeon_drv.h > >> @@ -113,6 +113,9 @@ > >> #define DRIVER_MINOR 33 > >> #define DRIVER_PATCHLEVEL 0 > >> > >> +long radeon_drm_ioctl(struct file *filp, > >> + unsigned int cmd, unsigned long arg); > >> + > >> /* The rest of the file is DEPRECATED! */ > >> #ifdef CONFIG_DRM_RADEON_UMS > >> > >> diff --git a/drivers/gpu/drm/radeon/radeon_ioc32.c > >> b/drivers/gpu/drm/radeon/radeon_ioc32.c > >> index c180df8..bdb0f93 100644 > >> --- a/drivers/gpu/drm/radeon/radeon_ioc32.c > >> +++ b/drivers/gpu/drm/radeon/radeon_ioc32.c > >> @@ -418,7 +418,7 @@ long radeon_kms_compat_ioctl(struct file *filp, > >> unsigned int cmd, unsigned long > >> if (nr < DRM_COMMAND_BASE) > >> return drm_compat_ioctl(filp, cmd, arg); > >> > >> - ret = drm_ioctl(filp, cmd, arg); > >> + ret = radeon_drm_ioctl(filp, cmd, arg); > >> > >> return ret; > >> } > >> diff --git a/drivers/gpu/drm/radeon/radeon_irq_kms.c > >> b/drivers/gpu/drm/radeon/radeon_irq_kms.c > >> index cc9e848..ec6240b 100644 > >> --- a/drivers/gpu/drm/radeon/radeon_irq_kms.c > >> +++ b/drivers/gpu/drm/radeon/radeon_irq_kms.c > >> @@ -32,6 +32,8 @@ > >> #include "radeon.h" > >> #include "atom.h" > >> > >> +#include > >> + > >> #define RADEON_WAIT_IDLE_TIMEOUT 200 > >> > >> /** > >> @@ -47,8 +49,12 @@ irqreturn_t > radeon_driver_irq_handler_kms(DRM_IRQ_ARGS) > >> { > >> struct drm_device *dev = (struct drm_device *) arg; > >> struct radeon_device *rdev = dev->dev_private; > >> + irqreturn_t ret; > >> > >> - return radeon_irq_process(rdev); > >> + ret = radeon_irq_process(rdev); > >> + if (ret == IRQ_HANDLED) > >> + pm_runtime_mark_last_busy(dev->dev); > >> + return ret; > >> } > >> > >> /* > >> diff --git a/drivers/gpu/drm/radeon/radeon_kms.c > >> b/drivers/gpu/drm/radeon/radeon_kms.c > >> index 61580dd..b51 100644 > >> --- a/drivers/gpu/drm/radeon/radeon_kms.c > >> +++ b/drivers/gpu/drm/radeon/radeon_kms.c > >> @@ -32,7 +32,7 @@ > >> > >> #include > >> #include > >> - > >> +#include > >> /** > >> * radeon_driver_unload_kms - Main unload function for KMS. > >> * > >> @@ -50,9 +50,14 @@ int radeon_driver_unload_kms(struct drm_device *dev) > >> > >> if (rdev == NULL) > >> return 0; > >> + > >> if (rdev->rmmio == NULL) > >> goto done_free; > >> + > >> + pm_runtime_get_sync(dev->dev); > >> + > >> radeon_acpi_fini(rdev); > >> + > >> radeon_modeset_fini(rdev); > >> radeon_device_fini(rdev); > >> > >> @@ -125,9 +130,20 @@ int radeon_driver_load_kms(struct drm_device *dev, > >> unsigned long flags) > >> "Error during ACPI methods call\n"); > >> } > >> > >> + if (radeon_runtime_pm != 0) { > >> + pm_runtime_use_autosuspend(dev->dev); > >> + pm_runtime_set_autosuspend_delay(dev->dev, 5000); > >> + pm_runtime_set_active(dev->dev); > >> + pm_runtime_allow(dev->dev); > >> + pm_runtime_mark_last_busy(dev->dev); > >> + pm_runtime_put_autosuspend(dev->dev); > >> + } > >> + > >> out: > >> if (r) > >> radeon_driver_unload_kms(dev); > >> + > >> + > >> return r; > >> } > >> > >> @@ -475,9 +491,14 @@ void radeon_driver_lastclose_kms(struct drm_device > >> *dev) > >> int radeon_driver_open_kms(struct drm_device *dev, struct drm_file > >> *file_priv) > >> { > >> struct radeon_device *rdev = dev->dev_private; > >> + int r; > >> > >> file_priv->driver_priv = NULL; > >> > >> + r = pm_runtime_get_sync(dev->dev); > >> + if (r < 0) > >> + return r; > >> + > >> /* new gpu have virtual address space support */ > >> if (rdev->family >= CHIP_CAYMAN) { > >> struct radeon_fpriv *fpriv; > >> @@ -506,6 +527,9 @@ int radeon_driver_open_kms(struct drm_device *dev, > >> struct drm_file *file_priv) > >> > >> file_priv->driver_priv = fpriv; > >> } > >> + > >> + pm_runtime_mark_last_busy(dev->dev); > >> + pm_runtime_put_autosuspend(dev->dev); > >> return 0; > >> } > >> > >> -- > >> 1.8.3.1 > >> > >> ___ > >> dri-devel mailing list > >> dri-devel at lists.freedesktop.org > >> http://lists.freedesktop.org/mailman/listinfo/dri-devel > > > > > -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20130920/d5d3b5d7/attachment-0001.html>

[PATCH 2/2] drm/radeon: add runtime PM support (v2)

2013-09-20 Thread Mike Lothian
gt;> >> struct drm_device *drm_dev = pci_get_drvdata(pdev); > >> >> - return radeon_resume_kms(drm_dev, 0); > >> >> + return radeon_resume_kms(drm_dev, false, true); > >> >> +} > >> >> + > >> >> +static int radeon_pmops_runtime_suspend(struct device *dev) > >> >> +{ > >> >> + struct pci_dev *pdev = to_pci_dev(dev); > >> >> + struct drm_device *drm_dev = pci_get_drvdata(pdev); > >> >> + int ret; > >> >> + > >> >> + if (radeon_runtime_pm == 0) > >> >> + return -EINVAL; > >> >> + > >> >> + drm_dev->switch_power_state = DRM_SWITCH_POWER_CHANGING; > >> >> + drm_kms_helper_poll_disable(drm_dev); > >> >> + vga_switcheroo_set_dynamic_switch(pdev, VGA_SWITCHEROO_OFF); > >> >> + > >> >> + ret = radeon_suspend_kms(drm_dev, false, false); > >> >> + pci_save_state(pdev); > >> >> + pci_disable_device(pdev); > >> >> + pci_set_power_state(pdev, PCI_D3cold); > >> >> + drm_dev->switch_power_state = DRM_SWITCH_POWER_DYNAMIC_OFF; > >> >> + > >> >> + return 0; > >> >> +} > >> >> + > >> >> +static int radeon_pmops_runtime_resume(struct device *dev) > >> >> +{ > >> >> + struct pci_dev *pdev = to_pci_dev(dev); > >> >> + struct drm_device *drm_dev = pci_get_drvdata(pdev); > >> >> + int ret; > >> >> + > >> >> + if (radeon_runtime_pm == 0) > >> >> + return -EINVAL; > >> >> + > >> >> + drm_dev->switch_power_state = DRM_SWITCH_POWER_CHANGING; > >> >> + > >> >> + pci_set_power_state(pdev, PCI_D0); > >> >> + pci_restore_state(pdev); > >> >> + ret = pci_enable_device(pdev); > >> >> + if (ret) > >> >> + return ret; > >> >> + pci_set_master(pdev); > >> >> + > >> >> + ret = radeon_resume_kms(drm_dev, false, false); > >> >> + drm_kms_helper_poll_enable(drm_dev); > >> >> + vga_switcheroo_set_dynamic_switch(pdev, VGA_SWITCHEROO_ON); > >> >> + drm_dev->switch_power_state = DRM_SWITCH_POWER_ON; > >> >> + return 0; > >> >> +} > >> >> + > >> >> +static int radeon_pmops_runtime_idle(struct device *dev) > >> >> +{ > >> >> + struct pci_dev *pdev = to_pci_dev(dev); > >> >> + struct drm_device *drm_dev = pci_get_drvdata(pdev); > >> >> + struct drm_crtc *crtc; > >> >> + > >> >> + if (radeon_runtime_pm == 0) > >> >> + return -EBUSY; > >> >> + > >> >> + /* are we PX enabled? */ > >> >> + if (radeon_runtime_pm == -1 && !radeon_is_px()) { > >> >> + DRM_DEBUG_DRIVER("failing to power off - not px\n"); > >> >> + return -EBUSY; > >> >> + } > >> >> + > >> >> + list_for_each_entry(crtc, _dev->mode_config.crtc_list, > >> >> head) { > >> >> + if (crtc->enabled) { > >> >> + DRM_DEBUG_DRIVER("failing to power off - crtc > >> >> active\n"); > >> >> + return -EBUSY; > >> >> + } > >> >> + } > >> >> + > >> >> + pm_runtime_mark_last_busy(dev); > >> >> + pm_runtime_autosuspend(dev); > >> >> + /* we don't want the main rpm_idle to call suspend - we want > to > >> >> autosuspend */ > >> >> + return 1; > >> >> +} > >> >> + > >> >> +long radeon_drm_ioctl(struct file *filp, > >> >> + unsigned int cmd, unsigned long arg) > >> >> +{ > >> >> + struct drm_file *file_priv = filp->private_data; > >> >> + struct drm_device *dev; > >> >> + long ret; > >> >> + dev = file_priv->minor->dev; > >> >> + ret = pm_runtime_get_sync(dev->dev); > >> >> + if (ret < 0) > >> >> + return ret; > >> >> + > >> >> + ret = drm_ioctl(filp, cmd, arg); > >> >> + > >> >> + pm_runtime_mark_last_busy(dev->dev); > >> >> + pm_runtime_put_autosuspend(dev->dev); > >> >> + return ret; > >> >> } > >> >> > >> >> static const struct dev_pm_ops radeon_pm_ops = { > >> >> @@ -388,13 +489,16 @@ static const struct dev_pm_ops radeon_pm_ops = > { > >> >> .thaw = radeon_pmops_thaw, > >> >> .poweroff = radeon_pmops_freeze, > >> >> .restore = radeon_pmops_resume, > >> >> + .runtime_suspend = radeon_pmops_runtime_suspend, > >> >> + .runtime_resume = radeon_pmops_runtime_resume, > >> >> + .runtime_idle = radeon_pmops_runtime_idle, > >> >> }; > >> >> > >> >> static const struct file_operations radeon_driver_kms_fops = { > >> >> .owner = THIS_MODULE, > >> >> .open = drm_open, > >> >> .release = drm_release, > >> >> - .unlocked_ioctl = drm_ioctl, > >> >> + .unlocked_ioctl = radeon_drm_ioctl, > >> >> .mmap = radeon_mmap, > >> >> .poll = drm_poll, > >> >> .read = drm_read, > >> >> diff --git a/drivers/gpu/drm/radeon/radeon_drv.h > >> >> b/drivers/gpu/drm/radeon/radeon_drv.h > >> >> index b369d42..543dcfa 100644 > >> >> --- a/drivers/gpu/drm/radeon/radeon_drv.h > >> >> +++ b/drivers/gpu/drm/radeon/radeon_drv.h > >> >> @@ -113,6 +113,9 @@ > >> >> #define DRIVER_MINOR 33 > >> >> #define DRIVER_PATCHLEVEL 0 > >> >> > >> >> +long radeon_drm_ioctl(struct file *filp, > >> >> + unsigned int cmd, unsigned long arg); > >> >> + > >> >> /* The rest of the file is DEPRECATED! */ > >> >> #ifdef CONFIG_DRM_RADEON_UMS > >> >> > >> >> diff --git a/drivers/gpu/drm/radeon/radeon_ioc32.c > >> >> b/drivers/gpu/drm/radeon/radeon_ioc32.c > >> >> index c180df8..bdb0f93 100644 > >> >> --- a/drivers/gpu/drm/radeon/radeon_ioc32.c > >> >> +++ b/drivers/gpu/drm/radeon/radeon_ioc32.c > >> >> @@ -418,7 +418,7 @@ long radeon_kms_compat_ioctl(struct file *filp, > >> >> unsigned int cmd, unsigned long > >> >> if (nr < DRM_COMMAND_BASE) > >> >> return drm_compat_ioctl(filp, cmd, arg); > >> >> > >> >> - ret = drm_ioctl(filp, cmd, arg); > >> >> + ret = radeon_drm_ioctl(filp, cmd, arg); > >> >> > >> >> return ret; > >> >> } > >> >> diff --git a/drivers/gpu/drm/radeon/radeon_irq_kms.c > >> >> b/drivers/gpu/drm/radeon/radeon_irq_kms.c > >> >> index cc9e848..ec6240b 100644 > >> >> --- a/drivers/gpu/drm/radeon/radeon_irq_kms.c > >> >> +++ b/drivers/gpu/drm/radeon/radeon_irq_kms.c > >> >> @@ -32,6 +32,8 @@ > >> >> #include "radeon.h" > >> >> #include "atom.h" > >> >> > >> >> +#include > >> >> + > >> >> #define RADEON_WAIT_IDLE_TIMEOUT 200 > >> >> > >> >> /** > >> >> @@ -47,8 +49,12 @@ irqreturn_t > >> >> radeon_driver_irq_handler_kms(DRM_IRQ_ARGS) > >> >> { > >> >> struct drm_device *dev = (struct drm_device *) arg; > >> >> struct radeon_device *rdev = dev->dev_private; > >> >> + irqreturn_t ret; > >> >> > >> >> - return radeon_irq_process(rdev); > >> >> + ret = radeon_irq_process(rdev); > >> >> + if (ret == IRQ_HANDLED) > >> >> + pm_runtime_mark_last_busy(dev->dev); > >> >> + return ret; > >> >> } > >> >> > >> >> /* > >> >> diff --git a/drivers/gpu/drm/radeon/radeon_kms.c > >> >> b/drivers/gpu/drm/radeon/radeon_kms.c > >> >> index 61580dd..b51 100644 > >> >> --- a/drivers/gpu/drm/radeon/radeon_kms.c > >> >> +++ b/drivers/gpu/drm/radeon/radeon_kms.c > >> >> @@ -32,7 +32,7 @@ > >> >> > >> >> #include > >> >> #include > >> >> - > >> >> +#include > >> >> /** > >> >> * radeon_driver_unload_kms - Main unload function for KMS. > >> >> * > >> >> @@ -50,9 +50,14 @@ int radeon_driver_unload_kms(struct drm_device > *dev) > >> >> > >> >> if (rdev == NULL) > >> >> return 0; > >> >> + > >> >> if (rdev->rmmio == NULL) > >> >> goto done_free; > >> >> + > >> >> + pm_runtime_get_sync(dev->dev); > >> >> + > >> >> radeon_acpi_fini(rdev); > >> >> + > >> >> radeon_modeset_fini(rdev); > >> >> radeon_device_fini(rdev); > >> >> > >> >> @@ -125,9 +130,20 @@ int radeon_driver_load_kms(struct drm_device > *dev, > >> >> unsigned long flags) > >> >> "Error during ACPI methods call\n"); > >> >> } > >> >> > >> >> + if (radeon_runtime_pm != 0) { > >> >> + pm_runtime_use_autosuspend(dev->dev); > >> >> + pm_runtime_set_autosuspend_delay(dev->dev, 5000); > >> >> + pm_runtime_set_active(dev->dev); > >> >> + pm_runtime_allow(dev->dev); > >> >> + pm_runtime_mark_last_busy(dev->dev); > >> >> + pm_runtime_put_autosuspend(dev->dev); > >> >> + } > >> >> + > >> >> out: > >> >> if (r) > >> >> radeon_driver_unload_kms(dev); > >> >> + > >> >> + > >> >> return r; > >> >> } > >> >> > >> >> @@ -475,9 +491,14 @@ void radeon_driver_lastclose_kms(struct > drm_device > >> >> *dev) > >> >> int radeon_driver_open_kms(struct drm_device *dev, struct drm_file > >> >> *file_priv) > >> >> { > >> >> struct radeon_device *rdev = dev->dev_private; > >> >> + int r; > >> >> > >> >> file_priv->driver_priv = NULL; > >> >> > >> >> + r = pm_runtime_get_sync(dev->dev); > >> >> + if (r < 0) > >> >> + return r; > >> >> + > >> >> /* new gpu have virtual address space support */ > >> >> if (rdev->family >= CHIP_CAYMAN) { > >> >> struct radeon_fpriv *fpriv; > >> >> @@ -506,6 +527,9 @@ int radeon_driver_open_kms(struct drm_device > *dev, > >> >> struct drm_file *file_priv) > >> >> > >> >> file_priv->driver_priv = fpriv; > >> >> } > >> >> + > >> >> + pm_runtime_mark_last_busy(dev->dev); > >> >> + pm_runtime_put_autosuspend(dev->dev); > >> >> return 0; > >> >> } > >> >> > >> >> -- > >> >> 1.8.3.1 > >> >> > >> >> ___ > >> >> dri-devel mailing list > >> >> dri-devel at lists.freedesktop.org > >> >> http://lists.freedesktop.org/mailman/listinfo/dri-devel > >> > > >> > > -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20130920/f1b1262c/attachment-0001.html>

[PATCH 2/2] drm/radeon: add runtime PM support (v2)

2013-09-20 Thread Mike Lothian
gt;> >> struct drm_device *drm_dev = pci_get_drvdata(pdev); > >> >> - return radeon_resume_kms(drm_dev, 0); > >> >> + return radeon_resume_kms(drm_dev, false, true); > >> >> +} > >> >> + > >> >> +static int radeon_pmops_runtime_suspend(struct device *dev) > >> >> +{ > >> >> + struct pci_dev *pdev = to_pci_dev(dev); > >> >> + struct drm_device *drm_dev = pci_get_drvdata(pdev); > >> >> + int ret; > >> >> + > >> >> + if (radeon_runtime_pm == 0) > >> >> + return -EINVAL; > >> >> + > >> >> + drm_dev->switch_power_state = DRM_SWITCH_POWER_CHANGING; > >> >> + drm_kms_helper_poll_disable(drm_dev); > >> >> + vga_switcheroo_set_dynamic_switch(pdev, VGA_SWITCHEROO_OFF); > >> >> + > >> >> + ret = radeon_suspend_kms(drm_dev, false, false); > >> >> + pci_save_state(pdev); > >> >> + pci_disable_device(pdev); > >> >> + pci_set_power_state(pdev, PCI_D3cold); > >> >> + drm_dev->switch_power_state = DRM_SWITCH_POWER_DYNAMIC_OFF; > >> >> + > >> >> + return 0; > >> >> +} > >> >> + > >> >> +static int radeon_pmops_runtime_resume(struct device *dev) > >> >> +{ > >> >> + struct pci_dev *pdev = to_pci_dev(dev); > >> >> + struct drm_device *drm_dev = pci_get_drvdata(pdev); > >> >> + int ret; > >> >> + > >> >> + if (radeon_runtime_pm == 0) > >> >> + return -EINVAL; > >> >> + > >> >> + drm_dev->switch_power_state = DRM_SWITCH_POWER_CHANGING; > >> >> + > >> >> + pci_set_power_state(pdev, PCI_D0); > >> >> + pci_restore_state(pdev); > >> >> + ret = pci_enable_device(pdev); > >> >> + if (ret) > >> >> + return ret; > >> >> + pci_set_master(pdev); > >> >> + > >> >> + ret = radeon_resume_kms(drm_dev, false, false); > >> >> + drm_kms_helper_poll_enable(drm_dev); > >> >> + vga_switcheroo_set_dynamic_switch(pdev, VGA_SWITCHEROO_ON); > >> >> + drm_dev->switch_power_state = DRM_SWITCH_POWER_ON; > >> >> + return 0; > >> >> +} > >> >> + > >> >> +static int radeon_pmops_runtime_idle(struct device *dev) > >> >> +{ > >> >> + struct pci_dev *pdev = to_pci_dev(dev); > >> >> + struct drm_device *drm_dev = pci_get_drvdata(pdev); > >> >> + struct drm_crtc *crtc; > >> >> + > >> >> + if (radeon_runtime_pm == 0) > >> >> + return -EBUSY; > >> >> + > >> >> + /* are we PX enabled? */ > >> >> + if (radeon_runtime_pm == -1 && !radeon_is_px()) { > >> >> + DRM_DEBUG_DRIVER("failing to power off - not px\n"); > >> >> + return -EBUSY; > >> >> + } > >> >> + > >> >> + list_for_each_entry(crtc, _dev->mode_config.crtc_list, > >> >> head) { > >> >> + if (crtc->enabled) { > >> >> + DRM_DEBUG_DRIVER("failing to power off - crtc > >> >> active\n"); > >> >> + return -EBUSY; > >> >> + } > >> >> + } > >> >> + > >> >> + pm_runtime_mark_last_busy(dev); > >> >> + pm_runtime_autosuspend(dev); > >> >> + /* we don't want the main rpm_idle to call suspend - we want > to > >> >> autosuspend */ > >> >> + return 1; > >> >> +} > >> >> + > >> >> +long radeon_drm_ioctl(struct file *filp, > >> >> + unsigned int cmd, unsigned long arg) > >> >> +{ > >> >> + struct drm_file *file_priv = filp->private_data; > >> >> + struct drm_device *dev; > >> >> + long ret; > >> >> + dev = file_priv->minor->dev; > >> >> + ret = pm_runtime_get_sync(dev->dev); > >> >> + if (ret < 0) > >> >> + return ret; > >> >> + > >> >> + ret = drm_ioctl(filp, cmd, arg); > >> >> + > >> >> + pm_runtime_mark_last_busy(dev->dev); > >> >> + pm_runtime_put_autosuspend(dev->dev); > >> >> + return ret; > >> >> } > >> >> > >> >> static const struct dev_pm_ops radeon_pm_ops = { > >> >> @@ -388,13 +489,16 @@ static const struct dev_pm_ops radeon_pm_ops = > { > >> >> .thaw = radeon_pmops_thaw, > >> >> .poweroff = radeon_pmops_freeze, > >> >> .restore = radeon_pmops_resume, > >> >> + .runtime_suspend = radeon_pmops_runtime_suspend, > >> >> + .runtime_resume = radeon_pmops_runtime_resume, > >> >> + .runtime_idle = radeon_pmops_runtime_idle, > >> >> }; > >> >> > >> >> static const struct file_operations radeon_driver_kms_fops = { > >> >> .owner = THIS_MODULE, > >> >> .open = drm_open, > >> >> .release = drm_release, > >> >> - .unlocked_ioctl = drm_ioctl, > >> >> + .unlocked_ioctl = radeon_drm_ioctl, > >> >> .mmap = radeon_mmap, > >> >> .poll = drm_poll, > >> >> .read = drm_read, > >> >> diff --git a/drivers/gpu/drm/radeon/radeon_drv.h > >> >> b/drivers/gpu/drm/radeon/radeon_drv.h > >> >> index b369d42..543dcfa 100644 > >> >> --- a/drivers/gpu/drm/radeon/radeon_drv.h > >> >> +++ b/drivers/gpu/drm/radeon/radeon_drv.h > >> >> @@ -113,6 +113,9 @@ > >> >> #define DRIVER_MINOR 33 > >> >> #define DRIVER_PATCHLEVEL 0 > >> >> > >> >> +long radeon_drm_ioctl(struct file *filp, > >> >> + unsigned int cmd, unsigned long arg); > >> >> + > >> >> /* The rest of the file is DEPRECATED! */ > >> >> #ifdef CONFIG_DRM_RADEON_UMS > >> >> > >> >> diff --git a/drivers/gpu/drm/radeon/radeon_ioc32.c > >> >> b/drivers/gpu/drm/radeon/radeon_ioc32.c > >> >> index c180df8..bdb0f93 100644 > >> >> --- a/drivers/gpu/drm/radeon/radeon_ioc32.c > >> >> +++ b/drivers/gpu/drm/radeon/radeon_ioc32.c > >> >> @@ -418,7 +418,7 @@ long radeon_kms_compat_ioctl(struct file *filp, > >> >> unsigned int cmd, unsigned long > >> >> if (nr < DRM_COMMAND_BASE) > >> >> return drm_compat_ioctl(filp, cmd, arg); > >> >> > >> >> - ret = drm_ioctl(filp, cmd, arg); > >> >> + ret = radeon_drm_ioctl(filp, cmd, arg); > >> >> > >> >> return ret; > >> >> } > >> >> diff --git a/drivers/gpu/drm/radeon/radeon_irq_kms.c > >> >> b/drivers/gpu/drm/radeon/radeon_irq_kms.c > >> >> index cc9e848..ec6240b 100644 > >> >> --- a/drivers/gpu/drm/radeon/radeon_irq_kms.c > >> >> +++ b/drivers/gpu/drm/radeon/radeon_irq_kms.c > >> >> @@ -32,6 +32,8 @@ > >> >> #include "radeon.h" > >> >> #include "atom.h" > >> >> > >> >> +#include > >> >> + > >> >> #define RADEON_WAIT_IDLE_TIMEOUT 200 > >> >> > >> >> /** > >> >> @@ -47,8 +49,12 @@ irqreturn_t > >> >> radeon_driver_irq_handler_kms(DRM_IRQ_ARGS) > >> >> { > >> >> struct drm_device *dev = (struct drm_device *) arg; > >> >> struct radeon_device *rdev = dev->dev_private; > >> >> + irqreturn_t ret; > >> >> > >> >> - return radeon_irq_process(rdev); > >> >> + ret = radeon_irq_process(rdev); > >> >> + if (ret == IRQ_HANDLED) > >> >> + pm_runtime_mark_last_busy(dev->dev); > >> >> + return ret; > >> >> } > >> >> > >> >> /* > >> >> diff --git a/drivers/gpu/drm/radeon/radeon_kms.c > >> >> b/drivers/gpu/drm/radeon/radeon_kms.c > >> >> index 61580dd..b51 100644 > >> >> --- a/drivers/gpu/drm/radeon/radeon_kms.c > >> >> +++ b/drivers/gpu/drm/radeon/radeon_kms.c > >> >> @@ -32,7 +32,7 @@ > >> >> > >> >> #include > >> >> #include > >> >> - > >> >> +#include > >> >> /** > >> >> * radeon_driver_unload_kms - Main unload function for KMS. > >> >> * > >> >> @@ -50,9 +50,14 @@ int radeon_driver_unload_kms(struct drm_device > *dev) > >> >> > >> >> if (rdev == NULL) > >> >> return 0; > >> >> + > >> >> if (rdev->rmmio == NULL) > >> >> goto done_free; > >> >> + > >> >> + pm_runtime_get_sync(dev->dev); > >> >> + > >> >> radeon_acpi_fini(rdev); > >> >> + > >> >> radeon_modeset_fini(rdev); > >> >> radeon_device_fini(rdev); > >> >> > >> >> @@ -125,9 +130,20 @@ int radeon_driver_load_kms(struct drm_device > *dev, > >> >> unsigned long flags) > >> >> "Error during ACPI methods call\n"); > >> >> } > >> >> > >> >> + if (radeon_runtime_pm != 0) { > >> >> + pm_runtime_use_autosuspend(dev->dev); > >> >> + pm_runtime_set_autosuspend_delay(dev->dev, 5000); > >> >> + pm_runtime_set_active(dev->dev); > >> >> + pm_runtime_allow(dev->dev); > >> >> + pm_runtime_mark_last_busy(dev->dev); > >> >> + pm_runtime_put_autosuspend(dev->dev); > >> >> + } > >> >> + > >> >> out: > >> >> if (r) > >> >> radeon_driver_unload_kms(dev); > >> >> + > >> >> + > >> >> return r; > >> >> } > >> >> > >> >> @@ -475,9 +491,14 @@ void radeon_driver_lastclose_kms(struct > drm_device > >> >> *dev) > >> >> int radeon_driver_open_kms(struct drm_device *dev, struct drm_file > >> >> *file_priv) > >> >> { > >> >> struct radeon_device *rdev = dev->dev_private; > >> >> + int r; > >> >> > >> >> file_priv->driver_priv = NULL; > >> >> > >> >> + r = pm_runtime_get_sync(dev->dev); > >> >> + if (r < 0) > >> >> + return r; > >> >> + > >> >> /* new gpu have virtual address space support */ > >> >> if (rdev->family >= CHIP_CAYMAN) { > >> >> struct radeon_fpriv *fpriv; > >> >> @@ -506,6 +527,9 @@ int radeon_driver_open_kms(struct drm_device > *dev, > >> >> struct drm_file *file_priv) > >> >> > >> >> file_priv->driver_priv = fpriv; > >> >> } > >> >> + > >> >> + pm_runtime_mark_last_busy(dev->dev); > >> >> + pm_runtime_put_autosuspend(dev->dev); > >> >> return 0; > >> >> } > >> >> > >> >> -- > >> >> 1.8.3.1 > >> >> > >> >> ___ > >> >> dri-devel mailing list > >> >> dri-devel at lists.freedesktop.org > >> >> http://lists.freedesktop.org/mailman/listinfo/dri-devel > >> > > >> > > -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20130920/3dc8b580/attachment-0001.html>