Commit Graph

98 Commits

Author SHA1 Message Date
Rob Clark
41e69778c8 drm/msm: DT support for 8960/8064 (v3)
Now that we (almost) have enough dependencies in place (MMCC, RPM, etc),
add necessary DT support so that we can use drm/msm on upstream kernel.

v2: update for review comments
v3: rebase on component helper changes

Signed-off-by: Rob Clark <robdclark@gmail.com>
2014-08-04 11:55:28 -04:00
Hai Li
8f67da335d drm/msm: Implement msm drm fb_mmap callback function
This change implements msm drm specific fb_mmap function for fb device
to properly map the fb address to userspace.

Signed-off-by: Hai Li <hali@codeaurora.org>
Signed-off-by: Stephane Viau <sviau@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com> (+ minor comment tweak)
2014-08-04 11:55:28 -04:00
Stephane Viau
3bf6c1ecae drm/msm: activate iommu support
This changes activates the iommu support for MDP5, through the
platform config structure.

Signed-off-by: Stephane Viau <sviau@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2014-08-04 11:55:28 -04:00
Rob Clark
b544021f18 drm/msm: fix double struct_mutex acquire
Mutex is already grabbed in show_locked().. somehow this slipped
through.

Signed-off-by: Rob Clark <robdclark@gmail.com>
2014-08-04 11:55:27 -04:00
Dave Airlie
78660d5fb0 Merge branch 'component-for-drm' of git://ftp.arm.linux.org.uk/~rmk/linux-arm into drm-next
pull the msm patch in.
* 'component-for-drm' of git://ftp.arm.linux.org.uk/~rmk/linux-arm:
  drm: msm: update to use component match support
2014-07-23 14:30:13 +10:00
Thierry Reding
10a2310265 drm: Introduce drm_fb_helper_prepare()
To implement hotplug detection in a race-free manner, drivers must call
drm_kms_helper_poll_init() before hotplug events can be triggered. Such
events can be triggered right after any of the encoders or connectors
are initialized. At the same time, if the drm_fb_helper_hotplug_event()
helper is used by a driver, then the poll helper requires some parts of
the FB helper to be initialized to prevent a crash.

At the same time, drm_fb_helper_init() requires information that is not
necessarily available at such an early stage (number of CRTCs and
connectors), so it cannot be used yet.

Add a new helper, drm_fb_helper_prepare(), that initializes the bare
minimum needed to allow drm_kms_helper_poll_init() to execute and any
subsequent hotplug events to be processed properly.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-07-08 11:31:28 +10:00
Thierry Reding
3a4938799d drm: Constify struct drm_fb_helper_funcs
There's no need for this to be modifiable. Make it const so that it can
be put into the .rodata section.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-07-08 11:31:15 +10:00
Dave Airlie
f71c5d9dd2 Merge branch 'drm-next' of git://people.freedesktop.org/~dvdhrm/linux into drm-next
* 'drm-next' of git://people.freedesktop.org/~dvdhrm/linux:
  drm/omap: remove null test before kfree
  drm/bochs: replace ALIGN(PAGE_SIZE) by PAGE_ALIGN
  drm/ttm: recognize ARM arch in ioprot handler
  drm: enable render-nodes by default
  drm/ttm: remove declaration of ttm_tt_cache_flush
  drm/gem: remove misleading gfp parameter to get_pages()
  drm/omap: use __GFP_DMA32 for shmem-backed gem
  drm/i915: use shmem helpers if possible

Conflicts:
	drivers/gpu/drm/drm_stub.c
2014-07-08 11:08:31 +10:00
Dave Airlie
afa95e7403 Merge tag 'topic/core-stuff-2014-06-30' of git://anongit.freedesktop.org/drm-intel into drm-next
misc core patches picked up by Daniel and Jani.

* tag 'topic/core-stuff-2014-06-30' of git://anongit.freedesktop.org/drm-intel:
  drm/fb-helper: Remove unnecessary list empty check in drm_fb_helper_debug_enter()
  drm/fb-helper: Redundant info->fix.type_aux setting in drm_fb_helper_fill_fix()
  drm/debugfs: add an "edid_override" file per connector
  drm/debugfs: add a "force" file per connector
  drm: add register and unregister functions for connectors
  drm: fix uninitialized acquire_ctx fields (v2)
  drm: Driver-specific ioctls range from 0x40 to 0x9f
  drm: Don't export internal module variables
