platform/kernel/linux-amlogic.git
8 years agoMerge branch 'exynos-drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/daein...
Dave Airlie [Wed, 4 May 2016 07:37:20 +0000 (17:37 +1000)]
Merge branch 'exynos-drm-next' of git://git./linux/kernel/git/daeinki/drm-exynos into drm-next

Summary:
 - Support for pipeline clock between KMS drivers.
   . Exynos SoC is required to control clocks across KMS drivers
     according to Exynos SoC version. So this patch refactos
     some relevant codes and provides generic solution for it.
 - Add Exynos5433 SoC support to HDMI parts - HDMI and DECON-TV.
 - Add HW trigger mode support to CRTC drivers.
   . In case of using i80 Panel, some Exynos SoC supports HW trigger
     mode so this patch makes trigger mode - HW or SW trigger - to be
     set according to SoC version properly.
 - And some cleanups and regression fixups.

* 'exynos-drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos: (39 commits)
  drm/exynos: clean up register definions for fimd and decon
  drm/exynos: decon: clean up interface type
  drm/exynos: fimd: add HW trigger support
  drm/exynos: clean up wait_for_vblank
  drm/exynos: mixer: use generic of_device_get_match_data helper
  drm/exynos: mixer: remove support for non-dt platforms
  drm/exynos: hdmi: use generic of_device_get_match_data helper
  drm/exynos: rotator: use generic of_device_get_match_data helper
  drm/exynos: fimd: use generic of_device_get_match_data helper
  drm/exynos: dsi: use generic of_device_get_match_data helper
  drm/exynos: exynos5433_decon: use generic of_device_get_match_data helper
  drm/exynos: convert clock_enable crtc callback to pipeline clock
  drm/exynos/mixer: enable HDMI-PHY before configuring MIXER
  drm/exynos/decon5433: enable HDMI-PHY before configuring DECON
  drm/exynos: add support for pipeline clock to the framework
  drm/exynos: add helper to get crtc from pipe
  drm/exynos/decon5433: do not protect window in plane disable
  drm/exynos/decon5433: reset decon on start
  drm/exynos/decon5433: fix DECON standalone update
  drm/exynos/hdmi: remove registry dump
  ...

8 years agoMerge tag 'drm-vc4-next-2016-05-02' of https://github.com/anholt/linux into drm-next
Dave Airlie [Wed, 4 May 2016 07:30:53 +0000 (17:30 +1000)]
Merge tag 'drm-vc4-next-2016-05-02' of https://github.com/anholt/linux into drm-next

This pull request brings in DPI panel support, gamma ramp support, and
render nodes for vc4.

* tag 'drm-vc4-next-2016-05-02' of https://github.com/anholt/linux:
  drm/vc4: Add missing render node support
  drm/vc4: Add support for gamma ramps.
  drm/vc4: Fix NULL deref in HDMI init error path
  drm/vc4: Add DPI driver
  drm: Add an encoder and connector type enum for DPI.

8 years agoMerge tag 'topic/drm-misc-2016-04-29' of git://anongit.freedesktop.org/drm-intel...
Dave Airlie [Wed, 4 May 2016 07:28:09 +0000 (17:28 +1000)]
Merge tag 'topic/drm-misc-2016-04-29' of git://anongit.freedesktop.org/drm-intel into drm-next

- prep work for struct_mutex-less gem_free_object
- more invasive/tricky mst fixes from Lyude for broken hw. I discussed
  this with Ville/Jani and we all agreed more soaking in -next would be
  real good this late in the -rc cycle. They're cc: stable too to make
  sure they're not getting lost. Feel free to cherry-pick those four if
  you disagree.
- few small things all over

* tag 'topic/drm-misc-2016-04-29' of git://anongit.freedesktop.org/drm-intel:
  drm/atomic: Add missing drm_crtc_internal.h include
  drm/dp: Allow signals to interrupt drm_aux-dev reads/writes
  drm: Quiet down drm_mode_getresources
  drm: Quiet down drm_mode_getconnector
  drm: Protect dev->filelist with its own mutex
  drm: Make drm_vm_open/close_locked private to drm_vm.c
  drm: Hide master MAP cleanup in drm_bufs.c
  drm: Forbid legacy MAP functions for DRIVER_MODESET
  drm: Push struct_mutex into ->master_destroy
  drm: Move drm_getmap into drm_bufs.c and give it a legacy prefix
  drm: Put legacy lastclose work into drm_legacy_dev_reinit
  drm: Give drm_agp_clear drm_legacy_ prefix
  drm/sysfs: Annote lockless show functions with READ_ONCE
  MAINTAINERS: Update the files list for the GMA500 DRM driver
  drm: rcar-du: Fix compilation warning
  drm/i915: Get rid of intel_dp_dpcd_read_wake()
  drm/dp_helper: Perform throw-away read before actual read in drm_dp_dpcd_read()
  drm/dp_helper: Retry aux transactions on all errors
  drm/dp_helper: Always wait before retrying native aux transactions

8 years agoMerge tag 'drm-intel-next-2016-04-25' of git://anongit.freedesktop.org/drm-intel...
Dave Airlie [Wed, 4 May 2016 07:25:30 +0000 (17:25 +1000)]
Merge tag 'drm-intel-next-2016-04-25' of git://anongit.freedesktop.org/drm-intel into drm-next

- more userptr cornercase fixes from Chris
- clean up and tune forcewake handling (Tvrtko)
- more underrun fixes from Ville, mostly for ilk to appeas CI
- fix unclaimed register warnings on vlv/chv and enable the debug code to catch
  them by default (Ville)
- skl gpu hang fixes for gt3/4 (Mika Kuoppala)
- edram improvements for gen9+ (Mika again)
- clean up gpu reset corner cases (Chris)
- fix ctx/ring machine deaths on snb/ilk (Chris)
- MOCS programming for all engines (Peter Antoine)
- robustify/clean up vlv/chv irq handler (Ville)
- split gen8+ irq handlers into ack/handle phase (Ville)
- tons of bxt rpm fixes (mostly around firmware interactions), from Imre
- hook up panel fitting for dsi panels (Ville)
- more runtime PM fixes all over from Imre
- shrinker polish (Chris)
- more guc fixes from Alex Dai and Dave Gordon
- tons of bugfixes and small polish all over (but with a big focus on bxt)

* tag 'drm-intel-next-2016-04-25' of git://anongit.freedesktop.org/drm-intel: (142 commits)
  drm/i915: Update DRIVER_DATE to 20160425
  drm/i915/bxt: Explicitly clear the Turbo control register
  drm/i915: Correct the i915_frequency_info debugfs output
  drm/i915: Macros to convert PM time interval values to microseconds
  drm/i915: Make RPS EI/thresholds multiple of 25 on SNB-BDW
  drm/i915: Fake HDMI live status
  drm/i915/bxt: Force reprogramming a PHY with invalid HW state
  drm/i915/bxt: Wait for PHY1 GRC done if PHY0 was already enabled
  drm/i915/bxt: Use PHY0 GRC value for HW state verification
  drm/i915: use dev_priv directly in gen8_ppgtt_notify_vgt
  drm/i915/bxt: Enable DC5 during runtime resume
  drm/i915/bxt: Sanitize DC state tracking during system resume
  drm/i915/bxt: Don't uninit/init display core twice during system suspend/resume
  drm/i915: Inline intel_suspend_complete
  drm/i915/kbl: Don't WARN for expected secondary MISC IO power well request
  drm/i915: Fix eDP low vswing for Broadwell
  drm/i915: check for ERR_PTR from i915_gem_object_pin_map()
  drm/i915/guc: local optimisations and updating comments
  drm/i915/guc: drop cached copy of 'wq_head'
  drm/i915/guc: keep GuC doorbell & process descriptor mapped in kernel
  ...

