]> git.kernelconcepts.de Git - karo-tx-linux.git/log
karo-tx-linux.git
8 years agor128_drm.h: include drm/drm.h
Mikko Rapeli [Thu, 15 Oct 2015 05:55:46 +0000 (07:55 +0200)]
r128_drm.h: include drm/drm.h

Fixes compile error:

drm/r128_drm.h:156:23: error: array type has incomplete element type
  struct drm_clip_rect boxes[R128_NR_SAREA_CLIPRECTS];

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agosavage_drm.h: include <drm/drm.h>
Mikko Rapeli [Thu, 15 Oct 2015 05:55:49 +0000 (07:55 +0200)]
savage_drm.h: include <drm/drm.h>

Fixes compiler error:

drm/savage_drm.h:50:24: error: array type has incomplete element type
  struct drm_tex_region texList[SAVAGE_NR_TEX_HEAPS][SAVAGE_NR_TEX_REGIONS +

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agogpu/doc: Convert to markdown harder
Lukas Wunner [Mon, 12 Oct 2015 07:10:33 +0000 (09:10 +0200)]
gpu/doc: Convert to markdown harder

This snippet...

    * Lock VMA manager for extended lookups. Only *_locked() VMA function calls
    * are allowed while holding this lock. All other contexts are blocked from VMA
    * until the lock is released via drm_vma_offset_unlock_lookup().

...causes markdown-enabled kernel-doc to barf:

    debian/build/build-doc/Documentation/DocBook/gpu.aux.xml:3247: parser error : Opening and ending tag mismatch: emphasis line 3247 and function
       *<function><emphasis>locked</function> VMA function calls are allowed while
                                             ^
    /root/airlied/debian/build/build-doc/Documentation/DocBook/gpu.aux.xml:3249: parser error : Opening and ending tag mismatch: function line 3249 and emphasis
       released via <function>drm</emphasis>vma_offset_unlock_lookup</function>.
                                            ^
    unable to parse /root/airlied/debian/build/build-doc/Documentation/DocBook/gpu.aux.xml

A quick workaround is to replace *_locked() by X_locked().

Cc: Danilo Cesar Lemes de Paula <danilo.cesar@collabora.co.uk>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
[danvet: Just drop the X_ too, the usual style is _unlocked, except
that _ seems to be what annoys markdown.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agogpu/doc: Add vga_switcheroo documentation
Lukas Wunner [Sun, 11 Oct 2015 09:55:00 +0000 (11:55 +0200)]
gpu/doc: Add vga_switcheroo documentation

Requires Markdown support.

Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agogpu/doc: Fix up remaining occurrences of old document title
Lukas Wunner [Sun, 11 Oct 2015 09:26:26 +0000 (11:26 +0200)]
gpu/doc: Fix up remaining occurrences of old document title

Following Daniel's renaming of the document.

Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agodrm/doc: Rename docbook to gpu.tmpl
Daniel Vetter [Wed, 7 Oct 2015 07:55:28 +0000 (09:55 +0200)]
drm/doc: Rename docbook to gpu.tmpl

DRM is a lot more than a direct rendering manager nowadays, and there's
also a bunch of things worth documenting for gpu driver developers
outside of drivers/gpu/drm, like vgaarb, vga_switcheroo or the various
hardware buses like host1x and ipu-v3.

To avoid further confusion let's rename the top-level to reflect
reality.

And yes I'm already looking forward to when we need to replace the G
in GPU with a * ;-)

Inspired by a thread with Lukas since he refused to include the
vga_switcheroo docs into the drm docs because it's not drm.

Cc: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
[Lukas: Drop BUG() easter egg in i915_gem_execbuffer.c spotted by Jani
and fix typos in commit message.]
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Acked-by: Dave Airlie <airlied@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agodrm: misc cleanup
Rob Clark [Tue, 13 Oct 2015 14:13:28 +0000 (10:13 -0400)]
drm: misc cleanup

Drop unused drm_atomic and fix comment for drm_debug.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agovga_switcheroo: Use enum vga_switcheroo_client_id instead of int
Lukas Wunner [Fri, 28 Aug 2015 10:54:07 +0000 (12:54 +0200)]
vga_switcheroo: Use enum vga_switcheroo_client_id instead of int

Signed-off-by: Lukas Wunner <lukas@wunner.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agovga_switcheroo: Use VGA_SWITCHEROO_UNKNOWN_ID instead of -1
Lukas Wunner [Fri, 28 Aug 2015 11:30:32 +0000 (13:30 +0200)]
vga_switcheroo: Use VGA_SWITCHEROO_UNKNOWN_ID instead of -1

Signed-off-by: Lukas Wunner <lukas@wunner.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agovga_switcheroo: Use enum vga_switcheroo_state instead of int
Lukas Wunner [Fri, 28 Aug 2015 09:56:26 +0000 (11:56 +0200)]
vga_switcheroo: Use enum vga_switcheroo_state instead of int

Signed-off-by: Lukas Wunner <lukas@wunner.de>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agodrm: Add DRM_DEBUG_VBL()
Ville Syrjälä [Fri, 9 Oct 2015 19:57:37 +0000 (22:57 +0300)]
drm: Add DRM_DEBUG_VBL()

Add a new debug class for _verbose_ debug message from the vblank code.
That is message we spew out potentially for every vblank interrupt.
Thierry already got annoyed at the spew, and now I managed to lock up
my box with these debug prints (seems serial console + a few debug
prints every vblank aren't a good combination).

Or should I maybe call it DRM_DEBUG_IRQ?

Cc: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agodrm: Don't use '\' for string literal concatenation
Ville Syrjälä [Fri, 9 Oct 2015 19:57:36 +0000 (22:57 +0300)]
drm: Don't use '\' for string literal concatenation

String literals get concatenated just fine on their own,
no need to use '\'.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agodrm/<drivers>: Drop DRM_UNLOCKED from modeset drivers
Daniel Vetter [Tue, 8 Sep 2015 11:56:30 +0000 (13:56 +0200)]
drm/<drivers>: Drop DRM_UNLOCKED from modeset drivers

Just one special case (since i915 lost its ums code, yay):
- radeon: Has slots for the old ums ioctls which don't have
  DRM_UNLOCKED, but all filled with drm_invalid_op. So ok to drop it
  everywhere.

Every other kms driver just has DRM_UNLOCKED for all their ioctls, as
they should.

v2: admgpu happened, include that one too. And i915 lost its UMS
support which means we can change all the i915 ioctls too.

v3: Rebased on top of new vmwgfx DX interface extensions.

v4: Rebase on top of render-node support in exynos.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agodrm: Enforce unlocked ioctl operation for kms driver ioctls
Daniel Vetter [Mon, 28 Sep 2015 19:42:40 +0000 (21:42 +0200)]
drm: Enforce unlocked ioctl operation for kms driver ioctls

With the prep patches for i915 all kms drivers either have
DRM_UNLOCKED on all their ioctls. Or the ioctl always directly returns
with an invariant return value when in modeset mode. But that's only
the case for i915 and radeon. The drm core ioctls are unfortunately
too much a mess still to dare this.

Follow-up patches will remove DRM_UNLOCKED from all kms drivers to
prove that this is indeed the case.

Also update the documentation.

v2: Really only do this for driver ioctls, spotted by David Herrmann.
And drop spurious whitespace change.

Cc: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agodrm/i915: Mark getparam ioctl as DRM_UNLOCKED
Daniel Vetter [Tue, 8 Sep 2015 11:56:25 +0000 (13:56 +0200)]
drm/i915: Mark getparam ioctl as DRM_UNLOCKED

With kms all the data getparam looks at is actually invariant, and
certainly not protected by the global kms mutex. With ums all the
setup code is already racy as hell, so this won't make things any
worse.

I've done this change so that all ioctl still used by kms drivers
are marked as DRM_UNLOCKED, besides that we obviously don't need
it any more in kms mode.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agovirtio-gpu: add page flip support
Gerd Hoffmann [Wed, 23 Sep 2015 10:19:11 +0000 (12:19 +0200)]
virtio-gpu: add page flip support

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
8 years agovirtio-gpu: mark as a render gpu
Dave Airlie [Tue, 16 Jun 2015 05:41:56 +0000 (15:41 +1000)]
virtio-gpu: mark as a render gpu

Also add DRM_RENDER_ALLOW to the ioctls.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
8 years agovirtio-gpu: add basic prime support
Dave Airlie [Fri, 23 Jan 2015 03:04:11 +0000 (13:04 +1000)]
virtio-gpu: add basic prime support

This is enough to enable DRI3.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
8 years agovirtio-gpu: add 3d/virgl support
Gerd Hoffmann [Tue, 28 Oct 2014 11:48:00 +0000 (12:48 +0100)]
virtio-gpu: add 3d/virgl support

Add the bits needed for opengl rendering support: query
capabilities, new virtio commands, drm ioctls.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
8 years agovirtio-gpu: don't free things on ttm_bo_init failure
Dave Airlie [Tue, 13 Oct 2015 06:55:48 +0000 (16:55 +1000)]
virtio-gpu: don't free things on ttm_bo_init failure

ttm_bo_init will call the destroy callback which will do all
this, this was causing a double free.

Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agovirtio-gpu: wait for cursor updates finish
Gerd Hoffmann [Tue, 15 Sep 2015 06:20:46 +0000 (08:20 +0200)]
virtio-gpu: wait for cursor updates finish

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
8 years agovirtio-gpu: add & use virtio_gpu_queue_fenced_ctrl_buffer
Gerd Hoffmann [Wed, 19 Aug 2015 21:44:15 +0000 (23:44 +0200)]
virtio-gpu: add & use virtio_gpu_queue_fenced_ctrl_buffer

Add helper function to handle the submission of fenced control requests.
Make sure we initialize the fence while holding the virtqueue lock, so
requests can't be reordered.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
8 years agovirtio-gpu: add virtio_gpu_queue_ctrl_buffer_locked
Gerd Hoffmann [Wed, 19 Aug 2015 21:35:57 +0000 (23:35 +0200)]
virtio-gpu: add virtio_gpu_queue_ctrl_buffer_locked

Add virtio_gpu_queue_ctrl_buffer_locked function, which does the same as
virtio_gpu_queue_ctrl_buffer but does not take the virtqueue lock.  The
caller must hold the lock instead.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
8 years agovia_drm.h: move struct via_file_private definition to drivers/gpu/drm/via/via_drv.h
Mikko Rapeli [Thu, 15 Oct 2015 05:55:48 +0000 (07:55 +0200)]
via_drm.h: move struct via_file_private definition to drivers/gpu/drm/via/via_drv.h

Fixes userspace compile error since list_head is not exported to userspace
headers.

Suggested by Emil Velikov <emil.l.velikov@gmail.com> at
https://lkml.org/lkml/2015/6/3/792

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agoinclude/uapi/drm/sis_drm.h: move sis_file_private to drivers/gpu/drm/sis/sis_drv.h
Mikko Rapeli [Thu, 15 Oct 2015 05:55:50 +0000 (07:55 +0200)]
include/uapi/drm/sis_drm.h: move sis_file_private to drivers/gpu/drm/sis/sis_drv.h

Fixes userspace compile error:

drm/sis_drm.h:68:19: error: field ‘obj_list’ has incomplete type
  struct list_head obj_list;

Suggested by Emil Velikov <emil.l.velikov@gmail.com> at
https://lkml.org/lkml/2015/6/3/792

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agoMerge branch 'drm-dwhdmi-devel' of git://ftp.arm.linux.org.uk/~rmk/linux-arm into...
Dave Airlie [Fri, 16 Oct 2015 00:25:49 +0000 (10:25 +1000)]
Merge branch 'drm-dwhdmi-devel' of git://ftp.arm.linux.org.uk/~rmk/linux-arm into drm-next

This series:
* adds support for interlaced video modes to the ipu-v3 driver
  and dw_hdmi bridge.
* reworks the dw_hdmi connector enable/disable support, to ensure that
  when DRM disables the output, it stays disabled irrespective of the
  hotplug state.
* adds support for connector forcing, so we can force the hotplug state
  for this connector.
* adds the ALSA AHB audio driver to the bridge: Iwai has acked the
  audio driver.
* a few fixes to the ACR calculations to allow more modes to work with
  audio on iMX6.

Fabio has independently tested this series, so all patches here carry
his tested-by tag.

* 'drm-dwhdmi-devel' of git://ftp.arm.linux.org.uk/~rmk/linux-arm:
  drm: bridge/dw_hdmi: replace CTS calculation for the ACR
  drm: bridge/dw_hdmi: remove ratio support from ACR code
  drm: bridge/dw_hdmi: adjust pixel clock values in N calculation
  drm: bridge/dw_hdmi: avoid being recursive in N calculation
  drm: bridge/dw_hdmi-ahb-audio: allow larger buffer sizes
  drm: bridge/dw_hdmi-ahb-audio: basic support for multi-channel PCM audio
  drm: bridge/dw_hdmi-ahb-audio: parse ELD from HDMI driver
  drm: bridge/dw_hdmi-ahb-audio: add audio driver
  drm: bridge/dw_hdmi: improve HDMI enable/disable handling
  drm: bridge/dw_hdmi: add connector mode forcing
  drm: bridge/dw_hdmi: add support for interlaced video modes
  gpu: imx: fix support for interlaced modes
  gpu: imx: simplify sync polarity setting

8 years agoMerge commit '06d1ee32a4d25356a710b49d5e95dbdd68bdf505' of git://git.kernel.org/pub...
Dave Airlie [Fri, 16 Oct 2015 00:10:32 +0000 (10:10 +1000)]
Merge commit '06d1ee32a4d25356a710b49d5e95dbdd68bdf505' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into drm-next

Backmerge the drm-fixes pull from Linus's tree into drm-next.

This is to fix some conflicts and make future pulls cleaner

8 years agoMerge tag 'topic/drm-misc-2015-10-08' of git://anongit.freedesktop.org/drm-intel...
Dave Airlie [Fri, 16 Oct 2015 00:02:35 +0000 (10:02 +1000)]
Merge tag 'topic/drm-misc-2015-10-08' of git://anongit.freedesktop.org/drm-intel into drm-next

Another round of drm-misc. Unfortunately the DRM_UNLOCKED removal for
DRIVER_MODESET isn't complete yet for lack of review on 1-2 patches.
Otherwise just various stuff all over.

* tag 'topic/drm-misc-2015-10-08' of git://anongit.freedesktop.org/drm-intel:
  drm: Stop using drm_vblank_count() as the hw frame counter
  drm/irq: Use unsigned int pipe in public API
  drm: Use DRM_ROTATE_MASK and DRM_REFLECT_MASK
  drm: Add DRM_ROTATE_MASK and DRM_REFLECT_MASK
  vga_switcheroo: Add missing locking
  vgaarb: use kzalloc in vga_arbiter_add_pci_device()
  drm: Don't zero vblank timestamps from the irq handler
  drm: Hack around CONFIG_AGP=m build failures
  drm/i915: Remove setparam ioctl
  drm: Remove dummy agp ioctl wrappers
  drm/vmwgfx: Stop checking for DRM_UNLOCKED
  drm/drm_ioctl.c: kerneldoc
  drm: Define a drm_invalid_op ioctl implementation
  drm: Remove __OS_HAS_AGP
  drm/doc: Update docs about device instance setup

8 years agoMerge tag 'drm-intel-next-2015-09-28-merged' of git://anongit.freedesktop.org/drm...
Dave Airlie [Thu, 15 Oct 2015 23:59:19 +0000 (09:59 +1000)]
Merge tag 'drm-intel-next-2015-09-28-merged' of git://anongit.freedesktop.org/drm-intel into drm-next

drm-intel-next-2015-09-28:
- fastboot by default for some systems (Maarten Lankhorts)
- piles of workarounds for bxt and skl
- more fbc work from Paulo
- fix hdmi hotplug detection (Sonika)
- first few patches from Ville to parametrize register macros, prep work for
  typesafe mmio functions
- prep work for nv12 rotation (Tvrtko Ursulin)
- various other bugfixes and improvements all over

I have another backmerge here since things became messy and I didn't
realize you resolved some of them already (usually you complain when
there's a conflict ...).

For 4.4 I plan one more feature round after this and then that's it.
* tag 'drm-intel-next-2015-09-28-merged' of git://anongit.freedesktop.org/drm-intel: (80 commits)
  drm/i915: Update DRIVER_DATE to 20150928
  drm/i915: fix task reference leak in i915_debugfs.c
  drm/i915: Defer adding preallocated stolen objects to the VM list
  drm/i915: Remove extraneous request cancel.
  drm/i915: Enable querying offset of UV plane with intel_plane_obj_offset
  drm/i915: Support NV12 in rotated GGTT mapping
  drm/i915: Support appending to the rotated pages mapping
  drm/i915: Support planar formats in tile height calculations
  drm/i915/bxt: Update revision id for BXT C0
  drm/i915: Parametrize CSR_PROGRAM registers
  drm/i915: Parametrize DDI_BUF_TRANS registers
  drm/i915: Parametrize TV luma/chroma filter registers
  drm/i915: Replace raw numbers with the approproate register name in ILK turbo code
  drm/i915: Parametrize ILK turbo registers
  drm/i915: Parametrize FBC_TAG registers
  drm/i915: Parametrize GEN7_GT_SCRATCH and GEN7_LRA_LIMITS
  drm/i915: Parametrize LRC registers
  drm/i915: Don't pass sdvo_reg to intel_sdvo_select_{ddc, i2c}_bus()
  drm/i915: Ignore "digital output" and "not HDMI output" bits for eDP detection
  drm/i915: Make sure we don't detect eDP on g4x
  ...

8 years agoMerge branch 'drm-next-4.4' of git://people.freedesktop.org/~agd5f/linux into drm...
Dave Airlie [Thu, 15 Oct 2015 23:39:14 +0000 (09:39 +1000)]
Merge branch 'drm-next-4.4' of git://people.freedesktop.org/~agd5f/linux into drm-next

This is the first radeon and amdgpu pull for drm-next. Highlights include:
- Efficiency improvements to the CS checker for pre-SI asics
- Cursor fixes ported from radeon to amdgpu
- Enable GPU scheduler by default
- Add a bunch of GPUVM debugging options
- Add support for some new atombios opcodes
- Misc cleanups and fixes

* 'drm-next-4.4' of git://people.freedesktop.org/~agd5f/linux: (42 commits)
  drm/amdgpu: fix lockup when clean pending fences
  drm/amdgpu: add timer to fence to detect scheduler lockup
  drm/amdgpu: add VM CS mapping trace point
  drm/amdgpu: add option to clear VM page tables after every submit
  drm/amdgpu: add option to stop on VM fault
  drm/amdgpu: only print meaningful VM faults
  drm/amdgpu: also trace already allocated VMIDs
  drm/amdgpu: Drop unnecessary #include <linux/vga_switcheroo.h>
  drm/radeon: Drop unnecessary #include <linux/vga_switcheroo.h>
  drm/amdgpu: clean up pageflip interrupt handling
  drm/amdgpu: rework sdma structures
  drm/amdgpu: unpin cursor BOs on suspend and pin them again on resume
  drm/amdgpu/dce8: Fold set_cursor() into show_cursor()
  drm/amdgpu/dce8: Clean up reference counting and pinning of the cursor BOs
  drm/amdgpu/dce8: Move hotspot handling out of set_cursor
  drm/amdgpu/dce8: Re-show the cursor after a modeset (v2)
  drm/amdgpu/dce8: Use cursor_set2 hook for enabling / disabling the HW cursor
  drm/amdgpu/dce11: Fold set_cursor() into show_cursor()
  drm/amdgpu/dce11: Clean up reference counting and pinning of the cursor BOs
  drm/amdgpu/dce11: Move hotspot handling out of set_cursor
  ...

8 years agodrm/i915: Kill the leftover RMW from ivb_sprite_disable()
Ville Syrjälä [Thu, 15 Oct 2015 14:04:04 +0000 (17:04 +0300)]
drm/i915: Kill the leftover RMW from ivb_sprite_disable()

We still had one lingering RMW in ivb_sprite_disable(), all the other
RMWs were killed off from the sprite code some time ago. Kill the
straggler too.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agodrm/radeon: Use rdev->gem.mutex to protect hyperz/cmask owners
Daniel Vetter [Thu, 15 Oct 2015 07:36:34 +0000 (09:36 +0200)]
drm/radeon: Use rdev->gem.mutex to protect hyperz/cmask owners

This removes the last depency of radeon for dev->struct_mutex!

Also the locking scheme for hyperz/cmask owners seems a bit unsound,
there's no protection in the preclose handler (and that never did hold
dev->struct_mutex while being called). So grab the same lock there,
too.

There's also all the checks in the cs checker, but since the overall
design seems to never stall for the previous owner I figured it's ok
if I leave this racy. It was racy even before I touched it after all
too.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/i915: restore ggtt double-bind avoidance
Daniel Vetter [Thu, 15 Oct 2015 12:23:01 +0000 (14:23 +0200)]
drm/i915: restore ggtt double-bind avoidance

This was accidentally lost in

commit 75d04a3773ecee617847de963ae4195d6aa74c28
Author: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Date:   Tue Apr 28 17:56:17 2015 +0300

    drm/i915/gtt: Allocate va range only if vma is not bound

While at it implement an improved version suggested by Chris which
avoids the double-bind irrespective of what type of bind is done
first.

Note that this exact bug was already addressed in

commit d0e30adc42d979e4adc36b6c112b57337423b70c
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Jul 29 20:02:48 2015 +0100

    drm/i915: Mark PIN_USER binding as GLOBAL_BIND without the aliasing ppgtt

but the problem is still that originally in

commit 0875546c5318c85c13d07014af5350e9000bc9e9
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Mon Apr 20 09:04:05 2015 -0700

    drm/i915: Fix up the vma aliasing ppgtt binding

if forgotten to take into account there case where we have a
GLOBAL_BIND before a LOCAL_BIND. This patch here fixes that.

v2: Pimp commit message and revert the partial fix.

v3: Split into two functions to specialize on aliasing_ppgtt y/n.

v4: WARN_ON for paranoia in the init sequence, since the ggtt probe
and aliasing ppgtt setup are far apart.

v5: Style nits.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Michel Thierry <michel.thierry@intel.com>
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://mid.gmane.org/1444911781-32607-1-git-send-email-daniel.vetter@ffwll.ch
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agodrm/i915/skl: Enable pipe gamma for sprite planes.
Bob Paauwe [Thu, 27 Aug 2015 20:46:30 +0000 (13:46 -0700)]
drm/i915/skl: Enable pipe gamma for sprite planes.

Since SKL has universal planes, we should configure the sprite planes
and the primary plane the same.  For the primary plane we do enable
the pipe gamma on the plane so do the same for the non-primary planes.

Without this, the pipe CRC values will be different for something
displayed on the primary plane and something displayed on a sprite
plane when the ARGB8888 format is used.

Signed-off-by: Bob Paauwe <bob.j.paauwe@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agodrm/i915/skl+: Enable pipe CSC on cursor planes. (v2)
Bob Paauwe [Mon, 31 Aug 2015 21:03:30 +0000 (14:03 -0700)]
drm/i915/skl+: Enable pipe CSC on cursor planes. (v2)

Extend this to SKL and BXT as it's needed for these platforms as well.

v2: Change if condition to HAS_DDI() instead of listing each platform
Signed-off-by: Bob Paauwe <bob.j.paauwe@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agoMerge branch 'drm-tda998x-devel' of git://ftp.arm.linux.org.uk/~rmk/linux-arm into...
Dave Airlie [Thu, 15 Oct 2015 04:17:13 +0000 (14:17 +1000)]
Merge branch 'drm-tda998x-devel' of git://ftp.arm.linux.org.uk/~rmk/linux-arm into drm-next

* removes the now unused DRM slave encoder support, which all users have
  migrated away from, allowing us to simplify the code.
* ensure all pending interrupts are processed together, rather than
  needing the handler to be re-entered each time.
* use more HDMI helpers to setup the info frames.
* fix EDID read handling by ensuring that we always wait the specified time
  before attempting to read the EDID, no matter where the EDID read request
  came from.

* 'drm-tda998x-devel' of git://ftp.arm.linux.org.uk/~rmk/linux-arm:
  drm/i2c: tda998x: clean up after struct tda998x_priv2 removal
  drm/i2c: tda998x: kill struct tda998x_priv2
  drm/i2c: tda998x: move connector into struct tda998x_priv
  drm/i2c: tda998x: remove encoder pointer
  drm/i2c: tda998x: remove DRM slave encoder support
  drm/i2c: tda998x: use more HDMI helpers
  drm/i2c: tda998x: handle all outstanding interrupts
  drm/i2c: tda998x: convert to u8/u16/u32 types
  drm/i2c: tda998x: re-implement "Fix EDID read timeout on HDMI connect"
  drm/i2c: tda998x: report whether we actually handled the IRQ
  drm/i2c: tda998x: remove useless NULL checks

8 years agoMerge branch 'drm-armada-devel' of git://ftp.arm.linux.org.uk/~rmk/linux-arm into...
Dave Airlie [Thu, 15 Oct 2015 04:02:47 +0000 (14:02 +1000)]
Merge branch 'drm-armada-devel' of git://ftp.arm.linux.org.uk/~rmk/linux-arm into drm-next

* remove support for the non-component support from the Armada DRM driver,
  switching it to component-only mode.
* create a "armada plane" to allow the primary and overlay planes to share
  some code.
* increase efficiency by using inherently atomic operations, rather than
  spinlocking to achieve atomicity.  Eg, if we want to exchange a value,
  using xchg().
* increase PM savings by stopping the external pixel clock when we're in
  DPMS mode.

* 'drm-armada-devel' of git://ftp.arm.linux.org.uk/~rmk/linux-arm:
  drm/armada: move frame wait wakeup into plane work
  drm/armada: convert overlay plane vbl worker to a armada plane worker
  drm/armada: move CRTC flip work to primary plane work
  drm/armada: move frame wait into armada_frame
  drm/armada: move the locking for armada_drm_vbl_event_remove()
  drm/armada: move the update of dplane->ctrl0 out of spinlock
  drm/armada: move write to dma_ctrl0 to armada_drm_crtc_plane_disable()
  drm/armada: provide a common helper to disable a plane
  drm/armada: allocate primary plane ourselves
  drm/armada: add primary plane creation
  drm/armada: introduce generic armada_plane struct
  drm/armada: update armada overlay to use drm_universal_plane_init()
  drm/armada: use xchg() to atomically update dplane->old_fb
  drm/armada: factor out retirement of old fb
  drm/armada: rename overlay identifiers
  drm/armada: redo locking and atomics for armada_drm_crtc_complete_frame_work()
  drm/armada: disable CRTC clock during DPMS
  drm/armada: use drm_plane_force_disable() to disable the overlay plane
  drm/armada: move vbl code into armada_crtc
  drm/armada: remove non-component support

8 years agodrm/amdgpu: fix lockup when clean pending fences
Junwei Zhang [Tue, 13 Oct 2015 03:14:23 +0000 (11:14 +0800)]
drm/amdgpu: fix lockup when clean pending fences

The first lockup fence will lock the fence list of scheduler.
Then cancel the delayed workqueues for all clean pending fences
without waiting the workqueues to finish.

Change-Id: I9bec826de1aa49d587b0662f3fb4a95333979429
Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
8 years agodrm/amdgpu: add timer to fence to detect scheduler lockup
Junwei Zhang [Sat, 10 Oct 2015 00:48:42 +0000 (08:48 +0800)]
drm/amdgpu: add timer to fence to detect scheduler lockup

Change-Id: I67e987db0efdca28faa80b332b75571192130d33
Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
Reviewed-by: David Zhou <david1.zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
8 years agodrm/amdgpu: add VM CS mapping trace point
Christian König [Mon, 28 Sep 2015 10:00:23 +0000 (12:00 +0200)]
drm/amdgpu: add VM CS mapping trace point

Output all VM mappings a command submission uses.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: add option to clear VM page tables after every submit
Christian König [Thu, 10 Sep 2015 12:00:35 +0000 (14:00 +0200)]
drm/amdgpu: add option to clear VM page tables after every submit

This makes it much easier to find when userspace misses to send some buffers.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: add option to stop on VM fault
Christian König [Mon, 28 Sep 2015 10:31:26 +0000 (12:31 +0200)]
drm/amdgpu: add option to stop on VM fault

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: only print meaningful VM faults
Christian König [Thu, 10 Sep 2015 13:00:39 +0000 (15:00 +0200)]
drm/amdgpu: only print meaningful VM faults

Port of radeon commit 9b7d786b900baf7c0d1a7e211570aef1cb27590f.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: also trace already allocated VMIDs
Christian König [Mon, 28 Sep 2015 10:01:20 +0000 (12:01 +0200)]
drm/amdgpu: also trace already allocated VMIDs

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: Drop unnecessary #include <linux/vga_switcheroo.h>
Lukas Wunner [Mon, 12 Oct 2015 09:54:18 +0000 (11:54 +0200)]
drm/amdgpu: Drop unnecessary #include <linux/vga_switcheroo.h>

This was added to two radeon files even though they don't use any
vga_switcheroo symbols, the amdgpu fork inherited them:

Added to amdgpu_acpi.c by commit d7a2952f1ade ("drm/radeon: Add
support for the ATIF ACPI method to the radeon driver").

Added to amdgpu_bios.c by commit 6a9ee8af344e ("vga_switcheroo:
initial implementation (v15)").

Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/radeon: Drop unnecessary #include <linux/vga_switcheroo.h>
Lukas Wunner [Mon, 12 Oct 2015 09:15:17 +0000 (11:15 +0200)]
drm/radeon: Drop unnecessary #include <linux/vga_switcheroo.h>

This was added to three files even though they don't use any
vga_switcheroo symbols:

Added to radeon_acpi.c by commit d7a2952f1ade ("drm/radeon: Add
support for the ATIF ACPI method to the radeon driver").

Added to radeon_asic.c by commit 0a10c85129c2 ("drm/radeon: create
radeon_asic.c").

Added to radeon_bios.c by commit 6a9ee8af344e ("vga_switcheroo:
initial implementation (v15)").

Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: clean up pageflip interrupt handling
Alex Deucher [Fri, 9 Oct 2015 15:38:49 +0000 (11:38 -0400)]
drm/amdgpu: clean up pageflip interrupt handling

Check to make sure we aren't touching a non-existent
display controller and simplify the code.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: rework sdma structures
Alex Deucher [Thu, 8 Oct 2015 20:30:37 +0000 (16:30 -0400)]
drm/amdgpu: rework sdma structures

Rework the sdma structures in the driver to
consolidate all of the sdma info into a single
structure and allow for asics that may have
different numbers of sdma instances.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: unpin cursor BOs on suspend and pin them again on resume
Alex Deucher [Thu, 8 Oct 2015 04:03:36 +0000 (00:03 -0400)]
drm/amdgpu: unpin cursor BOs on suspend and pin them again on resume

Everything is evicted from VRAM before suspend, so we need to make
sure all BOs are unpinned and re-pinned after resume. Fixes broken
mouse cursor after resume introduced by commit b9729b17.

Port of radeon commit:
f3cbb17bcf676a2fc6aedebe9fbebd59e550c51a

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu/dce8: Fold set_cursor() into show_cursor()
Alex Deucher [Thu, 8 Oct 2015 03:46:49 +0000 (23:46 -0400)]
drm/amdgpu/dce8: Fold set_cursor() into show_cursor()

Port of radeon commit:
8991668ab4e26f985a8485719bce5d6d0623a644

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu/dce8: Clean up reference counting and pinning of the cursor BOs
Alex Deucher [Thu, 8 Oct 2015 15:31:58 +0000 (11:31 -0400)]
drm/amdgpu/dce8: Clean up reference counting and pinning of the cursor BOs

Take a GEM reference for and pin the new cursor BO, unpin and drop the
GEM reference for the old cursor BO in dce8 crtc_cursor_set2, and use
amdgpu_crtc->cursor_addr in dce8 set_cursor.

This fixes dce8 cursor_reset accidentally incrementing the cursor BO
pin count, and cleans up the code a little.

Port of radeon commit:
cd404af0c930104462aa91344f07d002cf8248ed

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu/dce8: Move hotspot handling out of set_cursor
Alex Deucher [Thu, 8 Oct 2015 03:38:03 +0000 (23:38 -0400)]
drm/amdgpu/dce8: Move hotspot handling out of set_cursor

It's only needed in dce8 crtc_cursor_set2.

Port of radeon commit:
2e007e611bc0a46dfed1547e0228a57f800e703d

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu/dce8: Re-show the cursor after a modeset (v2)
Alex Deucher [Thu, 8 Oct 2015 03:34:57 +0000 (23:34 -0400)]
drm/amdgpu/dce8: Re-show the cursor after a modeset (v2)

Setting a mode seems to clear the cursor registers, so we need to
re-program them to make sure the cursor is visible.

Port of radeon commit:
6d3759fac636028849f3bbec80c4b77e9bfdb1d2

v2: change radeon reference in error message

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu/dce8: Use cursor_set2 hook for enabling / disabling the HW cursor
Alex Deucher [Thu, 8 Oct 2015 03:26:15 +0000 (23:26 -0400)]
drm/amdgpu/dce8: Use cursor_set2 hook for enabling / disabling the HW cursor

The cursor_set2 hook provides the cursor hotspot position within the
cursor image. When the hotspot position changes, we can adjust the cursor
position such that the hotspot doesn't move on the screen. This prevents
the cursor from appearing to intermittently jump around on the screen
when the position of the hotspot within the cursor image changes.

Port of radeon commits:
78b1a6010b46a69bcd47b723a80f92693f26d17b
3feba08d79c32777a845c3c8a4ab93092bdf6f19

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu/dce11: Fold set_cursor() into show_cursor()
Alex Deucher [Thu, 8 Oct 2015 03:20:45 +0000 (23:20 -0400)]
drm/amdgpu/dce11: Fold set_cursor() into show_cursor()

Port of radeon commit:
8991668ab4e26f985a8485719bce5d6d0623a644

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu/dce11: Clean up reference counting and pinning of the cursor BOs
Alex Deucher [Thu, 8 Oct 2015 15:28:49 +0000 (11:28 -0400)]
drm/amdgpu/dce11: Clean up reference counting and pinning of the cursor BOs

Take a GEM reference for and pin the new cursor BO, unpin and drop the
GEM reference for the old cursor BO in dce11 crtc_cursor_set2, and use
amdgpu_crtc->cursor_addr in dce11 set_cursor.

This fixes dce11 cursor_reset accidentally incrementing the cursor BO
pin count, and cleans up the code a little.

Port of radeon commit:
cd404af0c930104462aa91344f07d002cf8248ed

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu/dce11: Move hotspot handling out of set_cursor
Alex Deucher [Wed, 7 Oct 2015 21:25:54 +0000 (17:25 -0400)]
drm/amdgpu/dce11: Move hotspot handling out of set_cursor

It's only needed in dce11 crtc_cursor_set2.

Port of radeon commit:
2e007e611bc0a46dfed1547e0228a57f800e703d

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu/dce11: Re-show the cursor after a modeset (v2)
Alex Deucher [Wed, 7 Oct 2015 21:22:23 +0000 (17:22 -0400)]
drm/amdgpu/dce11: Re-show the cursor after a modeset (v2)

Setting a mode seems to clear the cursor registers, so we need to
re-program them to make sure the cursor is visible.

Port of radeon commit:
6d3759fac636028849f3bbec80c4b77e9bfdb1d2

v2: change radeon reference in error output

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu/dce11: Use cursor_set2 hook for enabling / disabling the HW cursor
Alex Deucher [Wed, 7 Oct 2015 21:07:01 +0000 (17:07 -0400)]
drm/amdgpu/dce11: Use cursor_set2 hook for enabling / disabling the HW cursor

The cursor_set2 hook provides the cursor hotspot position within the
cursor image. When the hotspot position changes, we can adjust the cursor
position such that the hotspot doesn't move on the screen. This prevents
the cursor from appearing to intermittently jump around on the screen
when the position of the hotspot within the cursor image changes.

Port of radeon commits:
78b1a6010b46a69bcd47b723a80f92693f26d17b
3feba08d79c32777a845c3c8a4ab93092bdf6f19

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu/dce10: Fold set_cursor() into show_cursor()
Alex Deucher [Fri, 25 Sep 2015 13:51:59 +0000 (09:51 -0400)]
drm/amdgpu/dce10: Fold set_cursor() into show_cursor()

Port of radeon commit:
8991668ab4e26f985a8485719bce5d6d0623a644

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu/dce10: Clean up reference counting and pinning of the cursor BOs
Alex Deucher [Thu, 8 Oct 2015 15:25:38 +0000 (11:25 -0400)]
drm/amdgpu/dce10: Clean up reference counting and pinning of the cursor BOs

Take a GEM reference for and pin the new cursor BO, unpin and drop the
GEM reference for the old cursor BO in dce10 crtc_cursor_set2, and use
amdgpu_crtc->cursor_addr in dce10 set_cursor.

This fixes dce10 cursor_reset accidentally incrementing the cursor BO
pin count, and cleans up the code a little.

Port of radeon commit:
cd404af0c930104462aa91344f07d002cf8248ed

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu/dce10: Move hotspot handling out of set_cursor
Alex Deucher [Thu, 24 Sep 2015 21:46:19 +0000 (17:46 -0400)]
drm/amdgpu/dce10: Move hotspot handling out of set_cursor

It's only needed in dce10 crtc_cursor_set2.

Port of radeon commit:
2e007e611bc0a46dfed1547e0228a57f800e703d

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu/dce10: Re-show the cursor after a modeset (v2)
Alex Deucher [Thu, 24 Sep 2015 21:43:09 +0000 (17:43 -0400)]
drm/amdgpu/dce10: Re-show the cursor after a modeset (v2)

Setting a mode seems to clear the cursor registers, so we need to
re-program them to make sure the cursor is visible.

Port of radeon commit:
6d3759fac636028849f3bbec80c4b77e9bfdb1d2

v2: change radeon reference in error message

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu/dce10: Use cursor_set2 hook for enabling / disabling the HW cursor
Alex Deucher [Thu, 24 Sep 2015 21:29:44 +0000 (17:29 -0400)]
drm/amdgpu/dce10: Use cursor_set2 hook for enabling / disabling the HW cursor

The cursor_set2 hook provides the cursor hotspot position within the
cursor image. When the hotspot position changes, we can adjust the cursor
position such that the hotspot doesn't move on the screen. This prevents
the cursor from appearing to intermittently jump around on the screen
when the position of the hotspot within the cursor image changes.

Port of radeon commits:
78b1a6010b46a69bcd47b723a80f92693f26d17b
3feba08d79c32777a845c3c8a4ab93092bdf6f19

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu/atom: add support for new div32 opcodes (v3)
Alex Deucher [Fri, 2 Oct 2015 18:26:41 +0000 (14:26 -0400)]
drm/amdgpu/atom: add support for new div32 opcodes (v3)

Better precision than the regular div opcode.

v2: drop 64 bit divide
v3: fix op handling.  This actually is a 64 bit divide.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu/atom: add support for new mul32 opcodes (v2)
Alex Deucher [Fri, 2 Oct 2015 18:16:11 +0000 (14:16 -0400)]
drm/amdgpu/atom: add support for new mul32 opcodes (v2)

Better precision than the regular mul opcode.

v2: handle big endian properly.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu/atom: add support for process ds opcode
Alex Deucher [Fri, 2 Oct 2015 18:03:26 +0000 (14:03 -0400)]
drm/amdgpu/atom: add support for process ds opcode

Just skips a data section.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu/atom: implement debug opcode
Alex Deucher [Fri, 2 Oct 2015 17:53:33 +0000 (13:53 -0400)]
drm/amdgpu/atom: implement debug opcode

Basically a nop.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agoMerge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Linus Torvalds [Tue, 13 Oct 2015 16:45:21 +0000 (09:45 -0700)]
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux

Pull drm fixes from Dave Airlie:
 "I got a bit behind last week, so here is a delayed fixes pull:

   - a bunch of radeon/amd gpu fixes
   - some nouveau regression fixes (ppc bios reading and runtime pm fix)
   - one drm core oops fix
   - two qxl locking fixes
   - one qxl regression fix"

* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
  drm/nouveau/bios: fix OF loading
  drm/nouveau/fbcon: take runpm reference when userspace has an open fd
  drm/nouveau/nouveau: Disable AGP for SiS 761
  drm/nouveau/display: allow up to 16k width/height for fermi+
  drm/nouveau/bios: translate devinit pri/sec i2c bus to internal identifiers
  drm: Fix locking for sysfs dpms file
  drm/amdgpu: fix memory leak in amdgpu_vm_update_page_directory
  drm/amdgpu: fix 32-bit compiler warning
  drm/qxl: avoid dependency lock
  drm/qxl: avoid buffer reservation in qxl_crtc_page_flip
  drm/qxl: fix framebuffer dirty rectangle tracking.
  drm/amdgpu: flag iceland as experimental
  drm/amdgpu: check before checking pci bridge registers
  drm/amdgpu: fix num_crtc on CZ
  drm/amdgpu: restore the fbdev mode in lastclose
  drm/radeon: restore the fbdev mode in lastclose
  drm/radeon: add quirk for ASUS R7 370
  drm/amdgpu: add pm sysfs files late
  drm/radeon: add pm sysfs files late

8 years agoMAINTAINERS: add link to the Intel Graphics for Linux web site
Jani Nikula [Tue, 13 Oct 2015 08:16:48 +0000 (11:16 +0300)]
MAINTAINERS: add link to the Intel Graphics for Linux web site

There's plenty of drm/i915 related hardware and software documentation,
and firmware downloads for the latest platforms.

Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agodrm/i915: Move skl/bxt gt specific workarounds to ring init
Mika Kuoppala [Mon, 12 Oct 2015 10:20:59 +0000 (13:20 +0300)]
drm/i915: Move skl/bxt gt specific workarounds to ring init

Some registers are, naturally, lost in gpu reset/suspend cycle.
And some registers, for example in display domain, are not subject
to gpu reset so they retain their contents.

As hang recovery triggers a reset, recoverable gpu hang can currently
flush out essential workarounds and cause havoc later on.

When register GEN8_GARBNTL is missing the WaEnableGapsTsvCreditFix:skl,
it can cause random system hangs [1]. This workaround was added in:
commit 245d96670d26 ("drm/i915:skl: Add WaEnableGapsTsvCreditFix")
But another set of system hangs were observed and the failure pattern
indicated that there was random gpu hang preceding the system hang [2].
This lead to the realization that we lose this workaround and BDW_SCRATCH1
on reset.

Add these workarounds setup in display init to skl/bxt ring init
where LRI workarounds are also setup. This way their setup is not
dependent on display side init.

References: [1] https://bugs.freedesktop.org/show_bug.cgi?id=90854
References: [2] https://bugs.freedesktop.org/show_bug.cgi?id=92315
Reported-by: Tomi Sarvela <tomix.p.sarvela@intel.com>
Cc: Tomi Sarvela <tomix.p.sarvela@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Tested-by: Tomi Sarvela <tomix.p.sarvela@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agodrm/i915: Drop i915_gem_obj_is_pinned() from set-cache-level
Chris Wilson [Fri, 9 Oct 2015 13:11:27 +0000 (14:11 +0100)]
drm/i915: Drop i915_gem_obj_is_pinned() from set-cache-level

Since the remove of the pin-ioctl, we only care about not changing the
cache level on buffers pinned to the hardware as indicated by
obj->pin_display. By knowing that only objects pinned to the hardware
will have an elevated vma->pin_count, so we can coallesce many of the
linear walks over the obj->vma_list.

v2: Try and retrospectively add comments explaining the steps in
rebinding the active VMA.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agodrm/i915: revert a few more watermark commits
Paulo Zanoni [Fri, 9 Oct 2015 21:22:43 +0000 (18:22 -0300)]
drm/i915: revert a few more watermark commits

This is a squash of the following commits:

Revert "drm/i915: Drop intel_update_sprite_watermarks"
This reverts commit 47c99438b52d12df50e182583634a4cfede3c920.

Revert "drm/i915/ivb: Move WaCxSRDisabledForSpriteScaling w/a to atomic check"
This reverts commit 7809e5ae35b9d8d0710f0874b2e3f10be144e38b.

Revert "drm/i915/skl: Eliminate usage of pipe_wm_parameters from SKL-style WM (v3)"
This reverts commit 3a05f5e2e78eab7ffe816abb59b6769e331a1957.

With these reverts, SKL finally stops failing every single FBC test
with FIFO underrun error messages. After some brief testing, it also
seems that this commit prevents the machine from completely freezing
when we run igt/kms_fbc_crc (see fd.o #92355).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92355
Cc: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agodrm/i915: Remove dev_priv argument from NEEDS_FORCE_WAKE
Ville Syrjälä [Fri, 18 Sep 2015 17:03:46 +0000 (20:03 +0300)]
drm/i915: Remove dev_priv argument from NEEDS_FORCE_WAKE

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agodrm/i915: Clean up LVDS register handling
Ville Syrjälä [Fri, 18 Sep 2015 17:03:45 +0000 (20:03 +0300)]
drm/i915: Clean up LVDS register handling

Keep single 'lvds_reg' and 'lvds' variable around in
intel_lvds_init(), and read it just once at the start.

Also intel_lvds_get_config() doesn't need to figure out which reg to use
since it can just consult lvds_encoder->reg.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agodrm/i915: Throw out some useless variables
Ville Syrjälä [Tue, 22 Sep 2015 16:50:01 +0000 (19:50 +0300)]
drm/i915: Throw out some useless variables

Drop some useless 'reg' variables when we only use them once.

v2: A few more, including a few variable moves

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agodrm/i915: Parametrize and fix SWF registers
Ville Syrjälä [Fri, 18 Sep 2015 17:03:43 +0000 (20:03 +0300)]
drm/i915: Parametrize and fix SWF registers

Parametrize the SWF registers. This also fixes the register offsets,
which were mostly garbage in the old defines.

Also save/restore only as many SWF registers that each platform has.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agodrm/i915: s/PIPE_FRMCOUNT_GM45/PIPE_FRMCOUNT_G4X/ etc.
Ville Syrjälä [Fri, 18 Sep 2015 17:03:42 +0000 (20:03 +0300)]
drm/i915: s/PIPE_FRMCOUNT_GM45/PIPE_FRMCOUNT_G4X/ etc.

The PIPE_FRMCOUNT_GM45 and PIPE_FLIPCOUNT_GM45 names have bothered me
for a long time. The work equally well for ELK and onwards, so let's
s/GM45/G4X/.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agodrm/i915: Turn GEN5_ASSERT_IIR_IS_ZERO() into a function
Ville Syrjälä [Fri, 18 Sep 2015 17:03:41 +0000 (20:03 +0300)]
drm/i915: Turn GEN5_ASSERT_IIR_IS_ZERO() into a function

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agodrm/i915: Fix a few bad hex numbers in register defines
Ville Syrjälä [Fri, 18 Sep 2015 17:03:40 +0000 (20:03 +0300)]
drm/i915: Fix a few bad hex numbers in register defines

A few register mask defines were missing the '0x' from hex numbers. Or
at least I assume those were meant to be hex numbers. Put the '0x' in
place.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agodrm/i915: Protect register macro arguments
Ville Syrjälä [Fri, 18 Sep 2015 17:03:39 +0000 (20:03 +0300)]
drm/i915: Protect register macro arguments

Always put parens around macro argument evaluations.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agodrm/i915: Include gpio_mmio_base in GMBUS reg defines
Ville Syrjälä [Fri, 18 Sep 2015 17:03:38 +0000 (20:03 +0300)]
drm/i915: Include gpio_mmio_base in GMBUS reg defines

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agodrm/i915: Parametrize HSW video DIP data registers
Ville Syrjälä [Fri, 18 Sep 2015 17:03:37 +0000 (20:03 +0300)]
drm/i915: Parametrize HSW video DIP data registers

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agodrm/i915: Eliminate weird parameter inversion from BXT PPS registers
Ville Syrjälä [Mon, 12 Oct 2015 16:41:08 +0000 (19:41 +0300)]
drm/i915: Eliminate weird parameter inversion from BXT PPS registers

v2: Keep using the same registers (PCH_*) instead of accidentally
    starting to use the other ones (BXT_*)2) (Jesse)

Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agodrm/i915: Hold dev->event_lock whilst inspecting intel_crtc->unpin_work
Chris Wilson [Sat, 10 Oct 2015 09:44:32 +0000 (10:44 +0100)]
drm/i915: Hold dev->event_lock whilst inspecting intel_crtc->unpin_work

We should serialise access to the intel_crtc->unpin_work through the
dev->event_lock spinlock. It should not be possible for it to disappear
without severe error as the mmio_flip worker has not tagged the
unpin_work pending flip-completion. Similarly if the error exists, just
taking the unpin_work whilst holding the spinlock and then using it
unserialised just masks the race. (It is supposed to be valid as the
unpin_work exists until the flip completion interrupt which should not
fire until we flush the mmio writes to update the display base which is
the last time we access the unpin_work from the kthread.)

References: https://bugs.freedesktop.org/show_bug.cgi?id=92335
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agoi915: switch from acpi_os_ioremap to memremap
Williams, Dan J [Mon, 12 Oct 2015 21:12:57 +0000 (21:12 +0000)]
i915: switch from acpi_os_ioremap to memremap

i915 expects the OpRegion to be cached (i.e. not __iomem), so explicitly
map it with memremap rather than the implied cache setting of
acpi_os_ioremap().

Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Cc: David Airlie <airlied@linux.ie>
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agodrm/i915: Drop unnecessary #include <linux/vga_switcheroo.h>
Lukas Wunner [Mon, 12 Oct 2015 08:57:43 +0000 (10:57 +0200)]
drm/i915: Drop unnecessary #include <linux/vga_switcheroo.h>

Commit 599bbb9de0fe ("drm/i915: i915 cannot provide switcher services.")
removed all remaining vga_switcheroo symbols from intel_acpi.c but left
the include. Drop it.

Signed-off-by: Lukas Wunner <lukas@wunner.de>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agoMerge branch 'linux-4.3' of git://anongit.freedesktop.org/git/nouveau/linux-2.6 into...
Dave Airlie [Mon, 12 Oct 2015 03:59:04 +0000 (13:59 +1000)]
Merge branch 'linux-4.3' of git://anongit.freedesktop.org/git/nouveau/linux-2.6 into drm-fixes

Nothing too crazy here, a couple of regression fixes + runpm/fbcon
race fix.

* 'linux-4.3' of git://anongit.freedesktop.org/git/nouveau/linux-2.6:
  drm/nouveau/bios: fix OF loading
  drm/nouveau/fbcon: take runpm reference when userspace has an open fd
  drm/nouveau/nouveau: Disable AGP for SiS 761
  drm/nouveau/display: allow up to 16k width/height for fermi+
  drm/nouveau/bios: translate devinit pri/sec i2c bus to internal identifiers

8 years agodrm/nouveau/bios: fix OF loading
Ilia Mirkin [Fri, 2 Oct 2015 03:41:21 +0000 (23:41 -0400)]
drm/nouveau/bios: fix OF loading

Currently OF bios load fails for a few reasons:
 - checksum failure
 - bios size too small
 - no PCIR header
 - bios length not a multiple of 4

In this change, we resolve all of the above by ignoring any checksum
failures (since OF VBIOS tends not to have a checksum), and faking the
PCIR data when loading from OF.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
8 years agodrm/nouveau/fbcon: take runpm reference when userspace has an open fd
Ben Skeggs [Fri, 2 Oct 2015 04:03:19 +0000 (14:03 +1000)]
drm/nouveau/fbcon: take runpm reference when userspace has an open fd

We need to do this in order to prevent accesses to the device while it's
powered down.  Userspace may have an mmap of the fb, and there's no good
way (that I know of) to prevent it from touching the device otherwise.

This fixes some nasty races between runpm and plymouth on some systems,
which result in the GPU getting very upset and hanging the boot.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Cc: stable@vger.kernel.org
8 years agodrm/nouveau/nouveau: Disable AGP for SiS 761
Ondrej Zary [Mon, 14 Sep 2015 19:19:57 +0000 (21:19 +0200)]
drm/nouveau/nouveau: Disable AGP for SiS 761

SiS 761 chipset does not support AGP cards but has AGP capability (for
the onboard video). At least PC Chips A31G board using this chipset has
an AGP-like AGPro slot that's wired to the PCI bus. Enabling AGP will
fail (GPU lockup and software fbcon, X11 hangs).

Add support for matching just the host bridge in nvkm_device_agp_quirks
and add entry for SiS 761 with mode 0 (AGP disabled).

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
8 years agodrm/nouveau/display: allow up to 16k width/height for fermi+
Ilia Mirkin [Fri, 18 Sep 2015 02:31:20 +0000 (22:31 -0400)]
drm/nouveau/display: allow up to 16k width/height for fermi+

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
8 years agodrm/nouveau/bios: translate devinit pri/sec i2c bus to internal identifiers
Ben Skeggs [Tue, 29 Sep 2015 02:08:35 +0000 (12:08 +1000)]
drm/nouveau/bios: translate devinit pri/sec i2c bus to internal identifiers

fdo#92013.

Regression from "i2c: transition pad/ports away from being based on nvkm_object"

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
8 years agoLinux 4.3-rc5 v4.3-rc5
Linus Torvalds [Sun, 11 Oct 2015 18:09:45 +0000 (11:09 -0700)]
Linux 4.3-rc5

8 years agoMerge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 11 Oct 2015 17:24:32 +0000 (10:24 -0700)]
Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull scheduler fix from Thomas Gleixner:
 "Fix a long standing state race in finish_task_switch()"

* 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  sched/core: Fix TASK_DEAD race in finish_task_switch()

8 years agoMerge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 11 Oct 2015 17:23:52 +0000 (10:23 -0700)]
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull perf fix from Thomas Glexiner:
 "Fix build breakage on powerpc in perf tools"

* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  perf tools: Fix build break on powerpc due to sample_reg_masks

8 years agoMerge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 11 Oct 2015 17:23:00 +0000 (10:23 -0700)]
Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull maintainer email update from Thomas Gleixner:
 "Change Matt Fleming's email address in the maintainers file"

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  MAINTAINERS: Change Matt Fleming's email address

8 years agoMerge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 11 Oct 2015 17:16:59 +0000 (10:16 -0700)]
Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull irq fixes from Thomas Gleixner:
 "Three trivial commits:

   - Fix a kerneldoc regression

   - Export handle_bad_irq to unbreak a driver in next

   - Add an accessor for the of_node field so refactoring in next does
     not depend on merge ordering"

* 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  irqdomain: Add an accessor for the of_node field
  genirq: Fix handle_bad_irq kerneldoc comment
  genirq: Export handle_bad_irq

8 years agoMerge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Linus Torvalds [Sun, 11 Oct 2015 17:02:30 +0000 (10:02 -0700)]
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi

Pull SCSI fixes from James Bottomley:
 "This is a set of three bug fixes, two of which are regressions from
  recent updates (the 3ware one from 4.1 and the device handler fixes
  from 4.2)"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
  3w-9xxx: don't unmap bounce buffered commands
  scsi_dh: Use the correct module name when loading device handler
  libiscsi: Fix iscsi_check_transport_timeouts possible infinite loop

8 years agoMerge tag 'md/4.3-rc4-fix' of git://neil.brown.name/md
Linus Torvalds [Sun, 11 Oct 2015 16:35:51 +0000 (09:35 -0700)]
Merge tag 'md/4.3-rc4-fix' of git://neil.brown.name/md

Pull md bugfix from Neil Brown:
 "One bug fix for raid1/raid10.

  Very careless bug earler in 4.3-rc, now fixed :-)"

* tag 'md/4.3-rc4-fix' of git://neil.brown.name/md:
  crash in md-raid1 and md-raid10 due to incorrect list manipulation