devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Boris BREZILLON <boris.brezillon@free-electrons.com>
To: Boris Brezillon <boris.brezillon@free-electrons.com>
Cc: David Airlie <airlied@linux.ie>,
	dri-devel@lists.freedesktop.org,
	Nicolas Ferre <nicolas.ferre@atmel.com>,
	Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,
	Alexandre Belloni <alexandre.belloni@free-electrons.com>,
	Andrew Victor <linux@maxim.org.za>,
	Samuel Ortiz <sameo@linux.intel.com>,
	Lee Jones <lee.jones@linaro.org>,
	Thierry Reding <thierry.reding@gmail.com>,
	linux-pwm@vger.kernel.org, Rob Clark <robdclark@gmail.com>,
	linux-arm-kernel@lists.infradead.org,
	Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	Mark Yao <mark.yao@rock-chips.com>
Subject: Re: [PATCH v6 05/11] drm: add Atmel HLCDC Display Controller support
Date: Mon, 29 Sep 2014 19:20:57 +0200	[thread overview]
Message-ID: <20140929192057.1ede0346@bbrezillon> (raw)
In-Reply-To: <1412001864-3251-6-git-send-email-boris.brezillon@free-electrons.com>

On Mon, 29 Sep 2014 16:44:18 +0200
Boris Brezillon <boris.brezillon@free-electrons.com> wrote:

> From: Boris BREZILLON <boris.brezillon@free-electrons.com>
> 
> The Atmel HLCDC (HLCD Controller) IP available on some Atmel SoCs (i.e.
> at91sam9n12, at91sam9x5 family or sama5d3 family) provides a display
> controller device.
> 
> This display controller supports at least one primary plane and might
> provide several overlays and an hardware cursor depending on the IP
> version.
> 
> At the moment, this driver only implements an RGB connector to interface
> with LCD panels, but support for other kind of external devices might be
> added later.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> Reviewed-by: Rob Clark <robdclark@gmail.com>
> Tested-by: Anthony Harivel <anthony.harivel@emtrion.de>
> Tested-by: Ludovic Desroches <ludovic.desroches@atmel.com>
> ---
>  drivers/gpu/drm/Kconfig                          |   2 +
>  drivers/gpu/drm/Makefile                         |   1 +
>  drivers/gpu/drm/atmel-hlcdc/Kconfig              |  13 +
>  drivers/gpu/drm/atmel-hlcdc/Makefile             |   7 +
>  drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c   | 392 +++++++++++
>  drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c     | 527 ++++++++++++++
>  drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h     | 216 ++++++
>  drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_layer.c  | 659 ++++++++++++++++++
>  drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_layer.h  | 403 +++++++++++
>  drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c | 443 ++++++++++++
>  drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c  | 833 +++++++++++++++++++++++
>  11 files changed, 3496 insertions(+)
>  create mode 100644 drivers/gpu/drm/atmel-hlcdc/Kconfig
>  create mode 100644 drivers/gpu/drm/atmel-hlcdc/Makefile
>  create mode 100644 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
>  create mode 100644 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
>  create mode 100644 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h
>  create mode 100644 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_layer.c
>  create mode 100644 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_layer.h
>  create mode 100644 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c
>  create mode 100644 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
> 
> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
> index b066bb3..2d97f7e 100644
> --- a/drivers/gpu/drm/Kconfig
> +++ b/drivers/gpu/drm/Kconfig
> @@ -185,6 +185,8 @@ source "drivers/gpu/drm/cirrus/Kconfig"
>  

[...]

> +
> +int atmel_hlcdc_crtc_mode_valid(struct drm_crtc *c,
> +				struct drm_display_mode *mode)
> +{
> +	struct videomode vm;
> +
> +	vm.vfront_porch = mode->vsync_start - mode->vdisplay;
> +	vm.vback_porch = mode->vtotal - mode->vsync_end;
> +	vm.vsync_len = mode->vsync_end - mode->vsync_start;
> +	vm.hfront_porch = mode->hsync_start - mode->hdisplay;
> +	vm.hback_porch = mode->htotal - mode->hsync_end;
> +	vm.hsync_len = mode->hsync_end - mode->hsync_start;
> +
> +	if (vm.hsync_len > 0x40 || vm.hsync_len < 1)
> +		return MODE_HSYNC;
> +
> +	if (vm.vsync_len > 0x40 || vm.vsync_len < 1)
> +		return MODE_VSYNC;
> +
> +	if (vm.vfront_porch > 0x40 || vm.hfront_porch < 1 ||
> +	    vm.vback_porch > 0x40 || vm.vback_porch < 0 ||
> +	    mode->hdisplay > 2048 || mode->hdisplay < 1)
> +		return MODE_H_ILLEGAL;
> +
> +	if (vm.hfront_porch > 0x200 || vm.hfront_porch < 1 ||
> +	    vm.hback_porch > 0x200 || vm.hback_porch < 1 ||
> +	    mode->hdisplay > 2048 || mode->hdisplay < 1)
> +		return MODE_V_ILLEGAL;
> +
> +	return MODE_OK;
> +}
> +

I forgot to squash the commit removing this function which a vestige
from one of my attempt to provide a common mode_valid function that can
be called from the connector mode_valid function.

-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

  reply	other threads:[~2014-09-29 17:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-29 14:44 [PATCH v6 00/11] drm: add support for Atmel HLCDC Display Controller Boris Brezillon
2014-09-29 14:44 ` [PATCH v6 01/11] mfd: add atmel-hlcdc driver Boris Brezillon
2014-09-29 14:44 ` [PATCH v6 02/11] mfd: add documentation for atmel-hlcdc DT bindings Boris Brezillon
2014-09-29 14:44 ` [PATCH v6 03/11] pwm: add support for atmel-hlcdc-pwm device Boris Brezillon
2014-09-29 14:44 ` [PATCH v6 04/11] pwm: add DT bindings documentation for atmel-hlcdc-pwm driver Boris Brezillon
2014-09-29 14:44 ` [PATCH v6 05/11] drm: add Atmel HLCDC Display Controller support Boris Brezillon
2014-09-29 17:20   ` Boris BREZILLON [this message]
2014-09-29 14:44 ` [PATCH v6 06/11] drm: add DT bindings documentation for atmel-hlcdc-dc driver Boris Brezillon
2014-09-29 14:44 ` [PATCH v6 07/11] ARM: AT91/dt: split sama5d3 lcd pin definitions to match RGB mode configs Boris Brezillon
2014-09-29 14:44 ` [PATCH v6 08/11] ARM: AT91/dt: add alternative pin muxing for sama5d3 lcd pins Boris Brezillon
2014-09-29 14:44 ` [PATCH v6 09/11] ARM: at91/dt: define the HLCDC node available on sama5d3 SoCs Boris Brezillon
2014-09-29 14:44 ` [PATCH v6 10/11] ARM: at91/dt: add LCD panel description to sama5d3xdm.dtsi Boris Brezillon
2014-09-29 14:44 ` [PATCH v6 11/11] ARM: at91/dt: enable the LCD panel on sama5d3xek boards Boris Brezillon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140929192057.1ede0346@bbrezillon \
    --to=boris.brezillon@free-electrons.com \
    --cc=airlied@linux.ie \
    --cc=alexandre.belloni@free-electrons.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=linux@maxim.org.za \
    --cc=mark.rutland@arm.com \
    --cc=mark.yao@rock-chips.com \
    --cc=nicolas.ferre@atmel.com \
    --cc=pawel.moll@arm.com \
    --cc=plagnioj@jcrosoft.com \
    --cc=robdclark@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=sameo@linux.intel.com \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).