platform/kernel/linux-rpi3.git
7 years agoMerge tag 'drm-intel-next-2016-11-21' of git://anongit.freedesktop.org/git/drm-intel...
Dave Airlie [Wed, 30 Nov 2016 04:21:35 +0000 (14:21 +1000)]
Merge tag 'drm-intel-next-2016-11-21' of git://anongit.freedesktop.org/git/drm-intel into drm-next

Final 4.10 updates:

- fine-tune fb flushing and tracking (Chris Wilson)
- refactor state check dumper code for more conciseness (Tvrtko)
- roll out dev_priv all over the place (Tvrkto)
- finally remove __i915__ magic macro (Tvrtko)
- more gvt bugfixes (Zhenyu&team)
- better opregion CADL handling (Jani)
- refactor/clean up wm programming (Maarten)
- gpu scheduler + priority boosting for flips as first user (Chris
  Wilson)
- make fbc use more atomic (Paulo)
- initial kvm-gvt framework, but not yet complete (Zhenyu&team)

* tag 'drm-intel-next-2016-11-21' of git://anongit.freedesktop.org/git/drm-intel: (127 commits)
  drm/i915: Update DRIVER_DATE to 20161121
  drm/i915: Skip final clflush if LLC is coherent
  drm/i915: Always flush the dirty CPU cache when pinning the scanout
  drm/i915: Don't touch NULL sg on i915_gem_object_get_pages_gtt() error
  drm/i915: Check that each request phase is completed before retiring
  drm/i915: i915_pages_create_for_stolen should return err ptr
  drm/i915: Enable support for nonblocking modeset
  drm/i915: Be more careful to drop the GT wakeref
  drm/i915: Move frontbuffer CS write tracking from ggtt vma to object
  drm/i915: Only dump dp_m2_n2 configuration when drrs is used
  drm/i915: don't leak global_timeline
  drm/i915: add i915_address_space_fini
  drm/i915: Add a few more sanity checks for stolen handling
  drm/i915: Waterproof verification of gen9 forcewake table ranges
  drm/i915: Introduce enableddisabled helper
  drm/i915: Only dump possible panel fitter config for the platform
  drm/i915: Only dump scaler config where supported
  drm/i915: Compact a few pipe config debug lines
  drm/i915: Don't log pipe config kernel pointer and duplicated pipe name
  drm/i915: Dump FDI config only where applicable
  ...

7 years agoMerge tag 'drm-qemu-20161121' of git://git.kraxel.org/linux into drm-next
Dave Airlie [Wed, 30 Nov 2016 04:18:51 +0000 (14:18 +1000)]
Merge tag 'drm-qemu-20161121' of git://git.kraxel.org/linux into drm-next

drm/virtio: fix busid in a different way, allocate more vbufs.
drm/qxl: various bugfixes and cleanups,

* tag 'drm-qemu-20161121' of git://git.kraxel.org/linux: (224 commits)
  drm/virtio: allocate some extra bufs
  qxl: Allow resolution which are not multiple of 8
  qxl: Don't notify userspace when monitors config is unchanged
  qxl: Remove qxl_bo_init() return value
  qxl: Call qxl_gem_{init, fini}
  qxl: Add missing '\n' to qxl_io_log() call
  qxl: Remove unused prototype
  qxl: Mark some internal functions as static
  Revert "drm: virtio: reinstate drm_virtio_set_busid()"
  drm/virtio: fix busid regression
  drm: re-export drm_dev_set_unique
  Linux 4.9-rc5
  gp8psk: Fix DVB frontend attach
  gp8psk: fix gp8psk_usb_in_op() logic
  dvb-usb: move data_mutex to struct dvb_usb_device
  iio: maxim_thermocouple: detect invalid storage size in read()
  aoe: fix crash in page count manipulation
  lightnvm: invalid offset calculation for lba_shift
  Kbuild: enable -Wmaybe-uninitialized warnings by default
  pcmcia: fix return value of soc_pcmcia_regulator_set
  ...

7 years agoMerge branch 'drm-tda998x-devel' of git://git.armlinux.org.uk/~rmk/linux-arm into...
Dave Airlie [Thu, 24 Nov 2016 23:55:33 +0000 (09:55 +1000)]
Merge branch 'drm-tda998x-devel' of git://git.armlinux.org.uk/~rmk/linux-arm into drm-next

These updates:
* improve the robustness of the driver wrt races
* improve the compliance for sending infoframes and audio
* re-organise the function order in the driver to group like functions
  together.  (This unfortunately causes a conflict with the change in
  drm-misc, but it should be trivial to solve, although it looks more
  scarey than it really is - sfr has already sent two reports about
  this, one earlier today.)
* simplify tda998x_audio_get_eld and DPMS handling
* power down sections of the chip that we never use
* add some initial preparation for supporting the CEC driver

* 'drm-tda998x-devel' of git://git.armlinux.org.uk/~rmk/linux-arm:
  drm/i2c: tda998x: fix spelling mistake
  drm/i2c: tda998x: allow sharing of the CEC device accesses
  drm/i2c: tda998x: allow interrupt to be shared
  drm/i2c: tda998x: power down pre-filter and color conversion
  drm/i2c: tda998x: switch to boolean is_on
  drm/i2c: tda998x: remove complexity from tda998x_audio_get_eld()
  drm/i2c: tda998x: group audio functions together
  drm/i2c: tda998x: separate connector initialisation
  drm/i2c: tda998x: group connector functions and funcs together
  drm/i2c: tda998x: move and rename tda998x_encoder_set_config()
  drm/i2c: tda998x: correct function name in comments
  drm/i2c: tda998x: only enable audio if supported by sink
  drm/i2c: tda998x: only configure infoframes and audio if supported
  drm/i2c: tda998x: avoid race when programming audio
  drm/i2c: tda998x: avoid racy access to mode clock
  drm/i2c: tda998x: avoid race in tda998x_encoder_mode_set()
  drm/i2c: tda998x: move audio mutex initialisation

7 years agoMerge branch 'drm-armada-devel' of git://git.armlinux.org.uk/~rmk/linux-arm into...
Dave Airlie [Thu, 24 Nov 2016 23:03:27 +0000 (09:03 +1000)]
Merge branch 'drm-armada-devel' of git://git.armlinux.org.uk/~rmk/linux-arm into drm-next

Building on top of the MALI change previously merged, these changes:
* add tracing support for overlay updates
* refactor some of the plane support code
* de-midlayer the driver
* cleanups from other folk reviewing the code

* 'drm-armada-devel' of git://git.armlinux.org.uk/~rmk/linux-arm:
  drm/armada: fix NULL pointer comparison warning
  drm/armada: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops
  drm/armada: remove some dead code
  drm/armada: mark symbols static where possible
  drm/armada: de-midlayer armada
  drm/armada: use common helper for plane base address
  drm/armada: move setting primary plane position to armada_drm_primary_set()
  drm/armada: split out primary plane update
  drm/armada: move plane state to struct armada_plane
  drm/armada: clean up armada_drm_plane_work_run()
  drm/armada: add tracing support

7 years agodrm/i915: Update DRIVER_DATE to 20161121
Daniel Vetter [Mon, 21 Nov 2016 08:45:03 +0000 (09:45 +0100)]
drm/i915: Update DRIVER_DATE to 20161121

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
7 years agoMerge tag 'drm-hisilicon-next-2016-11-17' of http://github.com/zourongrong/linux...
Dave Airlie [Mon, 21 Nov 2016 01:42:17 +0000 (11:42 +1000)]
Merge tag 'drm-hisilicon-next-2016-11-17' of github.com/zourongrong/linux into drm-next

hibmc drm driver for hisilicon.

