summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)AuthorFilesLines
2017-10-01drm/meson: Use drm_gem_fb_create()Noralf Trønnes1-1/+2
drm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly. Cc: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Noralf Trønnes <noralf@tronnes.org> Reviewed-by: Eric Anholt <eric@anholt.net> Link: https://patchwork.freedesktop.org/patch/msgid/1506255985-61113-5-git-send-email-noralf@tronnes.org
2017-10-01drm/hisilicon/kirin: Use drm_gem_fb_create()Noralf Trønnes1-1/+2
drm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly. Cc: Xinliang Liu <z.liuxinliang@hisilicon.com> Cc: Rongrong Zou <zourongrong@gmail.com> Cc: Xinwei Kong <kong.kongxinwei@hisilicon.com> Cc: Chen Feng <puck.chen@hisilicon.com> Signed-off-by: Noralf Trønnes <noralf@tronnes.org> Reviewed-by: Xinliang Liu <z.liuxinliang@hisilicon.com> Reviewed-by: Eric Anholt <eric@anholt.net> Link: https://patchwork.freedesktop.org/patch/msgid/1506255985-61113-4-git-send-email-noralf@tronnes.org
2017-10-01drm/fsl-dcu: Use drm_gem_fb_create()Noralf Trønnes1-1/+2
drm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly. Cc: Stefan Agner <stefan@agner.ch> Cc: Alison Wang <alison.wang@freescale.com> Signed-off-by: Noralf Trønnes <noralf@tronnes.org> Reviewed-by: Eric Anholt <eric@anholt.net> Link: https://patchwork.freedesktop.org/patch/msgid/1506255985-61113-3-git-send-email-noralf@tronnes.org
2017-10-01drm/tinydrm: Use drm_gem_framebuffer_helperNoralf Trønnes5-9/+14
Use drm_gem_framebuffer_helper directly instead of the cma library wrappers. Signed-off-by: Noralf Trønnes <noralf@tronnes.org> Reviewed-by: Eric Anholt <eric@anholt.net> Link: https://patchwork.freedesktop.org/patch/msgid/1506255985-61113-2-git-send-email-noralf@tronnes.org
2017-10-01drm: of: always initialize panel in drm_of_find_panel_or_bridge()Dan Carpenter1-0/+2
The callers expect "panel" to be initialized, but that isn't true if we return -ENODEV. It causes bugs like: drivers/gpu/drm/tve200/tve200_drv.c:83 tve200_modeset_init() error: uninitialized symbol 'panel'. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20170925103038.lvr5msjvekwczctn@mwanda
2017-10-01drm/tve200: Check for IS_ERR instead of NULL in probeDan Carpenter1-1/+1
devm_ioremap_resource() returns error pointer, it never returns NULL on error. Fixes: 179c02fe90a4 ("drm/tve200: Add new driver for TVE200") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20170925102520.a7spymwqqbsczzz2@mwanda
2017-10-01drm/tve200: make two functions staticColin Ian King1-2/+2
The functions tve200_display_disable and tve200_display_funcs are local to the source and do not need to be in global scope, so make them static. Cleans up sparse warnings: symbol 'tve200_display_disable' was not declared. Should it be static? symbol 'tve200_display_funcs' was not declared. Should it be static? Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20170922160516.16283-1-colin.king@canonical.com
2017-09-29drm/armada: Remove unused #include <drmP.h>Haneen Mohammed5-5/+0
Remove drmP.h as it is not needed anymore since nothing it defines is used in these files. Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20170927073846.GA14352@Haneen
2017-09-27drm/rockchip: Rely on the default best_encoder() behaviorHaneen Mohammed1-9/+0
Since the output has 1:1 relationship between connectors and encoders, and the driver is relying on the atomic helpers, remove the custom best_encoder() and let the core call drm_atomic_helper_best_encoder(). Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: https://patchwork.freedesktop.org/patch/msgid/20170927182317.GA8249@Haneen
2017-09-27drm/vc4: Set up the DSI host at pdev probe time, not component bind.Eric Anholt1-40/+57
We need the following things to happen in sequence: DSI host creation DSI device creation in the panel driver (needs DSI host) DSI device attach from panel to host. DSI drm_panel_add() DSI encoder creation DSI encoder's DRM panel/bridge attach Unless we allow device creation while the host isn't up yet, we need to break the -EPROBE_DEFER deadlock between the panel driver looking up the host and the host driver looking up the panel. We can do so by moving the DSI host creation outside of the component bind loop, and the panel/bridge lookup/attach into the component bind process. Signed-off-by: Eric Anholt <eric@anholt.net> Link: https://patchwork.freedesktop.org/patch/msgid/20170815234722.20700-3-eric@anholt.net Reviewed-by: Archit Taneja <architt@codeaurora.org>
2017-09-27drm/vc4: Avoid using vrefresh==0 mode in DSI htotal math.Eric Anholt1-1/+2
The incoming mode might have a missing vrefresh field if it came from drmModeSetCrtc(), which the kernel is supposed to calculate using drm_mode_vrefresh(). We could either use that or the adjusted_mode's original vrefresh value. However, we can maintain a more exact vrefresh value (not just the integer approximation), by scaling by the ratio of our clocks. v2: Use math suggested by Andrzej Hajda instead. v3: Simplify math now that adjusted_mode->clock isn't padded. v4: Drop some parens. Signed-off-by: Eric Anholt <eric@anholt.net> Link: https://patchwork.freedesktop.org/patch/msgid/20170815234722.20700-2-eric@anholt.net Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
2017-09-27drm/core: clean up references to drm_dev_unref()Aishwarya Pant2-2/+2
This is a continuation of a previous commit ("drm: introduce drm_dev_{get/put} functions") to replace all references to drm_dev_unref() in drm core files with drm_dev_put(). Signed-off-by: Aishwarya Pant <aishpant@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20170926170400.GA7671@aishwarya
2017-09-26drm/tilcdc: replace reference/unreference() with get/putAishwarya Pant2-4/+4
For maintaining consistency with kernel coding style replace reference/unreference in ref counting functions with get/put. The following cocci script was used to generate the tilcdc patch: @@ expression ex; @@ ( -drm_framebuffer_unreference(ex); +drm_framebuffer_put(ex); | -drm_dev_unref(ex); +drm_dev_put(ex); | -drm_framebuffer_reference(ex); +drm_framebuffer_get(ex); ) Signed-off-by: Aishwarya Pant <aishpant@gmail.com> Acked-by: Jyri Sarha <jsarha@ti.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/3f2f592f6ea28adfea3fd8b70421b2fab38f0b94.1506413698.git.aishpant@gmail.com
2017-09-26drm: introduce drm_dev_{get/put} functionsAishwarya Pant2-20/+33
Reference counting functions in the kernel typically use get/put suffixes. For maintaining coding style consistency, introduce drm_dev_{get/put} functions. All callers of drm_dev_ref() API have been converted in this patch and hence it has been dropped while the drm_dev_unref() API with non-trivial number of users remains for compatibility. The semantic patch scripts/coccinelle/api/drm-get-put.cocci has been updated with the new helper for conversion of drm_dev_unref() to drm_dev_put() Signed-off-by: Aishwarya Pant <aishpant@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/6babda56134035a98220d5d37a4fd4048df214ce.1506413698.git.aishpant@gmail.com
2017-09-26drm/rockchip: Cocci spatch "vma_pages"Thomas Meyer1-1/+1
Use vma_pages function on vma object instead of explicit computation. Found by coccinelle spatch "api/vma_pages.cocci" Signed-off-by: Thomas Meyer <thomas@m3y3r.de> Signed-off-by: Mark Yao <mark.yao@rock-chips.com> Link: https://patchwork.freedesktop.org/patch/msgid/1505946334393-988165015-7-diffsplit-thomas@m3y3r.de
2017-09-26drm: Remove obsolete "This is gross" commentHaneen Mohammed1-9/+0
Remove obsolete comment which was initially added in 2008 to annotate that idr_find() was used before idr_remove() since idr_remove() didn't use to return feedback. The comment now is irrelevant with commit f6cd7daecff5 ("drm: Release driver references to handle before making it available again"). Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20170921210424.GA21951@Haneen
2017-09-26drm: Try to document legacy DPMS uapi a bit betterDaniel Vetter1-0/+23
Due to inconsistency of how various legacy drivers implemented DPMS the DPMS uabi has a lot of quirks. Atomic standardizes this, but drivers using the DPMS support can't rely on that since legacy drivers still exist. Laurent asked for this. v2: Improve commit message and explain that DPMS doesn't really exist for the atomic ioctl (it's "ACTIVE" on the CRTC instead). Text polish from Eric's review. Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Daniel Vetter <daniel.vetter@intel.com> Cc: Jani Nikula <jani.nikula@linux.intel.com> Cc: Sean Paul <seanpaul@chromium.org> Cc: David Airlie <airlied@linux.ie> Cc: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Sean Paul <seanpaul@chromium.org> Link: https://patchwork.freedesktop.org/patch/msgid/20170920225957.16278-1-daniel.vetter@ffwll.ch
2017-09-21drm/rockchip: Fix uninitialized use of retSean Paul1-3/+8
If there are no children for lvds, ret is used uninitialized. This patch initializes ret and returns an error if the port has no children. Fixes: 34cc0aa25456 ("drm/rockchip: Add support for Rockchip Soc LVDS") Cc: Mark Yao <mark.yao@rock-chips.com> Cc: Heiko Stuebner <heiko@sntech.de> Cc: Sandy Huang <hjc@rock-chips.com> Cc: dri-devel@lists.freedesktop.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-rockchip@lists.infradead.org Reviewed-by: Mark Yao <mark.yao@rock-chips.com> Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: https://patchwork.freedesktop.org/patch/msgid/20170921001408.1839-1-seanpaul@chromium.org
2017-09-20dma-buf: remove redundant initialization of sg_tableColin Ian King1-1/+1
sg_table is being initialized and is never read before it is updated again later on, hence making the initialization redundant. Remove the initialization. Detected by clang scan-build: "warning: Value stored to 'sg_table' during its initialization is never read" Signed-off-by: Colin Ian King <colin.king@canonical.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20170914230516.6056-1-colin.king@canonical.com
2017-09-20drm/agpsupport: Remove extra blank lineMeghana Madhyastha1-1/+0
Remove extra blank line to adhere to standard coding style. Found by checkpath.pl.. Signed-off-by: Meghana Madhyastha <meghana.madhyastha@gmail.com> Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: https://patchwork.freedesktop.org/patch/msgid/9cfc7e7535908f3fe3b1df706f2999687c90d4e7.1505376068.git.meghana.madhyastha@gmail.com
2017-09-20drm/agpsupport: Move EXPORT_SYMBOL so that it immediately follows its functionMeghana Madhyastha1-3/+0
EXPORT_SYMBOL(foo) should immediately follow its function/variable. This coding style is preferred. Found by checkpath.pl. Signed-off-by: Meghana Madhyastha <meghana.madhyastha@gmail.com> Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: https://patchwork.freedesktop.org/patch/msgid/0496f0e821082969ec7950ac35f1e6b6cedb22a6.1505376068.git.meghana.madhyastha@gmail.com
2017-09-20drm/agpsupport: Remove assignment in if conditionMeghana Madhyastha1-13/+18
Move the assignment so that it happens before the if condition. Merged multiple similar conditionals to a single conditional statement. This results in syntax which is easier to read. Found by checkpath.pl Signed-off-by: Meghana Madhyastha <meghana.madhyastha@gmail.com> Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: https://patchwork.freedesktop.org/patch/msgid/d30cb59d92c8a98d0665ef6ae2a56b364dc61098.1505376068.git.meghana.madhyastha@gmail.com
2017-09-20drm/agpsupport: Replace "foo * bar" with "foo *bar"Meghana Madhyastha1-5/+5
This replaces all instances of foo * bar with foo *bar in drm_agpsupport.c. This is so that it adheres to standard C syntax for pointers. Signed-off-by: Meghana Madhyastha <meghana.madhyastha@gmail.com> Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: https://patchwork.freedesktop.org/patch/msgid/e092694c26e61fc6147e44851392a43b7a68c4f3.1505376068.git.meghana.madhyastha@gmail.com
2017-09-19drm: add backwards compatibility support for drm_kms_helper.edid_firmwaredrm-misc-next-2017-09-20Jani Nikula2-0/+44
Add drm_kms_helper.edid_firmware module parameter with param ops hooks to set drm.edid_firmware instead, for backwards compatibility. Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: Abdiel Janulgue <abdiel.janulgue@linux.intel.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Acked-by: Dave Airlie <airlied@gmail.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20170918182003.22238-2-jani.nikula@intel.com
2017-09-19drm: handle override and firmware EDID at drm_do_get_edid() levelJani Nikula4-20/+18
Handle debugfs override edid and firmware edid at the low level to transparently and completely replace the real edid. Previously, we practically only used the modes from the override EDID, and none of the other data, such as audio parameters. This change also prevents actual EDID reads when the EDID is to be overridden, but retains the DDC probe. This is useful if the reason for preferring override EDID are problems with reading the data, or corruption of the data. Move firmware EDID loading from helper to core, as the functionality moves to lower level as well. This will result in a change of module parameter from drm_kms_helper.edid_firmware to drm.edid_firmware, which arguably makes more sense anyway. Some future work remains related to override and firmware EDID validation. Like before, no validation is done for override EDID. The firmware EDID is validated separately in the loader. Some unification and deduplication would be in order, to validate all of them at the drm_do_get_edid() level, like "real" EDIDs. v2: move firmware loading to core v3: rebase, commit message refresh Cc: Abdiel Janulgue <abdiel.janulgue@linux.intel.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Tested-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Acked-by: Dave Airlie <airlied@gmail.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/1e8a710bcac46e5136c1a7b430074893c81f364a.1505203831.git.jani.nikula@intel.com
2017-09-18drm/rockchip: Replace dev_* with DRM_DEV_*Haneen Mohammed10-98/+121
This patch replace instances of dev_info/err/debug with DRM_DEV_INFO/ERROR/WARN respectively inorder to use a drm-formatted specific log messages. Issue corrected with the help of the following Coccinelle script: @r@ @@ ( -dev_info +DRM_DEV_INFO | -dev_err +DRM_DEV_ERROR | -dev_dbg +DRM_DEV_DEBUG ) Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> Signed-off-by: Mark Yao <mark.yao@rock-chips.com> Link: https://patchwork.freedesktop.org/patch/msgid/20170915083603.GA18992@Haneen
2017-09-16drm/tinydrm: Drop driver registered messageNoralf Trønnes4-36/+6
No need to put out a driver registered message since drm_dev_register() does that now. SPI speed is an important metric when dealing with display problems, so retain that info. Cc: David Lechner <david@lechnology.com> Signed-off-by: Noralf Trønnes <noralf@tronnes.org> Acked-by: David Lechner <david@lechnology.com> Link: https://patchwork.freedesktop.org/patch/msgid/1504883250-43487-8-git-send-email-noralf@tronnes.org
2017-09-16drm/gem-fb-helper: Use debug message on gem lookup failureNoralf Trønnes1-2/+2
GEM lookup failure can easily be triggered by userspace so make it a debug message, not an error message. Also remove unnecessary inner parentheses and fix alphabetical struct declaration order. Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Noralf Trønnes <noralf@tronnes.org> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Link: https://patchwork.freedesktop.org/patch/msgid/1505147865-18194-2-git-send-email-noralf@tronnes.org
2017-09-16drm/imx: Use drm_gem_fb_create() and drm_gem_fb_prepare_fb()Noralf Trønnes2-2/+4
drm_fb_cma_create() and drm_fb_cma_prepare_fb() are just wrappers now, use drm_gem_fb_create() and drm_gem_fb_prepare_fb() directly. Cc: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Noralf Trønnes <noralf@tronnes.org> Acked-by: Philipp Zabel <p.zabel@pengutronix.de> Link: https://patchwork.freedesktop.org/patch/msgid/1502631125-13557-11-git-send-email-noralf@tronnes.org
2017-09-16drm/bridge: adv7511: Constify HDMI CODEC platform dataLars-Peter Clausen1-1/+1
The HDMI codec platform data is global driver state shared by all instances. As such it should not be modified (and is not), to make this explicit declare it as const. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Tested-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Archit Taneja <architt@codeaurora.org> Link: https://patchwork.freedesktop.org/patch/msgid/20170905121018.11477-4-lars@metafoo.de
2017-09-16drm/bridge: adv7511: Enable connector polling when no interrupt is specifiedLars-Peter Clausen1-1/+5
Fall back to polling the connector for connect and disconnect events when no interrupt is specified. Otherwise these events will not be noticed and monitor hotplug does not work. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Tested-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Archit Taneja <architt@codeaurora.org> Link: https://patchwork.freedesktop.org/patch/msgid/20170905121018.11477-3-lars@metafoo.de
2017-09-16drm/bridge: adv7511: Remove private copy of the EDIDLars-Peter Clausen2-12/+6
The adv7511 driver keeps a private copy of the EDID in its driver state struct. But this copy is only used in adv7511_get_modes() where it is also retrieved, so there is no need to keep this extra copy around. If a need to access the EDID elsewhere in the driver ever arises the copy that is stored in the connector can be used. This copy is accessible through drm_connector_get_edid(). Note, this patch removes the NULL check of the EDID before passing it to drm_detect_hdmi_monitor(), but that is fine since the function correctly handles the case where the EDID is NULL. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Tested-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Archit Taneja <architt@codeaurora.org> Link: https://patchwork.freedesktop.org/patch/msgid/20170905121018.11477-2-lars@metafoo.de
2017-09-16drm/bridge: adv7511: Properly update EDID when no EDID was foundLars-Peter Clausen1-2/+0
Currently adv7511_get_modes() bails out early when no EDID could be retrieved. This leaves the previous EDID in place, which is typically not the intended behavior and might confuse applications. Instead the EDID should be cleared when no EDID could be retrieved. All functions that are called after the EDID check handle the case where the EDID is NULL just fine and exhibit the expected behavior, so just drop the check. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Tested-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Archit Taneja <architt@codeaurora.org> Link: https://patchwork.freedesktop.org/patch/msgid/20170905121018.11477-1-lars@metafoo.de
2017-09-13drm/crtc: Convert setcrtc ioctl locking to interruptible.Maarten Lankhorst1-3/+4
Pass DRM_MODESET_ACQUIRE_INTERRUPTIBLE to acquire_init, and handle drm_modeset_backoff which can now fail by returning the error. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20170912133749.6532-7-maarten.lankhorst@linux.intel.com Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2017-09-13drm/atomic: Convert pageflip ioctl locking to interruptible.Maarten Lankhorst1-3/+4
Pass DRM_MODESET_ACQUIRE_INTERRUPTIBLE to acquire_init, and handle drm_modeset_backoff which can now fail by returning the error. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20170912133749.6532-6-maarten.lankhorst@linux.intel.com Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2017-09-13drm/legacy: Convert setplane ioctl locking to interruptible.Maarten Lankhorst1-3/+4
Pass DRM_MODESET_ACQUIRE_INTERRUPTIBLE to acquire_init, and handle drm_modeset_backoff which can now fail by returning the error. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20170912133749.6532-5-maarten.lankhorst@linux.intel.com Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2017-09-13drm/legacy: Convert cursor ioctl locking to interruptible.Maarten Lankhorst1-3/+4
Pass DRM_MODESET_ACQUIRE_INTERRUPTIBLE to acquire_init, and handle drm_modeset_backoff which can now fail by returning the error. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20170912133749.6532-4-maarten.lankhorst@linux.intel.com Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2017-09-13drm/atomic: Convert atomic ioctl locking to interruptible.Maarten Lankhorst1-3/+4
Pass DRM_MODESET_ACQUIRE_INTERRUPTIBLE to acquire_init, and handle drm_modeset_backoff which can now fail by returning the error. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20170912133749.6532-3-maarten.lankhorst@linux.intel.com Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2017-09-13drm/atomic: Prepare drm_modeset_lock infrastructure for interruptible ↵Maarten Lankhorst2-49/+49
waiting, v2. When we want to make drm_atomic_commit interruptible, there are a lot of places that call the lock function, which we don't have control over. Rather than trying to convert every single one, it's easier to toggle interruptible waiting per acquire_ctx. If drm_modeset_acquire_init is called with DRM_MODESET_ACQUIRE_INTERRUPTIBLE, then we will perform interruptible waits in drm_modeset_lock and drm_modeset_backoff. Changes since v1: - Fix locking example in drm_modeset_lock.c to be compatible with interruptible waiting (xexaxo) and make it default. Uninterruptible waiting shouldn't happen except in corner cases, but the example will still apply if the flag is removed. - Add drm_modeset_lock_single_interruptible() to documentation. - Fix dead link to removed drm_modeset_lock_interruptible() in drm_modeset_lock(). Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> #v1 Cc: Emil Velikov <emil.l.velikov@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20170912133749.6532-2-maarten.lankhorst@linux.intel.com Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2017-09-11drm/tve200: Clean up panel bridgingLinus Walleij3-21/+13
This makes use of the drm_simple_display_pipe_attach_bridge() call and removes the two calls removing the bridge, which were erroneous: they unregister the bridge which is not what we want, we just want to unreference it and that is already handled by the core. Reviewed-by: Eric Anholt <eric@anholt.net> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20170910220801.28588-1-linus.walleij@linaro.org
2017-09-11drm/dp/mst: Sideband message transaction to power up/down nodesDhinakaran Pandiyan1-0/+74
The POWER_DOWN_PHY and POWER_UP_PHY sideband message transactions allow the source to reqest any node in a mst path or a whole path to be powered down or up. This allows drivers to target a specific sink in the MST topology, an improvement over just power managing the imediate downstream device. Secondly, since the request-reply protocol waits for an ACK, we can be sure that a downstream sink has enough time to respond to a power up/down request. v2: Fix memory leak (Lyude) Cc: Lyude <lyude@redhat.com> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20170907001458.9399-1-dhinakaran.pandiyan@intel.com Reviewed-by: Lyude Paul <lyude@redhat.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2017-09-11drm: Make __drm_object_property_get_value() staticVille Syrjälä1-2/+3
Make __drm_object_property_get_value() static to fix the following sparse warning: drm_mode_object.c:250:5: warning: symbol '__drm_object_property_get_value' was not declared. Should it be static? Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Fixes: 4a97a3da420b ("drm: Don't update property values for atomic drivers") Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20170901165328.24459-4-ville.syrjala@linux.intel.com Reviewed-by: Thierry Reding <treding@nvidia.com>
2017-09-11drm: Drop drm_get_link_status_name()Ville Syrjälä1-1/+0
drm_get_link_status_name() isn't used so kill it. Fixes the following sparse warning: drm_connector.c:618:1: warning: symbol 'drm_get_link_status_name' was not declared. Should it be static? Cc: Manasi Navare <manasi.d.navare@intel.com> Fixes: 40ee6fbef75f ("drm: Add a new connector atomic property for link status") Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20170901165328.24459-3-ville.syrjala@linux.intel.com Reviewed-by: Thierry Reding <treding@nvidia.com>
2017-09-11drm: Make syncobj import/export functions staticVille Syrjälä1-4/+4
Fix the following sparse warnings by making functions static: drm_syncobj.c:420:5: warning: symbol 'drm_syncobj_import_sync_file_fence' was not declared. Should it be static? drm_syncobj.c:441:5: warning: symbol 'drm_syncobj_export_sync_file' was not declared. Should it be static? Cc: Dave Airlie <airlied@redhat.com> Fixes: 3ee45a3b533a ("drm/syncobj: add sync_file interaction. (v1.2)") Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20170901165328.24459-1-ville.syrjala@linux.intel.com Reviewed-by: Thierry Reding <treding@nvidia.com>
2017-09-10drm/pl111: Add handling of Versatile platformsLinus Walleij5-10/+285
The ARM reference designs in the Versatile family: Integrator, Versatile and RealView can make use of the new DRM driver as well. We just need to create a bit of platform-specific code for them that we isolate to its own file. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20170908124709.4758-7-linus.walleij@linaro.org
2017-09-10drm/pl111: Add optional variant display en/disable callbacksLinus Walleij2-0/+9
The silcon and components around the PL111 may require some variants to perform special set-up of the display. Add two callbacks to manage this. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20170908124709.4758-6-linus.walleij@linaro.org
2017-09-10drm/pl111: Insert delay before powering up PL11xLinus Walleij1-3/+28
The old codebase has a delay between enabling and powering up the PL11x. According to the manual for PL110, ARM DDI 0161E page 1-5 and the PL111 manual ARM DDI 0293C page 1-6, the power sequence should be such that once Vdd is stable (which we assume it is at boot) LCDEN is enabled first and then CLPOWER should be enabled "after the signals have stabilized" and this is said to be display-dependent. The old codebase uses 20ms. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20170908124709.4758-5-linus.walleij@linaro.org
2017-09-10drm/pl111: Enable PL110 variantLinus Walleij3-25/+108
We detect and enable the use of the PL110 variant, an earlier incarnation of PL111. The only real difference is that the control and interrupt enable registers have swapped place. The Versatile AB and Versatile PB have a variant inbetween PL110 and PL111, it is PL110 but they have already swapped the two registers so those two need a bit of special handling. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20170908124709.4758-4-linus.walleij@linaro.org
2017-09-10drm/pl111: Replace custom connector with panel bridgeLinus Walleij6-168/+49
This replaces the custom connector in the PL111 with the panel bridge helper. This works nicely for all standard panels, but since there are several PL11x-based systems that will need to use the dumb VGA connector bridge we use drm_of_find_panel_or_bridge() and make some headroom for dealing with bridges that are not panels as well, and drop a TODO in the code. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20170908124709.4758-3-linus.walleij@linaro.org
2017-09-10drm/pl111: Add all registers to debugfsLinus Walleij1-0/+6
This adds all the main control registers to the debugfs register file. This was helpful for my debugging so it will likely help others as well. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20170908124709.4758-2-linus.walleij@linaro.org