8 years agodrm/vc4: Add missing render node support
Eric Anholt [Fri, 15 Apr 2016 06:16:05 +0000 (23:16 -0700)]
drm/vc4: Add missing render node support

There shouldn't be any other driver support necessary, since none of
the driver-specific ioctls ever required auth, and none of them deal
with modesetting.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agodrm/vc4: Add support for gamma ramps.
Eric Anholt [Fri, 1 Apr 2016 01:38:20 +0000 (18:38 -0700)]
drm/vc4: Add support for gamma ramps.

We could possibly save a bit of power by not requesting gamma
conversion when the ramp happens to be 1:1, but at least if all the
CRTCs are off the SRAM will be disabled.

This should fix brightness sliders in a lot of fullscreen games.

Signed-off-by: Eric Anholt <eric@anholt.net>
8 years agodrm/exynos: clean up register definions for fimd and decon
Inki Dae [Tue, 12 Apr 2016 00:59:11 +0000 (09:59 +0900)]
drm/exynos: clean up register definions for fimd and decon

This patch removes suffixes from I80 relevant register definitions,
which are misleading.

This is based on top of below patch set,
     http://www.spinics.net/lists/dri-devel/msg104057.html

Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm/exynos: decon: clean up interface type
Inki Dae [Mon, 18 Apr 2016 08:59:01 +0000 (17:59 +0900)]
drm/exynos: decon: clean up interface type

This patch cleans up interface type relevant codes.

Trigger mode is determinded only by i80 mode, which isn't
related to Display types - HDMI or Display controller.
So this patch makes the trigger mode to be set only in case of
i80 mode - For DECON-TV, HW Trigger mode is flaged mandatorily
because HDMI Timing Generator generates VSYNC signal
which works as a hardware trigger.

Changelog v2.
- If interface type is HDMI then set out_type to I80.
- fix compile warning.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm/exynos: fimd: add HW trigger support
Inki Dae [Mon, 18 Apr 2016 08:54:39 +0000 (17:54 +0900)]
drm/exynos: fimd: add HW trigger support

This patch adds HW trigger support on i80 mode.

Until now, Exynos DRM only supported SW trigger which was set
SWTRGCMD bit of TRIGCON register by CPU to transfer scanout
buffer to Display bus device or panel.

With this patch, the transmission to Display bus device or
panel will be initiated by FIMD controller.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm/exynos: clean up wait_for_vblank
Inki Dae [Tue, 5 Apr 2016 08:27:42 +0000 (17:27 +0900)]
drm/exynos: clean up wait_for_vblank

This patch cleans up wait_for_vblank relevant codes.
wait_for_vblank callback isn't used anymore in Exynos drm driver
so it removes relevant codes. However, display controllers -
FIMD and DECON - still use this function driver internally
to ensure shadow registers to be updated, which resolves
page fault issue so keep it.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm/exynos: mixer: use generic of_device_get_match_data helper
Marek Szyprowski [Fri, 1 Apr 2016 13:17:46 +0000 (15:17 +0200)]
drm/exynos: mixer: use generic of_device_get_match_data helper

Simplify code by replacing custom code by generic helper.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm/exynos: mixer: remove support for non-dt platforms
Marek Szyprowski [Fri, 1 Apr 2016 13:17:45 +0000 (15:17 +0200)]
drm/exynos: mixer: remove support for non-dt platforms

There are no non-devicetree based Exynos platforms in mainline, so there
no point keeping old platform driver data for them.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm/exynos: hdmi: use generic of_device_get_match_data helper
Marek Szyprowski [Fri, 1 Apr 2016 13:17:44 +0000 (15:17 +0200)]
drm/exynos: hdmi: use generic of_device_get_match_data helper

Simplify code by replacing custom code by generic helper.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm/exynos: rotator: use generic of_device_get_match_data helper
Marek Szyprowski [Fri, 1 Apr 2016 13:17:43 +0000 (15:17 +0200)]
drm/exynos: rotator: use generic of_device_get_match_data helper

Simplify code by replacing custom code by generic helper.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm/exynos: fimd: use generic of_device_get_match_data helper
Marek Szyprowski [Mon, 18 Apr 2016 08:38:27 +0000 (17:38 +0900)]
drm/exynos: fimd: use generic of_device_get_match_data helper

Simplify code by replacing custom code by generic helper.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm/exynos: dsi: use generic of_device_get_match_data helper
Marek Szyprowski [Tue, 19 Apr 2016 07:37:10 +0000 (09:37 +0200)]
drm/exynos: dsi: use generic of_device_get_match_data helper

Simplify code by replacing custom code by generic helper and add missing
const qualifier to driver data structures.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm/exynos: exynos5433_decon: use generic of_device_get_match_data helper
Marek Szyprowski [Fri, 1 Apr 2016 13:17:40 +0000 (15:17 +0200)]
drm/exynos: exynos5433_decon: use generic of_device_get_match_data helper

Simplify code by replacing custom code by generic helper.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm/exynos: convert clock_enable crtc callback to pipeline clock
Andrzej Hajda [Fri, 29 Apr 2016 16:39:08 +0000 (01:39 +0900)]
drm/exynos: convert clock_enable crtc callback to pipeline clock

clock_enable callback is used only by FIMD->DP pipeline. Similar but more
universal functionality provides pipeline clock.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <daeinki@gmail.com>
8 years agodrm/exynos/mixer: enable HDMI-PHY before configuring MIXER
Andrzej Hajda [Wed, 23 Mar 2016 13:26:01 +0000 (14:26 +0100)]
drm/exynos/mixer: enable HDMI-PHY before configuring MIXER

According to documentation HDMI-PHY must be on prior to MIXER configuration.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm/exynos/decon5433: enable HDMI-PHY before configuring DECON
Andrzej Hajda [Wed, 23 Mar 2016 13:26:00 +0000 (14:26 +0100)]
drm/exynos/decon5433: enable HDMI-PHY before configuring DECON

According to documentation and tests HDMI-PHY must be on prior
to MIXER configuration.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
8 years agodrm/exynos: add support for pipeline clock to the framework
Andrzej Hajda [Wed, 23 Mar 2016 13:25:58 +0000 (14:25 +0100)]
drm/exynos: add support for pipeline clock to the framework