* tag 'drm-hisilicon-next-2016-11-17' of http://github.com/zourongrong/linux:
  MAINTAINERS: Update HISILICON DRM entries
  drm/hisilicon/hibmc: Add support for vblank interrupt
  drm/hisilicon/hibmc: Add support for VDAC
  drm/hisilicon/hibmc: Add support for display engine
  drm/hisilicon/hibmc: Add support for frame buffer
  drm/hisilicon/hibmc: Add video memory management
  drm/hisilicon/hibmc: Add hisilicon hibmc drm master driver

7 years agodrm/i915: Skip final clflush if LLC is coherent
Chris Wilson [Fri, 18 Nov 2016 21:17:47 +0000 (21:17 +0000)]
drm/i915: Skip final clflush if LLC is coherent

If the LLC is coherent with the object, we do not need to worry about
whether main memory and cache mismatch when we hand the object back to
the system.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20161118211747.25197-2-chris@chris-wilson.co.uk
7 years agodrm/i915: Always flush the dirty CPU cache when pinning the scanout
Chris Wilson [Fri, 18 Nov 2016 21:17:46 +0000 (21:17 +0000)]
drm/i915: Always flush the dirty CPU cache when pinning the scanout

Currently we only clflush the scanout if it is in the CPU domain. Also
flush if we have a pending CPU clflush. We also want to treat the
dirtyfb path similar, and flush any pending writes there as well.

v2: Only send the fb flush message if flushing the dirt on flip
v3: Make flush-for-flip and dirtyfb look more alike since they serve
similar roles as end-of-frame marker.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> #v2
Link: http://patchwork.freedesktop.org/patch/msgid/20161118211747.25197-1-chris@chris-wilson.co.uk
7 years agodrm/i915: Don't touch NULL sg on i915_gem_object_get_pages_gtt() error
Chris Wilson [Mon, 14 Nov 2016 11:29:30 +0000 (11:29 +0000)]
drm/i915: Don't touch NULL sg on i915_gem_object_get_pages_gtt() error

On the DMA mapping error path, sg may be NULL (it has already been
marked as the last scatterlist entry), and we should avoid dereferencing
it again.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: e227330223a7 ("drm/i915: avoid leaking DMA mappings")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Imre Deak <imre.deak@intel.com>
Cc: stable@vger.kernel.org
Link: http://patchwork.freedesktop.org/patch/msgid/20161114112930.2033-1-chris@chris-wilson.co.uk
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
7 years agodrm/i915: Check that each request phase is completed before retiring
Chris Wilson [Fri, 18 Nov 2016 14:34:12 +0000 (14:34 +0000)]
drm/i915: Check that each request phase is completed before retiring

Trying to chase an impossible bug (ivb):

[  207.765411] [drm:i915_reset_and_wakeup [i915]] resetting chip
[  207.765734] [drm:i915_gem_reset [i915]] resetting render ring to restart from tail of request 0x4ee834
[  207.765791] [drm:intel_print_rc6_info [i915]] Enabling RC6 states: RC6 on RC6p on RC6pp off
[  207.767213] [drm:intel_guc_setup [i915]] GuC fw status: path (null), fetch NONE, load NONE
[  207.767515] kernel BUG at drivers/gpu/drm/i915/i915_gem_request.c:203!
[  207.767551] invalid opcode: 0000 [#1] PREEMPT SMP
[  207.767576] Modules linked in: snd_hda_intel i915 cdc_ncm usbnet mii x86_pkg_temp_thermal coretemp crct10dif_pclmul crc32_pclmul ghash_clmulni_intel lpc_ich snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic snd_hda_codec snd_hwdep snd_hda_core mei_me mei snd_pcm sdhci_pci sdhci mmc_core e1000e ptp pps_core [last unloaded: i915]
[  207.767808] CPU: 3 PID: 8855 Comm: gem_ringfill Tainted: G     U          4.9.0-rc5-CI-Patchwork_3052+ #1
[  207.767854] Hardware name: LENOVO 2356GCG/2356GCG, BIOS G7ET31WW (1.13 ) 07/02/2012
[  207.767894] task: ffff88012c82a740 task.stack: ffffc9000383c000
[  207.767927] RIP: 0010:[<ffffffffa00a0a3a>]  [<ffffffffa00a0a3a>] i915_gem_request_retire+0x2a/0x4b0 [i915]
[  207.767999] RSP: 0018:ffffc9000383fb20  EFLAGS: 00010293
[  207.768027] RAX: 00000000004ee83c RBX: ffff880135dcb480 RCX: 00000000004ee83a
[  207.768062] RDX: ffff88012fea42a8 RSI: 0000000000000001 RDI: ffff88012c82af68
[  207.768095] RBP: ffffc9000383fb48 R08: 0000000000000000 R09: 0000000000000000
[  207.768129] R10: 0000000000000000 R11: 0000000000000000 R12: ffff880135dcb480
[  207.768163] R13: ffff88012fea42a8 R14: 0000000000000000 R15: 00000000000001d8
[  207.768200] FS:  00007f955f658740(0000) GS:ffff88013e2c0000(0000) knlGS:0000000000000000
[  207.768239] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  207.768258] CR2: 0000555899725930 CR3: 00000001316f6000 CR4: 00000000001406e0
[  207.768286] Stack:
[  207.768299]  ffff880135dcb480 ffff880135dcbe00 ffff88012fea42a8 0000000000000000
[  207.768350]  00000000000001d8 ffffc9000383fb70 ffffffffa00a1339 0000000000000000
[  207.768402]  ffff88012f296c88 00000000000003f0 ffffc9000383fbb0 ffffffffa00b582d
[  207.768453] Call Trace:
[  207.768493]  [<ffffffffa00a1339>] i915_gem_request_retire_upto+0x49/0x90 [i915]
[  207.768553]  [<ffffffffa00b582d>] intel_ring_begin+0x15d/0x2d0 [i915]
[  207.768608]  [<ffffffffa00b59cb>] intel_ring_alloc_request_extras+0x2b/0x40 [i915]
[  207.768667]  [<ffffffffa00a2fd9>] i915_gem_request_alloc+0x359/0x440 [i915]
[  207.768723]  [<ffffffffa008bd03>] i915_gem_do_execbuffer.isra.15+0x783/0x1a10 [i915]
[  207.768766]  [<ffffffff811a6a2e>] ? __might_fault+0x3e/0x90
[  207.768816]  [<ffffffffa008d380>] i915_gem_execbuffer2+0xc0/0x250 [i915]
[  207.768854]  [<ffffffff815532a6>] drm_ioctl+0x1f6/0x480
[  207.768900]  [<ffffffffa008d2c0>] ? i915_gem_execbuffer+0x330/0x330 [i915]
[  207.768939]  [<ffffffff81202f6e>] do_vfs_ioctl+0x8e/0x690
[  207.768972]  [<ffffffff818193ac>] ? retint_kernel+0x2d/0x2d
[  207.769004]  [<ffffffff810d6ef2>] ? trace_hardirqs_on_caller+0x122/0x1b0
[  207.769039]  [<ffffffff812035ac>] SyS_ioctl+0x3c/0x70
[  207.769068]  [<ffffffff818189ae>] entry_SYSCALL_64_fastpath+0x1c/0xb1
[  207.769103] Code: 90 55 48 89 e5 41 57 41 56 41 55 41 54 49 89 fc 53 8b 35 fa 7b e1 e1 85 f6 0f 85 55 03 00 00 41 8b 84 24 80 02 00 00 85 c0 75 02 <0f> 0b 49 8b 94 24 a8 00 00 00 48 8b 8a e0 01 00 00 8b 89 c0 00
[  207.769400] RIP  [<ffffffffa00a0a3a>] i915_gem_request_retire+0x2a/0x4b0 [i915]
[  207.769463]  RSP <ffffc9000383fb20>