2014-07-08 11:04:35 +10:00
David Herrmann
0cdbe8ac69 drm/gem: remove misleading gfp parameter to get_pages()
drm_gem_get_pages() currently allows passing a 'gfp' parameter that is
passed to shmem combined with mapping_gfp_mask(). Given that the default
mapping_gfp_mask() is GFP_HIGHUSER, it is _very_ unlikely that anyone will
ever make use of that parameter. In fact, all drivers currently pass
redundant flags or 0.

This patch removes the 'gfp' parameter. The only reason to keep it is to
remove flags like __GFP_WAIT. But in its current form, it can only be used
to add flags. So to remove __GFP_WAIT, you'd have to drop it from the
mapping_gfp_mask, which again is stupid as this mask is used by shmem-core
for other allocations, too.

If any driver ever requires that parameter, we can introduce a new helper
that takes the raw 'gfp' parameter. The caller'd be responsible to combine
it with mapping_gfp_mask() in a suitable way. The current
drm_gem_get_pages() helper would then simply use mapping_gfp_mask() and
call the new helper. This is what shmem_read_mapping_pages{_gfp,} does
right now.

Moreover, the gfp-zone flag-usage is not obvious: If you pass a modified
zone, shmem core will WARN() or even BUG(). In other words, the following
must be true for 'gfp' passed to shmem_read_mapping_pages_gfp():
    gfp_zone(mapping_gfp_mask(mapping)) == gfp_zone(gfp)
Add a comment to drm_gem_read_pages() explaining that constraint.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2014-07-08 00:29:53 +02:00
Russell King
8444828854 drm: msm: update to use component match support
Update MSM's DRM driver to use the component match support rather than
add_components.

Reviewed-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-07-04 18:05:57 +01:00
Stephane Viau
87e956e9be drm/msm: fix IOMMU cleanup for -EPROBE_DEFER
If probe fails after IOMMU is attached, we need to detach in order to
clean up properly.  Before this change, IOMMU faults would occur if the
probe failed (-EPROBE_DEFER).

Signed-off-by: Stephane Viau <sviau@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2014-06-22 08:32:10 -04:00
Fabian Frederick
cf3198c205 drm/msm: use PAGE_ALIGNED instead of IS_ALIGNED(PAGE_SIZE)
use mm.h definition

Cc: David Airlie <airlied@linux.ie>
Cc: Rob Clark <robdclark@gmail.com>
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2014-06-22 08:32:10 -04:00
Stephane Viau
b77f47e789 drm/msm/hdmi: set hdp clock rate before prepare_enable
The clock driver usually complains when a clock is being prepared
before setting its rate. It is the case here for "core_clk" which
needs to be set at 19.2 MHz before we attempt a prepare_enable().

Signed-off-by: Stephane Viau <sviau@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2014-06-22 08:32:09 -04:00
Peter Griffin
370a4d8a79 drm/msm: storage class should be before const qualifier
The C99 specification states in section 6.11.5:

The placement of a storage-class specifier other than at the beginning
of the declaration specifiers in a declaration is an obsolescent
feature.

Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
Cc: David Airlie <airlied@linux.ie>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Rob Clark <robdclark@gmail.com>
2014-06-22 08:32:09 -04:00
Matwey V. Kornilov
2557e2d79d drm/msm: Replace type of paddr to uint32_t.
This patch helps to avoid the following build issue:

drivers/gpu/drm/msm/msm_fbdev.c:108:2: error: passing argument 3 of 'msm_gem_get_iova_locked' from incompatible pointer type [-Werror]
   msm_gem_get_iova_locked(fbdev->bo, 0, &paddr);
   ^
