All of lore.kernel.org
 help / color / mirror / Atom feed
From: jani.nikula@linux.intel.com (Jani Nikula)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v9.5.1 09/20] drm/dsi: Add a helper to get bits per pixel of MIPI DSI pixel format
Date: Fri, 15 May 2015 09:34:54 +0300	[thread overview]
Message-ID: <878ucqnyb5.fsf@intel.com> (raw)
In-Reply-To: <1431570099-29216-1-git-send-email-Ying.Liu@freescale.com>

On Thu, 14 May 2015, Liu Ying <Ying.Liu@freescale.com> wrote:
> This patch adds a helper to get bits per pixel value of MIPI DSI pixel format.
> The helper takes a parameter in the type 'enum mipi_dsi_pixel_format' and
> returns it's bits per pixel value if the parameter is valid, otherwise, it
> returns -EINVAL.  The helper makes users' life easier to do the conversion
> from a specific MIPI DSI pixel format to it's bits per pixel value.
>
> Signed-off-by: Liu Ying <Ying.Liu@freescale.com>

Reviewed-by: Jani Nikula <jani.nikula@intel.com>


> ---
> v9.5->v9.5.1:
>  * To address Thierry Reding's comments, add a commit message to describe why
>    the helper is useful and when to use it and fix typo in kernel-doc from
>    'mipi dsi' to 'MIPI DSI'.
>
> v9->v9.5:
>  * Add kernel-doc for the new helper function to address Daniel Vetter's
>    comment.
>
> v8->v9:
>  * Rebase onto the imx-drm/next branch of Philipp Zabel's open git repository.
>
> v7->v8:
>  * None.
>
> v6->v7:
>  * None.
>
> v5->v6:
>  * Address the over 80 characters in one line warning reported by the
>    checkpatch.pl script.
>
> v4->v5:
>  * None.
>
> v3->v4:
>  * None.
>
> v2->v3:
>  * None.
>
> v1->v2:
>  * Thierry Reding suggested that the mipi_dsi_pixel_format_to_bpp() function
>    could be placed at the common DRM MIPI DSI driver.
>    This patch is newly added.
>
>  include/drm/drm_mipi_dsi.h | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)
>
> diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h
> index f1d8d0d..186b15b 100644
> --- a/include/drm/drm_mipi_dsi.h
> +++ b/include/drm/drm_mipi_dsi.h
> @@ -163,6 +163,28 @@ static inline struct mipi_dsi_device *to_mipi_dsi_device(struct device *dev)
>  	return container_of(dev, struct mipi_dsi_device, dev);
>  }
>  
> +/**
> + * mipi_dsi_pixel_format_to_bpp() - get bits per pixel for a MIPI DSI
> + *    pixel format
> + * @fmt: MIPI DSI pixel format
> + *
> + * Return: The bits per pixel value for the MIPI DSI pixel format on success or
> + *    a negative error code on failure.
> + */
> +static inline int mipi_dsi_pixel_format_to_bpp(enum mipi_dsi_pixel_format fmt)
> +{
> +	switch (fmt) {
> +	case MIPI_DSI_FMT_RGB888:
> +	case MIPI_DSI_FMT_RGB666:
> +		return 24;
> +	case MIPI_DSI_FMT_RGB666_PACKED:
> +		return 18;
> +	case MIPI_DSI_FMT_RGB565:
> +		return 16;
> +	}
> +	return -EINVAL;
> +}
> +
>  struct mipi_dsi_device *of_find_mipi_dsi_device_by_node(struct device_node *np);
>  int mipi_dsi_attach(struct mipi_dsi_device *dsi);
>  int mipi_dsi_detach(struct mipi_dsi_device *dsi);
> -- 
> 1.9.1
>

-- 
Jani Nikula, Intel Open Source Technology Center

WARNING: multiple messages have this Message-ID (diff)
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Liu Ying <Ying.Liu@freescale.com>, dri-devel@lists.freedesktop.org
Cc: linux-arm-kernel@lists.infradead.org, linux@arm.linux.org.uk,
	kernel@pengutronix.de, p.zabel@pengutronix.de,
	thierry.reding@gmail.com, shawn.guo@linaro.org, airlied@linux.ie,
	andyshrk@gmail.com, stefan.wahren@i2se.com, a.hajda@samsung.com,
	sboyd@codeaurora.org, daniel.vetter@ffwll.ch,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v9.5.1 09/20] drm/dsi: Add a helper to get bits per pixel of MIPI DSI pixel format
