Commit graph

30596 commits

Author SHA1 Message Date
Chris Wilson
077675c1e8 drm: Convert prime dma-buf <-> handle to rbtree
Currently we use a linear walk to lookup a handle and return a dma-buf,
and vice versa. A long overdue TODO task is to convert that to a
hashtable. Since the initial implementation of dma-buf/prime, we now
have resizeable hashtables we can use (and now a future task is to RCU
enable the lookup!). However, this patch opts to use an rbtree instead
to provide O(lgN) lookups (and insertion, deletion). rbtrees were chosen
over using the RCU backed resizable hashtable to firstly avoid the
reallocations (rbtrees can be embedded entirely within the parent
struct) and to favour simpler code with predictable worst case
behaviour. In simple testing, the difference between using the constant
lookup and insertion of the rhashtable and the rbtree was less than 10%
of the wall time (igt/benchmarks/prime_lookup) - both are dramatic
improvements over the existing linear lists.

v2: Favour rbtree over rhashtable

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94631
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Sean Paul <seanpaul@chromium.org>
Cc: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20160926204414.23222-1-chris@chris-wilson.co.uk
2016-10-04 08:23:07 +02:00
Baoyou Xie
188af070d4 drm/mediatek: mark symbols static where possible
We get 4 warnings when building kernel with W=1:
drivers/gpu/drm/mediatek/mtk_hdmi.c:1089:6: warning: no previous prototype for 'mtk_hdmi_audio_enable' [-Wmissing-prototypes]
drivers/gpu/drm/mediatek/mtk_hdmi.c:1095:6: warning: no previous prototype for 'mtk_hdmi_audio_disable' [-Wmissing-prototypes]
drivers/gpu/drm/mediatek/mtk_hdmi.c:1101:5: warning: no previous prototype for 'mtk_hdmi_audio_set_param' [-Wmissing-prototypes]
drivers/gpu/drm/mediatek/mtk_hdmi.c:1627:5: warning: no previous prototype for 'mtk_hdmi_audio_digital_mute' [-Wmissing-prototypes]

In fact, both functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks both functions with 'static'.

Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
[seanpaul fixed checkpatch warning for argument alignment]
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1474789109-22010-2-git-send-email-baoyou.xie@linaro.org
2016-10-04 08:23:01 +02:00
Baoyou Xie
6239817702 drm/rockchip: mark symbols static where possible
We get 2 warnings when building kernel with W=1:
drivers/gpu/drm/rockchip/rockchip_drm_drv.c:309:6: warning: no previous prototype for 'rockchip_drm_fb_suspend' [-Wmissing-prototypes]
drivers/gpu/drm/rockchip/rockchip_drm_drv.c:318:6: warning: no previous prototype for 'rockchip_drm_fb_resume' [-Wmissing-prototypes]

In fact, these functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1474789388-3284-1-git-send-email-baoyou.xie@linaro.org
2016-10-04 08:23:01 +02:00
Baoyou Xie
813cfc89f8 drm/rockchip: add missing header dependencies
We get 2 warnings when building kernel with W=1:
drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c:130:5: warning: no previous prototype for 'rockchip_drm_fbdev_init' [-Wmissing-prototypes]
drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c:173:6: warning: no previous prototype for 'rockchip_drm_fbdev_fini' [-Wmissing-prototypes]