In file included from drivers/gpu/drm/msm/msm_fbdev.c:18:0:
drivers/gpu/drm/msm/msm_drv.h:153:5: note: expected 'uint32_t *' but argument is of type 'dma_addr_t *'
  int msm_gem_get_iova_locked(struct drm_gem_object *obj, int id,
      ^

Signed-off-by: Matwey V. Kornilov <matwey@sai.msu.ru>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2014-06-22 08:32:09 -04:00
Thomas Wood
34ea3d3863 drm: add register and unregister functions for connectors
Introduce generic functions to register and unregister connectors. This
provides a common place to add and remove associated user space
interfaces.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-06-19 08:55:28 +02:00
Rob Clark
5ea1f752ae drm: add drm_fb_helper_restore_fbdev_mode_unlocked()
All drm_fb_helper_restore_fbdev_mode() call sites, save one, do the same
locking.  Simplify this into drm_fb_helper_restore_fbdev_mode_unlocked().

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-06-05 10:02:40 +10:00
Rob Clark
543d3011f1 drm/msm: use correct gfp flag for vram allocation
We want at least __GFP_WAIT, otherwise dma-mapping tries to use coherent
pool rather than CMA pool.

Signed-off-by: Rob Clark <robdclark@gmail.com>
2014-06-02 07:36:31 -04:00
Rob Clark
a0906a023b drm/msm/mdp5: fix error return value
Signed-off-by: Rob Clark <robdclark@gmail.com>
2014-06-02 07:36:30 -04:00
Rob Clark
814cb96fdc drm/msm: remove redundant private plane cleanup
Now that drm core knows about private planes, it cleans them up for us.
Trying to do this twice results in badness.

Signed-off-by: Rob Clark <robdclark@gmail.com>
2014-06-02 07:36:29 -04:00
Rob Clark
70c70f091b drm/msm: add perf logging debugfs
Signed-off-by: Rob Clark <robdclark@gmail.com>
2014-06-02 07:36:21 -04:00
Rob Clark
a7d3c9509b drm/msm: add rd logging debugfs
To ease debugging, add debugfs file which can be cat/tail'd to log
submits, along with fence #.  If GPU hangs, you can look at 'gpu'
debugfs file to find last completed fence and current register state,
and compare with logged rd file to narrow down the DRAW_INDX which
triggered the GPU hang.

Signed-off-by: Rob Clark <robdclark@gmail.com>
2014-06-02 07:36:11 -04:00
Rob Clark
fb27b8f29f drm/msm: update for ARCH_MSM -> ARCH_QCOM
Architecture rename/split..  ARCH_QCOM is for the non-legacy platforms
(ie. device-tree, multiplatform support, etc).

Signed-off-by: Rob Clark <robdclark@gmail.com>
2014-05-30 15:37:54 -04:00
Rob Clark
3189650d7f drm/msm/hdmi: use gpio and HPD polling
The hotplug detect and irq does not seem to be reliable on all devices
for some reason.  For now it is more reliable to use polling, and give
preference to raw gpio status if it disagrees with the debounced hpd
status.

Signed-off-by: Rob Clark <robdclark@gmail.com>
2014-05-30 15:32:42 -04:00
Rob Clark
8a57e95057 drm/msm/mdp5: fix crash in error/unload paths
Signed-off-by: Rob Clark <robdclark@gmail.com>
2014-05-30 15:29:42 -04:00
Dave Airlie
444c9a08bf Merge branch 'drm-init-cleanup' of git://people.freedesktop.org/~danvet/drm into drm-next
Next pull request, this time more of the drm de-midlayering work. The big
thing is that his patch series here removes everything from drm_bus except
the set_busid callback. Thierry has a few more patches on top of this to
make that one optional to.

With that we can ditch all the non-pci drm_bus implementations, which
Thierry has already done for the fake tegra host1x drm_bus.

Reviewed by Thierry, Laurent and David and now also survived some testing
on my intel boxes to make sure the irq fumble is fixed correctly ;-) The
last minute rebase was just to add the r-b tags from Thierry for the 2
patches I've redone.

* 'drm-init-cleanup' of git://people.freedesktop.org/~danvet/drm:
  drm/<drivers>: don't set driver->dev_priv_size to 0
  drm: Remove dev->kdriver
  drm: remove drm_bus->get_name
  drm: rip out dev->devname
  drm: inline drm_pci_set_unique
  drm: remove bus->get_irq implementations
  drm: pass the irq explicitly to drm_irq_install
  drm/irq: Look up the pci irq directly in the drm_control ioctl
  drm/irq: track the irq installed in drm_irq_install in dev->irq
  drm: rename dev->count_lock to dev->buf_lock
  drm: Rip out totally bogus vga_switcheroo->can_switch locking
  drm: kill drm_bus->bus_type
  drm: remove drm_dev_to_irq from drivers
  drm/irq: remove cargo-culted locking from irq_install/uninstall
  drm/irq: drm_control is a legacy ioctl, so pci devices only
  drm/pci: fold in irq_by_busid support
  drm/irq: simplify irq checks in drm_wait_vblank