Components belonging to the same pipeline often requires
synchronized clocks. Such clocks are sometimes provided
by external clock controller, but they can be also provided by
pipeline components. In latter case there should be a way
to access them from another component belonging to the same pipeline.
This is the case of:
- DECON,FIMD -> HDMI and HDMI-PHY clock,
- FIMD -> DP and DP clock in FIMD.
The latter case has been solved by clock_enable callback
in exynos_drm_crtc_ops. This solutin will not work with
HDMI path as in this case clock is provided by encoder.

This patch provides more generic solution allowing to register
pipeline clock during initialization in exynos_drm_crtc structure.
This way the clock will be easily accessible from both components.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm/exynos: add helper to get crtc from pipe
Andrzej Hajda [Wed, 23 Mar 2016 13:25:57 +0000 (14:25 +0100)]
drm/exynos: add helper to get crtc from pipe

The helper abstracts out conversion from pipeline
to crtc. Currently it is used in two places, but
there will be more uses in next patches.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm/exynos/decon5433: do not protect window in plane disable
Andrzej Hajda [Wed, 23 Mar 2016 13:15:18 +0000 (14:15 +0100)]
drm/exynos/decon5433: do not protect window in plane disable

decon_atomic_begin and decon_atomic_flush protects all windows already.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm/exynos/decon5433: reset decon on start
Andrzej Hajda [Wed, 23 Mar 2016 13:15:17 +0000 (14:15 +0100)]
drm/exynos/decon5433: reset decon on start

Resetting IP at starting ensures that DECON will be in known state
regardless of changes by bootloader.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm/exynos/decon5433: fix DECON standalone update
Andrzej Hajda [Wed, 23 Mar 2016 13:15:16 +0000 (14:15 +0100)]
drm/exynos/decon5433: fix DECON standalone update

DECON should be updated after un-protecting windows and after changing
output parameters, otherwise image is not displayed in case of HDMI path.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm/exynos/hdmi: remove registry dump
Andrzej Hajda [Wed, 23 Mar 2016 13:15:15 +0000 (14:15 +0100)]
drm/exynos/hdmi: remove registry dump

HDMI registry dump unnecessary spoils console and is not very helpful.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm/exynos/hdmi: add core reset code
Andrzej Hajda [Wed, 23 Mar 2016 13:15:14 +0000 (14:15 +0100)]
drm/exynos/hdmi: add core reset code

To ensure HDMI-PHY reprogramming will not affect
HDMI the latter should be reset.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm/exynos/hdmi: add PHY power off signal handling
Andrzej Hajda [Wed, 23 Mar 2016 13:15:13 +0000 (14:15 +0100)]
drm/exynos/hdmi: add PHY power off signal handling

HDMI-PHY power off bit defaults to 0 in older HDMI versions.
In case of Exynos5433 it defaults to 1. To make code
consistent across all versions this bit is always unset/set in
power on/off sequences.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm/exynos/hdmi: fix PHY configuration sequence
Andrzej Hajda [Wed, 23 Mar 2016 13:15:12 +0000 (14:15 +0100)]
drm/exynos/hdmi: fix PHY configuration sequence

Proper PHY configuration should be as follow:
1. set HDMI clock parents to OSCCLK.
2. reconfigure PHY.
3. set HDMI clock parents to PHY.
4. wait for PLL stabilization.

The patch fixes it and consolidates the code.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodt-bindings: video: exynos5433-decon: add bindings for DECON-TV
Andrzej Hajda [Mon, 26 Oct 2015 11:59:56 +0000 (12:59 +0100)]
dt-bindings: video: exynos5433-decon: add bindings for DECON-TV

DECON-TV(Display and Enhancement Controller for TV) is a variation
of DECON IP. Its main purpose is to produce video stream for HDMI IP.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodt-bindings: video: add PCLK clock entry to exynos5433-decon
Andrzej Hajda [Tue, 20 Oct 2015 09:22:35 +0000 (11:22 +0200)]
dt-bindings: video: add PCLK clock entry to exynos5433-decon

DECON IP requires this clock to access configuration registers.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm/exynos/hdmi: add Exynos5433 support
Andrzej Hajda [Thu, 14 Jan 2016 05:40:07 +0000 (14:40 +0900)]
drm/exynos/hdmi: add Exynos5433 support

HDMI on Exynos5433 differs from previous versions:
- different HDMI-PHY settings,
- different clocks,
- SYSREG registers for enabling reference clock,
- MODE_SET register in HDMI-PHY.
It is distinguished from other variants by different compatible string.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodt-bindings: exynos_hdmi: add bindings for Exynos5433 variant
Andrzej Hajda [Thu, 24 Mar 2016 01:36:28 +0000 (10:36 +0900)]
dt-bindings: exynos_hdmi: add bindings for Exynos5433 variant

Exynos5433 variant of HDMI requires different set of clocks and sysreg
phandle to system registers.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm/exynos/hdmi: stop programming registers with default values
Andrzej Hajda [Mon, 2 Nov 2015 13:16:43 +0000 (14:16 +0100)]
drm/exynos/hdmi: stop programming registers with default values

There is no point in rewriting default values, as the IP is reset anyway.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm/exynos/hdmi: code cleanup
Andrzej Hajda [Thu, 14 Jan 2016 05:28:20 +0000 (14:28 +0900)]
drm/exynos/hdmi: code cleanup

The patch performs following clean-ups:
- remove unnecessary white spaces,
- remove obvious comments,
- fix tabulations,
- remove NULL initializators,
- re-order driver data.

The patch does not change driver's behavior.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm/exynos/hdmi: use array specifier for HDMI-PHY configurations
Andrzej Hajda [Mon, 2 Nov 2015 13:16:41 +0000 (14:16 +0100)]
drm/exynos/hdmi: use array specifier for HDMI-PHY configurations

HDMI-PHY configurations are stored as array pointer and count pair,
we can re-use existing helpers to simplify their initialization.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm/exynos/hdmi: constify global variables
Andrzej Hajda [Mon, 2 Nov 2015 13:16:40 +0000 (14:16 +0100)]
drm/exynos/hdmi: constify global variables

These variables should not be modified.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm/exynos/hdmi: clock code re-factoring
Andrzej Hajda [Thu, 14 Jan 2016 05:22:47 +0000 (14:22 +0900)]
drm/exynos/hdmi: clock code re-factoring

With incoming support for newer SoCs different set of clocks will be required,
depending on IP version. The patch prepares the driver for it.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm/exynos: Use VIDEO_SAMSUNG_S5P_G2D=n as G2D Kconfig dependency
Javier Martinez Canillas [Tue, 29 Mar 2016 01:28:55 +0000 (10:28 +0900)]
drm/exynos: Use VIDEO_SAMSUNG_S5P_G2D=n as G2D Kconfig dependency

Commit 254d4d111ee1 ("drm/exynos: Add dependency for G2D in Kconfig") made
the DRM_EXYNOS_G2D symbol to only be selectable if the s5p-g2d V4L2 driver
is not enabled, since both use the same HW IP block.

But added the dependency as depends on !VIDEO_SAMSUNG_S5P_G2D which isn't
correct since Kconfig expressions are not boolean but tristate. So it will
only evaluate to 'n' if VIDEO_SAMSUNG_S5P_G2D=y but it will evaluate to m
if VIDEO_SAMSUNG_S5P_G2D=m.

