Commit graph

224 commits

Author SHA1 Message Date
Fabio Estevam b44ab1b0df imx-hdmi: Make checkpatch happy
WARNING: Missing a blank line after declarations
#160: FILE: drivers/staging/imx-drm/imx-hdmi.c:160:
+	u8 val = hdmi_readb(hdmi, reg) & ~mask;
+	val |= data & mask;

WARNING: Missing a blank line after declarations
#1609: FILE: drivers/staging/imx-drm/imx-hdmi.c:1609:
+		const struct platform_device_id *device_id = of_id->data;
+		hdmi->dev_type = device_id->driver_data;

total: 0 errors, 2 warnings, 1767 lines checked

drivers/staging/imx-drm/imx-hdmi.c has style problems, please review.

If any of these errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-23 20:44:43 +09:00
Greg Kroah-Hartman 69c1f05379 Merge 3.15-rc6 into staging-next.
This resolves the conflicts in the files:
	drivers/iio/adc/Kconfig
	drivers/staging/rtl8723au/os_dep/usb_ops_linux.c

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-22 23:27:17 +09:00
Greg Kroah-Hartman c4784756a5 Merge branch 'imx-drm-fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm into staging-next
imx-drm fixes from Russell
2014-05-06 06:26:31 -07:00
Philipp Zabel 1e6d486be4 imx-drm: ipu-dc: disable DC module when not in use
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-04-26 11:24:20 +01:00
Philipp Zabel c115edb87f imx-drm: ipuv3-crtc: change display enable/disable order
Now that ipu_dc_disable_channel correctly waits for the channel to finish,
we can reorder the enable/disable order to first stop the DC and DI and
only then disable the IDMAC. Enabling is done the other way around: IDMAC
first, then DC, then DI.

This avoids an issue where sometimes the channel would not correctly start,
leading to non-working LVDS displays.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-04-26 11:24:19 +01:00
Philipp Zabel 216ddd608f imx-drm: imx-dp: when disabling the DP foreground channel, wait until the DP background channel is finished before disabling the IDMAC channel
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-04-26 11:24:18 +01:00
Philipp Zabel 285bbb018f imx-drm: ipu-dp: split disabling the DP foreground channel from disabling the DP module
The former has to be done before disabling the DMFC, the latter has to be
done afterwards. Otherwise the DMFC FIFOs never get cleared properly.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-04-26 11:24:17 +01:00
Philipp Zabel 1dee9a9e53 imx-drm: ipu-dc: wait for DC_FC_1 / DP_SF_END interrupt
Wait for the DC Frame Complete or DP Sync Flow End interrupts
before disabling DC channels.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-04-26 11:24:16 +01:00
Philipp Zabel 47348661c4 imx-drm: ipu-dmfc: wait for FIFOs to run empty before disabling
Disabling the DMFC module while there is still data in the FIFOs could
cause the "new frame before end of frame" error state when the DMFC is
enabled again.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-04-26 11:24:15 +01:00
Philipp Zabel 1707550468 imx-drm: ipu-common: add helpers to check for a busy IDMAC channel and to busywait for an interrupt
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-04-26 11:24:14 +01:00
Philipp Zabel 861a50c172 imx-drm: ipu-common: add ipu_map_irq to request non-IDMAC interrupts
This allows to request the DC related interrupts.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-04-26 11:24:13 +01:00
Denis Carikli 85de9d17c4 imx-drm: match ipu_di_signal_cfg's clk_pol with its description.
According to the datasheet, setting the di0_polarity_disp_clk
field in the GENERAL di register sets the output clock polarity
to active high.