Let's add a couple more BUG_ONs before this to ascertain that the request
did make it to hardware. The impossible part of this stacktrace is that
request must have been considered completed by the i915_request_wait()
before we tried to retire it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20161118143412.26508-1-chris@chris-wilson.co.uk
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
7 years agodrm/i915: i915_pages_create_for_stolen should return err ptr
Matthew Auld [Fri, 18 Nov 2016 17:02:16 +0000 (17:02 +0000)]
drm/i915: i915_pages_create_for_stolen should return err ptr

When gathering the pages from our backing storage we expect get_pages()
to either give us our sg_table or an err ptr. However when gathering our
fake pages for stolen memory we may return NULL in the event of a
failure. To prevent any funny business we should therefore return the
proper err ptr value.

Fixes: 03ac84f1830e ("drm/i915: Pass around sg_table to get_pages/put_pages backend")
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1479488536-6168-1-git-send-email-matthew.auld@intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
7 years agodrm/i915: Enable support for nonblocking modeset
Maarten Lankhorst [Tue, 8 Nov 2016 12:55:42 +0000 (13:55 +0100)]
drm/i915: Enable support for nonblocking modeset

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1478609742-13603-12-git-send-email-maarten.lankhorst@linux.intel.com
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> #irc
7 years agodrm/i915: Be more careful to drop the GT wakeref
Chris Wilson [Tue, 15 Nov 2016 16:46:20 +0000 (16:46 +0000)]
drm/i915: Be more careful to drop the GT wakeref

Since we can retire requests from multiple paths, we cannot assume that
i915_gem_retire_requests() is the sole path on which we can transition
to gt.active_requests == 0. A consequence of this is that we would skip
the function if we had already retired all the requests and not
scheduled the idle worker.

This is fallout from changing the routine from considering active_engines
(for which it was the only consumer) to active_requests.

v2: Move kicking the idle working to i915_gem_request_retire() otherwise
we could postpone the idle callback everytime we called retire_requests
even though we did no work.
v3: We only need to move the idle work kicking!
v4: Drop the BUG_ON(!awake) as we may be called from the shrinker in the
middle of constructing a request before we have marked the device awake.
v5: Add a BUG_ON() for active_requests underflow upon retirement (Joonas)

Fixes: 28176ef4cfa5 ("drm/i915: Reserve space in the global seqno during request allocation")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20161115164620.17185-1-chris@chris-wilson.co.uk
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
7 years agodrm/i915: Move frontbuffer CS write tracking from ggtt vma to object
Chris Wilson [Wed, 16 Nov 2016 19:07:04 +0000 (19:07 +0000)]
drm/i915: Move frontbuffer CS write tracking from ggtt vma to object

I tried to avoid having to track the write for every VMA by only
tracking writes to the ggtt. However, for the purposes of frontbuffer
tracking this is insufficient as we need to invalidate around writes not
just to the the ggtt but all aliased ppgtt views of the framebuffer. By
moving the critical section to the object and only doing so for
framebuffer writes we can reduce the tracking even further by only
watching framebuffers and not vma.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20161116190704.5293-1-chris@chris-wilson.co.uk
Tested-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
7 years agodrm/i915: Only dump dp_m2_n2 configuration when drrs is used
Tvrtko Ursulin [Thu, 17 Nov 2016 15:44:09 +0000 (15:44 +0000)]
drm/i915: Only dump dp_m2_n2 configuration when drrs is used

Otherwise it is just an useless empty line.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Suggested-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1479397449-27085-1-git-send-email-tvrtko.ursulin@linux.intel.com
7 years agodrm/i2c: tda998x: fix spelling mistake
Colin Ian King [Mon, 14 Nov 2016 22:46:43 +0000 (22:46 +0000)]
drm/i2c: tda998x: fix spelling mistake

Trivial fix to spelling mistake "configutation" to "configuration"
in dev_err message

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
7 years agodrm/i2c: tda998x: allow sharing of the CEC device accesses
Russell King [Thu, 3 Nov 2016 10:16:17 +0000 (10:16 +0000)]
drm/i2c: tda998x: allow sharing of the CEC device accesses

cec_read() is non-atomic in the presence of other I2C bus transactions
to the same device.  This presents a problem when we add support for
the TDA9950 CEC engine part - both drivers can be trying to access the
device.

Avoid the inherent problems by switching to i2c_transfer() instead,
which allows us to perform more than one bus transaction atomically.

As this means we will be using I2C transactions rather than SMBUS, we
have to check that the host supports I2C functionality.

Tested-by: Brian Starkey <brian.starkey@arm.com>
Reviewed-by: Brian Starkey <brian.starkey@arm.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
7 years agodrm/i2c: tda998x: allow interrupt to be shared
Russell King [Thu, 3 Nov 2016 08:58:04 +0000 (08:58 +0000)]
drm/i2c: tda998x: allow interrupt to be shared

Some TDA998x contain several different I2C devices - there is the HDMI
encoder, and there is a TDA9950 CEC engine.  These two share the same
interrupt signal.

In order to allow a driver for the CEC engine to work, we need to be
able to share the interrupt with the CEC driver, so convert the handler
and registration to allow this to happen.

Tested-by: Brian Starkey <brian.starkey@arm.com>
Reviewed-by: Brian Starkey <brian.starkey@arm.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
7 years agodrm/i2c: tda998x: power down pre-filter and color conversion
Russell King [Thu, 3 Nov 2016 15:19:06 +0000 (15:19 +0000)]
drm/i2c: tda998x: power down pre-filter and color conversion

Disabling the pre-filter block of the TDA998x saves 40mW and the colour
conversion block saves 15mW.  As we always disable these two blocks, we
can power these sections of the chip down to save 55mW of unnecessary
power consumption.

Tested-by: Brian Starkey <brian.starkey@arm.com>
Reviewed-by: Brian Starkey <brian.starkey@arm.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
7 years agodrm/i2c: tda998x: switch to boolean is_on
Russell King [Sun, 23 Oct 2016 10:39:04 +0000 (11:39 +0100)]
drm/i2c: tda998x: switch to boolean is_on

Rather than storing the DPMS mode (which will always be on or off) use a
boolean to store this instead.

Tested-by: Robin Murphy <robin.murphy@arm.com>
Tested-by: Jon Medhurst <tixy@linaro.org>
Acked-by: Jon Medhurst <tixy@linaro.org>
Tested-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
7 years agodrm/i2c: tda998x: remove complexity from tda998x_audio_get_eld()
Russell King [Sun, 23 Oct 2016 10:31:44 +0000 (11:31 +0100)]
drm/i2c: tda998x: remove complexity from tda998x_audio_get_eld()

tda998x_audio_get_eld() is needlessly complex - the connector associated
with the encoder is always our own priv->connector.  Remove this
complexity, but ensure that there are no races when copying out the ELD.

Tested-by: Jon Medhurst <tixy@linaro.org>
Acked-by: Jon Medhurst <tixy@linaro.org>
Tested-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
7 years agodrm/i2c: tda998x: group audio functions together
Russell King [Sun, 23 Oct 2016 10:30:56 +0000 (11:30 +0100)]
drm/i2c: tda998x: group audio functions together

Group the TDA998x audio functions together rather than split between
two different locations in the file, keeping like code together.

Tested-by: Jon Medhurst <tixy@linaro.org>
Acked-by: Jon Medhurst <tixy@linaro.org>
Tested-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
7 years agodrm/i2c: tda998x: separate connector initialisation
Russell King [Sun, 23 Oct 2016 10:30:56 +0000 (11:30 +0100)]
drm/i2c: tda998x: separate connector initialisation

