GitHub/MotorolaMobilityLLC/kernel-slsi.git
11 years agodrm/radeon: align VM PTBs (Page Table Blocks) to 32K
Alex Deucher [Fri, 12 Jul 2013 19:56:02 +0000 (15:56 -0400)]
drm/radeon: align VM PTBs (Page Table Blocks) to 32K

Covers requirements of all current asics.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
11 years agodrm/radeon: allow selection of alignment in the sub-allocator
Alex Deucher [Fri, 12 Jul 2013 19:46:09 +0000 (15:46 -0400)]
drm/radeon: allow selection of alignment in the sub-allocator

There are cases where we need more than 4k alignment.  No
functional change with this commit.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
11 years agodrm/radeon: never unpin UVD bo v3
Christian König [Fri, 12 Jul 2013 14:18:09 +0000 (10:18 -0400)]
drm/radeon: never unpin UVD bo v3

Changing the UVD BOs offset on suspend/resume doesn't work because the VCPU
internally keeps pointers to it. Just keep it always pinned and save the
content manually.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=66425

v2: fix compiler warning
v3: fix CIK support

Note: a version of this patch needs to go to stable.

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 years agodrm/radeon: fix UVD fence emit
Christian König [Fri, 12 Jul 2013 08:05:47 +0000 (10:05 +0200)]
drm/radeon: fix UVD fence emit

Currently doesn't matter cause we allocate the fence in the
lower 265MB anyway.

Reported-by: Frank Huang <FrankR.Huang@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
11 years agodrm/radeon: add fault decode function for CIK
Alex Deucher [Fri, 14 Jun 2013 14:42:22 +0000 (10:42 -0400)]
drm/radeon: add fault decode function for CIK

Helpful for debugging GPUVM errors as we can see what
hw block and page generated the fault in the log.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 years agodrm/radeon: add fault decode function for SI (v2)
Alex Deucher [Thu, 13 Jun 2013 22:47:58 +0000 (18:47 -0400)]
drm/radeon: add fault decode function for SI (v2)

Helpful for debugging GPUVM errors as we can see what
hw block and page generated the fault in the log.

v2: simplify fault decoding

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
11 years agodrm/radeon: add fault decode function for cayman/TN (v2)
Alex Deucher [Thu, 13 Jun 2013 22:26:25 +0000 (18:26 -0400)]
drm/radeon: add fault decode function for cayman/TN (v2)

Helpful for debugging GPUVM errors as we can see what
hw block and page generated the fault in the log.

v2: simplify fault decoding

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
11 years agodrm/radeon: use radeon device for request firmware
Jerome Glisse [Thu, 11 Jul 2013 19:53:01 +0000 (15:53 -0400)]
drm/radeon: use radeon device for request firmware

Avoid creating temporary platform device that will lead to issue
when several radeon gpu are in same computer. Instead directly use
the radeon device for requesting firmware.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 years agodrm/radeon: add missing ttm_eu_backoff_reservation to radeon_bo_list_validate
Maarten Lankhorst [Wed, 10 Jul 2013 10:26:56 +0000 (12:26 +0200)]
drm/radeon: add missing ttm_eu_backoff_reservation to radeon_bo_list_validate

Op 10-07-13 12:03, Markus Trippelsdorf schreef:
> On 2013.07.10 at 11:56 +0200, Maarten Lankhorst wrote:
>> Op 10-07-13 11:46, Markus Trippelsdorf schreef:
>>> On 2013.07.10 at 11:29 +0200, Maarten Lankhorst wrote:
>>>> Op 10-07-13 11:22, Markus Trippelsdorf schreef:
>>>>> By simply copy/pasting a big document under LibreOffice my system hangs
>>>>> itself up. Only a hard reset gets it working again.
>>>>> see also: https://bugs.freedesktop.org/show_bug.cgi?id=66551
>>>>>
>>>>> I've bisected the issue to:
>>>>>
>>>>> commit ecff665f5e3f1c6909353e00b9420e45ae23d995
>>>>> Author: Maarten Lankhorst <m.b.lankhorst@gmail.com>
>>>>> Date:   Thu Jun 27 13:48:17 2013 +0200
>>>>>
>>>>>     drm/ttm: make ttm reservation calls behave like reservation calls
>>>>>
>>>>>     This commit converts the source of the val_seq counter to
>>>>>     the ww_mutex api. The reservation objects are converted later,
>>>>>     because there is still a lockdep splat in nouveau that has to
>>>>>     resolved first.
>>>>>
>>>>>     Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
>>>>>     Reviewed-by: Jerome Glisse <jglisse@redhat.com>
>>>>>     Signed-off-by: Dave Airlie <airlied@redhat.com>
>>>> Hey,
>>>>
>>>> Can you try current head with CONFIG_PROVE_LOCKING set and post the
>>>> lockdep splat from dmesg, if any? If there is any locking issue
>>>> lockdep should warn about it.  Lockdep will turn itself off after the
>>>> first splat, so if the lockdep splat happens before running the
>>>> affected parts those will have to be fixed first.
>>> There was an unrelated EDAC lockdep splat, so I simply disabled it.
>>>
>>> This is what I get:
>>>
>>> Jul 10 11:40:44 x4 kernel: ================================================
>>> Jul 10 11:40:44 x4 kernel: [ BUG: lock held when returning to user space! ]
>>> Jul 10 11:40:44 x4 kernel: 3.10.0-08587-g496322b #35 Not tainted
>>> Jul 10 11:40:44 x4 kernel: ------------------------------------------------
>>> Jul 10 11:40:44 x4 kernel: X/211 is leaving the kernel with locks still held!
>>> Jul 10 11:40:44 x4 kernel: 2 locks held by X/211:
>>> Jul 10 11:40:44 x4 kernel: #0:  (reservation_ww_class_acquire){+.+.+.}, at: [<ffffffff813279f0>] radeon_bo_list_validate+0x20/0xd0
>>> Jul 10 11:40:44 x4 kernel: #1:  (reservation_ww_class_mutex){+.+.+.}, at: [<ffffffff81309306>] ttm_eu_reserve_buffers+0x126/0x4b0
>>> Jul 10 11:40:52 x4 kernel: SysRq : Emergency Sync
>>> Jul 10 11:40:53 x4 kernel: Emergency Sync complete
>>>
>> Thanks, exactly what I thought. I missed a backoff somewhere..
>>
>> Does the below patch fix it?
> Yes. Thank you for your quick reply.

