| Message ID | 20221005151309.7278-8-jagan@amarulasolutions.com |
|---|---|
| State | New |
| Headers |
Return-Path: <linux-amarula+bncBD7MFH7A7EEBBHN662MQMGQEJ7OZTVQ@amarulasolutions.com> X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-il1-f198.google.com (mail-il1-f198.google.com [209.85.166.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 5A33B3F1F7 for <linux-amarula@patchwork.amarulasolutions.com>; Wed, 5 Oct 2022 17:13:34 +0200 (CEST) Received: by mail-il1-f198.google.com with SMTP id k3-20020a056e02156300b002f5623faa62sf13380935ilu.0 for <linux-amarula@patchwork.amarulasolutions.com>; Wed, 05 Oct 2022 08:13:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1664982813; cv=pass; d=google.com; s=arc-20160816; b=vPfm0cj0nDrMfjUJhhsoFAavCjFcob22O2Xghbd7haoWoYEKNkpi1M7fAE1sbX7DjL hgE5Iv0Ahqu5bkz2bCeU3blOV8eX7oCDWULW0QIfz0PdPLjq859QtorEv2v5tzZir461 RBg+nwV4OF4ZL/rSBfHueZmSAsdBDPy5t4Gu0D8zif4MXSJglBarwFv89NKPy2/FFuI4 XG5JvNcLBDxnBhOcv1wW0PDVX+kBu3oIeQyVejaChXRaBT/uKBWUxdufZgTakvjgiXI+ X0fTJ+2bLu0p6A7slPHpODHyvZIzmg41qdbnQjOwo83YWdYZE3pGbflZTup86CVhE4gS EEsw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=yB875yHvuADix901JoxECZfxBgF9HMjIfTWpwNUcNEw=; b=Q72XxnJtcjHFtRY8W8/7KUdiTaCQtpRib8OhhUbvFGkAK/MRLfxjBCBb/F8UfRtMps IQx77wWanb0ujtZZzqwwbFJGnv0LXE41+ayC+sU2U9mFEFJ8q6oR8PR9ZzEmFG7netV0 vz8BBevG3le8w9ymGw2Gk0JSEYmrIa/3msbZhvautq5V3yQxPbXokxokNIKNZjsSAZ0P LBg1CYuNqx5OeCNL4sw8VQZE50B81YFMK0YM2RlXUpp6nslGvb6nakdAjClTe4AL5jgO BqvayyfOKoj+0yMdrsloBGXZL11LFce8nQqgOGnI9YDn3Ve8ecTOAZZn6IXsh28Bj9lX RrZA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=He75xA4R; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date; bh=yB875yHvuADix901JoxECZfxBgF9HMjIfTWpwNUcNEw=; b=PALhGyfS2fuq2h7S054CljBMKBrV1P2TYxiD0+Iszip3Bvp8KHrCxxqn3YRriy/4NN 44MVquPyoCXJYk6n2m6ZD1j+bcCBVPVHMid0OQbjDx0sef01B8YTXpUwTmP4ZbOqe6CL haOX5L9sW61+3ej2TqcwMcVD0xcL8ndaQHGls= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date; bh=yB875yHvuADix901JoxECZfxBgF9HMjIfTWpwNUcNEw=; b=zjNeLOLmInOryesw33iWTbK6J+8tU7tyU+0gYQ6HUvRuXUWHqQ01rzALN7XPNHI2ef IEQvtQFTZTxoS8tH2JSoRAA7pRtDKdq9YUnHN9UqaRBmPRWOZXlsJer27ikCdTTYGEb0 XpuRGRCpurs59VTAfGnfmG0p+dykomjB/PxH0/UAenwgrhlGm7Blo4i2S1QhKBdYeX9B mMnDAXd7GACtvwTbXgC/HsFhzaDIOdYJi5W3Wp3UtpjYUR0dC7A4Dar6C/jW+yzhFiw7 Oztv/TBvBMCZFIvcxBwOApccDCUcdWzhMcNOU+SDTUWTvxEHGGn2ffF68k379oTJH5+s 2gXg== X-Gm-Message-State: ACrzQf0KeL5ysXeSr+bfCbTaknS3xn+ogeEalLxm0PDHcWfuj2bS35xK cmixhbs2MVOXvrjTmDGAdw0IlAvu X-Google-Smtp-Source: AMsMyM5taqLNhE6SJBop4aUwCcy8MtvijYBkk3tdSOzvBKLgkdmgvWwQNl6E6Ak+loWHC5HZYO9+wQ== X-Received: by 2002:a05:6638:d54:b0:363:5fe2:1918 with SMTP id d20-20020a0566380d5400b003635fe21918mr66041jak.146.1664982813420; Wed, 05 Oct 2022 08:13:33 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a5d:8898:0:b0:6a8:19bf:4f91 with SMTP id d24-20020a5d8898000000b006a819bf4f91ls1896581ioo.10.-pod-prod-gmail; Wed, 05 Oct 2022 08:13:33 -0700 (PDT) X-Received: by 2002:a6b:5f10:0:b0:6b6:2e31:a07f with SMTP id t16-20020a6b5f10000000b006b62e31a07fmr177717iob.12.1664982812790; Wed, 05 Oct 2022 08:13:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664982812; cv=none; d=google.com; s=arc-20160816; b=rcW8DCqNPGO2E4CQl6hYTZetu2DFcfalA/JWqA/1Z44nZ1cz9pF2eCJwKkROEl8Hqo 3bOrLeKMZfaLNsFr3s5Up0qzGeAzBPwEEESAYa8Al22tWoan+3aAKAxfU4RJzcYGV+08 jKsAjY7CYvS1Ld7C7Zda1gnY5q/lqGW1w/hlYF3OV5JRjdl2Ogi1ldAZhlLIXzAlLk2Y ZjX1V+tAlKYV+Fh7N77c33PEnqybNA03VTTOir+sVSsZVvjSmnkEg3PCarBFbobpaOKr HY9b9eaZYiTKHKcVOBo/dqGrwbBJYhhrWtQ8soiWi3t8TwfzIdDM4SuVia7tRkUsvmjS xmvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=eqWkyv52rZKBGpE2JLSJud8lD9bHv8P4xkrBjD3bCbk=; b=c2CDgFv1CueJb3EyQBgXTBCV96SP1be7lpgXvrF09Jtl8x8taWjI5YhnFhcqqH6vpQ 9j6lvgF0PNljV3FvQRD67pTJRBCY3BlRhYGtX2MM7/hKmGLN6VOYkdpenyG8pATkLGaj yxMHHdlJuW792Mws+KojNmTV2r3tAlv5WVNCvjhmJ70hHKxlYHlEd/3qQGRGehpaIRAY JV/1UkRaUjsnA56L8uV1aNvEvJxrhf6rpLYgibS9wdQRw3JtQ3TN48tBSWSyx07MmYqf vbmp0I1YIMSyjftQsNWUB59rb9DJ2szf1WXOLEACs7i06KBYjIbQieancng754G12Vpn NlAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=He75xA4R; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id cp11-20020a056638480b00b003633894d932sor2472970jab.53.2022.10.05.08.13.32 for <linux-amarula@amarulasolutions.com> (Google Transport Security); Wed, 05 Oct 2022 08:13:32 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a02:8804:0:b0:35b:7425:82af with SMTP id r4-20020a028804000000b0035b742582afmr52577jai.21.1664982812516; Wed, 05 Oct 2022 08:13:32 -0700 (PDT) Received: from j-ThinkPad-E14-Gen-2.stthomas.edu ([140.209.96.21]) by smtp.gmail.com with ESMTPSA id w15-20020a056602034f00b0068a235db030sm7089276iou.27.2022.10.05.08.13.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Oct 2022 08:13:32 -0700 (PDT) From: Jagan Teki <jagan@amarulasolutions.com> To: Andrzej Hajda <andrzej.hajda@intel.com>, Inki Dae <inki.dae@samsung.com>, Marek Szyprowski <m.szyprowski@samsung.com>, Joonyoung Shim <jy0922.shim@samsung.com>, Seung-Woo Kim <sw0312.kim@samsung.com>, Kyungmin Park <kyungmin.park@samsung.com>, Frieder Schrempf <frieder.schrempf@kontron.de>, Fancy Fang <chen.fang@nxp.com>, Tim Harvey <tharvey@gateworks.com>, Michael Nazzareno Trimarchi <michael@amarulasolutions.com>, Adam Ford <aford173@gmail.com>, Neil Armstrong <narmstrong@linaro.org>, Robert Foss <robert.foss@linaro.org>, Laurent Pinchart <Laurent.pinchart@ideasonboard.com>, Tommaso Merciai <tommaso.merciai@amarulasolutions.com>, Marek Vasut <marex@denx.de> Cc: Matteo Lisi <matteo.lisi@engicam.com>, dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team <linux-imx@nxp.com>, linux-amarula <linux-amarula@amarulasolutions.com>, Jagan Teki <jagan@amarulasolutions.com> Subject: [PATCH v7 07/10] drm: bridge: samsung-dsim: Add atomic_get_input_bus_fmts Date: Wed, 5 Oct 2022 20:43:06 +0530 Message-Id: <20221005151309.7278-8-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221005151309.7278-1-jagan@amarulasolutions.com> References: <20221005151309.7278-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=He75xA4R; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: <linux-amarula.amarulasolutions.com> X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/post>, <mailto:linux-amarula@amarulasolutions.com> List-Help: <https://support.google.com/a/amarulasolutions.com/bin/topic.py?topic=25838>, <mailto:linux-amarula+help@amarulasolutions.com> List-Archive: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/> List-Unsubscribe: <mailto:googlegroups-manage+476853432473+unsubscribe@googlegroups.com>, <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/subscribe> |
| Series |
drm: bridge: Add Samsung MIPI DSIM bridge
|
|
Commit Message
Jagan Teki
Oct. 5, 2022, 3:13 p.m. UTC
Finding the right input bus format throughout the pipeline is hard
so add atomic_get_input_bus_fmts callback and initialize with the
default RGB888_1X24 bus format on DSI-end.
This format can be used in pipeline for negotiating bus format between
the DSI-end of this bridge and the other component closer to pipeline
components.
v7, v6, v5, v4:
* none
v3:
* include media-bus-format.h
v2:
* none
v1:
* new patch
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
drivers/gpu/drm/bridge/samsung-dsim.c | 28 +++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
Comments
On 10/5/22 17:13, Jagan Teki wrote: [...] > @@ -1321,6 +1322,32 @@ static void samsung_dsim_atomic_post_disable(struct drm_bridge *bridge, > pm_runtime_put_sync(dsi->dev); > } > > +#define MAX_INPUT_SEL_FORMATS 1 > + > +static u32 * > +samsung_dsim_atomic_get_input_bus_fmts(struct drm_bridge *bridge, > + struct drm_bridge_state *bridge_state, > + struct drm_crtc_state *crtc_state, > + struct drm_connector_state *conn_state, > + u32 output_fmt, > + unsigned int *num_input_fmts) > +{ > + u32 *input_fmts; > + > + *num_input_fmts = 0; > + > + input_fmts = kcalloc(MAX_INPUT_SEL_FORMATS, sizeof(*input_fmts), > + GFP_KERNEL); > + if (!input_fmts) > + return NULL; > + > + /* This is the DSI-end bus format */ > + input_fmts[0] = MEDIA_BUS_FMT_RGB888_1X24; > + *num_input_fmts = 1; Is this the only supported format ? NXP AN13573 lists the following: i.MX 8/RT MIPI DSI/CSI-2, Rev. 0, 21 March 2022 3.7.4 Pixel formats Table 14. DSI pixel packing formats Loosely Packed Pixel Stream, 20-bit YCbCr, 4:2:2 Packed Pixel Stream, 24-bit YCbCr, 4:2:2 Packed Pixel Stream, 16-bit YCbCr, 4:2:2 Packed Pixel Stream, 30-bit RGB, 10-10-10 Packed Pixel Stream, 36-bit RGB, 12-12-12 Packed Pixel Stream, 12-bit YCbCr, 4:2:0 Packed Pixel Stream, 16-bit RGB, 5-6-5 Packed Pixel Stream, 18-bit RGB, 6-6-6 Loosely Packed Pixel Stream, 18-bit RGB, 6-6-6 Packed Pixel Stream, 24-bit RGB, 8-8-8 Format The MX8MM/MN LCDIF can generate all of those RGB formats , the MX8MP LCDIFv3 can also generate the 16bit YCbCr . It seems there should be more formats here.
On Sun, Oct 16, 2022 at 3:31 AM Marek Vasut <marex@denx.de> wrote: > > On 10/5/22 17:13, Jagan Teki wrote: > > [...] > > > @@ -1321,6 +1322,32 @@ static void samsung_dsim_atomic_post_disable(struct drm_bridge *bridge, > > pm_runtime_put_sync(dsi->dev); > > } > > > > +#define MAX_INPUT_SEL_FORMATS 1 > > + > > +static u32 * > > +samsung_dsim_atomic_get_input_bus_fmts(struct drm_bridge *bridge, > > + struct drm_bridge_state *bridge_state, > > + struct drm_crtc_state *crtc_state, > > + struct drm_connector_state *conn_state, > > + u32 output_fmt, > > + unsigned int *num_input_fmts) > > +{ > > + u32 *input_fmts; > > + > > + *num_input_fmts = 0; > > + > > + input_fmts = kcalloc(MAX_INPUT_SEL_FORMATS, sizeof(*input_fmts), > > + GFP_KERNEL); > > + if (!input_fmts) > > + return NULL; > > + > > + /* This is the DSI-end bus format */ > > + input_fmts[0] = MEDIA_BUS_FMT_RGB888_1X24; > > + *num_input_fmts = 1; > > Is this the only supported format ? NXP AN13573 lists the following: At least it only formats I have tested on my panel. > > i.MX 8/RT MIPI DSI/CSI-2, Rev. 0, 21 March 2022 > 3.7.4 Pixel formats > Table 14. DSI pixel packing formats > > Loosely Packed Pixel Stream, 20-bit YCbCr, 4:2:2 > Packed Pixel Stream, 24-bit YCbCr, 4:2:2 > Packed Pixel Stream, 16-bit YCbCr, 4:2:2 > Packed Pixel Stream, 30-bit RGB, 10-10-10 > Packed Pixel Stream, 36-bit RGB, 12-12-12 > Packed Pixel Stream, 12-bit YCbCr, 4:2:0 > Packed Pixel Stream, 16-bit RGB, 5-6-5 > Packed Pixel Stream, 18-bit RGB, 6-6-6 > Loosely Packed Pixel Stream, 18-bit RGB, 6-6-6 > Packed Pixel Stream, 24-bit RGB, 8-8-8 Format > > The MX8MM/MN LCDIF can generate all of those RGB formats , the MX8MP > LCDIFv3 can also generate the 16bit YCbCr . > > It seems there should be more formats here. The idea of this patch is to support the default format first, and can possibly add future patches with the addition of new formats. Thanks, Jagan.
On 10/17/22 05:58, Jagan Teki wrote: > On Sun, Oct 16, 2022 at 3:31 AM Marek Vasut <marex@denx.de> wrote: >> >> On 10/5/22 17:13, Jagan Teki wrote: >> >> [...] >> >>> @@ -1321,6 +1322,32 @@ static void samsung_dsim_atomic_post_disable(struct drm_bridge *bridge, >>> pm_runtime_put_sync(dsi->dev); >>> } >>> >>> +#define MAX_INPUT_SEL_FORMATS 1 >>> + >>> +static u32 * >>> +samsung_dsim_atomic_get_input_bus_fmts(struct drm_bridge *bridge, >>> + struct drm_bridge_state *bridge_state, >>> + struct drm_crtc_state *crtc_state, >>> + struct drm_connector_state *conn_state, >>> + u32 output_fmt, >>> + unsigned int *num_input_fmts) >>> +{ >>> + u32 *input_fmts; >>> + >>> + *num_input_fmts = 0; >>> + >>> + input_fmts = kcalloc(MAX_INPUT_SEL_FORMATS, sizeof(*input_fmts), >>> + GFP_KERNEL); >>> + if (!input_fmts) >>> + return NULL; >>> + >>> + /* This is the DSI-end bus format */ >>> + input_fmts[0] = MEDIA_BUS_FMT_RGB888_1X24; >>> + *num_input_fmts = 1; >> >> Is this the only supported format ? NXP AN13573 lists the following: > > At least it only formats I have tested on my panel. > >> >> i.MX 8/RT MIPI DSI/CSI-2, Rev. 0, 21 March 2022 >> 3.7.4 Pixel formats >> Table 14. DSI pixel packing formats >> >> Loosely Packed Pixel Stream, 20-bit YCbCr, 4:2:2 >> Packed Pixel Stream, 24-bit YCbCr, 4:2:2 >> Packed Pixel Stream, 16-bit YCbCr, 4:2:2 >> Packed Pixel Stream, 30-bit RGB, 10-10-10 >> Packed Pixel Stream, 36-bit RGB, 12-12-12 >> Packed Pixel Stream, 12-bit YCbCr, 4:2:0 >> Packed Pixel Stream, 16-bit RGB, 5-6-5 >> Packed Pixel Stream, 18-bit RGB, 6-6-6 >> Loosely Packed Pixel Stream, 18-bit RGB, 6-6-6 >> Packed Pixel Stream, 24-bit RGB, 8-8-8 Format >> >> The MX8MM/MN LCDIF can generate all of those RGB formats , the MX8MP >> LCDIFv3 can also generate the 16bit YCbCr . >> >> It seems there should be more formats here. > > The idea of this patch is to support the default format first, and can > possibly add future patches with the addition of new formats. Since you already know about the list, please add all the formats, so we won't be adding known broken code first, only to fix it later.
On Mon, Oct 17, 2022 at 12:54 PM Marek Vasut <marex@denx.de> wrote: > > On 10/17/22 05:58, Jagan Teki wrote: > > On Sun, Oct 16, 2022 at 3:31 AM Marek Vasut <marex@denx.de> wrote: > >> > >> On 10/5/22 17:13, Jagan Teki wrote: > >> > >> [...] > >> > >>> @@ -1321,6 +1322,32 @@ static void samsung_dsim_atomic_post_disable(struct drm_bridge *bridge, > >>> pm_runtime_put_sync(dsi->dev); > >>> } > >>> > >>> +#define MAX_INPUT_SEL_FORMATS 1 > >>> + > >>> +static u32 * > >>> +samsung_dsim_atomic_get_input_bus_fmts(struct drm_bridge *bridge, > >>> + struct drm_bridge_state *bridge_state, > >>> + struct drm_crtc_state *crtc_state, > >>> + struct drm_connector_state *conn_state, > >>> + u32 output_fmt, > >>> + unsigned int *num_input_fmts) > >>> +{ > >>> + u32 *input_fmts; > >>> + > >>> + *num_input_fmts = 0; > >>> + > >>> + input_fmts = kcalloc(MAX_INPUT_SEL_FORMATS, sizeof(*input_fmts), > >>> + GFP_KERNEL); > >>> + if (!input_fmts) > >>> + return NULL; > >>> + > >>> + /* This is the DSI-end bus format */ > >>> + input_fmts[0] = MEDIA_BUS_FMT_RGB888_1X24; > >>> + *num_input_fmts = 1; > >> > >> Is this the only supported format ? NXP AN13573 lists the following: > > > > At least it only formats I have tested on my panel. > > > >> > >> i.MX 8/RT MIPI DSI/CSI-2, Rev. 0, 21 March 2022 > >> 3.7.4 Pixel formats > >> Table 14. DSI pixel packing formats > >> > >> Loosely Packed Pixel Stream, 20-bit YCbCr, 4:2:2 > >> Packed Pixel Stream, 24-bit YCbCr, 4:2:2 > >> Packed Pixel Stream, 16-bit YCbCr, 4:2:2 > >> Packed Pixel Stream, 30-bit RGB, 10-10-10 > >> Packed Pixel Stream, 36-bit RGB, 12-12-12 > >> Packed Pixel Stream, 12-bit YCbCr, 4:2:0 > >> Packed Pixel Stream, 16-bit RGB, 5-6-5 > >> Packed Pixel Stream, 18-bit RGB, 6-6-6 > >> Loosely Packed Pixel Stream, 18-bit RGB, 6-6-6 > >> Packed Pixel Stream, 24-bit RGB, 8-8-8 Format > >> > >> The MX8MM/MN LCDIF can generate all of those RGB formats , the MX8MP > >> LCDIFv3 can also generate the 16bit YCbCr . > >> > >> It seems there should be more formats here. > > > > The idea of this patch is to support the default format first, and can > > possibly add future patches with the addition of new formats. > > Since you already know about the list, please add all the formats, so we > won't be adding known broken code first, only to fix it later. Okay. I can see the DSI section Mini TRM shown below formats. (13.6.2 Features) Supports pixel format: 16bpp, 18bpp packed, 18bpp loosely packed (3 byte format), and 24bpp I will try to add these 4 formats. let me know. Jagan.
On Sun, Oct 16, 2022 at 3:31 AM Marek Vasut <marex@denx.de> wrote: > > On 10/5/22 17:13, Jagan Teki wrote: > > [...] > > > @@ -1321,6 +1322,32 @@ static void samsung_dsim_atomic_post_disable(struct drm_bridge *bridge, > > pm_runtime_put_sync(dsi->dev); > > } > > > > +#define MAX_INPUT_SEL_FORMATS 1 > > + > > +static u32 * > > +samsung_dsim_atomic_get_input_bus_fmts(struct drm_bridge *bridge, > > + struct drm_bridge_state *bridge_state, > > + struct drm_crtc_state *crtc_state, > > + struct drm_connector_state *conn_state, > > + u32 output_fmt, > > + unsigned int *num_input_fmts) > > +{ > > + u32 *input_fmts; > > + > > + *num_input_fmts = 0; > > + > > + input_fmts = kcalloc(MAX_INPUT_SEL_FORMATS, sizeof(*input_fmts), > > + GFP_KERNEL); > > + if (!input_fmts) > > + return NULL; > > + > > + /* This is the DSI-end bus format */ > > + input_fmts[0] = MEDIA_BUS_FMT_RGB888_1X24; > > + *num_input_fmts = 1; > > Is this the only supported format ? NXP AN13573 lists the following: > > i.MX 8/RT MIPI DSI/CSI-2, Rev. 0, 21 March 2022 > 3.7.4 Pixel formats > Table 14. DSI pixel packing formats > > Loosely Packed Pixel Stream, 20-bit YCbCr, 4:2:2 > Packed Pixel Stream, 24-bit YCbCr, 4:2:2 > Packed Pixel Stream, 16-bit YCbCr, 4:2:2 Look like these are unsupported in media-bus-format.h list. > Packed Pixel Stream, 30-bit RGB, 10-10-10 > Packed Pixel Stream, 36-bit RGB, 12-12-12 > Packed Pixel Stream, 12-bit YCbCr, 4:2:0 Same issue, unsupported. > Packed Pixel Stream, 16-bit RGB, 5-6-5 MEDIA_BUS_FMT_RGB565_1X16 > Packed Pixel Stream, 18-bit RGB, 6-6-6 Same issue, unsupported. > Loosely Packed Pixel Stream, 18-bit RGB, 6-6-6 > Packed Pixel Stream, 24-bit RGB, 8-8-8 Format MEDIA_BUS_FMT_RGB666_1X18 MEDIA_BUS_FMT_RGB888_1X24 > > The MX8MM/MN LCDIF can generate all of those RGB formats , the MX8MP > LCDIFv3 can also generate the 16bit YCbCr . Is YCbCr denoted as UYVY in media-bus-format.h ? Thanks, Jagan.
On 11/3/22 10:39, Jagan Teki wrote: > On Sun, Oct 16, 2022 at 3:31 AM Marek Vasut <marex@denx.de> wrote: >> >> On 10/5/22 17:13, Jagan Teki wrote: >> >> [...] >> >>> @@ -1321,6 +1322,32 @@ static void samsung_dsim_atomic_post_disable(struct drm_bridge *bridge, >>> pm_runtime_put_sync(dsi->dev); >>> } >>> >>> +#define MAX_INPUT_SEL_FORMATS 1 >>> + >>> +static u32 * >>> +samsung_dsim_atomic_get_input_bus_fmts(struct drm_bridge *bridge, >>> + struct drm_bridge_state *bridge_state, >>> + struct drm_crtc_state *crtc_state, >>> + struct drm_connector_state *conn_state, >>> + u32 output_fmt, >>> + unsigned int *num_input_fmts) >>> +{ >>> + u32 *input_fmts; >>> + >>> + *num_input_fmts = 0; >>> + >>> + input_fmts = kcalloc(MAX_INPUT_SEL_FORMATS, sizeof(*input_fmts), >>> + GFP_KERNEL); >>> + if (!input_fmts) >>> + return NULL; >>> + >>> + /* This is the DSI-end bus format */ >>> + input_fmts[0] = MEDIA_BUS_FMT_RGB888_1X24; >>> + *num_input_fmts = 1; >> >> Is this the only supported format ? NXP AN13573 lists the following: >> >> i.MX 8/RT MIPI DSI/CSI-2, Rev. 0, 21 March 2022 >> 3.7.4 Pixel formats >> Table 14. DSI pixel packing formats >> >> Loosely Packed Pixel Stream, 20-bit YCbCr, 4:2:2 >> Packed Pixel Stream, 24-bit YCbCr, 4:2:2 >> Packed Pixel Stream, 16-bit YCbCr, 4:2:2 > > Look like these are unsupported in media-bus-format.h list. Aren't those: MEDIA_BUS_FMT_UYVY12_1X24 MEDIA_BUS_FMT_UYVY8_1X16 ? Those are packed, and subsampled 4:2:2 >> Packed Pixel Stream, 30-bit RGB, 10-10-10 MEDIA_BUS_FMT_RGB101010_1X30 >> Packed Pixel Stream, 36-bit RGB, 12-12-12 MEDIA_BUS_FMT_RGB121212_1X36 >> Packed Pixel Stream, 12-bit YCbCr, 4:2:0 > > Same issue, unsupported. The 12-bit packed 4:2:0 might be something along the lines of drivers/media/platform/rockchip/rkisp1/rkisp1-resizer.c MEDIA_BUS_FMT_YUYV8_1_5X8, /* YUV420 */ >> Packed Pixel Stream, 16-bit RGB, 5-6-5 > > MEDIA_BUS_FMT_RGB565_1X16 > >> Packed Pixel Stream, 18-bit RGB, 6-6-6 > > Same issue, unsupported. MEDIA_BUS_FMT_RGB666_1X18 >> Loosely Packed Pixel Stream, 18-bit RGB, 6-6-6 >> Packed Pixel Stream, 24-bit RGB, 8-8-8 Format > > MEDIA_BUS_FMT_RGB666_1X18 > MEDIA_BUS_FMT_RGB888_1X24 > >> >> The MX8MM/MN LCDIF can generate all of those RGB formats , the MX8MP >> LCDIFv3 can also generate the 16bit YCbCr . > > Is YCbCr denoted as UYVY in media-bus-format.h ? I think this applies: https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/colorspaces.html " Sometimes people confuse Y’CbCr as being a colorspace. This is not correct, it is just an encoding of an R’G’B’ color into luma and chroma values. " And esp. this: " In order to correctly interpret a color you need to know the quantization range, whether it is R’G’B’ or Y’CbCr, the used Y’CbCr encoding and the colorspace. From that information you can calculate the corresponding CIE XYZ color and map that again to whatever colorspace your display device uses. " Which means that in order to properly describe or interpret the data, you need the entire v4l2_mbus_framefmt content, not just the pixel code: https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/subdev-formats.html But this information is not passed across the bus, that's metadata internal to the kernel.
On 11/3/22 08:40, Jagan Teki wrote: > On Mon, Oct 17, 2022 at 12:54 PM Marek Vasut <marex@denx.de> wrote: >> >> On 10/17/22 05:58, Jagan Teki wrote: >>> On Sun, Oct 16, 2022 at 3:31 AM Marek Vasut <marex@denx.de> wrote: >>>> >>>> On 10/5/22 17:13, Jagan Teki wrote: >>>> >>>> [...] >>>> >>>>> @@ -1321,6 +1322,32 @@ static void samsung_dsim_atomic_post_disable(struct drm_bridge *bridge, >>>>> pm_runtime_put_sync(dsi->dev); >>>>> } >>>>> >>>>> +#define MAX_INPUT_SEL_FORMATS 1 >>>>> + >>>>> +static u32 * >>>>> +samsung_dsim_atomic_get_input_bus_fmts(struct drm_bridge *bridge, >>>>> + struct drm_bridge_state *bridge_state, >>>>> + struct drm_crtc_state *crtc_state, >>>>> + struct drm_connector_state *conn_state, >>>>> + u32 output_fmt, >>>>> + unsigned int *num_input_fmts) >>>>> +{ >>>>> + u32 *input_fmts; >>>>> + >>>>> + *num_input_fmts = 0; >>>>> + >>>>> + input_fmts = kcalloc(MAX_INPUT_SEL_FORMATS, sizeof(*input_fmts), >>>>> + GFP_KERNEL); >>>>> + if (!input_fmts) >>>>> + return NULL; >>>>> + >>>>> + /* This is the DSI-end bus format */ >>>>> + input_fmts[0] = MEDIA_BUS_FMT_RGB888_1X24; >>>>> + *num_input_fmts = 1; >>>> >>>> Is this the only supported format ? NXP AN13573 lists the following: >>> >>> At least it only formats I have tested on my panel. >>> >>>> >>>> i.MX 8/RT MIPI DSI/CSI-2, Rev. 0, 21 March 2022 >>>> 3.7.4 Pixel formats >>>> Table 14. DSI pixel packing formats >>>> >>>> Loosely Packed Pixel Stream, 20-bit YCbCr, 4:2:2 >>>> Packed Pixel Stream, 24-bit YCbCr, 4:2:2 >>>> Packed Pixel Stream, 16-bit YCbCr, 4:2:2 >>>> Packed Pixel Stream, 30-bit RGB, 10-10-10 >>>> Packed Pixel Stream, 36-bit RGB, 12-12-12 >>>> Packed Pixel Stream, 12-bit YCbCr, 4:2:0 >>>> Packed Pixel Stream, 16-bit RGB, 5-6-5 >>>> Packed Pixel Stream, 18-bit RGB, 6-6-6 >>>> Loosely Packed Pixel Stream, 18-bit RGB, 6-6-6 >>>> Packed Pixel Stream, 24-bit RGB, 8-8-8 Format >>>> >>>> The MX8MM/MN LCDIF can generate all of those RGB formats , the MX8MP >>>> LCDIFv3 can also generate the 16bit YCbCr . >>>> >>>> It seems there should be more formats here. >>> >>> The idea of this patch is to support the default format first, and can >>> possibly add future patches with the addition of new formats. >> >> Since you already know about the list, please add all the formats, so we >> won't be adding known broken code first, only to fix it later. > > Okay. I can see the DSI section Mini TRM shown below formats. (13.6.2 Features) > > Supports pixel format: 16bpp, 18bpp packed, 18bpp loosely packed (3 byte > format), and 24bpp > > I will try to add these 4 formats. let me know. You should be able to add all but the 'Packed Pixel Stream, 12-bit YCbCr, 4:2:0' which would have to be defined (that's a few lines patch?).
On Thu, Nov 3, 2022 at 9:56 PM Marek Vasut <marex@denx.de> wrote: > > On 11/3/22 10:39, Jagan Teki wrote: > > On Sun, Oct 16, 2022 at 3:31 AM Marek Vasut <marex@denx.de> wrote: > >> > >> On 10/5/22 17:13, Jagan Teki wrote: > >> > >> [...] > >> > >>> @@ -1321,6 +1322,32 @@ static void samsung_dsim_atomic_post_disable(struct drm_bridge *bridge, > >>> pm_runtime_put_sync(dsi->dev); > >>> } > >>> > >>> +#define MAX_INPUT_SEL_FORMATS 1 > >>> + > >>> +static u32 * > >>> +samsung_dsim_atomic_get_input_bus_fmts(struct drm_bridge *bridge, > >>> + struct drm_bridge_state *bridge_state, > >>> + struct drm_crtc_state *crtc_state, > >>> + struct drm_connector_state *conn_state, > >>> + u32 output_fmt, > >>> + unsigned int *num_input_fmts) > >>> +{ > >>> + u32 *input_fmts; > >>> + > >>> + *num_input_fmts = 0; > >>> + > >>> + input_fmts = kcalloc(MAX_INPUT_SEL_FORMATS, sizeof(*input_fmts), > >>> + GFP_KERNEL); > >>> + if (!input_fmts) > >>> + return NULL; > >>> + > >>> + /* This is the DSI-end bus format */ > >>> + input_fmts[0] = MEDIA_BUS_FMT_RGB888_1X24; > >>> + *num_input_fmts = 1; > >> > >> Is this the only supported format ? NXP AN13573 lists the following: > >> > >> i.MX 8/RT MIPI DSI/CSI-2, Rev. 0, 21 March 2022 > >> 3.7.4 Pixel formats > >> Table 14. DSI pixel packing formats > >> > >> Loosely Packed Pixel Stream, 20-bit YCbCr, 4:2:2 > >> Packed Pixel Stream, 24-bit YCbCr, 4:2:2 > >> Packed Pixel Stream, 16-bit YCbCr, 4:2:2 > > > > Look like these are unsupported in media-bus-format.h list. > > Aren't those: > > MEDIA_BUS_FMT_UYVY12_1X24 Why is UYVY12 - YCbCr, 4:2:2 is 4+2+2 = 8 then it has UYVY8 ? > MEDIA_BUS_FMT_UYVY8_1X16 If YCbCr is UYVY (I still don't get this notation, sorry) then Packed Pixel Stream, 24-bit YCbCr, 4:2:2 with 2 Pixels per packet from Table 14 can be MEDIA_BUS_FMT_UYVY8_2X24 (YCbCr 4:2:2 is UYVY8) " based on a reference example from media bus format doc 4.13.3.4.1.1.3. Packed YUV Formats, For instance, a format where pixels are encoded as 8-bit YUV values downsampled to 4:2:2 and transferred as 2 8-bit bus samples per pixel in the U, Y, V, Y order will be named MEDIA_BUS_FMT_UYVY8_2X8." https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/subdev-formats.html _2X24 here 2 Pixels per packet is the exact packets to consider or we can consider 1 Pixel per packet also. If later is true then _1X24 from your notation is correct. Thanks, Jagan.
On 11/3/22 18:27, Jagan Teki wrote: > On Thu, Nov 3, 2022 at 9:56 PM Marek Vasut <marex@denx.de> wrote: >> >> On 11/3/22 10:39, Jagan Teki wrote: >>> On Sun, Oct 16, 2022 at 3:31 AM Marek Vasut <marex@denx.de> wrote: >>>> >>>> On 10/5/22 17:13, Jagan Teki wrote: >>>> >>>> [...] >>>> >>>>> @@ -1321,6 +1322,32 @@ static void samsung_dsim_atomic_post_disable(struct drm_bridge *bridge, >>>>> pm_runtime_put_sync(dsi->dev); >>>>> } >>>>> >>>>> +#define MAX_INPUT_SEL_FORMATS 1 >>>>> + >>>>> +static u32 * >>>>> +samsung_dsim_atomic_get_input_bus_fmts(struct drm_bridge *bridge, >>>>> + struct drm_bridge_state *bridge_state, >>>>> + struct drm_crtc_state *crtc_state, >>>>> + struct drm_connector_state *conn_state, >>>>> + u32 output_fmt, >>>>> + unsigned int *num_input_fmts) >>>>> +{ >>>>> + u32 *input_fmts; >>>>> + >>>>> + *num_input_fmts = 0; >>>>> + >>>>> + input_fmts = kcalloc(MAX_INPUT_SEL_FORMATS, sizeof(*input_fmts), >>>>> + GFP_KERNEL); >>>>> + if (!input_fmts) >>>>> + return NULL; >>>>> + >>>>> + /* This is the DSI-end bus format */ >>>>> + input_fmts[0] = MEDIA_BUS_FMT_RGB888_1X24; >>>>> + *num_input_fmts = 1; >>>> >>>> Is this the only supported format ? NXP AN13573 lists the following: >>>> >>>> i.MX 8/RT MIPI DSI/CSI-2, Rev. 0, 21 March 2022 >>>> 3.7.4 Pixel formats >>>> Table 14. DSI pixel packing formats >>>> >>>> Loosely Packed Pixel Stream, 20-bit YCbCr, 4:2:2 >>>> Packed Pixel Stream, 24-bit YCbCr, 4:2:2 >>>> Packed Pixel Stream, 16-bit YCbCr, 4:2:2 >>> >>> Look like these are unsupported in media-bus-format.h list. >> >> Aren't those: >> >> MEDIA_BUS_FMT_UYVY12_1X24 > > Why is UYVY12 - YCbCr, 4:2:2 is 4+2+2 = 8 then it has UYVY8 ? (someone please correct me if I'm totally wrong here) The 12 is channel width (12 bit for each Y1/Y2/U/V channel sample). The 4:2:2 is subsampling (where are the color components sampled relative to brightness component). Picture is here: https://upload.wikimedia.org/wikipedia/commons/f/f2/Common_chroma_subsampling_ratios.svg Each Y square of the left is 12bit sample. Each U+V square is 12bit sample for U and 12bit sample for V. In case of 4:4:4 subsampling, each luminance (brightness) component has matching chrominance (color) components. In case of the 4:2:2 subsampling, two neighboring luminance components share two chrominance components. To transfer one pixel including color information, you have to transfer two pixels, Y0+U as 2x12bit sample in one cycle of 24bit bus, and then Y1+V as 2x12bit sample in another cycle of 24bit bus (2 clock cycles total, 4 samples total). From that you can reconstruct the two top-left squares (purple pixels) in the rightmost YUV column of 4:2:2 row. The entire trick is that because eye is less sensitive to color than it is to light, you can transfer less color information and thus save bandwidth without anyone noticing (much of it). >> MEDIA_BUS_FMT_UYVY8_1X16 > > If YCbCr is UYVY (I still don't get this notation, sorry) then Packed > Pixel Stream, 24-bit YCbCr, 4:2:2 with 2 Pixels per packet from Table > 14 can be > > MEDIA_BUS_FMT_UYVY8_2X24 > (YCbCr 4:2:2 is UYVY8) > > " based on a reference example from media bus format doc > 4.13.3.4.1.1.3. Packed YUV Formats, For instance, a format where > pixels are encoded as 8-bit YUV values downsampled to 4:2:2 and > transferred as 2 8-bit bus samples per pixel in the U, Y, V, Y order > will be named MEDIA_BUS_FMT_UYVY8_2X8." The way I read the above is that the channel width of each channel is 8-bit , so you start with two pixels Y0/U/Y1/V which add up to 32bit total. That is transferred over 8-bit bus, in 4 bus cycles total. One pixel therefore takes 2 cycles of the 8 bit bus to transfer, even if you cannot transfer one pixel separately . > https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/subdev-formats.html > > _2X24 here 2 Pixels per packet is the exact packets to consider or we > can consider 1 Pixel per packet also. If later is true then _1X24 from > your notation is correct. Since the DSIM input bus is 32bit wide, to transfer one such 4:2:2 pixel, you need 1 bus cycle (2x12 bits per half of two pixels). [...]
Hi Marek, On Fri, Nov 4, 2022 at 12:28 AM Marek Vasut <marex@denx.de> wrote: > > On 11/3/22 18:27, Jagan Teki wrote: > > On Thu, Nov 3, 2022 at 9:56 PM Marek Vasut <marex@denx.de> wrote: > >> > >> On 11/3/22 10:39, Jagan Teki wrote: > >>> On Sun, Oct 16, 2022 at 3:31 AM Marek Vasut <marex@denx.de> wrote: > >>>> > >>>> On 10/5/22 17:13, Jagan Teki wrote: > >>>> > >>>> [...] > >>>> > >>>>> @@ -1321,6 +1322,32 @@ static void samsung_dsim_atomic_post_disable(struct drm_bridge *bridge, > >>>>> pm_runtime_put_sync(dsi->dev); > >>>>> } > >>>>> > >>>>> +#define MAX_INPUT_SEL_FORMATS 1 > >>>>> + > >>>>> +static u32 * > >>>>> +samsung_dsim_atomic_get_input_bus_fmts(struct drm_bridge *bridge, > >>>>> + struct drm_bridge_state *bridge_state, > >>>>> + struct drm_crtc_state *crtc_state, > >>>>> + struct drm_connector_state *conn_state, > >>>>> + u32 output_fmt, > >>>>> + unsigned int *num_input_fmts) > >>>>> +{ > >>>>> + u32 *input_fmts; > >>>>> + > >>>>> + *num_input_fmts = 0; > >>>>> + > >>>>> + input_fmts = kcalloc(MAX_INPUT_SEL_FORMATS, sizeof(*input_fmts), > >>>>> + GFP_KERNEL); > >>>>> + if (!input_fmts) > >>>>> + return NULL; > >>>>> + > >>>>> + /* This is the DSI-end bus format */ > >>>>> + input_fmts[0] = MEDIA_BUS_FMT_RGB888_1X24; > >>>>> + *num_input_fmts = 1; > >>>> > >>>> Is this the only supported format ? NXP AN13573 lists the following: > >>>> > >>>> i.MX 8/RT MIPI DSI/CSI-2, Rev. 0, 21 March 2022 > >>>> 3.7.4 Pixel formats > >>>> Table 14. DSI pixel packing formats > >>>> > >>>> Loosely Packed Pixel Stream, 20-bit YCbCr, 4:2:2 > >>>> Packed Pixel Stream, 24-bit YCbCr, 4:2:2 > >>>> Packed Pixel Stream, 16-bit YCbCr, 4:2:2 > >>> > >>> Look like these are unsupported in media-bus-format.h list. > >> > >> Aren't those: > >> > >> MEDIA_BUS_FMT_UYVY12_1X24 > > > > Why is UYVY12 - YCbCr, 4:2:2 is 4+2+2 = 8 then it has UYVY8 ? > > (someone please correct me if I'm totally wrong here) > > The 12 is channel width (12 bit for each Y1/Y2/U/V channel sample). > The 4:2:2 is subsampling (where are the color components sampled > relative to brightness component). > > Picture is here: > https://upload.wikimedia.org/wikipedia/commons/f/f2/Common_chroma_subsampling_ratios.svg > > Each Y square of the left is 12bit sample. > Each U+V square is 12bit sample for U and 12bit sample for V. > > In case of 4:4:4 subsampling, each luminance (brightness) component has > matching chrominance (color) components. > > In case of the 4:2:2 subsampling, two neighboring luminance components > share two chrominance components. To transfer one pixel including color > information, you have to transfer two pixels, Y0+U as 2x12bit sample in > one cycle of 24bit bus, and then Y1+V as 2x12bit sample in another cycle > of 24bit bus (2 clock cycles total, 4 samples total). From that you can > reconstruct the two top-left squares (purple pixels) in the rightmost > YUV column of 4:2:2 row. > > The entire trick is that because eye is less sensitive to color than it > is to light, you can transfer less color information and thus save > bandwidth without anyone noticing (much of it). > > >> MEDIA_BUS_FMT_UYVY8_1X16 > > > > If YCbCr is UYVY (I still don't get this notation, sorry) then Packed > > Pixel Stream, 24-bit YCbCr, 4:2:2 with 2 Pixels per packet from Table > > 14 can be > > > > MEDIA_BUS_FMT_UYVY8_2X24 > > (YCbCr 4:2:2 is UYVY8) > > > > " based on a reference example from media bus format doc > > 4.13.3.4.1.1.3. Packed YUV Formats, For instance, a format where > > pixels are encoded as 8-bit YUV values downsampled to 4:2:2 and > > transferred as 2 8-bit bus samples per pixel in the U, Y, V, Y order > > will be named MEDIA_BUS_FMT_UYVY8_2X8." > > The way I read the above is that the channel width of each channel is > 8-bit , so you start with two pixels Y0/U/Y1/V which add up to 32bit > total. That is transferred over 8-bit bus, in 4 bus cycles total. One > pixel therefore takes 2 cycles of the 8 bit bus to transfer, even if you > cannot transfer one pixel separately . > > > https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/subdev-formats.html > > > > _2X24 here 2 Pixels per packet is the exact packets to consider or we > > can consider 1 Pixel per packet also. If later is true then _1X24 from > > your notation is correct. > > Since the DSIM input bus is 32bit wide, to transfer one such 4:2:2 > pixel, you need 1 bus cycle (2x12 bits per half of two pixels). Thanks for your explanation. I need some time to understand and it looks worth waiting for others to comment on this. Meanwhile, I'm planning to send subsequent version patches with possible supported formats like, MEDIA_BUS_FMT_UYVY8_1X16, MEDIA_BUS_FMT_RGB101010_1X30, MEDIA_BUS_FMT_RGB121212_1X36, MEDIA_BUS_FMT_RGB565_1X16, MEDIA_BUS_FMT_RGB666_1X18, MEDIA_BUS_FMT_RGB888_1X24, Let me know. Jagan.
diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index 41970e794a7c..f714e49c1eab 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -15,6 +15,7 @@ #include <linux/clk.h> #include <linux/delay.h> #include <linux/irq.h> +#include <linux/media-bus-format.h> #include <linux/of_device.h> #include <linux/phy/phy.h> @@ -1321,6 +1322,32 @@ static void samsung_dsim_atomic_post_disable(struct drm_bridge *bridge, pm_runtime_put_sync(dsi->dev); } +#define MAX_INPUT_SEL_FORMATS 1 + +static u32 * +samsung_dsim_atomic_get_input_bus_fmts(struct drm_bridge *bridge, + struct drm_bridge_state *bridge_state, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state, + u32 output_fmt, + unsigned int *num_input_fmts) +{ + u32 *input_fmts; + + *num_input_fmts = 0; + + input_fmts = kcalloc(MAX_INPUT_SEL_FORMATS, sizeof(*input_fmts), + GFP_KERNEL); + if (!input_fmts) + return NULL; + + /* This is the DSI-end bus format */ + input_fmts[0] = MEDIA_BUS_FMT_RGB888_1X24; + *num_input_fmts = 1; + + return input_fmts; +} + static int samsung_dsim_atomic_check(struct drm_bridge *bridge, struct drm_bridge_state *bridge_state, struct drm_crtc_state *crtc_state, @@ -1384,6 +1411,7 @@ static const struct drm_bridge_funcs samsung_dsim_bridge_funcs = { .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, .atomic_reset = drm_atomic_helper_bridge_reset, + .atomic_get_input_bus_fmts = samsung_dsim_atomic_get_input_bus_fmts, .atomic_check = samsung_dsim_atomic_check, .atomic_pre_enable = samsung_dsim_atomic_pre_enable, .atomic_enable = samsung_dsim_atomic_enable,