Separate out the connector initialisation from the rest of the drivers
initialisation.

Tested-by: Robin Murphy <robin.murphy@arm.com>
Tested-by: Jon Medhurst <tixy@linaro.org>
Acked-by: Jon Medhurst <tixy@linaro.org>
Tested-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
7 years agodrm/i2c: tda998x: group connector functions and funcs together
Russell King [Sun, 23 Oct 2016 10:29:59 +0000 (11:29 +0100)]
drm/i2c: tda998x: group connector functions and funcs together

Group the TDA998x connector functions and funcs structures together
before the encoder support, rather than scattered amongst the rest of
the file.  This keeps like code together.

Tested-by: Robin Murphy <robin.murphy@arm.com>
Tested-by: Jon Medhurst <tixy@linaro.org>
Acked-by: Jon Medhurst <tixy@linaro.org>
Tested-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
7 years agodrm/i2c: tda998x: move and rename tda998x_encoder_set_config()
Russell King [Sun, 23 Oct 2016 10:25:02 +0000 (11:25 +0100)]
drm/i2c: tda998x: move and rename tda998x_encoder_set_config()

The naming of tda998x_encoder_set_config() is a left-over from when
TDA998x was a slave encoder.  Since this is part of the initialisation,
drop the _encoder from the name, and move it near tda998x_bind().

Tested-by: Robin Murphy <robin.murphy@arm.com>
Tested-by: Jon Medhurst <tixy@linaro.org>
Acked-by: Jon Medhurst <tixy@linaro.org>
Tested-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
7 years agodrm/i2c: tda998x: correct function name in comments
Russell King [Sun, 23 Oct 2016 10:24:22 +0000 (11:24 +0100)]
drm/i2c: tda998x: correct function name in comments

Correct two references to tda998x_connector_get_modes() which were
incorrectly referring to tda998x_encoder_get_modes().

Tested-by: Robin Murphy <robin.murphy@arm.com>
Tested-by: Jon Medhurst <tixy@linaro.org>
Acked-by: Jon Medhurst <tixy@linaro.org>
Tested-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
7 years agodrm/i2c: tda998x: only enable audio if supported by sink
Russell King [Wed, 2 Nov 2016 21:15:04 +0000 (21:15 +0000)]
drm/i2c: tda998x: only enable audio if supported by sink

Check for audio support by the attached sink by consulting the EDID
prior to enabling audio over the TMDS link.  We must consult the EDID
after calling drm_helper_probe_single_connector_modes(), as this can
use an override EDID, or load a replacement EDID.

Tested-by: Jon Medhurst <tixy@linaro.org>
Acked-by: Jon Medhurst <tixy@linaro.org>
Tested-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
7 years agodrm/i2c: tda998x: only configure infoframes and audio if supported
Russell King [Sun, 23 Oct 2016 10:32:42 +0000 (11:32 +0100)]
drm/i2c: tda998x: only configure infoframes and audio if supported

The CEA 861B specification indicates the situations when we are able to
send each infoframe based on the version of the EDID's CEA extension.
Update the tda998x driver to follow the CEA specification wrt sending
of infoframes.

Since we only support the generation of AVI version 2, this limits us
to CEA extension version 3, so we treat CEA extension version 2 as
CEA 861 (no infoframes, no audio.)

Tested-by: Robin Murphy <robin.murphy@arm.com>
Tested-by: Jon Medhurst <tixy@linaro.org>
Acked-by: Jon Medhurst <tixy@linaro.org>
Tested-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
7 years agodrm/i2c: tda998x: avoid race when programming audio
Russell King [Wed, 2 Nov 2016 21:38:34 +0000 (21:38 +0000)]
drm/i2c: tda998x: avoid race when programming audio

Avoid a race between programming audio and an in-progress mode set.
A mode set is complex, and disables the ability to send infoframes
to the sink, and is disruptive to audio - we have to mute the audio
FIFO while doing a mode set.

If an attempt is made to start up the audio side, we will undo the
audio FIFO mute before the mode set has completed.

Move the lock so that we prevent audio interfering with an in-progress
mode set.

Tested-by: Jon Medhurst <tixy@linaro.org>
Acked-by: Jon Medhurst <tixy@linaro.org>
Tested-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
7 years agodrm/i2c: tda998x: avoid racy access to mode clock
Russell King [Sun, 23 Oct 2016 10:32:43 +0000 (11:32 +0100)]
drm/i2c: tda998x: avoid racy access to mode clock

Avoid a racy access to the mode clock by storing the current mode clock
during a mode set under the audio mutex.  This allows us to access it
from the audio path in a safe way.

Tested-by: Jon Medhurst <tixy@linaro.org>
Acked-by: Jon Medhurst <tixy@linaro.org>
Tested-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
7 years agodrm/i2c: tda998x: avoid race in tda998x_encoder_mode_set()
Russell King [Sun, 23 Oct 2016 10:31:44 +0000 (11:31 +0100)]
drm/i2c: tda998x: avoid race in tda998x_encoder_mode_set()

As priv->audio_params can now be changed at run time, we need to be more
careful about how we deal with a mode set.  We must take the audio lock
while checking if there's a valid audio configuration.

However, it's slightly worse than that - during mode set, we mute the
audio, and it must not be unmuted until we have finished the mode set.
It is possible that the audio side may start while a mode set is in
progress, so take the audio_mutex lock around the whole mode setting
procedure.

Tested-by: Jon Medhurst <tixy@linaro.org>
Acked-by: Jon Medhurst <tixy@linaro.org>
Tested-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
7 years agodrm/i2c: tda998x: move audio mutex initialisation
Russell King [Thu, 17 Nov 2016 23:55:00 +0000 (23:55 +0000)]
drm/i2c: tda998x: move audio mutex initialisation

We will need the audio mutex initialised in all cases, so lets move this
to be early, rather than only being initialised for the DT case.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
7 years agodrm/i915: don't leak global_timeline
Matthew Auld [Thu, 17 Nov 2016 21:04:11 +0000 (21:04 +0000)]
drm/i915: don't leak global_timeline

We need to clean up the global_timeline in i915_gem_load_cleanup.

v2: don't forget about the struct_mutex, and also WARN_ON if we have any
remaining timelines before purging the global_timeline.

v3: it might be a good idea to first remove the global_timeline...duh!

Fixes: 73cb97010d4f ("drm/i915: Combine seqno + tracking into a global timeline struct")
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: http://patchwork.freedesktop.org/patch/msgid/1479415087-13216-1-git-send-email-matthew.auld@intel.com
Link: http://patchwork.freedesktop.org/patch/msgid/20161117210411.14044-2-chris@chris-wilson.co.uk
7 years agodrm/i915: add i915_address_space_fini
Matthew Auld [Thu, 17 Nov 2016 21:04:10 +0000 (21:04 +0000)]
drm/i915: add i915_address_space_fini

We already have an i915_address_space_init, so for symmetry we should
also have a _fini, plus we already open code it twice. This then also
fixes a bug where we leak the timeline for the ggtt vm.

v2: don't forget about the struct_mutex for the ggtt path.

Fixes: 80b204bce8f2 ("drm/i915: Enable multiple timelines")
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: http://patchwork.freedesktop.org/patch/msgid/20161117210411.14044-1-chris@chris-wilson.co.uk
7 years agodrm/i915: Add a few more sanity checks for stolen handling
Chris Wilson [Thu, 17 Nov 2016 15:58:46 +0000 (15:58 +0000)]
drm/i915: Add a few more sanity checks for stolen handling

