Commit graph

22931 commits

Author SHA1 Message Date
David Henningsson
d5f362a7b9 drm/i915: Add locks around audio component bind/unbind
This will make sure that audio callbacks do not race with
component bind/unbind.

[Note: this is an update patch to commit [51e1d83cab: drm/i915: Call
 audio pin/ELD notify function] where I mistakenly applied the older
 version.  Jani and Daniel's review tags were to the latest version,
 so I add them below, too -- tiwai]

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Acked-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-09-03 12:14:45 +02:00
David Henningsson
f0675d4a8e drm/i915: Drop port_mst_index parameter from pin/eld callback
The port_mst_index parameter was reserved for future use, but
maintainers prefer to add it later when it is actually used.

[Note: this is an update patch to commit [51e1d83cab: drm/i915: Call
 audio pin/ELD notify function] where I mistakenly applied the older
 version.  Jani and Daniel's review tags were to the latest version,
 so I add them below, too -- tiwai]

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Acked-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-09-03 12:09:03 +02:00
Jammy Zhou
bddf802638 drm/amdgpu: set MEC doorbell range for Fiji
Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-09-02 12:35:52 -04:00
Jammy Zhou
ac01db3dd5 drm/amdgpu: implement burst NOP for SDMA
Customize the insert_nop func for SDMA rings, and use burst NOP for
ring/IB submissions in other places as well

Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-09-02 12:35:39 -04:00
Jammy Zhou
edff0e2826 drm/amdgpu: add insert_nop ring func and default implementation
The insert_nop function is added to amdgpu_ring_funcs structure as
well as the default implementation

Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-09-02 12:24:43 -04:00
Jammy Zhou
4b2f7e2ca9 drm/amdgpu: add amdgpu_get_sdma_instance helper function
This function is added to map the ring to sdma instance

Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-09-02 12:23:58 -04:00
Jammy Zhou
36f523a7c0 drm/amdgpu: add AMDGPU_MAX_SDMA_INSTANCES
Remove the hardcoded usage

Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-09-02 12:23:12 -04:00
Jammy Zhou
18111de0df drm/amdgpu: add burst_nop flag for sdma
The burst NOP is supported for SDMA when feature_version is >= 20.

Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-09-02 12:22:28 -04:00
Jammy Zhou
4207a734c3 drm/amdgpu: add count field for the SDMA NOP packet v2
This is added to support the burst NOP

v2: squash the typo fix

Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-09-02 12:21:35 -04:00
Christian König
a60c42320b drm/amdgpu: use PT for VM sync on unmap
Instead of the array which is used for ID management.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
2015-09-02 12:19:54 -04:00
Chunming Zhou
c9f0fe5e19 drm/amdgpu: make wait_event uninterruptible in push_job
with interruptible, the push_job maybe return -ERESTARTSYS,
then result in push_job error.

E.g. bug trace:
[  181.618860] *****amdgpu_copy_buffer:fence->seq:0x0000000048d8758b, contxt:1207959552, ref:683967304, r:-512
[  181.618929] BUG: unable to handle kernel paging request at ffffffff811aa266
[  181.625887] IP: [<ffffffff81548ffc>] reservation_object_add_excl_fence+0x3c/0x120
...
[  181.859767]  [<ffffffff811aa266>] ? unmap_mapping_range+0x66/0x110
[  181.865928]  [<ffffffffc0608ac1>] ttm_bo_move_accel_cleanup+0x41/0x3c0 [ttm]
[  181.872971]  [<ffffffffc062d382>] amdgpu_move_blit.isra.18+0x122/0x150 [amdgpu]
[  181.880254]  [<ffffffff811aa266>] ? unmap_mapping_range+0x66/0x110
[  181.886420]  [<ffffffffc062d709>] amdgpu_bo_move+0xa9/0x200 [amdgpu]
[  181.892753]  [<ffffffffc0606e8d>] ttm_bo_handle_move_mem+0x26d/0x5c0 [ttm]

Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2015-09-02 12:19:53 -04:00
Christian König
4c28fb0b27 drm/amdgpu: fix amdgpu_bo_unreserve order in GEM_OP IOCTL v2
No copy_(to|from)_user while BO is reserved.

v2: handle default path as well

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
2015-09-02 12:19:53 -04:00
Christian König
8221d706f4 drm/amdgpu: partially revert "modify amdgpu_fence_wait_any() to amdgpu_fence_wait_multiple()" v2
That isn't used any more.

v2: rebase

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-09-02 12:19:52 -04:00
Jeffery Miller
09bfda10e6 Add radeon suspend/resume quirk for HP Compaq dc5750.
With the radeon driver loaded the HP Compaq dc5750
Small Form Factor machine fails to resume from suspend.
Adding a quirk similar to other devices avoids
the problem and the system resumes properly.

Signed-off-by: Jeffery Miller <jmiller@neverware.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2015-09-02 12:19:52 -04:00
Chunming Zhou
423a9480ad drm/amdgpu: re-work sync_resv
sync_resv is to handle both amdgpu_fence and sched_fence.

Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Christian K?nig <christian.koenig@amd.com>
2015-09-02 12:05:08 -04:00
Alex Deucher
e39daf2c63 drm/amdgpu/atom: Send out the full AUX address
AUX addresses are 20 bits long. Send out the entire address instead of
just the low 16 bits.

Port of:
drm/radeon/atom: Send out the full AUX address
to amdgpu

Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2015-09-02 12:04:54 -04:00
Ville Syrjälä
58f2cf241f drm/i915: Don't call intel_get_hpd_pins() when there's no hotplug interrupt
On GMCH plaforms we are now getting the following spew on aux
interrupts:
[drm:intel_get_hpd_pins] hotplug event received, stat 0x00000000, dig 0x00000000, pins 0x00000000
[drm:intel_get_hpd_pins] hotplug event received, stat 0x00000000, dig 0x00000000, pins 0x00000000
[drm:intel_get_hpd_pins] hotplug event received, stat 0x00000000, dig 0x00000000, pins 0x00000000
[drm:intel_get_hpd_pins] hotplug event received, stat 0x00000000, dig 0x00000000, pins 0x00000000
[drm:intel_get_hpd_pins] hotplug event received, stat 0x00000000, dig 0x00000000, pins 0x00000000
[drm:intel_dp_aux_ch] dp_aux_ch timeout status 0x71450064

Prevent it by not calling intel_get_hpd_pins() unless one of the HPD
interrupt bits are actually set.

I already fixed similar annoyance once with
4bca26d0a6 drm/i915: Use HOTPLUG_INT_STATUS_G4X on VLV/CHV

but another source for it got added in
fd63e2a972 drm/i915: combine i9xx_get_hpd_pins and pch_get_hpd_pins

due to pch_get_hpd_pins() being chosen over i9xx_get_hpd_pins() to
serve as the new unified piece of code. pch_get_hpd_pins() had the debug
print, and i9xx_get_hpd_pins() didn't.

Cc: Imre Deak <imre.deak@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-09-02 17:07:23 +02:00
Ville Syrjälä
a52bb15bfa drm/i915: Rewrite BXT HPD code to conform to pre-existing style
Rewrite the BXT hpd setup to match the way we do it on other platforms:
- Throw out BXT_HOTPLUG_CTL since it's the same as PCH_PORT_HOTPLUG
- Enable the HPD bits in the DE port IER in gen8_de_irq_postinstall()
- Update DE port IMR using bdw_update_port_irq()

Also throw out port D from bxt_port_hotplug_long_detect() since BXT only
goes up to C.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-09-02 17:01:49 +02:00
Ville Syrjälä
40e5641086 drm/i915: Refactor the hpd irq handling functions
A lot of the hpd irq handling is duplicated code, so refactor it a bit
by observing that in several places the only difference is the hpd[]
array. So pull the code to a few functions and pass in the hpd[] array
from the caller. Another option would be to determine the correct array
to use within the functions themselves, but somehow passing it in felt
nicer.

Further code reduction could be achieved by passing in the hotplug
register offset, and the long pulse detection function pointer. But that
didn't feel as good for some reason, so I left it at the middle ground.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-09-02 17:01:32 +02:00
Ville Syrjälä
cebd87a077 drm/i915: Rewrite bxt_hpd_handler() to look like everyone else
bxt_hpd_handler() looks different to everyone else for no good reason.
Rewrite it to use the standard variable namees etc.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-09-02 16:57:23 +02:00
Ville Syrjälä
08d8a232aa drm/i915: Reinitialize HPD after runtime D3
Runtime suspends disabled all interrupts, so in order to get them back
fully we need to also do the HPD irq setup on runtime resume. Except
on VLV/CHV where the display interrupt initialization is part of the
display power well powerup.

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-09-02 16:57:03 +02:00
Ville Syrjälä
74c0b395fc drm/i915: Add port A HPD support for SPT
On SKL the port A HPD has moved to the PCH. Hook it up.

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-09-02 16:56:56 +02:00
Ville Syrjälä
3a3b3c7da3 drm/i915: Add port A HPD support for BDW
Wire up the port A HPD for BDW. Compared to earlier platforms the
interrupt setup is a bit different, but basically everything else
looks the same.

v2: 0 initialize pin_mask/long_mask due to intel_get_hpd_pins() changes
    Check for BDW before processing the HPD to not break BXT
    Set found=true when processing port A HPD
    Sort out the mess I made of the irq setup in v1
    Warn about bad irq mask vs. enable bits in bdw_update_port_irq()  (Paulo)

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-09-02 16:56:37 +02:00
Ville Syrjälä
0b2eb33e5e drm/i915: LPT:LP needs port A HPD enabled in both north and south
If the CPU and PCH are on the same package we must enabled the port A
HPD also in the south hotplug register. To identify the package type
we simply look at the PCH type: LPT-H means separate package, and
LPT-LP means multi chip package (MCP).

