1
0
Fork 0
Commit Graph

617564 Commits (81c5d6aa3983662b6b48b504fe3a0a4c640f6a84)

Author SHA1 Message Date
Dave Airlie 81c5d6aa39 Merge branch 'drm-etnaviv-next' of git://git.pengutronix.de/git/lst/linux into drm-next
Notable changes:

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

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

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

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

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

Allwinner sun4i DRM fixes for 4.9

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

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

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

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

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

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

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

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

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

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

* tag 'drm-amdkfd-next-2016-09-19' of git://people.freedesktop.org/~gabbayo/linux:
  drm/amdkfd: Pass 'struct queue_propertices' by reference
  drm/amdkfd: Unify multiple calls to pr_debug() into one
  drm/amdkfd: Fix possible infinite loop
  drm/amdkfd: Reuse function to find a process through pasid
  drm/amdkfd: Add some missing memset zero'ing in queue init func
  drm/amdkfd: Tidy up kfd_generate_gpu_id() uint64_t bitshift unpack
2016-09-28 10:25:42 +10:00
Baoyou Xie 089cfdd9b0 drm: bridge: analogix/dp: mark symbols static where possible
We get 2 warnings when building kernel with W=1:
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c:1053:5: warning: no previous prototype for 'analogix_dp_get_modes' [-Wmissing-prototypes]
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c:1097:1: warning: no previous prototype for 'analogix_dp_detect' [-Wmissing-prototypes]

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

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

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

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

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

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

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

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

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

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Tested-by: Javier Martinez Canillas <javier@osg.samsung.com>
Tested-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Cc: Javier Martinez Canillas <javier@osg.samsung.com>
Cc: Mika Kahola <mika.kahola@intel.com>
Cc: Yakir Yang <ykk@rock-chips.com>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Archit Taneja <architt@codeaurora.org>
2016-09-24 11:56:34 +05:30
Daniel Schultz 7b993855df drm/tilcdc: fix wrong error handling
When 'component_bind_all' fails it should not try to unbind components
in the error handling. This will produce a null pointer kernel panic when
no component exist.

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

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

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

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

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

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

Acked-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
2016-09-23 03:29:50 -07:00
Daniel Vetter 226714dc7c drm: Fix plane type uabi breakage
Turns out assuming that only stuff in uabi is uabi is a bit naive, and
we have a bunch of properties for which the enum values are placed in
random headers. A proper fix would be to split out uapi include
headers, but meanwhile sprinkle at least some warning over them.

Fixes: 532b36712d ("drm/doc: Polish for drm_plane.[hc]")
Cc: Archit Taneja <architt@codeaurora.org>
Cc: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1474612525-9488-1-git-send-email-daniel.vetter@ffwll.ch
2016-09-22 23:52:12 -07:00
Jyri Sarha 34355ee0d5 drm/tilcdc: Remove "default" from blue-and-red-wiring property binding
Remove "default" keyword from blue-and-red-wiring devicetree property
binding document. The code does not support and there is no intention
to support it.

Reported-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jyri Sarha <jsarha@ti.com>
2016-09-22 23:50:10 +03:00
Wei Yongjun 30457676e2 drm/tilcdc: Fix non static symbol warning
Fixes the following sparse warning:

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

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

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

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

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

Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
Signed-off-by: Jyri Sarha <jsarha@ti.com>
2016-09-22 23:50:08 +03:00
Gustavo Padovan c654dd0752 dma-buf/sync_file: free fences array in num_fences is 1
When merging sync_files there is a case when we can end up with only one
fence in the merged sync_file: when all fences belong to the same
timeline.

So for this case a fence_array is not created instead we just assigned the
fence to sync_file->fence. Then we do not use the fences array anymore nor
does free it.

This patch frees the array.

Reported-by:  Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1474442419-6040-1-git-send-email-gustavo@padovan.org
2016-09-22 04:06:16 -07:00
Brian Starkey 6a2925ea12 drm/i2c: tda998x: don't register the connector
The connector shouldn't be registered until the rest of the whole device
is set up, so that consistent state is presented to userspace.

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

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

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

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

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

Fix our mask.

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

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

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

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2016-09-22 10:10:54 +03:00
Daniel Vetter f566911ae1 drm: Remove dirty property from docs
We removed it in

commit 6ab10b76ff
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Fri Aug 12 22:48:45 2016 +0200

    drm/kms: Nuke dirty_info property

Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1474448370-32227-7-git-send-email-daniel.vetter@ffwll.ch
2016-09-22 00:04:03 -07:00
Daniel Vetter a6acccf8ef drm/doc: Document color space handling
Again move it from the unmaintainable csv into DOC free-form overview
sections.

v2: Types Lionel&Sean spotted.

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

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

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

v2: Fix typos Sean spotted.

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

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

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

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

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

v3: rebase over PAGE_FLIP_TARGET.

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

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

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

    drm: Reject page_flip for !DRIVER_MODESET

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1474324848-6446-1-git-send-email-dhinakaran.pandiyan@intel.com
2016-09-21 13:33:50 +02:00