summaryrefslogtreecommitdiffstats
path: root/drivers
AgeCommit message (Collapse)AuthorFilesLines
2017-01-19drm/bridge: adv7511: Rework adv7511_power_on/off() so they can be reused ↵John Stultz1-4/+11
internally In chasing down issues with EDID probing, I found some duplicated but incomplete logic used to power the chip on and off. This patch refactors the adv7511_power_on/off functions, so they can be used for internal needs. Cc: David Airlie <airlied@linux.ie> Cc: Archit Taneja <architt@codeaurora.org> Cc: Wolfram Sang <wsa+renesas@sang-engineering.com> Cc: Lars-Peter Clausen <lars@metafoo.de> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: dri-devel@lists.freedesktop.org Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Archit Taneja <architt@codeaurora.org> Link: http://patchwork.freedesktop.org/patch/msgid/1484614372-15342-5-git-send-email-john.stultz@linaro.org
2017-01-19drm/bridge: adv7511: Enable HPD interrupts to support hotplug and improve ↵Archit Taneja1-1/+5
monitor detection On some adv7511 implementations, we can get some spurious disconnect signals which can cause monitor probing to fail. This patch enables HPD (hot plug detect) interrupt support which allows the monitor to be properly re-initialized when the spurious disconnect signal goes away. This also enables proper hotplug support. Cc: David Airlie <airlied@linux.ie> Cc: Archit Taneja <architt@codeaurora.org> Cc: Wolfram Sang <wsa+renesas@sang-engineering.com> Cc: Lars-Peter Clausen <lars@metafoo.de> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: dri-devel@lists.freedesktop.org Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Originally-by: Archit Taneja <architt@codeaurora.org> [jstultz: Added proper commit message] Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Archit Taneja <architt@codeaurora.org> Link: http://patchwork.freedesktop.org/patch/msgid/1484614372-15342-4-git-send-email-john.stultz@linaro.org
2017-01-19drm/bridge: adv7511: Switch to using drm_kms_helper_hotplug_event()John Stultz1-1/+15
In chasing down a previous issue with EDID probing from calling drm_helper_hpd_irq_event() from irq context, Laurent noticed that the DRM documentation suggests that drm_kms_helper_hotplug_event() should be used instead. Thus this patch replaces drm_helper_hpd_irq_event() with drm_kms_helper_hotplug_event(), which requires we update the connector.status entry and only call _hotplug_event() when the status changes. Cc: David Airlie <airlied@linux.ie> Cc: Archit Taneja <architt@codeaurora.org> Cc: Wolfram Sang <wsa+renesas@sang-engineering.com> Cc: Lars-Peter Clausen <lars@metafoo.de> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: dri-devel@lists.freedesktop.org Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Archit Taneja <architt@codeaurora.org> Link: http://patchwork.freedesktop.org/patch/msgid/1484614372-15342-3-git-send-email-john.stultz@linaro.org
2017-01-19drm/bridge: adv7511: Use work_struct to defer hotplug handing to out of irq ↵John Stultz2-1/+12
context I was recently seeing issues with EDID probing, where the logic to wait for the EDID read bit to be set by the IRQ wasn't happening and the code would time out and fail. Digging deeper, I found this was due to the fact that IRQs were disabled as we were running in IRQ context from the HPD signal. Thus this patch changes the logic to handle the HPD signal via a work_struct so we can be out of irq context. With this patch, the EDID probing on hotplug does not time out. Cc: David Airlie <airlied@linux.ie> Cc: Archit Taneja <architt@codeaurora.org> Cc: Wolfram Sang <wsa+renesas@sang-engineering.com> Cc: Lars-Peter Clausen <lars@metafoo.de> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: dri-devel@lists.freedesktop.org Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Archit Taneja <architt@codeaurora.org> Link: http://patchwork.freedesktop.org/patch/msgid/1484614372-15342-2-git-send-email-john.stultz@linaro.org
2017-01-18drm: vc4: use crtc helper drm_crtc_from_index()Shawn Guo2-11/+7
Use drm_crtc_from_index() to find drm_crtc for given index, so that we do not need to maintain a pointer array in struct vc4_dev. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Cc: Eric Anholt <eric@anholt.net> Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: http://patchwork.freedesktop.org/patch/msgid/1483961145-18453-7-git-send-email-shawnguo@kernel.org
2017-01-18drm: tegra: use crtc helper drm_crtc_from_index()Shawn Guo1-16/+3
Function tegra_crtc_from_pipe() does the exactly same thing as what crtc helper drm_crtc_from_index() provides. Use the helper to save some code. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Cc: Thierry Reding <thierry.reding@gmail.com> Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: http://patchwork.freedesktop.org/patch/msgid/1483961145-18453-6-git-send-email-shawnguo@kernel.org
2017-01-18drm: nouveau: use crtc helper drm_crtc_from_index()Shawn Guo1-15/+18
Use drm_crtc_from_index() to find drm_crtc for given index. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Cc: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: http://patchwork.freedesktop.org/patch/msgid/1483961145-18453-5-git-send-email-shawnguo@kernel.org
2017-01-18drm: mediatek: use crtc helper drm_crtc_from_index()Shawn Guo2-6/+4
Use drm_crtc_from_index() to find drm_crtc for given index, so that we do not need to maintain a pointer array in struct mtk_drm_private. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Cc: CK Hu <ck.hu@mediatek.com> Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: http://patchwork.freedesktop.org/patch/msgid/1483961145-18453-4-git-send-email-shawnguo@kernel.org
2017-01-18drm: kirin: use crtc helper drm_crtc_from_index()Shawn Guo2-7/+4
Use drm_crtc_from_index() to find drm_crtc for given index, so that we do not need to maintain a pointer array in struct kirin_drm_private. Reviewed-by: Xinliang Liu<z.liuxinliang@hisilicon.com> Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: http://patchwork.freedesktop.org/patch/msgid/1483961145-18453-3-git-send-email-shawnguo@kernel.org
2017-01-18drm: exynos: use crtc helper drm_crtc_from_index()Shawn Guo2-14/+2
Use drm_crtc_from_index() to find drm_crtc for given index, so that we do not need to maintain a pointer array in struct exynos_drm_private. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Cc: Inki Dae <inki.dae@samsung.com> Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: http://patchwork.freedesktop.org/patch/msgid/1483961145-18453-2-git-send-email-shawnguo@kernel.org
2017-01-18drm: bridge: dw-hdmi: Assert SVSRET before resetting the PHYLaurent Pinchart1-5/+5
According to the PHY IP core vendor, the SVSRET signal must be asserted before resetting the PHY. Tests on RK3288 and R-Car Gen3 showed no regression, the change should thus be safe. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: Archit Taneja <architt@codeaurora.org> Link: http://patchwork.freedesktop.org/patch/msgid/20170117082910.27023-20-laurent.pinchart+renesas@ideasonboard.com
2017-01-18drm: bridge: dw-hdmi: Fix the name of the PHY reset macrosLaurent Pinchart2-5/+4
The PHY reset signal is controlled by bit PHYRSTZ in the MC_PHYRSTZ register. The signal is active low on Gen1 PHYs and active high on Gen2 PHYs. The driver toggles the signal high then low, which is correct for all currently supported platforms, but the register values macros are incorrectly named. Replace them with a single macro named after the bit, and add a comment to the source code to explain the behaviour. The driver's behaviour isn't changed by this rename, the code will still need to be fixed to support Gen1 PHYs. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: Archit Taneja <architt@codeaurora.org> Link: http://patchwork.freedesktop.org/patch/msgid/20170117082910.27023-19-laurent.pinchart+renesas@ideasonboard.com
2017-01-18drm: bridge: dw-hdmi: Define and use macros for PHY register addressesLaurent Pinchart2-15/+86
Replace the hardcoded register address numerical values with macros to clarify the code. This change has been tested by comparing the assembly code before and after the change. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: Archit Taneja <architt@codeaurora.org> Link: http://patchwork.freedesktop.org/patch/msgid/20170117082910.27023-18-laurent.pinchart+renesas@ideasonboard.com
2017-01-18drm: bridge: dw-hdmi: Detect PHY type at runtimeLaurent Pinchart1-3/+65
Detect the PHY type and use it to handle the PHY type-specific SVSRET signal. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Archit Taneja <architt@codeaurora.org> Link: http://patchwork.freedesktop.org/patch/msgid/20170117082910.27023-17-laurent.pinchart+renesas@ideasonboard.com
2017-01-18drm: bridge: dw-hdmi: Handle overflow workaround based on device versionLaurent Pinchart1-13/+33
Use the device version queried at runtime instead of the device type provided through platform data to handle the overflow workaround. This will make support of other SoCs integrating the same HDMI TX controller version easier. Among the supported platforms only i.MX6DL and i.MX6Q have been identified as needing the workaround. Disabling it on Rockchip RK3288 (which integrates a v2.00a controller) didn't produce any error or artifact. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: Archit Taneja <architt@codeaurora.org> Link: http://patchwork.freedesktop.org/patch/msgid/20170117082910.27023-16-laurent.pinchart+renesas@ideasonboard.com
2017-01-18drm: bridge: dw-hdmi: Detect AHB audio DMA using correct registerLaurent Pinchart2-3/+7
Bit 0 in CONFIG1_ID tells whether the IP core uses an AHB slave interface for control. The correct way to identify AHB audio DMA support is through bit 1 in CONFIG3_ID. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: Archit Taneja <architt@codeaurora.org> Link: http://patchwork.freedesktop.org/patch/msgid/20170117082910.27023-15-laurent.pinchart+renesas@ideasonboard.com
2017-01-18drm: bridge: dw-hdmi: Reject invalid product IDsLaurent Pinchart2-6/+27
The DWC HDMI TX can be recognized by the two product identification registers. If the registers don't read as expect the IP will be very different than what the driver has been designed for, or will be misconfigured in a way that makes it non-operational (invalid memory address, incorrect clocks, ...). We should reject this situation with an error. While this isn't critical for proper operation with supported IPs at the moment, the driver will soon gain automatic device-specific handling based on runtime device identification. This change makes it easier to implement that without having to default to a random guess in case the device can't be identified. While at it print a readable version number in the device identification message instead of raw register values. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: Archit Taneja <architt@codeaurora.org> Link: http://patchwork.freedesktop.org/patch/msgid/20170117082910.27023-14-laurent.pinchart+renesas@ideasonboard.com
2017-01-18drm: bridge: dw-hdmi: Rename CONF0 SPARECTRL bit to SVSRETLaurent Pinchart2-6/+6
The bit is documented in a Rockchip BSP as #define m_SVSRET_SIG (1 << 5) /* depend on PHY_MHL_COMB0=1 */ This is confirmed by a Renesas platform, which uses a 2.0 DWC HDMI TX as the RK3288. Rename the bit accordingly. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: Archit Taneja <architt@codeaurora.org> Link: http://patchwork.freedesktop.org/patch/msgid/20170117082910.27023-13-laurent.pinchart+renesas@ideasonboard.com
2017-01-18drm: bridge: dw-hdmi: Remove PHY configuration resolution parameterKieran Bingham1-22/+5
The current code hard codes the call of hdmi_phy_configure() to be 8bpp and provides extraneous error checking to verify that this hardcoded value is correct. Simplify the implementation by removing the argument. Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: Archit Taneja <architt@codeaurora.org> Link: http://patchwork.freedesktop.org/patch/msgid/20170117082910.27023-12-laurent.pinchart+renesas@ideasonboard.com
2017-01-18drm: bridge: dw-hdmi: Implement DRM bridge registrationLaurent Pinchart1-32/+80
As an option for drivers not based on the component framework, register the bridge with the DRM core with the DRM bridge API. Existing drivers based on dw_hdmi_bind() and dw_hdmi_unbind() are not affected as those functions are preserved with their current behaviour. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: Archit Taneja <architt@codeaurora.org> Link: http://patchwork.freedesktop.org/patch/msgid/20170117082910.27023-11-laurent.pinchart+renesas@ideasonboard.com
2017-01-18drm: bridge: dw-hdmi: Create connector in the bridge attach operationLaurent Pinchart1-13/+20
The DRM device is not guaranteed by the bridge API to be available before the attach callback. The driver performs properly at the moment as it doesn't use the drm_bridge_add() registration method. As this will be changed later, move connector creation to attach time to ensure compatibility with the API. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: Archit Taneja <architt@codeaurora.org> Link: http://patchwork.freedesktop.org/patch/msgid/20170117082910.27023-10-laurent.pinchart+renesas@ideasonboard.com
2017-01-18drm: bridge: dw-hdmi: Reorder functions to prepare for next commitLaurent Pinchart1-36/+36
The next commit will reference structures and functions in a way that currently requires forward declarations. Reorder the functions to avoid that. No functional change to the code is performed. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: Archit Taneja <architt@codeaurora.org> Link: http://patchwork.freedesktop.org/patch/msgid/20170117082910.27023-9-laurent.pinchart+renesas@ideasonboard.com
2017-01-18drm: bridge: dw-hdmi: Move IRQ and IO resource allocation to common codeLaurent Pinchart3-25/+12
There's no need to duplicate identical code in multiple drivers (two at the moment, one more to come soon). Move it to the dw-hdmi core where it can be shared. If resource allocation ever becomes device-specific later we'll always have the option of splitting it out again. While it at pass the platform device to the bind function to avoid having to cast struct device to struct platform_device. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: Archit Taneja <architt@codeaurora.org> Link: http://patchwork.freedesktop.org/patch/msgid/20170117082910.27023-8-laurent.pinchart+renesas@ideasonboard.com
2017-01-18drm: bridge: dw-hdmi: Don't forward HPD events to DRM core before attachLaurent Pinchart1-1/+2
Hotplug events should only be forwarded to the DRM core by the interrupt handler when the bridge has been attached, otherwise the DRM device pointer will be NULL, resulting in a crash. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: Archit Taneja <architt@codeaurora.org> Link: http://patchwork.freedesktop.org/patch/msgid/20170117082910.27023-7-laurent.pinchart+renesas@ideasonboard.com
2017-01-18drm: bridge: dw-hdmi: Remove encoder field from struct dw_hdmiLaurent Pinchart1-6/+3
The field isn't needed, remove it. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: Archit Taneja <architt@codeaurora.org> Link: http://patchwork.freedesktop.org/patch/msgid/20170117082910.27023-6-laurent.pinchart+renesas@ideasonboard.com
2017-01-18drm: bridge: dw-hdmi: Embed drm_bridge in struct dw_hdmiLaurent Pinchart1-10/+3
The drm_bridge instance is always needed, there's no point in allocating it separately. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: Archit Taneja <architt@codeaurora.org> Link: http://patchwork.freedesktop.org/patch/msgid/20170117082910.27023-5-laurent.pinchart+renesas@ideasonboard.com
2017-01-18drm: bridge: dw-hdmi: Remove unused function parameterKieran Bingham1-5/+2
The 'prep' parameter passed to hdmi_phy_configure() is useless. It is hardcoded as 0, and if set, simply prevents the configure function from executing. Remove it. Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: Archit Taneja <architt@codeaurora.org> Link: http://patchwork.freedesktop.org/patch/msgid/20170117082910.27023-4-laurent.pinchart+renesas@ideasonboard.com
2017-01-18drm: bridge: dw-hdmi: Remove unneeded arguments to bind/unbind functionsLaurent Pinchart3-9/+7
The master argument isn't used. The data argument, a void pointer, is used by the bind function only where it's cast to a drm_device pointer, which can easily be obtained from the encoder argument instead. Remove them. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: Archit Taneja <architt@codeaurora.org> Link: http://patchwork.freedesktop.org/patch/msgid/20170117082910.27023-3-laurent.pinchart+renesas@ideasonboard.com
2017-01-18drm: bridge: dw-hdmi: Merge __hdmi_phy_i2c_write and hdmi_phy_i2c_writeLaurent Pinchart1-8/+1
The latter is just an int wrapper around the former void function that unconditionally returns 0. As the return value is never checked, merge the two functions into one. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: Archit Taneja <architt@codeaurora.org> Link: http://patchwork.freedesktop.org/patch/msgid/20170117082910.27023-2-laurent.pinchart+renesas@ideasonboard.com
2017-01-17drm: qxl: Let DRM core handle connector registeringGabriel Krisman Bertazi1-1/+0
Registering the connector explicitly right after creation is not necessary for modesetting drivers, because drm_dev_register already takes care of this on the core side, by calling drm_modeset_register_all. In addition, performing the initialization too early will get in the way of the load() hook removal, because the connector interface cannot be published prior to registering the minors. Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk> CC: Dave Airlie <airlied@redhat.com> CC: Daniel Vetter <daniel.vetter@ffwll.ch> CC: dri-devel@lists.freedesktop.org Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com> Link: http://patchwork.freedesktop.org/patch/msgid/20170112161610.19924-1-krisman@collabora.co.uk
2017-01-17drm/bridge: adv7511: Initialize regulatorsArchit Taneja2-9/+81
Maintain a table of regulator names expected by ADV7511 and ADV7533. Use regulator_bulk_* api to configure these. Initialize and enable the regulators during probe itself. Controlling these dynamically is left for later. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Archit Taneja <architt@codeaurora.org> Link: http://patchwork.freedesktop.org/patch/msgid/1484117547-26417-3-git-send-email-architt@codeaurora.org
2017-01-12drm/tegra: Stop using drm_framebuffer_unregister_privateDaniel Vetter1-5/+2
This is the deprecated function for when you embedded the framebuffer somewhere else (which breaks refcounting). But Tegra is using drm_framebuffer_remove and a free-standing FB, so this is redundant. One caveat here is that the failure path in the init code still manually cleaned up the fb. I presume that was an oversight and changed it over to drm_framebuffer_remove too. Cc: Thierry Reding <thierry.reding@gmail.com> Reviewed-by: Archit Taneja <architt@codeaurora.org> Acked-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1482835765-12044-5-git-send-email-daniel.vetter@ffwll.ch Link: http://patchwork.freedesktop.org/patch/msgid/1482835765-12044-2-git-send-email-daniel.vetter@ffwll.ch
2017-01-12drm/cma-helper: Stop using drm_framebuffer_unregister_privateDaniel Vetter1-6/+3
This is the deprecated function for when you embedded the framebuffer somewhere else (which breaks refcounting). But cma helpers are using drm_framebuffer_remove and a free-standing fb, so this is rendundant. Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1482835765-12044-2-git-send-email-daniel.vetter@ffwll.ch
2017-01-12drm/omap: Stop using drm_framebuffer_unregister_privateDaniel Vetter1-6/+2
This is the deprecated function for when you embedded the framebuffer somewhere else (which breaks refcounting). But omapdrm is using drm_framebuffer_remove and a free-standing fb, so this is rendundant. Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1482835765-12044-4-git-send-email-daniel.vetter@ffwll.ch
2017-01-12drm: fix MMU dependenciesBenjamin Gaignard1-2/+2
DRM_VM and DRM_LEGACY shouldn't be selected if MMU isn't set. Fixes: 62a0d98a188c ("drm: allow to use mmuless SoC") Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1484211456-5759-1-git-send-email-benjamin.gaignard@linaro.org
2017-01-12drm/msm: Stop using drm_framebuffer_unregister_privateDaniel Vetter1-4/+1
This is the deprecated function for when you embedded the framebuffer somewhere else (which breaks refcounting). But msm is using drm_framebuffer_remove and a free-standing fb, so this is rendundant. Cc: Rob Clark <robdclark@gmail.com> Reviewed-by: Archit Taneja <architt@codeaurora.org> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1482835765-12044-1-git-send-email-daniel.vetter@ffwll.ch
2017-01-12drm/atomic: Add target_vblank support in atomic helpers (v2)Andrey Grodzovsky1-21/+112
Allows usage of the new page_flip_target hook for drivers implementing the atomic path. Provides default atomic helper for the new hook. v2: Update code sharing logic between exsiting and the new flip hooks. Improve kerneldoc. Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1483735180-4173-1-git-send-email-Andrey.Grodzovsky@amd.com
2017-01-11drm: add more MMU dependenciesArnd Bergmann3-1/+3
Many DRM drivers only work with an MMU, and after the patch to enable core DRM support without MMU, we already had one fixup for many of them. The etnaviv, armada and msm drivers were missed and have the same problem: warning: (DRM_ETNAVIV) selects IOMMU_SUPPORT which has unmet direct dependencies (MMU) warning: (DRM_I915 && DRM_MSM && DRM_ETNAVIV) selects SHMEM which has unmet direct dependencies (MMU) drivers/gpu/drm/armada/armada_gem.o: In function `armada_gem_vm_fault': armada_gem.c:(.text.armada_gem_vm_fault+0x14): undefined reference to `vm_insert_pfn' arch/arm/mm/dma-mapping.c: In function '__iommu_alloc_remap': arch/arm/mm/dma-mapping.c:1390:4: error: 'VM_ARM_DMA_CONSISTENT' undeclared (first use in this function) arch/arm/mm/dma-mapping.c:1456:31: error: 'atomic_pool' undeclared (first use in this function); did you mean 'atomic_xor'? Fixes: 011cda589938 ("drm: fix compilations issues introduced by "drm: allow to use mmuless SoC"") Fixes: 62a0d98a188c ("drm: allow to use mmuless SoC") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20170111133357.3664191-2-arnd@arndb.de
2017-01-11drm: Fix error handling in drm_mm eviction kselftestChris Wilson1-3/+9
drivers/gpu/drm/selftests/test-drm_mm.c:1277 evict_everything() warn: calling list_del() inside list_for_each The list_del() inside the error handling in the eviction loop is overkill. We have to undo the eviction scan to return the drm_mm back to a recoverable state, so have to iterate over the full list, but we only want to report the error once and once we have an error we can return early. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Fixes: 560b32842912 ("drm: kselftest for drm_mm and eviction") Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20170110144031.7609-1-chris@chris-wilson.co.uk
2017-01-10drm/exynos: constify exynos_drm_crtc_ops structuresBhumika Goyal1-1/+1
Declare exynos_drm_crtc_ops structures as const as they are only passed as an argument to the function exynos_drm_crtc_create. This argument is of type const struct exynos_drm_crtc_ops *, so exynos_drm_crtc_ops structures having this property can be declared const. Done using Coccinelle: @r disable optional_qualifier@ identifier i; position p; @@ static struct exynos_drm_crtc_ops i@p={...}; @ok@ position p; identifier r.i; @@ exynos_drm_crtc_create(...,&i@p,...) @bad@ position p!={r.p,ok.p}; identifier r.i; @@ i@p @depends on !bad disable optional_qualifier@ identifier r.i; @@ +const struct exynos_drm_crtc_ops i; File size before: text data bss dec hex filename 5008 280 0 5288 14a8 exynos/exynos5433_drm_decon.o File size after: text data bss dec hex filename 5120 176 0 5296 14b0 exynos/exynos5433_drm_decon.o Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1483984493-25284-1-git-send-email-bhumirks@gmail.com
2017-01-10drm: Move drm_clflush prototypes to drm_cache header fileGabriel Krisman Bertazi2-0/+2
Continue to clean up drmP.h by moving the cache flushing functions into it's own header file. Compile-tested only Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20170109215649.6860-2-krisman@collabora.co.uk
2017-01-10drm: Document drm_cache interfaceGabriel Krisman Bertazi1-0/+23
Notice that this uncovers an issue with the kernel-doc handling of array arguments, causing the first parameter of drm_clflush_pages() to not show up in the rst-generated page. A proposed fix is under review in linux-doc: <http://www.spinics.net/lists/linux-doc/msg42544.html> Changes since v1: - Add section to drm-mm.rst. - Fix kernel-doc style issues. - s/memory/kernel memory/. Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20170109215649.6860-1-krisman@collabora.co.uk
2017-01-10Merge tag 'drm-misc-next-2017-01-09' of ↵Dave Airlie102-436/+513
git://anongit.freedesktop.org/git/drm-misc into drm-next Back to regular -misc pulls with reasonable sizes: - dma_fence error clarification (Chris) - drm_crtc_from_index helper (Shawn), pile more patches on the m-l to roll this out to drivers - mmu-less support for fbdev helpers from Benjamin - piles of kerneldoc work - some polish for crc support from Tomeu and Benjamin - odd misc stuff all over * tag 'drm-misc-next-2017-01-09' of git://anongit.freedesktop.org/git/drm-misc: (48 commits) dma-fence: Introduce drm_fence_set_error() helper dma-fence: Wrap querying the fence->status dma-fence: Clear fence->status during dma_fence_init() drm: fix compilations issues introduced by "drm: allow to use mmuless SoC" drm: Change the return type of the unload hook to void drm: add more document for drm_crtc_from_index() drm: remove useless parameters from drm_pick_cmdline_mode function drm: crc: Call wake_up_interruptible() each time there is a new CRC entry drm: allow to use mmuless SoC drm: compile drm_vm.c only when needed fbmem: add a default get_fb_unmapped_area function drm: crc: Wait for a frame before returning from open() drm: Move locking into drm_debugfs_crtc_crc_add drm/imx: imx-tve: Remove unused variable Revert "drm: nouveau: fix build when LEDS_CLASS=m" drm: Add kernel-doc for drm_crtc_commit_get/put drm/atomic: Fix outdated comment. drm: reference count event->completion gpu: drm: mgag200: mgag200_main:- Handle error from pci_iomap drm: Document deprecated load/unload hook ...
2017-01-10Merge tag 'drm-intel-next-2017-01-09' of ↵Dave Airlie96-4131/+9551
git://anongit.freedesktop.org/git/drm-intel into drm-next More 4.11 stuff, holidays edition (i.e. not much): - docs and cleanups for shared dpll code (Ander) - some kerneldoc work (Chris) - fbc by default on gen9+ too, yeah! (Paulo) - fixes, polish and other small things all over gem code (Chris) - and a few small things on top Plus a backmerge, because Dave was enjoying time off too. * tag 'drm-intel-next-2017-01-09' of git://anongit.freedesktop.org/git/drm-intel: (275 commits) drm/i915: Update DRIVER_DATE to 20170109 drm/i915: Drain freed objects for mmap space exhaustion drm/i915: Purge loose pages if we run out of DMA remap space drm/i915: Fix phys pwrite for struct_mutex-less operation drm/i915: Simplify testing for am-I-the-kernel-context? drm/i915: Use range_overflows() drm/i915: Use fixed-sized types for stolen drm/i915: Use phys_addr_t for the address of stolen memory drm/i915: Consolidate checks for memcpy-from-wc support drm/i915: Only skip requests once a context is banned drm/i915: Move a few more utility macros to i915_utils.h drm/i915: Clear ret before unbinding in i915_gem_evict_something() drm/i915/guc: Exclude the upper end of the Global GTT for the GuC drm/i915: Move a few utility macros into a separate header drm/i915/execlists: Reorder execlists register enabling drm/i915: Assert that we do create the deferred context drm/i915: Assert all timeline requests are gone before fini drm/i915: Revoke fenced GTT mmapings across GPU reset drm/i915: enable FBC on gen9+ too drm/i915: actually drive the BDW reserved IDs ...
2017-01-09dma-fence: Introduce drm_fence_set_error() helperChris Wilson1-1/+1
The dma_fence.error field (formerly known as dma_fence.status) is an optional field that may be set by drivers before calling dma_fence_signal(). The field can be used to indicate that the fence was completed in err rather than with success, and is visible to other consumers of the fence and to userspace via sync_file. This patch renames the field from status to error so that its meaning is hopefully more clear (and distinct from dma_fence_get_status() which is a composite between the error state and signal state) and adds a helper that validates the preconditions of when it is suitable to adjust the error field. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Sumit Semwal <sumit.semwal@linaro.org> Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org> Link: http://patchwork.freedesktop.org/patch/msgid/20170104141222.6992-3-chris@chris-wilson.co.uk
2017-01-09dma-fence: Wrap querying the fence->statusChris Wilson3-13/+35
The fence->status is an optional field that is only valid once the fence has been signaled. (Driver may fill the fence->status with an error code prior to calling dma_fence_signal().) Given the restriction upon its validity, wrap querying of the fence->status into a helper dma_fence_get_status(). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Sumit Semwal <sumit.semwal@linaro.org> Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org> Link: http://patchwork.freedesktop.org/patch/msgid/20170104141222.6992-2-chris@chris-wilson.co.uk
2017-01-09dma-fence: Clear fence->status during dma_fence_init()Chris Wilson1-0/+1
As the fence->status is an optional field that may be set before dma_fence_signal() is called to convey that the fence completed with an error, we have to ensure that it is always set to zero on initialisation so that the typical use (i.e. unset) always flags a successful completion. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Sumit Semwal <sumit.semwal@linaro.org> Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org> Link: http://patchwork.freedesktop.org/patch/msgid/20170104141222.6992-1-chris@chris-wilson.co.uk
2017-01-09drm: fix compilations issues introduced by "drm: allow to use mmuless SoC"Benjamin Gaignard11-12/+12
Removing MMU configuration flag from DRM make few automatic build failed when they answer yes to all flags. Add asm/vga.h file on Blackfin architecture to not broke compilation. Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org> Fixes: 62a0d98a188c ("drm: allow to use mmuless SoC") Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1483789151-6603-1-git-send-email-benjamin.gaignard@linaro.org
2017-01-09drm: Change the return type of the unload hook to voidGabriel Krisman Bertazi32-69/+38
The integer returned by the unload hook is ignored by the drm core, so let's make it void. This patch was created using the following Coccinelle semantic script (except for the declaration and comment in drm_drv.h): Compile-tested only. // <smpl> @ get_name @ struct drm_driver drv; identifier fn; @@ drv.unload = fn; @ replace_type @ identifier get_name.fn; @@ - int + void fn (...) { ... } @ remove_return_param @ identifier get_name.fn; @@ void fn (...) { <... if (...) return - ... ; ...> } @ drop_final_return @ identifier get_name.fn; @@ void fn (...) { ... - return 0; } // </smpl> Suggested-by: Daniel Vetter <daniel.vetter@intel.com> Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk> Acked-by: Christian König <christian.koenig@amd.com>. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20170106175731.29196-1-krisman@collabora.co.uk
2017-01-09drm: add more document for drm_crtc_from_index()Shawn Guo2-2/+5
Add a bit more document for function drm_crtc_from_index() to cross link it with drm_crtc_from_index(), and explain that the function is useful in vblank code. While at it, add cross link comment for drm_plane_from_index() as well. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1483779131-19935-1-git-send-email-shawnguo@kernel.org