Commit graph

589454 commits

Author SHA1 Message Date
Dave Airlie b89359bdf0 Merge branch 'for-next' of http://git.agner.ch/git/linux-drm-fsl-dcu into drm-next
This adds very rudimentary TCON (timing controller for raw LCD displays)
support to enable the bypass mode in order to use the DCU controller on
Freescale/NXP Vybrid SoC's.

Additionally the register clock and pixel clock has been separated, but
are currently still enabled and disabled pairwise.

Other than that, fixes and cleanups accross the driver.

* 'for-next' of http://git.agner.ch/git/linux-drm-fsl-dcu:
  drm/fsl-dcu: increment version and date
  drm/fsl-dcu: implement lastclose callback
  drm/fsl-dcu: disable output polling on driver unload
  drm/fsl-dcu: deallocate fbdev CMA on unload
  drm/fsl-dcu: use variable name dev for struct drm_device
  drm/fsl-dcu: handle missing panel gracefully
  drm/fsl-dcu: detach panel on destroy
  drm/layerscape: reduce excessive stack usage
  drm/fsl-dcu: add TCON driver
  drm/fsl-dcu: use common clock framework for pixel clock divider
  drm/fsl-dcu: add extra clock for pixel clock
  drm/fsl-dcu: disable clock on initialization failure and remove
2016-04-29 14:57:51 +10:00
Dave Airlie d3a8f6784a Allwinner DRM driver for 4.7
This pull request introduces the sun4i driver, meant to be used on the
 older Allwinner SoCs (A10, A13, A20, A23, A31 and A33).
 
 It currently supports only the A13, which has one of the simplest video
 pipeline. Support for other video components and SoCs will be added
 eventually.
 
 It supports only a RGB or composite output. It doesn't do HDMI, VGA, LVDS
 or power management yet, but that will come in time as well.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJXIcwNAAoJEBx+YmzsjxAg9kUP+wdyn++9GoBXZMv6jZHq2cTZ
 lgyoJuBL+TnxQ1z6LQZVesf9XvCfVsmfN9SbyF20gdsnhdh/bc6yian6SfM3w7W1
 OnBNVVp5VDbrV6Sbl5h43ERB30NmY2Q09iG6rGh2+cuCoEDg/RSN5OCdV4SdaPuz
 SKBWrKEy+FexceigN1+82nknL3f+f684mg5sneyvWf2Y9bC3oyYT/PnJ45xoVykb
 tBVgdA+CCo0kVvjWYMzXs8qyZSch50U/dP/hp3AlkSgbATEHz0KTc8tb2lIQtWYz
 mphlY3mPkvD3xyr1Ve8Pu6ILSRv/fC1FXn8cn9y9ErABfx6auwMs6rEeUnImrMSl
 Y1EmCey0T69ov05Gft0+rnNkjHJYKbO4B92Hx85uHQpGenvV//oTC+Sq4vK57/7Y
 /42KLc6JGBKz5GIpR+cOSEzjwUMDFN2d+x4do5FzOEinh70XXMJRjZYdfjeuJcej
 KWzVed+2F5xt76daE7L+CAcR3CwIjRxy+JOU9zgnzZ3qn9b6Zmmrxc0jEYU6aWgW
 K8PXX5hhNZ59EWEA+1PWQGloDBT/8vt4LpDSzPGKuPmowwH198WFtTj9SikD9aQI
 Od/onNBJeSSgKYOwHSEaiU3IXA4Nh4aPa8IK+g5m7teYMSyfgEA63eQn+tQgE0w5
 gAubaOK4nh4dM2ZDm6mx
 =q39n
 -----END PGP SIGNATURE-----

Merge tag 'sun4i-drm-for-4.7' of https://git.kernel.org/pub/scm/linux/kernel/git/mripard/linux into drm-next

Allwinner DRM driver for 4.7

This pull request introduces the sun4i driver, meant to be used on the
older Allwinner SoCs (A10, A13, A20, A23, A31 and A33).

It currently supports only the A13, which has one of the simplest video
pipeline. Support for other video components and SoCs will be added
eventually.

It supports only a RGB or composite output. It doesn't do HDMI, VGA, LVDS
or power management yet, but that will come in time as well.

