summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* drm/fb-helper: unexport drm_fb_helper_panicDaniel Vetter2013-02-141-2/+1
| | | | | | | | | | | | | | | It doesn't even show up in any header files and only used iternally. Originally it was (ab)used to restore the fbcon on lastclose, but that died with commit e8e7a2b8ccfdae0d4cb6bd25824bbedcd42da316 Author: Dave Airlie <airlied@redhat.com> Date: Thu Apr 21 22:18:32 2011 +0100 drm/i915: restore only the mode of this driver on lastclose (v2) Reviewed-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
* drm/fb-helper: kill drm_fb_helper_restoreDaniel Vetter2013-02-142-16/+8
| | | | | | | | | | | | | | | | | | It's only used internally for the sysrq and panic handlers provided by the drm fb helper implementation. Hence just inline it, kill the export and remove the confusing kerneldoc. Driver's are supposed to call drm_fb_helper_restore_fbdev_mode on lastclose. Note that locking is totally fubar - the sysrq case doesn't take any locks at all. The panic handler probably shouldn't take any locks since it'll only make things worse. Otoh it's probably better to switch things over to the atomic modeset callbacks (and disable the panic handler for those drivers which don't implement it). But that's both better done in separate patches. Reviewed-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
* drm: review locking for drm_fb_helper_restore_fbdev_modeDaniel Vetter2013-02-145-1/+31
| | | | | | | | | | | | | | | | | ... it's required. Fix up exynos and the cma helper, and add a corresponding WARN_ON to drm_fb_helper_restore_fbdev_mode. Note that tegra calls the fbdev cma helper restore function also from it's driver-load callback. Which is a bit against current practice, since usually the call is only from ->lastclose, and initial setup is done by drm_fb_helper_initial_config. Also add the relevant drm DocBook entry. v2: Add promised WARN to restore_fbdev_mode. Reviewed-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
* Merge branch 'for-airlied' of git://people.freedesktop.org/~mlankhorst/linux ↵Dave Airlie2013-02-085-88/+178
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into drm-next TTM reservations changes, preparing for new reservation mutex system. * 'for-airlied' of git://people.freedesktop.org/~mlankhorst/linux: drm/ttm: unexport ttm_bo_wait_unreserved drm/nouveau: use ttm_bo_reserve_slowpath in validate_init, v2 drm/ttm: use ttm_bo_reserve_slowpath_nolru in ttm_eu_reserve_buffers, v2 drm/ttm: add ttm_bo_reserve_slowpath drm/ttm: cleanup ttm_eu_reserve_buffers handling drm/ttm: remove lru_lock around ttm_bo_reserve drm/nouveau: increase reservation sequence every retry drm/vmwgfx: always use ttm_bo_is_reserved
| * drm/ttm: unexport ttm_bo_wait_unreservedMaarten Lankhorst2013-01-152-14/+2
| | | | | | | | | | | | | | | | All legitimate users of this function outside ttm_bo.c are gone, now it's only an implementation detail. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Reviewed-by: Jerome Glisse <jglisse@redhat.com>
| * drm/nouveau: use ttm_bo_reserve_slowpath in validate_init, v2Maarten Lankhorst2013-01-151-5/+17
| | | | | | | | | | | | | | | | | | | | | | | | Similar rationale to the identical commit in drm/ttm. Instead of only waiting for unreservation, we make sure we actually own the reservation, then retry to get the rest. Changes since v1: - Increase the seqno before calling ttm_bo_reserve_slowpath Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Reviewed-by: Jerome Glisse <jglisse@redhat.com>
| * drm/ttm: use ttm_bo_reserve_slowpath_nolru in ttm_eu_reserve_buffers, v2Maarten Lankhorst2013-01-151-2/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This requires re-use of the seqno, which increases fairness slightly. Instead of spinning with a new seqno every time we keep the current one, but still drop all other reservations we hold. Only when we succeed, we try to get back our other reservations again. This should increase fairness slightly as well. Changes since v1: - Increase val_seq before calling ttm_bo_reserve_slowpath_nolru and retrying to take all entries to prevent a race. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Reviewed-by: Jerome Glisse <jglisse@redhat.com>
| * drm/ttm: add ttm_bo_reserve_slowpathMaarten Lankhorst2013-01-152-0/+77
| | | | | | | | | | | | | | | | | | | | Instead of dropping everything, waiting for the bo to be unreserved and trying over, a better strategy would be to do a blocking wait. This can be mapped a lot better to a mutex_lock-like call. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Reviewed-by: Jerome Glisse <jglisse@redhat.com>
| * drm/ttm: cleanup ttm_eu_reserve_buffers handlingMaarten Lankhorst2013-01-151-32/+21
| | | | | | | | | | | | | | | | | | With the lru lock no longer required for protecting reservations we can just do a ttm_bo_reserve_nolru on -EBUSY, and handle all errors in a single path. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Reviewed-by: Jerome Glisse <jglisse@redhat.com>
| * drm/ttm: remove lru_lock around ttm_bo_reserveMaarten Lankhorst2013-01-153-35/+40
| | | | | | | | | | | | | | | | | | | | There should no longer be assumptions that reserve will always succeed with the lru lock held, so we can safely break the whole atomic reserve/lru thing. As a bonus this fixes most lockdep annotations for reservations. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Reviewed-by: Jerome Glisse <jglisse@redhat.com>
| * drm/nouveau: increase reservation sequence every retryMaarten Lankhorst2013-01-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | This is temporary until the fence framework can be used. With the lru/reservation atomicity removal it is possible to see your old sequence number and the buffer being reserved, leading to erroneously reporting -EDEADLK. Workaround it by bumping the sequence number every retry. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
| * drm/vmwgfx: always use ttm_bo_is_reservedMaarten Lankhorst2013-01-151-2/+2
| | | | | | | | | | | | Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
* | drm: make frame duration time calculation more preciseDaniel Kurtz2013-02-081-1/+5
| | | | | | | | | | | | | | | | | | It is a bit more precise to compute the total number of pixels first and then divide, rather than multiplying the line pixel count by the already-rounded line duration. Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
* | drm/pci: Use PCI Express Capability accessorsBjorn Helgaas2013-02-081-16/+5
| | | | | | | | | | | | | | | | | | | | | | | | Use PCI Express Capability access functions to simplify this code a bit. For non-PCIe devices or pre-PCIe 3.0 devices that don't implement the Link Capabilities 2 register, pcie_capability_read_dword() reads a zero. Since we're only testing whether the bits we care about are set, there's no need to mask out the other bits we *don't* care about. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* | drm/pci: Set all supported speeds in speed cap mask for pre-3.0 devicesBjorn Helgaas2013-02-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For devices that conform to PCIe r3.0 and have a Link Capabilities 2 register, we test and report every bit in the Supported Link Speeds Vector field. For a device that supports both 2.5GT/s and 5.0GT/s, we set both DRM_PCIE_SPEED_25 and DRM_PCIE_SPEED_50 in the returned mask. For pre-r3.0 devices, the Link Capabilities 0010b encoding (PCI_EXP_LNKCAP_SLS_5_0GB) means that both 5.0GT/s and 2.5GT/s are supported, so set both DRM_PCIE_SPEED_25 and DRM_PCIE_SPEED_50 in this case as well. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* | drm/pci: Use the standard #defines for PCIe Link Capability bitsBjorn Helgaas2013-02-081-2/+2
| | | | | | | | | | | | | | | | Use the standard #defines rather than bare numbers for the PCIe Link Capabilities speed bits. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* | drm: Allow vblank support without DRIVER_HAVE_IRQThierry Reding2013-02-081-2/+3
| | | | | | | | | | | | | | | | | | | | Drivers that register interrupt handlers without the DRM core helpers don't initialize the .irq_enabled field and drm_dev_to_irq() may fail when called on them. This shouldn't preclude them from implementing the vblank IOCTL. Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by: Dave Airlie <airlied@redhat.com>
* | drm/radeon: use prime helpersAaron Plattner2013-02-083-157/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simplify the Radeon prime implementation by using the default behavior provided by drm_gem_prime_import and drm_gem_prime_export. v2: - Rename functions to radeon_gem_prime_get_sg_table and radeon_gem_prime_import_sg_table. - Delete the now-unused vmapping_count variable. Signed-off-by: Aaron Plattner <aplattner@nvidia.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: David Airlie <airlied@linux.ie> Signed-off-by: Dave Airlie <airlied@redhat.com>
* | drm/nouveau: use prime helpersAaron Plattner2013-02-085-161/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | Simplify the Nouveau prime implementation by using the default behavior provided by drm_gem_prime_import and drm_gem_prime_export. v2: Rename functions to nouveau_gem_prime_get_sg_table and nouveau_gem_prime_import_sg_table. Signed-off-by: Aaron Plattner <aplattner@nvidia.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: David Airlie <airlied@linux.ie> Signed-off-by: Dave Airlie <airlied@redhat.com>
* | drm: add prime helpersAaron Plattner2013-02-083-1/+201
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of reimplementing all of the dma_buf functionality in every driver, create helpers drm_prime_import and drm_prime_export that implement them in terms of new, lower-level hook functions: gem_prime_pin: callback when a buffer is created, used to pin buffers into GTT gem_prime_get_sg_table: convert a drm_gem_object to an sg_table for export gem_prime_import_sg_table: convert an sg_table into a drm_gem_object gem_prime_vmap, gem_prime_vunmap: map and unmap an object These hooks are optional; drivers can opt in by using drm_gem_prime_import and drm_gem_prime_export as the .gem_prime_import and .gem_prime_export fields of struct drm_driver. v2: - Drop .begin_cpu_access. None of the drivers this code replaces implemented it. Having it here was a leftover from when I was trying to include i915 in this rework. - Use mutex_lock instead of mutex_lock_interruptible, as these three drivers did. This patch series shouldn't change that behavior. - Rename helpers to gem_prime_get_sg_table and gem_prime_import_sg_table. Rename struct sg_table* variables to 'sgt' for clarity. - Update drm.tmpl for these new hooks. v3: - Pass the vaddr down to the driver. This lets drivers that just call vunmap on the pointer avoid having to store the pointer in their GEM private structures. - Move documentation into a /** DOC */ comment in drm_prime.c and include it in drm.tmpl with a !P line. I tried to use !F lines to include documentation of the individual functions from drmP.h, but the docproc / kernel-doc scripts barf on that file, so hopefully this is good enough for now. - apply refcount fix from commit be8a42ae60addd8b6092535c11b42d099d6470ec ("drm/prime: drop reference on imported dma-buf come from gem") Signed-off-by: Aaron Plattner <aplattner@nvidia.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: David Airlie <airlied@linux.ie> Signed-off-by: Dave Airlie <airlied@redhat.com>
* | drm/i2c: give i2c it's own KconfigRob Clark2013-02-083-23/+24
| | | | | | | | | | | | | | | | | | Move this out of nouveau directory. As we start to add more encoder slaves used by other drivers, it makes sense to put the Kconfig bits in one place. Signed-off-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* | Merge branch 'drm-next-3.9' of git://people.freedesktop.org/~agd5f/linux ↵Dave Airlie2013-02-0843-1887/+2199
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into drm-next Alex writes: - CS ioctl cleanup and unification. Unification of a lot of functionality that was duplicated across multiple generates of hardware. - Add support for Oland GPUs - Deprecate UMS support. Mesa and the ddx dropped support for UMS and apparently very few people still use it since the UMS CS ioctl was broken for several kernels and no one reported it. It was fixed in 3.8/stable. - Rework GPU reset. Use the status registers to determine what blocks to reset. This better matches the recommended reset programming model. This also allows us to properly reset blocks besides GFX and DMA. - Switch the VM set page code to use an IB rather than the ring. This fixes overflow issues when doing large page table updates using a small ring like DMA. - Several small cleanups and bug fixes. * 'drm-next-3.9' of git://people.freedesktop.org/~agd5f/linux: (38 commits) drm/radeon/dce6: fix display powergating drm/radeon: add Oland pci ids drm/radeon: radeon-asic updates for Oland drm/radeon: add ucode loading support for Oland drm/radeon: fill in gpu init for Oland drm/radeon: add Oland chip family drm/radeon: switch back to using the DMA ring for VM PT updates drm/radeon: use IBs for VM page table updates v2 drm/radeon: don't reset the MC on IGPs/APUs drm/radeon: use the reset mask to determine if rings are hung drm/radeon: halt engines before disabling MC (si) drm/radeon: halt engines before disabling MC (cayman/TN) drm/radeon: halt engines before disabling MC (evergreen) drm/radeon: halt engines before disabling MC (6xx/7xx) drm/radeon: use status regs to determine what to reset (si) drm/radeon: use status regs to determine what to reset (cayman) drm/radeon: use status regs to determine what to reset (evergreen) drm/radeon: use status regs to determine what to reset (6xx/7xx) drm/radeon: rework GPU reset on cayman/TN drm/radeon: rework GPU reset on cayman/TN ...
| * | drm/radeon/dce6: fix display powergatingAlex Deucher2013-02-051-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Only enable it when we disable the display rather than at DPMS time since enabling it requires a full modeset to restore the display state. Fixes blank screens in certain cases. Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
| * | drm/radeon: add Oland pci idsAlex Deucher2013-02-011-0/+13
| | | | | | | | | | | | Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
| * | drm/radeon: radeon-asic updates for OlandAlex Deucher2013-02-011-1/+5
| | | | | | | | | | | | Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
| * | drm/radeon: add ucode loading support for OlandAlex Deucher2013-02-011-0/+59
| | | | | | | | | | | | Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
| * | drm/radeon: fill in gpu init for OlandAlex Deucher2013-02-011-1/+19
| | | | | | | | | | | | Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
| * | drm/radeon: add Oland chip familyAlex Deucher2013-02-013-0/+3
| | | | | | | | | | | | | | | | | | Oland is a new asic in the SI family. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
| * | drm/radeon: switch back to using the DMA ring for VM PT updatesAlex Deucher2013-02-011-3/+3
| | | | | | | | | | | | | | | | | | | | | Now that we have switched to using IBs for page table updates, we can switch back the using the DMA ring. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
| * | drm/radeon: use IBs for VM page table updates v2Alex Deucher2013-02-017-92/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For very large page table updates, we can exceed the size of the ring. To avoid this, use an IB to perform the page table update. v2(ck): cleanup the IB infrastructure and the use it instead of filling the struct ourself. Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Christian König <christian.koenig@amd.com>
| * | drm/radeon: don't reset the MC on IGPs/APUsAlex Deucher2013-01-313-6/+12
| | | | | | | | | | | | | | | | | | The MC isn't part of the GPU per se. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
| * | drm/radeon: use the reset mask to determine if rings are hungAlex Deucher2013-01-316-80/+173
| | | | | | | | | | | | | | | | | | | | | fetch the reset mask and check if the relevant ring flags are set to determine whether the ring is hung or not. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
| * | drm/radeon: halt engines before disabling MC (si)Alex Deucher2013-01-311-5/+7
| | | | | | | | | | | | | | | | | | It's better to halt the engines before we disable the MC. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
| * | drm/radeon: halt engines before disabling MC (cayman/TN)Alex Deucher2013-01-311-7/+7
| | | | | | | | | | | | | | | | | | It's better to halt the engines before we disable the MC. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
| * | drm/radeon: halt engines before disabling MC (evergreen)Alex Deucher2013-01-311-5/+7
| | | | | | | | | | | | | | | | | | It's better to halt the engines before we disable the MC. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
| * | drm/radeon: halt engines before disabling MC (6xx/7xx)Alex Deucher2013-01-311-5/+5
| | | | | | | | | | | | | | | | | | It's better to halt the engines before we disable the MC. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
| * | drm/radeon: use status regs to determine what to reset (si)Alex Deucher2013-01-312-34/+132
| | | | | | | | | | | | | | | | | | | | | When we attempt the reset the GPU, look at the status registers to determine what blocks need to be reset. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
| * | drm/radeon: use status regs to determine what to reset (cayman)Alex Deucher2013-01-313-32/+136
| | | | | | | | | | | | | | | | | | | | | When we attempt the reset the GPU, look at the status registers to determine what blocks need to be reset. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
| * | drm/radeon: use status regs to determine what to reset (evergreen)Alex Deucher2013-01-313-32/+145
| | | | | | | | | | | | | | | | | | | | | When we attempt the reset the GPU, look at the status registers to determine what blocks need to be reset. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
| * | drm/radeon: use status regs to determine what to reset (6xx/7xx)Alex Deucher2013-01-313-32/+136
| | | | | | | | | | | | | | | | | | | | | When we attempt the reset the GPU, look at the status registers to determine what blocks need to be reset. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
| * | drm/radeon: rework GPU reset on cayman/TNAlex Deucher2013-01-311-92/+90
| | | | | | | | | | | | | | | | | | | | | Update the code to better match the recommended programming sequence for soft reset. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
| * | drm/radeon: rework GPU reset on cayman/TNAlex Deucher2013-01-312-108/+92
| | | | | | | | | | | | | | | | | | | | | Update the code to better match the recommended programming sequence for soft reset. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
| * | drm/radeon: rework GPU reset on evergreenAlex Deucher2013-01-311-76/+85
| | | | | | | | | | | | | | | | | | | | | Update the code to better match the recommended programming sequence for soft reset. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
| * | drm/radeon: rework GPU reset on r6xx/r7xxAlex Deucher2013-01-312-122/+129
| | | | | | | | | | | | | | | | | | | | | Update the code to better match the recommended programming sequence for soft reset. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
| * | drm/radeon: add a bios scratch asic hung helperAlex Deucher2013-01-315-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | Used by all asic families from r600+. Flag for the vbios and later instances of the driver that the GPU is hung. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
| * | drm/radeon: add additional reset flagsAlex Deucher2013-01-311-0/+9
| | | | | | | | | | | | | | | | | | This adds further flags for fine grained reset. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
| * | drm/radeon: Deprecate UMS support v2Christian König2013-01-3114-117/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | KMS support is out and stable for a couple of years now and the userspace code has deprecated or abandoned the old UMS interface. So make the KMS interface the default and deprecate the UMS interface in the kernel as well. v2: rebased on alex/drm-next-3.9-wip Signed-off-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
| * | radeon/kms: cleanup async dma packet checkingJerome Glisse2013-01-313-435/+417
| | | | | | | | | | | | | | | | | | | | | This simplify and cleanup the async dma checking. Signed-off-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
| * | drm/radeon: consolidate redundant macros and constantsIlija Hadzic2013-01-3112-104/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After refactoring the _cs logic, we ended up with many macros and constants that #define the same thing. Clean'em up. Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com> Reviewed-by: Marek Olšák <maraeo@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
| * | drm/radeon: use common next_reloc functionIlija Hadzic2013-01-316-295/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch eliminates ASIC-specific ***_cs_packet_next_reloc functions and hooks up the new common function. Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com> Reviewed-by: Marek Olšák <maraeo@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
OpenPOWER on IntegriCloud