Patchwork Add i.MX IPUv3 base/KMS driver to the staging tree

login
register
mail settings
Submitter Sascha Hauer
Date Sept. 21, 2012, 8:07 a.m.
Message ID <1348214872-28594-1-git-send-email-s.hauer@pengutronix.de>
Download mbox
Permalink /patch/185605/
State New
Headers show

Pull-request

git://git.pengutronix.de/git/imx/linux-2.6.git tags/imx-ipu-staging

Comments

Sascha Hauer - Sept. 21, 2012, 8:07 a.m.
The following adds the i.MX IPUv3 base and KMS driver to the staging
tree. The patches apply cleanly on next-20120921. Dave has merged the
missing helper functions, so this series has no further dependencies.

Greg, please apply this for staging.

Thanks,
  Sascha

The following changes since commit d2711cb78d2533e66d1172a917391502ce3ddd85:

  Add linux-next specific files for 20120921 (2012-09-21 16:51:19 +1000)

are available in the git repository at:

  git://git.pengutronix.de/git/imx/linux-2.6.git tags/imx-ipu-staging

for you to fetch changes up to 2d1cf926a36f3e4ea71ea115df846d857e755efd:

  staging: drm/imx: Add TODO (2012-09-21 09:58:52 +0200)

----------------------------------------------------------------
Add support to the ARM i.MX5/6 IPUv3 to staging

----------------------------------------------------------------
Philipp Zabel (1):
      staging: drm/imx: Add devicetree binding documentation

Sascha Hauer (5):
      staging: drm/imx: Add i.MX drm core support
      staging: drm/imx: Add parallel display support
      staging: drm/imx: add i.MX IPUv3 base driver
      staging: drm/imx: Add i.MX IPUv3 crtc support
      staging: drm/imx: Add TODO

 .../bindings/staging/imx-drm/fsl-imx-drm.txt       |   41 +
 drivers/staging/Kconfig                            |    2 +
 drivers/staging/Makefile                           |    1 +
 drivers/staging/imx-drm/Kconfig                    |   35 +
 drivers/staging/imx-drm/Makefile                   |    9 +
 drivers/staging/imx-drm/TODO                       |   22 +
 drivers/staging/imx-drm/imx-drm-core.c             |  884 +++++++++++++++
 drivers/staging/imx-drm/imx-drm.h                  |   58 +
 drivers/staging/imx-drm/imx-fb.c                   |   47 +
 drivers/staging/imx-drm/imx-fbdev.c                |   74 ++
 drivers/staging/imx-drm/ipu-v3/Makefile            |    3 +
 drivers/staging/imx-drm/ipu-v3/imx-ipu-v3.h        |  318 ++++++
 drivers/staging/imx-drm/ipu-v3/ipu-common.c        | 1143 ++++++++++++++++++++
 drivers/staging/imx-drm/ipu-v3/ipu-dc.c            |  372 +++++++
 drivers/staging/imx-drm/ipu-v3/ipu-di.c            |  700 ++++++++++++
 drivers/staging/imx-drm/ipu-v3/ipu-dmfc.c          |  408 +++++++
 drivers/staging/imx-drm/ipu-v3/ipu-dp.c            |  336 ++++++
 drivers/staging/imx-drm/ipu-v3/ipu-prv.h           |  206 ++++
 drivers/staging/imx-drm/ipuv3-crtc.c               |  579 ++++++++++
 drivers/staging/imx-drm/parallel-display.c         |  261 +++++
 20 files changed, 5499 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/staging/imx-drm/fsl-imx-drm.txt
 create mode 100644 drivers/staging/imx-drm/Kconfig
 create mode 100644 drivers/staging/imx-drm/Makefile
 create mode 100644 drivers/staging/imx-drm/TODO
 create mode 100644 drivers/staging/imx-drm/imx-drm-core.c
 create mode 100644 drivers/staging/imx-drm/imx-drm.h
 create mode 100644 drivers/staging/imx-drm/imx-fb.c
 create mode 100644 drivers/staging/imx-drm/imx-fbdev.c
 create mode 100644 drivers/staging/imx-drm/ipu-v3/Makefile
 create mode 100644 drivers/staging/imx-drm/ipu-v3/imx-ipu-v3.h
 create mode 100644 drivers/staging/imx-drm/ipu-v3/ipu-common.c
 create mode 100644 drivers/staging/imx-drm/ipu-v3/ipu-dc.c
 create mode 100644 drivers/staging/imx-drm/ipu-v3/ipu-di.c
 create mode 100644 drivers/staging/imx-drm/ipu-v3/ipu-dmfc.c
 create mode 100644 drivers/staging/imx-drm/ipu-v3/ipu-dp.c
 create mode 100644 drivers/staging/imx-drm/ipu-v3/ipu-prv.h
 create mode 100644 drivers/staging/imx-drm/ipuv3-crtc.c
 create mode 100644 drivers/staging/imx-drm/parallel-display.c
