summaryrefslogtreecommitdiffstats
path: root/drivers/staging/imx-drm
Commit message (Collapse)AuthorAgeFilesLines
* imx-drm: imx-tve: remove unused variableVincent Stehlé2014-06-021-1/+0Star
| | | | | | | | | | | | | | | | Commit f9b0e251dfbf 'drm: make mode_valid callback optional' left variable ret unused; remove it. This fixes the following compilation warning: drivers/staging/imx-drm/imx-tve.c: In function ‘imx_tve_connector_mode_valid’: drivers/staging/imx-drm/imx-tve.c:252:6: warning: unused variable ‘ret’ [-Wunused-variable] Signed-off-by: Vincent Stehlé <vincent.stehle@laposte.net> Cc: Andrzej Hajda <a.hajda@samsung.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
* drm: make mode_valid callback optionalAndrzej Hajda2014-04-226-16/+0Star
| | | | | | | | | | | | Many drm connectors do not need mode validation. The patch makes this callback optional and removes dumb implementations. v2: Rebase: - imx move to a shared (but still dummy) ->mode_valid implementation. - probe helpers have been extracted to drm_probe_helper.c Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> (v1) Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
* Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linuxLinus Torvalds2014-04-082-4/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 ...
| * drm: Replace crtc fb with primary plane fb (v3)Matt Roper2014-04-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * staging: imx-drm: Replace DRM_LOG_KMS() by DRM_DEBUG_KMS()Lespiau, Damien2014-03-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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>
| * drm/imx: remove drm_mode_connector_detach_encoder harderDaniel Vetter2014-03-152-3/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * drm/kms: rip out drm_mode_connector_detach_encoderDaniel Vetter2014-03-132-4/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | staging:imx-drm: Fix line over 80 characters.Gulsah Kose2014-03-181-5/+10
| | | | | | | | | | | | | | 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>
* | staging: imx-drm: imx-ldb.c Fix line over 80 characters.Aybuke Ozdemir2014-03-181-6/+13
| | | | | | | | | | | | | | 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>
* | Merge branch 'imx-drm-staging' of git://ftp.arm.linux.org.uk/~rmk/linux-arm ↵Greg Kroah-Hartman2014-03-077-83/+201
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 (17b02809cfa7). 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.
| * | staging: imx-drm: Update TODOPhilipp Zabel2014-03-071-5/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | imx-drm: imx-tve: Fix DDC I2C bus propertyPhilipp Zabel2014-03-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | imx-drm: imx-hdmi: Fix DDC I2C bus propertyPhilipp Zabel2014-03-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | staging: imx-drm-core: use of_graph_parse_endpointPhilipp Zabel2014-03-071-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | staging: imx-drm-core: Use OF graph to find components and connections ↵Philipp Zabel2014-03-075-76/+199
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | imx-drm: imx-ldb: Use snprintf()Fabio Estevam2014-02-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | imx-drm: ipu-dmfc: Remove unneeded 'dmfc' checkFabio Estevam2014-02-281-3/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | imx-drm: imx-drm-core: Staticize imx_drm_find_crtc()Fabio Estevam2014-02-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | imx-drm: ipuv3-plane: Use %pad to print 'dma_addr_t'Fabio Estevam2014-02-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | imx-drm: parallel-display: Check 'mode' pointer firstFabio Estevam2014-02-271-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | imx-drm: imx-ldb: Check 'mode' pointer firstFabio Estevam2014-02-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | imx-drm: parallel-display: Add drm_panel supportPhilipp Zabel2014-02-272-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | imx-drm: ipu-dc: Use usleep_range instead of msleepPhilipp Zabel2014-02-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | imx-drm: Move IPU_PIX_FMT_GBR24 definition into imx-ipu-v3.hPhilipp Zabel2014-02-273-4/+3Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Merge branch 'imx-drm-staging' of git://ftp.arm.linux.org.uk/~rmk/linux-arm ↵Greg Kroah-Hartman2014-02-2411-1493/+861Star
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | imx-drm: imx-hdmi: add hotplug support to HDMI componentRussell King2014-02-241-7/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | imx-drm: imx-drm-core: add core hotplug connector supportRussell King2014-02-241-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | imx-drm: imx-drm-core: various cleanupsRussell King2014-02-242-33/+19Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | imx-drm: imx-drm-core: move allocation of imxdrm device to driver load functionRussell King2014-02-241-41/+6Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | imx-drm: imx-drm-core: kill off mutexRussell King2014-02-241-23/+3Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | imx-drm: imx-drm-core: get rid of drm_mode_group_init_legacy_group()Russell King2014-02-241-6/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | imx-drm: imx-drm-core: remove imx_drm_connector and imx_drm_encoder codeRussell King2014-02-242-384/+1Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The core imx_drm_connector and imx_drm_encoder code is no longer required - the connectors and encoders are all using the component support, so we can remove this. 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>
| * | imx-drm: initialise drm components directlyRussell King2014-02-244-174/+69Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that our bind function is only ever called during the main DRM driver ->load callback, we don't need to have the imx_drm_connector or imx_drm_encoder abstractions anymore. So let's get rid of it, and move the DRM connector and encoder setup into the connector support files. 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>
| * | imx-drm: imx-drm-core: provide common connector and encoder cleanup functionsRussell King2014-02-242-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Provide two helper functions to assist with cleaning up imx-drm connectors and encoders. 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>
| * | imx-drm: imx-drm-core: provide helper function to parse possible crtcsRussell King2014-02-242-0/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Provide a helper function to parse possible crtcs before the encoder is registered. The crtc mask is derived from the position of the CRTCs registered in the drm_device. 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>
| * | imx-drm: use supplied drm_device where possibleRussell King2014-02-243-35/+12Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The component helper provides us the drm_device which is being registered. Rather than having to reference a global in imx-drm-core, use this to get the imxdrm device, and also use it to register the CRTC against. This means we never have CRTCs/encoders/connectors without the drivers private data being accessible. Remove the module owner field as well; this provides no protection against the device being unbound. 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>
| * | imx-drm: remove imx-fb.cRussell King2014-02-243-49/+16Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | imx-fb.c doesn't need to be separate from imx-drm-core.c - all it is doing is setting up the minimum and maximum sizes of the scanout buffers, and setting up the mode_config function pointers. Move the contents into imx-drm-core.c and kill this file. 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>
| * | imx-drm: remove separate imx-fbdevRussell King2014-02-244-90/+31Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that we know when the components of the imx-drm subsystem will be initialised, we can move the fbdev helper initialisation and teardown into imx-drm-core. This gives us the required ordering that DRM wants in both driver load and unload methods. We can also stop exporting the imx_drm_device_get() and imx_drm_device_put() methods; nothing but the fbdev helper was making use of these. 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>
| * | imx-drm: delay publishing sysfs connector entriesRussell King2014-02-241-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Delay publishing sysfs connector entries until all components have initialised. This reduces the probability of generating false hotplug events when we're uncertain whether the driver can fully initialise. This also pulls that code out of the individual imx-drm connector drivers. 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>
| * | imx-drm: convert to componentised device supportRussell King2014-02-246-88/+237
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the componentised device support for imx-drm. This requires all the sub-components and the master device to register with the component device support. 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>
| * | imx-drm: simplify setup of panel formatRussell King2014-02-247-23/+21Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The encoder format passed into imx_drm_crtc_panel_format*() is the encoder format used for DRM in most cases; the HDMI encoder sets this to none, but this is incorrect, it should be TMDS. Since this is the case, we can pass the drm_encoder structure directly into this function and use the supplied fields there to configure the CRTC. 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>
| * | imx-drm: provide common connector mode validation functionRussell King2014-02-246-22/+18Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Provide a common connector mode validation function, which can be used to limit the available modes according to other components in the system. 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>
| * | imx-drm: imx-drm-core: use array instead of list for CRTCsRussell King2014-02-241-34/+23Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The DRM core indexes vblank by number, so there's little point maintaining a list, and have to scan the list to find the appropriate structure. Instead, use an array of pointers to the CRTCs. 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>
| * | imx-drm: imx-drm-core: sanitise imx_drm_encoder_get_mux_id()Russell King2014-02-244-19/+10Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Address the following issues: - imx_drm_encoder_get_mux_id() searches the CRTC list for the matching CRTC, and returns the position within this list as the MUX programming value for encoders. This is sub-optimal for two reasons: 1. It relies upon the CRTC list not changing during the lifetime of the driver. 2. It is dependent on the initialisation order of the CRTCs. We address (1) in this patch, leaving (2) until a better solution can be found, as (2) requires larger changes. - imx_drm_encoder is unused. Instead, pass the drm_encoder which is slightly more useful; all callers pass encoder->crtc as the required crtc, so move this inside the function. 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>
| * | imx-drm: ipu-v3: more clocking fixesRussell King2014-02-241-223/+105Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's no point in using the clk API for this; we end up having to violate the layering this provides. 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>
| * | imx-drm: ipu-v3: don't use clk_round_rate() before clk_set_rate()Russell King2014-02-241-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is nonsense; clk_round_rate() is just clk_set_rate() without the side effect of changing the hardware. 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>
| * | imx-drm: ipu-v3: more inteligent DI clock selectionRussell King2014-02-241-2/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The DI clock selection was very rudimentary: it would statically use either the IPU internal clock or the DI external clock depending on which "encoder" was being used. In the case of HDMI, it would always use the IPU clock. Moreover, using the IPU clock resulted in fractional divisors, which are achieved by skipping clock pulses. This can result in the HDMI PHY PLL being frequency modulated, and the attached device is then unable to properly lock on to the TMDS clock. We need at least 1% accurate and stable clocks for HDMI. Arrange for the DI clock to be sourced from the IPU internal clock if it can satisfy our requirements, otherwise switch to the DI external clock and try and set the external clock to our desired pixel clock rate. 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>
| * | imx-drm: imx-hdmi: fix CTS/N setup at init timeRussell King2014-02-241-38/+10Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many of the variables for the audio clock regenerator (CTS/N) were not initialised in any way. The pixel rate which was being used also wasn't being adjusted at all when the display mode is modified. Get rid of the seaprate 'pixel_clk_rate', and use the stored pixel clock rate instead. Pass this desired pixel clock rate into hdmi_set_clk_regenerator(). Collapse down hdmi_init_clk_regenerator() since it is a copy of hdmi_set_clk_regenerator(), and pass a default pixel clock rate. 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>
| * | imx-drm: imx-hdmi: clean up setting of vp_confRussell King2014-02-241-27/+22Star
| | | | | | | | | | | | | | | | | | | | | 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>
| * | imx-drm: imx-hdmi: provide register modification functionRussell King2014-02-241-117/+65Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are a load of read-modify-write patterns to change bitfields in various registers in this driver; provide a helper to perform this manipulation. 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>