8<------
If radeon_cs_parser_relocs fails ttm_eu_backoff_reservation doesn't get called.
This left open a bug where ttm_eu_reserve_buffers succeeded but the bo's were
not unlocked afterwards:

Jul 10 11:40:44 x4 kernel: ================================================
Jul 10 11:40:44 x4 kernel: [ BUG: lock held when returning to user space! ]
Jul 10 11:40:44 x4 kernel: 3.10.0-08587-g496322b #35 Not tainted
Jul 10 11:40:44 x4 kernel: ------------------------------------------------
Jul 10 11:40:44 x4 kernel: X/211 is leaving the kernel with locks still held!
Jul 10 11:40:44 x4 kernel: 2 locks held by X/211:
Jul 10 11:40:44 x4 kernel: #0:  (reservation_ww_class_acquire){+.+.+.}, at: [<ffffffff813279f0>] radeon_bo_list_validate+0x20/0xd0
Jul 10 11:40:44 x4 kernel: #1:  (reservation_ww_class_mutex){+.+.+.}, at: [<ffffffff81309306>] ttm_eu_reserve_buffers+0x126/0x4b0
Jul 10 11:40:52 x4 kernel: SysRq : Emergency Sync
Jul 10 11:40:53 x4 kernel: Emergency Sync complete

This is a regression caused by commit ecff665f5e.
"drm/ttm: make ttm reservation calls behave like reservation calls"

Reported-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Tested-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 years agodrm/radeon: use CP DMA on r6xx for bo moves
Alex Deucher [Thu, 11 Jul 2013 18:53:34 +0000 (14:53 -0400)]
drm/radeon: use CP DMA on r6xx for bo moves

Lighter weight than using the 3D engine.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 years agodrm/radeon: implement bo copy callback using CP DMA (v2)
Alex Deucher [Thu, 11 Jul 2013 18:48:05 +0000 (14:48 -0400)]
drm/radeon: implement bo copy callback using CP DMA (v2)

Lighter weight than using the 3D engine.

v2: fix ring count

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 years agodrm/radeon: Disable dma rings for bo moves on r6xx
Alex Deucher [Thu, 11 Jul 2013 18:20:11 +0000 (14:20 -0400)]
drm/radeon: Disable dma rings for bo moves on r6xx

They still seem to cause instability on some r6xx parts.
As a follow up, we can switch to using CP DMA for bo
moves on r6xx as a lighter weight alternative to using
the 3D engine.

A version of this patch should also go to stable kernels.

Tested-by: J.N. <golden.fleeced@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 years agodrm/radeon/dpm: disable gfx PG on PALM
Alex Deucher [Thu, 11 Jul 2013 19:00:14 +0000 (15:00 -0400)]
drm/radeon/dpm: disable gfx PG on PALM

Gfx PG doesn't seem to work properly when UVD is initialized
on certain PALM boards.  Disable gfx PG for now until we sort
out a proper fix.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 years agodrm/radeon/hdmi: make sure we have an afmt block assigned
Alex Deucher [Mon, 8 Jul 2013 22:16:56 +0000 (18:16 -0400)]
drm/radeon/hdmi: make sure we have an afmt block assigned

Prevents a segfault if an afmt block is not assigned to the
encoder such as in the LVDS or eDP case.

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=66714

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
11 years agoMerge branch 'drm-next-3.11' of git://people.freedesktop.org/~agd5f/linux into drm...
Dave Airlie [Tue, 9 Jul 2013 00:49:39 +0000 (10:49 +1000)]
Merge branch 'drm-next-3.11' of git://people.freedesktop.org/~agd5f/linux into drm-next

A few more DPM fixes based on user testing.

* 'drm-next-3.11' of git://people.freedesktop.org/~agd5f/linux:
  drm/radeon/dpm: implement vblank_too_short callback for si
  drm/radeon/dpm: implement vblank_too_short callback for cayman
  drm/radeon/dpm: implement vblank_too_short callback for btc
  drm/radeon/dpm: implement vblank_too_short callback for evergreen
  drm/radeon/dpm: implement vblank_too_short callback for 7xx
  drm/radeon/dpm: add checks against vblank time
  drm/radeon/dpm: add helper to calculate vblank time
  drm/radeon: remove stray line in old pm code
  drm/radeon/dpm: fix display_gap programming on rv7xx
  drm/radeon/dpm: implement force performance level for TN
  drm/radeon/dpm: implement force performance level for ON/LN
  drm/radeon/dpm: implement force performance level for SI
  drm/radeon/dpm: implement force performance level for cayman
  drm/radeon/dpm: implement force performance levels for 7xx/eg/btc
  drm/radeon/dpm: add infrastructure to force performance levels
  drm/radeon: fix surface setup on r1xx
  drm/radeon: add support for 3d perf states on older asics
  drm/radeon: set default clocks for SI when DPM is disabled

11 years agoMerge branch 'drm-nouveau-next' of git://anongit.freedesktop.org/git/nouveau/linux...
Dave Airlie [Tue, 9 Jul 2013 00:48:41 +0000 (10:48 +1000)]
Merge branch 'drm-nouveau-next' of git://anongit.freedesktop.org/git/nouveau/linux-2.6 into drm-next

Two minor fixes for regressions.

* 'drm-nouveau-next' of git://anongit.freedesktop.org/git/nouveau/linux-2.6:
  drm/nvc0/gr: fix gpc firmware regression
  drm/nouveau: fix minor thinko causing bo moves to not be async on kepler

11 years agodrm/radeon/dpm: implement vblank_too_short callback for si
Alex Deucher [Mon, 8 Jul 2013 16:15:11 +0000 (12:15 -0400)]
drm/radeon/dpm: implement vblank_too_short callback for si

Check if we can switch the mclk during the vblank time otherwise
we may get artifacts on the screen when the mclk changes.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 years agodrm/radeon/dpm: implement vblank_too_short callback for cayman
Alex Deucher [Mon, 8 Jul 2013 16:09:41 +0000 (12:09 -0400)]
drm/radeon/dpm: implement vblank_too_short callback for cayman