* tag 'sun4i-drm-for-4.7' of https://git.kernel.org/pub/scm/linux/kernel/git/mripard/linux:
  MAINTAINERS: Add a maintainer for the Allwinner DRM driver
  drm: sun4i: tv: Add NTSC output standard
  drm: sun4i: tv: Add PAL output standard
  drm: sun4i: Add composite output
  drm: sun4i: Add RGB output
  drm: Add Allwinner A10 Display Engine support
  drm: sun4i: Add DT bindings documentation
  drm: fb: Add seq_file definition
2016-04-29 14:52:41 +10:00
Maxime Ripard bf1139dfe7 MAINTAINERS: Add a maintainer for the Allwinner DRM driver
Add myself as the maintainer of the new Allwinner DRM driver.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2016-04-28 10:30:05 +02:00
Maxime Ripard 2ff77b1659 drm: sun4i: tv: Add NTSC output standard
Add the settings to support the NTSC standard.

Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2016-04-28 10:30:05 +02:00
Maxime Ripard 154f695007 drm: sun4i: tv: Add PAL output standard
Now that we have support for the composite output, we can start adding new
supported standards. Start with PAL, and we will add other eventually.

Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2016-04-28 10:30:05 +02:00
Maxime Ripard 03c4c71d25 drm: sun4i: Add composite output
Some Allwinner SoCs have an IP called the TV encoder that is used to output
composite and VGA signals. In such a case, we need to use the second TCON
channel.

Add support for that TV encoder.

Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2016-04-28 10:30:05 +02:00
Maxime Ripard 29e57fab97 drm: sun4i: Add RGB output
One of the A10 display pipeline possible output is an RGB interface to
drive LCD panels directly. This is done through the first channel of the
TCON that will output our video signals directly.

Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2016-04-28 10:30:05 +02:00
Maxime Ripard 9026e0d122 drm: Add Allwinner A10 Display Engine support
The Allwinner A10 and subsequent SoCs share the same display pipeline, with
variations in the number of controllers (1 or 2), or the presence or not of
some output (HDMI, TV, VGA) or not.

Add a driver with a limited set of features for now, and we will hopefully
support all of them eventually

Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2016-04-28 10:30:05 +02:00
Maxime Ripard 21a454fd36 drm: sun4i: Add DT bindings documentation
The display pipeline of the Allwinner A10 is involving several loosely
coupled components.

Add a documentation for the bindings.

Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2016-04-28 10:30:05 +02:00
Maxime Ripard 80588a86af drm: fb: Add seq_file definition
Otherwise, building with DEBUG_FS enabled will trigger a build warning
because we're using a structure that has not been declared.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2016-04-28 10:30:05 +02:00
Daniel Vetter 152ef5fa9e drm: Switch blobs to the new generic modeset obj refcounting
Need to move the free function around a bit, but otherwise mostly
just removing code.

Specifically we can nuke all the _locked variants since the weak idr
reference is now protected by the idr_mutex, which we never hold
anywhere expect in the lookup/reg/unreg functions. And those never
call anything else.

Another benefit of this is that this patch switches the weak reference
logic from kref_put_mutex to kref_get_unless_zero. And the later is in
general more flexible wrt accomodating multiple weak references
protected by different locks, which might or might not come handy
eventually.

But one consequence of that switch is that we need to acquire the
blob_lock from the free function for the list_del calls. That's a bit
tricky to pull off, but works well if we pick the exact same scheme as
is already used for framebuffers. Most important changes:

- filp list is maintainer by create/destroy_blob ioctls directly
  (already the case, so we can just remove the redundant list_del from
  the free function).

- filp close handler walks the filp-private list lockless - works
  because we know no one else can access it. I copied the same comment
  from the fb code over to explain this.

- Otherwise we need to sufficiently restrict blob_lock critical
  sections to avoid all the unreference calls. Easy to do once the
  blob_lock only protects the list, and no longer the weak reference.

Cc: Dave Airlie <airlied@gmail.com>
Cc: Daniel Stone <daniels@collabora.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-04-27 09:58:05 +10:00
Daniel Vetter b0b5511bdf drm/atomic-helpers: Don't duplicate code in destroy helpers
Random drive-by refactoring I spotted.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-04-27 09:56:30 +10:00
Daniel Vetter 1649c33ba3 drm: Fix fb leaks and WARN spew in get/set_prop ioctls
Dave Airlie had at least the refcount leak fixed in a later patch (but
that patch does other things which need a bit more work). But we still
have the trouble that silly userspace could hit the WARN_ON in
drm_mode_object_find.

Fix this all up to make sure we don't leak objects, and don't spew
into demsg.