v2: Add comment and pimp commit message

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-09-02 16:56:09 +02:00
Ville Syrjälä
23bb4cb512 drm/i915: Add port A HPD support for IVB/HSW
As with ILK/SNB wire up the port A HPD on IVB/HSW.

This might be more important on HSW with PSR. BSpec tells us that if the
automagic link training performed by the hardware fails for some reason,
we're going to get a short HPD and are supposed to re-train the link
manyally.

v2: 0 initialize pin_mask/long_mask due to intel_get_hpd_pins() changes
    Add a comment about the pulse duration bits being reserved on HSW+
    like we have for LPT+ in ibx_hpd_irq_setup()

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-09-02 16:56:03 +02:00
Ville Syrjälä
e4ce95aa66 drm/i915: Add port A HPD support for ILK/SNB
ILK/SNB support port A HPD. While HPD is optional on eDP let's at least
try to wite it up so that we might notice if the link has issues.

The eDP spec suggests that if HPD is not wired up, one should poll the
link status instead. We don't even do that currently.

v2: 0 initialize pin_mask/long_mask due to intel_get_hpd_pins() changes

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-09-02 16:55:59 +02:00
Ville Syrjälä
6dbf30ce23 drm/i915: Introduce spt_irq_handler()
Starting from SPT the only interrupts living in the south are GMBUS and
HPD. What's worse some of the SPT specific new bits conflict with some
other bits on earlier PCH generations. So better not use the
cpt_irq_handler() for SPT+ anymore.

Also kill the hand rolled port E handling with something more
standardish. This also avoids accidentally confusing port B and port E
long pulses since the bits occupy the same positions, just in different
registers.

Also add a comment noting that the short pulse duration bits are
reserved on LPT+. The 2ms value we program is 0, so no issue wrt. the
MBZ in the spec.

v2: Call intel_hpd_irq_handler() only once (Paulo)

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-09-02 16:55:38 +02:00
Ville Syrjälä
42db67d664 drm/i915: Move {pin, long}_mask initialization to caller from intel_get_hpd_pins()
Move the 0 initialization of pin_mask and long_mask from
intel_get_hpd_pins() into each caller. This we we can call
intel_get_hpd_pins() multiple times to accumulate more pins from several
sources.

v2: Add a comment explaining the dangers of intel_get_hpd_pins() (Paulo)

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-09-02 16:51:29 +02:00
Ville Syrjälä
195baa0673 drm/i915: Rename BXT PORTA HPD defines
The PORTA HPD defines are not BXT specific. They also exist on SPT,
and partially already on LPT:LP.

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-09-02 16:51:17 +02:00
Ville Syrjälä
c2699524d6 drm/i915: Add HAS_PCH_LPT_LP() macro
Make LPT:LP checks look neater by wrapping the details in a
new HAS_PCH_LPT_LP() macro.

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-09-02 16:51:12 +02:00
Ville Syrjälä
d9dc34f1a1 drm/i915: Factor out ilk_update_display_irq()
Extract the core of ironlake_{enable,disable}_display_irq() into a new
function. We'll have further use for it later.

v2: Warn about invalid mask vs. enable bits (Paulo)

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-09-02 16:51:08 +02:00
Ville Syrjälä
87a0210665 drm/i915: Extract intel_hpd_enabled_irqs()
Eliminate a bunch of duplicated code that calculates the currently
enabled HPD interrupt bits.

v2: s/;/:/ in patch subject (Paulo)

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-09-02 16:51:04 +02:00
Ville Syrjälä
40bfd7a330 drm/i915: Clean up various HPD defines
Indent the PORTx_HOTPLUG_... defines appropriately, and fix some space
vs. tab issues.

v2: Document pre-HSW/LPT bits, and order another tab (Paulo)

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-09-02 16:50:59 +02:00
Daniel Vetter
62f0ace531 drm/i915: Update comments around base bpp
Forgot to do that in

commit d328c9d78d
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Fri Apr 10 16:22:37 2015 +0200

    drm/i915: Select starting pipe bpp irrespective or the primary plane

and it's confusing. Fix it.

Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-09-02 16:36:33 +02:00
Joonyoung Shim
c3058579a2 drm/exynos: remove buf_cnt from struct exynos_drm_fb
Looking other drm drivers, there is no the restriction that framebuffer
has only one buffer in .create_handle() callback. They use just first
buffer.

If this limitation is removed, there is no reason keeping buffer count
for framebuffer, so we can remove buf_cnt from struct exynos_drm_fb.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-09-02 23:10:34 +09:00
Joonyoung Shim
faec262b14 drm/exynos: remove exynos_drm_fb_get_buf_cnt()
We can get buffer count of framebuffer using drm_format_num_planes(), so
keeping exynos_drm_fb_get_buf_cnt() is unnecessary.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-09-02 23:10:34 +09:00
Joonyoung Shim
8d31758ecf drm/exynos: cleanup exynos_user_fb_create()
Using exynos_drm_framebuffer_init(), redundant codes can be removed.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-09-02 23:10:33 +09:00
Joonyoung Shim
d56125afcb drm/exynos: update exynos_drm_framebuffer_init() for multiple buffers
This modifies exynos_drm_framebuffer_init() to be possible to support
multiple buffers. Then it can be used by exynos_user_fb_create().

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-09-02 23:10:32 +09:00
Joonyoung Shim
dcbb85a164 drm/exynos: cleanup to get gem object for fb
Current codes get first gem object and then again get remain gem
objects. They can be unified to one routine.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-09-02 23:10:32 +09:00
Joonyoung Shim
ee885ca5c0 drm/exynos: update fb_info via only one function
This patch moves codes to update fb_info into exynos_drm_fbdev_update(),
so fb_info is updated via only one function.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-09-02 23:10:31 +09:00
Joonyoung Shim
d761996098 drm/exynos: cleanup exynos_drm_fbdev_update()
It can get exynos_gem object via function argument, so no need to call
exynos_drm_fb_gem_obj() in exynos_drm_fbdev_update.

It also can get struct drm_framebuffer *fb via helper->fb, so can remove
a function argument for it.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-09-02 23:10:30 +09:00
Joonyoung Shim
39a839f2e6 drm/exynos: s/exynos_gem_obj/obj in exynos_drm_fbdev.c
The variable name "exynos_gem_obj" is too long, so some lines exceed 80
characters. It's simple to use "obj" instead of "exynos_gem_obj".

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-09-02 23:10:30 +09:00
Joonyoung Shim
94e30d93f9 drm/exynos: remove exynos_drm_fb_set_buf_cnt()
The exynos_drm_fb_set_buf_cnt() is used to set buffer count only in
exynos_drm_fbdev_update(). This patch sets directly buffer count in
exynos_drm_framebuffer_init() without using exynos_drm_fb_set_buf_cnt(),
so there is no any reason to keep exynos_drm_fb_set_buf_cnt().

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-09-02 23:10:30 +09:00
Tobias Jakobi
7de5c36c2a drm/exynos: remove superfluous checks in g2d_check_reg_offset()
The cases of the switch statement ensure that reg_type
can never be REG_TYPE_NONE here.

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-09-02 23:10:29 +09:00
Tobias Jakobi
179239a7ae drm/exynos: fix size check in g2d_check_buf_desc_is_valid()
The size check was incomplete. It only computed the
size of area of the drawing rectangle and checked if
the size still fit inside the buffer.

The correct check is to compute the position of the
last byte that the G2D engine is going to access and
then check if that position is still contained in the
buffer. In particular we need the stride information
to determine this.

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-09-02 23:10:28 +09:00
Ville Syrjälä
4e3d1e26c2 drm/i915: Pass hpd_status_i915[] to intel_get_hpd_pins() in pre-g4x
Pass the correct hpd[] array to intel_get_hpd_pins() on pre-g4x
platforms.

This got broken in the following commit:
commit fd63e2a972
Author: Imre Deak <imre.deak@intel.com>
Date:   Tue Jul 21 15:32:44 2015 -0700

    drm/i915: combine i9xx_get_hpd_pins and pch_get_hpd_pins

Cc: Imre Deak <imre.deak@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Egbert Eich <eich@suse.de>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-09-02 16:33:54 +03:00
Chris Wilson
51bc140431 drm/i915: Always mark the object as dirty when used by the GPU
There have been many hard to track down bugs whereby userspace forgot to
flag a write buffer and then cause graphics corruption or a hung GPU
when that buffer was later purged under memory pressure (as the buffer
appeared clean, its pages would have been evicted rather than preserved
and any changes more recent than in the backing storage would be lost).
In retrospect this is a rare optimisation against memory pressure,
already the slow path. If we always mark the buffer as dirty when
accessed by the GPU, anything not used can still be evicted cheaply
(ideal behaviour for mark-and-sweep eviction) but we do not run the risk
of corruption. For correct read serialisation, userspace still has to
notify when the GPU writes to an object. However, there are certain
situations under which userspace may wish to tell white lies to the
kernel...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Kristian Høgsberg <krh@bitplanet.net>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: "Goel, Akash" <akash.goel@intel.co>
Cc: Michał Winiarski <michal.winiarski@intel.com>
Cc: stable@vger.kernel.org
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-09-02 16:21:53 +03:00
Ville Syrjälä
f36203be60 drm/dp: Add dp_aux_i2c_speed_khz module param to set the assume i2c bus speed
To help with debugging i2c-over-aux issues, add a module parameter than
can be used to tweak the assumed i2c bus speed, and thus the maximum
number of retries we will do for each aux message.

Cc: Simon Farnsworth <simon.farnsworth@onelan.com>
Cc: moosotc@gmail.com
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Simon Farnsworth <simon.farnsworth@onelan.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-09-02 16:13:43 +03:00
Ville Syrjälä
4efa83c8c7 drm/dp: Adjust i2c-over-aux retry count based on message size and i2c bus speed
Calculate the number of retries we should do for each i2c-over-aux
message based on the time it takes to perform the i2c transfer vs. the
aux transfer. We assume the shortest possible length for the aux
transfer, and the longest possible (exluding clock stretching) for the
i2c transfer.

