aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/msm
AgeCommit message (Collapse)AuthorFilesLines
2014-04-01drm: Replace crtc fb with primary plane fb (v3)Matt Roper2-25/+25
Now that CRTC's have a primary plane, there's no need to track the framebuffer in the CRTC. Replace all references to the CRTC fb with the primary plane's fb. This patch was generated by the Coccinelle semantic patching tool using the following rules: @@ struct drm_crtc C; @@ - (C).fb + C.primary->fb @@ struct drm_crtc *C; @@ - (C)->fb + C->primary->fb v3: Generate patch via coccinelle. Actual removal of crtc->fb has been moved to a subsequent patch. v2: Fixup several lingering crtc->fb instances that were missed in the first patch iteration. [Rob Clark] Signed-off-by: Matt Roper <[email protected]> Reviewed-by: Rob Clark <[email protected]>
2014-04-01drm/msm: Switch to universal plane API'sMatt Roper4-8/+18
Use drm_universal_plane_init() and drm_crtc_init_with_planes() rather than the legacy drm_plane_init() / drm_crtc_init(). This will ensure that the proper primary plane is registered with the DRM (and eventually exposed to userspace in future patches). Cc: Rob Clark <[email protected]> Signed-off-by: Matt Roper <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2014-03-31drm/msm/mdp: add timeout for irq waitRob Clark1-1/+2
Make things recover a bit more gracefully if we get stuck with no vblank irq ever coming. Signed-off-by: Rob Clark <[email protected]>
2014-03-31drm/msm: validate flags, etcRob Clark2-3/+32
After reading a nice article on LWN[1], I went back and double checked my handling of invalid-input checking. Turns out there were a couple places I had missed. Since the driver is fairly young, and the devices it supports are really only just barely usable for basic stuff (serial console) with an upstream kernel, I think we should fix this now and revert specific parts of this patch later in the unlikely event that a regression is reported. [1] https://lwn.net/Articles/588444/ Signed-off-by: Rob Clark <[email protected]>
2014-03-31drm/msm: use componentised device supportRob Clark4-33/+176
Signed-off-by: Rob Clark <[email protected]>
2014-03-31drm/msm: add chip-id paramRob Clark1-0/+6
Some of the w/a or different behavior of userspace blob driver seem to be keyed to gpu patch revision, rather than gpu-id. So expose the full chip-id to userspace so it can DTRT. Signed-off-by: Rob Clark <[email protected]>
2014-03-31drm/msm: crank down gpu when inactiveRob Clark4-5/+113
Shut down the clks when the gpu has nothing to do. A short inactivity timer is used to provide a low pass filter for power transitions. Signed-off-by: Rob Clark <[email protected]>
2014-03-31drm/msm: spin helperRob Clark3-38/+32
Helper macro to simplify places where we need to poll with timeout waiting for gpu. Signed-off-by: Rob Clark <[email protected]>
2014-03-31drm/msm: add hang_debug module paramRob Clark3-1/+52
msm.hang_debug=y will dump out current register values if the gpu locks up, for easier debugging. Signed-off-by: Rob Clark <[email protected]>
2014-03-31drm/msm: hdmi audio supportRob Clark5-16/+317
Signed-off-by: Rob Clark <[email protected]>
2014-02-25Merge tag 'qcom-drivers-for-3.15' of ↵Arnd Bergmann1-1/+1
git://git.kernel.org/pub/scm/linux/kernel/git/galak/linux-qcom into next/drivers Merge "qcom driver changes for v3.15" from Kumar Gala: We've split Qualcomm MSM support into legacy and multiplatform. These drivers are only relevant on the multiplatform supported SoCs so switch the Kconfig depends to ARCH_QCOM. * tag 'qcom-drivers-for-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/galak/linux-qcom: gpio: msm: switch Kconfig to ARCH_QCOM depends hwrng: msm: switch Kconfig to ARCH_QCOM depends power: reset: msm - switch Kconfig to ARCH_QCOM depends drm/msm: drop ARCH_MSM Kconfig depend tty: serial: msm: Enable building msm_serial for ARCH_QCOM
2014-02-11drm/msm: drop ARCH_MSM Kconfig dependKumar Gala1-1/+1
The ARCH_MSM depend is redundant with ARCH_MSM8960, so we can remove it. Additionally, we are splitting Qualcomm MSM support into legacy (ARCH_MSM) and multiplatform (ARCH_QCOM). The MSM8960 with be ARCH_QCOM going forward so dropping ARCH_MSM will work properly for the new ARCH_QCOM multiplatform build. Acked-by: Rob Clark <[email protected]> Signed-off-by: Kumar Gala <[email protected]>
2014-02-11Merge branch 'msm-next' of git://people.freedesktop.org/~robclark/linux into ↵Dave Airlie6-74/+130
drm-next Compared to original fixes pull req that I sent yesterday, this adds one more fix that I found for a synchronization issue which starts to crop up when we use XA in DDX for 2d accel on 3d core. In particular, accelerating presentation blit triggers this problem. * 'msm-next' of git://people.freedesktop.org/~robclark/linux: drm/msm: bigger synchronization hammer drm/msm: fix deadlock in bo create fail path drm/msm/mdp4: cursor fixes drm/msm/mdp4: pageflip fixes drm/msm/mdp5: fix ref leaks in error paths drm/msm: fix inconsequential typo
2014-02-07drm/msm: bigger synchronization hammerRob Clark2-7/+5
Because we use a list_head in the bo to track it's position in a submit, we need to serialize at a higher layer. Otherwise there are problems when multiple contexts are SUBMIT'ing in parallel cmdstreams referencing a shared bo. Signed-off-by: Rob Clark <[email protected]>
2014-02-05drm/msm: fix deadlock in bo create fail pathRob Clark1-1/+1
We already hold struct_mutex here. Signed-off-by: Rob Clark <[email protected]>
2014-02-05drm/msm/mdp4: cursor fixesRob Clark1-6/+16
It seems we need to update all cursor registers from vblank. This appears to be the cause of intermittent underflows when enabling/ disabling cursor. Signed-off-by: Rob Clark <[email protected]>
2014-02-05drm/msm/mdp4: pageflip fixesRob Clark1-57/+100
Backport a few fixes found in the course of getting mdp5 working. There is a window of time after pageflip is requested, before we start scanning out the new fb (ie. while we are waiting for gpu). During that time we need to continue holding a reference to the still-current scanout fb, to avoid the backing gem bo's from being destroyed. Possibly a common mdp_crtc parent class could be useful to share some of this logic between mdp4_crtc and mdp5_crtc. OTOH, this all can be removed from the driver once atomic is in place, as plane/crtc updates get deferred until all fb's are ready before calling in to .page_flip(), etc. Signed-off-by: Rob Clark <[email protected]>
2014-02-05drm/msm/mdp5: fix ref leaks in error pathsRob Clark1-1/+6
Signed-off-by: Rob Clark <[email protected]>
2014-02-05drm/msm: fix inconsequential typoRob Clark1-2/+2
Small typo I noticed in the mdp4_plane code.. no consequence because PIPE_SRC_XY and PIPE_DST_XY have same register layout. Signed-off-by: Rob Clark <[email protected]>
2014-01-29Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linuxLinus Torvalds52-855/+5271
Pull drm updates from Dave Airlie: "Been a bit busy, first week of kids school, and waiting on other trees to go in before I could send this, so its a bit later than I'd normally like. Highlights: - core: timestamp fixes, lots of misc cleanups - new drivers: bochs virtual vga - vmwgfx: major overhaul for their nextgen virt gpu. - i915: runtime D3 on HSW, watermark fixes, power well work, fbc fixes, bdw is no longer prelim. - nouveau: gk110/208 acceleration, more pm groundwork, old overlay support - radeon: dpm rework and clockgating for CIK, pci config reset, big endian fixes - tegra: panel support and DSI support, build as module, prime. - armada, omap, gma500, rcar, exynos, mgag200, cirrus, ast: fixes - msm: hdmi support for mdp5" * 'drm-next' of git://people.freedesktop.org/~airlied/linux: (595 commits) drm/nouveau: resume display if any later suspend bits fail drm/nouveau: fix lock unbalance in nouveau_crtc_page_flip drm/nouveau: implement hooks for needed for drm vblank timestamping support drm/nouveau/disp: add a method to fetch info needed by drm vblank timestamping drm/nv50: fill in crtc mode struct members from crtc_mode_fixup drm/radeon/dce8: workaround for atom BlankCrtc table drm/radeon/DCE4+: clear bios scratch dpms bit (v2) drm/radeon: set si_notify_smc_display_change properly drm/radeon: fix DAC interrupt handling on DCE5+ drm/radeon: clean up active vram sizing drm/radeon: skip async dma init on r6xx drm/radeon/runpm: don't runtime suspend non-PX cards drm/radeon: add ring to fence trace functions drm/radeon: add missing trace point drm/radeon: fix VMID use tracking drm: ast,cirrus,mgag200: use drm_can_sleep drm/gma500: Lock struct_mutex around cursor updates drm/i915: Fix the offset issue for the stolen GEM objects DRM: armada: fix missing DRM_KMS_FB_HELPER select drm/i915: Decouple GPU error reporting from ring initialisation ...
2014-01-14drm: store the gem vma offset manager in a typed pointerDaniel Vetter1-1/+1
This was hidden in a generic void * dev->mm_private. But only ever used for gem. But thanks to this fake generic pretension no one noticed that Rob's drm drivers are now all broken. So just give the offset manager a type pointer and fix up msm, omapdrm and tilcdc. v2: Fixup compile fail. v3: Fixup rebase fail that David spotted. Cc: David Herrmann <[email protected]> Cc: Rob Clark <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2014-01-09drm/msm: add a330/apq8x74Rob Clark5-23/+144
Add support for adreno 330. Not too much different, just a few differences in initial configuration plus setting OCMEM base. Userspace support is already in upstream mesa. Note that the existing DT code is simply using the bindings from downstream android kernel, to simplify porting of this driver to existing devices. These do not constitute any committed/stable DT ABI. The addition of proper DT bindings will be a subsequent patch, at which point (as best as possible) I will try to support either upstream bindings or what is found in downstream android kernel, so that existing device DT files can be used. Signed-off-by: Rob Clark <[email protected]>
2014-01-09drm/msm: add mdp5/apq8x74Rob Clark12-2/+2167
Add support for the new MDP5 display controller block. The mapping between parts of the display controller and KMS is: plane -> PIPE{RGBn,VIGn} \ crtc -> LM (layer mixer) |-> MDP "device" encoder -> INTF / connector -> HDMI/DSI/eDP/etc --> other device(s) Unlike MDP4, it appears we can get by with a single encoder, rather than needing a different implementation for DTV, DSI, etc. (Ie. the register interface is same, just different bases.) Also unlike MDP4, all the IRQs for other blocks (HDMI, DSI, etc) are routed through MDP. And finally, MDP5 has this "Shared Memory Pool" (called "SMP"), from which blocks need to be allocated to the active pipes based on fetch stride. Signed-off-by: Rob Clark <[email protected]>
2014-01-09drm/msm: add hdmi support for apq8x74/mdp5Rob Clark8-107/+511
The HDMI block is basically the same between older SoC's with mdp4 display controller, and newer ones with mdp5. So mostly this consists of better abstracting out the different sets of regulators, clks, etc. In particular, for regulators and clks we can split it up by what is needed for hot plug detect to work, and what is needed to light up the display. Also, 8x74 has a new phy.. a very simple one, but split out into a different mmio space. And with mdp5, the irq is shared with mdp, so we don't directly register our own irq handler. Signed-off-by: Rob Clark <[email protected]>
2014-01-09drm/msm: move irq utils to mdp_kmsRob Clark10-169/+254
We'll want basically the same thing for mdp5, so refactor it out so it can be shared. Signed-off-by: Rob Clark <[email protected]>
2014-01-09drm/msm: split out msm_kms.hRob Clark6-30/+60
Signed-off-by: Rob Clark <[email protected]>
2014-01-09drm/msm: mdp4_format -> mdp_formatRob Clark7-31/+64
This can be shared between mdp4 and mdp5. Both use the same set of parameters to describe the format to the hw. Signed-off-by: Rob Clark <[email protected]>
2014-01-09drm/msm: resync generated headersRob Clark14-243/+1525
resync to latest envytools db, add mdp5 registers Signed-off-by: Rob Clark <[email protected]>
2014-01-09drm/msm: move mdp4 -> mdp/mdp4Rob Clark9-6/+6
There are some little bits and pieces that mdp4 and mdp5 can share, so move things around so that we can have both in a common parent directory. Signed-off-by: Rob Clark <[email protected]>
2014-01-09drm/msm: add support for msm8060ab/bstemRob Clark3-5/+19
This adds the necessary configuration for the APQ8060A SoC (dual-core krait + a320 gpu) as found on the bstem board. Signed-off-by: Rob Clark <[email protected]>
2014-01-09drm/msm: add support for non-IOMMU systemsRob Clark12-147/+410
Add a VRAM carveout that is used for systems which do not have an IOMMU. The VRAM carveout uses CMA. The arch code must setup a CMA pool for the device (preferrably in highmem.. a 256m-512m VRAM pool in lowmem is not cool). The user can configure the VRAM pool size using msm.vram module param. Technically, the abstraction of IOMMU behind msm_mmu is not strictly needed, but it simplifies the GEM code a bit, and will be useful later when I add support for a2xx devices with GPUMMU, so I decided to keep this part. It appears to be possible to configure the GPU to restrict access to addresses within the VRAM pool, but this is not done yet. So for now the GPU will refuse to load if there is no sort of mmu. Once address based limits are supported and tested to confirm that we aren't giving the GPU access to arbitrary memory, this restriction can be lifted Signed-off-by: Rob Clark <[email protected]>
2014-01-09drm/msm: fix bus scalingRob Clark4-15/+23
This got a bit broken with original patches when re-arranging things to move dependencies on mach-msm inside #ifndef OF. Signed-off-by: Rob Clark <[email protected]>
2014-01-09drm/msm: add missing MODULE_FIRMWARE()sRob Clark1-0/+5
Signed-off-by: Rob Clark <[email protected]>
2014-01-09drm/msm: COMPILE_TEST supportRob Clark3-4/+10
With a simple stub, we can get COMPILE_TEST support. Signed-off-by: Rob Clark <[email protected]>
2014-01-07drm/msm: Fix link error with !MSM_IOMMUJoerg Roedel1-0/+1
The DRM driver for MSM depends on symbols from the MSM IOMMU driver. Add this dependency to the Kconfig file. Fixes this comile error: Kernel: arch/arm/boot/zImage is ready ERROR: "msm_iommu_get_ctx" [drivers/gpu/drm/msm/msm.ko] undefined! make[2]: *** [__modpost] Error 1 Cc: Rob Clark <[email protected]> Signed-off-by: Joerg Roedel <[email protected]>
2013-12-18drm: Kill DRM_IRQ_ARGSDaniel Vetter1-1/+1
I've killed them a long time ago in drm/i915, let's get rid of this remnant of shared drm core days for good. Signed-off-by: Daniel Vetter <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-12-18drm/msm: call drm_put_dev directly in ->removeDaniel Vetter1-1/+1
The drvdata pointer is already assigned to something useful. Cc: Rob Clark <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Reviewed-by: Rob Clark <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-11-10Merge branch 'msm-next' of git://people.freedesktop.org/~robclark/linux into ↵Dave Airlie22-252/+664
drm-next prime support, inactive rework, render nodes * 'msm-next' of git://people.freedesktop.org/~robclark/linux: drm/msm/mdp4: page_flip cleanups/fixes drm/msm: EBUSY status handling in msm_gem_fault() drm/msm: rework inactive-work drm/msm: add plane support drm/msm: resync generated headers drm/msm: support render nodes drm/msm: prime support
2013-11-01drm/msm/mdp4: page_flip cleanups/fixesRob Clark3-15/+50
There were a few potential problems with the original page_flip/vblank code in mdp4_crtc. 1) We need vblank irq for a couple things, both completing flips and updating cursor. We need to keep track of what work is pending so that (for example) a cursor update while we are still waiting for pageflip_cb (ie. pageflip requested from userspace, but still waiting for rendering to complete) would not prematurely trigger event to userspace. 2) A preclose -> pageflip-cancel should not cancel a pageflip that was requested on a different file (ie. non-master closing should not cancel a pending pageflip). With these fixes, we no longer have problems w/ cursor not updating and with occasional hangs with userspace waiting for a pageflip that had been cancelled (launching XBMC from gnome-shell overview mode was a good way to trigger this, but now works reliably). Signed-off-by: Rob Clark <[email protected]>
2013-11-01drm/msm: EBUSY status handling in msm_gem_fault()Rob Clark1-0/+5
Subsequent threads returning EBUSY from vm_insert_pfn() was not handled correctly. As a result concurrent access from new threads to mmapped data caused SIGBUS. See e79e0fe3 Signed-off-by: Rob Clark <[email protected]> Acked-by: David Brown <[email protected]>
2013-11-01drm/msm: rework inactive-workRob Clark6-33/+71
Re-arrange things a bit so that we can get work requested after a bo fence passes, like pageflip, done before retiring bo's. Without any sort of bo cache in userspace, some games can trigger hundred's of transient bo's, which can cause retire to take a long time (5-10ms). Obviously we want a bo cache.. but this cleanup will make things a bit easier for atomic as well and makes things a bit cleaner. Signed-off-by: Rob Clark <[email protected]> Acked-by: David Brown <[email protected]>
2013-11-01drm/msm: add plane supportRob Clark6-56/+182
Enable using VG1 and VG2 for planes. Currently YUV/CSC or scaling is not enabled, but ARGB and xRGB blending is. Signed-off-by: Rob Clark <[email protected]> Acked-by: David Brown <[email protected]>
2013-11-01drm/msm: resync generated headersRob Clark12-115/+169
resync to latest envytools db, fixes a typo: s/mpd4/mdp4/ Signed-off-by: Rob Clark <[email protected]> Acked-by: David Brown <[email protected]>
2013-11-01drm/msm: support render nodesRob Clark1-7/+8
Enable support for drm render nodes for msm by flagging the ioctls that are safe and only needed for rendering. Signed-off-by: Rob Clark <[email protected]> Acked-by: David Brown <[email protected]>
2013-11-01drm/msm: prime supportRob Clark5-26/+179
Signed-off-by: Rob Clark <[email protected]> Acked-by: David Brown <[email protected]>
2013-10-11drm: Add separate Kconfig option for fbdev helpersDaniel Vetter1-0/+1
For drivers which might want to disable fbdev legacy support. Select the new option in all drivers for now, so this shouldn't result in any change. Drivers need some work anyway to make fbdev support optional (if they have it implemented, that is), so the recommended way to expose this is by adding per-driver options. At least as long as most drivers don't support disabling the fbdev support. v2: Update for new drm drivers msm and rcar-du. Note that Rob's msm driver can already take advantage of this, which allows us to build msm without any fbdev depencies in the kernel! v3: Move the MODULE_* stuff from the fbdev helper file to drm_crtc_helper.c. Cc: David Herrmann <[email protected]> Cc: Rob Clark <[email protected]> Reviewed-by: Rob Clark <[email protected]> Acked-by: Dave Airlie <[email protected]> Reviewed-by: Chon Ming Lee <[email protected]> Signed-off-by: Daniel Vetter <[email protected]>
2013-09-28drm/msm: use drm_gem_dumb_destroy helperRob Clark2-8/+1
Signed-off-by: Rob Clark <[email protected]>
2013-09-28drm/msm: deal with mach/iommu.h removalRob Clark1-2/+2
We still need an API exported by msm iommu driver (but not visible in any public header anymore). For now, just declare the prototype ourselves, but when msm iommu driver provides a better option, use that instead. Signed-off-by: Rob Clark <[email protected]>
2013-09-28drm/msm: Remove iommu include from mdp4_kms.cJoerg Roedel1-2/+0
The include file has been removed and the file does not need it anyway, so remove it. Fixes a compile error. Signed-off-by: Joerg Roedel <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2013-09-28drm/msm: Odd PTR_ERR usageThomas Meyer1-1/+1
The variable priv->kms is not initialized yet. Found by "scripts/coccinelle/tests/odd_ptr_err.cocci". PTR_ERR should access the value just tested by IS_ERR. Signed-off-by: Thomas Meyer <[email protected]>