Signed-off-by: Denis Carikli <denis@eukrea.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-04-26 11:23:55 +01:00
Shawn Guo a3fe964135 imx-drm: imx-tve: correct DDC property name to 'ddc-i2c-bus'
Commit 62e3879 (imx-drm: imx-tve: Fix DDC I2C bus property) was trying
to use 'ddc-i2c-bus' as the DDC property name (we can see that from the
commit log), but unfortunately 'i2c-ddc-bus' which is a typo was
actually used in the code.  This results in some unnecessary
inconsistency and confusions, because all the documented DDC property
in device tree bindings use 'ddc-i2c-bus'.

  Documentation/devicetree/bindings/staging/imx-drm/hdmi.txt
  Documentation/devicetree/bindings/panel/simple-panel.txt
  Documentation/devicetree/bindings/video/dvi-connector.txt

Let's fix it before the error spreads.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-04-26 11:23:38 +01:00
Antoine Schweitzer-Chaput 838201aa0f Staging: imx-drm: Fix some lines over 80 characters
Signed-off-by: Antoine Schweitzer-Chaput <antoine@schweitzer-chaput.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-25 16:14:56 -07:00
Russell King 98dbeadaf0 imx-drm: fix hdmi hotplug detection initial state
The initial state at boot is assumed to be disconnected, and we hope
to receive an interrupt to update the status.  Let's be more explicit
about the current state - reading the PHY status register tells us
the current level of the hotplug signal, which we can report back in
the _detect() method.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-25 16:13:56 -07:00
Philipp Zabel 60d857bffc imx-drm: imx-drm-core: Fix imx_drm_encoder_get_mux_id
The decoder mux id is equal to the port id of the encoder's input port
that is connected to the given crtc, not to the endpoint id (which is
arbitrary and usually zero).

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Tested-by: Shawn Guo <shawn.guo@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-25 16:13:56 -07:00
Fabio Estevam 539e26cbbd imx-hdmi: Propagate the real error code on platform_get_irq() failure
No need to return a 'fake' return value on platform_get_irq() failure.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-25 16:11:03 -07:00
Emil Renner Berthing 0e6bcf3a15 staging: imx-drm: imx-hdmi: clean up hdmi_phy_wait_i2c_done
Simplify hdmi_phy_wait_i2c_done so the call to hdmi_readb is
only done in one place. Also check for timout before waiting
as suggested by Troy Kisky.
This also fixes a checkpatch warning.

Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-25 16:11:03 -07:00
Emil Renner Berthing 9e74d2926a staging: imx-drm: add LVDS666 support for parallel display
Support the LVDS666 format on the IPUv3 parallel display.
This makes the screen work on my Hercules eCAFE Slim HD.

Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-25 16:11:03 -07:00
Shawn Guo 1c2366298b imx-drm: imx-drm-core: skip components whose parent device is disabled
In a board setup which disables LDB device node completely by changing
status to 'disabled', and only enables HDMI device, we're running into
the problem that imx-drm master never succeeds in binding, and hence
HDMI does not come up either.

&ldb {
	status = "disabled";

	lvds-channel@1 {
		...
		status = "okay";
	};
};

The imx-drm-core should really skip the LVDS channels no matter what
lvds-channel's status is, if LDB device is disabled.  Let's consider
such setup a misconfiguration, give a warning in there and not add the
component.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-04-19 09:50:57 +01:00
Philipp Zabel c509bdc20d imx-drm: imx-drm-core: fix imx_drm_encoder_get_mux_id
The decoder mux id is equal to the port id of the encoder's input port
that is connected to the given crtc, not to the endpoint id (which is
arbitrary and usually zero).

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Tested-by: Shawn Guo <shawn.guo@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-04-19 09:36:03 +01: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
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
Lespiau, Damien 38821e6490 staging: imx-drm: Replace DRM_LOG_KMS() by DRM_DEBUG_KMS()
There are only a few users of the DRM_LOG_KMS() macro. We can simplify
the DRM code a bit by replacing them by DRM_DEBUG_KMS().