We should never be called via obj->ops->release() on anything other than
a fully formed stolen object, so raise that to an assert. In the process
tidy up a comment and variable no longer used outside of a conditional
BUG.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: http://patchwork.freedesktop.org/patch/msgid/20161117155846.4631-1-chris@chris-wilson.co.uk
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
7 years agodrm/i915: Waterproof verification of gen9 forcewake table ranges
Tvrtko Ursulin [Thu, 17 Nov 2016 13:13:55 +0000 (13:13 +0000)]
drm/i915: Waterproof verification of gen9 forcewake table ranges

We have to make sure there are no holes in the table in Gen9.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: http://patchwork.freedesktop.org/patch/msgid/1479388435-12062-1-git-send-email-tvrtko.ursulin@linux.intel.com
7 years agodrm/i915: Introduce enableddisabled helper
Tvrtko Ursulin [Thu, 17 Nov 2016 12:30:14 +0000 (12:30 +0000)]
drm/i915: Introduce enableddisabled helper

Similar to existing yesno and onoff and use it throughout the code.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1479385814-2358-2-git-send-email-tvrtko.ursulin@linux.intel.com
7 years agodrm/i915: Only dump possible panel fitter config for the platform
Tvrtko Ursulin [Thu, 17 Nov 2016 12:30:13 +0000 (12:30 +0000)]
drm/i915: Only dump possible panel fitter config for the platform

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
7 years agodrm/i915: Only dump scaler config where supported
Tvrtko Ursulin [Thu, 17 Nov 2016 12:30:12 +0000 (12:30 +0000)]
drm/i915: Only dump scaler config where supported

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
7 years agodrm/i915: Compact a few pipe config debug lines
Tvrtko Ursulin [Thu, 17 Nov 2016 12:30:11 +0000 (12:30 +0000)]
drm/i915: Compact a few pipe config debug lines

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
7 years agodrm/i915: Don't log pipe config kernel pointer and duplicated pipe name
Tvrtko Ursulin [Thu, 17 Nov 2016 12:30:10 +0000 (12:30 +0000)]
drm/i915: Don't log pipe config kernel pointer and duplicated pipe name

Kernel pointer does not sound like an useful thing to log and
pipe name is already contained in the crtc name.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
7 years agodrm/i915: Dump FDI config only where applicable
Tvrtko Ursulin [Thu, 17 Nov 2016 12:30:09 +0000 (12:30 +0000)]
drm/i915: Dump FDI config only where applicable

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
7 years agodrm/i915: Extract intel_link_m_n config printing into a helper
Tvrtko Ursulin [Thu, 17 Nov 2016 12:30:08 +0000 (12:30 +0000)]
drm/i915: Extract intel_link_m_n config printing into a helper

And also only dump DP config for crtcs with DP encoders.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
7 years agodrm/i915: Remove stolen object spam
Chris Wilson [Wed, 16 Nov 2016 12:26:18 +0000 (12:26 +0000)]
drm/i915: Remove stolen object spam

We don't spam the debug when we create a normal object, nor when we
allocate their pages. Yet we do for stolen objects, and since these are
quite frequently used (at least once per context), the resulting spam
floods the dmesg in CI.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
7 years agodrm/i915: Demote i915_gem_open() debugging from DRIVER to USER
Chris Wilson [Wed, 9 Nov 2016 10:45:07 +0000 (10:45 +0000)]
drm/i915: Demote i915_gem_open() debugging from DRIVER to USER

We use DRM_DEBUG() when reporting on user actions, to try and keep
intentional errors out of the CI dmesg. Demote the debug from
i915_gem_open() similarly so that it is only apparent with drm.debug & 1
like its brethren.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: http://patchwork.freedesktop.org/patch/msgid/20161109104507.21228-1-chris@chris-wilson.co.uk
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
7 years agodrm/i915: Make scaler updates less chatty
Tvrtko Ursulin [Thu, 17 Nov 2016 10:00:05 +0000 (10:00 +0000)]
drm/i915: Make scaler updates less chatty

It looks to me skl_update_scaler will already log interesting
debug messages when the state transitions or there is an error.

In this case it feels we can remove the two unconditional
debug messages which happen immediately before calling
skl_update_scaler. This way we get rid of the sole debug
message when switching virtual terminals for example.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1479376805-5087-1-git-send-email-tvrtko.ursulin@linux.intel.com
7 years agodrm/i915: Remove __I915__ magic macro
Tvrtko Ursulin [Wed, 16 Nov 2016 08:55:45 +0000 (08:55 +0000)]
drm/i915: Remove __I915__ magic macro

And at the same time introduce a static inline helper for
more type safety.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: http://patchwork.freedesktop.org/patch/msgid/1479286545-15020-2-git-send-email-tvrtko.ursulin@linux.intel.com
7 years agodrm/i915: Fix for_each_pipe argument in vlv_display_power_well_init
Tvrtko Ursulin [Wed, 16 Nov 2016 08:55:44 +0000 (08:55 +0000)]
drm/i915: Fix for_each_pipe argument in vlv_display_power_well_init

Macro takes dev_priv and not dev.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
7 years agodrm/i915: dev_priv cleanup in intel_display.c
Tvrtko Ursulin [Wed, 16 Nov 2016 12:32:42 +0000 (12:32 +0000)]
drm/i915: dev_priv cleanup in intel_display.c

v2: Rebase.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
7 years agodrm/i915: dev_priv cleanup in intel_pm.c
Tvrtko Ursulin [Wed, 16 Nov 2016 08:55:42 +0000 (08:55 +0000)]
drm/i915: dev_priv cleanup in intel_pm.c

Plus a trickle of function prototype changes.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
7 years agodrm/i915: dev_priv cleanup in intel_dp.c
Tvrtko Ursulin [Wed, 16 Nov 2016 08:55:41 +0000 (08:55 +0000)]
drm/i915: dev_priv cleanup in intel_dp.c

And as usual a little bit of cascaded function prototype changes.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
7 years agodrm/i915: Assorted INTEL_INFO(dev) cleanups
Tvrtko Ursulin [Wed, 16 Nov 2016 08:55:40 +0000 (08:55 +0000)]
drm/i915: Assorted INTEL_INFO(dev) cleanups

A bunch of source files with just a few instances of the
incorrect INTEL_INFO use.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
7 years agodrm/i915: dev_priv cleanup in i915_suspend.c
Tvrtko Ursulin [Wed, 16 Nov 2016 08:55:39 +0000 (08:55 +0000)]
drm/i915: dev_priv cleanup in i915_suspend.c

And a little bit of function prototype changes.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
7 years agodrm/i915: dev_priv cleanup in i915_irq.c
Tvrtko Ursulin [Wed, 16 Nov 2016 08:55:38 +0000 (08:55 +0000)]
drm/i915: dev_priv cleanup in i915_irq.c

And a little bit of function prototype changes.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
7 years agodrm/i915: dev_priv cleanup in i915_gpu_error.c
Tvrtko Ursulin [Wed, 16 Nov 2016 08:55:37 +0000 (08:55 +0000)]
drm/i915: dev_priv cleanup in i915_gpu_error.c

And a little bit of cascaded function prototype changes.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
7 years agodrm/i915: dev_priv cleanup in i915_gem_tiling.c
Tvrtko Ursulin [Wed, 16 Nov 2016 08:55:36 +0000 (08:55 +0000)]
drm/i915: dev_priv cleanup in i915_gem_tiling.c

And a little bit of cascaded function prototype changes.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
7 years agodrm/i915: dev_priv cleanup in i915_gem_stolen.c
Tvrtko Ursulin [Wed, 16 Nov 2016 08:55:35 +0000 (08:55 +0000)]
drm/i915: dev_priv cleanup in i915_gem_stolen.c