Check if we can switch the mclk during the vblank time otherwise
we may get artifacts on the screen when the mclk changes.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 years agodrm/radeon/dpm: implement vblank_too_short callback for btc
Alex Deucher [Mon, 8 Jul 2013 16:03:55 +0000 (12:03 -0400)]
drm/radeon/dpm: implement vblank_too_short callback for btc

Check if we can switch the mclk during the vblank time otherwise
we may get artifacts on the screen when the mclk changes.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 years agodrm/radeon/dpm: implement vblank_too_short callback for evergreen
Alex Deucher [Mon, 8 Jul 2013 15:56:09 +0000 (11:56 -0400)]
drm/radeon/dpm: implement vblank_too_short callback for evergreen

Check if we can switch the mclk during the vblank time otherwise
we may get artifacts on the screen when the mclk changes.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 years agodrm/radeon/dpm: implement vblank_too_short callback for 7xx
Alex Deucher [Mon, 8 Jul 2013 15:49:48 +0000 (11:49 -0400)]
drm/radeon/dpm: implement vblank_too_short callback for 7xx

Check if we can switch the mclk during the vblank time otherwise
we may get artifacts on the screen when the mclk changes.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 years agodrm/radeon/dpm: add checks against vblank time
Alex Deucher [Mon, 8 Jul 2013 15:35:06 +0000 (11:35 -0400)]
drm/radeon/dpm: add checks against vblank time

If the vblank time is too short to adjust mclk,
assume multiple displays (no mclk adjustments).

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 years agodrm/radeon/dpm: add helper to calculate vblank time
Alex Deucher [Mon, 8 Jul 2013 15:26:42 +0000 (11:26 -0400)]
drm/radeon/dpm: add helper to calculate vblank time

Required for checking vblank time for mclk changes.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 years agodrm/radeon: remove stray line in old pm code
Alex Deucher [Mon, 8 Jul 2013 21:14:51 +0000 (17:14 -0400)]
drm/radeon: remove stray line in old pm code

Looks like a remnant from an old rebase.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 years agodrm/radeon/dpm: fix display_gap programming on rv7xx
Alex Deucher [Mon, 8 Jul 2013 21:20:13 +0000 (17:20 -0400)]
drm/radeon/dpm: fix display_gap programming on rv7xx

Check the driver state rather than the register as the
crtc registers may not be enabled yet.

Should fix:
https://bugzilla.kernel.org/show_bug.cgi?id=60510
https://bugs.freedesktop.org/show_bug.cgi?id=66651

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 years agodrm/nvc0/gr: fix gpc firmware regression
Maarten Lankhorst [Sun, 7 Jul 2013 08:37:48 +0000 (10:37 +0200)]
drm/nvc0/gr: fix gpc firmware regression

"drm/nve0-/gr: some new gpc registers can have multiple copies"
5ee86c4190f9e caused a regression for nvc0, because the bit indicating last
transfer has occured was no longer set, resulting in random system lockups.

Reported-by: Ronald Uitermark <ronald645@gmail.com>
Tested-by: Ronald Uitermark <ronald645@gmail.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nouveau: fix minor thinko causing bo moves to not be async on kepler
Ben Skeggs [Mon, 8 Jul 2013 00:40:35 +0000 (10:40 +1000)]
drm/nouveau: fix minor thinko causing bo moves to not be async on kepler

Reported-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/radeon/dpm: implement force performance level for TN
Alex Deucher [Tue, 2 Jul 2013 22:52:10 +0000 (18:52 -0400)]
drm/radeon/dpm: implement force performance level for TN

Allows you to force the selected performance level via sysfs.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 years agodrm/radeon/dpm: implement force performance level for ON/LN
Alex Deucher [Tue, 2 Jul 2013 22:50:09 +0000 (18:50 -0400)]
drm/radeon/dpm: implement force performance level for ON/LN

Allows you to force the selected performance level via sysfs.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 years agodrm/radeon/dpm: implement force performance level for SI
Alex Deucher [Tue, 2 Jul 2013 22:46:28 +0000 (18:46 -0400)]
drm/radeon/dpm: implement force performance level for SI

Allows you to force the selected performance level via sysfs.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 years agodrm/radeon/dpm: implement force performance level for cayman
Alex Deucher [Tue, 2 Jul 2013 22:43:53 +0000 (18:43 -0400)]
drm/radeon/dpm: implement force performance level for cayman

Allows you to force a performance level via sysfs.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 years agodrm/radeon/dpm: implement force performance levels for 7xx/eg/btc
Alex Deucher [Tue, 2 Jul 2013 22:40:35 +0000 (18:40 -0400)]
drm/radeon/dpm: implement force performance levels for 7xx/eg/btc

Allows you to limit the selected power levels via sysfs.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 years agodrm/radeon/dpm: add infrastructure to force performance levels
Alex Deucher [Tue, 2 Jul 2013 22:38:02 +0000 (18:38 -0400)]
drm/radeon/dpm: add infrastructure to force performance levels

This allows you to force specific power levels within a power
state.  Due to hardware restrictions between generations, the
interface is limited to the following 3 selections:

auto: all levels enabled
low: forced to the lowest power level
high: forced to the highest power level

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 years agodrm/radeon: fix surface setup on r1xx
Alex Deucher [Fri, 5 Jul 2013 14:05:49 +0000 (10:05 -0400)]
drm/radeon: fix surface setup on r1xx

r1xx asics have a slightly different surface register
setup compared to newer asics.  There is no specific
enable bit for macro tiling, rather, to disable macro
tiling, you need to set the surface pitch to 0.

With this fixed, the special rn50 handling can go.

Noticed-by: Mark Kettenis <mark.kettenis@xs4all.nl>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 years agodrm/radeon: add support for 3d perf states on older asics
Alex Deucher [Fri, 5 Jul 2013 15:48:31 +0000 (11:48 -0400)]
drm/radeon: add support for 3d perf states on older asics

Certain older rv770 asics have both a performance and
a 3D performance state rather than just multiple performance
levels in the state power state.  The current code would
select the performance state rather than the 3D performance
state when the "performance" profile was selected.  This change
switches to the "balanced" profile by default which ends up being
the internal performance profile.  When the user selects the
"performance" profile, it selects the internal 3D performance
state so the user can select the higher performance modes.

