dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: ville.syrjala@linux.intel.com
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 01/22] drm: Add drm_format_plane_width() and drm_format_plane_height()
Date: Wed, 21 Oct 2015 11:53:20 +0200	[thread overview]
Message-ID: <20151021095320.GS13786@phenom.ffwll.local> (raw)
In-Reply-To: <1444840154-7804-2-git-send-email-ville.syrjala@linux.intel.com>

On Wed, Oct 14, 2015 at 07:28:53PM +0300, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Add a few helpers to get the dimensions of the chroma plane(s).
> 
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  include/drm/drm_crtc.h | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
> index 33ddedd..317baf9 100644
> --- a/include/drm/drm_crtc.h
> +++ b/include/drm/drm_crtc.h
> @@ -1497,6 +1497,18 @@ extern int drm_format_num_planes(uint32_t format);
>  extern int drm_format_plane_cpp(uint32_t format, int plane);
>  extern int drm_format_horz_chroma_subsampling(uint32_t format);
>  extern int drm_format_vert_chroma_subsampling(uint32_t format);
> +static inline int drm_format_plane_width(int width, uint32_t format, int plane)
> +{
> +	if (plane == 0)
> +		return width;
> +	return width / drm_format_horz_chroma_subsampling(format);
> +}
> +static inline int drm_format_plane_height(int height, uint32_t format, int plane)
> +{
> +	if (plane == 0)
> +		return height;
> +	return height / drm_format_vert_chroma_subsampling(format);
> +}

A bit of kerneldoc would be neat. Either way Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

>  extern const char *drm_get_format_name(uint32_t format);
>  extern struct drm_property *drm_mode_create_rotation_property(struct drm_device *dev,
>  							      unsigned int supported_rotations);
> -- 
> 2.4.9
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

      reply	other threads:[~2015-10-21  9:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1444840154-7804-1-git-send-email-ville.syrjala@linux.intel.com>
2015-10-14 16:28 ` [PATCH 01/22] drm: Add drm_format_plane_width() and drm_format_plane_height() ville.syrjala
2015-10-21  9:53   ` Daniel Vetter [this message]

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=20151021095320.GS13786@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@linux.intel.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