Date: Fri, 15 May 2015 09:34:54 +0300	[thread overview]
Message-ID: <878ucqnyb5.fsf@intel.com> (raw)
In-Reply-To: <1431570099-29216-1-git-send-email-Ying.Liu@freescale.com>

On Thu, 14 May 2015, Liu Ying <Ying.Liu@freescale.com> wrote:
> This patch adds a helper to get bits per pixel value of MIPI DSI pixel format.
> The helper takes a parameter in the type 'enum mipi_dsi_pixel_format' and
> returns it's bits per pixel value if the parameter is valid, otherwise, it
> returns -EINVAL.  The helper makes users' life easier to do the conversion
> from a specific MIPI DSI pixel format to it's bits per pixel value.
>
> Signed-off-by: Liu Ying <Ying.Liu@freescale.com>

Reviewed-by: Jani Nikula <jani.nikula@intel.com>


> ---
> v9.5->v9.5.1:
>  * To address Thierry Reding's comments, add a commit message to describe why
>    the helper is useful and when to use it and fix typo in kernel-doc from
>    'mipi dsi' to 'MIPI DSI'.
>
> v9->v9.5:
>  * Add kernel-doc for the new helper function to address Daniel Vetter's
>    comment.
>
> v8->v9:
>  * Rebase onto the imx-drm/next branch of Philipp Zabel's open git repository.
>
> v7->v8:
>  * None.
>
> v6->v7:
>  * None.
>
> v5->v6:
>  * Address the over 80 characters in one line warning reported by the
>    checkpatch.pl script.
>
> v4->v5:
>  * None.
>
> v3->v4:
>  * None.
>
> v2->v3:
>  * None.
>
> v1->v2:
>  * Thierry Reding suggested that the mipi_dsi_pixel_format_to_bpp() function
>    could be placed at the common DRM MIPI DSI driver.
>    This patch is newly added.
>
>  include/drm/drm_mipi_dsi.h | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)
>
> diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h
> index f1d8d0d..186b15b 100644
> --- a/include/drm/drm_mipi_dsi.h
> +++ b/include/drm/drm_mipi_dsi.h
> @@ -163,6 +163,28 @@ static inline struct mipi_dsi_device *to_mipi_dsi_device(struct device *dev)
>  	return container_of(dev, struct mipi_dsi_device, dev);
>  }
>  
> +/**
> + * mipi_dsi_pixel_format_to_bpp() - get bits per pixel for a MIPI DSI
> + *    pixel format
> + * @fmt: MIPI DSI pixel format
> + *
> + * Return: The bits per pixel value for the MIPI DSI pixel format on success or
> + *    a negative error code on failure.
> + */
> +static inline int mipi_dsi_pixel_format_to_bpp(enum mipi_dsi_pixel_format fmt)
> +{
> +	switch (fmt) {
> +	case MIPI_DSI_FMT_RGB888:
> +	case MIPI_DSI_FMT_RGB666:
> +		return 24;
> +	case MIPI_DSI_FMT_RGB666_PACKED:
> +		return 18;
> +	case MIPI_DSI_FMT_RGB565:
> +		return 16;
> +	}
> +	return -EINVAL;
> +}
> +
>  struct mipi_dsi_device *of_find_mipi_dsi_device_by_node(struct device_node *np);
>  int mipi_dsi_attach(struct mipi_dsi_device *dsi);
>  int mipi_dsi_detach(struct mipi_dsi_device *dsi);
> -- 
> 1.9.1
>

-- 
Jani Nikula, Intel Open Source Technology Center

  reply	other threads:[~2015-05-15  6:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-14  2:21 [PATCH v9.5.1 09/20] drm/dsi: Add a helper to get bits per pixel of MIPI DSI pixel format Liu Ying
2015-05-14  2:21 ` Liu Ying
2015-05-14  2:21 ` Liu Ying
2015-05-15  6:34 ` Jani Nikula [this message]
2015-05-15  6:34   ` Jani Nikula

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=878ucqnyb5.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.