For most asics this changes nothing.  For certain rv770 asics
with static performance and 3D performance states, this allows
you to select between then using by selecting the "balanced"
and "performance" dpm profiles.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 years agodrm/radeon: set default clocks for SI when DPM is disabled
Alex Deucher [Fri, 5 Jul 2013 17:14:30 +0000 (13:14 -0400)]
drm/radeon: set default clocks for SI when DPM is disabled

Fix patching of vddc values for SI and enable manually forcing
clocks to default levels as per NI.

This improves the out of the box performance with SI asics.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 years agoMerge branch 'drm-nouveau-next' of git://anongit.freedesktop.org/git/nouveau/linux...
Dave Airlie [Fri, 5 Jul 2013 05:55:12 +0000 (15:55 +1000)]
Merge branch 'drm-nouveau-next' of git://anongit.freedesktop.org/git/nouveau/linux-2.6 into drm-next

- GF117 acceleration support
- GK110 acceleration-with-blob-ucode support, and initial work towards
fixing our own ucode to be suitable.
- Large cleanups of fermi/kepler context handling

* 'drm-nouveau-next' of git://anongit.freedesktop.org/git/nouveau/linux-2.6: (22 commits)
  drm/nva3/disp: Fix HDMI audio regression
  drm/nv50-/disp: Use output specific mask in interrupt
  drm/nouveau: use vmalloc for pgt allocation
  drm/nvc0-/gr: remove some more of the hardcoded register writes
  drm/nvc0-/gr: factor out yet more unknown magic into versioned functions
  drm/nvd7/devinit: use fermi class, not tesla
  drm/nvf0-/gr: ctxsw scratch reg count got bumped to 16
  drm/nvc0-/gr: remove hardcoding of UNK count/mask in GPCCS ucode
  drm/nvf0/gr: build cs ucode for GK110
  drm/nvc0-/gr: extend one of the magic calculations for >4 GPCs
  drm/nvf0/gr: fix ddx shaders locking up on me
  drm/nvc0/devinit: minor typo
  drm/nvf0/gr: enable support, if external cs ucode is available
  drm/nvf0/gr: magic sequence that makes PGRAPH come out of hiding
  drm/nvf0/ce: enable support
  drm/nvf0/fifo: enable support
  drm/nvd7/gr: initial support
  drm/nvc0-/gr: generate cs register lists from grctx data
  drm/nvc0-/gr: tpc regs a subset of gpc, add separate list for gpc/unk regs
  drm/nve0-/gr: some new gpc registers can have multiple copies
  ...

11 years agodrm/cma: remove GEM CMA specific dma_buf functionality
Joonyoung Shim [Fri, 28 Jun 2013 05:24:55 +0000 (14:24 +0900)]
drm/cma: remove GEM CMA specific dma_buf functionality

We can use prime helpers instead.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
11 years agodrm/cma: add low-level hook functions to use prime helpers
Joonyoung Shim [Fri, 28 Jun 2013 05:24:54 +0000 (14:24 +0900)]
drm/cma: add low-level hook functions to use prime helpers

Instead of using the dma_buf functionality for GEM CMA, we can use prime
helpers if we can provide low-level hook functions for GEM CMA.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
11 years agodrm: add mmap function to prime helpers
Joonyoung Shim [Fri, 28 Jun 2013 05:24:53 +0000 (14:24 +0900)]
drm: add mmap function to prime helpers

This adds to call low-level mmap() from prime helpers.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
11 years agodrm/prime: fix sgt NULL checking
Joonyoung Shim [Thu, 4 Jul 2013 07:19:12 +0000 (16:19 +0900)]
drm/prime: fix sgt NULL checking

The drm_gem_map_detach() can be called with sgt is NULL.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
11 years agoMerge branch 'exynos-drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/daein...
Dave Airlie [Fri, 5 Jul 2013 05:35:38 +0000 (15:35 +1000)]
Merge branch 'exynos-drm-next' of git://git./linux/kernel/git/daeinki/drm-exynos into drm-next

 This is final pull request for 3.11. This resolves some memory leak
   issues, and includes some code and dt document file cleanups; just
   removed unnecessary descriptions.

   And the patch work for enhancing hdmiphy driver isn't in progress so
   this patch may go to 3.12.

* 'exynos-drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos:
  drm/exynos: remove duplicated error routine and unnecessary assign
  drm/exynos: fix pages allocation size in lowlevel_buffer_allocate
  drm/exynos: use drm_calloc_large when allocates pointer array
  drm/exynos: add error check routine in exynos_drm_open
  drm/exynos: initialize the buf_num in vp_video_buffer
  drm/exynos: remove dead code in vidi_power_on
  drm/exynos: fix not to remain exynos_gem_obj as a leak
  of/documentation: Update hpd gpio property for exynos_hdmi

11 years agodrm/rcar-du: Fix buffer pitch alignment
Laurent Pinchart [Thu, 4 Jul 2013 18:05:51 +0000 (20:05 +0200)]
drm/rcar-du: Fix buffer pitch alignment

The DU requires a 16 pixels pitch alignement. Make sure dumb buffers are
allocated with the correct pitch, and validate the pitch when creating
frame buffers.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
11 years agodrm/rcar-du: Don't ignore rcar_du_crtc_create() return value
Laurent Pinchart [Thu, 4 Jul 2013 18:05:50 +0000 (20:05 +0200)]
drm/rcar-du: Don't ignore rcar_du_crtc_create() return value

Handle error cases correctly.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
11 years agodrm/nva3/disp: Fix HDMI audio regression
Ilia Mirkin [Wed, 3 Jul 2013 07:06:02 +0000 (03:06 -0400)]
drm/nva3/disp: Fix HDMI audio regression

This is the nva3 counterpart to commit beba44b17 (drm/nv84/disp: Fix
HDMI audio regression). The regression happened as a result of
refactoring in commit 8e9e3d2de (drm/nv84/disp: move hdmi control into
core).

Reported-and-tested-by: Max Baldwin <archerseven@gmail.com>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Cc: stable@vger.kernel.org
11 years agodrm/nv50-/disp: Use output specific mask in interrupt
Emil Velikov [Tue, 2 Jul 2013 13:44:12 +0000 (14:44 +0100)]
drm/nv50-/disp: Use output specific mask in interrupt

