summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'imx-drm-next-2018-01-02' of ↵Dave Airlie2018-01-059-39/+189
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.pengutronix.de/git/pza/linux into drm-next drm/imx: format modifier support - Add tiled prefetch support to PRE - Add format modifier support to PRG and imx-drm-core - Use runtime PM to control PRG clock - Allow building ipu-v3 under COMPILE_TEST * tag 'imx-drm-next-2018-01-02' of git://git.pengutronix.de/git/pza/linux: gpu: ipu-v3: allow to build with COMPILE_TEST drm/imx: advertise supported plane format modifiers drm/imx: add FB modifier support gpu: ipu-v3: prg: add modifier support gpu: ipu-v3: pre: add tiled prefetch support gpu: ipu-v3: prg: switch to runtime PM
| * gpu: ipu-v3: allow to build with COMPILE_TESTPhilipp Zabel2017-12-193-1/+5
| | | | | | | | | | | | | | | | Add missing include <linux/sizes.h> in ipu-cpmem and ipu-ic, select BITREVERSE for ipu-cpmem and GENERIC_ALLOCATOR for ipu-pre, and allow to build if COMPILE_TEST is enabled. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
| * drm/imx: advertise supported plane format modifiersLucas Stach2017-12-191-1/+34
| | | | | | | | | | | | | | | | Let userspace know about the supported modifiers, to make automatic selection of a proper modifier possible. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
| * drm/imx: add FB modifier supportLucas Stach2017-12-192-6/+60
| | | | | | | | | | | | | | | | This adds FB modifier support for the Vivante single buffer tiled formats, when the PRG/PRE engines are present. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
| * gpu: ipu-v3: prg: add modifier supportLucas Stach2017-12-193-6/+13
| | | | | | | | | | | | | | | | Allow to pass through the modifier to the PRE unit and extend the format check with the supported modifiers. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
| * gpu: ipu-v3: pre: add tiled prefetch supportLucas Stach2017-12-193-6/+29
| | | | | | | | | | | | | | | | | | | | This configures the TPR unit, using the DRM format modifier. For now only the single buffer modifiers are supported, as split buffer needs more configuration for the required cropping. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> [p.zabel@pengutronix.de: rebased after ERR009624 workaround] Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
| * gpu: ipu-v3: prg: switch to runtime PMLucas Stach2017-12-191-21/+50
| | | | | | | | | | | | | | | | Instead of open-coding the clk enable/disable in all of the callers move this to the RPM suspend/resume functions. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
* | Merge branch 'drm-armada-devel-4.15' of ↵Dave Airlie2018-01-054-290/+496
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.armlinux.org.uk/~rmk/linux-arm into drm-next This series builds upon the set of fixes previously submitted to move Armada DRM closer to atomic modeset. We're nowhere near yet, but this series helps to get us closer by unifying some of the differences between the primary and overlay planes. New features added allows userspace to disable the primary plane if overlay is full screen and there's nothing obscuring the colorkey - this saves having to fetch an entire buffer containing nothing but colorkey when displaying full screen video. [airlied: fixup for atomic plane helper rename: a01cb8ba3f6282934cff65e89ab36b18b14cbe27 Author: Ville Syrjälä <ville.syrjala@linux.intel.com> Date: Wed Nov 1 22:16:19 2017 +0200 drm: Move drm_plane_helper_check_state() into drm_atomic_helper.c ] * 'drm-armada-devel-4.15' of git://git.armlinux.org.uk/~rmk/linux-arm: (29 commits) drm/armada: expand overlay trace entry drm/armada: implement primary plane update drm/armada: extract register generation from armada_drm_primary_set() drm/armada: wait for previous work when moving overlay window drm/armada: move overlay plane register update generation drm/armada: re-organise overlay register update generation drm/armada: disable planes at next blanking period drm/armada: avoid work allocation drm/armada: allow armada_drm_plane_work_queue() to silently fail drm/armada: use drm_plane_helper_check_state() drm/armada: only enable HSMOOTH if scaling horizontally drm/armada: move writes of LCD_SPU_SRAM_PARA1 under lock drm/armada: move regs into armada_plane_work drm/armada: move event sending into armada_plane_work drm/armada: move fb retirement into armada_plane_work drm/armada: move overlay plane work out from under spinlock drm/armada: clear plane enable bit when disabling drm/armada: clean up armada_drm_crtc_plane_disable() drm/armada: allow the primary plane to be disabled drm/armada: wait and cancel any pending frame work at disable ...
| * | drm/armada: expand overlay trace entryRussell King2017-12-081-2/+22
| | | | | | | | | | | | | | | | | | Add CRTC and source positions to the Armada overlay trace entry. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
| * | drm/armada: implement primary plane updateRussell King2017-12-081-1/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement primary plane update without having to go through a modeset to achieve that; the hardware does not require such complexity. This means we treat the primary plane as any other, allowing the format, size, position and scaling to be updated via the normal plane ioctls. This also allows us to seemlessly disable and re-enable the primary plane when (eg) displaying full-frame video without any graphic clipping the overlaid video - which saves wasting memory bandwidth needlessly verifying that the colorkey is indeed filling the entire primary plane. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
| * | drm/armada: extract register generation from armada_drm_primary_set()Russell King2017-12-081-9/+16
| | | | | | | | | | | | | | | | | | | | | Extract the register generation from armada_drm_primary_set(), so that it can be re-used. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
| * | drm/armada: wait for previous work when moving overlay windowRussell King2017-12-081-4/+4
| | | | | | | | | | | | | | | | | | | | | We must wait for the previous plane work to complete before moving the overlay window, as it could overwrite our positioning update. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
| * | drm/armada: move overlay plane register update generationRussell King2017-12-082-93/+112
| | | | | | | | | | | | | | | | | | | | | Move the overlay plane register update generation to a separate function as this is independent of the legacy or atomic update. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
| * | drm/armada: re-organise overlay register update generationRussell King2017-12-081-30/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | Re-organise overlay register generation so that we do not have to wait for the previous update to complete while creating the new state. This allows the update to be fully prepared before queueing it for the next interrupt. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
| * | drm/armada: disable planes at next blanking periodRussell King2017-12-082-32/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Disable planes at the next blanking period rather than immediately. In order to achieve this, we need to delay the clearing of dcrtc->plane until after the next blanking period, so move that into a separate work function. To avoid races, we also need to move its assignment in the overlay code. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
| * | drm/armada: avoid work allocationRussell King2017-12-083-15/+23
| | | | | | | | | | | | Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
| * | drm/armada: allow armada_drm_plane_work_queue() to silently failRussell King2017-12-082-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid printing an error message when armada_drm_plane_work_queue() is unable to get the vblank (eg, because we're doing a modeset.) Continue to report the failure to the caller, so the caller can handle this. Move the error message into armada_ovl_plane_update(). Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
| * | drm/armada: use drm_plane_helper_check_state()Russell King2017-12-081-29/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use drm_plane_helper_check_state() to check the overlay plane state rather than drm_plane_helper_check_update(), as: (1) using drm_plane_helper_check_state() provides a better migration path to atomic modeset (2) it avoids needless copies of drm rectangle structures, and so is more efficient. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
| * | drm/armada: only enable HSMOOTH if scaling horizontallyRussell King2017-12-082-7/+8
| | | | | | | | | | | | | | | | | | | | | Only enable the HSMOOTH control bit if we are scaling horizontally, otherwise it makes no sense to enable the horizontal scaler. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
| * | drm/armada: move writes of LCD_SPU_SRAM_PARA1 under lockRussell King2017-12-082-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | Move writes of LCD_SPU_SRAM_PARA1 under the irq lock, so that we can add this to the frame updates at interrupt time when disabling a plane. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
| * | drm/armada: move regs into armada_plane_workRussell King2017-12-083-50/+39
| | | | | | | | | | | | | | | | | | | | | | | | Move the register update structure out of the overlay private structure into armada_plane_work, as this is common to both the primary and overlay planes. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
| * | drm/armada: move event sending into armada_plane_workRussell King2017-12-082-14/+14
| | | | | | | | | | | | | | | | | | | | | Move the sending of events into the armada_plane_work structure, and combine the processing in armada_drm_plane_work_call(). Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
| * | drm/armada: move fb retirement into armada_plane_workRussell King2017-12-083-30/+13
| | | | | | | | | | | | | | | | | | | | | | | | Both the primary and overlay planes retire framebuffers in a similar manner; this can be consolidated by moving the retirement up to the armada_plane_work layer. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
| * | drm/armada: move overlay plane work out from under spinlockRussell King2017-12-082-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the overlay plane work out from under the spinlock so that both the primary and overlay planes run their work in the same context. This is necessary so that we can use frame works with the overlay plane. However, we must update the CRTC registers under the spinlock, so fix up the overlay code for that. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
| * | drm/armada: clear plane enable bit when disablingRussell King2017-12-082-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | Clear the plane enable bit in the software state within armada_drm_plane_disable() when disabling either the primary or overlay planes. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
| * | drm/armada: clean up armada_drm_crtc_plane_disable()Russell King2017-12-083-20/+14
| | | | | | | | | | | | | | | | | | | | | | | | Merge armada_drm_primary_disable() into armada_drm_crtc_plane_disable() and rename to armada_drm_plane_disable(). Use this to simplify armada_ovl_plane_disable(). Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
| * | drm/armada: allow the primary plane to be disabledRussell King2017-12-081-44/+55
| | | | | | | | | | | | | | | | | | Add our own hook to allow the primary plane to be disabled. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
| * | drm/armada: wait and cancel any pending frame work at disableRussell King2017-12-082-8/+22
| | | | | | | | | | | | | | | | | | | | | | | | Wait for a second, and if we time out, cancel any pending work when disabling the primary plane. This ensures that any pending work is completed or cleaned up prior to the disable taking effect. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
| * | drm/armada: add work cancel callbackRussell King2017-12-082-7/+17
| | | | | | | | | | | | | | | | | | | | | Add a work cancel callback, so that work items can add functionality to clean themselves up when they are cancelled. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
| * | drm/armada: store plane in armada_plane_workRussell King2017-12-083-25/+21
| | | | | | | | | | | | | | | | | | | | | | | | Store the plane in the armada_plane_work structure rather than passing it around; it doesn't get used very much in the work structures, so passing it around is a needless expense. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
| * | drm/armada: add a common frame work allocatorRussell King2017-12-081-7/+17
| | | | | | | | | | | | | | | | | | | | | Add and use a common frame work allocator, initialising the frame work to a sane state. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
| * | drm/armada: remove armada_drm_plane_work_cancel() return valueRussell King2017-12-082-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | armada_drm_plane_work_cancel()'s returned work structure is never used or referenced, so it's pointless returning it. It's also pointless because the caller doesn't have a clue what kind of work structure it is. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
| * | drm/armada: fix YUV planar format framebuffer offsetsRussell King2017-12-081-1/+7
| | | | | | | | | | | | | | | | | | | | | We weren't correctly calculating the YUV planar offsets for subsampled chroma planes correctly - fix up the coordinates for planes 1 and 2. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
| * | drm/armada: improve efficiency of armada_drm_plane_calc_addrs()Russell King2017-12-081-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | Lookup the drm_format_info structure once when computing all the framebuffer plane addresses by using drm_format_info(), rather than repetitive lookups via drm_format_plane_cpp(). Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
| * | drm/armada: fix UV swap codeRussell King2017-12-082-19/+21
| | | | | | | | | | | | | | | | | | | | | The UV swap code was not always programming things correctly when the source origin box has been offset. Fix this. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
| * | drm/armada: fix SRAM powerdownRussell King2017-12-081-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid powering down the overlay SRAM banks when disabling the primary plane, thereby masking any overlay video. This feature is supposed to allow us to cut the bandwidth required while displaying full-frame overlay video. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
| * | drm/armada: fix leak of crtc structureRussell King2017-12-081-12/+13
| | | | | | | | | | | | | | | | | | | | | Fix the leak of the CRTC structure in the failure paths of armada_drm_crtc_create(). Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
* | | Merge branch 'etnaviv/next' of https://git.pengutronix.de/git/lst/linux into ↵Dave Airlie2018-01-0519-511/+323
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | drm-next Highlights this time: 1. Fix for a nasty Kconfig dependency chain issue from Philipp. 2. Occlusion query buffer address added to the cmdstream validator by Christian. 3. Fixes and cleanups to the job handling from me. This allows us to turn on the GPU performance profiling added in the last cycle. It is also prep work for hooking in the DRM GPU scheduler, which I hope to land for the next cycle. * 'etnaviv/next' of https://git.pengutronix.de/git/lst/linux: (32 commits) drm/etnaviv: use memset32 to init pagetable drm/etnaviv: move submit free out of critical section drm/etnaviv: re-enable perfmon support drm/etnaviv: couple runtime PM management to submit object lifetime drm/etnaviv: move GPU active handling to bo pin/unpin drm/etnaviv: move cmdbuf into submit object drm/etnaviv: use submit exec_state for perfmon sampling drm/etnaviv: move exec_state to submit object drm/etnaviv: move PMRs to submit object drm/etnaviv: refcount the submit object drm/etnaviv: move ww_acquire_ctx out of submit object drm/etnaviv: move object unpinning to submit cleanup drm/etnaviv: attach in fence to submit and move fence wait to fence_sync drm/etnaviv: rename submit fence to out_fence drm/etnaviv: move object fence attachment to gem_submit path drm/etnaviv: simplify submit_create drm/etnaviv: add lockdep annotations to buffer manipulation functions drm/etnaviv: hold GPU lock while inserting END command drm/etnaviv: move workqueue to be per GPU drm/etnaviv: remove switch_context member from etnaviv_gpu ...
| * | | drm/etnaviv: use memset32 to init pagetableLucas Stach2018-01-021-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that memset32 is available, the open-coded pagetable initialization loop can be replaced. Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
| * | | drm/etnaviv: move submit free out of critical sectionLucas Stach2018-01-021-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no need to hold the GPU lock while freeing the submit object. Only move the retired submits from the GPU active list to a temporary retire list under the GPU lock. Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
| * | | drm/etnaviv: re-enable perfmon supportLucas Stach2018-01-021-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that the PMR lifetime issues are solved we can safely re-enable performance counter profiling support. Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
| * | | drm/etnaviv: couple runtime PM management to submit object lifetimeLucas Stach2018-01-023-27/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As long as there is an active submit, we want the GPU to stay awake. This is slightly complicated by the fact that we really want to wake the GPU at the last possible moment to achieve maximum power savings. Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
| * | | drm/etnaviv: move GPU active handling to bo pin/unpinLucas Stach2018-01-022-10/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The active count is used to check if the BO is idle, where idle is defined as not active on the GPU and all VM mappings and reference counts dropped to the initial state. As the idling of the mappings and references now only happens in the submit cleanup, the active state handling must be moved to the same location in order to keep the userspace semantics. Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
| * | | drm/etnaviv: move cmdbuf into submit objectLucas Stach2018-01-0210-101/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Less dynamic allocations and slims down the cmdbuf object to only the required information, as everything else is already available in the submit object. This also simplifies buffer and mappings lifetime management, as they are now exlusively attached to the submit object and not additionally to the cmdbuf. Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
| * | | drm/etnaviv: use submit exec_state for perfmon samplingLucas Stach2018-01-023-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The GPU exec state may have changed at the time when the perfmon sampling is done, as it reflects the state of the last submission, not the current GPU execution state. So for proper sampling we must use the submit exec_state. Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
| * | | drm/etnaviv: move exec_state to submit objectLucas Stach2018-01-026-11/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We'll need this in some places where only the submit is available. Also this is a first step at slimming down the cmdbuf object. Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
| * | | drm/etnaviv: move PMRs to submit objectLucas Stach2018-01-026-49/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | To make them available to the event worker even after the actual command stream execution has finished. Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
| * | | drm/etnaviv: refcount the submit objectLucas Stach2018-01-022-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The submit object lifetime will get extended to the actual GPU execution. As multiple users will depend on this, add a kref to properly control destruction of the object. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
| * | | drm/etnaviv: move ww_acquire_ctx out of submit objectLucas Stach2018-01-022-10/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The acquire_ctx is special in that it needs to be released from the same thread as has been used to initialize it. This collides with the intention to extend the submit lifetime beyond the gem_submit function with potentially other threads doing the final cleanup. Move the ww_acquire_ctx to the function local stack as suggested in the documentation. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
| * | | drm/etnaviv: move object unpinning to submit cleanupLucas Stach2018-01-021-21/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is safe to call in all paths, as the BO_PINNED flag tells us if the BO needs unpinning. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>