And a little bit of cascaded function prototype changes.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
7 years agodrm/i915: dev_priv cleanup in i915_gem_gtt.c
Tvrtko Ursulin [Wed, 16 Nov 2016 08:55:34 +0000 (08:55 +0000)]
drm/i915: dev_priv cleanup in i915_gem_gtt.c

Started with removing INTEL_INFO(dev) and cascaded into a quite
big trickle of function prototype changes. Still, I think it is
for the better.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
7 years agodrm/i915: Use dev_priv in INTEL_INFO in i915_gem_fence_reg.c
Tvrtko Ursulin [Wed, 16 Nov 2016 08:55:33 +0000 (08:55 +0000)]
drm/i915: Use dev_priv in INTEL_INFO in i915_gem_fence_reg.c

Plus a small cascade of function prototype changes.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
7 years agodrm/i915: Use dev_priv in INTEL_INFO in i915_gem_execbuffer.c
Tvrtko Ursulin [Wed, 16 Nov 2016 08:55:32 +0000 (08:55 +0000)]
drm/i915: Use dev_priv in INTEL_INFO in i915_gem_execbuffer.c

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
7 years agodrm/i915: dev_priv and a small cascade of cleanups in i915_gem.c
Tvrtko Ursulin [Wed, 16 Nov 2016 08:55:31 +0000 (08:55 +0000)]
drm/i915: dev_priv and a small cascade of cleanups in i915_gem.c

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
7 years agoMerge tag 'gvt-next-2016-11-17' of https://github.com/01org/gvt-linux into drm-intel...
Daniel Vetter [Thu, 17 Nov 2016 13:46:39 +0000 (14:46 +0100)]
Merge tag 'gvt-next-2016-11-17' of https://github.com/01org/gvt-linux into drm-intel-next-queued

From Zhenyu Wang:

gvt-next-2016-11-17

- Fix lock order issue found in guest stress test
- Fix several MMIO handlers to correct behavior
- Fix crash for vgpu execlist reset and memleak
- Fix a possible conflict for unresolved vfio mdev dependency
- other misc fixes

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
7 years agoMerge remote-tracking branch 'airlied/drm-next' into drm-intel-next-queued
Daniel Vetter [Thu, 17 Nov 2016 13:32:57 +0000 (14:32 +0100)]
Merge remote-tracking branch 'airlied/drm-next' into drm-intel-next-queued

Tvrtko needs

commit b3c11ac267d461d3d597967164ff7278a919a39f
Author: Eric Engestrom <eric@engestrom.ch>
Date:   Sat Nov 12 01:12:56 2016 +0000

    drm: move allocation out of drm_get_format_name()

to be able to apply his patches without conflicts.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
7 years agodrm/i915: Fix gen9 forcewake range table
Tvrtko Ursulin [Thu, 17 Nov 2016 09:02:43 +0000 (09:02 +0000)]
drm/i915: Fix gen9 forcewake range table

Commit 0dd356bb6ff5 ("drm/i915: Eliminate Gen9 special case")
accidentaly dropped a MMIO range between 0xc000 to 0xcfff out
of the blitter forcewake domain. Fix it.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Fixes: 0dd356bb6ff5 ("drm/i915: Eliminate Gen9 special case")
Reported-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: http://patchwork.freedesktop.org/patch/msgid/1479373363-16528-1-git-send-email-tvrtko.ursulin@linux.intel.com
7 years agodrm/i915/opregion: fill in the CADL from connector list, not DIDL
Jani Nikula [Wed, 16 Nov 2016 11:29:57 +0000 (13:29 +0200)]
drm/i915/opregion: fill in the CADL from connector list, not DIDL

This is essentially the same thing as duplicating DIDL now that the
connector list has the ACPI device IDs.

Cc: Peter Wu <peter@lekensteyn.nl>
Cc: Rainer Koenig <Rainer.Koenig@ts.fujitsu.com>
Cc: Jan-Marek Glogowski <glogow@fbihome.de>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
Cc: Paolo Stivanin <paolostivanin@fastmail.fm>
Tested-by: Rainer Koenig <Rainer.Koenig@ts.fujitsu.com>
Tested-by: Paolo Stivanin <paolostivanin@fastmail.fm>
Tested-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/ea0a052fa99a4cb56b559a815866434bcfef853d.1479295490.git.jani.nikula@intel.com
7 years agodrm/i915: make i915 the source of acpi device ids for _DOD
Jani Nikula [Wed, 16 Nov 2016 11:29:56 +0000 (13:29 +0200)]
drm/i915: make i915 the source of acpi device ids for _DOD

The graphics driver is supposed to define the DIDL, which are used for
_DOD, not the BIOS. Restore that behaviour.

This is basically a revert of

commit 3143751ff51a163b77f7efd389043e038f3e008e
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Mon Mar 29 15:12:16 2010 +0800

    drm/i915: set DIDL using the ACPI video output device _ADR method return.

which went out of its way to cater to a specific BIOS, setting up DIDL
based on _ADR method. Perhaps that approach worked on that specific
machine, but on the machines I checked the _ADR method invents the
device identifiers out of thin air if DIDL has not been set. The source
for _ADR is also supposed to be the DIDL set by the driver, not the
other way around.

With this, we'll also limit the number of outputs to what the driver
actually has.

A side effect of this change is that the DIDL, and by proxy CADL, will
be initialized in the order of the connector list. That, in turn, has
internal panels in front, ensuring they're included in the DIDL and CADL
lists. Hopefully this ensures the BIOS does not block backlight hotkey
events, thinking the internal panel is off.

v2: do not set ACPI_DEVICE_ID_SCHEME in the device id (Peter Wu)

v3: Rebase

Cc: Peter Wu <peter@lekensteyn.nl>
Cc: Rainer Koenig <Rainer.Koenig@ts.fujitsu.com>
Cc: Jan-Marek Glogowski <glogow@fbihome.de>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
Cc: Paolo Stivanin <paolostivanin@fastmail.fm>
Tested-by: Rainer Koenig <Rainer.Koenig@ts.fujitsu.com>
Tested-by: Paolo Stivanin <paolostivanin@fastmail.fm>
Tested-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
Reviewed-and-tested-by: Peter Wu <peter@lekensteyn.nl>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/9660d29cf310c17bbf4d58c0e09d5b047446e2d5.1479295490.git.jani.nikula@intel.com
7 years agodrm/i915: fix the dequeue logic for single_port_submission context
Min He [Wed, 16 Nov 2016 14:05:04 +0000 (22:05 +0800)]
drm/i915: fix the dequeue logic for single_port_submission context

For a single_port_submission context, GVT expects that it can only be
submitted to port 0, and there shouldn't be any other context in port 1
at the same time. This is required by GVT-g context to have an opportunity
to save/restore some non-hw context render registers.

This patch is to workaround GVT-g.

v2: optimized code by following Chris's advice, and added more comments to
explain the patch.
v3: followed the coding style.

Signed-off-by: Min He <min.he@intel.com>
Reviewed-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: http://patchwork.freedesktop.org/patch/msgid/1479305104-17049-1-git-send-email-min.he@intel.com
7 years agodrm/i915/gvt: remove unresolved vfio pin/unpin pages interface dependency
Zhenyu Wang [Thu, 17 Nov 2016 06:49:26 +0000 (14:49 +0800)]
drm/i915/gvt: remove unresolved vfio pin/unpin pages interface dependency

Instead of partially depending on vfio pin/unpin pages interface if
mdev is available, which would result in failure if vfio is not
on. But replace with a wrapper which need to be fixed till mdev
support got fully merged.