The commit

   commit 476e84e126171d809f9c0b5d97137f5055f95ca8
   Author: Ben Skeggs <bskeggs@redhat.com>
   Date:   Mon Feb 11 09:24:23 2013 +1000

       drm/nv50-/disp: initial supervisor support for off-chip encoders

changed the write mask in one of the interrupt functions for on-chip encoders,
causing a regression in certain VGA dual-head setups. This commit reintroduces
the mask thus resolving the regression

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66129
Reported-and-Tested-by: Yves-Alexis <corsac@debian.org>
Cc: stable@vger.kernel.org [3.9+]
CC: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nouveau: use vmalloc for pgt allocation
Marcin Slusarz [Tue, 11 Jun 2013 08:50:30 +0000 (10:50 +0200)]
drm/nouveau: use vmalloc for pgt allocation

Page tables on nv50 take 48kB, which can be hard to allocate in one piece.
Let's use vmalloc.

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Cc: stable@vger.kernel.org [3.7+]
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nvc0-/gr: remove some more of the hardcoded register writes
Ben Skeggs [Fri, 5 Jul 2013 00:47:26 +0000 (10:47 +1000)]
drm/nvc0-/gr: remove some more of the hardcoded register writes

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nvc0-/gr: factor out yet more unknown magic into versioned functions
Ben Skeggs [Fri, 5 Jul 2013 00:26:20 +0000 (10:26 +1000)]
drm/nvc0-/gr: factor out yet more unknown magic into versioned functions

NVC1/NVD9 are the only chipsets that should have anything different
happen on them after this.  We previously weren't doing these
register modifications, and NVIDIA do.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nvd7/devinit: use fermi class, not tesla
Ben Skeggs [Thu, 4 Jul 2013 07:37:23 +0000 (17:37 +1000)]
drm/nvd7/devinit: use fermi class, not tesla

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nvf0-/gr: ctxsw scratch reg count got bumped to 16
Ben Skeggs [Thu, 4 Jul 2013 04:56:38 +0000 (14:56 +1000)]
drm/nvf0-/gr: ctxsw scratch reg count got bumped to 16

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nvc0-/gr: remove hardcoding of UNK count/mask in GPCCS ucode
Ben Skeggs [Thu, 4 Jul 2013 03:49:47 +0000 (13:49 +1000)]
drm/nvc0-/gr: remove hardcoding of UNK count/mask in GPCCS ucode

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nvf0/gr: build cs ucode for GK110
Ben Skeggs [Thu, 4 Jul 2013 03:03:59 +0000 (13:03 +1000)]
drm/nvf0/gr: build cs ucode for GK110

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nvc0-/gr: extend one of the magic calculations for >4 GPCs
Ben Skeggs [Thu, 4 Jul 2013 02:58:16 +0000 (12:58 +1000)]
drm/nvc0-/gr: extend one of the magic calculations for >4 GPCs

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nvf0/gr: fix ddx shaders locking up on me
Ben Skeggs [Thu, 4 Jul 2013 02:54:28 +0000 (12:54 +1000)]
drm/nvf0/gr: fix ddx shaders locking up on me

This can be generalised and used on GK104 (probably even GF117), but lets
just make it work for now.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nvc0/devinit: minor typo
Ben Skeggs [Thu, 4 Jul 2013 01:48:46 +0000 (11:48 +1000)]
drm/nvc0/devinit: minor typo

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nvf0/gr: enable support, if external cs ucode is available
Ben Skeggs [Thu, 4 Jul 2013 01:17:33 +0000 (11:17 +1000)]
drm/nvf0/gr: enable support, if external cs ucode is available

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nvf0/gr: magic sequence that makes PGRAPH come out of hiding
Ben Skeggs [Thu, 4 Jul 2013 01:01:34 +0000 (11:01 +1000)]
drm/nvf0/gr: magic sequence that makes PGRAPH come out of hiding

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nvf0/ce: enable support
Ben Skeggs [Thu, 2 May 2013 02:38:41 +0000 (12:38 +1000)]
drm/nvf0/ce: enable support

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nvf0/fifo: enable support
Ben Skeggs [Thu, 2 May 2013 02:37:38 +0000 (12:37 +1000)]
drm/nvf0/fifo: enable support

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nvd7/gr: initial support
Maarten Lankhorst [Thu, 4 Jul 2013 00:04:30 +0000 (10:04 +1000)]
drm/nvd7/gr: initial support

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nvc0-/gr: generate cs register lists from grctx data
Ben Skeggs [Mon, 1 Jul 2013 05:11:24 +0000 (15:11 +1000)]
drm/nvc0-/gr: generate cs register lists from grctx data

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nvc0-/gr: tpc regs a subset of gpc, add separate list for gpc/unk regs
Ben Skeggs [Mon, 1 Jul 2013 04:48:33 +0000 (14:48 +1000)]
drm/nvc0-/gr: tpc regs a subset of gpc, add separate list for gpc/unk regs

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nve0-/gr: some new gpc registers can have multiple copies
Ben Skeggs [Mon, 1 Jul 2013 04:32:42 +0000 (14:32 +1000)]
drm/nve0-/gr: some new gpc registers can have multiple copies

GK110 exposes more than one, and needs to be dealt with in the ctxsw
ucode just like the TPC sets are.

Broadcast is at +0xe00.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nvc0-/gr: pull out a group of separately context-switched gpc regs
Ben Skeggs [Mon, 1 Jul 2013 00:54:27 +0000 (10:54 +1000)]
drm/nvc0-/gr: pull out a group of separately context-switched gpc regs

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nvc0-/gr: make register lists from initvals functions
Ben Skeggs [Sun, 9 Jun 2013 06:08:22 +0000 (16:08 +1000)]
drm/nvc0-/gr: make register lists from initvals functions

Generated context verified to be the same for all supported chipsets.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agoMerge branch 'qxl-next' of git://people.freedesktop.org/~airlied/linux into drm-next
Dave Airlie [Fri, 5 Jul 2013 00:55:33 +0000 (10:55 +1000)]
Merge branch 'qxl-next' of git://people.freedesktop.org/~airlied/linux into drm-next