Fixes: d0f37cf629 ("drm/mode: move framebuffer reference into object.")
Testcase: igt/kms_addfb_basic/invalid-*-prop*
Cc: Dave Airlie <airlied@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-04-27 09:53:54 +10:00
Daniel Vetter 05981422ea drm: Improve kerneldoc for new mode object refcounting
Slipped through the cracks in my review. The one issue I spotted
is that drm_mode_object_find now acquires references and can be
used on FB objects, which caused follow-on bugs in get/set_prop ioctls.
Follow-up patches will fix that.

[airlied: fixup some incr fb/decr object mixups]

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-04-27 09:52:59 +10:00
Dave Airlie 944a3f323b Merge branch 'topic-arcpgu-v6' of https://github.com/foss-for-synopsys-dwc-arc-processors/linux into drm-next
This is DRM driver for ARC PGU - simple bitstreamer used on
Synopsys ARC SDP boards (both AXS101 and AXS103).

* 'topic-arcpgu-v6' of https://github.com/foss-for-synopsys-dwc-arc-processors/linux:
  arc: axs10x - add support of ARC PGU
  MAINTAINERS: Add maintainer for ARC PGU display controller
  drm: Add DT bindings documentation for ARC PGU display controller
  drm: Add support of ARC PGU display controller
2016-04-27 09:38:42 +10:00
Emil Velikov 33f0fca6b4 drm/sis: add missing include drm.h for the UAPI header
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-04-27 09:36:48 +10:00
Emil Velikov f7a3e1dc8f drm/qxl: remove XXX comment from the UAPI header
One cannot rename the struct at this point, so might as well remove the
comment.

Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Dave Airlie <airlied@redhat.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-04-27 09:36:21 +10:00
Dave Airlie 69056e9a43 Merge branch 'drm/next/du' of git://linuxtv.org/pinchartl/fbdev into drm-next
misc rcar changes.

* 'drm/next/du' of git://linuxtv.org/pinchartl/fbdev:
  drm: rcar-du: Fix compilation warning
  drm: rcar-du: Use ARCH_RENESAS
  drm: rcar-du: Clarify vsp dependency
2016-04-27 09:19:50 +10:00
Alexey Brodkin b8c1eca1e0 arc: axs10x - add support of ARC PGU
Synopsys DesignWare ARC SDP boards sport ARC SDP display
controller attached to ADV7511 HDMI encoder.

That change adds desctiption of both ARC PGU and ADV7511 in
ARC SDP'd base-board Device Tree.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Pawel Moll <pawel.moll@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>
Cc: Kumar Gala <galak@codeaurora.org>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: devicetree@vger.kernel.org
Cc: linux-snps-arc@lists.infradead.org
2016-04-26 18:26:54 +03:00
Alexey Brodkin 71d298ceff MAINTAINERS: Add maintainer for ARC PGU display controller
This updates MAINTEINERS file with information about maintainer of
ARC PGU display controller driver.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: linux-snps-arc@lists.infradead.org
2016-04-26 18:26:54 +03:00
Alexey Brodkin a1f8ebe5cf drm: Add DT bindings documentation for ARC PGU display controller
This add DT bindings documentation for ARC PGU display controller.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Pawel Moll <pawel.moll@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>
Cc: Kumar Gala <galak@codeaurora.org>
Cc: devicetree@vger.kernel.org
Cc: linux-snps-arc@lists.infradead.org
Acked-by: Rob Herring <robh@kernel.org>
2016-04-26 18:26:45 +03:00
Carlos Palminha 51dacf2089 drm: Add support of ARC PGU display controller
ARC PGU could be found on some development boards from Synopsys.
This is a simple byte streamer that reads data from a framebuffer
and sends data to the single encoder.

Signed-off-by: Carlos Palminha <palminha@synopsys.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: David Airlie <airlied@linux.ie>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-snps-arc@lists.infradead.org
2016-04-26 17:58:02 +03:00
Stefan Agner 0449eefe2d drm/fsl-dcu: increment version and date
The driver supports now a second platform and received several
fixes, hence a version increment is justified.

Signed-off-by: Stefan Agner <stefan@agner.ch>
2016-04-25 23:27:08 -07:00
Stefan Agner 9a15da1735 drm/fsl-dcu: implement lastclose callback
Use CMA helper drm_fbdev_cma_restore_mode to restore fbdev mode
in process which uses drm/kms dies.