Cc: Jike Song <jike.song@intel.com>
Cc: Xiaoguang Chen <xiaoguang.chen@intel.com>
Reviewed-by: Xiaoguang Chen <Xiaoguang.chen@intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
7 years agoMAINTAINERS: Update HISILICON DRM entries
Rongrong Zou [Wed, 16 Nov 2016 12:58:51 +0000 (20:58 +0800)]
MAINTAINERS: Update HISILICON DRM entries

Signed-off-by: Rongrong Zou <zourongrong@gmail.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Xinliang Liu <xinliang.liu@linaro.org>
Acked-by: Sean Paul <seanpaul@chromium.org>
7 years agodrm/hisilicon/hibmc: Add support for vblank interrupt
Rongrong Zou [Wed, 16 Nov 2016 12:57:01 +0000 (20:57 +0800)]
drm/hisilicon/hibmc: Add support for vblank interrupt

Add vblank interrupt.

Signed-off-by: Rongrong Zou <zourongrong@gmail.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Xinliang Liu <xinliang.liu@linaro.org>
Acked-by: Sean Paul <seanpaul@chromium.org>
7 years agodrm/hisilicon/hibmc: Add support for VDAC
Rongrong Zou [Wed, 16 Nov 2016 12:55:55 +0000 (20:55 +0800)]
drm/hisilicon/hibmc: Add support for VDAC

VDAC(Video Digital-to-Analog converter) converts the RGB diaital data
stream from DE to VGA analog signals.

Signed-off-by: Rongrong Zou <zourongrong@gmail.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Xinliang Liu <xinliang.liu@linaro.org>
Acked-by: Sean Paul <seanpaul@chromium.org>
7 years agodrm/hisilicon/hibmc: Add support for display engine
Rongrong Zou [Wed, 16 Nov 2016 12:54:52 +0000 (20:54 +0800)]
drm/hisilicon/hibmc: Add support for display engine

Add display engine function, crtc/plane is initialized here.

Signed-off-by: Rongrong Zou <zourongrong@gmail.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Xinliang Liu <xinliang.liu@linaro.org>
Acked-by: Sean Paul <seanpaul@chromium.org>
7 years agodrm/hisilicon/hibmc: Add support for frame buffer
Rongrong Zou [Wed, 16 Nov 2016 12:52:37 +0000 (20:52 +0800)]
drm/hisilicon/hibmc: Add support for frame buffer

Add support for fbdev and kms fb management.

Signed-off-by: Rongrong Zou <zourongrong@gmail.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Xinliang Liu <xinliang.liu@linaro.org>
Acked-by: Sean Paul <seanpaul@chromium.org>
7 years agodrm/hisilicon/hibmc: Add video memory management
Rongrong Zou [Wed, 16 Nov 2016 13:31:51 +0000 (21:31 +0800)]
drm/hisilicon/hibmc: Add video memory management

Hibmc have 32m video memory which can be accessed through PCIe by host,
we use ttm to manage these memory.

Signed-off-by: Rongrong Zou <zourongrong@gmail.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Xinliang Liu <xinliang.liu@linaro.org>
Acked-by: Sean Paul <seanpaul@chromium.org>
7 years agodrm/hisilicon/hibmc: Add hisilicon hibmc drm master driver
Rongrong Zou [Wed, 16 Nov 2016 09:15:34 +0000 (17:15 +0800)]
drm/hisilicon/hibmc: Add hisilicon hibmc drm master driver

Add DRM master driver for Hisilicon Hibmc SoC which used for
Out-of-band management. Blow is the general hardware connection,
both the Hibmc and the host CPU are on the same mother board.

+----------+       +----------+
|          | PCIe  |  Hibmc   |
|host CPU( |<----->| display  |
|arm64,x86)|       |subsystem |
+----------+       +----------+

Signed-off-by: Rongrong Zou <zourongrong@gmail.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Xinliang Liu <xinliang.liu@linaro.org>
Acked-by: Sean Paul <seanpaul@chromium.org>
7 years agodrm/i915/gvt: drop checks for early Skylake revisions
Jani Nikula [Wed, 16 Nov 2016 10:13:59 +0000 (12:13 +0200)]
drm/i915/gvt: drop checks for early Skylake revisions

We no longer cater for pre-production revisions of Skylake.

Fixes: d4362225e8cb ("drm/i915/gvt: update misc ctl regs base on stepping info")
Cc: Ping Gao <ping.a.gao@intel.com>
Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
Cc: Zhi Wang <zhi.a.wang@intel.com>
Cc: <intel-gfx@lists.freedesktop.org>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
7 years agoMerge branch 'linux-4.10' of git://github.com/skeggsb/linux into drm-next
Dave Airlie [Thu, 17 Nov 2016 00:08:29 +0000 (10:08 +1000)]
Merge branch 'linux-4.10' of git://github.com/skeggsb/linux into drm-next

- GP102/GP104 devinit (suspend/resume, optimus) hang fix
- GP102/GP104 hardware cursor fix
- Fix for a regression on some non-MST monitors that was caused by the
MST work
- Workaround for certain laptops where ACPI sends display hotkey presses
on a modeset, causing gnome-settings-daemon to go into a continuous loop

* 'linux-4.10' of git://github.com/skeggsb/linux:
  drm/nouveau/disp/gp102: rename from gp104
  drm/nouveau/ce/gp102: rename from gp104
  drm/nouveau/fb/gp102: rename from gp104
  drm/nouveau/disp/gp102: fix cursor/overlay immediate channel indices
  drm/nouveau/disp/nv50-: specify ctrl/user separately when constructing classes
  drm/nouveau/disp/nv50-: split chid into chid.ctrl and chid.user
  drm/nouveau: Intercept ACPI_VIDEO_NOTIFY_PROBE
  drm/nouveau/devinit/gm200: drop pmu reset sequence
  drm/nouveau/devinit/gm200: replace while loops with PTIMER-based timeout loops
  drm/nouveau/pmu/gp102: initial implementation
  drm/nouveau/pmu/gp100: initial implementation
  drm/nouveau/pmu: execute reset before running devinit
  drm/nouveau/pmu: move ucode handling into gt215 implementation
  drm/nouveau/core: initial support for GP102
  drm/nouveau/device/pci: fix oops if no mmu subdev present
  drm/nouveau/kms/nv50: avoid touching DP_MSTM_CTRL if !DP_MST_CAP

7 years agodrm/armada: fix NULL pointer comparison warning
Ravikant B Sharma [Tue, 8 Nov 2016 06:00:09 +0000 (11:30 +0530)]
drm/armada: fix NULL pointer comparison warning

Replace direct comparisons to NULL i.e.
'x == NULL' with '!x'. As per coding standard.

Signed-off-by: Ravikant B Sharma <ravikant.s2@samsung.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
7 years agodrm/armada: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops
Stefan Christ [Sun, 13 Nov 2016 23:03:14 +0000 (00:03 +0100)]
drm/armada: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops

Signed-off-by: Stefan Christ <contact@stefanchrist.eu>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
7 years agodrm/armada: remove some dead code
Christophe JAILLET [Sun, 30 Oct 2016 15:38:42 +0000 (16:38 +0100)]
drm/armada: remove some dead code

'dma_buf_map_attachment()' can not return NULL, so there is no need to
check for it.

Also add a space in order to improve layout.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
7 years agodrm/armada: mark symbols static where possible
Baoyou Xie [Sat, 22 Oct 2016 09:03:58 +0000 (17:03 +0800)]
drm/armada: mark symbols static where possible