Adds 3 features that UMS had to the KMS driver.
dynamic resizing - resizing remote-viewer makes guest resize
multiple crtcs - remote-viewer can access > 1 crtc.
suspend/resume/hibernate: guests can do suspend/resume/hibernate now.

* 'qxl-next' of git://people.freedesktop.org/~airlied/linux:
  qxl: use drm helper hotplug support
  qxl: add suspend/resume/hibernate support.
  qxl: add fb and ttm entry points for use by suspend/resume.
  qxl: add ring prep code for s/r
  qxl: prepare memslot code for suspend/resume
  qxl: split monitors_config object creation out.
  drm/qxl: set time on drawables from userspace
  drm/qxl: add support for > 1 output
  drm/qxl: make dynamic resizing work properly.

11 years agoqxl: use drm helper hotplug support
Dave Airlie [Fri, 5 Jul 2013 00:20:33 +0000 (10:20 +1000)]
qxl: use drm helper hotplug support

This uses the helper to deal with hotplug so fbdev gets included.

Signed-off-by: Dave Airlie <airlied@redhat.com>
11 years agoqxl: add suspend/resume/hibernate support.
Dave Airlie [Thu, 4 Jul 2013 05:02:33 +0000 (15:02 +1000)]
qxl: add suspend/resume/hibernate support.

This adds suspend/resume and hibernate support for the KMS driver. it evicts
all the objects, turns off the outputs, and waits for the hw to go idle,

On resume, it resets the memslots, rings, monitors object and forces modeset.

Signed-off-by: Dave Airlie <airlied@redhat.com>
11 years agoqxl: add fb and ttm entry points for use by suspend/resume.
Dave Airlie [Thu, 4 Jul 2013 04:59:34 +0000 (14:59 +1000)]
qxl: add fb and ttm entry points for use by suspend/resume.

This just ports some APIs like radeon uses to provide hooks for s/r to
call.

Signed-off-by: Dave Airlie <airlied@redhat.com>
11 years agoqxl: add ring prep code for s/r
Dave Airlie [Thu, 4 Jul 2013 04:58:45 +0000 (14:58 +1000)]
qxl: add ring prep code for s/r

This prepare the ring code for s/r additions, the release ring will need
reinitialising.

Signed-off-by: Dave Airlie <airlied@redhat.com>
11 years agoqxl: prepare memslot code for suspend/resume
Dave Airlie [Thu, 4 Jul 2013 04:57:58 +0000 (14:57 +1000)]
qxl: prepare memslot code for suspend/resume

this splits out initing the hw memslots from the guest info, and
creates an entrypoint for s/r to use.

Signed-off-by: Dave Airlie <airlied@redhat.com>
11 years agoqxl: split monitors_config object creation out.
Dave Airlie [Thu, 4 Jul 2013 04:46:46 +0000 (14:46 +1000)]
qxl: split monitors_config object creation out.

This splits the creation of the monitors config object out so we can
re-use it across suspend/resume later.

Signed-off-by: Dave Airlie <airlied@redhat.com>
11 years agodrm/qxl: set time on drawables from userspace
Dave Airlie [Tue, 2 Jul 2013 09:44:50 +0000 (10:44 +0100)]
drm/qxl: set time on drawables from userspace

This just sets the qxl time on the drawables.

Signed-off-by: Dave Airlie <airlied@redhat.com>
11 years agodrm/qxl: add support for > 1 output
Dave Airlie [Tue, 2 Jul 2013 05:37:13 +0000 (06:37 +0100)]
drm/qxl: add support for > 1 output

This adds support for a default of 4 heads, with a command line
parameter to change the default number.

It also overhauls the modesetting code to handle this case properly,
and send the correct things to the hardware at the right time.

Signed-off-by: Dave Airlie <airlied@redhat.com>
11 years agodrm/qxl: make dynamic resizing work properly.
Dave Airlie [Mon, 1 Jul 2013 04:14:38 +0000 (14:14 +1000)]
drm/qxl: make dynamic resizing work properly.

qxl has a feature to allow the userspace driver do arbitrary resizes
when the viewer resizes, this fixes it by removing unnecessary code
from the kernel side.

Signed-off-by: Dave Airlie <airlied@redhat.com>
11 years agodrm/exynos: remove duplicated error routine and unnecessary assign
Seung-Woo Kim [Wed, 3 Jul 2013 08:09:21 +0000 (17:09 +0900)]
drm/exynos: remove duplicated error routine and unnecessary assign

There were duplicated error handling routines during allocating
pages in lowlevel_buffer_allocate() and g2d_userptr_get_dma_addr().
Also unnecessary NULL assignments for variable used not any more
are removed from g2d_userptr_get_dma_addr() and
g2d_userptr_put_dma_addr().

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: YoungJun Cho <yj44.cho@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
11 years agodrm/exynos: fix pages allocation size in lowlevel_buffer_allocate
YoungJun Cho [Wed, 3 Jul 2013 08:09:20 +0000 (17:09 +0900)]
drm/exynos: fix pages allocation size in lowlevel_buffer_allocate

When IOMMU is not supported, buf->pages has to be allocated to
assign the result of phys_to_page() which return type is struct
page *. So it is sufficient to allocate buf->pages with the size
of multiple struct page pointers.

Signed-off-by: YoungJun Cho <yj44.cho@samsung.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
11 years agodrm/exynos: use drm_calloc_large when allocates pointer array
YoungJun Cho [Wed, 3 Jul 2013 08:09:19 +0000 (17:09 +0900)]
drm/exynos: use drm_calloc_large when allocates pointer array

If the type of object is pointer array, the drm_calloc_large() is
more suitable than kzalloc() for its allocation function. And uses
drm_free_large() instead of kfree() also.

Signed-off-by: YoungJun Cho <yj44.cho@samsung.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
11 years agodrm/exynos: add error check routine in exynos_drm_open
YoungJun Cho [Mon, 1 Jul 2013 08:00:47 +0000 (17:00 +0900)]
drm/exynos: add error check routine in exynos_drm_open

When the exynos_drm_subdrv_open() returns error, the file_priv
should be released and file->driver_priv set to NULL.