The DP spec has some examples on how to calculate this, but we don't
calculate things quite the same way. The spec doesn't account for the
retry interval (assumes immediate retry on defer), and doesn't assume
the best/worst case behaviour as we do.

Note that currently we assume 10 kHz speed for the i2c bus. Some real
world devices (eg. some Apple DP->VGA dongle) fails with less than 16
retries. and that would correspond to something close to 15 kHz (with
our method of calculating things) But let's just go for 10 kHz to be
on the safe side. Ideally we should query/set the i2c bus speed via
DPCD but for now this should at leaast remove the regression from the
1->16 byte trasnfer size change. And of course if the sink completes
the transfer quicker this shouldn't slow things down since we don't
change the interval between retries.

I did a few experiments with a DP->DVI dongle I have that allows you
to change the i2c bus speed. Here are the results of me changing the
actual bus speed and the assumed bus speed and seeing when we start
to fail the operation:

actual i2c khz          assumed i2c khz         max retries
1                       1 ok -> 2 fail          211 ok -> 106 fail
5                       8 ok -> 9 fail          27 ok -> 24 fail
10                      17 ok -> 18 fail        13 ok -> 12 fail
100                     210 ok -> 211 fail      2 ok -> 1 fail

So based on that we have a fairly decent safety margin baked into
the formula to calculate the max number of retries.

Fixes a regression with some DP dongles from:
commit 1d002fa720
Author: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
Date:   Tue Feb 10 18:38:08 2015 +0000

    drm/dp: Use large transactions for I2C over AUX

v2: Use best case for AUX and worst case for i2c (Simon Farnsworth)
    Add a define our AUX retry interval and account for it
v3: Make everything usecs to avoid confusion about units (Daniel)
    Add a comment reminding people about the AUX bitrate (Daniel)
    Use DIV_ROUND_UP() since we're after the "worst" case for i2c

Cc: Simon Farnsworth <simon.farnsworth@onelan.com>
Cc: moosotc@gmail.com
Tested-by: moosotc@gmail.com
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91451
Reviewed-by: Simon Farnsworth <simon.farnsworth@onelan.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-09-02 16:08:20 +03:00
Ville Syrjälä
79a2b161c1 drm/dp: Define AUX_RETRY_INTERVAL as 500 us
Currently we react to native and i2c defers by waiting either 400-500 us
or 500-600 us, depending on which code path we take. Consolidate them
all to one define AUX_RETRY_INTERVAL which defines the minimum interval.
Since we've been using two different intervals pick the longer of them
and define AUX_RETRY_INTERVAL as 500 us. For the maximum just use
AUX_RETRY_INTERVAL+100 us.

I want to have a define for this so that I can use it when calculating
the estimated duration of i2c-over-aux transfers. Without a define it
would be very easy to change the sleep duration and neglect to update
the i2c-over-aux estimates.

Cc: Simon Farnsworth <simon.farnsworth@onelan.com>
Cc: moosotc@gmail.com
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Simon Farnsworth <simon.farnsworth@onelan.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-09-02 15:49:20 +03:00
Daniel Vetter
e93c28f393 Merge tag 'drm-intel-next-fixes-2015-09-02' into drm-intel-next-queued
Backmerge -fixes since there's more DDI-E related cleanups on top of
the pile of -fixes for skl that just landed for 4.3.

Conflicts:
	drivers/gpu/drm/i915/intel_display.c
	drivers/gpu/drm/i914/intel_dp.c
	drivers/gpu/drm/i915/intel_lrc.c

Conflicts are all fairly harmless adjacent line stuff.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-09-02 14:33:42 +02:00
Maarten Lankhorst
85a62bf9d8 drm/i915: Also record time difference if vblank evasion fails, v2.
This makes the error message slightly more useful.

Changes since v1:
- Use ktime_get() while irqs are still disabled. (vsyrjala)

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-09-02 13:51:40 +02:00
Maarten Lankhorst
34e0adbb45 drm/i915: Remove start frame argument to pipe_update_begin/end.
There's already a per crtc member that can be used for it.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-09-02 13:51:30 +02:00
Zhiyuan Lv
650da34c4a drm/i915: guest i915 notification for Intel GVT-g
When i915 drivers run inside a VM with Intel GVT-g, some explicit
notifications are needed from guest to host device model through PV
INFO page write. The notifications include:

	PPGTT create
	PPGTT destroy

They are used for the shadow implementation of PPGTT. Intel GVT-g
needs to write-protect the guest pages of PPGTT, and clear the write
protection when they end their life cycle.

v2:
- Use lower_32_bits()/upper_32_bits() for qword operations;
- Remove the notification of guest context creation/destroy;

Signed-off-by: Zhiyuan Lv <zhiyuan.lv@intel.com>
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-09-02 11:46:55 +02:00
Zhiyuan Lv
532beabf34 drm/i915: Update PV INFO page definition for Intel GVT-g
Some more definitions in the PV info page are added. They are mainly
for the guest notification to Intel GVT-g device model. They are used
for Broadwell enabling.

The notification of PPGTT page table creation/destroy is to notify
GVT-g device model the life cycle of guest page tables. Then device
model will implement shadow page table for guests.

The notification of context create/destroy is optional. If it is used,
the device model will create/destroy shadow context corresponding to
the context's life cycle. Guest driver needs to make sure that the
context's LRCA and backing storage address unchanged. If it is not
used, the device model will perform the context shadow work in the
context scheduling time.

Signed-off-by: Zhiyuan Lv <zhiyuan.lv@intel.com>
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-09-02 11:46:12 +02:00
Zhiyuan Lv
a0bd6c3183 drm/i915: Always enable execlists on BDW for vgpu
Broadwell hardware supports both ring buffer mode and execlist mode.
When i915 runs inside a VM with Intel GVT-g, we allow execlist mode
only.

The main reason of EXECLIST only is that GVT-g does not support the
dynamic mode switch between ring buffer mode and execlist mode when
running multiple virtual machines.

v2:
- Adjust the position of vgpu check in sanitize function (Joonas)
- Add vgpu error check in context initialization. (Joonas, Daniel)

Signed-off-by: Zhiyuan Lv <zhiyuan.lv@intel.com>
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-09-02 11:45:50 +02:00
Zhiyuan Lv
331f38e77d drm/i915: preallocate pdps for 32 bit vgpu
This is based on Mika Kuoppala's patch below:
http://article.gmane.org/gmane.comp.freedesktop.xorg.drivers.intel/61104/match=workaround+hw+preload

The patch will preallocate the page directories for 32-bit PPGTT when
i915 runs inside a virtual machine with Intel GVT-g. With this change,
the root pointers in EXECLIST context will always keep the same.

The change is needed for vGPU because Intel GVT-g will do page table
shadowing, and needs to track all the page table changes from guest
i915 driver. However, if guest PPGTT is modified through GPU commands
like LRI, it is not possible to trap the operations in the right time,
so it will be hard to make shadow PPGTT to work correctly.

Shadow PPGTT could be much simpler with this change. Meanwhile
hypervisor could simply prohibit any attempt of PPGTT modification
through GPU command for security.

The function gen8_preallocate_top_level_pdps() in the patch is from
Mika, with only one change to set "used_pdpes" to avoid duplicated
allocation later.

Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Cc: Dave Gordon <david.s.gordon@intel.com>
Cc: Michel Thierry <michel.thierry@intel.com>
Signed-off-by: Zhiyuan Lv <zhiyuan.lv@intel.com>
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-09-02 11:42:53 +02:00
David Henningsson
51e1d83cab drm/i915: Call audio pin/ELD notify function
When the audio codec is enabled or disabled, notify the audio driver.
This will enable the audio driver to get the notification at all times
(even when audio is in different powersave states).

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Acked-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-09-02 11:31:44 +02:00
Jani Nikula
42a8ca4cb4 drm/i915: add yesno utility function
Add a common function to return "yes" or "no" string based on the
argument, and drop the local versions of it.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-09-02 11:16:44 +02:00
Jani Nikula
79e50a4f72 drm/i915: move intel_hrawclk() to intel_display.c
Make it available outside of intel_dp.c.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Clint Taylor <Clinton.A.Taylor@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-09-02 11:00:04 +02:00
Alex Dai
f5d3c3eaab drm/i915: Notify GuC rc6 state
If rc6 is enabled, notify GuC so it can do proper forcewake before
command submission.

Signed-off-by: Alex Dai <yu.dai@intel.com>
Reviewed-by: Tom O'Rourke <Tom.O'Rourke@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-09-02 10:39:01 +02:00
Alex Dai
aa557ab015 drm/i915/guc: Support GuC version 4.3
The firmware layout changes that now it only has css header +
uCode + RSA signature. Plus, other trivial changes to support
GuC V4.3.

Signed-off-by: Alex Dai <yu.dai@intel.com>
Reviewed-by: Dave Gordon <david.s.gordon@intel.com>
Reviewed-by: Dave Gordon <david.s.gordon@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-09-02 09:54:56 +02:00
Maarten Lankhorst
1751fcf9f9 drm/i915: Fix module initialisation, v2.
The driver doesn't support UMS any more, so set DRIVER_MODESET by default,
remove the legacy s/r callbacks, and rename the s/r functions to make it more clear
they're only in use by switcheroo now.

Also remove an obsolete comment about atomic. Normal updates are supported only
async updates aren't yet.

v2: Don't unconditionally set DRIVER_ATOMIC, we're not yet there.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-09-02 09:52:25 +02:00
Linus Torvalds
089b669506 Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
Pull trivial tree updates from Jiri Kosina:
 "The usual stuff from trivial tree for 4.3 (kerneldoc updates, printk()
  fixes, Documentation and MAINTAINERS updates)"

* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (28 commits)
  MAINTAINERS: update my e-mail address
  mod_devicetable: add space before */
  scsi: a100u2w: trivial typo in printk
  i2c: Fix typo in i2c-bfin-twi.c
  treewide: fix typos in comment blocks
  Doc: fix trivial typo in SubmittingPatches
  proportions: Spelling s/consitent/consistent/
  dm: Spelling s/consitent/consistent/
  aic7xxx: Fix typo in error message
  pcmcia: Fix typo in locking documentation
  scsi/arcmsr: Fix typos in error log
  drm/nouveau/gr: Fix typo in nv10.c
  [SCSI] Fix printk typos in drivers/scsi
  staging: comedi: Grammar s/Enable support a/Enable support for a/
  Btrfs: Spelling s/consitent/consistent/
  README: GTK+ is a acronym
  ASoC: omap: Fix typo in config option description
  mm: tlb.c: Fix error message
  ntfs: super.c: Fix error log
  fix typo in Documentation/SubmittingPatches
  ...
2015-09-01 18:46:42 -07:00
Ville Syrjälä
02e93c3537 drm/i915: Factor out intel_crtc_has_encoders()
Make the code mode readable by pulling the "does this crtc have any
encoders?" deduction into a separate function.

Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-09-01 12:02:33 +02:00
Ville Syrjälä
0f64614dde drm/i915: Fix clock readout when pipes are enabled w/o ports
The BIOS sometimes likes to enable pipes w/o any ports, at least on
older machines. Currently we fail to assign anything sensible to
crtc->hwmode.crtc_clock which leads to complaints from the vblank code.
Deal with active pipes w/o ports and assign something sensible to
crtc_clock in i9xx_get_pipe_config(). The encoder .get_config() will
override this if the port is enabled.

Gets rid of rest of these on my gen4:
[drm:drm_calc_timestamping_constants [drm]] *ERROR* crtc 24: Can't calculate constants, dotclock = 0!
[drm:i915_get_vblank_timestamp] crtc 1 is disabled

v2: Fill out crtc_clock already in i9xx_get_pipe_config() (Maarten)

Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-09-01 12:02:09 +02:00
Ville Syrjälä
30142273a3 drm/i915: Add CHV PHY LDO power sanity checks
At various points when changing the DPIO lane/phy power states,
construct an expected value of the DISPLAY_PHY_STATUS register
and compare it with the real thing.

To construct the expected value we look at our shadow PHY_CONTROL
register value (which should match what we've just written to the
hardware), and we also need to look at the actual state of the cmn
power wells as a disabled power well causes the relevant LDO status
to be reported as 'on' in DISPLAY_PHY_STATUS.

When initially powering up the PHY it performs various internal
calibrations for which it fully powers up. That means that if we check
for the expetected power state immediately upon releasing cmnreset we
would get the occasional false positive. But we can of course
poll until the expected value appears. It shouldn't be too long so
this shouldn't make modesets substantially longer.

One extra complication is introduced when we cross the streams, ie.
drive port B with pipe B. In this case we trick CL2 (where the DPLL lives)
into life by temporaily powering up the lanes in the second channel,
and once the pipe is up and runnign we release the lane power override.
At that point the power state of CL2 has somehow gotten entangled with
the power state of the first channel. That means that constructing the
expected DISPLAY_PHY_STATUS value is a bit tricky since based on the
lane power states in the second channel, CL2 should also be powered
down. But we can use the DPLL enable bit to determine when CL2 should
be alive even if the lanes are powered down. However the power state
of CL2 isn't actually tied in with the DPLL state, but to the state
of the lanes in first channel, so we have to avoid checking the
expected state between shutting down the DPLL and powering down
the lanes in the first channel. So no calling assert_chv_phy_status()
before the DISPLAY_PHY_CONTROL write in chv_phy_powergate_lanes(),
but after the write is a safe time to check.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Deepak S <deepak.s@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-09-01 11:44:57 +02:00
Ville Syrjälä
6669e39f95 drm/i915: Add some CHV DPIO lane power state asserts
Add some checks that the state of the DPIO lanes is more or less what we
expect based on the overrides.

The hardware only provides two bits per channel indicating whether all
or some of the lanes are powered down, so we can't do an exact check.

