[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y0rrh4cvqHFgcz9M@pendragon.ideasonboard.com>
Date: Sat, 15 Oct 2022 20:19:03 +0300
From: Laurent Pinchart <laurent.pinchart@...asonboard.com>
To: Maxime Ripard <maxime@...no.tech>
Cc: Maxime Ripard <mripard@...nel.org>, Eric Anholt <eric@...olt.net>,
Daniel Vetter <daniel@...ll.ch>,
David Airlie <airlied@...ux.ie>, Rob Herring <robh@...nel.org>,
Emma Anholt <emma@...olt.net>, dri-devel@...ts.freedesktop.org,
Joerg Quinten <aBUGSworstnightmare@...il.com>,
Chris Morgan <macromorgan@...mail.com>,
Dave Stevenson <dave.stevenson@...pberrypi.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 7/7] drm/vc4: dpi: Fix format mapping for RGB565
Hi Maxime and Dave,
Thank you for the patch.
On Thu, Oct 13, 2022 at 11:56:51AM +0200, Maxime Ripard wrote:
> From: Dave Stevenson <dave.stevenson@...pberrypi.com>
>
> The mapping is incorrect for RGB565_1X16 as it should be
> DPI_FORMAT_18BIT_666_RGB_1 instead of DPI_FORMAT_18BIT_666_RGB_3.
The driver includes the following macro definitions and comments:
/* Outputs 00000000rrrrrggggggbbbbb */
# define DPI_FORMAT_16BIT_565_RGB_1 1
/* Outputs 000rrrrr00gggggg000bbbbb */
# define DPI_FORMAT_16BIT_565_RGB_2 2
/* Outputs 00rrrrr000gggggg00bbbbb0 */
# define DPI_FORMAT_16BIT_565_RGB_3 3
MEDIA_BUS_FMT_RGB565_1X16 is defined as described in
https://linuxtv.org/downloads/v4l-dvb-apis/userspace-api/v4l/subdev-formats.html#id3:
Bit | 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Data | r4 r3 r2 r1 r0 g5 g4 g3 g2 g1 g0 b4 b3 b2 b1 b0
This seems to match DPI_FORMAT_16BIT_565_RGB_1 indeed.
Reviewed-by: Laurent Pinchart <laurent.pinchart@...asonboard.com>
> Fixes: 08302c35b59d ("drm/vc4: Add DPI driver")
> Signed-off-by: Dave Stevenson <dave.stevenson@...pberrypi.com>
> Signed-off-by: Maxime Ripard <maxime@...no.tech>
> ---
> drivers/gpu/drm/vc4/vc4_dpi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c b/drivers/gpu/drm/vc4/vc4_dpi.c
> index fdae02760b6d..a7bebfa5d5b0 100644
> --- a/drivers/gpu/drm/vc4/vc4_dpi.c
> +++ b/drivers/gpu/drm/vc4/vc4_dpi.c
> @@ -185,7 +185,7 @@ static void vc4_dpi_encoder_enable(struct drm_encoder *encoder)
> DPI_FORMAT);
> break;
> case MEDIA_BUS_FMT_RGB565_1X16:
> - dpi_c |= VC4_SET_FIELD(DPI_FORMAT_16BIT_565_RGB_3,
> + dpi_c |= VC4_SET_FIELD(DPI_FORMAT_16BIT_565_RGB_1,
> DPI_FORMAT);
> break;
> case MEDIA_BUS_FMT_RGB565_1X24_CPADHI:
>
--
Regards,
Laurent Pinchart
Powered by blists - more mailing lists