Greg KH - Sept. 21, 2012, 4:18 p.m.
On Fri, Sep 21, 2012 at 10:07:46AM +0200, Sascha Hauer wrote:
> The following adds the i.MX IPUv3 base and KMS driver to the staging
> tree. The patches apply cleanly on next-20120921. Dave has merged the
> missing helper functions, so this series has no further dependencies.
> 
> Greg, please apply this for staging.

Nice job, all now applied to the staging-next tree.

greg k-h
Eric Nelson - Sept. 21, 2012, 4:24 p.m.
Hi Sascha,

While testing against a video-enabled U-Boot on i.MX6, I found the issue
below.

On 09/21/2012 01:07 AM, Sascha Hauer wrote:
> This adds a i.MX51/53/6 IPU (Image Processing Unit) KMS driver. The
> driver has been tested on the i.MX51 babbage board, the i.MX53 LOCO
> board and the i.MX6q sabrelite board in different clone mode and dual
> head setups.
>
> Signed-off-by: Sascha Hauer<s.hauer@pengutronix.de>
> ---
> +++ b/drivers/staging/imx-drm/ipuv3-crtc.c
> @@ -0,0 +1,579 @@
> +/*
> + * i.MX IPUv3 Graphics driver
> + *
 >
 > <snip>
 >
> +static int ipu_get_resources(struct ipu_crtc *ipu_crtc,
> +		struct ipu_client_platformdata *pdata)
> +{
> +
> +	ipu_crtc->irq = ipu_idmac_channel_irq(ipu, ipu_crtc->ipu_ch,
> +			IPU_IRQ_EOF);

Interrupts get enabled here

> +	ret = devm_request_irq(ipu_crtc->dev, ipu_crtc->irq, ipu_irq_handler, 0,
> +			"imx_drm", ipu_crtc);
> +	if (ret<  0) {
> +		dev_err(ipu_crtc->dev, "irq request failed with %d.\n", ret);
> +		goto err_out;
> +	}
> +
>
> <snip>
>
> +
> +static int ipu_crtc_init(struct ipu_crtc *ipu_crtc,
> +		struct ipu_client_platformdata *pdata)
> +{
> +	int ret;
> +
> +	ret = ipu_get_resources(ipu_crtc, pdata);
> +	if (ret) {
> +		dev_err(ipu_crtc->dev, "getting resources failed with %d.\n",
> +				ret);
> +		return ret;
> +	}
> +

But ipu_crtc->imx_crtc gets initialized in this call, and
ipu_irq_handler() makes use of it.

The U-Boot code doesn't enable interrupts, so it's not acking
along the way, and leaves bits set in IPU1_INT_STAT_15.

I found that I can get around this in U-Boot by disabling the
LCD controller and acking all of the interrupts after disabling
the controller, but I haven't yet figured out where to tap into 
cleanup_before_linux().

Regards,


Eric
Sascha Hauer - Sept. 22, 2012, 10:17 a.m.
Hi Eric,

On Fri, Sep 21, 2012 at 09:24:19AM -0700, Eric Nelson wrote:
> Hi Sascha,
> 
> While testing against a video-enabled U-Boot on i.MX6, I found the issue
> below.
> 

[...]

> 
> But ipu_crtc->imx_crtc gets initialized in this call, and
> ipu_irq_handler() makes use of it.
> 
> The U-Boot code doesn't enable interrupts, so it's not acking
> along the way, and leaves bits set in IPU1_INT_STAT_15.
> 
> I found that I can get around this in U-Boot by disabling the
> LCD controller and acking all of the interrupts after disabling
> the controller, but I haven't yet figured out where to tap into
> cleanup_before_linux().

Passing over an enabled IPU from the bootloader to the kernel is
(currently) not a supported usecase, so U-Boot should indeed disable it.
That said, the kernel driver should make sure the IPU is sufficiently
configured before the interrupts are enabled, so this seems to be a bug
that deserves fixing.

Sascha
Eric Nelson - Sept. 22, 2012, 5:52 p.m.
On 09/22/2012 03:17 AM, Sascha Hauer wrote:
> Hi Eric,
>
> On Fri, Sep 21, 2012 at 09:24:19AM -0700, Eric Nelson wrote:
>> Hi Sascha,
>>
>>
>> But ipu_crtc->imx_crtc gets initialized in this call, and
>> ipu_irq_handler() makes use of it.
>>
>> The U-Boot code doesn't enable interrupts, so it's not acking
>> along the way, and leaves bits set in IPU1_INT_STAT_15.
>>
>> I found that I can get around this in U-Boot by disabling the
>> LCD controller and acking all of the interrupts after disabling
>> the controller, but I haven't yet figured out where to tap into
>> cleanup_before_linux().
>
> Passing over an enabled IPU from the bootloader to the kernel is
> (currently) not a supported usecase, so U-Boot should indeed disable it.
> That said, the kernel driver should make sure the IPU is sufficiently
> configured before the interrupts are enabled, so this seems to be a bug
> that deserves fixing.
>

Thanks Sascha,

Patches for U-Boot are in process.
	http://lists.denx.de/pipermail/u-boot/2012-September/134807.html

Regards,


Eric