2014-05-01 09:32:21 +10:00
Rob Clark
7d8d9f6705 drm/msm/mdp4: cure for the cursor blues (v2)
The hw cursor is relatively adept at triggering underflows, which
manifest as a "blue flash" (since blue is configured as the underflow
color).  Juggle a few things around to tighten up the timing for setting
cursor registers in DONE irq.

And most importantly, don't ever disable the hw cursor.  Instead flip it
to a blank/empty cursor.  This seems far more reliable, as even simply
clearing the cursor-enable bit (with no other updates in previous/
following frames) can in some cases cause underflow.

v1: original
v2: add missing locking spotted by Micah

Cc: Micah Richert <richert@braincorporation.com>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2014-04-25 08:58:23 -04:00
Rob Clark
96673ecbd7 drm/msm: default to XR24 rather than AR24
Since X11 is going to create an XR24 fb, if the pixel formats do not
match then crtc helpers will think it is a full modeset even if mode is
the same, which prevents smooth/flickerless handover from fbcon/plymouth
to X11.

Signed-off-by: Rob Clark <robdclark@gmail.com>
2014-04-25 08:58:23 -04:00
Micah Richert
1ffa2425bf drm/msm: fix memory leak
Signed-off-by: Micah Richert <richert@braincorporation.com>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2014-04-25 08:58:23 -04:00
Daniel Vetter
bb0f1b5c16 drm: pass the irq explicitly to drm_irq_install
Unfortunately this requires a drm-wide change, and I didn't see a sane
way around that. Luckily it's fairly simple, we just need to inline
the respective get_irq implementation from either drm_pci.c or
drm_platform.c.

With that we can now also remove drm_dev_to_irq from drm_irq.c.

Reviewed-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-04-23 10:32:50 +02:00
Linus Torvalds
e9f37d3a8d Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux
Pull drm updates from Dave Airlie:
 "Highlights:

   - drm:

     Generic display port aux features, primary plane support, drm
     master management fixes, logging cleanups, enforced locking checks
     (instead of docs), documentation improvements, minor number
     handling cleanup, pseudofs for shared inodes.

   - ttm:

     add ability to allocate from both ends

   - i915:

     broadwell features, power domain and runtime pm, per-process
     address space infrastructure (not enabled)

   - msm:

     power management, hdmi audio support

   - nouveau:

     ongoing GPU fault recovery, initial maxwell support, random fixes

   - exynos:

     refactored driver to clean up a lot of abstraction, DP support
     moved into drm, LVDS bridge support added, parallel panel support

   - gma500:

     SGX MMU support, SGX irq handling, asle irq work fixes

   - radeon:

     video engine bringup, ring handling fixes, use dp aux helpers

   - vmwgfx:

     add rendernode support"

* 'drm-next' of git://people.freedesktop.org/~airlied/linux: (849 commits)
  DRM: armada: fix corruption while loading cursors
  drm/dp_helper: don't return EPROTO for defers (v2)
  drm/bridge: export ptn3460_init function
  drm/exynos: remove MODULE_DEVICE_TABLE definitions
  ARM: dts: exynos4412-trats2: enable exynos/fimd node
  ARM: dts: exynos4210-trats: enable exynos/fimd node
  ARM: dts: exynos4412-trats2: add panel node
  ARM: dts: exynos4210-trats: add panel node
  ARM: dts: exynos4: add MIPI DSI Master node
  drm/panel: add S6E8AA0 driver
  ARM: dts: exynos4210-universal_c210: add proper panel node
  drm/panel: add ld9040 driver
  panel/ld9040: add DT bindings
  panel/s6e8aa0: add DT bindings
  drm/exynos: add DSIM driver
  exynos/dsim: add DT bindings
  drm/exynos: disallow fbdev initialization if no device is connected
  drm/mipi_dsi: create dsi devices only for nodes with reg property
  drm/mipi_dsi: add flags to DSI messages
  Skip intel_crt_init for Dell XPS 8700
  ...