Signed-off-by: Stefan Agner <stefan@agner.ch>
2016-04-25 20:45:34 -07:00
Stefan Agner 7d17a6264c drm/fsl-dcu: disable output polling on driver unload
Disabling output polling before unloading the driver.

Signed-off-by: Stefan Agner <stefan@agner.ch>
2016-04-25 20:45:34 -07:00
Stefan Agner afb49e4d38 drm/fsl-dcu: deallocate fbdev CMA on unload
Free fbdev CMA using drm_fbdev_cma_fini on unload. This fixes
a warning when unloading the driver:
WARNING: CPU: 0 PID: 164 at drivers/gpu/drm/drm_crtc.c:5930 drm_mode_config_cleanup+0x204/0x208

Signed-off-by: Stefan Agner <stefan@agner.ch>
2016-04-25 20:45:33 -07:00
Stefan Agner b617966c08 drm/fsl-dcu: use variable name dev for struct drm_device
The driver uses different variable names for struct drm_device
across functions which is confusing. Stick to the more common
variable name dev. While at it, remove unnecessary if statement
in error handling.

Signed-off-by: Stefan Agner <stefan@agner.ch>
2016-04-25 20:45:33 -07:00
Stefan Agner b7d11305b8 drm/fsl-dcu: handle missing panel gracefully
If the device tree property fsl,panel is missing, drm_panel_attach
is called with a NULL pointer as first argument. Having a panel is
basically mandatory since RGB is the only supported connector.
Check if a panel node has been found, return -ENODEV and cleanup
otherwise.

Signed-off-by: Stefan Agner <stefan@agner.ch>
2016-04-25 20:45:32 -07:00
Stefan Agner a109f66f4b drm/fsl-dcu: detach panel on destroy
Disable the earlier attached panel on connector destroy.

Signed-off-by: Stefan Agner <stefan@agner.ch>
2016-04-25 20:45:32 -07:00
Arnd Bergmann a5dab99139 drm/layerscape: reduce excessive stack usage
The fsl-dcu driver copies a drm_mode_config object to its
stack but then only accesses a single member (dpms_property)
once. The data structure is large enough to trigger a warning
about the amount of kernel stack being used:

drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c: In function 'fsl_dcu_drm_connector_create':
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c:182:1: error: the frame size of 1040 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]

This changes the fsl_dcu_drm_connector_create() function to
only access the drm_mode_config by reference, which is also
more efficient.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 109eee2f2a ("drm/layerscape: Add Freescale DCU DRM driver")
Signed-off-by: Stefan Agner <stefan@agner.ch>
2016-04-25 20:27:18 -07:00
Stefan Agner fb127b7943 drm/fsl-dcu: add TCON driver
Add driver for the TCON (timing controller) module. The TCON module
is a separate module attached after the DCU (display controller
unit). Each DCU instance has its own, directly connected TCON
instance. The DCU's RGB and timing signals are passing through
the TCON module. TCON can provide timing signals for raw TFT panels
or operate in a bypass mode which leaves all signals unaltered.

The driver currently only supports the bypass mode.

Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Stefan Agner <stefan@agner.ch>
2016-04-25 20:27:18 -07:00
Stefan Agner 2d701449bc drm/fsl-dcu: use common clock framework for pixel clock divider
Use the common clock framework to calculate the pixel clock
dividier. The previous implementation rounded down the calculated
factor. Thanks to the CLK_DIVIDER_ROUND_CLOSEST flag using the
common clock framework divider implementation improves the pixel
clock accuracy in some cases. Ontop of that it also allows to see
the actual pixel clock in the sysfs clock summary.

Signed-off-by: Stefan Agner <stefan@agner.ch>
2016-04-25 20:27:18 -07:00
Stefan Agner f93500f430 drm/fsl-dcu: add extra clock for pixel clock
The Vybrid DCU variant has two independent clock inputs, one
for the registers (IPG bus clock) and one for the pixel clock.
Support this distinction in the DCU DRM driver while staying
backward compatible for old device trees.

Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Stefan Agner <stefan@agner.ch>
2016-04-25 20:27:18 -07:00
Stefan Agner 73fa30337a drm/fsl-dcu: disable clock on initialization failure and remove
Fix error handling during probe by reordering initialization and
adding a error path which disables clock again. Also disable the
clock on remove.