This means that both the V4L2 and DRM drivers can be enabled if the former
is enabled as a module, which is not what we want.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm/exynos: fix a warning message
Dan Carpenter [Fri, 25 Mar 2016 20:05:59 +0000 (23:05 +0300)]
drm/exynos: fix a warning message

The "ret = regmap_write()" assignment was missing so this error message
is never printed.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm/exynos: mic: fix an error code
Dan Carpenter [Thu, 17 Mar 2016 10:32:15 +0000 (13:32 +0300)]
drm/exynos: mic: fix an error code

We accidentally return success instead of a negative error code here.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm/exynos: fimd: fix broken dp_clock control
Marek Szyprowski [Thu, 17 Mar 2016 06:53:12 +0000 (07:53 +0100)]
drm/exynos: fimd: fix broken dp_clock control

Commit 1feafd3afd294b03dbbedb8e8f94e0c4db526f10 ("drm/exynos: add
exynos5420 support for fimd") add support for Exynos 5420 SoC, but it
broke enabling display clock feature because of incorrect condition
check. This patch fixes it, so display is working again on platforms
requiring display clock control (i.e. Exynos5250-based SNOW platform).

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm/exynos: build fbdev code conditionally
Andrzej Hajda [Tue, 15 Mar 2016 11:43:21 +0000 (12:43 +0100)]
drm/exynos: build fbdev code conditionally

Fbdev code should be compiled only if CONFIG_DRM_FBDEV_EMULATION option
is enabled. The patch fixes exynos-drm code trying to manipulate
fbdev data which is not initialized in case CONFIG_DRM_FBDEV_EMULATION
is disabled.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm/exynos: fix adjusted_mode pointer in exynos_plane_mode_set
Andrzej Hajda [Tue, 15 Mar 2016 11:38:02 +0000 (12:38 +0100)]
drm/exynos: fix adjusted_mode pointer in exynos_plane_mode_set

exynos_plane_mode_set should use adjusted_mode from the same atomic state as
plane state. Otherwise it will result in incorrect behavior in case
crtc mode changes.

The patch fixes bug with black console framebuffer in case of command mode
panels.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm/exynos: fix error handling in exynos_drm_subdrv_open
Arnd Bergmann [Mon, 14 Mar 2016 14:22:25 +0000 (15:22 +0100)]
drm/exynos: fix error handling in exynos_drm_subdrv_open

gcc-6 warns about a pointless loop in exynos_drm_subdrv_open:

drivers/gpu/drm/exynos/exynos_drm_core.c: In function 'exynos_drm_subdrv_open':
drivers/gpu/drm/exynos/exynos_drm_core.c:104:199: error: self-comparison always evaluates to false [-Werror=tautological-compare]
  list_for_each_entry_reverse(subdrv, &subdrv->list, list) {

Here, the list_for_each_entry_reverse immediately terminates because
the subdrv pointer is compared to itself as the loop end condition.

If we were to take the current subdrv pointer as the start of the
list (as we would do if list_for_each_entry_reverse() was not a macro),
we would iterate backwards over the &exynos_drm_subdrv_list anchor,
which would be even worse.

Instead, we need to use list_for_each_entry_continue_reverse()
to go back over each subdrv that was successfully opened until
the first entry.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agoMerge branch 'for-next' of http://git.agner.ch/git/linux-drm-fsl-dcu into drm-next
Dave Airlie [Fri, 29 Apr 2016 04:57:51 +0000 (14:57 +1000)]
Merge branch 'for-next' of git.agner.ch/git/linux-drm-fsl-dcu into drm-next

This adds very rudimentary TCON (timing controller for raw LCD displays)
support to enable the bypass mode in order to use the DCU controller on
Freescale/NXP Vybrid SoC's.

Additionally the register clock and pixel clock has been separated, but
are currently still enabled and disabled pairwise.

Other than that, fixes and cleanups accross the driver.

* 'for-next' of http://git.agner.ch/git/linux-drm-fsl-dcu:
  drm/fsl-dcu: increment version and date
  drm/fsl-dcu: implement lastclose callback
  drm/fsl-dcu: disable output polling on driver unload
  drm/fsl-dcu: deallocate fbdev CMA on unload
  drm/fsl-dcu: use variable name dev for struct drm_device
  drm/fsl-dcu: handle missing panel gracefully
  drm/fsl-dcu: detach panel on destroy
  drm/layerscape: reduce excessive stack usage
  drm/fsl-dcu: add TCON driver
  drm/fsl-dcu: use common clock framework for pixel clock divider
  drm/fsl-dcu: add extra clock for pixel clock
  drm/fsl-dcu: disable clock on initialization failure and remove

8 years agoMerge tag 'sun4i-drm-for-4.7' of https://git.kernel.org/pub/scm/linux/kernel/git...
Dave Airlie [Fri, 29 Apr 2016 04:52:41 +0000 (14:52 +1000)]
Merge tag 'sun4i-drm-for-4.7' of https://git./linux/kernel/git/mripard/linux into drm-next

Allwinner DRM driver for 4.7

This pull request introduces the sun4i driver, meant to be used on the
older Allwinner SoCs (A10, A13, A20, A23, A31 and A33).

It currently supports only the A13, which has one of the simplest video
pipeline. Support for other video components and SoCs will be added
eventually.

It supports only a RGB or composite output. It doesn't do HDMI, VGA, LVDS
or power management yet, but that will come in time as well.

* tag 'sun4i-drm-for-4.7' of https://git.kernel.org/pub/scm/linux/kernel/git/mripard/linux:
  MAINTAINERS: Add a maintainer for the Allwinner DRM driver
  drm: sun4i: tv: Add NTSC output standard
  drm: sun4i: tv: Add PAL output standard
  drm: sun4i: Add composite output
  drm: sun4i: Add RGB output
  drm: Add Allwinner A10 Display Engine support
  drm: sun4i: Add DT bindings documentation
  drm: fb: Add seq_file definition

8 years agodrm/atomic: Add missing drm_crtc_internal.h include
Thierry Reding [Thu, 28 Apr 2016 13:19:56 +0000 (15:19 +0200)]
drm/atomic: Add missing drm_crtc_internal.h include

Some of the functions implemented are flagged as not having a prototype
defined when building with W=1. Include the header to avoid these build
warnings.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1461849596-12819-1-git-send-email-thierry.reding@gmail.com
8 years agodrm/dp: Allow signals to interrupt drm_aux-dev reads/writes
Ville Syrjälä [Wed, 27 Apr 2016 19:43:45 +0000 (22:43 +0300)]
drm/dp: Allow signals to interrupt drm_aux-dev reads/writes

Let's be nice and interrupt the dpcd aux-dev reads/writes when there's
a signal pending. Much nicer if the user can hit ^C instead of having to
sit around waiting for the read/write to finish.

time dd if=/dev/drm_dp_aux0 bs=$((1024*1024))
^C

before:
 real 0m34.681s
 user 0m0.003s
 sys 0m6.880s

after:
 real 0m0.222s
 user 0m0.006s
 sys 0m0.057s

Cc: Rafael Antognolli <rafael.antognolli@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1461786225-7790-1-git-send-email-ville.syrjala@linux.intel.com
8 years agodrm: Quiet down drm_mode_getresources
Tvrtko Ursulin [Wed, 27 Apr 2016 11:11:47 +0000 (12:11 +0100)]
drm: Quiet down drm_mode_getresources

The debug logging here can be very verbose in the kernel logs
and provides no information which userspace doesn't have the
access to already. Turn it off so kernel logs become more
manageable.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1461755507-30453-1-git-send-email-tvrtko.ursulin@linux.intel.com
8 years agodrm: Quiet down drm_mode_getconnector
Tvrtko Ursulin [Wed, 27 Apr 2016 10:07:02 +0000 (11:07 +0100)]
drm: Quiet down drm_mode_getconnector

Debug logging in this function does not provide any information
apart that the userspace is calling an ioctl on the connector.

There is not any info on the connector provided at all and
since there are other ioctls userspace typically calls which
do log useful things about the same connectors, remove this
one to make things a little bit more readable when KMS debugging
is turned on.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1461751622-26927-10-git-send-email-tvrtko.ursulin@linux.intel.com
8 years agoMAINTAINERS: Add a maintainer for the Allwinner DRM driver
Maxime Ripard [Thu, 28 Apr 2016 08:12:33 +0000 (10:12 +0200)]
MAINTAINERS: Add a maintainer for the Allwinner DRM driver

Add myself as the maintainer of the new Allwinner DRM driver.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
8 years agodrm: sun4i: tv: Add NTSC output standard
Maxime Ripard [Thu, 29 Oct 2015 08:39:56 +0000 (09:39 +0100)]
drm: sun4i: tv: Add NTSC output standard

Add the settings to support the NTSC standard.

Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
8 years agodrm: sun4i: tv: Add PAL output standard
Maxime Ripard [Thu, 29 Oct 2015 08:39:41 +0000 (09:39 +0100)]
drm: sun4i: tv: Add PAL output standard

Now that we have support for the composite output, we can start adding new
supported standards. Start with PAL, and we will add other eventually.

Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
8 years agodrm: sun4i: Add composite output
Maxime Ripard [Thu, 29 Oct 2015 08:39:01 +0000 (09:39 +0100)]
drm: sun4i: Add composite output

Some Allwinner SoCs have an IP called the TV encoder that is used to output
composite and VGA signals. In such a case, we need to use the second TCON
channel.

Add support for that TV encoder.

Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
8 years agodrm: sun4i: Add RGB output
Maxime Ripard [Thu, 29 Oct 2015 08:37:32 +0000 (09:37 +0100)]
drm: sun4i: Add RGB output

One of the A10 display pipeline possible output is an RGB interface to
drive LCD panels directly. This is done through the first channel of the
TCON that will output our video signals directly.

Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
8 years agodrm: Add Allwinner A10 Display Engine support
Maxime Ripard [Thu, 29 Oct 2015 08:36:23 +0000 (09:36 +0100)]
drm: Add Allwinner A10 Display Engine support

The Allwinner A10 and subsequent SoCs share the same display pipeline, with
variations in the number of controllers (1 or 2), or the presence or not of
some output (HDMI, TV, VGA) or not.

Add a driver with a limited set of features for now, and we will hopefully
support all of them eventually

Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
8 years agodrm: sun4i: Add DT bindings documentation
Maxime Ripard [Fri, 30 Oct 2015 13:25:05 +0000 (14:25 +0100)]
drm: sun4i: Add DT bindings documentation

The display pipeline of the Allwinner A10 is involving several loosely
coupled components.

Add a documentation for the bindings.

Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
8 years agodrm: fb: Add seq_file definition
Maxime Ripard [Mon, 8 Feb 2016 12:58:56 +0000 (13:58 +0100)]
drm: fb: Add seq_file definition

Otherwise, building with DEBUG_FS enabled will trigger a build warning
because we're using a structure that has not been declared.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
8 years agodrm: Protect dev->filelist with its own mutex
Daniel Vetter [Tue, 26 Apr 2016 17:29:41 +0000 (19:29 +0200)]
drm: Protect dev->filelist with its own mutex

amdgpu gained dev->struct_mutex usage, and that's because it's walking
the dev->filelist list. Protect that list with it's own lock to take
one more step towards getting rid of struct_mutex usage in drivers
once and for all.

While doing the conversion I noticed that 2 debugfs files in i915
completely lacked appropriate locking. Fix that up too.

v2: don't forget to switch to drm_gem_object_unreference_unlocked.

Cc: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1461691808-12414-9-git-send-email-daniel.vetter@ffwll.ch
8 years agodrm: Make drm_vm_open/close_locked private to drm_vm.c
Daniel Vetter [Tue, 26 Apr 2016 17:29:40 +0000 (19:29 +0200)]
drm: Make drm_vm_open/close_locked private to drm_vm.c

It's only used for legacy mmaping support now.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1461691808-12414-8-git-send-email-daniel.vetter@ffwll.ch
8 years agodrm: Hide master MAP cleanup in drm_bufs.c
Daniel Vetter [Wed, 27 Apr 2016 07:20:18 +0000 (09:20 +0200)]
drm: Hide master MAP cleanup in drm_bufs.c

And again make sure it's a no-op for modern drivers. Another case of
dev->struct_mutex gone for modern drivers!

Note that the entirety of the legacy addmap interface is now protected
by DRIVER_MODESET. Note that just auditing kernel code is not enough,
since userspace loves to set up legacy maps on it's own for various
things - with ums userspace and kernel space share control over
resources.

v2: Also add a DRIVER_* check like for all other maps functions to
really short-circuit the code. And give drm_legacy_rmmap used by the
dev unregister code the same treatment.

v3:
- remove redundant return; (Alex, Chris)
- don't special case nouveau with DRIVER_KMS_LEGACY_CONTEXT.

v4: Again special case nouveau. The problem is not directly in the
ddx, but that it calls dri1 functions from the X server. And those do
call drmAddMap. Fixed only in

    commit b1a630b48210d6a3c44994fce1b73273000ace5c
    Author: Dave Airlie <airlied@redhat.com>
    Date:   Wed Nov 7 14:45:14 2012 +1000

        nouveau: drop DRI1 device open interface.

Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1461741618-12679-1-git-send-email-daniel.vetter@ffwll.ch
8 years agodrm: Forbid legacy MAP functions for DRIVER_MODESET
Daniel Vetter [Tue, 26 Apr 2016 17:29:37 +0000 (19:29 +0200)]
drm: Forbid legacy MAP functions for DRIVER_MODESET

Like in

commit 0e975980d435d58df2d430d688b8c18778b42218
Author: Peter Antoine <peter.antoine@intel.com>
Date:   Tue Jun 23 08:18:49 2015 +0100

    drm: Turn off Legacy Context Functions

we need to again make an exception for nouveau, but everyone else
really doesn't need this.

Dave Airlie dug out again why we need this: The problem is the legacy
dri1 open function the nouveau ddx called, and the problematic code is
actually in the X server itself. It was only fixed in

commit b1a630b48210d6a3c44994fce1b73273000ace5c
Author: Dave Airlie <airlied@redhat.com>
Date:   Wed Nov 7 14:45:14 2012 +1000

    nouveau: drop DRI1 device open interface.

Cc: Peter Antoine <peter.antoine@intel.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1461691808-12414-5-git-send-email-daniel.vetter@ffwll.ch
Link: http://patchwork.freedesktop.org/patch/msgid/1461691808-12414-6-git-send-email-daniel.vetter@ffwll.ch
8 years agodrm: Push struct_mutex into ->master_destroy
Daniel Vetter [Tue, 26 Apr 2016 17:29:38 +0000 (19:29 +0200)]
drm: Push struct_mutex into ->master_destroy

Only two drivers implement this hook. vmwgfx (which doesn't need it
really) and legacy radeon (which since v1 has been nuked, yay).

v1: Rebase over radeon ums removal.

Cc: Thomas Hellstrom <thellstrom@vmware.com>
Cc: Alex Deucher <alexdeucher@gmail.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1461691808-12414-6-git-send-email-daniel.vetter@ffwll.ch
8 years agodrm: Move drm_getmap into drm_bufs.c and give it a legacy prefix
Daniel Vetter [Tue, 26 Apr 2016 17:29:36 +0000 (19:29 +0200)]
drm: Move drm_getmap into drm_bufs.c and give it a legacy prefix

It belongs right next to the addmap and rmmap functions really. And
for OCD consistency name it drm_legacy_getmap_ioctl.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1461691808-12414-4-git-send-email-daniel.vetter@ffwll.ch
8 years agodrm: Put legacy lastclose work into drm_legacy_dev_reinit
Daniel Vetter [Tue, 26 Apr 2016 17:29:35 +0000 (19:29 +0200)]
drm: Put legacy lastclose work into drm_legacy_dev_reinit

Except for the ->lasclose driver callback evrything in drm_lastclose()
is all legacy cruft and can be hidden. Which means another
dev->struct_mutex site disappears entirely for modern drivers!

Also while at it change the return value of drm_lastclose to void
since it will always succeed. No one checks the return value of
close() anyway, ever.

v2: Move misplaced hunk, spotted by 0day.

Cc: Thierry Reding <thierry.reding@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1461691808-12414-3-git-send-email-daniel.vetter@ffwll.ch
8 years agodrm: Give drm_agp_clear drm_legacy_ prefix
Daniel Vetter [Tue, 26 Apr 2016 17:29:34 +0000 (19:29 +0200)]
drm: Give drm_agp_clear drm_legacy_ prefix

It has a  DRIVER_MODESET check to sure make it's not creating havoc
for drm drivers. Make that clear in the name too.

v2: Move misplaced hunk, spotted by 0day and Thierry.

Cc: Thierry Reding <thierry.reding@gmail.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1461691808-12414-2-git-send-email-daniel.vetter@ffwll.ch
8 years agodrm: Switch blobs to the new generic modeset obj refcounting
Daniel Vetter [Fri, 22 Apr 2016 20:10:30 +0000 (22:10 +0200)]
drm: Switch blobs to the new generic modeset obj refcounting

Need to move the free function around a bit, but otherwise mostly
just removing code.

Specifically we can nuke all the _locked variants since the weak idr
reference is now protected by the idr_mutex, which we never hold
anywhere expect in the lookup/reg/unreg functions. And those never
call anything else.

Another benefit of this is that this patch switches the weak reference
logic from kref_put_mutex to kref_get_unless_zero. And the later is in
general more flexible wrt accomodating multiple weak references
protected by different locks, which might or might not come handy
eventually.

But one consequence of that switch is that we need to acquire the
blob_lock from the free function for the list_del calls. That's a bit
tricky to pull off, but works well if we pick the exact same scheme as
is already used for framebuffers. Most important changes:

- filp list is maintainer by create/destroy_blob ioctls directly
  (already the case, so we can just remove the redundant list_del from
  the free function).

- filp close handler walks the filp-private list lockless - works
  because we know no one else can access it. I copied the same comment
  from the fb code over to explain this.

- Otherwise we need to sufficiently restrict blob_lock critical
  sections to avoid all the unreference calls. Easy to do once the
  blob_lock only protects the list, and no longer the weak reference.

Cc: Dave Airlie <airlied@gmail.com>
Cc: Daniel Stone <daniels@collabora.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agodrm/atomic-helpers: Don't duplicate code in destroy helpers
Daniel Vetter [Fri, 22 Apr 2016 20:10:29 +0000 (22:10 +0200)]
drm/atomic-helpers: Don't duplicate code in destroy helpers

Random drive-by refactoring I spotted.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agodrm: Fix fb leaks and WARN spew in get/set_prop ioctls
Daniel Vetter [Fri, 22 Apr 2016 20:10:28 +0000 (22:10 +0200)]
drm: Fix fb leaks and WARN spew in get/set_prop ioctls

Dave Airlie had at least the refcount leak fixed in a later patch (but
that patch does other things which need a bit more work). But we still
have the trouble that silly userspace could hit the WARN_ON in
drm_mode_object_find.

Fix this all up to make sure we don't leak objects, and don't spew
into demsg.

Fixes: d0f37cf62979 ("drm/mode: move framebuffer reference into object.")
Testcase: igt/kms_addfb_basic/invalid-*-prop*
Cc: Dave Airlie <airlied@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agodrm: Improve kerneldoc for new mode object refcounting
Daniel Vetter [Fri, 22 Apr 2016 20:10:27 +0000 (22:10 +0200)]
drm: Improve kerneldoc for new mode object refcounting

Slipped through the cracks in my review. The one issue I spotted
is that drm_mode_object_find now acquires references and can be
used on FB objects, which caused follow-on bugs in get/set_prop ioctls.
Follow-up patches will fix that.

[airlied: fixup some incr fb/decr object mixups]

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agoMerge branch 'topic-arcpgu-v6' of https://github.com/foss-for-synopsys-dwc-arc-proces...
Dave Airlie [Tue, 26 Apr 2016 23:38:42 +0000 (09:38 +1000)]
Merge branch 'topic-arcpgu-v6' of https://github.com/foss-for-synopsys-dwc-arc-processors/linux into drm-next

This is DRM driver for ARC PGU - simple bitstreamer used on
Synopsys ARC SDP boards (both AXS101 and AXS103).

* 'topic-arcpgu-v6' of https://github.com/foss-for-synopsys-dwc-arc-processors/linux:
  arc: axs10x - add support of ARC PGU
  MAINTAINERS: Add maintainer for ARC PGU display controller
  drm: Add DT bindings documentation for ARC PGU display controller
  drm: Add support of ARC PGU display controller

8 years agodrm/sis: add missing include drm.h for the UAPI header
Emil Velikov [Thu, 21 Apr 2016 20:17:32 +0000 (21:17 +0100)]
drm/sis: add missing include drm.h for the UAPI header

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agodrm/qxl: remove XXX comment from the UAPI header
Emil Velikov [Thu, 21 Apr 2016 20:17:27 +0000 (21:17 +0100)]
drm/qxl: remove XXX comment from the UAPI header

One cannot rename the struct at this point, so might as well remove the
comment.

Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Dave Airlie <airlied@redhat.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agoMerge branch 'drm/next/du' of git://linuxtv.org/pinchartl/fbdev into drm-next
Dave Airlie [Tue, 26 Apr 2016 23:19:50 +0000 (09:19 +1000)]
Merge branch 'drm/next/du' of git://linuxtv.org/pinchartl/fbdev into drm-next

misc rcar changes.

* 'drm/next/du' of git://linuxtv.org/pinchartl/fbdev:
  drm: rcar-du: Fix compilation warning
  drm: rcar-du: Use ARCH_RENESAS
  drm: rcar-du: Clarify vsp dependency

8 years agoarc: axs10x - add support of ARC PGU
Alexey Brodkin [Fri, 19 Feb 2016 12:19:43 +0000 (15:19 +0300)]
arc: axs10x - add support of ARC PGU

Synopsys DesignWare ARC SDP boards sport ARC SDP display
controller attached to ADV7511 HDMI encoder.

That change adds desctiption of both ARC PGU and ADV7511 in
ARC SDP'd base-board Device Tree.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Pawel Moll <pawel.moll@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>
Cc: Kumar Gala <galak@codeaurora.org>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: devicetree@vger.kernel.org
Cc: linux-snps-arc@lists.infradead.org
8 years agoMAINTAINERS: Add maintainer for ARC PGU display controller
Alexey Brodkin [Fri, 19 Feb 2016 12:34:30 +0000 (15:34 +0300)]
MAINTAINERS: Add maintainer for ARC PGU display controller

This updates MAINTEINERS file with information about maintainer of
ARC PGU display controller driver.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: linux-snps-arc@lists.infradead.org
8 years agodrm: Add DT bindings documentation for ARC PGU display controller
Alexey Brodkin [Fri, 19 Feb 2016 12:35:52 +0000 (15:35 +0300)]
drm: Add DT bindings documentation for ARC PGU display controller

This add DT bindings documentation for ARC PGU display controller.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Pawel Moll <pawel.moll@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>
Cc: Kumar Gala <galak@codeaurora.org>
Cc: devicetree@vger.kernel.org
Cc: linux-snps-arc@lists.infradead.org
Acked-by: Rob Herring <robh@kernel.org>
8 years agodrm: Add support of ARC PGU display controller
Carlos Palminha [Fri, 19 Feb 2016 12:30:26 +0000 (15:30 +0300)]
drm: Add support of ARC PGU display controller

ARC PGU could be found on some development boards from Synopsys.
This is a simple byte streamer that reads data from a framebuffer
and sends data to the single encoder.

Signed-off-by: Carlos Palminha <palminha@synopsys.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: David Airlie <airlied@linux.ie>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-snps-arc@lists.infradead.org
8 years agodrm/sysfs: Annote lockless show functions with READ_ONCE
Daniel Vetter [Wed, 30 Mar 2016 09:45:13 +0000 (11:45 +0200)]
drm/sysfs: Annote lockless show functions with READ_ONCE

For documentation and paranoia.

Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1459331120-27864-4-git-send-email-daniel.vetter@ffwll.ch
8 years agodrm/fsl-dcu: increment version and date
Stefan Agner [Tue, 26 Apr 2016 03:47:57 +0000 (20:47 -0700)]
drm/fsl-dcu: increment version and date

The driver supports now a second platform and received several
fixes, hence a version increment is justified.

Signed-off-by: Stefan Agner <stefan@agner.ch>
8 years agodrm/fsl-dcu: implement lastclose callback
Stefan Agner [Sun, 17 Apr 2016 04:18:54 +0000 (21:18 -0700)]
drm/fsl-dcu: implement lastclose callback

Use CMA helper drm_fbdev_cma_restore_mode to restore fbdev mode
in process which uses drm/kms dies.

Signed-off-by: Stefan Agner <stefan@agner.ch>
8 years agodrm/fsl-dcu: disable output polling on driver unload
Stefan Agner [Sun, 17 Apr 2016 04:17:12 +0000 (21:17 -0700)]
drm/fsl-dcu: disable output polling on driver unload

Disabling output polling before unloading the driver.

Signed-off-by: Stefan Agner <stefan@agner.ch>
8 years agodrm/fsl-dcu: deallocate fbdev CMA on unload
Stefan Agner [Sun, 17 Apr 2016 05:02:49 +0000 (22:02 -0700)]
drm/fsl-dcu: deallocate fbdev CMA on unload

Free fbdev CMA using drm_fbdev_cma_fini on unload. This fixes
a warning when unloading the driver:
WARNING: CPU: 0 PID: 164 at drivers/gpu/drm/drm_crtc.c:5930 drm_mode_config_cleanup+0x204/0x208

Signed-off-by: Stefan Agner <stefan@agner.ch>
8 years agodrm/fsl-dcu: use variable name dev for struct drm_device
Stefan Agner [Wed, 13 Apr 2016 07:14:18 +0000 (00:14 -0700)]
drm/fsl-dcu: use variable name dev for struct drm_device

The driver uses different variable names for struct drm_device
across functions which is confusing. Stick to the more common
variable name dev. While at it, remove unnecessary if statement
in error handling.

Signed-off-by: Stefan Agner <stefan@agner.ch>
8 years agodrm/fsl-dcu: handle missing panel gracefully
Stefan Agner [Thu, 3 Dec 2015 02:03:50 +0000 (18:03 -0800)]
drm/fsl-dcu: handle missing panel gracefully

If the device tree property fsl,panel is missing, drm_panel_attach
is called with a NULL pointer as first argument. Having a panel is
basically mandatory since RGB is the only supported connector.
Check if a panel node has been found, return -ENODEV and cleanup
otherwise.

Signed-off-by: Stefan Agner <stefan@agner.ch>
8 years agodrm/fsl-dcu: detach panel on destroy
Stefan Agner [Thu, 24 Mar 2016 06:27:11 +0000 (23:27 -0700)]
drm/fsl-dcu: detach panel on destroy

Disable the earlier attached panel on connector destroy.

Signed-off-by: Stefan Agner <stefan@agner.ch>
8 years agodrm/layerscape: reduce excessive stack usage
Arnd Bergmann [Mon, 22 Feb 2016 21:33:31 +0000 (22:33 +0100)]
drm/layerscape: reduce excessive stack usage

The fsl-dcu driver copies a drm_mode_config object to its
stack but then only accesses a single member (dpms_property)
once. The data structure is large enough to trigger a warning
about the amount of kernel stack being used:

drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c: In function 'fsl_dcu_drm_connector_create':
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c:182:1: error: the frame size of 1040 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]

This changes the fsl_dcu_drm_connector_create() function to
only access the drm_mode_config by reference, which is also
more efficient.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 109eee2f2a18 ("drm/layerscape: Add Freescale DCU DRM driver")
Signed-off-by: Stefan Agner <stefan@agner.ch>
8 years agodrm/fsl-dcu: add TCON driver
Stefan Agner [Wed, 2 Dec 2015 22:39:40 +0000 (14:39 -0800)]
drm/fsl-dcu: add TCON driver

Add driver for the TCON (timing controller) module. The TCON module
is a separate module attached after the DCU (display controller
unit). Each DCU instance has its own, directly connected TCON
instance. The DCU's RGB and timing signals are passing through
the TCON module. TCON can provide timing signals for raw TFT panels
or operate in a bypass mode which leaves all signals unaltered.

The driver currently only supports the bypass mode.

Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Stefan Agner <stefan@agner.ch>
8 years agodrm/fsl-dcu: use common clock framework for pixel clock divider
Stefan Agner [Wed, 23 Mar 2016 01:06:08 +0000 (18:06 -0700)]
drm/fsl-dcu: use common clock framework for pixel clock divider

Use the common clock framework to calculate the pixel clock
dividier. The previous implementation rounded down the calculated
factor. Thanks to the CLK_DIVIDER_ROUND_CLOSEST flag using the
common clock framework divider implementation improves the pixel
clock accuracy in some cases. Ontop of that it also allows to see
the actual pixel clock in the sysfs clock summary.

Signed-off-by: Stefan Agner <stefan@agner.ch>
8 years agodrm/fsl-dcu: add extra clock for pixel clock
Stefan Agner [Tue, 22 Mar 2016 22:45:29 +0000 (15:45 -0700)]
drm/fsl-dcu: add extra clock for pixel clock

The Vybrid DCU variant has two independent clock inputs, one
for the registers (IPG bus clock) and one for the pixel clock.
Support this distinction in the DCU DRM driver while staying
backward compatible for old device trees.

Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Stefan Agner <stefan@agner.ch>
8 years agodrm/fsl-dcu: disable clock on initialization failure and remove
Stefan Agner [Tue, 22 Mar 2016 22:13:05 +0000 (15:13 -0700)]
drm/fsl-dcu: disable clock on initialization failure and remove

Fix error handling during probe by reordering initialization and
adding a error path which disables clock again. Also disable the
clock on remove.

Signed-off-by: Stefan Agner <stefan@agner.ch>
8 years agoMAINTAINERS: Update the files list for the GMA500 DRM driver
Emil Velikov [Thu, 21 Apr 2016 23:03:52 +0000 (00:03 +0100)]
MAINTAINERS: Update the files list for the GMA500 DRM driver

Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1461279842-28695-5-git-send-email-emil.l.velikov@gmail.com
8 years agodrm/i915: Update DRIVER_DATE to 20160425
Daniel Vetter [Mon, 25 Apr 2016 07:35:38 +0000 (09:35 +0200)]
drm/i915: Update DRIVER_DATE to 20160425

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agodrm/i915/bxt: Explicitly clear the Turbo control register
Akash Goel [Fri, 22 Apr 2016 18:35:45 +0000 (00:05 +0530)]
drm/i915/bxt: Explicitly clear the Turbo control register

As a part of WaGsvDisableTurbo, Driver makes an early exit from the
Gen9 Turbo enabling function, so doesn't program the Turbo Control register.
But BIOS could leave the Hw Turbo as enabled, so need to explicitly clear
out the Control register just to avoid inconsitency with debugfs
interface, which will show Turbo as enabled only and that is not expected
after adding the WaGsvDisableTurbo. Apart from this there is no problem
even if the Turbo is left enabled in the Control register, as the Up/Down
interrupts would remain masked.

v2: Add explicit clearing of Turbo Control register to *_disable_rps()
    also for the similar consistency (Chris)

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Akash Goel <akash.goel@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: http://patchwork.freedesktop.org/patch/msgid/1461350146-23454-2-git-send-email-akash.goel@intel.com
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
8 years agodrm/i915: Correct the i915_frequency_info debugfs output
Akash Goel [Fri, 22 Apr 2016 18:35:46 +0000 (00:05 +0530)]
drm/i915: Correct the i915_frequency_info debugfs output

There are certain registers, which captures the time elapsed in the
in current Up/Down EI, for how long GT has been Idle/Busy/Avg in the
current Up/Down EI and also in the previous Up/Down EI.
These register values are reported by the i915_frequency_info debugfs
interface. The Driver prints the 'us' suffix after the values, albeit
they are actually in raw form & not in microsecond units.
This patch removes the 'us' suffix so that its clear to User that values
are indeed in raw form.

v2: Present the values in microseconds unit also, after platform
    specific conversion (Chris)
v3: Add a space between raw & microsecond value (Chris)

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Akash Goel <akash.goel@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: http://patchwork.freedesktop.org/patch/msgid/1461350146-23454-3-git-send-email-akash.goel@intel.com
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
8 years agodrm/i915: Macros to convert PM time interval values to microseconds
Akash Goel [Fri, 22 Apr 2016 18:35:44 +0000 (00:05 +0530)]
drm/i915: Macros to convert PM time interval values to microseconds

Added a new GT_PM_INTERVAL_TO_US macro to perform the platform
specific conversion of PM time interval values to microseconds unit.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Akash Goel <akash.goel@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: http://patchwork.freedesktop.org/patch/msgid/1461350146-23454-1-git-send-email-akash.goel@intel.com
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
8 years agodrm: rcar-du: Fix compilation warning
Laurent Pinchart [Fri, 22 Apr 2016 14:52:45 +0000 (17:52 +0300)]
drm: rcar-du: Fix compilation warning

Commit d63c25e4245a ("drm: rcar-du: Use generic
drm_connector_register_all() helper") left an unused local variable
behind. Remove it.

Fixes: d63c25e4245a ("drm: rcar-du: Use generic drm_connector_register_all() helper")
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
8 years agodrm: rcar-du: Use ARCH_RENESAS
Simon Horman [Fri, 25 Mar 2016 01:38:28 +0000 (10:38 +0900)]
drm: rcar-du: Use ARCH_RENESAS

Make use of ARCH_RENESAS in place of ARCH_SHMOBILE.

This is part of an ongoing process to migrate from ARCH_SHMOBILE to
ARCH_RENESAS the motivation for which being that RENESAS seems to be a more
appropriate name than SHMOBILE for the majority of Renesas ARM based SoCs.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
8 years agodrm: rcar-du: Clarify vsp dependency
Arnd Bergmann [Fri, 26 Feb 2016 11:52:20 +0000 (12:52 +0100)]
drm: rcar-du: Clarify vsp dependency

The VSP1 compositor code in DRM links against the respective V4L
driver, but the dependency is not expressed correctly in Kconfig,
which leads to a build error when the DRM driver is built-in
and the V4L driver is a module:

drivers/gpu/built-in.o: In function `rcar_du_vsp_plane_atomic_update':
rcar-du/rcar_du_vsp.c:183: undefined reference to `vsp1_du_atomic_update'

This patch avoids the problem by ensuring that the DRM VSP code can
only be enabled if the V4L driver is linked into the kernel, or
both are loadable modules.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 6d62ef3ac30b ("drm: rcar-du: Expose the VSP1 compositor through KMS planes")
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>