aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu
AgeCommit message (Collapse)AuthorFilesLines
2015-06-20drm/exynos: atomic phase 3: atomic updates of planesGustavo Padovan2-2/+5
Now that phase 1 and 2 are complete we can switch the update/disable_plane callbacks to their atomic version. Signed-off-by: Gustavo Padovan <[email protected]> Reviewed-by: Joonyoung Shim <[email protected]> Tested-by: Tobias Jakobi <[email protected]> Signed-off-by: Inki Dae <[email protected]>
2015-06-20drm/exynos: atomic phase 2: keep track of framebuffer pointerGustavo Padovan1-0/+3
Use drm_atomic_set_fb_for_plane() in the legacy page_flip path to keep track of the framebuffer pointer and reference. Signed-off-by: Gustavo Padovan <[email protected]> Reviewed-by: Joonyoung Shim <[email protected]> Tested-by: Tobias Jakobi <[email protected]> Signed-off-by: Inki Dae <[email protected]>
2015-06-20drm/exynos: atomic phase 2: wire up state reset(), duplicate() and destroy()Gustavo Padovan10-0/+39
Set CRTC, planes and connectors to use the default implementations from the atomic helper library. The helpers will work to keep track of state for each DRM object. Signed-off-by: Gustavo Padovan <[email protected]> Reviewed-by: Joonyoung Shim <[email protected]> Tested-by: Tobias Jakobi <[email protected]> Signed-off-by: Inki Dae <[email protected]>
2015-06-20drm/exynos: use adjusted_mode of crtc_state instead of modeJoonyoung Shim3-9/+10
Handle changes by removing copy from adjusted_mode to mode as using adjusted_mode of crtc_state. Signed-off-by: Joonyoung Shim <[email protected]> Signed-off-by: Inki Dae <[email protected]>
2015-06-20drm/exynos: atomic phase 1: add .mode_set_nofb() callbackGustavo Padovan1-56/+7
The new atomic infrastructure needs the .mode_set_nofb() callback to update CRTC timings before setting any plane. v2: remove WARN_ON(!crtc->state) from mode_set_nofb Signed-off-by: Gustavo Padovan <[email protected]> Reviewed-by: Joonyoung Shim <[email protected]> Tested-by: Tobias Jakobi <[email protected]> Signed-off-by: Inki Dae <[email protected]>
2015-06-20drm/exynos: atomic phase 1: use drm_plane_helper_disable()Gustavo Padovan1-13/+19
The atomic helper to disable planes also uses the optional .atomic_disable() helper. The unique operation it does is calling .win_disable() Signed-off-by: Gustavo Padovan <[email protected]> Reviewed-by: Joonyoung Shim <[email protected]> Tested-by: Tobias Jakobi <[email protected]> Signed-off-by: Inki Dae <[email protected]>
2015-06-20drm/exynos: atomic phase 1: use drm_plane_helper_update()Gustavo Padovan3-26/+47
Rip out the check from exynos_update_plane() and create exynos_check_plane() for the check phase enabling use to use the atomic helpers to call our check and update phases when updating planes. Update all users of exynos_update_plane() accordingly to call exynos_check_plane() before. Signed-off-by: Gustavo Padovan <[email protected]> Reviewed-by: Joonyoung Shim <[email protected]> Tested-by: Tobias Jakobi <[email protected]>y Signed-off-by: Inki Dae <[email protected]>
2015-06-20drm/exynos: fix source data argument for planeJoonyoung Shim1-3/+4
The exynos_update_plane function needs 16.16 fixed point source data. Signed-off-by: Joonyoung Shim <[email protected]> Reviewed-by: Gustavo Padovan <[email protected]> Signed-off-by: Inki Dae <[email protected]>
2015-06-19drm: Avoid the double clflush on the last cache line in drm_clflush_virt_range()Chris Wilson1-2/+3
As the clflush operates on cache lines, and we can flush any byte address, in order to flush all bytes given in the range we issue an extra clflush on the last byte to ensure the last cacheline is flushed. We can can the iteration to be over the actual cache lines to avoid this double clflush on the last byte. Signed-off-by: Chris Wilson <[email protected]> Cc: Imre Deak <[email protected]> Reviewed-by: Imre Deak <[email protected]> Signed-off-by: Daniel Vetter <[email protected]>
2015-06-19drm/atomic: Extract needs_modeset functionDaniel Vetter2-13/+6
We use the same check already in the atomic core, so might as well make this official. And it's also reused in e.g. i915. Motivated by Maarten's idea to extract a connector_changed state out of mode_changed. Cc: Maarten Lankhorst <[email protected]> Reviewed-By: Maarten Lankhorst <[email protected]> Signed-off-by: Daniel Vetter <[email protected]>
2015-06-19Merge tag 'drm-intel-next-fixes-2015-06-18' of ↵Dave Airlie5-100/+164
git://anongit.freedesktop.org/drm-intel into drm-next i915 fixes for stuff in next * tag 'drm-intel-next-fixes-2015-06-18' of git://anongit.freedesktop.org/drm-intel: drm/i915: Don't set enabled value of all CRTCs when restoring the mode drm/i915: Don't update staged config during force restore modesets drm/i915: Don't check modeset state in the hw state force restore path drm/i915: Add SCRATCH1 and ROW_CHICKEN3 to the register whitelist. drm/i915: Extend the parser to check register writes against a mask/value pair. drm/i915: Fix command parser to validate multiple register access with the same command. drm/i915: Don't skip request retirement if the active list is empty
2015-06-19Merge tag 'drm-intel-fixes-2015-06-18' of ↵Dave Airlie1-1/+4
git://anongit.freedesktop.org/drm-intel into drm-fixes one fix, one revert * tag 'drm-intel-fixes-2015-06-18' of git://anongit.freedesktop.org/drm-intel: Revert "drm/i915: Don't skip request retirement if the active list is empty" drm/i915: Always reset vma->ggtt_view.pages cache on unbinding
2015-06-19drm: i915: Port to new backlight interface selection APIHans de Goede1-11/+1
This results in a nice cleanup, as we can replace the complicated logic from should_ignore_backlight_request() with a simple check for the type being native. Signed-off-by: Hans de Goede <[email protected]> Acked-by: Darren Hart <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2015-06-18drm/radeon: don't probe MST on hw we don't support it onDave Airlie1-0/+5
If you do radeon.mst=1 on a gpu without mst hw, and then plug some mst hw it will oops instead of falling back. So check we have DCE5 at least before proceeding. Signed-off-by: Dave Airlie <[email protected]> Signed-off-by: Christian König <[email protected]>
2015-06-18drm/radeon: Add RADEON_INFO_VA_UNMAP_WORKING queryMichel Dänzer1-0/+3
This tells userspace that it's safe to use the RADEON_VA_UNMAP operation of the DRM_RADEON_GEM_VA ioctl. Cc: [email protected] (NOTE: Backporting this commit requires at least backports of commits 26d4d129b6042197b4cbc8341c0618f99231af2f, 48afbd70ac7b6aa62e8d452091023941d8085f8a and c29c0876ec05d51a93508a39b90b92c29ba6423d as well, otherwise using RADEON_VA_UNMAP runs into trouble) Signed-off-by: Michel Dänzer <[email protected]> Signed-off-by: Christian König <[email protected]>
2015-06-18GPU: ipu: Fix race in installing IPU chained IRQ handlerRussell King1-8/+5
The IPU code was installing its chained interrupt handler (which enables the interrupt) before it was setting its data, which provokes an oops on kexec. Fix this by converting to irq_set_chained_handler_and_data(). [drm] Initialized drm 1.1.0 20060810 imx-drm display-subsystem: parent device of /soc/aips-bus@02000000/ldb@020e0008/lvds-channel@1 is not available imx-drm display-subsystem: parent device of /soc/aips-bus@02000000/ldb@020e0008/lvds-channel@1 is not available Unable to handle kernel NULL pointer dereference at virtual address 00000070 pgd = c0004000 [00000070] *pgd=00000000 Internal error: Oops: 5 [#1] SMP ARM Modules linked in: CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.1.0-rc6+ #1693 Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree) task: d74c0000 ti: d74aa000 task.ti: d74aa000 PC is at ipu_irq_handle+0x28/0xd8 LR is at ipu_irq_handler+0x6c/0xc0 pc : [<c03c56d8>] lr : [<c03c58a4>] psr: 200001d3 sp : d74abbd0 ip : d74abc00 fp : d74abbfc r10: 000001e0 r9 : c0085154 r8 : 00000009 r7 : 00000000 r6 : 00000000 r5 : d74abc04 r4 : c0a6b6a8 r3 : 00000000 r2 : 00000009 r1 : d74abc04 r0 : 00000000 Flags: nzCv IRQs off FIQs off Mode SVC_32 ISA ARM Segment kernel Control: 10c5387d Table: 10004059 DAC: 00000015 Process swapper/0 (pid: 1, stack limit = 0xd74aa210) Stack: (0xd74abbd0 to 0xd74ac000) Backtrace: [<c03c56b0>] (ipu_irq_handle) from [<c03c58a4>] (ipu_irq_handler+0x6c/0xc0) [<c03c5838>] (ipu_irq_handler) from [<c0080154>] (generic_handle_irq+0x28/0x38) [<c008012c>] (generic_handle_irq) from [<c0080288>] (__handle_domain_irq+0x5c/0xb8) [<c008022c>] (__handle_domain_irq) from [<c0009428>] (gic_handle_irq+0x28/0x68) [<c0009400>] (gic_handle_irq) from [<c0013dc4>] (__irq_svc+0x44/0x5c) [<c07638fc>] (_raw_spin_unlock_irqrestore) from [<c00803bc>] (__irq_put_desc_unlock+0x1c/0x40) [<c00803a0>] (__irq_put_desc_unlock) from [<c00841f4>] (__irq_set_handler+0x54/0x5c) [<c00841a0>] (__irq_set_handler) from [<c03c5f48>] (ipu_probe+0x29c/0x708) [<c03c5cac>] (ipu_probe) from [<c03d3848>] (platform_drv_probe+0x50/0xac) [<c03d37f8>] (platform_drv_probe) from [<c03d1f3c>] (driver_probe_device+0x1d4/0x278) Signed-off-by: Russell King <[email protected]> Cc: Alexandre Courbot <[email protected]> Cc: Hans Ulli Kroll <[email protected]> Cc: Jason Cooper <[email protected]> Cc: Lee Jones <[email protected]> Cc: Linus Walleij <[email protected]> Cc: Thierry Reding <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
2015-06-18Merge branch 'virtio-gpu-drm-next' of git://git.kraxel.org/linux into drm-nextDave Airlie4-21/+38
fixes and virtio-vga support. * 'virtio-gpu-drm-next' of git://git.kraxel.org/linux: virtio-gpu: add locking for vbuf pool drm/virtgpu: initialise fbdev after getting initial display info Add virtio-vga bits.
2015-06-18Merge tag 'drm/panel/for-4.2-rc1' of ↵Dave Airlie7-44/+78
git://anongit.freedesktop.org/tegra/linux into drm-next drm/panel: Changes for v4.2-rc1 This contains fixes for the long-standing build issues that some of the bridge drivers were exposing. Other than that it's mostly cleanup and a couple of new simple panels that are supported. * tag 'drm/panel/for-4.2-rc1' of git://anongit.freedesktop.org/tegra/linux: drm/panel: simple: Add bus format for HannStar HSD100PXN1 drm/panel: simple: Add display timing for HannStar HSD100PXN1 drm/panel: ld9040: Remove useless padding drm/panel: Constify OF match tables drm/bridge: Remove stale ptn3460.h include drm/bridge: ps8622: Include linux/gpio/consumer.h drm/bridge: ptn3460: Include linux/gpio/consumer.h drm/bridge: dw-hdmi: Return number of EDID modes drm/panel: simple: Add support for LG LB070WV8 800x480 7" panel drm/bridge: ptn3460: Pass flags to devm_gpiod_get() drm/bridge: ps8622: Pass flags to devm_gpiod_get() drm/bridge: ptn3460: Fix I2C ID table to match the reported modalias drm/bridge: dw-hdmi: Staticize dw_hdmi_bridge_funcs
2015-06-18Merge tag 'drm/tegra/for-4.2-rc1' of ↵Dave Airlie3-40/+36
git://anongit.freedesktop.org/tegra/linux into drm-next drm/tegra: Changes for v4.2-rc1 This contains a couple of mostly fixes for issues that have crept up in recent versions of linux-next. One issue is that DP AUX transactions of more than 4 bytes will access the wrong FIFO registers and hence become corrupt. Another fix is required to restore functionality of Tegra20 if using the GART. The current code expects the IOMMU aperture to be the complete 4 GiB address space, whereas the GART on Tegra20 only provides a 128 MiB aperture. One more issue with IOMMU support is that on 64-bit ARM, swiotlb is the default IOMMU implementation backing the DMA API. A side-effect of that is that when dma_map_sg() is called to flush caches (yes, this is a bit of a hack, but ARM does not provide a better API), swiotlb will immediately run out of memory because its bounce buffer is too small to make a framebuffer. Finally I've included a mostly cosmetic fix that stores register values in u32 rather than unsigned long to avoid sign-extension issues on 64- bit ARM. This is only a precaution since it hasn't caused any issues (yet). * tag 'drm/tegra/for-4.2-rc1' of git://anongit.freedesktop.org/tegra/linux: drm/tegra: dpaux: Registers are 32-bit drm/tegra: gem: Flush pages after allocation drm/tegra: gem: Take into account IOMMU aperture drm/tegra: dpaux: Fix transfers larger than 4 bytes
2015-06-18Merge branch 'drm/next/du' of git://linuxtv.org/pinchartl/fbdev into drm-nextDave Airlie5-22/+45
rcar-du fixes * 'drm/next/du' of git://linuxtv.org/pinchartl/fbdev: drm: rcar-du: Use the drm atomic state duplication helpers for planes drm: rcar-du: Clean up planes in the error paths of .atomic_commit() drm: rcar-du: Convert rcar_du_encoders_init_one() return value to 0/<0 drm: rcar-du: Clarify error message when encoder initialization fails drm: rcar-du: Fix crash with groups that have less than 9 planes drm: rcar-du: Disable all planes when stopping the CRTC drm: rcar-du: Print the error value when DRM/KMS init fails
2015-06-17drm/i915: Don't set enabled value of all CRTCs when restoring the modeAnder Conselvan de Oliveira1-17/+10
The code in intel_crtc_restore_mode() sets the enabled value of all the CRTCs when restoring the mode after a suspend/resume cycle. When more than one CRTC is enabled, that causes drm_atomic_helper_check_modeset() to fail if there is more than one pipe enabled, since all but one CRTC has valid connector data. Instead, set only the enabled value for the CRTC passed as an argument. v2: Don't leak atomic state. (Matt) Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90468 References: https://bugs.freedesktop.org/show_bug.cgi?id=90396 Signed-off-by: Ander Conselvan de Oliveira <[email protected]> Reviewed-by: Matt Roper <[email protected]>
2015-06-17drm/i915: Don't update staged config during force restore modesetsAnder Conselvan de Oliveira1-5/+3
The force restore path relies on the staged config to preserve the configuration used before a suspend/resume cycle. The update done to it in intel_modeset_fixup_state() would cause that information to be lost after the first modeset, making it impossible to restore the modes for pipes B and C. References: https://bugs.freedesktop.org/show_bug.cgi?id=90468 Signed-off-by: Ander Conselvan de Oliveira <[email protected]> Reviewed-by: Matt Roper <[email protected]> Signed-off-by: Jani Nikula <[email protected]>
2015-06-17drm/i915: Don't check modeset state in the hw state force restore pathAnder Conselvan de Oliveira1-9/+12
Since the force restore logic will restore the CRTCs state one at a time, it is possible that the state will be inconsistent until the whole operation finishes. A call to intel_modeset_check_state() is done once it's over, so don't check the state multiple times in between. This regression was introduced in: commit 7f27126ea3db6ade886f18fd39caf0ff0cd1d37f Author: Jesse Barnes <[email protected]> Date: Wed Nov 5 14:26:06 2014 -0800 drm/i915: factor out compute_config from __intel_set_mode v3 v2: Rename check parameter to force_restore. (Matt) Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=94431 Cc: Jesse Barnes <[email protected]> Signed-off-by: Ander Conselvan de Oliveira <[email protected]> Reviewed-by: Matt Roper <[email protected]> Signed-off-by: Jani Nikula <[email protected]>
2015-06-16drivers/gpu: include <module.h> for modular rockchip codePaul Gortmaker2-0/+2
These files are built off of a tristate Kconfig option and also contain modular function calls so they should explicitly include module.h to avoid compile breakage during header shuffles done in the future. Cc: David Airlie <[email protected]> Cc: Mark Yao <[email protected]> Cc: [email protected] Signed-off-by: Paul Gortmaker <[email protected]>
2015-06-16drm/amdkfd: fix some range checks in address watch ioctlDan Carpenter1-3/+3
buf_size_in_bytes must be large enough to hold ->num_watch_points and watch_mode so I have added a sizeof(int) * 2 to the minimum size. Also we have to subtract sizeof(*args) from the max args_idx limit so that it matches the allocation. Also I changed a > to >= for the last compare. Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2015-06-16drm: rcar-du: Use the drm atomic state duplication helpers for planesLaurent Pinchart1-5/+5
Ensure that the duplicate and destroy plane state operations will always be in sync with the DRM core implementation of the plane state by using the __drm_atomic_helper_plane_duplicate_state() and __drm_atomic_helper_plane_destroy_state() functions designed especially for this purpose. Signed-off-by: Laurent Pinchart <[email protected]>
2015-06-16drm: rcar-du: Clean up planes in the error paths of .atomic_commit()Laurent Pinchart1-3/+9
When the .atomic_commit() handler fails, clean up planes previoulsy prepared by drm_atomic_helper_prepare_planes() with a call to drm_atomic_helper_cleanup_planes(). Signed-off-by: Laurent Pinchart <[email protected]>
2015-06-16drm: rcar-du: Convert rcar_du_encoders_init_one() return value to 0/<0Laurent Pinchart1-5/+5
The function returns 1 on success, and either 0 or a negative error code on failure. As the 0 and negative values don't need to be differentiated by the caller, convert it to the usual scheme of returning 0 on success and a negative error code on failure. Signed-off-by: Laurent Pinchart <[email protected]>
2015-06-16drm: rcar-du: Clarify error message when encoder initialization failsLaurent Pinchart1-2/+5
A failure to initialize an encoder currently prints an error message in the kernel log without mentioning which encoder failed to initialize. To help debugging initialization issues print the encoder DT node name. This requires moving the error message to the rcar_du_encoders_init_one function and refactoring it slightly. Signed-off-by: Laurent Pinchart <[email protected]>
2015-06-16drm: rcar-du: Fix crash with groups that have less than 9 planesLaurent Pinchart4-6/+7
Commit 917de180379d ("drm: rcar-du: Implement universal plane support") made the number of planes per group dynamic, but didn't update all loops over the planes array, resulting in out-of-bound accesses on DU instances that have an odd number of CRTCs (such as the R8A7790). Fix it. Fixes: 917de180379d ("drm: rcar-du: Implement universal plane support") Cc: [email protected] Signed-off-by: Laurent Pinchart <[email protected]>
2015-06-16drm: rcar-du: Disable all planes when stopping the CRTCLaurent Pinchart1-0/+13
The DSnPR plane configuration registers are updated on vblank, and no vblank will occur once the CRTC is stopped. We thus can't only disable planes right before starting the CRTC as it would start scanning out immediately from old frame buffers until the next vblank. Fix the problem by disabling all planes when stopping the CRTC and wait for the change to take effect. This increases the CRTC stop delay, especially when multiple CRTCs are stopped in one operation as we now wait for one vblank per CRTC. Whether this can be improved needs to be researched. Signed-off-by: Laurent Pinchart <[email protected]>
2015-06-16drm: rcar-du: Print the error value when DRM/KMS init failsLaurent Pinchart1-1/+1
This helps debugging probe failures. Signed-off-by: Laurent Pinchart <[email protected]>
2015-06-16virtio-gpu: add locking for vbuf poolDave Airlie2-0/+8
Signed-off-by: Dave Airlie <[email protected]> Signed-off-by: Gerd Hoffmann <[email protected]>
2015-06-16drm/virtgpu: initialise fbdev after getting initial display infoDave Airlie3-1/+6
This should avoid issues with the fbdev path trying to render before we've gotten the display info. Signed-off-by: Dave Airlie <[email protected]> [ kraxel: wait for display-info reply ] Signed-off-by: Gerd Hoffmann <[email protected]>
2015-06-16Add virtio-vga bits.Gerd Hoffmann1-20/+24
2015-06-16drm/radeon: remove obsolete kfd_bo from radeon_deviceOded Gabbay1-1/+0
Signed-off-by: Oded Gabbay <[email protected]>
2015-06-16Merge tag 'omapdrm-4.2-atomic' of ↵Dave Airlie13-870/+661
git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux into drm-next omapdrm atomic modesetting support Atomic modesetting support for omapdrm. " we've had issues with omapdrm for years, which we've not been able to fix properly (like warnings/crashes when unloading modules, page-flips tearing, race issues with fbs). All those problems seem to be gone after this rewrite of omapdrm for atomic modesetting, and the resulting code is much cleaner and more maintainable." * tag 'omapdrm-4.2-atomic' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux: (43 commits) drm: omapdrm: new vblank and event handling drm: omapdrm: merge omap_crtc_flush and omap_crtc_atomic_flush drm: omapdrm: add lock for fb pinning drm: omapdrm: if omap_plane_atomic_update fails, disable plane drm: omapdrm: inline omap_plane_setup into update/disable drm: omapdrm: omap_plane_setup() cannot fail, use WARN drm: omapdrm: Don't setup planes manually from CRTC .enable()/.disable() drm: omapdrm: Don't flush CRTC when enabling or disabling it drm: omapdrm: Move encoder setup to encoder operations drm: omapdrm: Simplify DSS power management drm: omapdrm: Remove nested PM get/sync when configuring encoders drm: omapdrm: Support unlinking page flip events prematurely drm: omapdrm: omap_crtc_flush() isn't called with modeset locked drm: omapdrm: Don't get/put dispc in omap_crtc_flush() drm: omapdrm: Make the omap_crtc_flush function static drm: omapdrm: Remove omap_plane enabled field drm: omapdrm: Remove omap_crtc enabled field drm: omapdrm: Move crtc info out of the crtc structure drm: omapdrm: Move plane info and win out of the plane structure drm: omapdrm: Switch crtc and plane set_property to atomic helpers ...
2015-06-16drm/mgag200: Reject non-character-cell-aligned mode widthsAdam Jackson1-0/+5
Turns out 1366x768 does not in fact work on this hardware. Signed-off-by: Adam Jackson <[email protected]> Cc: [email protected] Signed-off-by: Dave Airlie <[email protected]>
2015-06-15drm/i915: Add SCRATCH1 and ROW_CHICKEN3 to the register whitelist.Francisco Jerez1-0/+7
Only bit 27 of SCRATCH1 and bit 6 of ROW_CHICKEN3 are allowed to be set because of security-sensitive bits we don't want userspace to mess with. On HSW hardware the whitelisted bits control whether atomic read-modify-write operations are performed on L3 or on GTI, and when set to L3 (which can be 10x-30x better performing than on GTI, depending on the application) require great care to avoid a system hang, so we currently program them to be handled on GTI by default. Beignet can immediately start taking advantage of this change to enable L3 atomics. Mesa should eventually switch to L3 atomics too, but a number of non-trivial changes are still required so it will continue using GTI atomics for now. Signed-off-by: Francisco Jerez <[email protected]> Reviewed-by: Zhigang Gong <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Signed-off-by: Jani Nikula <[email protected]>
2015-06-15drm/i915: Extend the parser to check register writes against a mask/value pair.Francisco Jerez2-47/+96
In some cases it might be unnecessary or dangerous to give userspace the right to write arbitrary values to some register, even though it might be desirable to give it control of some of its bits. This patch extends the register whitelist entries to contain a mask/value pair in addition to the register offset. For registers with non-zero mask, any LRM writes and LRI writes where the bits of the immediate given by the mask don't match the specified value will be rejected. This will be used in my next patch to grant userspace partial write access to some sensitive registers. Signed-off-by: Francisco Jerez <[email protected]> Reviewed-by: Zhigang Gong <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Signed-off-by: Jani Nikula <[email protected]>
2015-06-15drm/i915: Fix command parser to validate multiple register access with the ↵Francisco Jerez2-31/+48
same command. Until now the software command checker assumed that commands could read or write at most a single register per packet. This is not necessarily the case, MI_LOAD_REGISTER_IMM expects a variable-length list of offset/value pairs and writes them in sequence. The previous code would only check whether the first entry was valid, effectively allowing userspace to write unrestricted registers of the MMIO space by sending a multi-register write with a legal first register, with potential security implications on Gen6 and 7 hardware. Fix it by extending the drm_i915_cmd_descriptor table to represent multi-register access and making validate_cmd() iterate for all register offsets present in the command packet. Signed-off-by: Francisco Jerez <[email protected]> Reviewed-by: Zhigang Gong <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Signed-off-by: Jani Nikula <[email protected]>
2015-06-15Revert "drm/i915: Don't skip request retirement if the active list is empty"Jani Nikula1-0/+3
This reverts commit 0aedb1626566efd72b369c01992ee7413c82a0c5. I messed things up while applying [1] to drm-intel-fixes. Rectify. [1] http://mid.gmane.org/[email protected] Fixes: 0aedb1626566 ("drm/i915: Don't skip request retirement if the active list is empty") Cc: [email protected] Acked-by: Ville Syrjälä <[email protected]> Signed-off-by: Jani Nikula <[email protected]>
2015-06-15drm/i915: Don't skip request retirement if the active list is emptyVille Syrjälä1-3/+0
Apparently we can have requests even if though the active list is empty, so do the request retirement regardless of whether there's anything on the active list. The way it happened here is that during suspend intel_ring_idle() notices the olr hanging around and then proceeds to get rid of it by adding a request. However since there was nothing on the active lists i915_gem_retire_requests() didn't clean those up, and so the idle work never runs, and we leave the GPU "busy" during suspend resulting in a WARN later. Signed-off-by: Ville Syrjälä <[email protected]> Reviewed-by: Chris Wilson <[email protected]> Signed-off-by: Jani Nikula <[email protected]>
2015-06-15drm/i915: Always reset vma->ggtt_view.pages cache on unbindingChris Wilson1-1/+1
With the introduction of multiple views of an obj in the same vm, each vma was taught to cache its copy of the pages (so that different views could have different page arrangements). However, this missed decoupling those vma->ggtt_view.pages when the vma released its reference on the obj->pages. As we don't always free the vma, this leads to a possible scenario (e.g. execbuffer interrupted by the shrinker) where the vma points to a stale obj->pages, and explodes. Fixes regression from commit fe14d5f4e5468c5b80a24f1a64abcbe116143670 Author: Tvrtko Ursulin <[email protected]> Date: Wed Dec 10 17:27:58 2014 +0000 drm/i915: Infrastructure for supporting different GGTT views per object Tvrtko says, if someone else will be confused how this can happen, key is the reservation execbuffer path. That puts the VMA on the exec_list which prevents i915_vma_unbind and i915_gem_vma_destroy from fully destroying the VMA. So the VMA is left existing as an empty object in the list - unbound and disassociated with the backing store. Kind of a cached memory object. And then re-using it needs to clear the cached pages pointer which is fixed above. Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1227892 Signed-off-by: Chris Wilson <[email protected]> Cc: Tvrtko Ursulin <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Michel Thierry <[email protected]> Cc: [email protected] Reviewed-by: Tvrtko Ursulin <[email protected]> [Jani: Added Tvrtko's explanation to commit message.] Signed-off-by: Jani Nikula <[email protected]>
2015-06-15drm/cma: Fix 64-bit size_t build warningsMagnus Damm1-2/+2
Fix warnings related to size_t when building for 64-bit architectures: drivers/gpu/drm/drm_gem_cma_helper.c: In function ‘drm_gem_cma_create’: drivers/gpu/drm/drm_gem_cma_helper.c:114:4: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘size_t’ [-Wformat=] size); ^ drivers/gpu/drm/drm_gem_cma_helper.c: In function ‘drm_gem_cma_describe’: drivers/gpu/drm/drm_gem_cma_helper.c:393:4: warning: format ‘%d’ expects argument of type ‘int’, but argument 8 has type ‘size_t’ [-Wformat=] off, &cma_obj->paddr, cma_obj->vaddr, obj->size); Signed-off-by: Magnus Damm <[email protected]> Signed-off-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Daniel Vetter <[email protected]>
2015-06-12drm: omapdrm: new vblank and event handlingTomi Valkeinen3-76/+70
Rework the crtc event/flip_wait system as follows: - If we enable a crtc (full modeset), we set omap_crtc->pending and register vblank irq. - If we need to set GO bit (page flip), we do the same but also set the GO bit. - On vblank we unregister the irq, clear the 'pending' flag, send vblank event to userspace if crtc->state->event != NULL, and wake up 'pending_wait' wq. - In omap_atomic_complete() we wait for the 'pending' flag to get reset for all enabled crtcs using 'pending_wait' wq. The above ensures that we send the events to userspace in vblank, and that after the wait in omap_atomic_complete() everything for the affected crtcs has been completed. Signed-off-by: Tomi Valkeinen <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]>
2015-06-12drm: omapdrm: merge omap_crtc_flush and omap_crtc_atomic_flushTomi Valkeinen1-21/+14
omap_crtc_atomic_flush() is the only user of omap_crtc_flush(), so just move the code from omap_crtc_flush() to omap_crtc_atomic_flush(). Signed-off-by: Tomi Valkeinen <[email protected]> Acked-by: Laurent Pinchart <[email protected]>
2015-06-12drm: omapdrm: add lock for fb pinningTomi Valkeinen1-1/+18
Before atomic modesetting omap_framebuffer_pin() and omap_framebuffer_unpin() were always called with modesetting locks taken. With atomic modesetting support this is no longer the case, and we need locking to protect the pin_count and the paddr, as multiple threads may pin the same fb concurrently. This patch adds a mutex to struct omap_framebuffer, and uses it in omap_framebuffer_pin() and omap_framebuffer_unpin(). Signed-off-by: Tomi Valkeinen <[email protected]> Acked-by: Laurent Pinchart <[email protected]>
2015-06-12drm: omapdrm: if omap_plane_atomic_update fails, disable planeTomi Valkeinen1-1/+3
omap_plane_atomic_update() calls dispc_ovl_setup(), which can fail (but shouldn't). To make the code a bit more robust, make sure the plane gets disabled if dispc_ovl_setup() fails, as otherwise we might get illegal HW configuration leading to error interrupts. Signed-off-by: Tomi Valkeinen <[email protected]> Acked-by: Laurent Pinchart <[email protected]>
2015-06-12drm: omapdrm: inline omap_plane_setup into update/disableTomi Valkeinen1-27/+17
At the moment we have omap_plane_setup() function which handles both enabling (and configuring) and disabling the plane. With atomic modesetting we have separate hooks for plane enable/config and disable. This patch moves the code from omap_plane_setup() to omap_plane_atomic_update() and omap_plane_atomic_disable(). Signed-off-by: Tomi Valkeinen <[email protected]> Acked-by: Laurent Pinchart <[email protected]>