lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20180112142834.GB10981@intel.com>
Date:   Fri, 12 Jan 2018 16:28:34 +0200
From:   Ville Syrjälä <ville.syrjala@...ux.intel.com>
To:     Ayan Halder <ayan.halder@....com>
Cc:     liviu.dudau@....com, brian.starkey@....com,
        daniel.vetter@...el.com, jani.nikula@...ux.intel.com,
        seanpaul@...omium.org, airlied@...ux.ie,
        dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
        nd@....com
Subject: Re: [PATCH] drm: add drm_format_alpha_bits

On Fri, Jan 12, 2018 at 02:21:16PM +0000, Ayan Halder wrote:
> drm_format_info does not describe the number of bits used for the alpha
> channel. That information is useful in a central place like drm_fourcc.c
> where it can be queried by the drivers that want to determine if 'alpha
> blending' is to be enabled or not.
> 
> Signed-off-by: Ayan Kumar Halder <ayan.halder@....com>
> Reviewed-by: Liviu Dudau <liviu.dudau@....com>
> ---
>  drivers/gpu/drm/drm_fourcc.c | 154 ++++++++++++++++++++++++-------------------
>  include/drm/drm_fourcc.h     |   3 +
>  2 files changed, 89 insertions(+), 68 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_fourcc.c b/drivers/gpu/drm/drm_fourcc.c
> index 9c0152d..073001b 100644
> --- a/drivers/gpu/drm/drm_fourcc.c
> +++ b/drivers/gpu/drm/drm_fourcc.c
<snip>
> @@ -348,3 +348,21 @@ int drm_format_plane_height(int height, uint32_t format, int plane)
>  	return height / info->vsub;
>  }
>  EXPORT_SYMBOL(drm_format_plane_height);
> +
> +/**
> + * drm_format_alpha_bits - get the number of bits per pixel
> + * representing alpha for format
> + * @format: pixel format (DRM_FORMAT_*)
> + *
> + * Returns:
> + * The number of bits per pixel representing alpha used by the
> + * specified pixel format.
> + */
> +int drm_format_alpha_bits(uint32_t format)
> +{
> +	const struct drm_format_info *info;
> +
> +	info = drm_format_info(format);
> +	return info ? info->alpha : 0;
> +}
> +EXPORT_SYMBOL(drm_format_alpha_bits);

Do you have an actual use for this function somewhere?

> diff --git a/include/drm/drm_fourcc.h b/include/drm/drm_fourcc.h
> index 6942e84..5513510 100644
> --- a/include/drm/drm_fourcc.h
> +++ b/include/drm/drm_fourcc.h
> @@ -38,6 +38,7 @@ struct drm_mode_fb_cmd2;
>   * @cpp: Number of bytes per pixel (per plane)
>   * @hsub: Horizontal chroma subsampling factor
>   * @vsub: Vertical chroma subsampling factor
> + * @alpha: Number of bits per pixel representing alpha
>   */
>  struct drm_format_info {
>  	u32 format;
> @@ -46,6 +47,7 @@ struct drm_format_info {
>  	u8 cpp[3];
>  	u8 hsub;
>  	u8 vsub;
> +	u8 alpha;
>  };
>  
>  /**
> @@ -57,6 +59,7 @@ struct drm_format_name_buf {
>  };
>  
>  const struct drm_format_info *__drm_format_info(u32 format);
> +int drm_format_alpha_bits(u32 format);
>  const struct drm_format_info *drm_format_info(u32 format);
>  const struct drm_format_info *
>  drm_get_format_info(struct drm_device *dev,
> -- 
> 2.7.4
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@...ts.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Ville Syrjälä
Intel OTC

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