Signed-off-by: Stefan Agner <stefan@agner.ch>
2016-04-25 20:27:18 -07:00
Laurent Pinchart 077d67374e drm: rcar-du: Fix compilation warning
Commit d63c25e424 ("drm: rcar-du: Use generic
drm_connector_register_all() helper") left an unused local variable
behind. Remove it.

Fixes: d63c25e424 ("drm: rcar-du: Use generic drm_connector_register_all() helper")
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2016-04-24 02:53:35 +03:00
Simon Horman a033e6b61d drm: rcar-du: Use ARCH_RENESAS
Make use of ARCH_RENESAS in place of ARCH_SHMOBILE.

This is part of an ongoing process to migrate from ARCH_SHMOBILE to
ARCH_RENESAS the motivation for which being that RENESAS seems to be a more
appropriate name than SHMOBILE for the majority of Renesas ARM based SoCs.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2016-04-24 02:53:35 +03:00
Arnd Bergmann 4f5504cfc6 drm: rcar-du: Clarify vsp dependency
The VSP1 compositor code in DRM links against the respective V4L
driver, but the dependency is not expressed correctly in Kconfig,
which leads to a build error when the DRM driver is built-in
and the V4L driver is a module:

drivers/gpu/built-in.o: In function `rcar_du_vsp_plane_atomic_update':
rcar-du/rcar_du_vsp.c:183: undefined reference to `vsp1_du_atomic_update'

This patch avoids the problem by ensuring that the DRM VSP code can
only be enabled if the V4L driver is linked into the kernel, or
both are loadable modules.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 6d62ef3ac3 ("drm: rcar-du: Expose the VSP1 compositor through KMS planes")
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2016-04-24 02:53:35 +03:00
Dave Airlie 027b3f8ba9 drm/modes: stop handling framebuffer special
Since ref counting is in the object now we can just call the
normal interfaces.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-04-22 10:47:16 +10:00
Dave Airlie 2ddea3fd94 drm/modes: reduce fb_lock to just protecting lists
This reduces the fb_lock to just protecting the num_fb/fb_list.

"Previously fb refcounting, and especially the weak reference
(kref_get_unless_zero) used in fb lookups have been protected by fb_lock.
But with the refactoring to share refcounting in the drm_mode_object base
class that switched to being protected by idr_mutex, which means fb_lock
critical sections can be reduced."

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-04-22 10:43:24 +10:00
Dave Airlie 72fe90b8e7 drm/modes: move reference taking into object lookup.
When we lookup an ref counted object we now take a proper reference
using kref_get_unless_zero.

Framebuffer lookup no longer needs do this itself.

Convert rmfb to using framebuffer lookup and deal with the fact
it now gets an extra reference that we have to cleanup. This should
mean we can avoid holding fb_lock across rmfb. (if I'm wrong let me
know).

We also now only hold the fbs_lock around the list manipulation.

"Previously fb refcounting, and especially the weak reference
(kref_get_unless_zero) used in fb lookups have been protected by fb_lock.
But with the refactoring to share refcounting in the drm_mode_object base
class that switched to being protected by idr_mutex, which means fb_lock
critical sections can be reduced."

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-04-22 10:42:54 +10:00
Dave Airlie c7e1c59a18 drm/mode: reduce lock hold in addfb2
No need to hold the lock while assigning the variable.

Daniel wrote:
"Not sure why exactly I put that under the lock, but the only thing that
can race here is rmfb while addfb2 is still doing it's thing, with a
correctly guess (easy to do since they're fully deterministic) fb_id."

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-04-22 10:42:25 +10:00
Dave Airlie 9cd47424fb drm/mode: reduce scope of fb_lock in framebuffer init
We don't need to hold the fb lock around the initialisation,
only around the list manipulaton.

So do the lock hold only around the register for now.

From Daniel:
Previously fb refcounting, and especially the weak reference
(kref_get_unless_zero) used in fb lookups have been protected by fb_lock.
But with the refactoring to share refcounting in the drm_mode_object base
class that switched to being protected by idr_mutex, which means fb_lock
critical sections can be reduced.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-04-22 10:38:24 +10:00
Dave Airlie cee26ac47d drm/mode: use _object_find to find framebuffers.
No point have this code dupliated at this point, use the
_object_find code instead now.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-04-22 10:36:41 +10:00
Dave Airlie d0f37cf629 drm/mode: move framebuffer reference into object.
This is the initial code to add references to some mode objects.
In the future we need to start reference counting connectors so
firstly I want to reorganise the code so the framebuffer ref counting
uses the same paths.

This patch shouldn't change any functionality, just moves the kref.

[airlied: move kerneldoc as well]
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-04-22 10:34:28 +10:00
Dave Airlie 747a598ffa drm/mode: introduce wrapper to read framebuffer refcount.
Avoids drivers knowing where the kref is stored.

[airlied: add kerneldoc]
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-04-22 10:33:53 +10:00
Dave Airlie 19ab3f8bb4 drm/modes: drop __drm_framebuffer_unregister.
Just use the generic function.

The main side effect of this is that the fb->base.id
is now protected by the idr mutex as well.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-04-22 10:28:06 +10:00
Dave Airlie f55f1f91f5 drm/mode: move framebuffer_free up above framebuffer_init
A later patch will use it in framebuffer_init, and I want
to keep the diff cleaner.

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-04-22 10:26:42 +10:00
Dave Airlie 7c8f6d2577 drm/mode: rework drm_mode_object_put to drm_mode_object_unregister.
This changes the code to handle being called multiple times without
side effects. The new names seems more suitable for what it does.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-04-22 10:26:37 +10:00
Dave Airlie 9a297b36f4 Merge branch 'drm-atmel-hlcdc-devel' of https://github.com/bbrezillon/linux-at91 into drm-next
This PR contains several improvement and cleanup patches for the
atmel-hlcdc driver to be applied on drm-next (targeting 4.7).

* 'drm-atmel-hlcdc-devel' of https://github.com/bbrezillon/linux-at91:
  drm: atmel-hlcdc: route DMA accesses through AHB interfaces
  drm: atmel-hlcdc: check display mode validity in crtc->mode_fixup()
  drm: atmel-hlcdc: rework the output code to support drm bridges
  drm: atmel-hlcdc: move output mode selection in CRTC implementation
  drm: atmel-hlcdc: support extended timing ranges on sama5d4 and sama5d2
  drm: atmel-hlcdc: remove leftovers from atomic mode setting migration
  drm: atmel-hlcdc: fix connector and encoder types
  drm: atmel-hlcdc: support asynchronous atomic commit operations
  drm: atmel-hlcdc: add a ->cleanup_fb() operation
2016-04-22 09:06:44 +10:00
Dave Airlie 605b28c859 Merge tag 'drm-intel-next-2016-04-11' of git://anongit.freedesktop.org/drm-intel into drm-next
- make modeset hw state checker atomic aware (Maarten)
- close races in gpu stuck detection/seqno reading (Chris)
- tons&tons of small improvements from Chris Wilson all over the gem code
- more dsi/bxt work from Ramalingam&Jani
- macro polish from Joonas
- guc fw loading fixes (Arun&Dave)
- vmap notifier (acked by Andrew) + i915 support by Chris Wilson
- create bottom half for execlist irq processing (Chris Wilson)
- vlv/chv pll cleanup (Ville)
- rework DP detection, especially sink detection (Shubhangi Shrivastava)
- make color manager support fully atomic (Maarten)
- avoid livelock on chv in execlist irq handler (Chris)

* tag 'drm-intel-next-2016-04-11' of git://anongit.freedesktop.org/drm-intel: (82 commits)
  drm/i915: Update DRIVER_DATE to 20160411
  drm/i915: Avoid allocating a vmap arena for a single page
  drm,i915: Introduce drm_malloc_gfp()
  drm/i915/shrinker: Restrict vmap purge to objects with vmaps
  drm/i915: Refactor duplicate object vmap functions
  drm/i915: Consolidate common error handling in intel_pin_and_map_ringbuffer_obj
  drm/i915/dmabuf: Tighten struct_mutex for unmap_dma_buf
  drm/i915: implement WaClearTdlStateAckDirtyBits
  drm/i915/bxt: Reversed polarity of PORT_PLL_REF_SEL bit
  drm/i915: Rename hw state checker to hw state verifier.
  drm/i915: Move modeset state verifier calls.
  drm/i915: Make modeset state verifier take crtc as argument.
  drm/i915: Replace manual barrier() with READ_ONCE() in HWS accessor
  drm/i915: Use simplest form for flushing the single cacheline in the HWS
  drm/i915: Harden detection of missed interrupts
  drm/i915: Separate out the seqno-barrier from engine->get_seqno
  drm/i915: Remove forcewake dance from seqno/irq barrier on legacy gen6+
  drm/i915: Fixup the free space logic in ring_prepare
  drm/i915: Simplify check for idleness in hangcheck
  drm/i915: Apply a mb between emitting the request and hangcheck
  ...
2016-04-22 09:03:31 +10:00