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] [thread-next>] [day] [month] [year] [list]
Message-ID:
 <BL1PR12MB596954886CC5E28EC8E735BA9C372@BL1PR12MB5969.namprd12.prod.outlook.com>
Date: Wed, 4 Dec 2024 16:26:41 +0000
From: "Sagar, Vishal" <vishal.sagar@....com>
To: Tomi Valkeinen <tomi.valkeinen@...asonboard.com>, "Klymenko, Anatoliy"
	<Anatoliy.Klymenko@....com>, Maarten Lankhorst
	<maarten.lankhorst@...ux.intel.com>, Maxime Ripard <mripard@...nel.org>,
	Thomas Zimmermann <tzimmermann@...e.de>, David Airlie <airlied@...il.com>,
	Simona Vetter <simona@...ll.ch>, Laurent Pinchart
	<laurent.pinchart@...asonboard.com>, "Simek, Michal" <michal.simek@....com>
CC: "dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-arm-kernel@...ts.infradead.org" <linux-arm-kernel@...ts.infradead.org>
Subject: RE: [PATCH 01/10] drm/fourcc: Add warning for bad bpp

[AMD Official Use Only - AMD Internal Distribution Only]

Hi Tomi,

Thanks for the patch.

> -----Original Message-----
> From: Tomi Valkeinen <tomi.valkeinen@...asonboard.com>
> Sent: Wednesday, December 4, 2024 10:31 AM
> To: Sagar, Vishal <vishal.sagar@....com>; Klymenko, Anatoliy
> <Anatoliy.Klymenko@....com>; Maarten Lankhorst
> <maarten.lankhorst@...ux.intel.com>; Maxime Ripard <mripard@...nel.org>;
> Thomas Zimmermann <tzimmermann@...e.de>; David Airlie
> <airlied@...il.com>; Simona Vetter <simona@...ll.ch>; Laurent Pinchart
> <laurent.pinchart@...asonboard.com>; Simek, Michal <michal.simek@....com>
> Cc: dri-devel@...ts.freedesktop.org; linux-kernel@...r.kernel.org; linux-arm-
> kernel@...ts.infradead.org; Tomi Valkeinen <tomi.valkeinen@...asonboard.com>
> Subject: [PATCH 01/10] drm/fourcc: Add warning for bad bpp
>
> drm_format_info_bpp() cannot be used for formats which do not have an
> integer bits-per-pixel. Handle wrong calls by printing a warning and
> returning 0.

It would be good to add an example of pixel format that may cause this issue.

>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@...asonboard.com>
> ---
>  drivers/gpu/drm/drm_fourcc.c | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_fourcc.c b/drivers/gpu/drm/drm_fourcc.c
> index 193cf8ed7912..e84c4ed6928c 100644
> --- a/drivers/gpu/drm/drm_fourcc.c
> +++ b/drivers/gpu/drm/drm_fourcc.c
> @@ -429,6 +429,13 @@ unsigned int drm_format_info_bpp(const struct
> drm_format_info *info, int plane)
>       if (!info || plane < 0 || plane >= info->num_planes)
>               return 0;
>
> +     if (info->char_per_block[plane] * 8 %
> +         (drm_format_info_block_width(info, plane) *
> +          drm_format_info_block_height(info, plane))) {
> +             pr_warn("unable to return an integer bpp\n");
> +             return 0;
> +     }
> +
>       return info->char_per_block[plane] * 8 /
>              (drm_format_info_block_width(info, plane) *
>               drm_format_info_block_height(info, plane));
>
> --
> 2.43.0

Regards
Vishal Sagar

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