Additionally, CL2 powering down before we can check it adds another
twist. To work around this we simply check for the 0 value of the
CL2 register (which is what we get when it's powered down) and
adjust our expectations.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Deepak S <deepak.s@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-09-01 11:44:41 +02:00
Ville Syrjälä
a8f327fb84 drm/i915: Clean up CHV lane soft reset programming
Currently we release the lane soft reset before lane stagger settings
have been programmed. I believe that means we don't actually do lane
staggering. So move the soft reset deassert to happen after lane
staggering has been programmed.

The one confusing thing in this is that when we remove the power down
override from the lanes, they power up with defaul register values,
which do not have the soft reset overrides enabled. And according to
some docs by default the data lane resets are tied to cmnreset. So that
would mean that lanes would come out of reset without staggering as
soon as the power down overrides are removed. But since we can't access
either the lane stagger register nor the soft reset override registers
until the lanes are powered on, we can't really do anything about it.
So let's just set the soft reset overrides as soon as the lane is
powered on and hope for the best.

v2: Fix typos in commit message (Daniel)

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Deepak S <deepak.s@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-09-01 11:43:37 +02:00
Ander Conselvan de Oliveira
6fa2d19793 i915: Set ddi_pll_sel in DP MST path
The DP MST encoder config function never sets ddi_pll_sel, even though
its value is programmed in its ->pre_enable() hook. That used to work
because a new pipe_config was kzalloc'ed at every modeset, and the value
of zero selects the highest clock for the PLL. Starting with the commit
below, the value of ddi_pll_sel is preserved through modesets, and since
the correct value wasn't properly setup by the MST code, it could lead
to warnings and blank screens.

commit 8504c74c7a
Author: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Date:   Fri May 15 11:51:50 2015 +0300

    drm/i915: Preserve ddi_pll_sel when allocating new pipe_config

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91628
Cc: stable@vger.kernel.org # 7e6313a251 drm/i915: Don't use link_bw for PLL setup
Cc: stable@vger.kernel.org
Cc: Timo Aaltonen <tjaalton@ubuntu.com>
Cc: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-09-01 12:42:27 +03:00
Francisco Jerez
2bbe6bbb0d drm/i915: Bump command parser version number.
This was forgotten in

commit d351f6d948
Author: Francisco Jerez <currojerez@riseup.net>
Date:   Fri May 29 16:44:15 2015 +0300

    drm/i915: Add SCRATCH1 and ROW_CHICKEN3 to the register whitelist.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-09-01 11:40:15 +02:00
Jani Nikula
caa860d919 drm/i915/dp: use the drm dp helper for determining sink tps3 support
No functional changes.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
[danvet: s/intel_dp_tps/drm_dp_tps/.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-09-01 11:35:22 +02:00
Ville Syrjälä
7e6313a251 drm/i915: Don't use link_bw for PLL setup
Use port_clock instead of link_bw when picking the PLL parameters for
DP. link_bw may be zero with an eDP 1.4 sink that supports
DP_LINK_RATE_SET so we shouldn't use it for anything other than feed it
to the sink appropriately.

v2: Fix typo in commit message (Sivakumar)

Reviewed-by: Sivakumar Thulasimani <sivakumar.thulasimani@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
[Jani: cherry-picked from future.]
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-09-01 12:31:44 +03:00
Thomas Hellstrom
aa3469ce7a drm/vmwgfx: Allow dropped masters render-node like access on legacy nodes v2
Applications like gnome-shell may try to render after dropping master
privileges. Since the driver should now be safe against this scenario,
allow those applications to use their legacy node like a render node.

v2: Add missing return statement.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
2015-09-01 02:06:02 -07:00
Maarten Lankhorst
c4749c9a4a drm/atomic: Fix bookkeeping with TEST_ONLY, v3.
Commit ec9f932ed4
"drm/atomic: Cleanup on error properly in the atomic ioctl."
cleaned up some error paths, but didn't fix the TEST_ONLY path.
In the check only case plane->fb shouldn't be updated, and
the vblank events should be cleared as on failure.

Changes since v1:
- Fix -EDEADLK handling of vblank events too.
- Free state last with CHECK_ONLY.
Changes since v2:
- Add comment about freeing crtc_state->event with TEST_ONLY.
  (Daniel Stone)

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-09-01 11:57:06 +03:00
Lukas Wunner
69f92f67b6 drm/i915: Preserve SSC earlier
Commit 92122789b2 ("drm/i915: preserve SSC if previously set v3")
added code to intel_modeset_gem_init to override the SSC status read
from VBT with the SSC status set by BIOS.

However, intel_modeset_gem_init is invoked *after* intel_modeset_init,
which calls intel_setup_outputs, which *modifies* SSC status by way of
intel_init_pch_refclk. So unlike advertised, intel_modeset_gem_init
doesn't preserve the SSC status set by BIOS but whatever
intel_init_pch_refclk decided on.

This is a problem on dual gpu laptops such as the MacBook Pro which
require either a handler to switch DDC lines, or the discrete gpu
to proxy DDC/AUX communication: Both the handler and the discrete
gpu may initialize after the i915 driver, and consequently, an LVDS
connector may initially seem disconnected and the SSC therefore
is disabled by intel_init_pch_refclk, but on reprobe the connector
may turn out to be connected and the SSC must then be enabled.

Due to 92122789b2 however, the SSC is not enabled on reprobe since
it is assumed BIOS disabled it while in fact it was disabled by
intel_init_pch_refclk.

Also, because the SSC status is preserved so late, the preserved value
only ever gets used on resume but not on panel initialization:
intel_modeset_init calls intel_init_display which indirectly calls
intel_panel_use_ssc via multiple subroutines, *before* the BIOS value
overrides the VBT value in intel_modeset_gem_init (intel_panel_use_ssc
is the sole user of dev_priv->vbt.lvds_use_ssc).

Fix this by moving the code introduced by 92122789b2 from
intel_modeset_gem_init to intel_modeset_init before the invocation
of intel_setup_outputs and intel_init_display.

Add a DRM_DEBUG_KMS as suggested way back by Jani:
http://lists.freedesktop.org/archives/intel-gfx/2014-June/046666.html

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=88861
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61115
Tested-by: Paul Hordiienko <pvt.gord@gmail.com>
    [MBP  6,2 2010  intel ILK + nvidia GT216  pre-retina]
Tested-by: William Brown <william@blackhats.net.au>
    [MBP  8,2 2011  intel SNB + amd turks     pre-retina]
Tested-by: Lukas Wunner <lukas@wunner.de>
    [MBP  9,1 2012  intel IVB + nvidia GK107  pre-retina]
Tested-by: Bruno Bierbaumer <bruno@bierbaumer.net>
    [MBP 11,3 2013  intel HSW + nvidia GK107  retina -- work in progress]
Fixes: 92122789b2 ("drm/i915: preserve SSC if previously set v3")
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-09-01 09:38:49 +03:00
Linus Torvalds
f36fc04e4c The clk framework changes for 4.3 are mostly updates to existing drivers
and the addition of new clock drivers. Stephen Boyd has also done a lot
 of subsystem-wide driver clean-ups (thanks!). There are also fixes to
 the framework core and changes to better split clock provider drivers
 from clock consumer drivers.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJV5KelAAoJEKI6nJvDJaTUwaQP/RVb70v6XSgMIePuOq3iaECT
 bclCAyito3YFwykrPPmQ1DucHvEjlWopeFwKqEE9VjNl07TVIH/OMGeonb9yErIY
 aN+FMoA9RUGVexMhy004q5sSbOEihAqTgKWaOiYoY8zAfJfeTpYXUoy34FcrW7MB
 j/cDDJgigtWe9zzcdrW04oT454lXQaSQuGX39tDCR0s0S3soYU2JyjkyBGiO5Yid
 1yIMq/nzI8SrCwxwD/nFwQNtg7lqiAN291Nbi4At1vvG5r4RhNveuLGv8uJ50XRB
 xwy0sdHLIVJrIJ8OUcs1sY8wxu7ghDS8u+vjTNO2RzBf3KZWbuXWX+yVM7JQi4Ty
 0iL5hGbvERy5E9QSzzH+Ox2jVt5e/r/dyvRf3oBDPVrFXhKusYhn6JmdUVJkTZ83
 GTw2sQdEpcmry4z/50/MaqpZuXVZ09VTOCTqp8ToseJjsz9jXxVhQ4HdAwLc8cmV
 txWGRXuBxCB+2o8M0oky3IKS69VFFH5u6QQ0KG8+JYOrDDG7GcnJsFeV7mQjlu8g
 3evYUILNAUfJGBpkOeLs654KUBHwUyXc87cUIKwjGaPruWb2048+kdCVrL3IFwPb
 sS/7Qn3DQ90pHFUTssDnWLz3X0IWT3H0iV4zZyAqqdARugEo+mpykmXmMWcWc3VR
 MrD1l3GVxLegEf242Zpo
 =QAiQ
 -----END PGP SIGNATURE-----

Merge tag 'clk-for-linus-4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux

Pull clk updates from Michael Turquette:
 "The clk framework changes for 4.3 are mostly updates to existing
  drivers and the addition of new clock drivers.  Stephen Boyd has also
  done a lot of subsystem-wide driver clean-ups (thanks!).  There are
  also fixes to the framework core and changes to better split clock
  provider drivers from clock consumer drivers"

* tag 'clk-for-linus-4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: (227 commits)
  clk: s5pv210: add missing call to samsung_clk_of_add_provider()
  clk: pistachio: correct critical clock list
  clk: pistachio: Fix PLL rate calculation in integer mode
  clk: pistachio: Fix override of clk-pll settings from boot loader
  clk: pistachio: Fix 32bit integer overflows
  clk: tegra: Fix some static checker problems
  clk: qcom: Fix MSM8916 prng clock enable bit
  clk: Add missing header for 'bool' definition to clk-conf.h
  drivers/clk: appropriate __init annotation for const data
  clk: rockchip: register pll mux before pll itself
  clk: add bindings for the Ux500 clocks
  clk/ARM: move Ux500 PRCC bases to the device tree
  clk: remove duplicated code with __clk_set_parent_after
  clk: Convert __clk_get_name(hw->clk) to clk_hw_get_name(hw)
  clk: Constify clk_hw argument to provider APIs
  clk: Hi6220: add stub clock driver
  dt-bindings: clk: Hi6220: Document stub clock driver
  dt-bindings: arm: Hi6220: add doc for SRAM controller
  clk: atlas7: fix pll missed divide NR in fraction mode
  clk: atlas7: fix bit field and its root clk for coresight_tpiu
  ...
2015-08-31 17:26:48 -07:00
Xiong Zhang
d8e19f99d3 drm/i915/skl: Adding DDI_E power well domain
From B spec, DDI_E port belong to PowerWell 2, but
DDI_E share the powerwell_req/staus register bit with
DDI_A which belong to DDI_A_E_POWER_WELL.

In order to communicate with the connector on DDI-E, both
DDI_A_E_POWER_WELL and POWER_WELL_2 must be enabled.

Currently intel_dp_power_get(DDI_E) only enable
DDI_A_E_POWER_WELL, this patch will not only enable
DDI_a_E_POWER_WELL but also enable POWER_WELL_2.

This patch also fix the DDI-E hotplug function.

Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-08-31 18:40:48 +03:00
Alex Deucher
7040c399ae drm/radeon/native: Send out the full AUX address
AUX addresses are 20 bits long. Send out the entire address instead of
just the low 16 bits.

Port of:
drm/radeon/atom: Send out the full AUX address
to radeon non-atom aux path

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2015-08-31 11:38:30 -04:00
Ville Syrjälä
3f8340cc72 drm/radeon/atom: Send out the full AUX address
AUX addresses are 20 bits long. Send out the entire address instead of
just the low 16 bits.

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2015-08-31 11:38:29 -04:00
Rodrigo Vivi
477ec3283c drm/i915: eDP can be present on DDI-E
Enable eDP on DDI-E.

Also let's remove duplicated definitions to avoid later confusion.

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Xiong Zhang <xiong.y.zhang@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-08-31 18:36:38 +03:00
Rodrigo Vivi
2800e4c228 drm/i915/skl: Enable DDI-E
There are OEMs using DDI-E out there,
so let's enable it.

Unfortunately there is no detection bit for DDI-E
So we need to rely on VBT for that.

I also need to give credits to Xiong since before seing
his approach to check info->support_* I was creating an ugly
vbt->ddie_sfuse_strap in order to propagate the ddi presence info

v2: Rebased as last patch in the series. since all other patches
in this series are needed for anything working propperly on DDI-E.

Credits-to: "Zhang, Xiong Y" <xiong.y.zhang@intel.com>
Cc: "Zhang, Xiong Y" <xiong.y.zhang@intel.com>
Reviewed-by: Xiong Zhang <xiong.y.zhang@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-08-31 18:28:09 +03:00
Xiong Zhang
11c1b657c4 drm/i915: Enable HDMI on DDI-E
DDI-E doesn't have the correspondent GMBUS pin.

We rely on VBT to tell us which one it being used instead.

The DVI/HDMI on shared port couldn't exist.

This patch isn't tested without hardware wchich has HDMI
on DDI-E.

v2: fix trailing whitespace
v3: MISSING_CASE take place of BUG()

Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-08-31 18:27:02 +03:00
Imre Deak
54875571bb drm/i915: apply the PCI_D0/D3 hibernation workaround everywhere on pre GEN6
commit da2bc1b9db
Author: Imre Deak <imre.deak@intel.com>
Date:   Thu Oct 23 19:23:26 2014 +0300

    drm/i915: add poweroff_late handler

introduced a regression on old platforms during hibernation. A workaround was
added in

commit ab3be73fa7
Author: Imre Deak <imre.deak@intel.com>
Date:   Mon Mar 2 13:04:41 2015 +0200

    drm/i915: gen4: work around hang during hibernation

using an explicit blacklist for the GENs/BIOS vendors where the issue was
reported. Later there we had reports of the same failure on platforms not on
this list.

To my best knowledge the correct thing to do is still to put the device to PCI
D3 state during hibernation, see [1] and [2] for the reasons. This also aligns
with our future plans to unify more the runtime and system suspend/resume
paths. Since an exact blacklist seems to be impractical (multiple GENs and
BIOS vendors are affected) apply the workaround on everything pre GEN6.

[1] http://lists.freedesktop.org/archives/intel-gfx/2015-February/060710.html
[2] https://lkml.org/lkml/2015/6/22/274

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=95061
Reported-by: Ilya Tumaykin <itumaykin@gmail.com>
Reported-by: Dirk Griesbach <spamthis@freenet.de>
Reported-by: Pavel Machek <pavel@ucw.cz>
Reported-by: Mikko Rapeli <mikko.rapeli@iki.fi>
Tested-by: Mikko Rapeli <mikko.rapeli@iki.fi>
Reported-by: Paul Bolle <pebolle@tiscali.nl>
CC: stable@vger.kernel.org
Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-08-31 18:18:51 +03:00
Ville Syrjälä
d14e7b6d1d drm/i915: Check DP link status on long hpd too
We are no longer checkling the DP link status on long hpd. We used to do
that from the .hot_plug() handler, but it was removed when MST got
introduced.

If there's no userspace we now fail to retrain the link if the sink
power is toggled (or cable yanked and replugged), meaning the user is
left staring at a blank screen. With the retraining put back that should
be fixed.

Also remove the leftover comment that referred to the old retraining
from .hot_plug().

Fixes a regression introduced in:
commit 0e32b39cee
Author: Dave Airlie <airlied@redhat.com>
Date:   Fri May 2 14:02:48 2014 +1000

    drm/i915: add DP 1.2 MST support (v0.7)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89453
Tested-by: Palmer Dabbelt <palmer@dabbelt.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91407
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89461
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89594
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85641
Cc: Dave Airlie <airlied@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-08-31 18:16:43 +03:00
Dave Airlie
879a37d00f Merge branch 'exynos-drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-next
This is a second pull-request which adds last part of
atomic modeset/pageflip support, render node support,
clean-up, and fix-up.

* 'exynos-drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos:
  drm/exynos: fix build warning to exynos_drm_gem.c
  drm/exynos: Properly report supported formats for each device
  drm/exynos: add render node support
  drm/exynos: implement atomic_{begin/flush} of DECON
  drm/exynos: remove legacy ->suspend()/resume()
  drm/exynos: Enable atomic modesetting feature
  drm/exynos: remove wait queue for pending page flip
  drm/exynos: wait all planes updates to finish
  drm/exynos: add atomic asynchronous commit
  drm/exynos: fimd: only finish update if START == START_S
  drm/exynos: add macro to get the address of START_S reg
  drm/exynos: check for pending fb before finish update
  drm/exynos: fimd: move window protect code to prepare/cleanup_plane
  drm/exynos: add prepare and cleanup phases for planes
  drm/exynos: fimd: unify call to exynos_drm_crtc_finish_pageflip()
  drm/exynos: don't track enabled state at exynos_crtc
2015-08-31 10:25:45 +10:00
Dave Airlie
701078d538 Merge tag 'drm-intel-next-fixes-2015-08-28' of git://anongit.freedesktop.org/drm-intel into drm-next
Some i915 fixes headed for v4.3. SKL DDI-E is a wip, but here's the
first in a series.

* tag 'drm-intel-next-fixes-2015-08-28' of git://anongit.freedesktop.org/drm-intel:
  drm/i915/skl: enable DDI-E hotplug
  drm/i915: Fix build warning on 32-bit
  drm/i915/skl: Update DDI buffer translation programming.
  drm/i915: Allow parsing of variable size child device entries from VBT
  drm/i915: fix link rates reported for SKL
  drm/i915: fix VBT parsing for SDVO child device mapping
2015-08-31 10:06:22 +10:00
Inki Dae
50002d4c21 drm/exynos: fix build warning to exynos_drm_gem.c
Signed-off-by: Inki Dae <daeinki@gmail.com>
2015-08-31 01:12:36 +09:00
Marek Szyprowski
fbbb1e1a7f drm/exynos: Properly report supported formats for each device
Exynos DRM reported that all planes for all supported sub-devices supports
only three pixel formats: XRGB24, ARGB24 and NV12. This patch lets each
Exynos DRM sub-drivers to provide the list of supported pixel formats
and registers this list to DRM core.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-31 01:03:02 +09:00
Joonyoung Shim
74f230d2a7 drm/exynos: add render node support
This patch allows clients who want to use render node to access
rendering relevant ioctls - g2d, post processor and gem allocation.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-31 01:02:59 +09:00
Hyungwon Hwang
cc5a7b3579 drm/exynos: implement atomic_{begin/flush} of DECON
Each CRTC's atomic_{begin/flush} must stop/start the update of shadow
registers to active register in the functions. This patch achieves these
purpose by moving the setting of protection bits to those functions from
decon_update_plane.

v2: rebased to the branch exynos-drm-next

Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-31 01:02:58 +09:00
Gustavo Padovan
e7fefb1d5a drm/exynos: remove legacy ->suspend()/resume()
These legacy helpers should only be used by shadow-attaching drivers.
KMS drivers has its own way to handle suspend/resume and don't need to
use these two helpers.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <daeinki@gmail.com>
2015-08-31 01:02:56 +09:00
Gustavo Padovan
c8c38ccff9 drm/exynos: Enable atomic modesetting feature
From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

Now that atomic modesetting is implemented for exynos enable the
DRIVER_ATOMIC flag on the driver's features.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-31 00:27:38 +09:00
Gustavo Padovan
7cf23eaf0d drm/exynos: remove wait queue for pending page flip
Exynos atomic commit procedures already does this job of waiting for
pending updates to finish, that means using pending_flip_queue is
pointless now because the disable CRTC procedure will never happen
during a page_flip.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-31 00:27:38 +09:00
Gustavo Padovan
c4533665d8 drm/exynos: wait all planes updates to finish
Add infrastructure to wait for all planes updates to finish by using
an atomic_t variable to track how many pending updates we are waiting
plus a wait_queue for the wait part.

It also changes vblank behaviour and keeps it enabled for all types
of updates

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-31 00:27:38 +09:00
Gustavo Padovan
a379df1935 drm/exynos: add atomic asynchronous commit
The atomic modesetting interfaces supports async commits that should be
implemented by the drivers. If drm core requests an async commit
exynos_atomic_commit() will now schedule a work task to run the update later.

It also serializes commits that needs to run on the same crtc, putting the
following commit to wait until the current one is finished.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-31 00:27:38 +09:00
Gustavo Padovan
cb11b3f189 drm/exynos: fimd: only finish update if START == START_S
fimd_update_plane() programs BUF_START[win] and during the update
BUF_START[win] is copied to BUF_START_S[win] (its shadow register)
and starts scanning out, then it raises a irq.

The fimd_irq_handler, in the case we have a pending_fb, will check
the fb value was copied to START_S register and finish the update
in case of success.

Based on patch from Daniel Kurtz <djkurtz@chromium.org>

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-31 00:27:37 +09:00
Gustavo Padovan
822f6dfd71 drm/exynos: check for pending fb before finish update
The current code was ignoring the end of update for all overlay planes,
caring only for the primary plane update in case of pageflip.

This change adds a change to start to check for pending updates for all
planes through exynos_plane->pending_fb. At the start of plane update the
pending_fb is set with the fb to be shown on the screen. Then only when to
fb is already presented in the screen we set pending_fb to NULL to
signal that the update was finished.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>

fixup! drm/exynos: check for pending fb before finish update
2015-08-31 00:27:37 +09:00
Gustavo Padovan
ce3ff36be9 drm/exynos: fimd: move window protect code to prepare/cleanup_plane
Only set/clear the update bit in the CRTC's .atomic_begin()/flush()
so all planes are really committed at the same time.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-31 00:27:36 +09:00
Gustavo Padovan
d9220d4733 drm/exynos: add prepare and cleanup phases for planes
From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

.prepare_plane() and .cleanup_plane() allows to perform extra operations
before and after the update of planes. For FIMD for example this will
be used to enable disable the shadow protection bit.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-31 00:27:36 +09:00
Gustavo Padovan
fc75f7107a drm/exynos: fimd: unify call to exynos_drm_crtc_finish_pageflip()
Unify handling of finished plane update to prepare for a following patch
that will check for the START and START_S regs to really make sure that
the plane was updated.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-31 00:27:36 +09:00
Gustavo Padovan
bb0fa93523 drm/exynos: don't track enabled state at exynos_crtc
struct drm_crtc already stores the enabled state of the crtc
thus we don't need to replicate enabled in exynos_drm_crtc.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-31 00:27:36 +09:00
Mark Brown
532161e6cc Merge remote-tracking branches 'asoc/topic/rcar', 'asoc/topic/reg-default', 'asoc/topic/rl6231', 'asoc/topic/rockchip' and 'asoc/topic/rt286' into asoc-next 2015-08-30 15:55:54 +01:00
Christoph Hellwig
2497ee7215 amdkfd: use <linux/mman.h> instead of <uapi/asm-generic/mman-common.h>
The latter is a default version of <asm/mman.h> and not for driver use.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
2015-08-30 12:36:58 +03:00
Chunming Zhou
6e7a384074 drm/amdgpu: use IB for fill_buffer instead of direct command
Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
Reviewed-by: Christian K?nig <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-08-28 15:04:19 -04:00
Christian König
8f8202f771 drm/amdgpu: stop trying to suspend UVD sessions v2
Saving the current UVD state on suspend and restoring it on resume
just doesn't work reliable. Just close cleanup all sessions on suspend.

Ported from radeon commit "12e49feadff6d7b7ebbe852b36943a71524d8d34".

v2: rebased

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v1)
2015-08-28 15:04:18 -04:00
Christian König
e61235db62 drm/amdgpu: add scheduler dependency callback v2
This way the scheduler doesn't wait in it's work thread any more.

v2: fix race conditions

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
2015-08-28 15:04:17 -04:00
Christian König
69bd5bf13a drm/amdgpu: let the scheduler work more with jobs v2
v2: fix another race condition

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
2015-08-28 15:04:17 -04:00
Alex Deucher
86b7709d48 drm/radeon: fix HDMI quantization_range for pre-DCE5 asics
Support for output_csc is only available on DCE5 and newer so
don't mess with the HDMI quantization_range on pre-DCE5 asics.

bug:
https://bugs.freedesktop.org/show_bug.cgi?id=83226

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2015-08-28 15:04:16 -04:00
Gary Wang
39d9b85a4d drm/i915: set CDCLK if DPLL0 enabled during resuming from S3
Since BIOS RC 1.4 it would enable CDCLK PLL during BIOS S3 resume, then
driver needs to set CDCLK to avoid display corruption if DPLL0 enabled.

References: https://bugs.freedesktop.org/show_bug.cgi?id=91697
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Reviewed-by: Cooper Chiou <cooper.chiou@intel.com>
Reviewed-by: Wei Shun Chang <wei.shun.chang@intel.com>
Tested-by: Gary Wang <gary.c.wang@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Gavin Hindman <gavin.hindman@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Xiong Y Zhang <xiong.y.zhang@intel.com>
Signed-off-by: Gary Wang <gary.c.wang@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-08-28 20:32:02 +03:00
Daniel Vetter
01302d4d17 drm/i915: Update DRIVER_DATE to 20150828
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-08-28 18:05:26 +02:00
Dave Airlie
92cffd56b2 drm/nouveau/dispnv04: fix build on powerpc
align with mask code in overlay.c, Ben can clean the naming
up later if necessary.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-08-28 20:33:58 +10:00
Dave Airlie
4b9e78bd9f nouveau: fix powerpc build
Reported-by: Ilia Mirkin on irc.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-08-28 18:18:10 +10:00
Ben Skeggs
a3c1ff87cf drm/nouveau: bump driver version for release
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:49 +10:00
Ben Skeggs
43a70661ea drm/nouveau/tegra: merge platform setup from nouveau drm
The copyright header in nvkm/engine/device/platform.c has been replaced
with the NVIDIA one from drm/nouveau_platform.c, as most of the actual
code is now theirs.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:49 +10:00
Ben Skeggs
340b0e7c50 drm/nouveau/pci: merge agp handling from nouveau drm
This commit reinstates the pre-DEVINIT AGP fiddling that was broken in
an earlier commit.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:49 +10:00
Ben Skeggs
26c9e8effe drm/nouveau/device: remove pci/platform_device from common struct
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:49 +10:00
Ben Skeggs
c7af0ff0e8 drm/nouveau/device: import pciid list and integrate quirks with it
PCI IDs taken from the NVIDIA binary driver, with permission.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:48 +10:00
Ben Skeggs
7e8820fed7 drm/nouveau/device: cleaner abstraction for device resource functions
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:48 +10:00
Ben Skeggs
2b700825e7 drm/nouveau/mc: move device irq handling to platform-specific code
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:48 +10:00
Ben Skeggs
ae0a5b2dd2 drm/nouveau/mc/gf100-: handle second interrupt tree
Doesn't fix any known issue, but best be safe in case control is handed
to us from firmware with these left enabled.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:48 +10:00
Ben Skeggs
d4c4cc8373 drm/nouveau/mc: abstract interface to master intr registers
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:48 +10:00
Ben Skeggs
0a34fb3149 drm/nouveau/pci: new subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:48 +10:00
Ben Skeggs
fbd58ebda9 drm/nouveau/object: merge with handle
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:47 +10:00
Ben Skeggs
68f3f702b6 drm/nouveau/core: remove the remainder of the previous style
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:47 +10:00
Ben Skeggs
7624fc011e drm/nouveau/mpeg: convert to new-style nvkm_engine
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:47 +10:00
Ben Skeggs
6f41c7c569 drm/nouveau/sw: convert to new-style nvkm_engine
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:47 +10:00
Ben Skeggs
97070f23c6 drm/nouveau/pm: convert to new-style nvkm_engine
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:47 +10:00
Ben Skeggs
c85ee6ca79 drm/nouveau/gr: convert to new-style nvkm_engine
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:47 +10:00
Ben Skeggs
13de7f4629 drm/nouveau/fifo: convert to new-style nvkm_engine
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:46 +10:00
Ben Skeggs
70aa8670e5 drm/nouveau/disp: convert to new-style nvkm_engine
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:46 +10:00
Ben Skeggs
bd70563f01 drm/nouveau/dma: convert to new-style nvkm_engine
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:46 +10:00
Ben Skeggs
14d74acafb drm/nouveau/cipher: convert to new-style nvkm_engine
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:46 +10:00
Ben Skeggs
e5b31ca632 drm/nouveau/ce: convert to new-style nvkm_engine
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:46 +10:00
Ben Skeggs
98b20c9ab8 drm/nouveau/xtensa: convert to new-style nvkm_engine
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:45 +10:00
Ben Skeggs
53e60da43a drm/nouveau/falcon: convert to new-style nvkm_engine
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:45 +10:00
Ben Skeggs
437b2296ce drm/nouveau/volt: convert to new-style nvkm_subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:45 +10:00
Ben Skeggs
31649ecf47 drm/nouveau/tmr: convert to new-style nvkm_subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:45 +10:00
Ben Skeggs
57113c0170 drm/nouveau/therm: convert to new-style nvkm_subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:45 +10:00
Ben Skeggs
e2ca4e7d6e drm/nouveau/pmu: convert to new-style nvkm_subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:45 +10:00
Ben Skeggs
a4f7bd3608 drm/nouveau/mxm: convert to new-style nvkm_subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:45 +10:00
Ben Skeggs
c9582455ab drm/nouveau/mmu: convert to new-style nvkm_subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:44 +10:00
Ben Skeggs
54dcadd5b6 drm/nouveau/mc: convert to new-style nvkm_subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:44 +10:00
Ben Skeggs
70bc7182cb drm/nouveau/ltc: convert to new-style nvkm_subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:44 +10:00
Ben Skeggs
b7a2bc1886 drm/nouveau/imem: convert to new-style nvkm_subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:44 +10:00
Ben Skeggs
8de65bd090 drm/nouveau/devinit: run devinit scripts right after preinit
This ensures we have a valid mask of disabled engines before we start
trying to execute fini()/init() on the subdevs, potentially touching
devices that don't exist.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:44 +10:00
Ben Skeggs
551d341755 drm/nouveau/ibus: convert to new-style nvkm_subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:44 +10:00
Ben Skeggs
49bd8da513 drm/nouveau/i2c: convert to new-style nvkm_subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:43 +10:00
Ben Skeggs
2ea7249fe2 drm/nouveau/gpio: convert to new-style nvkm_subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:43 +10:00
Ben Skeggs
c5fcafa528 drm/nouveau/fuse: convert to new-style nvkm_subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:43 +10:00
Ben Skeggs
03c8952fb3 drm/nouveau/fb: convert to new-style nvkm_subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:43 +10:00
Ben Skeggs
151abd44c2 drm/nouveau/devinit: convert to new-style nvkm_subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:43 +10:00
Ben Skeggs
6625f55c08 drm/nouveau/clk: convert to new-style nvkm_subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:42 +10:00
Ben Skeggs
bb23f9d791 drm/nouveau/bus: convert to new-style nvkm_subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:42 +10:00
Ben Skeggs
46484438ab drm/nouveau/bios: convert to new-style nvkm_subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:42 +10:00
Ben Skeggs
3293228174 drm/nouveau/bar: convert to new-style nvkm_subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:42 +10:00
Ben Skeggs
ef8bc5760b drm/nouveau/core: kill some (now) dead code
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:42 +10:00
Ben Skeggs
07b9e6cc95 drm/nouveau/sw: convert user classes to new-style nvkm_object
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:42 +10:00
Ben Skeggs
5ffeb84b8e drm/nouveau/pm: convert user classes to new-style nvkm_object
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:41 +10:00
Ben Skeggs
218f978d43 drm/nouveau/mpeg: convert user classes to new-style nvkm_object
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:41 +10:00
Ben Skeggs
27f3d6cf80 drm/nouveau/gr: convert user classes to new-style nvkm_object
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:41 +10:00
Ben Skeggs
b3c9815047 drm/nouveau/cipher: convert user classes to new-style nvkm_object
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:41 +10:00
Ben Skeggs
e5ff112781 drm/nouveau/ce: convert user classes to new-style nvkm_object
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:41 +10:00
Ben Skeggs
c79a191b27 drm/nouveau/xtensa: convert user classes to new-style nvkm_object
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:41 +10:00
Ben Skeggs
9d498e0f7a drm/nouveau/falcon: convert user classes to new-style nvkm_object
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:40 +10:00
Ben Skeggs
8f0649b5c6 drm/nouveau/fifo: convert user classes to new-style nvkm_object
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:40 +10:00
Ben Skeggs
9a65a38c45 drm/nouveau/fifo: split user classes out from engine implementations
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:40 +10:00
Ben Skeggs
0ce41e3c66 drm/nouveau/disp: convert user classes to new-style nvkm_object
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:40 +10:00
Ben Skeggs
2a7909c0ad drm/nouveau/disp: split user classes out from engine implementations
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:40 +10:00
Ben Skeggs
0710cc3148 drm/nouveau/dma: convert user classes to new-style nvkm_object
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:40 +10:00
Ben Skeggs
19fef52d93 drm/nouveau/dma: split user classes out from engine implementations
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:39 +10:00
Ben Skeggs
0e29998a89 drm/nouveau/device: convert ctrl class to new-style nvkm_object
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:39 +10:00
Ben Skeggs
2a9f847f5d drm/nouveau/device: convert user class to new-style nvkm_object
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:39 +10:00
Ben Skeggs
24bd0930be drm/nouveau/client: convert to new-style nvkm_object
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:39 +10:00
Ben Skeggs
6157091177 drm/nouveau/sw: remove dependence on namedb/engctx lookup
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:39 +10:00
Ben Skeggs
590801c1a3 drm/nouveau/mpeg: remove dependence on namedb/engctx lookup
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:39 +10:00
Ben Skeggs
a65955e19e drm/nouveau/gr: remove dependence on namedb/engctx lookup
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:38 +10:00
Ben Skeggs
6ca307b0c9 drm/nouveau/fifo: remove dependence on namedb/engctx lookup
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:38 +10:00
Ben Skeggs
35acf3d72c drm/nouveau/cipher: remove dependence on namedb/engctx lookup
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:38 +10:00
Ben Skeggs
a83d8872fc drm/nouveau/falcon: remove dependence on namedb/engctx lookup
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:38 +10:00
Ben Skeggs
344c2d429d drm/nouveau/fb: remove dependence on namedb/engctx lookup
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:38 +10:00
Ben Skeggs
898a2b3213 drm/nouveau/sw: turn flip completion into an event
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:38 +10:00
Ben Skeggs
cd459e7776 drm/nouveau/sw/nv04: replace direct context access with GetRef method
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:37 +10:00
Ben Skeggs
1d2a1e5386 drm/nouveau/ramht: remove dependence on namedb
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:37 +10:00
Ben Skeggs
f027f49166 drm/nouveau/gpuobj: separate allocation from nvkm_object
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:37 +10:00
Ben Skeggs
227c95d90a drm/nouveau/gr: directly use instmem where currently possible
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:37 +10:00
Ben Skeggs
358ce601ae drm/nouveau/fifo: directly use instmem for runlists and polling areas
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:37 +10:00
Ben Skeggs
faf468981e drm/nouveau/xtensa: directly use instmem for ucode image
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:37 +10:00
Ben Skeggs
406ca8c714 drm/nouveau/falcon: directly use instmem for ucode image
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:36 +10:00
Ben Skeggs
5b1ab0c2c7 drm/nouveau/imem/nv04-nv40: directly use instmem for vbios/ramfc/ramro
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:36 +10:00
Ben Skeggs
adb53d2773 drm/nouveau/bar/gf100: directly use instmem for channel descriptors
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:36 +10:00
Ben Skeggs
d0659d3277 drm/nouveau/mmu: directly use instmem for page tables
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:36 +10:00
Ben Skeggs
d8e83994aa drm/nouveau/imem: improve management of instance memory
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:36 +10:00
Ben Skeggs
1de68568d6 drm/nouveau/mmu: protect each vm with its own mutex
An upcoming commit requires being able to modify the PRAMIN BAR page
tables while already holding the MMU subdev mutex.

To solve this issue, each VM has been given its own mutex.  As a nice
side-effect, this also allows separate VMs to be updated concurrently.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:35 +10:00
Ben Skeggs
524bdbf202 drm/nouveau/core: prepare for new-style objects
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:35 +10:00
Ben Skeggs
6cf813fb26 drm/nouveau/device: prepare for new-style subdevs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:35 +10:00
Ben Skeggs
7974dd1bdb drm/nouveau/device: separate construction of pci/tegra devices
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:34 +10:00
Ben Skeggs
168c2e213d drm/nouveau/engine: implement support for new-style nvkm_engine
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:34 +10:00
Ben Skeggs
f0290215c4 drm/nouveau/subdev: implement support for new-style nvkm_subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:34 +10:00
Ben Skeggs
cbea21e2ab drm/nouveau/object: implement support for new-style nvkm_object
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:34 +10:00
Ben Skeggs
89c651e221 drm/nouveau/engine: rename some functions to avoid upcoming conflicts
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:34 +10:00
Ben Skeggs
3a8c3400f3 drm/nouveau/subdev: rename some functions to avoid upcoming conflicts
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:33 +10:00
Ben Skeggs
aa35888ff0 drm/nouveau/object: rename some functions to avoid upcoming conflicts
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:33 +10:00
Ben Skeggs
d61f4c178c drm/nouveau/nvif: device time mthd
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:33 +10:00
Ben Skeggs
159045cdc4 drm/nouveau/nvif: replace pushbuf with vm in fermi/kepler gpfifo class args
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:33 +10:00
Ben Skeggs
22827fa42b drm/nouveau/nvif: return chipset/board names from device info method
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:33 +10:00
Ben Skeggs
d56241794c drm/nouveau/nvif: add supported engines query to kepler gpfifo class
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:33 +10:00
Ben Skeggs
41a634064d drm/nouveau/nvif: return min/max versions for supported object classes
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:32 +10:00
Ben Skeggs
f58ddf9581 drm/nouveau/nvif: assign internal class identifiers to sw classes
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:32 +10:00
Ben Skeggs
315a8b2edf drm/nouveau/nvif: use negative oclass identifier for internal classes
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:32 +10:00
Ben Skeggs
5c15bf709e drm/nouveau/nvif: return success from sclass even for objects without children
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:32 +10:00
Ben Skeggs
99d4d36ad6 drm/nouveau/nvif: extend nop ioctl to return nvif version identifier
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:32 +10:00
Ben Skeggs
bf81df9be2 drm/nouveau/nvif: replace path-based object identification
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:32 +10:00
Ben Skeggs
a01ca78c8f drm/nouveau/nvif: simplify and tidy library interfaces
A variety of tweaks to the NVIF library interfaces, mostly ripping out
things that turned out to be not so useful.

- Removed refcounting from nvif_object, callers are expected to not be
  stupid instead.
- nvif_client is directly reachable from anything derived from nvif_object,
  removing the need for heuristics to locate it
- _new() versions of interfaces, that allocate memory for the object
  they construct, have been removed.  The vast majority of callers used
  the embedded _init() interfaces.
- No longer storing constructor arguments (and the data returned from
  nvkm) inside nvif_object, it's more or less unused and just wastes
  memory.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:32 +10:00
Ben Skeggs
4e7e62d607 drm/nouveau/client: store default device by handle, not reference
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:31 +10:00
Ben Skeggs
102b49da15 drm/nouveau/parent: remove some (now) unnecessary special-case handling
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:31 +10:00
Ben Skeggs
493f189dc0 drm/nouveau/object: store object type data outside of handle
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:31 +10:00
Ben Skeggs
a1e8873622 drm/nouveau/device: decouple from engine machinery
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:31 +10:00
Ben Skeggs
a1bfb29a33 drm/nouveau/device: split user device implementation out on its own
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:31 +10:00
Ben Skeggs
0ac9d210a1 drm/nouveau/device: simplify subdev construction
Replaces the piece-by-piece (in response to NV_DEVICE ctor args) device
contruction with a once-off all-or-nothing approach, eliminating some
tricky refcounting issues.  The partial device init capability was only
required by some tools, and has been moved to probe time instead.

Temporarily removes a workaround for some boards where we need to fiddle
with AGP registers before executing the DEVINIT scripts.  A later commit
in this series reinstates it.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:31 +10:00
Ben Skeggs
e781dc8f6c drm/nouveau/device: tidy ctor/dtor interfaces
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:30 +10:00
Ben Skeggs
76ecea5b4b drm/nouveau/client: tidy ctor/dtor interfaces
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:30 +10:00
Ben Skeggs
47b2505efb drm/nouveau/platform: remove subclassing of nvkm_device
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:30 +10:00
Ben Skeggs
f2c906fc0c drm/nouveau/disp: transition outp/conn away from being based on nvkm_object
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:30 +10:00
Ben Skeggs
2aa5eac516 drm/nouveau/i2c: transition pad/ports away from being based on nvkm_object
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:29 +10:00
Ben Skeggs
d36a99d2da drm/nouveau/fb: transition nvkm_ram away from being based on nvkm_object
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:29 +10:00
Ben Skeggs
a8dae9fe0e drm/nouveau/vga: require nvkm_device pointer in accessor functions
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:29 +10:00
Ben Skeggs
95cf469cc3 drm/nouveau/imem: use object accessor function for suspend/resume
Very much not ideal, but this will be improved later.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:29 +10:00
Ben Skeggs
cfdc4c44b4 drm/nouveau/core: wrap direct use of object accessor functions
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:29 +10:00
Ben Skeggs
572fb13db2 drm/nouveau/mpeg: switch to gpuobj accessor macros
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:28 +10:00
Ben Skeggs
142ea05f49 drm/nouveau/gr: switch to gpuobj accessor macros
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:28 +10:00
Ben Skeggs
5444e770e3 drm/nouveau/fifo: switch to gpuobj accessor macros
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:28 +10:00
Ben Skeggs
3f532ef1e2 drm/nouveau/dma: switch to gpuobj accessor macros
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:28 +10:00
Ben Skeggs
6d06fd68cb drm/nouveau/cipher: switch to gpuobj accessor macros
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:28 +10:00
Ben Skeggs
edb1dc51de drm/nouveau/xtensa: switch to gpuobj accessor macros
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:28 +10:00
Ben Skeggs
9cc264a3aa drm/nouveau/falcon: switch to gpuobj accessor macros
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:28 +10:00
Ben Skeggs
cd821077aa drm/nouveau/mmu: switch to gpuobj accessor macros
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:27 +10:00
Ben Skeggs
1918707556 drm/nouveau/bar: switch to gpuobj accessor macros
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:27 +10:00
Ben Skeggs
45ea503161 drm/nouveau/core: switch to gpuobj accessor macros
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:27 +10:00
Ben Skeggs
384af9acea drm/nouveau/gpuobj: type-safe accessor macros
These require an explicit struct nvkm_gpuobj pointer, unlike the previous
macros which take a void *, and work with any nvkm_object.

New semantics require acquiring/releasing a gpuobj before accessing them,
which will be made use of in later patches to greatly reduce the overhead
of accesses, particularly when a direct mmio mapping of the object is not
available (suspend/resume, out of ioremap() space, and on GK20A).

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:27 +10:00
Ben Skeggs
9ccdc76006 drm/nouveau/xtensa: remove object accessor functions
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:27 +10:00
Ben Skeggs
63902181a7 drm/nouveau/falcon: remove object accessor functions
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:27 +10:00
Ben Skeggs
a47474261e drm/nouveau/imem: remove object accessor functions
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:26 +10:00
Ben Skeggs
7e24c1145a drm/nouveau/fuse: remove object accessor functions
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:26 +10:00
Ben Skeggs
7f5f518fd7 drm/nouveau/bios: remove object accessor functions
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:26 +10:00
Ben Skeggs
5300394106 drm/nouveau/core: remove last printks
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:26 +10:00
Ben Skeggs
9ad97ede4b drm/nouveau: use dev_* for logging
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:26 +10:00
Ben Skeggs
9e3911e5b2 drm/nouveau/sec: switch to subdev printk macros
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:26 +10:00
Ben Skeggs
476901ff6c drm/nouveau/pm: switch to subdev printk macros
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:25 +10:00
Ben Skeggs
b835c09bc6 drm/nouveau/mpeg: switch to subdev printk macros
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-08-28 12:40:25 +10:00