2014-04-08 09:52:16 -07:00
Dave Airlie
2614dc6683 Merge branch 'msm-next' of git://people.freedesktop.org/~robclark/linux into drm-next
* 'msm-next' of git://people.freedesktop.org/~robclark/linux:
  drm/omap: Don't dereference list head when the connectors list is empty
  drm/msm/mdp: add timeout for irq wait
  drm/msm: validate flags, etc
  drm/msm: use componentised device support
  drm/msm: add chip-id param
  drm/msm: crank down gpu when inactive
  drm/msm: spin helper
  drm/msm: add hang_debug module param
  drm/msm: hdmi audio support
2014-04-04 08:03:21 +10:00
Matt Roper
f4510a2752 drm: Replace crtc fb with primary plane fb (v3)
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 <matthew.d.roper@intel.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
2014-04-01 20:18:28 -04:00
Matt Roper
2d82d188b2 drm/msm: Switch to universal plane API's
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 <robdclark@gmail.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2014-04-01 20:18:27 -04:00
Rob Clark
30b6f8f679 drm/msm/mdp: add timeout for irq wait
Make things recover a bit more gracefully if we get stuck with no vblank
irq ever coming.

Signed-off-by: Rob Clark <robdclark@gmail.com>
2014-03-31 10:27:46 -04:00
Rob Clark
93ddb0d3b0 drm/msm: validate flags, etc
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 <robdclark@gmail.com>
2014-03-31 10:27:46 -04:00
Rob Clark
060530f1ea drm/msm: use componentised device support
Signed-off-by: Rob Clark <robdclark@gmail.com>
2014-03-31 10:27:46 -04:00
Rob Clark
4e1cbaa3eb drm/msm: add chip-id param
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 <robdclark@gmail.com>
2014-03-31 10:27:46 -04:00
Rob Clark
37d77c3ab5 drm/msm: crank down gpu when inactive
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 <robdclark@gmail.com>
2014-03-31 10:27:46 -04:00
Rob Clark
0963756fe5 drm/msm: spin helper
Helper macro to simplify places where we need to poll with timeout
waiting for gpu.

Signed-off-by: Rob Clark <robdclark@gmail.com>
2014-03-31 10:27:45 -04:00
Rob Clark
5b6ef08e4b drm/msm: add hang_debug module param
msm.hang_debug=y will dump out current register values if the gpu locks
up, for easier debugging.

Signed-off-by: Rob Clark <robdclark@gmail.com>
2014-03-31 10:27:45 -04:00
Rob Clark
c0c0d9eeeb drm/msm: hdmi audio support
Signed-off-by: Rob Clark <robdclark@gmail.com>
2014-03-31 10:27:45 -04:00
Arnd Bergmann
23453853e4 Merge tag 'qcom-drivers-for-3.15' of 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-25 18:10:57 +01:00
Kumar Gala
016bcb3b81 drm/msm: drop ARCH_MSM Kconfig depend
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 <robdclark@gmail.com>
Signed-off-by: Kumar Gala <galak@codeaurora.org>
2014-02-11 14:40:59 -06:00
Dave Airlie
7431105b14 Merge branch 'msm-next' of git://people.freedesktop.org/~robclark/linux into 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-11 12:56:17 +10:00
Rob Clark
c2703b13a6 drm/msm: bigger synchronization hammer
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 <robdclark@gmail.com>
2014-02-07 10:26:25 -05:00
Rob Clark
9999f105e7 drm/msm: fix deadlock in bo create fail path
We already hold struct_mutex here.

Signed-off-by: Rob Clark <robdclark@gmail.com>
2014-02-05 11:24:42 -05:00
Rob Clark
aa1b0e59d3 drm/msm/mdp4: cursor fixes
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 <robdclark@gmail.com>
2014-02-05 11:23:29 -05:00
Rob Clark
b69720c0f5 drm/msm/mdp4: pageflip fixes
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 <robdclark@gmail.com>
2014-02-05 11:23:07 -05:00