Signed-off-by: YoungJun Cho <yj44.cho@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
11 years agodrm/exynos: initialize the buf_num in vp_video_buffer
YoungJun Cho [Mon, 1 Jul 2013 04:04:12 +0000 (13:04 +0900)]
drm/exynos: initialize the buf_num in vp_video_buffer

The buf_num in vp_video_buffer() should be 1 or 2, but it is not
initialized, and only set to 2 in NV12M or NV12MT cases.
So this patch initializes the buf_num with 1 as default.

Signed-off-by: YoungJun Cho <yj44.cho@samsung.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
11 years agodrm/exynos: remove dead code in vidi_power_on
YoungJun Cho [Mon, 1 Jul 2013 04:03:39 +0000 (13:03 +0900)]
drm/exynos: remove dead code in vidi_power_on

The type of input parameter enable is bool, so it does not need
to check whether true or false.

Signed-off-by: YoungJun Cho <yj44.cho@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
11 years agodrm/exynos: fix not to remain exynos_gem_obj as a leak
YoungJun Cho [Mon, 1 Jul 2013 02:17:12 +0000 (11:17 +0900)]
drm/exynos: fix not to remain exynos_gem_obj as a leak

The exynos_drm_gem_create() only calls drm_gem_object_release()
when exynos_drm_alloc_buf() is failed, and exynos_gem_obj remains
as a leak, which is allocated in exynos_drm_gem_init().
So this patch fixes it not to remain as a leak.

Signed-off-by: YoungJun Cho <yj44.cho@samsung.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
11 years agoof/documentation: Update hpd gpio property for exynos_hdmi
Sachin Kamat [Mon, 1 Jul 2013 06:15:36 +0000 (15:15 +0900)]
of/documentation: Update hpd gpio property for exynos_hdmi

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Rahul Sharma <rahul.sharma@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
11 years agodrm/mm: kill color_search_free/get_block
Daniel Vetter [Mon, 1 Jul 2013 20:05:53 +0000 (22:05 +0200)]
drm/mm: kill color_search_free/get_block

drm/i915 is the only user of the color allocation handling and
switched to insert_node a while ago. So we can ditch this.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
11 years agodrm: fix print format of sequence in trace point
Seung-Woo Kim [Mon, 1 Jul 2013 10:44:14 +0000 (19:44 +0900)]
drm: fix print format of sequence in trace point

seq of a trace point is unsigned int but print format was %d. So
it fixes the format as %u.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
11 years agodrm: fix error routines in drm_open_helper
Seung-Woo Kim [Tue, 2 Jul 2013 00:53:28 +0000 (09:53 +0900)]
drm: fix error routines in drm_open_helper

There are missing parts to handle error in drm_open_helper().
The priv->minor, assigned by idr_find() which can return NULL,
should be checked whether it is NULL or not before referencing it.
put_pid(), drm_gem_release(), and drm_prime_destory_file_private()
should be called when error happens after their pair functions are
called. If an error occurs after executing dev->driver->open()
which allocates driver specific per-file private data, then the
private data should be released.

Signed-off-by: YoungJun Cho <yj44.cho@samsung.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Chris Wilson <chris-wilson.co.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
11 years agodrm: add assertion for checking null edid to drm_edid_block_valid
Seung-Woo Kim [Tue, 2 Jul 2013 08:57:04 +0000 (17:57 +0900)]
drm: add assertion for checking null edid to drm_edid_block_valid

If raw_edid of drm_edid_block_vaild() is null, it will crash, so
checking in bad label is removed and instead assertion is added at
the top of the function.
The type of return for the function is bool, so it fixes to return
true and false instead of 1 and 0.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
11 years agodrm: Convert drm class driver from legacy pm ops to dev_pm_ops
Shuah Khan [Mon, 1 Jul 2013 22:06:02 +0000 (16:06 -0600)]
drm: Convert drm class driver from legacy pm ops to dev_pm_ops

Convert drivers/gpu/drm class to use dev_pm_ops for power management and
remove Legacy PM ops hooks. With this change, drm class registers
suspend/resume callbacks via class->pm (dev_pm_ops) instead of Legacy
class->suspend/resume. When __device_suspend() runs call-backs, it will
find class->pm ops for the drm class.

drm_class_suspend() hook calls driver legacy ops with the state information.
e.g: drm_class_suspend() calls into driver suspend routines
via drm_dev->driver->suspend(drm_dev, state).

Once drm_class_suspend() is converted to dev_pm_ops, it will no longer
have access to pm_transition which it has to pass into driver legacy
suspend calls. A new freeze and suspend hooks are added to address the not
having access to the state information. The new freeze and suspend hooks
simply call __drm_class_suspend() with the appropriate pm state information.
__drm_class_suspend() is the original suspend hook with a new name.

Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
11 years agoMerge tag 'drm-intel-fixes-2013-07-03' of git://people.freedesktop.org/~danvet/drm...
Dave Airlie [Thu, 4 Jul 2013 00:46:17 +0000 (10:46 +1000)]
Merge tag 'drm-intel-fixes-2013-07-03' of git://people.freedesktop.org/~danvet/drm-intel into drm-next

Pile of fixes for 3.11. A bit large in patch count, but that's simply due
to two fixes being split up into really small parts. Also I've included a
few more vlv patches than I'd have included for other platforms. But since
vlv is officially supported for the first time only in 3.11 that shouldn't
result in unbearable risks.

Highlights:
- ghost eDP fixes for hsw from Paulo
- fix PCH detection in virtualized enviroments (Rui Guo)
- duct-tape dma sg construction when swiotlb is in use (Konrad), dupe with
  a patch in your drm-fixes branch
- fix sdvo hotplug on i965g
- tune down a bunch of dmesg ERRORs which can be hit under normal
  conditions
- detect invalid pitches for tiled scanout buffers (Chris)
- a pile of vlv fixes from Ville: rps improvements, fixes for the dpll
  LPF, fixup the sprite mmio offsets
- fix context size on hsw (Ben)
- locking fixes for the hotplug code, specifically the storm handling
- fix get_config on CPT (Xiong Zhang)
- Fix the domain tracking when an unlocked seqno wait was interrupt
  (Chris), this seems to explain tons of little corruption bugs in the
  ddx. Chris also added a nice igt to exercise this.
- work around stack-corrupting vnsprintf in our error state dumper

