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: <20181204152928.ola6ggxbatre54nd@flea>
Date:   Tue, 4 Dec 2018 16:29:28 +0100
From:   Maxime Ripard <maxime.ripard@...tlin.com>
To:     Paul Kocialkowski <paul.kocialkowski@...tlin.com>
Cc:     dri-devel@...ts.freedesktop.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        David Airlie <airlied@...ux.ie>, Chen-Yu Tsai <wens@...e.org>,
        Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
        Sean Paul <sean@...rly.run>,
        Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
        linux-sunxi@...glegroups.com, Daniel Vetter <daniel@...ll.ch>
Subject: Re: [PATCH v3 06/21] drm/sun4i: frontend: Configure and enable YUV
 to RGB CSC when needed

On Tue, Dec 04, 2018 at 03:22:03PM +0100, Paul Kocialkowski wrote:
> In prevision of adding support for YUV formats, set the YUV to RGB
> colorspace conversion coefficients if required and don't bypass the
> CSC engine when converting.
> 
> The BT601 coefficients from the A33 BSP are copied over from the backend
> code. Because of module inter-dependency, we can't have the frontend use
> these coefficients from the backend directly.
> 
> Signed-off-by: Paul Kocialkowski <paul.kocialkowski@...tlin.com>
> ---
>  drivers/gpu/drm/sun4i/sun4i_frontend.c | 45 ++++++++++++++++++++++++--
>  drivers/gpu/drm/sun4i/sun4i_frontend.h |  2 ++
>  2 files changed, 45 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/sun4i/sun4i_frontend.c b/drivers/gpu/drm/sun4i/sun4i_frontend.c
> index d0eca4b8784d..1737a4394401 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_frontend.c
> +++ b/drivers/gpu/drm/sun4i/sun4i_frontend.c
> @@ -48,6 +48,28 @@ static const u32 sun4i_frontend_horz_coef[64] = {
>  	0x03ff0000, 0x0000fd41, 0x01ff0000, 0x0000fe42,
>  };
>  
> +/*
> + * These coefficients are taken from the A33 BSP from Allwinner.
> + *
> + * The first three values of each row are coded as 13-bit signed fixed-point
> + * numbers, with 10 bits for the fractional part. The fourth value is a
> + * constant coded as a 14-bit signed fixed-point number with 4 bits for the
> + * fractional part.
> + *
> + * The values in table order give the following colorspace translation:
> + * G = 1.164 * Y - 0.391 * U - 0.813 * V + 135
> + * R = 1.164 * Y + 1.596 * V - 222
> + * B = 1.164 * Y + 2.018 * U + 276
> + *
> + * This seems to be a conversion from Y[16:235] UV[16:240] to RGB[0:255],
> + * following the BT601 spec.
> + */
> +static const u32 sunxi_bt601_yuv2rgb_coef[12] = {
> +	0x000004a7, 0x00001e6f, 0x00001cbf, 0x00000877,
> +	0x000004a7, 0x00000000, 0x00000662, 0x00003211,
> +	0x000004a7, 0x00000812, 0x00000000, 0x00002eb1,
> +};
> +

I'd really prefer not to duplicate that structure. IIRC, we already
have a dependency between the frontend and the backend (or the other
way around), maybe we should just move that structure to either so
that we don't have a circular dependency?

Maxime

-- 
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