Cc: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-03-28 12:57:13 +10:00
Gulsah Kose 256a38b048 staging:imx-drm: Fix line over 80 characters.
Fix checkpatch.pl issues with line over 80 characters in imx-hdmi.c

Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-18 11:36:58 -07:00
Aybuke Ozdemir e5e1b1663f staging: imx-drm: imx-ldb.c Fix line over 80 characters.
Fix checkpatch.pl issues with line over 80 characters in imx-ldb.c

Signed-off-by: Aybuke Ozdemir <aybuke.147@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-18 11:36:58 -07:00
Daniel Vetter fc1645ac82 drm/imx: remove drm_mode_connector_detach_encoder harder
Since the last time I've looked more of this stuff sprouted up. Stomp
it down again.

Repeating the original justification for ripping this all out: There's
absolutely no need to deteach connectors before cleaning them up at
driver unload time. And since drm doesn't support hotplugging kms
objects at all it's positively dangerous to attempt this at runtime.
Luckily imx only detachs at driver cleanup time and hence we can
savely remove this.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-15 12:11:54 +01:00
Daniel Vetter 69fa5293bf drm/kms: rip out drm_mode_connector_detach_encoder
It's only used by imx, and that one gets it wrong - there's no need
to deteach the encoder before removing it.

And really, neither current drm modesetting code nor all the userspace
we have can handle dynamic changes in the set of possible encoders for
a given connector. So let's just remove this before someone starts
doing something really nasty with it.

As a plus, one less kerneldoc comment to write.

Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-13 12:48:38 +01:00
Greg Kroah-Hartman bfe24b9cbe Merge branch 'imx-drm-staging' of git://ftp.arm.linux.org.uk/~rmk/linux-arm into staging-next
Russell writes:

This set of changes reorganises imx-drm's DT bindings by re-using the OF
graph parsing code which was located in drivers/media, removing the
temporary bindings.

The result is that more TODO entries are now removed.  While we're not
quite done with this yet as there's a few straggling updates to imx-ldb
to come, but leaving these out is not detrimental at this point in time
- they are more an enhancement.

However, this pull has the additional complication that we're sharing
seven commits with Mauro's V4L git tree, which move the OF graph parsing
code out of drivers/media into drivers/of.  Philipp's imx-drm changes
depend on these and my previously committed round of imx-drm commits.
Hence, the diffstat below is from a test merge with your tree head
(17b02809cf).

Mauro merged those seven commits earlier today as a git pull, so both
trees will be sharing exactly the same commit IDs.

I've given these changes a spin here on both my Hummingboard and Cubox-i4
(one is iMX6Solo, the other is iMX6Quad based), which includes Xorg using
the DRM device directly, and I find nothing wrong.

The diffstat does look a little scarey - this is because we're having to
update the ARM DT files along with this change, and obviously the
dependency on the OF graph parsing code.
2014-03-07 14:23:34 -08:00
Philipp Zabel 6a63171133 staging: imx-drm: Update TODO
The device tree bindings are updated regardless of the common display
framework and in the meantime the HDMI driver was included.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-03-07 16:18:01 +00:00
Philipp Zabel 62e3879a2c imx-drm: imx-tve: Fix DDC I2C bus property
This patch fixes the TV Encoder DDC I2C bus property to use the common
'ddc-i2c-bus' property name instead of 'ddc'.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-03-07 16:17:54 +00:00
Philipp Zabel b5d4590136 imx-drm: imx-hdmi: Fix DDC I2C bus property
This patch fixes the DDC I2C bus property to use the common 'ddc-i2c-bus'
property name instead of 'ddc'. This is already documented in
Documentation/devicetree/bindings/staging/imx-drm/hdmi.txt

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-03-07 16:17:53 +00:00
Philipp Zabel b6babdd93c staging: imx-drm-core: use of_graph_parse_endpoint
Using of_graph_parse_endpoint recovers the port id from an endpoint device
tree node. This just replaces an open coded read of the "reg" property.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-03-07 16:17:49 +00:00
Philipp Zabel 655b43ccb7 staging: imx-drm-core: Use OF graph to find components and connections between encoder and crtcs
This patch adds support to find the involved components connected to
the IPU display interface ports using the OF graph bindings documented
in Documentation/devicetree/bindings/media/video-interfaces.txt.
It makes use of the of_graph (formerly v4l2_of) parsing helpers and
thus depends on the patch that moves those out to drivers/of.