We get 2 warnings when building kernel with W=1:
drivers/gpu/drm/armada/armada_gem.c:215:27: warning: no previous prototype for 'armada_gem_alloc_object' [-Wmissing-prototypes]
drivers/gpu/drm/armada/armada_gem.c:423:1: warning: no previous prototype for 'armada_gem_prime_map_dma_buf' [-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 these functions with 'static'.

Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
7 years agodrm/armada: de-midlayer armada
Russell King [Tue, 1 Nov 2016 20:05:47 +0000 (20:05 +0000)]
drm/armada: de-midlayer armada

Now that the drm_connector_register() is gone from tda998x, we can
remove the mid-layer from armada-drm, eliminating the load, unload,
debugfs_init, and debugfs_cleanup callbacks from armada's drm_driver
structure.  No functional changes.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
7 years agodrm/nouveau/disp/gp102: rename from gp104
Ben Skeggs [Wed, 16 Nov 2016 05:03:07 +0000 (15:03 +1000)]
drm/nouveau/disp/gp102: rename from gp104

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/ce/gp102: rename from gp104
Ben Skeggs [Wed, 16 Nov 2016 05:01:37 +0000 (15:01 +1000)]
drm/nouveau/ce/gp102: rename from gp104

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/fb/gp102: rename from gp104
Ben Skeggs [Wed, 16 Nov 2016 04:59:49 +0000 (14:59 +1000)]
drm/nouveau/fb/gp102: rename from gp104

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/disp/gp102: fix cursor/overlay immediate channel indices
Ben Skeggs [Wed, 16 Nov 2016 04:53:08 +0000 (14:53 +1000)]
drm/nouveau/disp/gp102: fix cursor/overlay immediate channel indices

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/disp/nv50-: specify ctrl/user separately when constructing classes
Ben Skeggs [Wed, 16 Nov 2016 04:49:35 +0000 (14:49 +1000)]
drm/nouveau/disp/nv50-: specify ctrl/user separately when constructing classes

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/disp/nv50-: split chid into chid.ctrl and chid.user
Ben Skeggs [Wed, 16 Nov 2016 04:38:44 +0000 (14:38 +1000)]
drm/nouveau/disp/nv50-: split chid into chid.ctrl and chid.user

GP102/GP104 make life difficult by redefining the channel indices for
some registers, but not others.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau: Intercept ACPI_VIDEO_NOTIFY_PROBE
Hans de Goede [Wed, 9 Nov 2016 17:17:44 +0000 (18:17 +0100)]
drm/nouveau: Intercept ACPI_VIDEO_NOTIFY_PROBE

Various notebooks with nvidia GPUs generate an ACPI_VIDEO_NOTIFY_PROBE
acpi-video event when an external device gets plugged in (and again on
modesets on that connector), the default behavior in the acpi-video
driver for this is to send a KEY_SWITCHVIDEOMODE evdev event, which
causes e.g. gnome-settings-daemon to ask us to rescan the connectors
(good), but also causes g-s-d to switch to mirror mode on a newly plugged
monitor rather then using the monitor to extend the desktop (bad)
as KEY_SWITCHVIDEOMODE is supposed to switch between extend the desktop
vs mirror mode.

More troublesome are the repeated ACPI_VIDEO_NOTIFY_PROBE events on
changing the mode on the connector, which cause g-s-d to switch
between mirror/extend mode, which causes a new ACPI_VIDEO_NOTIFY_PROBE
event and we end up with an endless loop.

This commit fixes this by adding an acpi notifier block handler to
nouveau_display.c to intercept ACPI_VIDEO_NOTIFY_PROBE and:

1) Wake-up runtime suspended GPUs and call drm_helper_hpd_irq_event()
   on them, this is necessary in some cases for the GPU to detect connector
   hotplug events while runtime suspended
2) Return NOTIFY_BAD to stop acpi-video from emitting a bogus
   KEY_SWITCHVIDEOMODE key-press event

There already is another acpi notifier block handler registered in
drivers/gpu/drm/nouveau/nvkm/engine/device/acpi.c, but that is not
suitable since that one gets unregistered on runtime suspend, and
we also want to intercept ACPI_VIDEO_NOTIFY_PROBE when runtime suspended.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
7 years agodrm/nouveau/devinit/gm200: drop pmu reset sequence
Ben Skeggs [Wed, 9 Nov 2016 00:42:47 +0000 (10:42 +1000)]
drm/nouveau/devinit/gm200: drop pmu reset sequence

This sequence is incorrect for GP102/GP104 boards.  This is now being
handled correctly by the PMU subdev during preinit();

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/devinit/gm200: replace while loops with PTIMER-based timeout loops
Ben Skeggs [Tue, 8 Nov 2016 01:54:24 +0000 (11:54 +1000)]
drm/nouveau/devinit/gm200: replace while loops with PTIMER-based timeout loops

It appears to be safe to access PTIMER on an unposted board with newer
chipsets.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/pmu/gp102: initial implementation
Ben Skeggs [Wed, 9 Nov 2016 00:41:43 +0000 (10:41 +1000)]
drm/nouveau/pmu/gp102: initial implementation

GP102/GP104 require a harder reset of PMU prior to DEVINIT, or the IFR
image will hang.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/pmu/gp100: initial implementation
Ben Skeggs [Wed, 9 Nov 2016 00:37:56 +0000 (10:37 +1000)]
drm/nouveau/pmu/gp100: initial implementation

Just enough to hookup preinit reset(), which DEVINIT will depend on later.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/pmu: execute reset before running devinit
Ben Skeggs [Wed, 9 Nov 2016 00:39:08 +0000 (10:39 +1000)]
drm/nouveau/pmu: execute reset before running devinit

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/pmu: move ucode handling into gt215 implementation
Ben Skeggs [Wed, 9 Nov 2016 00:23:55 +0000 (10:23 +1000)]
drm/nouveau/pmu: move ucode handling into gt215 implementation

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/core: initial support for GP102
Ben Skeggs [Mon, 7 Nov 2016 07:38:43 +0000 (17:38 +1000)]
drm/nouveau/core: initial support for GP102

From visual inspection of traces, what we currently implement appears to
be identical to GP104.  Seems to work well enough too.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/device/pci: fix oops if no mmu subdev present
Ben Skeggs [Mon, 7 Nov 2016 23:43:50 +0000 (09:43 +1000)]
drm/nouveau/device/pci: fix oops if no mmu subdev present

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/kms/nv50: avoid touching DP_MSTM_CTRL if !DP_MST_CAP
Ben Skeggs [Mon, 7 Nov 2016 04:51:53 +0000 (14:51 +1000)]
drm/nouveau/kms/nv50: avoid touching DP_MSTM_CTRL if !DP_MST_CAP

Fixes certain displays not being detected due to DPAUX errors.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agoMerge tag 'drm-vc4-next-2016-11-16' of https://github.com/anholt/linux into drm-next
Dave Airlie [Wed, 16 Nov 2016 23:43:56 +0000 (09:43 +1000)]
Merge tag 'drm-vc4-next-2016-11-16' of https://github.com/anholt/linux into drm-next

This pull request brings in fragment shader threading and ETC1 support
for vc4.

7 years agoMerge branch 'drm-tda998x-mali' of git://git.armlinux.org.uk/~rmk/linux-arm into...
Dave Airlie [Wed, 16 Nov 2016 22:55:26 +0000 (08:55 +1000)]
Merge branch 'drm-tda998x-mali' of git://git.armlinux.org.uk/~rmk/linux-arm into drm-next

Fix conncector registration with tda998x.

* 'drm-tda998x-mali' of git://git.armlinux.org.uk/~rmk/linux-arm:
  drm/i2c: tda998x: mali-dp: hdlcd: refactor connector registration