summaryrefslogtreecommitdiffstats
path: root/drivers/staging/imx-drm/imx-ldb.c
Commit message (Collapse)AuthorAgeFilesLines
* drm: imx: Move imx-drm driver out of stagingPhilipp Zabel2014-11-261-616/+0Star
| | | | | | | | | | | | | | | | The imx-drm driver was put into staging mostly for the following reasons, all of which have been addressed or superseded: - convert the irq driver to use linear irq domains - work out the device tree bindings, this lead to the common of_graph bindings being used - factor out common helper functions, this mostly resulted in the component framework and drm of_graph helpers. Before adding new fixes, and certainly before adding new features, move it into its proper place below drivers/gpu/drm. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Dave Airlie <airlied@redhat.com>
* imx-drm: imx-ldb: fix NULL pointer in imx_ldb_unbind()Russell King2014-09-081-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When trying to unbind imx-drm, the following oops was observed from the imx-ldb driver: Unable to handle kernel NULL pointer dereference at virtual address 0000001c pgd = de954000 [0000001c] *pgd=2e92c831, *pte=00000000, *ppte=00000000 Internal error: Oops: 17 [#1] SMP ARM Modules linked in: bnep rfcomm bluetooth nfsd exportfs hid_cypress brcmfmac brcmutil snd_soc_fsl_ssi snd_soc_fsl_spdif imx_pcm_fiq imx_pcm_dma imx_ldb(C) imx_thermal imx_sdma imx2_wdt snd_soc_sgtl5000 snd_soc_imx_sgtl5000 snd_soc_imx_spdif snd_soc_imx_audmux CPU: 1 PID: 1228 Comm: bash Tainted: G C 3.16.0-rc2+ #1229 task: ea378d80 ti: de948000 task.ti: de948000 PC is at imx_ldb_unbind+0x1c/0x58 [imx_ldb] LR is at component_unbind+0x38/0x70 pc : [<bf025068>] lr : [<c0353108>] psr: 200f0013 sp : de949da8 ip : de949dc0 fp : de949dbc r10: e9a44b0c r9 : 00000000 r8 : de949f78 r7 : 00000012 r6 : e9b3f400 r5 : e9b133b8 r4 : e9b13010 r3 : 00000000 r2 : e9b3f400 r1 : ea9a0210 r0 : e9b13020 Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user Control: 10c53c7d Table: 2e95404a DAC: 00000015 Process bash (pid: 1228, stack limit = 0xde948240) Stack: (0xde949da8 to 0xde94a000) ... Backtrace: [<bf02504c>] (imx_ldb_unbind [imx_ldb]) from [<c0353108>] (component_unbind+0x38/0x70) [<c03530d0>] (component_unbind) from [<c03531d4>] (component_unbind_all+0x94/0xc8) [<c0353140>] (component_unbind_all) from [<c04bc224>] (imx_drm_driver_unload+0x34/0x4c) [<c04bc1f0>] (imx_drm_driver_unload) from [<c03394a4>] (drm_dev_unregister+0x2c/0xa0) [<c0339478>] (drm_dev_unregister) from [<c0339f8c>] (drm_put_dev+0x30/0x6c) [<c0339f5c>] (drm_put_dev) from [<c04bc1cc>] (imx_drm_unbind+0x14/0x18) [<c04bc1b8>] (imx_drm_unbind) from [<c03530b4>] (component_master_del+0xbc/0xd8) ... Code: e5904058 e2840010 e2845fea e59430a0 (e593301c) ---[ end trace 4f211c6dbbcd4963 ]--- This is caused by only having one channel out of the pair configured in DT; the second channel remains uninitialised, but upon unbind, the driver attempts to clean up both, thereby dereferencing a NULL pointer. Avoid this by checking that the second channel is initialised. Fixes: 1b3f76756633 ("imx-drm: initialise drm components directly") Cc: <stable@vger.kernel.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* drm: make mode_valid callback optionalAndrzej Hajda2014-04-221-1/+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>
* 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-071-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-core: Use OF graph to find components and connections ↵Philipp Zabel2014-03-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: 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: initialise drm components directlyRussell King2014-02-241-46/+22Star
| | | | | | | | | | | | 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: convert to componentised device supportRussell King2014-02-241-12/+28
| | | | | | | | | | | 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-241-2/+1Star
| | | | | | | | | | | | | | | 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-241-7/+1Star
| | | | | | | | | | | 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: sanitise imx_drm_encoder_get_mux_id()Russell King2014-02-241-4/+2Star
| | | | | | | | | | | | | | | | | | | | | | 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>
* staging: imx-drm: remove unnecessary bracesSima Baymani2013-11-101-2/+1Star
| | | | | | | | | | Fix checkpatch warning by removing unnecessary braces. Compile-tested the single file. Signed-off-by: Sima Baymani <sima.baymani@gmail.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Reviewed-by: Archana Kumari <archanakumari959@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: imx-drm: Fix warning for static const char * array in imx-ldb.cArchana kumari2013-11-101-1/+1
| | | | | | | | | This patch fixes the warning "static const char * array should probably be static const char * const" in imx-ldb.c. Signed-off-by: Archana kumari <archanakumari959@gmail.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: drm/imx: replace IS_ERR and PTR_ERR with PTR_ERR_OR_ZEROValentina Manea2013-10-281-3/+1Star
| | | | | | | | | This patch fixes coccinelle error regarding usage of IS_ERR and PTR_ERR instead of PTR_ERR_OR_ZERO. Signed-off-by: Valentina Manea <valentina.manea.m@gmail.com> Reviewed-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: imx-drm: Remove redundant of_match_ptrSachin Kamat2013-10-011-2/+1Star
| | | | | | | | 'imx_ldb_dt_ids' is always compiled in. Hence of_match_ptr() is not needed. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: imx-drm: imx-ldb: Staticize of_get_data_mapping()Fabio Estevam2013-09-261-1/+1
| | | | | | | | | | Staticize of_get_data_mapping() in order to fix the following sparse warning: drivers/staging/imx-drm/imx-ldb.c:424:11: warning: symbol 'of_get_data_mapping' was not declared. Should it be static? Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* imx-drm: imx-ldb: Add MODULE_ALIAS()Fabio Estevam2013-08-201-0/+1
| | | | | | | | Add MODULE_ALIAS, so that auto module loading can work. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: imx-drm: Fix typo in staging/imx-drmMasanari Iida2013-07-231-1/+1
| | | | | | | | | Correct spelling typo in staging/imx-drm Singed-off-by: Masanari Iida <standby24x7@gmail.com> Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: imx_drm: imx_ldb: fix 18 bit formatMarkus Niebel2013-06-181-1/+17
| | | | | | | | | | | Since 18 bit is supported as datawidth in device tree it should be supported in driver. Beside the LDB channel the IPU channel has also to be configured to use BGR666. Signed-off-by: Markus Niebel <Markus.Niebel@tqs.de> Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: drm/imx: Add LDB supportSascha Hauer2013-06-181-0/+609
This adds support for the LVDS Display Bridge contained in i.MX5 and i.MX6 SoCs. Bit mapping, data width, and video timings are configurable via device tree. Dual-channel mode is supported for a single high-resolution source. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>