In fact, these functions are declared
in drivers/gpu/drm/rockchip/rockchip_drm_fbdev.h,
so this patch adds missing header dependencies.

Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1474789109-22010-1-git-send-email-baoyou.xie@linaro.org
2016-10-04 08:23:00 +02:00
Laszlo Ersek
c2cbc38b97 drm: virtio: reinstate drm_virtio_set_busid()
Before commit a325725633 ("drm: Lobotomize set_busid nonsense for !pci
drivers"), several DRM drivers for platform devices used to expose an
explicit "drm_driver.set_busid" callback, invariably backed by
drm_platform_set_busid().

Commit a325725633 removed drm_platform_set_busid(), along with the
referring .set_busid field initializations. This was justified because
interchangeable functionality had been implemented in drm_dev_alloc() /
drm_dev_init(), which DRM_IOCTL_SET_VERSION would rely on going forward.

However, commit a325725633 also removed drm_virtio_set_busid(), for
which the same consolidation was not appropriate: this .set_busid callback
had been implemented with drm_pci_set_busid(), and not
drm_platform_set_busid(). The error regressed Xorg/xserver on QEMU's
"virtio-vga" card; the drmGetBusid() function from libdrm would no longer
return stable PCI identifiers like "pci:0000:00:02.0", but rather unstable
platform ones like "virtio0".

Reinstate drm_virtio_set_busid() with judicious use of

  git checkout -p a325725633c2^ -- drivers/gpu/drm/virtio

Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Emil Velikov <emil.l.velikov@gmail.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Joachim Frieben <jfrieben@hotmail.com>
Cc: stable@vger.kernel.org # v4.8
Reported-by: Joachim Frieben <jfrieben@hotmail.com>
Fixes: a325725633
Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1366842
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-10-04 13:10:30 +10:00
Daniel Vetter
2adb29b18e drm: Undo damage to page_flip_ioctl
I screwed up rebasing of my patch in

commit 43968d7b80
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Wed Sep 21 10:59:24 2016 +0200

    drm: Extract drm_plane.[hc]

which meant on error paths drm_crtc_vblank_put could be called without
a get, leading to an underrun of the refcount.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98020
Reported-and-tested-by: Andy Furniss <adf.lists@gmail.com>
Cc: Sean Paul <seanpaul@chromium.org>
Cc: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20161003082827.11586-1-daniel.vetter@ffwll.ch
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-10-04 12:53:12 +10:00
Chris Wilson
e86fa21b77 drm: Restore lost drm_framebuffer_unreference in drm_mode_page_flip_ioctl
Commit 43968d7b80 ("drm: Extract drm_plane.[hc]") was not the simple
cut'n'paste we presumed, somehow it introduced a leak of the page flip
target's framebuffer.

Fixes: 43968d7b80 ("drm: Extract drm_plane.[hc]")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20160928222500.11827-1-chris@chris-wilson.co.uk
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-10-04 12:52:58 +10:00
Tobias Jakobi
c046279646 drm/exynos: g2d: simplify g2d_free_runqueue_node()
The function is never called with zero 'runqueue_node'.

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-10-01 00:39:42 +09:00
Tobias Jakobi
7c3fc2b5cc drm/exynos: g2d: use autosuspend mode for PM runtime
The runqueue worker currently issues a get() when a new
node is processed, and a put() once a node is completed.

The corresponding suspend and resume calls currently only
do clock gating, but with the upcoming introduction of
IOMMU runpm also the corresponding IOMMU domain gets
enabled (for get()) and disabled (for put()). This
introduces performance regressions with we mitigate here.

Switch PM runtime to autosuspend, such that clock gating
and IOMMU control only happens when the engine is idle for
a 'long' time.

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-10-01 00:39:41 +09:00
Tobias Jakobi
134a0fe984 drm/exynos: g2d: wait for engine to finish
While the engine works on a runqueue node it does memory access to
the buffers associated with that node.
Make sure that the engine is idle when g2d_close() and/or
g2d_remove() are called, i.e. buffer associated with the process (for
g2d_close()), or all buffers (for g2d_remove()) can be safely be
unmapped.

We have to take into account that the engine might be in an undefined
state, i.e. it hangs and doesn't become idle. In this case, we issue
a hardware reset to return the hardware and the driver context into a
proper state.

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-10-01 00:39:40 +09:00
Tobias Jakobi
5332737432 drm/exynos: g2d: remove runqueue nodes in g2d_{close,remove}()
The driver might be closed (and/or removed) while there are still
nodes queued for processing.
Make sure to remove these nodes, which means all of them in
the case of g2d_remove() and only those belonging to the
corresponding process in g2d_close().

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-10-01 00:39:39 +09:00
Tobias Jakobi
22d6704dd4 drm/exynos: g2d: move PM management to runqueue worker
Do all pm_runtime_{get,put}() calls in the runqueue worker.
Also keep track of the engine's idle/busy state.

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-10-01 00:39:39 +09:00
Tobias Jakobi
05e2e4666c Revert "drm/exynos: g2d: fix system and runtime pm integration"
This reverts commit b05984e21a.

The change, i.e. merging the sleep and runpm operations, produces
a deadlock situation:
(1) exynos_g2d_exec_ioctl() prepares a runqueue node and
    calls g2d_exec_runqueue()
(2) g2d_exec_runqueue() calls g2d_dma_start() which gets
    runtime PM sync
(3) runtime PM core calls g2d_runtime_resume()
(4) g2d_runtime_resume() calls g2d_exec_runqueue(), which
    loops back to (2)

Due to mutexes that are in place, a deadlock situation is created.

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-10-01 00:39:38 +09:00
Andrzej Hajda
9276dff7a8 drm/exynos: use drm core to handle page-flip event
Exynos DRM framework handled page-flip event with custom code.
The patch replaces it with drm-core vblank queue.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-10-01 00:39:37 +09:00
Baoyou Xie
d42c09628a drm/exynos: mark exynos_dp_crtc_clock_enable() static
We get 1 warning when building kernel with W=1:
drivers/gpu/drm/exynos/exynos_dp.c:46:5: warning: no previous prototype for 'exynos_dp_crtc_clock_enable' [-Wmissing-prototypes]

In fact, this function is only used in the file in which it is
declared and don't need a declaration, but can be made static.
So this patch marks it 'static'.

Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-10-01 00:39:37 +09:00
Andrzej Hajda
c96fdfdeca drm/exynos/fimd: add clock rate checking
In case of some platforms fimd clocks can be configured to
very low values, as a result refresh rate can be very low and
driver/drm-core will timeout waiting for vblanks, it will result
in premature removal of framebuffers and will cause oopses.
The patch adds atomic_check callback to fimd to prevent setting
such modes.

Reported-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-10-01 00:39:36 +09:00
Andrzej Hajda
14e022f304 drm/exynos: fix pending update handling
Exynos DRM devices update their registers at vblank time. Exynos-DRM uses
custom mechanism to wait for vblank. This mechanism is error prone -
variables are not updated atomically. As a result in certain circumstances
user space can try to free buffers which are still in use by hardware,
in such cases IOMMU can throw OOPS.
The patch instead of fixing the mechanism replaces it with drm core helper.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-10-01 00:39:35 +09:00
Andrzej Hajda
8574e927b4 drm/exynos/vidi: use timer for vblanks instead of sleeping worker
VIDI driver uses fake vblank handler to generate vblank events.
It was implemented using worker which slept for vblank time, additionally
it did not work if there were no page flips. The patch replaces it with
timer, uses drm_crtc_vblank_(on|off) helpers to manage it and fixes
behavior for non-page-flip cases.
This change allows further improvements of vblank in exynos-drm framework.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-10-01 00:39:35 +09:00
Tobias Jakobi
61865b5d4d drm/exynos: g2d: beautify probing message
Apply some 'make-up' in g2d_probe().

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-10-01 00:39:34 +09:00
Tobias Jakobi
a696394c52 drm/exynos: mixer: simplify loop in vp_win_reset()
A simple while loop should do the same here.

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-10-01 00:39:33 +09:00
Tobias Jakobi
adeb6f4485 drm/exynos: mixer: convert booleans to flags in mixer context
The mixer context struct already has a 'flags' field, so
we can use it to store the 'interlace', 'vp_enabled' and
'has_sclk' booleans.
We use the non-atomic helper functions to access these bits.

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-10-01 00:39:33 +09:00
Milo Kim
c0d656dd2d gpu: drm: exynos_hdmi: Remove duplicate initialization of regulator bulk consumer
The helper, devm_regulator_bulk_get() initializes the consumer as NULL,
so this code can be ignored.

Signed-off-by: Milo Kim <woogyom.kim@gmail.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-10-01 00:39:32 +09:00
Milo Kim
b5413022fd gpu: drm: exynos_hdmi: Move PHY logic into single function
Paring DT properties and getting PHY IO (memory mapped or I2C) in one
function.

Signed-off-by: Milo Kim <woogyom.kim@gmail.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-10-01 00:39:31 +09:00
Milo Kim
1caa360ed9 gpu: drm: exynos_hdmi: Move DDC logic into single function
Paring DT properties and getting the I2C adapter in one function.

Signed-off-by: Milo Kim <woogyom.kim@gmail.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-10-01 00:39:31 +09:00
Dave Airlie
28a396545a Merge branch 'drm-next-4.9' of git://people.freedesktop.org/~agd5f/linux into drm-next
Some additional fixes for 4.9:
- The rest of Christian's GTT rework which fixes a long standing bug
  in the GPUVM code among other things
- Changes to the pci shutdown callbacks for certain hypervisors
- Fix hpd interrupt storms on eDP panels which have the hpd interrupt
  enabled by the bios
- misc cleanups and bug fixes

* 'drm-next-4.9' of git://people.freedesktop.org/~agd5f/linux: (33 commits)
  drm/radeon: always apply pci shutdown callbacks
  drm/amdgpu: always apply pci shutdown callbacks (v2)
  drm/amdgpu: improve VM PTE trace points
  drm/amdgpu: fix GART_DEBUGFS define
  drm/amdgpu: free userptrs even if GTT isn't bound
  drm/amd/amdgpu: Various cleanups for DCEv6
  drm/amdgpu: fix BO move offsets
  drm/amdgpu: fix amdgpu_move_blit on 32bit systems
  drm/amdgpu: fix gtt_mgr bo's offset
  drm/amdgpu: fix initializing the VM BO shadow
  drm/amdgpu: fix initializing the VM last eviction counter
  drm/amdgpu: cleanup VM shadow BO unreferencing
  drm/amdgpu: allocate GTT space for shadow VM page tables
  drm/amdgpu: rename all rbo variable to abo v2
  drm/amdgpu: remove unused member from struct amdgpu_bo
  drm/amdgpu: add a custom GTT memory manager v2
  drm/amdgpu/dce6: disable hpd on local panels
  drm/amdgpu/dce8: disable hpd on local panels
  drm/amdgpu/dce11: disable hpd on local panels
  drm/amdgpu/dce10: disable hpd on local panels
  ...
2016-09-30 13:21:02 +10:00
Dave Airlie
b2d7e08903 drm/tegra: Changes for v4.9-rc1
One bugfix that avoids overwriting the Y plane base address when
 displaying buffers with one of the YUV/YVU formats.
 -----BEGIN PGP SIGNATURE-----
 
 iQIwBAABCAAaBQJX7T5nExx0cmVkaW5nQG52aWRpYS5jb20ACgkQ3SOs138+s6Hi
 Mg//R8TGYK3G5r7iNdF6DkugJFbJI5pzvp3mQ1Xy9FIzkFk0v0BdDT4izGF5MXB+
 cb02vKva71bF71tUxkCeH1GZmACNxgFSCwjN6npYXDtbdQRhjt5J2vKCNYHZJ7BY
 wcrtZAFBPaJEvN7DlP5iO7tT2jCo9vsivIRnzOiiEV16S6nAfn2YR2Z0Pub21VKz
 BIhL9D8N3GqfAxbgPqVGxRFMwyFuxmIj4NviOX+KbwomhZUv/Q+ToY4SB5Kp5kEm
 IWm7fyaRpbKB8lPhZu/bwf5am60G9ZAykr/g0AjCfUSosxax8OJJHV1FWOgewewf
 SUs0/87+nvKuIyWHQLJ/iZWVS8J+HVdVJP+CVOcgkMa6vDbgiMwaTLfbHv4exAlT
 iqVLskZ5Ce76MPLg63PxsZU07IBMbXsv7AtG1q48dtUzPXKPywzymXBTNHDsvaG1
 F0M3Bmejpd++i5Yis8DRuDRyKgkIrBjVdEGcYKhfV+Jsn3RrKoJ/G0AVfJKvkDrH
 gQ0CgdHzSCtdaCLYE8PEZRJ18ZAdGhHkheNbbDRVoYD0DfhxhMZjDPZMYWed5vAF
 wYir6S64G2EF+tg7p3Njmrbb+5LDeBPAd0dBS4GoC4rjaMO9hPGdpEiWGB+7GlhP
 M8rpgtPGo65lS1fIydLJnMP1b5H0lYPMiviyoKZl8h40PJ4=
 =sjge
 -----END PGP SIGNATURE-----

Merge tag 'drm/tegra/for-4.9-rc1' of git://anongit.freedesktop.org/tegra/linux into drm-next

drm/tegra: Changes for v4.9-rc1

One bugfix that avoids overwriting the Y plane base address when
displaying buffers with one of the YUV/YVU formats.

* tag 'drm/tegra/for-4.9-rc1' of git://anongit.freedesktop.org/tegra/linux:
  drm/tegra: Fix window[0] base address corruption
2016-09-30 13:00:36 +10:00
Dave Airlie
011a9b9d50 drm/panel: Changes for v4.9-rc1
Adds support for one more panel to the simple-panel driver, fixes up a
 couple of delays and flags for existing panels and finally adds a new
 driver for the DSI panel found on Nexus 7 devices.
 -----BEGIN PGP SIGNATURE-----
 
 iQIwBAABCAAaBQJX7TIgExx0cmVkaW5nQG52aWRpYS5jb20ACgkQ3SOs138+s6Eh
 MQ/+N5NE2/fFnS32/v+Qp+FQdf9aJVOMgkVmroVd2q1psK11omd0Pgqg3HdyQupe
 GVkL8BV3WtmcD3aKjGNdlNBl/lsbFOVYfakzap7ig4Qly2ADqrQeKCZn3esTH25G
 9CMlkaOw/xfja47ajVAEeinoAktY5yt8nP0oay73A0Vl+0WQ5sZDr7XeZfWA72bY
 uKTFoue7tBoh12iWgMFX8N4LLR5U5qzV0CEhEXBJ4xrkYKFTVrgTotY3bdlef5AJ
 tPjfMWBLrdbDt1YnuSQuNGwbx/Mzc/hrvddQiQC2UBk3g2Tq0BCHpZma4eNiDHhv
 So1fefjC/0mkde27/ZfR9qE2Zee9wY8PN8bchP3uCRhyzFTcjZhdcRAR/NNp9+yX
 4Wl/lOWX2UiPWHLOm9RO5W6y+kEvCa0E/0IsM9LRnfDw7VTn8ZY0052BGayfz6Z4
 alM94TP4WLFulRbKgisJe+Wlbvjn7MEwTfpLm74Ras5LHWvVf+FSuDEO3c5sKrTQ
 LqJh8aj+fjUUSIV3DfFUbrlVBjQSbveNAd7di9Q2LCZeUU+Iv3HXJcn9x2B3c/7H
 q49v4Kf62NEy89P8g/oKKL1AdZ+MTFPrVbEJyAb++m/7IWlLlQbGBP6vMo/OwYD6
 G6CFKqM3vdw0diiRjVs6FpRAsqfpPB7Pn9OduEG+MOACtJ4=
 =k9a0
 -----END PGP SIGNATURE-----

Merge tag 'drm/panel/for-4.9-rc1' of git://anongit.freedesktop.org/tegra/linux into drm-next

drm/panel: Changes for v4.9-rc1

Adds support for one more panel to the simple-panel driver, fixes up a
couple of delays and flags for existing panels and finally adds a new
driver for the DSI panel found on Nexus 7 devices.

* tag 'drm/panel/for-4.9-rc1' of git://anongit.freedesktop.org/tegra/linux:
  drm/panel: Add JDI LT070ME05000 WUXGA DSI Panel
  dt-bindings: Add JDI LT070ME05000 panel bindings
  drm/panel: simple: Fix bus_format for the Olimex LCD-OLinuXino-4.3TS
  drm/panel: simple-panel: Add delay timings for Starry KR122EA0SRA
  drm/panel: simple: Fix bus flags for Ortustech com43h4m85ulc
  drm/panel: simple: Add Innolux G101ICE-L01 panel
  drm/panel: simple: Add delay timing for Sharp LQ123P1JX31
  drm/dsi: Implement DCS set/get display brightness
  drm/dsi: Order DCS helpers by command code
2016-09-30 12:56:31 +10:00
Alex Deucher
a481daa88f drm/radeon: always apply pci shutdown callbacks
We can't properly detect all hypervisors and we
need this to properly tear down the hardware.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-28 16:16:27 -04:00
Alex Deucher
00ea8cba5e drm/amdgpu: always apply pci shutdown callbacks (v2)
We can't properly detect all hypervisors and we
need this to properly tear down the hardware.

v2: trivial warning fix

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-28 16:16:27 -04:00
Christian König
ec2f05f034 drm/amdgpu: improve VM PTE trace points
Use a separate one for the copy operation and
log all the interesting parameters.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-28 16:16:26 -04:00
Christian König
186294f9c5 drm/amdgpu: fix GART_DEBUGFS define
Obviously missed during the rename.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-28 16:16:26 -04:00
Christian König
85a4b5798f drm/amdgpu: free userptrs even if GTT isn't bound
This fixes a memory leak since binding GTT only on demand.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-28 16:16:25 -04:00
Tom St Denis
3d5f4d4770 drm/amd/amdgpu: Various cleanups for DCEv6
Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-28 16:16:25 -04:00
Christian König
ad78069c33 drm/amdgpu: fix BO move offsets
It's pretty pointless to get the offset first and then initialize it.

Should fix issues with the new GTT manager.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-28 16:16:24 -04:00
Christian König
98b480dba9 drm/amdgpu: fix amdgpu_move_blit on 32bit systems
This bug seems to be present for a very long time.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2016-09-28 16:16:23 -04:00
Flora Cui
8159730394 drm/amdgpu: fix gtt_mgr bo's offset
Signed-off-by: Flora Cui <Flora.Cui@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-28 16:16:23 -04:00
Christian König
2befa60e4c drm/amdgpu: fix initializing the VM BO shadow
We need to clear the shadows as well.

Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-28 16:16:22 -04:00
Christian König
2a82ec21b9 drm/amdgpu: fix initializing the VM last eviction counter
Close a very small window where something can go wrong.

Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-28 16:16:22 -04:00
Christian König
2698f6206f drm/amdgpu: cleanup VM shadow BO unreferencing
Unreference the shadow BOs in the error path as well and drop the NULL checks.

Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-28 16:16:21 -04:00
Christian König
0fc8683e56 drm/amdgpu: allocate GTT space for shadow VM page tables
We need to access those with the system domain.

Fixes fallout from only allocating GTT space on demand.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-28 16:16:21 -04:00
Christian König
765e7fbf08 drm/amdgpu: rename all rbo variable to abo v2
Just to cleanup some radeon leftovers.

sed -i "s/rbo/abo/g" drivers/gpu/drm/amd/amdgpu/*.c
sed -i "s/rbo/abo/g" drivers/gpu/drm/amd/amdgpu/*.h

v2: rebased

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-28 16:16:20 -04:00
Christian König
1927ffc0c1 drm/amdgpu: remove unused member from struct amdgpu_bo
Not used in a while.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-28 16:16:20 -04:00
Christian König
bb990bb092 drm/amdgpu: add a custom GTT memory manager v2
Only allocate address space when we really need it.

v2: fix a typo, add correct function description,
    stop leaking the node in the error case.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-28 16:16:19 -04:00
Alex Deucher
2744b647f4 drm/amdgpu/dce6: disable hpd on local panels
Otherwise we can get a hotplug interrupt storm when
we turn the panel off if hpd interrupts were enabled
by the bios.

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

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-28 16:13:19 -04:00
Alex Deucher
324082586c drm/amdgpu/dce8: disable hpd on local panels
Otherwise we can get a hotplug interrupt storm when
we turn the panel off if hpd interrupts were enabled
by the bios.

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

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2016-09-28 16:13:18 -04:00
Alex Deucher
3a9d993ee9 drm/amdgpu/dce11: disable hpd on local panels
Otherwise we can get a hotplug interrupt storm when
we turn the panel off if hpd interrupts were enabled
by the bios.

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

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2016-09-28 16:13:18 -04:00
Alex Deucher
e96ec90f49 drm/amdgpu/dce10: disable hpd on local panels
Otherwise we can get a hotplug interrupt storm when
we turn the panel off if hpd interrupts were enabled
by the bios.

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

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2016-09-28 16:13:17 -04:00
Alex Deucher
bdbdb571c8 drm/amdgpu/si/dpm: fix phase shedding setup
Used the wrong index to setup the phase shedding mask.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-28 16:13:17 -04:00
Alex Deucher
427920292b drm/radeon/si/dpm: fix phase shedding setup
Used the wrong index to setup the phase shedding mask.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2016-09-28 16:13:16 -04:00
Alex Deucher
9909a7956f drm/amdgpu/si/dpm: sync up quirks from radeon
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-28 16:13:15 -04:00
Dave Airlie
c0d5fb4d0d bugfixes for qemu (bochs, qxl and virtio-gpu) drm drivers
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJX4lTNAAoJEEy22O7T6HE4aT4P/iWFkmG/Wg5WqANDrfZw6tPb
 sy7Nhl9w5L9tyMQY2Mvan3zaBEnpy/QVHCNn3iFBx68TeP6jO4eA5X4xtTGlFVV0
 +K2vjPj7pYZKo4InwvTAnL9G5FpfPMtFydLsjuZOLwrfeAIDj3MMTpkvKiOAPkAg
 gNSmNGkt+rxo0gFVHyev1/TXjV5J2fXhv+NZiqdegEkdSFi7A63TO9pN0d/VDcCh
 c6ZoVy1OFKfTD/2kvtBqgeFghXThjkJv+38uRzZwq5yGerq/4L8FU5tD6WTAowzo
 MayJdGIKaSqEDMzIVVMkeCDcDGXrZNAJhwfw5LDsNU2M50LL2oRxil3t7PxLeG8l
 9KOp3jR1L8LGpqyTZQBKrrWhFwF4iZ1f6U7Q3N2MSH8oGc7orqvklis23jhNNkk/
 /oNBckGrX3Hof7mMgaug1RDjEfhXD82awhvEoQS7ep+jYhJnnfqvbx/GvTBc5i3t
 cXu1jNvh1tBKbdbEoFOBrNDla05IL5qD3LaPaH0w4un6YjUhEYdQliDz20e6N5uz
 R2f5BmqcHKkQHH108dOAUNgF9LiHqlZQPVyOYds8ACQTm874COPbgpyFohAl96Ri
 /swEXv8mijluOMp5ZCXaClNvsv18iW/eCNw2ohT8qWbPj4TTuJUy8Rx4RIFBEBMo
 /LoiT6Sf9UFljafQYt50
 =lhHU
 -----END PGP SIGNATURE-----

Merge tag 'drm-qemu-20160921' of git://git.kraxel.org/linux into drm-next

bugfixes for qemu (bochs, qxl and virtio-gpu) drm drivers

* tag 'drm-qemu-20160921' of git://git.kraxel.org/linux:
  drm/virtio: add real fence context and seqno
  drm/virtio: drop virtio_gpu_execbuffer_ioctl() wrapping
  virtio-gpu: avoid possible NULL pointer dereference
  drm/qxl: reapply cursor after SetCrtc calls
  bochs: ignore device if there isn't enougth memory
2016-09-28 13:23:07 +10:00
Dave Airlie
ca09fb9f60 Linux 4.8-rc8
-----BEGIN PGP SIGNATURE-----
 
 iQEcBAABAgAGBQJX6H4uAAoJEHm+PkMAQRiG5sMH/3yzrMiUCSokdS+cvY+jgKAG
 JS58JmRvBPz2mRaU3MRPBGRDeCz/Nc9LggL2ZcgM+E1ZYirlYyQfIED3lkqk5R07
 kIN1wmb+kQhXyU4IY3fEX7joqyKC6zOy4DUChPkBQU0/0+VUmdVmcJvsuPlnMZtf
 g95m0BdYTui+eDezASRqOEp3Lb5ONL4c3ao4yBP0LHF033ctj3VJQiyi5uERPZJ0
 5e6Mo7Wxn78t9WqJLQAiEH46kTwT2plNlxf3XXqTenfIdbWhqE873HPGeSMa3VQV
 VywXTpCpSPQsA8BYg66qIbebdKOhs9MOviHVfqDtwQlvwhjlBDya0gNHfI5fSy4=
 =Y/L5
 -----END PGP SIGNATURE-----

Merge tag 'v4.8-rc8' into drm-next

Linux 4.8-rc8

There was a lot of fallout in the imx/amdgpu/i915 drivers, so backmerge
it now to avoid troubles.

* tag 'v4.8-rc8': (1442 commits)
  Linux 4.8-rc8
  fault_in_multipages_readable() throws set-but-unused error
  mm: check VMA flags to avoid invalid PROT_NONE NUMA balancing
  radix tree: fix sibling entry handling in radix_tree_descend()
  radix tree test suite: Test radix_tree_replace_slot() for multiorder entries
  fix memory leaks in tracing_buffers_splice_read()
  tracing: Move mutex to protect against resetting of seq data
  MIPS: Fix delay slot emulation count in debugfs
  MIPS: SMP: Fix possibility of deadlock when bringing CPUs online
  mm: delete unnecessary and unsafe init_tlb_ubc()
  huge tmpfs: fix Committed_AS leak
  shmem: fix tmpfs to handle the huge= option properly
  blk-mq: skip unmapped queues in blk_mq_alloc_request_hctx
  MIPS: Fix pre-r6 emulation FPU initialisation
  arm64: kgdb: handle read-only text / modules
  arm64: Call numa_store_cpu_info() earlier.
  locking/hung_task: Fix typo in CONFIG_DETECT_HUNG_TASK help text
  nvme-rdma: only clear queue flags after successful connect
  i2c: qup: skip qup_i2c_suspend if the device is already runtime suspended
  perf/core: Limit matching exclusive events to one PMU
  ...
2016-09-28 12:08:49 +10:00
Dave Airlie
9f4ef05bcd Merge branch 'drm-next-4.9' of git://people.freedesktop.org/~agd5f/linux into drm-next
Last set of radeon and amdgpu changes for 4.9.  This is
mostly just the powerplay cleanup for dGPUs.  Beyond that,
just misc code cleanups and bug fixes.

* 'drm-next-4.9' of git://people.freedesktop.org/~agd5f/linux: (49 commits)
  drm/amd/amdgpu: Clean up afmt allocation in DCEv6. (v2)
  drm/amd/amdgpu: Remove division from vblank_wait
  drm/radeon/atif: Send a hotplug event when we get dgpu display request
  drm/radeon/atpx: check for ATIF dGPU wake for display events support
  drm/amdgpu/atif: Send a hotplug event when we get dgpu display request
  drm/amdgpu/atpx: check for ATIF dGPU wake for display events support
  drm/amdgpu: bump version for new vce packet support
  drm/amdgpu/vce: allow the clock table packet
  drm/amdgpu:cleanup virt related define
  drm/amdgpu: use powerplay module for dgpu in Vi.
  drm/amdgpu: set gfx clock gating for tonga/polaris.
  drm/amdgpu: set system clock gating for tonga/polaris.
  drm/amd/powerplay: export function to help to set cg by smu.
  drm/amdgpu: avoid out of bounds access on array interrupt_status_offsets
  drm/amdgpu: mark symbols static where possible
  drm/amdgpu: remove unused functions
  drm/amd/powerplay:  Replace per-asic print_performance with generic
  drm/radeon: narrow asic_init for virtualization
  drm/amdgpu:add fw version entry to info
  drm/amdgpu:determine if vPost is needed indeed
  ...
2016-09-28 11:27:05 +10:00
Dave Airlie
81c5d6aa39 Merge branch 'drm-etnaviv-next' of git://git.pengutronix.de/git/lst/linux into drm-next
Notable changes:

- Cleanups from Fabio to some error paths and proper error propagation.

- Lots of refactoring and new code to support the new MMU version 2,
still relatively unoptimized and doesn't yet provide better process
isolation than MMUv1, but enough to get newer cores up and running.

- New hardware support: GC3000, as found on the NXP i.MX6 QuadPlus SoC.

* 'drm-etnaviv-next' of git://git.pengutronix.de/git/lst/linux: (25 commits)
  drm/etnaviv: mark whole context as lost in recover worker
  drm/etnaviv: record correct cmdbuf IOVA in dump
  drm/etnaviv: space out IOVA layout for cmdbufs on MMUv2
  drm/etnaviv: fix up model and revision for GC2000+
  drm/etnaviv: implement IOMMUv2 translation
  drm/etnaviv: handle MMU exception in IRQ handler
  drm/etnaviv: add flushing logic for MMUv2
  drm/etnaviv: add function to construct MMUv2 init buffer
  drm/etnaviv: map cmdbuf through MMU on version 2
  drm/etnaviv: split out iova search and MMU reaping logic
  drm/etnaviv: split out FE start
  drm/etnaviv: split out wait for gpu idle
  drm/etnaviv: move gpu_va() to etnaviv mmu
  drm/etnaviv: remove unused iommu_v2 header
  drm/etnaviv: move IOMMU domain allocation into etnaviv MMU
  drm/etnaviv: indirect IOMMU restore through etnaviv MMU
  drm/etnaviv: move linear window setup into etnaviv_iommuv1_restore
  drm/etnaviv: rename etnaviv_iommu_domain_restore to etnaviv_iommuv1_restore
  drm/etnaviv: only check if the cmdbuf is inside the linear window on MMUv1
  drm/etnaviv: only try to use the linear window on MMUv1
  ...
2016-09-28 11:24:05 +10:00
Dave Airlie
a4a7fbb401 Allwinner sun4i DRM fixes for 4.9
A few fixes for the sun4i drm driver that range, including some fixes that
 might prevent multiple planes from working depending on the sequence where
 they are enabled.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJX44UwAAoJEBx+YmzsjxAgo+AQAKiv91r8qNidJ9I5dK4bLHVs
 8wUkGgmdMSN/TIDtdxRwcNKkCG6D+ieyUCkeU2Tvop9QSK4vO5ZVh23d8/H9GEPh
 ebhHoPUQ76JwrLLxD4bJZ7+dcgOExLOFuM54275SYh+YVzEzSdwY7z4kD3O0H9fm
 6RiuPVnehnkgyQGtUMpU/HfFhlwDEwpsJPbDb/RWnpN4C7o4kGP6+kDsJLh4vhyT
 2wd9XXCXMKQrrxx7krppqFlAcBDUIfOpQcvceDopG8/xGJaGRyH64UGMwjnPrdGS
 5kOqNg1/YwzSM2q/WSXziIh3o6RHuh9pyBnrcVPgpA731R744n9GrrclR/8Vkybp
 Bka1Rl4w7A/pw1HB2uOgH89KSFbb0rwEb5Zg0Oh4BfK6h2JUXkiscx4Q9JT5/H4T
 pUr51cxazGeHwV6KeMGt5ogpQcgtu93bcJnlbFtulnh/LQIXDVgFA/0oUK4vdnaz
 VRW8G8ZMl8sikMwxvyNzrf6iF5aXhM7eKa4xr4HqdND5skXe4CDZyvxZ/kvqO0eG
 0Pf4VmlcMP8VV/I1lyHPw9ggQLsEO0dgLvvWmkOu1uOc6yYTfKrf8GnGjfUabxYj
 3l3DIHnEBr6mFOFI/1PuD69urHt/IwnWsMCMdmbru+G74mKJ8cLLlEgF3FcyXEbV
 F8eSyPkSXVBTp4mV8kh3
 =Ondz
 -----END PGP SIGNATURE-----

Merge tag 'sunxi-drm-fixes-for-4.9' of https://git.kernel.org/pub/scm/linux/kernel/git/mripard/linux into drm-next

Allwinner sun4i DRM fixes for 4.9

A few fixes for the sun4i drm driver that range, including some fixes that
might prevent multiple planes from working depending on the sequence where
they are enabled.

* tag 'sunxi-drm-fixes-for-4.9' of https://git.kernel.org/pub/scm/linux/kernel/git/mripard/linux:
  drm/sun4i: Fix the high buffer address mask
  drm/sun4i: tv: Check mode pointer
  drm/sun4i: Fix formats usable by the primary plane
  drm/sun4i: dotclock: Round to closest clock rate
  drm/sun4i: Fix sparse warnings
  drm/sun4i: dotclock: Allow divider = 127
  drm/sun4i: dotclock: Fix clock rate read back calcation
  drm/sun4i: backend: remove redundant dev_err call in sun4i_backend_bind()
2016-09-28 11:23:15 +10:00
Dave Airlie
378db830c3 Merge branch 'for-next' of ssh://people.freedesktop.org/~seanpaul/dogwood into drm-next
I've included some improvements to PSR from myself, as well as a great
series from Tomasz to clean up and tighten up vblank/flip handling.

The last patch is one from Tomeu that has been floating around for a
while, and since rockchip is one of the beneficiaries, I figured this
would be a good place to pick it up.

* 'for-next' of ssh://people.freedesktop.org/~seanpaul/dogwood:
  drm/rockchip: Balance irq refcount on failure
  drm/rockchip: Kill vop_plane_state
  drm/rockchip: Always signal event in next vblank after cfg_done
  drm/rockchip: Do not enable vblank without event
  drm/rockchip: Replace custom wait_for_vblanks with helper
  drm/rockchip: Unreference framebuffers from flip work
  drm/rockchip: Avoid race with vblank count increment
  drm/rockchip: Get rid of some unnecessary code
  drm/rockchip: Clear interrupt status bits before enabling
  drm/rockchip: Fix up bug in psr state machine
  drm/bridge: analogix_dp: Remove duplicated code
  drm/rockchip: Reduce psr flush time to 100ms
  drm/rockchip: Don't key off vblank for psr
2016-09-28 11:22:27 +10:00
Dave Airlie
662d5c9571 Second attempt for 3rd drm/tilcdc pull request for v4.9.
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJX5R79AAoJEJA2s1DX1hlBKHYP/2dfTMY3OGJtLaXUTFR0v5/v
 NPYneoAlSbwI8//hyuXXwgubiHGc0sTiQtmiVpdjXl2TgUrQpgTO98xGV+tMEeME
 4vydlR/dZV7TTdsKhWAWkx3BauSR5Qqfz5jy4oiRjxtCCBKyyAQxvuSC6opHnpCu
 dDlIy9PLEMV8PcIh3iTEqRDkJ1xy0dcZ/E+j66EeLACByduObVjaxRnNumu/1kzh
 wskBaVPR4547Qx4OM/LDOLrh97D2lIhMMBoDlrQZNx6sCcXFXPgLG+CWZv7b8/TQ
 A8PT4cQuUHg5Bs2w/8VWuXja0sWpwptp6zU7b6W6H0omYK9+lZLppRMWiP549s5R
 BirrChI4jGq7iTSfp7WUJI/dopSkSxGeX96w2pQfhbf6Ip6TbN0/ohMpOVQXh8Pn
 96prS67/gHXJ4u3pxU1/Yce6L9NkXiTHFiyiL8EGsUHSki0ccFiiPrSq6Yrteea+
 oDgRGHB3tcEA0Uk08pSHjy2Ts73CxDs27iA1N/Q2k60bR37WaKU5MKlxnTrntPfZ
 6kdoyPyQI9BUZDzlpmXrH2zLPTXMlFgAnbo8AevF1u4c95fJlDdlYyWZunQ/DOlB
 CNDSGZIU1kG99LH8sNr4+4TxjeFavBYAl09fPL6kFS8hyNhorvdZye8x+lmQvIkQ
 NsmWkVzHCoosINIJmuCl
 =Iyf9
 -----END PGP SIGNATURE-----

Merge tag 'tilcdc-4.9-3.1' of https://github.com/jsarha/linux into drm-next

Second attempt for 3rd drm/tilcdc pull request for v4.9.

* tag 'tilcdc-4.9-3.1' of https://github.com/jsarha/linux:
  drm/tilcdc: fix wrong error handling
  drm/tilcdc: Return directly after a failed kfree_table_init() in tilcdc_convert_slave_node()
  drm/tilcdc: Remove "default" from blue-and-red-wiring property binding
  drm/tilcdc: Fix non static symbol warning
  drm/tilcdc: mark symbols static where possible
  drm/tilcdc: add missing header dependencies
  drm/tilcdc: WARN if CRTC is touched without CRTC lock
  drm/tilcdc: Take CRTC lock when calling tilcdc_crtc_disable()
  drm/tilcdc: Remove unnecessary tilcdc_crtc_disable() from tilcdc_unload()
  drm/tilcdc: Flush flip-work workqueue before drm_flip_work_cleanup()
  drm/tilcdc: Clean up LCDC functional clock rate setting code
  drm/tilcdc: Take crtc modeset lock while updating the crtc clock rate
2016-09-28 11:17:26 +10:00
Dave Airlie
f01ebbdb46 Merge branch 'sti-drm-next-2016-09-20' of https://github.com/vinceab/linux into drm-next
Here are some patches for drm-next.
It contains:
- minor fixes for typo and warning.
- sparse and coccicheck warning fixes
- bunch of patches fixing issues found while testing drm/sti with an
atomic version of weston
- the removal of the support of stih415-416 sti platform

* 'sti-drm-next-2016-09-20' of https://github.com/vinceab/linux:
  drm/sti: remove stih415-416 platform support
  drm/sti: fix compositor debugfs creation
  drm/sti: use valid video mode
  drm/sti: in crtc_atomic_flush, enable only planes of this crtc
  drm/sti: use vtg array instead of vtg_main/aux
  drm/sti: use different notifier_block for each pipe
  drm/sti: fix atomic_disable check
  drm/sti: run gdp init sequence only once
  drm/sti: run hqvdp init sequence only once
  drm/sti: fix debug logs
  drm/sti: dpms function missing for HDMI connector
  drm/sti: Fix sparse warnings
  drm: sti: fix coccicheck warnings
  drm: sti: Replace drm_fb_get_bpp_depth() with drm_format_plane_cpp()
2016-09-28 11:14:58 +10:00
Dave Airlie
f8049dd865 Merge branch 'msm-next' of git://people.freedesktop.org/~robclark/linux into drm-next
A bit smaller pull-req this time around.  Some continued DT binding
cleanup to get the corresponding dts bits merged upstream (through
other trees).  And explicit fence-fd support for submit ioctl.

* 'msm-next' of git://people.freedesktop.org/~robclark/linux:
  drm/msm: bump kernel api version for explicit fencing
  drm/msm: submit support for out-fences
  drm/msm: move fence allocation out of msm_gpu_submit()
  drm/msm: submit support for in-fences
  drm/msm: extend the submit ioctl to pass in flags
  drm/msm/mdp5: Set rotation property initial value to DRM_ROTATE_0 insted of 0
  drm/msm/hdmi: don't print error when adding i2c adapter fails
  drm/msm/mdp4: mark symbols static where possible
  drm/msm: Remove call to reservation_object_test_signaled_rcu before wait
  drm/msm/hdmi: Clean up HDMI gpio DT bindings
  drm/msm/mdp4: Fix issue with LCDC/LVDS port parsing
2016-09-28 11:09:59 +10:00
Dave Airlie
3f346d5dcb Merge tag 'topic/drm-misc-2016-09-25' of git://anongit.freedesktop.org/drm-intel into drm-next
- more core cleanup patches to prep drm_file to be used for
  kernel-internal contexts (David Herrmann)
- more split-up+docs for drm_crtc.c
- lots of small fixes and polish all over

* tag 'topic/drm-misc-2016-09-25' of git://anongit.freedesktop.org/drm-intel: (37 commits)
  drm: bridge: analogix/dp: mark symbols static where possible
  drm/bochs: mark bochs_connector_get_modes() static
  drm/bridge: analogix_dp: Improve panel on time
  drm/bridge: analogix_dp: Don't read EDID if panel present
  drm/bridge: analogix_dp: Remove duplicated code
  Revert "drm/i2c: tda998x: don't register the connector"
  drm: Fix plane type uabi breakage
  dma-buf/sync_file: free fences array in num_fences is 1
  drm/i2c: tda998x: don't register the connector
  drm: Don't swallow error codes in drm_dev_alloc()
  drm: Distinguish no name from ENOMEM in set_unique()
  drm: Remove dirty property from docs
  drm/doc: Document color space handling
  drm: Extract drm_color_mgmt.[hc]
  drm/doc: Polish plane composition property docs
  drm: Conslidate blending properties in drm_blend.[hc]
  drm/doc: Polish for drm_plane.[hc]
  drm: Extract drm_plane.[hc]
  drm/tilcdc: Add atomic and crtc headers to crtc.c
  drm: Fix typo in encoder docs
  ...
2016-09-28 10:28:23 +10:00
Dave Airlie
196ebdcc1d Merge tag 'drm-amdkfd-next-2016-09-19' of git://people.freedesktop.org/~gabbayo/linux into drm-next
This is amdkfd's pull request for kernel 4.9. It contains a fix to a possible
infinite loop bug and a couple of other minor "cleaning" patches.

* tag 'drm-amdkfd-next-2016-09-19' of git://people.freedesktop.org/~gabbayo/linux:
  drm/amdkfd: Pass 'struct queue_propertices' by reference
  drm/amdkfd: Unify multiple calls to pr_debug() into one
  drm/amdkfd: Fix possible infinite loop
  drm/amdkfd: Reuse function to find a process through pasid
  drm/amdkfd: Add some missing memset zero'ing in queue init func
  drm/amdkfd: Tidy up kfd_generate_gpu_id() uint64_t bitshift unpack
2016-09-28 10:25:42 +10:00
Grazvydas Ignotas
4cd00d3755 drm/amdgpu/vce3: don't forget to tear down some rings
We can use .num_rings for that.

Fixes: 6f0359ff73 ("vce3: add support for third vce ring")
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-27 13:00:52 -04:00
Grazvydas Ignotas
44f9d7b3f1 drm/amdgpu/i2c: add const where appropriate
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-27 13:00:52 -04:00
Grazvydas Ignotas
54ddf3a6af drm/amdgpu: don't leave dangling pointers around
Right now it's possible to trigger fence_drv.fences[] dereference after
the array has been freed. While the real problem is elsewhere, this still
results in confusing errors that depend on how the freed memory was
reused (I've seen "kernel tried to execute NX-protected page"), it's
better to clear them and get NULL dereference so that it's obvious what's
going wrong.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-27 13:00:51 -04:00
Grazvydas Ignotas
d8907643cc drm/amdgpu: clear ring pointer in amdgpu_device on teardown
This is in symmetry to setup done in amdgpu_ring_init.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-27 13:00:51 -04:00
Alex Deucher
24c5fe56b2 drm/amdgpu/vce: take all rings into account for idle checks
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-27 13:00:50 -04:00
Alex Deucher
b62b5931bd drm/amdgpu: add version bump for raster config programming
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-27 13:00:50 -04:00
Christian König
d7a4ac667e drm/amdgpu: fix addr handling in amdgpu_vm_bo_update_mapping
Otherwise we will look at the wrong place in the IB when GART
mappings are split into smaller updates.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Tom StDenis <Tom.StDenis@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-27 13:00:49 -04:00
Rex Zhu
3374dcebb8 drm/amdgpu: bypass vce clock if vce is idle on Fiji.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-27 13:00:48 -04:00
Baoyou Xie
089cfdd9b0 drm: bridge: analogix/dp: mark symbols static where possible
We get 2 warnings when building kernel with W=1:
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c:1053:5: warning: no previous prototype for 'analogix_dp_get_modes' [-Wmissing-prototypes]
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c:1097:1: warning: no previous prototype for 'analogix_dp_detect' [-Wmissing-prototypes]

In fact, both functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks both functions with 'static'.

Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1474788764-6069-1-git-send-email-baoyou.xie@linaro.org
2016-09-25 22:59:02 +02:00
Baoyou Xie
41bb156ea9 drm/bochs: mark bochs_connector_get_modes() static
We get 1 warning when building kernel with W=1:
drivers/gpu/drm/bochs/bochs_kms.c:181:5: warning: no previous prototype for 'bochs_connector_get_modes' [-Wmissing-prototypes]

In fact, this function is only used in the file in which it is
declared and don't need a declaration, but can be made static.
So this patch marks it 'static'.

Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1474788334-11007-1-git-send-email-baoyou.xie@linaro.org
2016-09-25 22:58:53 +02:00
Sean Paul
f2600d08d4 drm/bridge: analogix_dp: Improve panel on time
In order to reduce the time required to turn on the panel, this patch
makes 2 assumptions:
1- In detect(): if there's a panel, we're connected.
2- In get_modes(): if there's a panel, let the panel driver decide if
   it should prepare/unprepare in order to get the modes.

The first is straightforward, and shouldn't need further explanation. The
second should eliminate the prepare/unprepare delays from get_modes() in
most cases, since panels generally hardcode their modes in the driver as
opposed to reading EDID. If a panel does need to read EDID, it should be
responsible for ensuring it's in a state in which it can.

Signed-off-by: Sean Paul <seanpaul@chromium.org>
2016-09-24 11:56:35 +05:30
Sean Paul
8c77e2c2a4 drm/bridge: analogix_dp: Don't read EDID if panel present
If there's a panel connected to the analogix_dp bridge, rely on
the panel driver for modes, rather than reading EDID *and* calling
get_modes() on the panel.

This allows panels with a valid EDID to read it in the panel driver
(e.g. simple_panel), and panels with invalid EDID to homebrew modes
in their get_modes implementation.

Signed-off-by: Sean Paul <seanpaul@chromium.org>
2016-09-24 11:56:34 +05:30
Tomeu Vizoso
0d97ad03f4 drm/bridge: analogix_dp: Remove duplicated code
Remove code for reading the EDID and DPCD fields and use the helpers
instead.

Besides the obvious code reduction, other helpers are being added to the
core that could be used in this driver and will be good to be able to
use them instead of duplicating them.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Tested-by: Javier Martinez Canillas <javier@osg.samsung.com>
Tested-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Cc: Javier Martinez Canillas <javier@osg.samsung.com>
Cc: Mika Kahola <mika.kahola@intel.com>
Cc: Yakir Yang <ykk@rock-chips.com>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Archit Taneja <architt@codeaurora.org>
2016-09-24 11:56:34 +05:30
Flora Cui
05dcb5c888 drm/amdgpu: fix amdgpu_vm_bo_update param error
Signed-off-by: Flora Cui <Flora.Cui@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-23 11:47:50 -04:00
Nils Wallménius
a1c1a1de43 drm/amdgpu: Constify tables
Mark some powerplay tables as 'const' and adjust pointers acessing
them to avoid introducing warnings.

Signed-off-by: Nils Wallménius <nils.wallmenius@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-23 10:50:22 -04:00
Daniel Schultz
7b993855df drm/tilcdc: fix wrong error handling
When 'component_bind_all' fails it should not try to unbind components
in the error handling. This will produce a null pointer kernel panic when
no component exist.

This patch changes the order of the error handling. Now, it will only
unbind components if the are bound. Otherwise, the module will jump to
an error label below.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Jyri Sarha <jsarha@ti.com>
2016-09-23 15:12:57 +03:00
Markus Elfring
cf97ee1962 drm/tilcdc: Return directly after a failed kfree_table_init() in tilcdc_convert_slave_node()
Return directly after a memory allocation failed in this function
at the beginning.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Jyri Sarha <jsarha@ti.com>
2016-09-23 13:49:52 +03:00
Sean Paul
f67ed57494 Revert "drm/i2c: tda998x: don't register the connector"
This reverts commit 6a2925ea12.

commit 6a2925ea12
Author: Brian Starkey <brian.starkey@arm.com>
Date:   Mon Jul 25 11:55:48 2016 +0100

    drm/i2c: tda998x: don't register the connector

[seanpaul]
Patch isn't fully baked, and still causing problems. Revert
until this is sorted.

Acked-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
2016-09-23 03:29:50 -07:00
Wei Yongjun
30457676e2 drm/tilcdc: Fix non static symbol warning
Fixes the following sparse warning:

drivers/gpu/drm/tilcdc/tilcdc_drv.c:64:5: warning:
 symbol 'tilcdc_atomic_check' was not declared. Should it be static?

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Jyri Sarha <jsarha@ti.com>
2016-09-22 23:50:09 +03:00
Baoyou Xie
952e8faec5 drm/tilcdc: mark symbols static where possible
We get 3 warnings when building kernel with W=1:
drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c:142:29: warning: no previous prototype for 'tilcdc_get_overlay' [-Wmissing-prototypes]
drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c:198:13: warning: no previous prototype for 'tilcdc_convert_slave_node' [-Wmissing-prototypes]
drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c:264:12: warning: no previous prototype for 'tilcdc_slave_compat_init' [-Wmissing-prototypes]

In fact, these functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
Signed-off-by: Jyri Sarha <jsarha@ti.com>
2016-09-22 23:50:09 +03:00
Baoyou Xie
0fd86779f0 drm/tilcdc: add missing header dependencies
We get 4 warnings when building kernel with W=1:
drivers/gpu/drm/tilcdc/tilcdc_tfp410.c:393:12: warning: no previous prototype for 'tilcdc_tfp410_init' [-Wmissing-prototypes]
drivers/gpu/drm/tilcdc/tilcdc_tfp410.c:398:13: warning: no previous prototype for 'tilcdc_tfp410_fini' [-Wmissing-prototypes]
drivers/gpu/drm/tilcdc/tilcdc_panel.c:443:12: warning: no previous prototype for 'tilcdc_panel_init' [-Wmissing-prototypes]
drivers/gpu/drm/tilcdc/tilcdc_panel.c:448:13: warning: no previous prototype for 'tilcdc_panel_fini' [-Wmissing-prototypes]

In fact, these functions are declared in
drivers/gpu/drm/tilcdc/tilcdc_tfp410.h,
drivers/gpu/drm/tilcdc/tilcdc_panel.h,
so this patch adds missing header dependencies.

Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
Signed-off-by: Jyri Sarha <jsarha@ti.com>
2016-09-22 23:50:08 +03:00
Tom St Denis
beb86f29c9 drm/amd/amdgpu: Clean up afmt allocation in DCEv6. (v2)
v2: minor build fix

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-22 14:15:59 -04:00
Tom St Denis
e37e4f057b drm/amd/amdgpu: Remove division from vblank_wait
Removes division from vblank_wait for DCE v6, v8,
and v10.  Was already implemented for v11.

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-22 13:06:43 -04:00
Alex Deucher
735598477f drm/radeon/atif: Send a hotplug event when we get dgpu display request
On PX systems, if the platform supports hotplug events ATIF while the
dGPU is powered down, handle the event and alert userspace.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-22 10:30:58 -04:00
Alex Deucher
4777166989 drm/radeon/atpx: check for ATIF dGPU wake for display events support
Some ATPX laptops implement special circuitry to generate
display hotplug events via ACPI when the dGPU is powered off.
Check if this is supported.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-22 10:30:45 -04:00
Alex Deucher
1b0f568d24 drm/amdgpu/atif: Send a hotplug event when we get dgpu display request
On PX systems, if the platform supports hotplug events ATIF while the
dGPU is powered down, handle the event and alert userspace.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-22 10:30:36 -04:00
Alex Deucher
efc83cf423 drm/amdgpu/atpx: check for ATIF dGPU wake for display events support
Some ATPX laptops implement special circuitry to generate
display hotplug events via ACPI when the dGPU is powered off.
Check if this is supported.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-22 10:30:30 -04:00
Alex Deucher
9cee3c1f95 drm/amdgpu: bump version for new vce packet support
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-22 10:24:42 -04:00
Alex Deucher
4f82778540 drm/amdgpu/vce: allow the clock table packet
This packet allows the user mode driver to specify
the required performance for specific use cases.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-22 10:24:21 -04:00
Monk Liu
ceeb50ed77 drm/amdgpu:cleanup virt related define
move virtual machine related structure to amdgpu_virt.h
easy for developer to maintain for virualization stuffs

Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-22 10:24:20 -04:00
Rex Zhu
9487dd1548 drm/amdgpu: use powerplay module for dgpu in Vi.
delete non-pp code and files. It was just a temporary
solution and not support dynamic power management.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Acked-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-22 10:24:20 -04:00
Rex Zhu
a8ca341364 drm/amdgpu: set gfx clock gating for tonga/polaris.
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-22 10:24:19 -04:00
Rex Zhu
1bb08f91b0 drm/amdgpu: set system clock gating for tonga/polaris.
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-22 10:24:18 -04:00
Rex Zhu
465f96e213 drm/amd/powerplay: export function to help to set cg by smu.
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-22 10:24:18 -04:00
Colin Ian King
664a08bb90 drm/amdgpu: avoid out of bounds access on array interrupt_status_offsets
The check for an out of bound index into array interrupt_status_offsets
is off-by-one. Fix this and also don't compared to a hard coded array
size but use adev->mode_info.num_hpd instead.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-22 10:24:17 -04:00
Baoyou Xie
4d446656fa drm/amdgpu: mark symbols static where possible
We get 7 warnings when building kernel with W=1:
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1990:5: warning: no previous prototype for 'amdgpu_pre_soft_reset' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c:1548:5: warning: no previous prototype for 'amdgpu_connector_virtual_dpms' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c:1560:5: warning: no previous prototype for 'amdgpu_connector_virtual_set_property' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:330:5: warning: no previous prototype for 'amdgpu_cs_list_validate' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/dce_virtual.c:98:6: warning: no previous prototype for 'dce_virtual_stop_mc_access' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/dce_virtual.c:130:6: warning: no previous prototype for 'dce_virtual_resume_mc_access' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/dce_virtual.c:136:6: warning: no previous prototype for 'dce_virtual_set_vga_render_state' [-Wmissing-prototypes]

In fact, all of the functions are only used in the file
in which they are declared and don't need a declaration,
but can be made static.

So this patch marks both functions with 'static'.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-22 10:24:17 -04:00
Baoyou Xie
fa675329fc drm/amdgpu: remove unused functions
We get 2 warnings when building kernel with W=1:
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c:146:5: warning: no previous prototype for 'pool_to_domain' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/cz_smc.c:104:5: warning: no previous prototype for 'cz_send_msg_to_smc_with_parameter_async' [-Wmissing-prototypes]

In fact, both functions are called by no one and not exported,
so this patch removes them.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-22 10:24:16 -04:00
Tom St Denis
3de4ec5727 drm/amd/powerplay: Replace per-asic print_performance with generic
Replace per-asic print_current_performance() functions with generic
that calls read_sensor.  Tested on Tonga and Carrizo for aesthetics
and accuracy.

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-22 10:24:16 -04:00
Alex Deucher
884031f0aa drm/radeon: narrow asic_init for virtualization
Only needed on CIK+ due to the way pci reset is handled
by the GPU.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2016-09-22 10:24:15 -04:00
Frank Min
fc76cbf456 drm/amdgpu:add fw version entry to info
Signed-off-by: Frank Min <Frank.Min@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-22 10:24:15 -04:00
Monk Liu
bec86378be drm/amdgpu:determine if vPost is needed indeed
Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-22 10:24:14 -04:00
Brian Starkey
6a2925ea12 drm/i2c: tda998x: don't register the connector
The connector shouldn't be registered until the rest of the whole device
is set up, so that consistent state is presented to userspace.

As drm_dev_register() now registers all of the connectors anyway,
there's no need to explicitly do it in individual drivers so remove
the calls to drm_connector_register()/drm_connector_unregister().

This allows componentised drivers to use tda998x without having racy
initialisation.

Signed-off-by: Brian Starkey <brian.starkey@arm.com>
Reviewed-by: Liviu Dudau <Liviu.Dudau@arm.com>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1469444148-19003-1-git-send-email-brian.starkey@arm.com
Link: http://patchwork.freedesktop.org/patch/msgid/545C835D.1050008@arm.com
2016-09-22 04:04:24 -07:00
Tom Gundersen
0f2886057b drm: Don't swallow error codes in drm_dev_alloc()
There are many reasons other than ENOMEM that drm_dev_init() can
fail. Return ERR_PTR rather than NULL to be able to distinguish
these in the caller.

Signed-off-by: Tom Gundersen <teg@jklm.no>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/20160921145919.13754-2-teg@jklm.no
2016-09-22 04:03:48 -07:00
Tom Gundersen
c6bf811a0b drm: Distinguish no name from ENOMEM in set_unique()
If passing name == NULL to drm_drv_set_unique() we now get -ENOMEM
as kstrdup() returns NULL. Instead check for this explicitly and
return -EINVAL if no name is provided.

Signed-off-by: Tom Gundersen <teg@jklm.no>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/20160921145919.13754-1-teg@jklm.no
2016-09-22 04:03:42 -07:00
Maxime Ripard
f0188ef830 drm/sun4i: Fix the high buffer address mask
The highest 3bits of the 4 layers buffers are all part of the same
register. However, our mask computation was wrong, leading to all the
lowest register bits being removed when we use regmap_update_bits, which
will lead to the buffers being set to some random part of the RAM.

Fix our mask.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2016-09-22 10:13:22 +03:00
Maxime Ripard
e4192089fe drm/sun4i: tv: Check mode pointer
The drm_mode_create call might return NULL in case of a failure, and the
current code doesn't check for that. Make sure it does.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2016-09-22 10:13:08 +03:00
Maxime Ripard
c222f39904 drm/sun4i: Fix formats usable by the primary plane
Even though all our planes can support the ARGB formats, the lowest plane
(ie the primary plane) cannot use the alpha component, otherwise it will
just result in the transparent area being entirely black.

Since some applications will still require the ARGB format, let's force the
format to XRGB to drop the alpha component entirely.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2016-09-22 10:10:54 +03:00
Daniel Vetter
a6acccf8ef drm/doc: Document color space handling
Again move it from the unmaintainable csv into DOC free-form overview
sections.

v2: Types Lionel&Sean spotted.

Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1474448370-32227-6-git-send-email-daniel.vetter@ffwll.ch
2016-09-22 00:04:03 -07:00
Daniel Vetter
f1e2f66ce2 drm: Extract drm_color_mgmt.[hc]
For both the new degamm/lut/gamma atomic combo, and the old legacy
gamma tables.

Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1474448370-32227-5-git-send-email-daniel.vetter@ffwll.ch
2016-09-22 00:04:02 -07:00
Daniel Vetter
1e4d84c658 drm/doc: Polish plane composition property docs
Try to spec a bit more precisely how they all fit together, now that
at least the code is for all the additional properties is in one
place.

Also remove the entries for the standardized properties from the
table, because that thing is supremely unmaintaineable.

v2: Fix typos Sean spotted.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Sean Paul <seanpaul@chromium.org>
Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1474448370-32227-4-git-send-email-daniel.vetter@ffwll.ch
2016-09-22 00:04:02 -07:00
Daniel Vetter
1873380246 drm: Conslidate blending properties in drm_blend.[hc]
Imo zpos, rotatation, blending eq (once we have it) and all that
should be in drm_blend.c, since those are all about how exactly the
pixels are rendered onto the CRTC's visible area. Also noticed that
one exported function accidentally ended up in drm_crtc_internal.h,
move it to the right place too.

Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1474448370-32227-3-git-send-email-daniel.vetter@ffwll.ch
2016-09-22 00:04:01 -07:00
Daniel Vetter
532b36712d drm/doc: Polish for drm_plane.[hc]
Big thing is untangling and carefully documenting the different uapi
types of planes. I also sprinkled a few more cross references around
to make this easier to discover.

As usual, remove the kerneldoc for internal functions which are not
exported. Aside: We should probably go OCD on all the ioctl handlers
and consistenly give them an _ioctl postfix.

Acked-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1474448370-32227-2-git-send-email-daniel.vetter@ffwll.ch
2016-09-22 00:04:01 -07:00
Daniel Vetter
43968d7b80 drm: Extract drm_plane.[hc]
Just pure code movement, cleanup and polish will happen in later
patches.

v2: Don't forget all the ioctl! To extract those cleanly I decided to
put check_src_coords into drm_framebuffer.c (and give it a
drm_framebuffer_ prefix), since that just checks framebuffer
constraints.

v3: rebase over PAGE_FLIP_TARGET.

Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

[seanpaul]
This patch as posted on the list was rebased on:

commit 6f00975c61
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Sat Aug 20 12:22:11 2016 +0200

    drm: Reject page_flip for !DRIVER_MODESET

so as a result of moving the page_flip ioctl, this fix has
been rolled into this patch.

Signed-off-by: Sean Paul <seanpaul@chromium.org>
2016-09-22 00:01:56 -07:00
Sean Paul
ce2f2c3f82 drm/tilcdc: Add atomic and crtc headers to crtc.c
Also reorder alphabetically and fix up drm_flip_work header.

Reviewed-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
2016-09-21 23:36:53 -07:00
Sean Paul
8c763c9b10 drm/rockchip: Balance irq refcount on failure
If create_crtc fails in vop bind, ensure the irq refcount is zeroed
back out before exiting.

Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
2016-09-21 06:55:53 -07:00
Tomasz Figa
d47a7246bb drm/rockchip: Kill vop_plane_state
After changes introduced by last patches, there is no useful data stored
in vop_plane_state struct.  Let's remove it and make the driver use
generic plane state alone.

Signed-off-by: Tomasz Figa <tfiga@chromium.org>
2016-09-21 06:55:52 -07:00
Tomasz Figa
41ee436700 drm/rockchip: Always signal event in next vblank after cfg_done
This patch makes the driver send the pending vblank event in next vblank
following the commit, relying on vblank signalling improvements done in
previous patches. This gives us vblank events that always represent the
real moment of changes hitting on the screen (which was the case only
for complete FB changes before) and lets us remove the manual window
update check.

Signed-off-by: Tomasz Figa <tfiga@chromium.org>
2016-09-21 06:55:52 -07:00
Tomasz Figa
646ec68718 drm/rockchip: Do not enable vblank without event
Originally we needed to enable vblank for any atomic commit to kick the
PSR machine, but that was changed and we no longer need to do so from
a vblank interrupt. Let's return to original behavior of enabling
vblank only if it is really necessary.

This essentially reverts commit 5b6804034a ("drm/rockchip: Enable
vblank without event").

Signed-off-by: Tomasz Figa <tfiga@chromium.org>
2016-09-21 06:55:51 -07:00
Tomasz Figa
81c248f75a drm/rockchip: Replace custom wait_for_vblanks with helper
Currently the driver uses a custom function to wait for flip to complete
after an atomic commit. It was needed before because of two problems:
 - there is no hardware vblank counter, so the original helper would
   have a race condition with the vblank interrupt,
 - the driver didn't support unreferencing cursor framebuffers
   asynchronously to the commit, which was what the helper expected.
Since both problems have been solved by previous patches, we can now
make the driver use the generic helper and remove custom waiting code.

Signed-off-by: Tomasz Figa <tfiga@chromium.org>
2016-09-21 06:55:51 -07:00
Tomasz Figa
47a7eb4597 drm/rockchip: Unreference framebuffers from flip work
Currently the driver waits for vblank and then unreferences old
framebuffers from atomic commit code path. This is however breaking the
legacy cursor API, which requires the updates to be fully asynchronous.
Instead of just adding a special case for cursor, we can have actually
smaller amount of code to unreference any changed framebuffer from a
flip work.

Signed-off-by: Tomasz Figa <tfiga@chromium.org>
2016-09-21 06:55:51 -07:00
Tomasz Figa
7caecdbec1 drm/rockchip: Avoid race with vblank count increment
Since VOP does not have a hardware vblank count register, the ongoing
commit might be racing with a requested vblank interrupt, which would
increment the software vblank counter before the changes being committed
actually happen.

To avoid this, we can extend .atomic_flush(), so after it sets cfg_done
bit, it polls the vblank interrupt bit until it's inactive to make sure
that any old vblank interrupt gets to the handler and then uses
synchronize_irq(vop->irq) to make sure the handler finishes running.

The polling case should happen very rarely, but even if, the total wait
time should be relatively low and in practice almost equal to the vop
hardirq handler running time.

Signed-off-by: Tomasz Figa <tfiga@chromium.org>
2016-09-21 06:55:50 -07:00
Tomasz Figa
65bcb6bcc8 drm/rockchip: Get rid of some unnecessary code
Current code implements prepare_fb and cleanup_fb callbacks only to
grab/release fb references, which is already done by atomic framework
when creating/destryoing plane state. Let's remove these
unused bits.

Signed-off-by: Tomasz Figa <tfiga@chromium.org>
2016-09-21 06:55:50 -07:00
Tomasz Figa
fa374107c1 drm/rockchip: Clear interrupt status bits before enabling
The enable register only masks the raw status bits to signal CPU
interrupt only for enabled interrupts. The status bits are activated
regardless of the enable register. This means that we might have an old
interrupt event queued, which we are not interested in. To avoid getting
a spurious interrupt signalled, we have to clear the old bit before we
update the enable register.

Signed-off-by: Tomasz Figa <tfiga@chromium.org>
2016-09-21 06:55:49 -07:00
Sean Paul
be91a983ea drm/rockchip: Fix up bug in psr state machine
The ->set() callback would always be called when transitioning
from FLUSH->DISABLE since we assign state to psr->state right
above the skip condition.

Reported-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
2016-09-21 06:55:49 -07:00
Tomeu Vizoso
d2f12adc00 drm/bridge: analogix_dp: Remove duplicated code
Remove code for reading the EDID and DPCD fields and use the helpers
instead.

Besides the obvious code reduction, other helpers are being added to the
core that could be used in this driver and will be good to be able to
use them instead of duplicating them.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Tested-by: Javier Martinez Canillas <javier@osg.samsung.com>
Tested-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Yakir Yang <ykk@rock-chips.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Cc: Javier Martinez Canillas <javier@osg.samsung.com>
Cc: Mika Kahola <mika.kahola@intel.com>
Cc: Yakir Yang <ykk@rock-chips.com>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Archit Taneja <architt@codeaurora.org>
2016-09-21 06:55:48 -07:00
Sean Paul
604bac48a7 drm/rockchip: Reduce psr flush time to 100ms
3 seconds is a bit too conservative, drop this to 100ms for
better power savings.

Reviewed-by: Yakir Yang <ykk@rock-chips.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
2016-09-21 06:55:48 -07:00
Sean Paul
b883c9ba18 drm/rockchip: Don't key off vblank for psr
Instead of keying off vblank for psr, just flush every time
we get an atomic update. This ensures that cursor updates
will properly disable psr (without turning vblank on/off),
and unifies the paths between fb_dirty and atomic psr
enable/disable.

Reviewed-by: Yakir Yang <ykk@rock-chips.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
2016-09-21 06:55:47 -07:00
Dhinakaran Pandiyan
f15e6bb06e drm: Fix typo in encoder docs
Corrected typo in bridge and encoder comparison. Also, added a one-line
encoder description from the previous documentation.

Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Archit Taneja <architt@codeaurora.org>

Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1474324848-6446-1-git-send-email-dhinakaran.pandiyan@intel.com
2016-09-21 13:33:50 +02:00
Markus Elfring
b5a2ecd857 GPU-DRM: Replace a kzalloc() call by kcalloc() in drm_legacy_addbufs_sg()
The script "checkpatch.pl" can point information out like the following.

WARNING: Prefer kcalloc over kzalloc with multiply

Thus fix the affected source code place.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/b340d1ca-f114-a523-e6d1-afe7fd6c3826@users.sourceforge.net
2016-09-21 13:24:27 +02:00
Markus Elfring
81a441378d GPU-DRM: Replace a kzalloc() call by kcalloc() in drm_legacy_addbufs_agp()
The script "checkpatch.pl" can point information out like the following.

WARNING: Prefer kcalloc over kzalloc with multiply

Thus fix the affected source code place.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/606c22f3-5da5-2e84-783d-bfe5289b4a01@users.sourceforge.net
2016-09-21 13:24:27 +02:00
Markus Elfring
ed6dee4192 GPU-DRM: Replace two kzalloc() calls by kcalloc() in drm_legacy_addbufs_pci()
The script "checkpatch.pl" can point information out like the following.

WARNING: Prefer kcalloc over kzalloc with multiply

Thus fix the affected source code places.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/51f88f44-130d-48ac-f531-32ca9ae3919f@users.sourceforge.net
2016-09-21 13:24:27 +02:00
Markus Elfring
2027400893 GPU-DRM: Use kmalloc_array() in drm_legacy_addbufs_pci()
A multiplication for the size determination of a memory allocation
indicated that an array data structure should be processed.
Thus use the corresponding function "kmalloc_array".

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/b71c8fee-8e84-9f1b-8569-f1ae8b879cc5@users.sourceforge.net
2016-09-21 13:24:27 +02:00
Rob Clark
7a3bcc0a8e drm/msm: bump kernel api version for explicit fencing
Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-09-21 03:09:19 -04:00
Dave Airlie
52f13a02b7 Merge branch 'for-next' of http://git.agner.ch/git/linux-drm-fsl-dcu into drm-next
fsl-dcu fixes.

* 'for-next' of http://git.agner.ch/git/linux-drm-fsl-dcu:
  drm/fsl-dcu: disable clock on error path
  drm/fsl-dcu: use PTR_ERR_OR_ZERO() to simplify the code
  drm/fsl-dcu: fix endian issue when using clk_register_divider
2016-09-21 06:28:25 +10:00
Vincent Abriou
b4bba92dfb drm/sti: remove stih415-416 platform support
stih415 and stih416 platform are obsolete and no more supported.
Only stih407 and stih410 platform are maintained.

Signed-off-by: Vincent Abriou <vincent.abriou@st.com>
Acked-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Acked-by: Peter Griffin <peter.griffin@linaro.org>
2016-09-20 15:03:33 +02:00
Gustavo Padovan
30b9c96cf7 drm/virtio: add real fence context and seqno
virtio fences were created with no fence context, which would make then
clash with an allocated fence context.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Message-id: 1472660813-28219-2-git-send-email-gustavo@padovan.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2016-09-20 14:25:43 +02:00
Gustavo Padovan
5c32c3dd85 drm/virtio: drop virtio_gpu_execbuffer_ioctl() wrapping
Instead of wrapping virtio_gpu_execbuffer() to execute the ioctl
just execute it directly.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Message-id: 1472660813-28219-1-git-send-email-gustavo@padovan.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2016-09-20 14:25:41 +02:00
Heinrich Schuchardt
b28c69dd3d virtio-gpu: avoid possible NULL pointer dereference
If output is NULL it is not permissable to dereference it.
So we should leave the respective function in this case.

The inconsistency was indicated by cppcheck.
No actual NULL pointer dereference was observed.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Message-id: 1471813566-5324-1-git-send-email-xypron.glpk@gmx.de
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2016-09-20 14:25:39 +02:00
Ray Strode
4532b241a4 drm/qxl: reapply cursor after SetCrtc calls
The qxl driver currently destroys and recreates the
qxl "primary" any time the first crtc is set.

A side-effect of destroying the primary is mouse state
associated with the crtc is lost, which leads to
disappearing mouse cursors on wayland sessions.

This commit changes the driver to reapply the cursor
any time SetCrtc is called. It achieves this by keeping
a reference to the cursor bo on the qxl_crtc struct.

Signed-off-by: Ray Strode <rstrode@redhat.com>
Message-id: 1473433745-11016-1-git-send-email-halfline@gmail.com

https://bugzilla.redhat.com/show_bug.cgi?id=1200901
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2016-09-20 14:25:37 +02:00
Gerd Hoffmann
de59576293 bochs: ignore device if there isn't enougth memory
The qemu stdvga can be configured with a wide range of video memory,
from 1 MB to 256 MB (default is 16 MB).  In case it is configured
with only 1 or 2 MB it isn't really usable with bochsdrm, due to
depths other than 32bpp not being supported so that isn't enough
memory for a reasonable sized framebuffer.  So skip the device
and let vgacon or vesafb+fbcon handle the it.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2016-09-20 14:25:35 +02:00
Vincent Abriou
38fdb8d95f drm/sti: fix compositor debugfs creation
Fix typo and issue while creating the vid and mixer debugfs entries.

Signed-off-by: Vincent Abriou <vincent.abriou@st.com>
Acked-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
2016-09-20 11:32:07 +02:00
Fabien Dessenne
f766c6c810 drm/sti: use valid video mode
In atomic mode the crtc_xxx (eg crtc_hdisplay) members of the mode
structure may be unset before calling atomic_check/commit for planes.
Instead of, use xxx members which are actually set.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Vincent Abriou <vincent.abriou@st.com>
2016-09-20 11:32:06 +02:00
Fabien Dessenne
3bc6b01de3 drm/sti: in crtc_atomic_flush, enable only planes of this crtc
crtc_atomic_flush performs some additional processing, like plane
enable at mixer level.
Enable only the planes attached to the CRTC.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Vincent Abriou <vincent.abriou@st.com>
2016-09-20 11:32:06 +02:00
Fabien Dessenne
ffdbb82ca4 drm/sti: use vtg array instead of vtg_main/aux
This is more generic and more consistent with the other members of the
sti_compositor struct.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Vincent Abriou <vincent.abriou@st.com>
2016-09-20 11:32:06 +02:00
Fabien Dessenne
ae2178503d drm/sti: use different notifier_block for each pipe
Each pipe shall have its own notifier block to manage the vblank event.
This fixes issues where a client registered on given pipe is later
abusively notified of events on the other pipe.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Vincent Abriou <vincent.abriou@st.com>
2016-09-20 11:32:06 +02:00
Fabien Dessenne
5552aad35d drm/sti: fix atomic_disable check
When a drm_plane is being disabled, its ->crtc member is set to NULL
before the .atomic_disable() func is called.
To get the crtc of the plane, read old_state->crtc instead of
drm_plane->crtc

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Vincent Abriou <vincent.abriou@st.com>
2016-09-20 11:32:05 +02:00
Fabien Dessenne
00b517e54f drm/sti: run gdp init sequence only once
Do not rely on plane->status to define whether this is the first update
but rather check for gdp->vtg.
This avoids multiple and unwanted calls to sti_vtg_register_client()
which breaks the kernel scheduler.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Vincent Abriou <vincent.abriou@st.com>
2016-09-20 11:32:05 +02:00
Fabien Dessenne
9dd5942b31 drm/sti: run hqvdp init sequence only once
Do not rely on plane->status to define whether this is the first update
but rather check for hqvdp->xp70_initialized bit status.
This avoids multiple and unwanted calls to sti_vtg_register_client()
which breaks the kernel scheduler.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Vincent Abriou <vincent.abriou@st.com>
2016-09-20 11:32:05 +02:00
Fabien Dessenne
29ffa77668 drm/sti: fix debug logs
Add some missing \n in logs.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Vincent Abriou <vincent.abriou@st.com>
2016-09-20 11:32:05 +02:00