Each display interface needs to have an associated port node in the
device tree. We can associate this node with the crtc platform device
and use it to find the crtc corresponding to a given port node instead
of using a combination of parent device node and id number, as before.

Explicitly converting the void* cookie to the port device tree node
allows to get rid of the ipu_id and di_id fields. The multiplexer
setting on i.MX6 now can be obtained from the port id (reg property)
in the device tree.

The imx-drm node now needs a ports property that contains phandles
to each of the IPU display interface port nodes. From there, all
attached encoders are scanned and enabled encoders are added to a
waiting list.
The bind order makes sure that once all components are probed, crtcs
are bound before encoders, so that imx_drm_encoder_parse_of can be
called from the encoder bind callbacks.

For parsing the OF graph, temporary copies of the V4L2 OF graph
helpers are used, that can be removed again once those are available
at a generic place.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-03-07 16:17:48 +00:00
Fabio Estevam 98dd3b2a3a imx-drm: imx-ldb: Use snprintf()
Use snprintf() in order to fix the following static checker warning:

drivers/staging/imx-drm/imx-ldb.c:340 imx_ldb_get_clk() error: format string overflow. buf_size: 16 length: 18
probably 18 is theory and not real life, but 16 is based on
theory as well.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-28 14:56:34 -08:00
Fabio Estevam b6d8115e4e imx-drm: ipu-dmfc: Remove unneeded 'dmfc' check
Fix the following static checker warning:

drivers/staging/imx-drm/ipu-v3/ipu-dmfc.c:164 ipu_dmfc_setup_channel() warn: variable dereferenced before check 'dmfc' (see line 157)

As 'dmfc' could never be null, there is no need to do such check.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-28 14:56:33 -08:00
Fabio Estevam fdffa6f2b3 imx-drm: imx-drm-core: Staticize imx_drm_find_crtc()
Fix the following static checker warning:

drivers/staging/imx-drm/imx-drm-core.c:89:21: warning: symbol 'imx_drm_find_crtc' was not declared. Should it be static?

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-27 14:57:43 -08:00
Fabio Estevam 18589738ee imx-drm: ipuv3-plane: Use %pad to print 'dma_addr_t'
Fix the following static checker warning:

drivers/staging/imx-drm/ipuv3-plane.c:75:2: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'dma_addr_t' [-Wformat]

Use %pad to print 'dma_addr_t'.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-27 14:57:43 -08:00
Fabio Estevam 39dcf4f708 imx-drm: parallel-display: Check 'mode' pointer first
Fix the following static checker warnings:

drivers/staging/imx-drm/parallel-display.c:64 imx_pd_connector_get_modes() error: potential null dereference 'mode'.  (drm_mode_create returns null)
drivers/staging/imx-drm/parallel-display.c:73 imx_pd_connector_get_modes() error: potential null dereference 'mode'.  (drm_mode_create returns null)

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-27 14:57:43 -08:00
Fabio Estevam 9f9b036f0e imx-drm: imx-ldb: Check 'mode' pointer first
Fix the following static checker warning:

drivers/staging/imx-drm/imx-ldb.c:109 imx_ldb_connector_get_modes() error: potential null dereference 'mode'.  (drm_mode_create returns null)

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-27 14:57:43 -08:00
Philipp Zabel 628f435be4 imx-drm: parallel-display: Add drm_panel support
This patch allows to optionally attach the parallel-display to a panel
supported by a drm_panel driver instead of supplying the modes via
device tree.