* tag 'drm-intel-fixes-2013-07-03' of git://people.freedesktop.org/~danvet/drm-intel: (39 commits)
  drm/i915: Don't try to tear down the stolen drm_mm if it's not there
  drm/i915: Break up the large vsnprintf() in print_error_buffers()
  drm/i915: Refactor the wait_rendering completion into a common routine
  drm/i915: Only clear write-domains after a successful wait-seqno
  drm/i915: correct intel_dp_get_config() function for DevCPT
  drm/i915: fix hpd interrupt register locking
  drm/i915: fold the no-irq check into intel_hpd_irq_handler
  drm/i915: fold the queue_work into intel_hpd_irq_handler
  drm/i915: fold the hpd_irq_setup call into intel_hpd_irq_handler
  drm/i915: s/hotplug_irq_storm_detect/intel_hpd_irq_handler/
  drm/i915: close tiny race in the ilk pcu even interrupt setup
  drm/i915: fix locking around ironlake_enable|disable_display_irq
  drm/i915: Fix context sizes on HSW
  drm/i915: Fix VLV sprite register offsets
  Revert "drm/i915: Don't use the HDMI port color range bit on Valleyview"
  drm/i915: s/LFP/LPF in DPIO PLL register names
  drm/i915: Fix VLV PLL LPF coefficients for DAC
  drm/i915: Jump to at least RPe on VLV when increasing the GPU frequency
  drm/i915: Don't increase the GPU frequency from the delayed VLV rps timer
  drm/i915: GEN6_RP_INTERRUPT_LIMITS doesn't seem to exist on VLV
  ...

11 years agoMerge branch 'drm-next-3.11' of git://people.freedesktop.org/~agd5f/linux into drm...
Dave Airlie [Thu, 4 Jul 2013 00:44:06 +0000 (10:44 +1000)]
Merge branch 'drm-next-3.11' of git://people.freedesktop.org/~agd5f/linux into drm-next

A few more DPM fixes.

* 'drm-next-3.11' of git://people.freedesktop.org/~agd5f/linux:
  drm/radeon/sumo: implement support for disable_gfx_power_gating_in_uvd flag
  drm/radeon/tn: disable PG when changing UVD clocks
  drm/radeon/sumo: disable PG when changing UVD clocks
  drm/radeon/aruba: disable additional rlc features
  drm/radeon: fix endian bug in radeon_atom_get_mclk_range_table()
  drm/radeon/dpm: fix compilation with certain versions of gcc
  drm/radeon/dpm: clarify debugfs warning

11 years agodrm/mm: WARN for unclean mm takedown
Daniel Vetter [Mon, 1 Jul 2013 20:01:04 +0000 (22:01 +0200)]
drm/mm: WARN for unclean mm takedown

The usual drm driver has tons of different drm_mm memory managers so the drm
error message in dmesg is pretty useless. WARN instead so that we have the full
backtrace.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
11 years agodrm/mm: fix debug table BUG
Daniel Vetter [Mon, 1 Jul 2013 20:01:02 +0000 (22:01 +0200)]
drm/mm: fix debug table BUG

In

commit 3a359f0b21ab218c1bf7a6a1b638b6fd143d0b99
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Sat Apr 20 12:08:11 2013 +0200

    drm/mm: fix dump table BUG

I've failed to fix both instances of the regression introduced in

commit 9e8944ab564f2e3dde90a518cd32048c58918608
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Nov 15 11:32:17 2012 +0000

   drm: Introduce an iterator over holes in the drm_mm range manager

Patch this up in the same way by extracting the hole debug logic
into it's own function, since that'll also clarify the logic a bit.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
11 years agodrm/prime: fix up handle_to_fd ioctl return value
Daniel Vetter [Tue, 2 Jul 2013 07:18:39 +0000 (09:18 +0200)]
drm/prime: fix up handle_to_fd ioctl return value

In

commit da34242e5e0638312130f5bd5d2d277afbc6f806
Author: YoungJun Cho <yj44.cho@samsung.com>
Date:   Wed Jun 26 10:21:42 2013 +0900

    drm/prime: add return check for dma_buf_fd

the failure case handling was fixed up. But in the case when we
already had the buffer exported it changed the return value:
Previously we've return 0 on success, now we return the fd.

This ABI change has been caught by i-g-t/prime_self_import/with_one_bo.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66436
Cc: YoungJun Cho <yj44.cho@samsung.com>
Cc: Seung-Woo Kim <sw0312.kim@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Tested-by: lu hua <huax.lu@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: YoungJun Cho <yj44.cho@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
11 years agodrm/radeon/sumo: implement support for disable_gfx_power_gating_in_uvd flag
Alex Deucher [Wed, 3 Jul 2013 19:14:25 +0000 (15:14 -0400)]
drm/radeon/sumo: implement support for disable_gfx_power_gating_in_uvd flag

Some asic revisions need to disable PG when UVD is active.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 years agodrm/radeon/tn: disable PG when changing UVD clocks
Alex Deucher [Wed, 3 Jul 2013 19:01:45 +0000 (15:01 -0400)]
drm/radeon/tn: disable PG when changing UVD clocks

Causes hangs for some people.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 years agodrm/radeon/sumo: disable PG when changing UVD clocks
Alex Deucher [Wed, 3 Jul 2013 19:07:28 +0000 (15:07 -0400)]
drm/radeon/sumo: disable PG when changing UVD clocks

Causes hangs for some people.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 years agodrm/radeon/aruba: disable additional rlc features
Alex Deucher [Wed, 3 Jul 2013 16:02:10 +0000 (12:02 -0400)]
drm/radeon/aruba: disable additional rlc features

They cause problems with dynamic clocking.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 years agodrm/radeon: fix endian bug in radeon_atom_get_mclk_range_table()
Alex Deucher [Wed, 3 Jul 2013 15:18:08 +0000 (11:18 -0400)]
drm/radeon: fix endian bug in radeon_atom_get_mclk_range_table()

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 years agodrm/radeon/dpm: fix compilation with certain versions of gcc
Mike Lothian [Tue, 2 Jul 2013 21:38:11 +0000 (17:38 -0400)]
drm/radeon/dpm: fix compilation with certain versions of gcc

Add #include <linux/seq_file.h> to *_dpm.c files

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>