summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2016-07-12qxl: check for kmap failuresDan Carpenter
If kmap fails, it leads to memory corruption. Fixes: f64122c1f6ad ('drm: add new QXL driver. (v1.4)') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20160711084633.GA31411@mwanda
2016-07-12vga_switcheroo: Sphinxify docsLukas Wunner
Fix up formatting glitches remaining after the automatic rst conversion. Cc: Jonathan Corbet <corbet@lwn.net> Cc: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Lukas Wunner <lukas@wunner.de> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/3a369602ae35fdbf5e4a12f7e172088c89fa27bb.1468225027.git.lukas@wunner.de
2016-07-12drm: Restore double clflush on the last partial cachelineChris Wilson
This effectively reverts commit afcd950cafea6e27b739fe7772cbbeed37d05b8b Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Wed Jun 10 15:58:01 2015 +0100 drm: Avoid the double clflush on the last cache line in drm_clflush_virt_range() as we have observed issues with serialisation of the clflush operations on Baytrail+ Atoms with partial updates. Applying the double flush on the last cacheline forces that clflush to be ordered with respect to the previous clflush, and the mfence then protects against prefetches crossing the clflush boundary. The same issue can be demonstrated in userspace with igt/gem_exec_flush. Fixes: afcd950cafea6 (drm: Avoid the double clflush on the last cache...) Testcase: igt/gem_concurrent_blit Testcase: igt/gem_partial_pread_pwrite Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92845 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: dri-devel@lists.freedesktop.org Cc: Akash Goel <akash.goel@intel.com> Cc: Imre Deak <imre.deak@intel.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Jason Ekstrand <jason.ekstrand@intel.com> Cc: stable@vger.kernel.org Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1467880930-23082-6-git-send-email-chris@chris-wilson.co.uk
2016-07-12gpu: drm: rockchip_drm_drv: add missing of_node_put after calling ↵Peter Chen
of_parse_phandle of_node_put needs to be called when the device node which is got from of_parse_phandle has finished using. Cc: Mark Yao <mark.yao@rock-chips.com> Cc: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1467684294-20111-2-git-send-email-peter.chen@nxp.com
2016-07-12gpu: drm: sti_vtg: add missing of_node_put after calling of_parse_phandlePeter Chen
of_node_put needs to be called when the device node which is got from of_parse_phandle has finished using. Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org> Cc: Vincent Abriou <vincent.abriou@st.com> Signed-off-by: Peter Chen <peter.chen@nxp.com> Acked-by: Benjamin Gaignard <benjamin.gaignard@linaro.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1467684294-20111-6-git-send-email-peter.chen@nxp.com
2016-07-12gpu: drm: sti_hqvdp: add missing of_node_put after calling of_parse_phandlePeter Chen
of_node_put needs to be called when the device node which is got from of_parse_phandle has finished using. Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org> Cc: Vincent Abriou <vincent.abriou@st.com> Signed-off-by: Peter Chen <peter.chen@nxp.com> Acked-by: Benjamin Gaignard <benjamin.gaignard@linaro.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1467684294-20111-5-git-send-email-peter.chen@nxp.com
2016-07-12gpu: drm: sti_vdo: add missing of_node_put after calling of_parse_phandlePeter Chen
of_node_put needs to be called when the device node which is got from of_parse_phandle has finished using. Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org> Cc: Vincent Abriou <vincent.abriou@st.com> Signed-off-by: Peter Chen <peter.chen@nxp.com> Acked-by: Benjamin Gaignard <benjamin.gaignard@linaro.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1467684294-20111-4-git-send-email-peter.chen@nxp.com
2016-07-12gpu: drm: sti_compositor: add missing of_node_put after calling of_parse_phandlePeter Chen
of_node_put needs to be called when the device node which is got from of_parse_phandle has finished using. Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org> Cc: Vincent Abriou <vincent.abriou@st.com> Signed-off-by: Peter Chen <peter.chen@nxp.com> Acked-by: Benjamin Gaignard <benjamin.gaignard@linaro.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1467684294-20111-3-git-send-email-peter.chen@nxp.com
2016-07-12drm/tilcdc: use drm_crtc_handle_vblank()Gustavo Padovan
Remove legacy usage of drm_handle_vblank() Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1467677092-5089-6-git-send-email-gustavo@padovan.org
2016-07-12drm/rcar-du: use drm_crtc_handle_vblank()Gustavo Padovan
Remove legacy usage of drm_handle_vblank() Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1467677092-5089-5-git-send-email-gustavo@padovan.org
2016-07-12drm/nouveau: use drm_crtc_handle_vblank()Gustavo Padovan
Remove legacy usage of drm_handle_vblank() Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1467677092-5089-4-git-send-email-gustavo@padovan.org
2016-07-12drm/atmel: use drm_crtc_handle_vblank()Gustavo Padovan
Remove legacy usage of drm_handle_vblank() Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1467677092-5089-3-git-send-email-gustavo@padovan.org
2016-07-12drm/armada: use drm_crtc_handle_vblank()Gustavo Padovan
Remove legacy usage of drm_handle_vblank() Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1467677092-5089-2-git-send-email-gustavo@padovan.org
2016-07-12drm: make drm_vblank_count_and_time() staticGustavo Padovan
As they are not used anywhere outside drm_irq.c make them static. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1467677092-5089-1-git-send-email-gustavo@padovan.org
2016-07-12drm/mediatek/mtk_mipi_tx: checking the wrong variableDan Carpenter
We should be checking "phy_provider" here not "phy". Fixes: 2e54c14e310f ('drm/mediatek: Add DSI sub driver') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20160701135934.GA15723@mwanda
2016-07-12drm/qxl: Remove deprecated create_singlethread_workqueueBhaktipriya Shridhar
System workqueues have been able to handle high level of concurrency for a long time now and there's no reason to use dedicated workqueues just to gain concurrency. Since the workqueue in the QXL graphics device driver is involved in freeing and processing the release ring (workitem &qdev->gc_workqxl, maps to gc_work which calls qxl_garbage_collect) and is not being used on a memory reclaim path, dedicated gc_queue has been replaced with the use of system_wq. Unlike a dedicated per-cpu workqueue created with create_workqueue(), system_wq allows multiple work items to overlap executions even on the same CPU; however, a per-cpu workqueue doesn't have any CPU locality or global ordering guarantees unless the target CPU is explicitly specified and thus the increase of local concurrency shouldn't make any difference. flush_work() has been called in qxl_device_fini() to ensure that there are no pending tasks while disconnecting the driver. Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20160702110209.GA3560@Karyakshetra
2016-07-12drm/hisilicon: Fix ADE vblank on/off handlingXinliang Liu
Vblank turn on should be called in crtc's enable callback. And turn off called in crtc's disable callback. Thanks to Daniel Vetter, this bug is reported by him. Reported-by: Daniel Vetter <daniel.vetter@intel.com> Signed-off-by: Xinliang Liu <xinliang.liu@linaro.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20160630092300.141864-1-xinliang.liu@linaro.org
2016-07-12drm_aux-dev: fix error handling in drm_dp_aux_dev_init()Alexey Khoroshilov
If class_create() fails, there is no need for class_destroy(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1467237135-13075-1-git-send-email-khoroshilov@ispras.ru
2016-07-12drm: Fix broken use of _PAGE_NO_CACHE on powerpcBenjamin Herrenschmidt
That constant isn't meant to be used outside of arch mm code Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1467018023.20278.65.camel@kernel.crashing.org
2016-07-12drm/dsi: Make set_tear_scanline command consistentThierry Reding
Use a consistent name for the function that implements set_tear_scanline and reword and reformat the kerneldoc slightly. Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20160613133327.7630-1-thierry.reding@gmail.com
2016-07-12drm/qxl: Remove dead codeThierry Reding
The QXL driver sets DRIVER_MODESET unconditionally, so testing for the absence of the feature will always fail. Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1466788520-21325-5-git-send-email-frank.binns@imgtec.com
2016-07-12drm/vmwgfx: Stop checking minor type directlyFrank Binns
Use the appropriate drm minor type helper instead. Cc: Sinclair Yeh <syeh@vmware.com> Cc: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Frank Binns <frank.binns@imgtec.com> Reviewed-by: Sinclair Yeh <syeh@vmware.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1466788520-21325-2-git-send-email-frank.binns@imgtec.com
2016-07-12drm/udl: Unplugging a device now unregisters itChris Wilson
Rather than manually perform our unregistration actions before shutting down the device, move them to drm_unplug_dev(). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: David Airlie <airlied@linux.ie> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Alexey Brodkin <Alexey.Brodkin@synopsys.com> Cc: Amitoj Kaur Chawla <amitoj1606@gmail.com> Cc: dri-devel@lists.freedesktop.org Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1466778982-6974-4-git-send-email-chris@chris-wilson.co.uk
2016-07-12drm: Do a full device unregister when unpluggingChris Wilson
Rather than do a partial unregister of just the minors, unregister the device (drm_dev_unregister(), and so remove all userspace interfaces, when the device is unplugged (drm_unplug_dev()). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: David Airlie <airlied@linux.ie> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Alexey Brodkin <Alexey.Brodkin@synopsys.com> Cc: Amitoj Kaur Chawla <amitoj1606@gmail.com> Cc: dri-devel@lists.freedesktop.org Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1466778982-6974-3-git-send-email-chris@chris-wilson.co.uk
2016-07-12drm: Unexport drm_connector_register_all()Chris Wilson
This has now been removed from all drivers as it is performed centrally as a part of device registration for modesetting drivers. With the last user gone, we can unexport it from the DRM module. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: David Airlie <airlied@linux.ie> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: dri-devel@lists.freedesktop.org Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1466778982-6974-1-git-send-email-chris@chris-wilson.co.uk Link: http://patchwork.freedesktop.org/patch/msgid/1466778982-6974-2-git-send-email-chris@chris-wilson.co.uk
2016-07-12drm/exynos: make fbdev support really optionalTobias Jakobi
Currently enabling Exynos DRM support automatically pulls in lots of fbdev dependencies. However these deps are unnecessary since DRM core already enables them when needed. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1466769168-31602-1-git-send-email-tjakobi@math.uni-bielefeld.de
2016-07-12drm: Only handle _DRM_VBLANK_NEXTONMISS onceMichel Dänzer
Consolidate the _DRM_VBLANK_NEXTONMISS handling between drm_wait_vblank and drm_queue_vblank_event. This is a cleanup spotted while working on other changes. (The way it was previously handled could also theoretically result in drm_queue_vblank_event unnecessarily bumping vblwait->request.sequence, if the vblank counter happened to increment between the drm_vblank_count(_and_time) calls in each function, but that's unlikely) Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1466755187-29418-1-git-send-email-michel@daenzer.net
2016-07-12drm/vgem: Enable dmabuf interface for exportChris Wilson
Enable the standard GEM dma-buf interface provided by the DRM core, but only for exporting the VGEM object. This allows passing around the VGEM objects created from the dumb interface and using them as sources elsewhere. Creating a VGEM object for a foriegn handle is not supported. v2: With additional completeness. v3: Need to clear the CPU cache upon exporting the dma-addresses. v4: Use drm_gem_put_pages() as well. v5: Use drm_prime_pages_to_sg() Testcase: igt/vgem_basic/dmabuf-* Testcase: igt/prime_vgem Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Sean Paul <seanpaul@chromium.org> Cc: Zach Reizner <zachr@google.com> Acked-by: Zach Reizner <zachr@google.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1468242488-1505-3-git-send-email-chris@chris-wilson.co.uk
2016-07-12drm/vgem: Fix mmapingChris Wilson
The vGEM mmap code has bitrotted slightly and now immediately BUGs. Since vGEM was last updated, there are new core GEM facilities to provide more common functions, so let's use those here. v2: drm_gem_free_mmap_offset() is performed from drm_gem_object_release() so we can remove the redundant call. Testcase: igt/vgem_basic/mmap Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96603 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Sean Paul <seanpaul@chromium.org> Cc: Zach Reizner <zachr@google.com> Cc: Matthew Auld <matthew.auld@intel.com> Tested-by: Humberto Israel Perez Rodriguez <humberto.i.perez.rodriguez@intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1466692534-28303-1-git-send-email-chris@chris-wilson.co.uk
2016-06-30drm: Fix a typo in drm_ioctl.cMasanari Iida
This patch fix a spelling typo found in Documentation/DocBook/gpu/API-drm-ioctl-flags.html It is because the html file was created from comments in source, I have to fix the source. Signed-off-by: Masanari Iida <standby24x7@gmail.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20160629234706.31209-1-standby24x7@gmail.com
2016-06-27drm: fix some spelling mistakesFrank Binns
Signed-off-by: Frank Binns <frank.binns@imgtec.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1466763337-27428-1-git-send-email-frank.binns@imgtec.com
2016-06-24drm/nouveau/dispnv04: Use helper to turn off CRTCLukas Wunner
Use shiny new drm_crtc_force_disable() instead of open coding the same. No functional change intended. Cc: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Lukas Wunner <lukas@wunner.de> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/95bfab0175ea327f777d43dcc18034bf42ca2287.1465392124.git.lukas@wunner.de
2016-06-24drm/i2c/ch7006: Use helper to turn off CRTCLukas Wunner
Use shiny new drm_crtc_force_disable() instead of open coding the same. No functional change intended. Cc: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Lukas Wunner <lukas@wunner.de> Reviewed-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/ec7d5c06e2a21dfb8f9fc9413d3e6df86d6aa1fb.1465392124.git.lukas@wunner.de
2016-06-24drm: Use helper to turn off CRTCLukas Wunner
Use shiny new drm_crtc_force_disable() instead of open coding the same. No functional change intended. Signed-off-by: Lukas Wunner <lukas@wunner.de> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/fce52e55fa5a3a2c1436205d26fc1cec70d01eea.1465392124.git.lukas@wunner.de
2016-06-24drm/amdgpu: Turn off CRTCs on driver unloadLukas Wunner
amdgpu leaks a runtime pm ref if at least one CRTC is enabled on unload. The ref is taken by amdgpu_crtc_set_config() and held as long as a CRTC is in use. Fix by turning off all CRTCs on unload. Cc: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Lukas Wunner <lukas@wunner.de> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/7bf8d9ceb9d343a7495788667e6da170b8fd3af1.1465392124.git.lukas@wunner.de
2016-06-24drm/radeon: Turn off CRTCs on driver unloadLukas Wunner
radeon leaks a runtime pm ref if at least one CRTC is enabled on unload. The ref is taken by radeon_crtc_set_config() and held as long as a CRTC is in use. Fix by turning off all CRTCs on unload. Cc: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Lukas Wunner <lukas@wunner.de> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/f706b9db319e2bdaf153966a2b95a5d80f67e09b.1465392124.git.lukas@wunner.de
2016-06-24drm/nouveau: Turn off CRTCs on driver unloadLukas Wunner
nouveau leaks a runtime pm ref if at least one CRTC is enabled on unload. The ref is taken by nouveau_crtc_set_config() and held as long as a CRTC is in use. nv04_display_destroy() should solve this by turning off all CRTCs, but (1) nv50_display_destroy() doesn't do the same and (2) it's broken since commit d6bf2f370703 ("drm/nouveau: run mode_config destructor before destroying internal display state") because the crtc structs are torn down by drm_mode_config_cleanup() before being turned off. Also, there's no locking. Move the code to turn off all CRTCs from nv04_display_destroy() to nouveau_display_destroy() so that it's called for both nv04 and nv50 and before drm_mode_config_cleanup(). Use drm_crtc_force_disable_all() helper to save on code and have proper locking. Cc: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Lukas Wunner <lukas@wunner.de> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/66daa161322444bbde05d83cb0210b90a66988a4.1465392124.git.lukas@wunner.de
2016-06-24drm: Add helpers to turn off CRTCsLukas Wunner
Turning off a single CRTC or all active CRTCs of a DRM device is a fairly common pattern. Add helpers to avoid open coding this everywhere. The name was chosen to be consistent with drm_plane_force_disable(). Cc: Daniel Vetter <daniel@ffwll.ch> Signed-off-by: Lukas Wunner <lukas@wunner.de> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-06-24drm/amdgpu: Forbid runtime pm on driver unloadLukas Wunner
The PCI core calls pm_runtime_forbid() on device probe in pci_pm_init(), making this the default state when amdgpu is loaded. amdgpu_driver_load_kms() therefore calls pm_runtime_allow(), but there's no pm_runtime_forbid() in amdgpu_driver_unload_kms() to balance it. Add it so that we leave the device in the same state that we found it. This isn't a bug, it's just good housekeeping. When amdgpu is first loaded with runpm=1, then unloaded and loaded again with runpm=0, pm_runtime_forbid() will be called from amdgpu_pmops_runtime_idle() or amdgpu_pmops_runtime_suspend(), so the behaviour is correct. If there ever is a third party driver for AMD cards, this commit avoids that it has to clean up behind amdgpu. Cc: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Lukas Wunner <lukas@wunner.de> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/ccd4f7208acbd7761364418fc34f7849acbb4597.1465392124.git.lukas@wunner.de
2016-06-24drm/amdgpu: Don't leak runtime pm ref on driver loadLukas Wunner
If an error occurs in amdgpu_device_init() after adev->rmmio has been set, its caller amdgpu_driver_load_kms() will skip runtime pm initialization and call amdgpu_driver_unload_kms(), which acquires a runtime pm ref that is leaked. Balance by releasing a runtime pm ref in the error path of amdgpu_driver_load_kms(). Fixes: d38ceaf99ed0 ("drm/amdgpu: add core driver (v4)") Cc: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Lukas Wunner <lukas@wunner.de> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/9a53449865759d7499a439ca2776093ee117b1eb.1465392124.git.lukas@wunner.de
2016-06-24drm/amdgpu: Don't leak runtime pm ref on driver unloadLukas Wunner
amdgpu_driver_load_kms() calls pm_runtime_put_autosuspend() if amdgpu_device_is_px(dev), but amdgpu_driver_unload_kms() calls pm_runtime_get_sync() unconditionally. We therefore leak a runtime pm ref whenever amdgpu is unloaded on a non-PX machine or if runpm=0. The GPU will subsequently never runtime suspend after loading amdgpu again. Fix by taking the runtime pm ref under the same condition that it was released on driver load. Fixes: d38ceaf99ed0 ("drm/amdgpu: add core driver (v4)") Cc: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Lukas Wunner <lukas@wunner.de> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/86364eeb5711323608930c4f0f69046792ff6d3c.1465392124.git.lukas@wunner.de
2016-06-24drm/radeon: Forbid runtime pm on driver unloadLukas Wunner
The PCI core calls pm_runtime_forbid() on device probe in pci_pm_init(), making this the default state when radeon is loaded. radeon_driver_load_kms() therefore calls pm_runtime_allow(), but there's no pm_runtime_forbid() in radeon_driver_unload_kms() to balance it. Add it so that we leave the device in the same state that we found it. This isn't a bug, it's just good housekeeping. When radeon is first loaded with runpm=1, then unloaded and loaded again with runpm=0, pm_runtime_forbid() will be called from radeon_pmops_runtime_idle() or radeon_pmops_runtime_suspend(), so the behaviour is correct. If there ever is a third party driver for AMD cards, this commit avoids that it has to clean up behind radeon. Cc: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Lukas Wunner <lukas@wunner.de> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/25a3e20b786fd66b10f40fa24c61dd36c33270da.1465392124.git.lukas@wunner.de
2016-06-24drm/radeon: Don't leak runtime pm ref on driver loadLukas Wunner
radeon_device_init() returns an error if either of the two calls to radeon_init() fail. One level up in the call stack, radeon_driver_load_kms() will then skip runtime pm initialization and call radeon_driver_unload_kms(), which acquires a runtime pm ref that is leaked. Balance by releasing a runtime pm ref in the error path of radeon_device_init(). Fixes: 10ebc0bc0934 ("drm/radeon: add runtime PM support (v2)") Cc: Dave Airlie <airlied@redhat.com> Cc: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Lukas Wunner <lukas@wunner.de> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/fa5bb977c1fe00474acedae5b03232dbf0b49410.1465392124.git.lukas@wunner.de
2016-06-24drm/radeon: Don't leak runtime pm ref on driver unloadLukas Wunner
radeon_driver_load_kms() calls pm_runtime_put_autosuspend() if radeon_is_px(dev), but radeon_driver_unload_kms() calls pm_runtime_get_sync() unconditionally. We therefore leak a runtime pm ref whenever radeon is unloaded on a non-PX machine or if runpm=0. The GPU will subsequently never runtime suspend after loading radeon again. Fix by taking the runtime pm ref under the same condition that it was released on driver load. Fixes: 10ebc0bc0934 ("drm/radeon: add runtime PM support (v2)") Cc: Dave Airlie <airlied@redhat.com> Cc: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Lukas Wunner <lukas@wunner.de> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/aaf71106c042126817aeca8b8e54ed468ab61ef7.1465392124.git.lukas@wunner.de
2016-06-24drm/nouveau: Forbid runtime pm on driver unloadLukas Wunner
The PCI core calls pm_runtime_forbid() on device probe in pci_pm_init(), making this the default state when nouveau is loaded. nouveau_drm_load() therefore calls pm_runtime_allow(), but there's no pm_runtime_forbid() in nouveau_drm_unload() to balance it. Add it so that we leave the device in the same state that we found it. This isn't a bug, it's just good housekeeping. When nouveau is first loaded with runpm=1, then unloaded and loaded again with runpm=0, pm_runtime_forbid() will be called from nouveau_pmops_runtime_idle() or nouveau_pmops_runtime_suspend(), so the behaviour is correct. The nvidia blob doesn't use runtime pm, but if it ever does, this commit avoids that it has to clean up behind nouveau. Cc: Ben Skeggs <bskeggs@redhat.com> Tested-by: Karol Herbst <karolherbst@gmail.com> Tested-by: Peter Wu <peter@lekensteyn.nl> Signed-off-by: Lukas Wunner <lukas@wunner.de> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/92cf96445088217a4d7d7081b90140f2d6f047da.1465392124.git.lukas@wunner.de
2016-06-24drm/nouveau: Don't leak runtime pm ref on driver unloadLukas Wunner
nouveau_drm_load() calls pm_runtime_put() if nouveau_runtime_pm != 0, but nouveau_drm_unload() calls pm_runtime_get_sync() unconditionally. We therefore leak a runtime pm ref whenever nouveau is loaded with runpm=0 and then unloaded. The GPU will subsequently never runtime suspend even if nouveau is loaded again with runpm=1. Fix by taking the runtime pm ref under the same condition that it was released on driver load. Fixes: 5addcf0a5f0f ("nouveau: add runtime PM support (v0.9)") Cc: Dave Airlie <airlied@redhat.com> Cc: Ben Skeggs <bskeggs@redhat.com> Reported-by: Karol Herbst <karolherbst@gmail.com> Tested-by: Karol Herbst <karolherbst@gmail.com> Tested-by: Peter Wu <peter@lekensteyn.nl> Signed-off-by: Lukas Wunner <lukas@wunner.de> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1544b82007037601fbc510b1a50edc56c529e75f.1465392124.git.lukas@wunner.de
2016-06-24Merge tag 'mediatek-drm-2016-06-20' of ↵Dave Airlie
git://git.pengutronix.de/git/pza/linux into drm-next MT8173 HDMI support - device tree binding documentation for MT8173 HDMI encoder, CEC, DDC, and PHY - drivers for MT8173 HDMI encoder, CEC (HPD only for now), DDC, and PHY - enable HDMI output via a custom SMCCC call - add ddc-i2c-bus property to HDMI connector device tree binding * tag 'mediatek-drm-2016-06-20' of git://git.pengutronix.de/git/pza/linux: dt-bindings: hdmi-connector: add DDC I2C bus phandle documentation drm/mediatek: enable hdmi output control bit drm/mediatek: Add HDMI support dt-bindings: drm/mediatek: Add Mediatek HDMI dts binding
2016-06-24Merge branch 'drm/next/du' of git://linuxtv.org/pinchartl/media into drm-nextDave Airlie
some rcar-du fixes. * 'drm/next/du' of git://linuxtv.org/pinchartl/media: drm: rcar-du: error message is not needed for EPROBE_DEFER drm: rcar-du: error message is not needed for drm_vblank_init() rcar-du: add/rename DEFR6 TCON bits
2016-06-24Merge tag 'drm-intel-next-2016-06-20' of ↵Dave Airlie
git://anongit.freedesktop.org/drm-intel into drm-next - Infrastructure for GVT-g (paravirtualized gpu on gen8+), from Zhi Wang - another attemp at nonblocking atomic plane updates - bugfixes and refactoring for GuC doorbell code (Dave Gordon) - GuC command submission enabled by default, if fw available (Dave Gordon) - more bxt w/a (Arun Siluvery) - bxt phy improvements (Imre Deak) - prep work for stolen objects support (Ankitprasa Sharma & Chris Wilson) - skl/bkl w/a update from Mika Kuoppala - bunch of small improvements and fixes all over, as usual * tag 'drm-intel-next-2016-06-20' of git://anongit.freedesktop.org/drm-intel: (81 commits) drm/i915: Update DRIVER_DATE to 20160620 drm/i915: Introduce GVT context creation API drm/i915: Support LRC context single submission drm/i915: Introduce execlist context status change notification drm/i915: Make addressing mode bits in context descriptor configurable drm/i915: Make ring buffer size of a LRC context configurable drm/i915: gvt: Introduce the basic architecture of GVT-g drm/i915: Fold vGPU active check into inner functions drm/i915: Use offsetof() to calculate the offset of members in PVINFO page drm/i915: Factor out i915_pvinfo.h drm/i915: Serialise presentation with imported dmabufs drm/i915: Use atomic commits for legacy page_flips drm/i915: Move fb_bits updating later in atomic_commit drm/i915: nonblocking commit Reapply "drm/i915: Pass atomic states to fbc update, functions." drm/i915: Roll out the helper nonblock tracking drm/i915: Signal drm events for atomic drm/i915/ilk: Don't disable SSC source if it's in use drm/i915/guc: (re)initialise doorbell h/w when enabling GuC submission drm/i915/guc: replace assign_doorbell() with select_doorbell_register() ...
2016-06-24Merge tag 'topic/drm-misc-2016-06-22-updated' of ↵Dave Airlie
git://anongit.freedesktop.org/drm-intel into drm-next Again a pile of things all over - Conversion to rst from docbook from Jani. Looks real pretty, and the source is now actually readable (compared to horrible, horrible docbook xml)! https://01.org/linuxgraphics/gfx-docs/drm/ - device register/unregister rework from Chris, with follow-up work from Benjamin. Allows more drivers to demidlayer load/unload and others to remove a bit of boilerplate. - master/auth related cleanup, with docs - some dma-buf polish, merged by Sumit - small stuff all over (like build fixes from Arnd) Group maintainership seems to slowly take off, with both Thierry and Sumit pushing a few things. No hiccups thus far. * tag 'topic/drm-misc-2016-06-22-updated' of git://anongit.freedesktop.org/drm-intel: (68 commits) drm/vc4: Remove unused connector drm/fb-helper: Reduce READ_ONCE(master) to lockless_dereference drm/sun4i: Remove open-coded drm_connector_register_all() drm/vc4: Remove open-coded drm_connector_register_all() drm/atmel-hlcdc: Remove redundant call to drm_connector_unregister_all() drm: document drm_auth.c drm: Clear up master tracking booleans drm: Extract drm_is_current_master drm: Refactor drop/set master code a bit drm: Lobotomize set_busid nonsense for !pci drivers drm: Nuke SET_UNIQUE ioctl drm: Don't call drm_dev_set_unique from platform drivers drm/vgem: Stop calling drm_drv_set_unique drm: Use dev->name as fallback for dev->unique drm: Clean up drm_crtc.h drm: Move master pointer from drm_minor to drm_device drm: sti: rework init sequence drm: sti: use late_register and early_unregister callbacks drm/amdkfd: Clean up inline handling drm: Add callbacks for late registering ...