Before:
	parallel-display {
		compatible = "fsl,imx-parallel-display";
		...

		display-timings {
			native-timing = <&timing1>;
			timing1: etm0700g0dh6 {
				hactive = <800>;
				vactive = <480>;
				clock-frequency = <33260000>;
				hsync-len = <128>;
				hback-porch = <88>;
				hfront-porch = <40>;
				vsync-len = <2>;
				vback-porch = <33>;
				vfront-porch = <10>;
				hsync-active = <0>;
				vsync-active = <0>;
				...
			};
		};
		...
	};

After:
	parallel-display {
		compatible = "fsl,imx-parallel-display";
		fsl,panel = <&panel>;
		...
	};

	panel: panel {
		compatible = "edt,etm0700g0dh6", "simple-panel";
	};

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-27 12:43:36 -08:00
Philipp Zabel 1f15b69b59 imx-drm: ipu-dc: Use usleep_range instead of msleep
Since msleep(2) can sleep up to 20ms anyway, make this explicit by using
usleep_range(2000, 20000).

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-27 12:41:10 -08:00
Philipp Zabel 7f4392aa87 imx-drm: Move IPU_PIX_FMT_GBR24 definition into imx-ipu-v3.h
The IPU display controller supports a non-standard green-red-blue ordered
format that is used on the connection between IPU display interface 1 and
the TV encoder on i.MX53.
In preparation for the move of IPU core code out of staging, place the
IPU_PIX_FMT_GBR24 definition in imx-ipu-v3.h, so that both the IPU
display interface driver and the TVE encoder driver can access it.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-27 12:41:10 -08:00
Greg Kroah-Hartman 58e7573138 Merge branch 'imx-drm-staging' of git://ftp.arm.linux.org.uk/~rmk/linux-arm into staging-next
Russell writes:

These changes, which convert imx-drm to use the recently merged
component infrastructure, have been reviewed and acked by Philipp Zabel,
Shawn Guo and Fabio Estevam, and are now deemed to be ready.
2014-02-24 12:39:56 -08:00
Russell King d94905e019 imx-drm: imx-hdmi: add hotplug support to HDMI component
Add hotplug support.  We have to make the interrupt handler threaded so
we can call drm_helper_hpd_irq_event().  Keeping in mind that we will
want to share the interrupt with other HDMI interface drivers (eg, audio
and CEC) put the groundwork in now for that, rather than just using
IRQF_ONESHOT.

Also, we must not call drm_helper_hpd_irq_event() until we have fully
setup the connector; keep the interrupt(s) muted until after that point.

Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Reviewed-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-02-24 12:08:02 +00:00
Russell King 3e68439bf0 imx-drm: imx-drm-core: add core hotplug connector support
Add core imx-drm support for hotplug connector support.  We need to
setup the poll helper after we've setup the connectors; the helper
scans the connectors to determine their capabilities.

Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Reviewed-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-02-24 12:08:00 +00:00
Russell King e7d6231e67 imx-drm: imx-drm-core: various cleanups
Various cleanups are possible after the previous round of changes; these
have no real functional bearing other than tidying up the code.

Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Reviewed-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-02-24 12:07:58 +00:00
Russell King b85f2b5d87 imx-drm: imx-drm-core: move allocation of imxdrm device to driver load function
It is now no longer necessary to keep this structure around; we can
allocate it upon DRM driver load and destroy it thereafter without
affecting the other components now.

Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Reviewed-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-02-24 12:07:56 +00:00
Russell King ccec7f621d imx-drm: imx-drm-core: kill off mutex
This mutex doesn't protect anything anymore; get rid of it.

Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Reviewed-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-02-24 12:07:54 +00:00
Russell King 06c6b82bf7 imx-drm: imx-drm-core: get rid of drm_mode_group_init_legacy_group()
Since we're now operating like a conventional DRM driver, doing all
the initialisation within the driver's ->load callback, we don't
need to mess around with the mode groups - we can rely on the one
in the DRM platform code.

Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Reviewed-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-02-24 12:07:52 +00:00