[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <91f53ccc-69a6-4e31-9d8f-c4267bb4b8ab@ideasonboard.com>
Date: Wed, 28 Jan 2026 17:28:47 +0200
From: Tomi Valkeinen <tomi.valkeinen@...asonboard.com>
To: Laurent Pinchart <laurent.pinchart@...asonboard.com>
Cc: Vishal Sagar <vishal.sagar@....com>,
Anatoliy Klymenko <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>,
Michal Simek <michal.simek@....com>, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Dmitry Baryshkov <dmitry.baryshkov@....qualcomm.com>,
Pekka Paalanen <ppaalanen@...il.com>
Subject: Re: [PATCH v7 09/11] drm: xlnx: zynqmp: Add support for Y8 and
Y10_P32
Hi,
On 28/01/2026 14:10, Laurent Pinchart wrote:
> Hi Tomi,
>
> Thank you for the patch.
>
> On Mon, Dec 01, 2025 at 02:18:51PM +0200, Tomi Valkeinen wrote:
>> Add support for Y8 and Y10_P32 formats. We also need to add new csc
>> matrices for the y-only formats.
>>
>> Reviewed-by: Vishal Sagar <vishal.sagar@....com>
>> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@...asonboard.com>
>> ---
>> drivers/gpu/drm/xlnx/zynqmp_disp.c | 26 +++++++++++++++++++++++++-
>> 1 file changed, 25 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/xlnx/zynqmp_disp.c b/drivers/gpu/drm/xlnx/zynqmp_disp.c
>> index 1dc77f2e4262..fe111fa8cc13 100644
>> --- a/drivers/gpu/drm/xlnx/zynqmp_disp.c
>> +++ b/drivers/gpu/drm/xlnx/zynqmp_disp.c
>> @@ -307,6 +307,16 @@ static const struct zynqmp_disp_format avbuf_vid_fmts[] = {
>> .buf_fmt = ZYNQMP_DISP_AV_BUF_FMT_NL_VID_YV16CI_10,
>> .swap = false,
>> .sf = scaling_factors_101010,
>> + }, {
>> + .drm_fmt = DRM_FORMAT_Y8,
>> + .buf_fmt = ZYNQMP_DISP_AV_BUF_FMT_NL_VID_MONO,
>> + .swap = false,
>> + .sf = scaling_factors_888,
>> + }, {
>> + .drm_fmt = DRM_FORMAT_Y10_P32,
>> + .buf_fmt = ZYNQMP_DISP_AV_BUF_FMT_NL_VID_YONLY_10,
>> + .swap = false,
>> + .sf = scaling_factors_101010,
>> },
>> };
>>
>> @@ -697,6 +707,16 @@ static const u32 csc_sdtv_to_rgb_offsets[] = {
>> 0x0, 0x1800, 0x1800
>> };
>>
>
> A comment here to explain why the 1.0 value is in the third column
> instead of the expected first column would be good.
Sure.
>> +static const u16 csc_sdtv_to_rgb_yonly_matrix[] = {
>> + 0x0, 0x0, 0x1000,
>> + 0x0, 0x0, 0x1000,
>> + 0x0, 0x0, 0x1000,
>> +};
>> +
>> +static const u32 csc_sdtv_to_rgb_yonly_offsets[] = {
>> + 0x0, 0x0, 0x0
>> +};
>> +
>> /**
>> * zynqmp_disp_blend_set_output_format - Set the output format of the blender
>> * @disp: Display controller
>> @@ -846,7 +866,11 @@ static void zynqmp_disp_blend_layer_enable(struct zynqmp_disp *disp,
>> ZYNQMP_DISP_V_BLEND_LAYER_CONTROL(layer->id),
>> val);
>>
>> - if (layer->drm_fmt->is_yuv) {
>> + if (layer->drm_fmt->format == DRM_FORMAT_Y8 ||
>> + layer->drm_fmt->format == DRM_FORMAT_Y10_P32) {
>
> We could replace is_yuv with a type enum to avoid checking the format
> here, and use a switch statement. Up to you.
True, but I'm not sure it helps too much here at the moment. I tried a
few different kinds of enums (for channels, RGB/YUV/Y, and for CSC type
DEFAULT/YUV/Y) and a boolean (is_y_only) to zynqmp_disp_format, but I
wasn't sure if they really fit (especially considering we already have
is_yuv in the DRM format).
Furthermore, if we at some point add configurable color ranges and
encodings, the code has to change and I'm not sure what enum, if any,
makes sense there.
Tomi
> With those issues addressed,
>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@...asonboard.com>
>
>> + coeffs = csc_sdtv_to_rgb_yonly_matrix;
>> + offsets = csc_sdtv_to_rgb_yonly_offsets;
>> + } else if (layer->drm_fmt->is_yuv) {
>> coeffs = csc_sdtv_to_rgb_matrix;
>> offsets = csc_sdtv_to_rgb_offsets;
>> } else {
>
Powered by blists - more mailing lists