All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marius Vlad <marius.vlad@collabora.com>
To: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Cc: dri-devel@lists.freedesktop.org, wse@tuxedocomputers.com,
	andri@yngvason.is, sebastian.wick@redhat.com, mripard@kernel.org,
	daniel.stone@collabora.com, jani.nikula@linux.intel.com,
	tzimmermann@suse.de, simona.vetter@ffwll.ch,
	harry.wentland@amd.com, christian.koenig@amd.com,
	derek.foreman@collabora.com
Subject: Re: [PATCH 5/8] drm: Pass supported color formats straight onto drm_bridge
Date: Thu, 11 Sep 2025 20:34:48 +0300	[thread overview]
Message-ID: <aMMIOBfuQ7oJFH6i@xpredator> (raw)
In-Reply-To: <fekbw2ngxyg4mvkhlvkvegylcm4vm74y5rhhxeygiqxve7oqaj@sxvkyqjssdru>

[-- Attachment #1: Type: text/plain, Size: 5052 bytes --]

On Thu, Sep 11, 2025 at 04:55:29PM +0300, Dmitry Baryshkov wrote:
> On Thu, Sep 11, 2025 at 04:07:36PM +0300, Marius Vlad wrote:
> > Initialize drm_brige with advertised colors formats straight on.
> > 
> > Drivers that make use of DRM helpers would check the
> > drm_brige::supported_formats bit-field list and refuse to use the color
> > format passed. Drivers that make use of drm_bridge can pass the
> > supported color formats in the bridge as well as supported color format
> > for the DRM color format property.
> 
> Your commit message doesn't match patch contents. You are pushing format
> selection to the instance creating drm_bridge_connector, which
> frequently has no idea about the other end of the chain - the bridges
> which actually send pixel data to the monitor.

None of these changes in this patch actually perform a functional
change, it will just explicitly expose the fact that BIT(HDMI_COLORSPACE_RGB)
was embedded in drm_bridge_connector_init(). 

Commit description is a bit forthcoming explaining the rationale behind
the change. This actually allows the ability to pass a list of supported
formats the bridge itself, similar how do we do it with the connector.

If any of these are wrong, they were prior to me touching them.

> 
> We have drm_bridge::ycbcr_420_allowed with clearly defined meaning. I
> think it would be wise to start from that and to describe why such a
> field doesn't fulfill your needs.
Alright, I'll be looking into this. 
> 
> > 
> > This includes a fallback to RGB when Auto has been selected.
> > 
> > Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
> > ---
> >  drivers/gpu/drm/bridge/adv7511/adv7511_drv.c      | 2 +-
> >  drivers/gpu/drm/bridge/ite-it6263.c               | 2 +-
> >  drivers/gpu/drm/bridge/ti-sn65dsi86.c             | 3 ++-
> >  drivers/gpu/drm/display/drm_bridge_connector.c    | 4 ++--
> >  drivers/gpu/drm/imx/dcss/dcss-kms.c               | 2 +-
> >  drivers/gpu/drm/mediatek/mtk_dpi.c                | 2 +-
> >  drivers/gpu/drm/mediatek/mtk_dsi.c                | 2 +-
> >  drivers/gpu/drm/meson/meson_encoder_cvbs.c        | 3 ++-
> >  drivers/gpu/drm/meson/meson_encoder_hdmi.c        | 4 ++--
> >  drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c          | 2 +-
> >  drivers/gpu/drm/msm/dp/dp_drm.c                   | 3 ++-
> >  drivers/gpu/drm/msm/dsi/dsi_manager.c             | 2 +-
> >  drivers/gpu/drm/msm/hdmi/hdmi.c                   | 2 +-
> >  drivers/gpu/drm/renesas/rcar-du/rcar_du_encoder.c | 2 +-
> >  drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.c  | 2 +-
> >  drivers/gpu/drm/rockchip/cdn-dp-core.c            | 2 +-
> >  drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c    | 2 +-
> >  drivers/gpu/drm/rockchip/rockchip_lvds.c          | 2 +-
> >  drivers/gpu/drm/tegra/hdmi.c                      | 2 +-
> >  drivers/gpu/drm/tegra/rgb.c                       | 2 +-
> >  drivers/gpu/drm/tidss/tidss_encoder.c             | 2 +-
> >  include/drm/drm_bridge_connector.h                | 3 ++-
> >  22 files changed, 28 insertions(+), 24 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/msm/dp/dp_drm.c b/drivers/gpu/drm/msm/dp/dp_drm.c
> > index 9a461ab2f32f..8d5299849be6 100644
> > --- a/drivers/gpu/drm/msm/dp/dp_drm.c
> > +++ b/drivers/gpu/drm/msm/dp/dp_drm.c
> > @@ -368,7 +368,8 @@ struct drm_connector *msm_dp_drm_connector_init(struct msm_dp *msm_dp_display,
> >  {
> >  	struct drm_connector *connector = NULL;
> >  
> > -	connector = drm_bridge_connector_init(msm_dp_display->drm_dev, encoder);
> > +	connector = drm_bridge_connector_init(msm_dp_display->drm_dev, encoder,
> > +					      BIT(HDMI_COLORSPACE_RGB));
> 
> Just to point out: this is wrong.
Yeah, I understand why you're saying that just that I haven't really
modified these.
> 
> >  	if (IS_ERR(connector))
> >  		return connector;
> >  
> > diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c
> > index ca400924d4ee..4b87f4f78d38 100644
> > --- a/drivers/gpu/drm/msm/dsi/dsi_manager.c
> > +++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c
> > @@ -479,7 +479,7 @@ int msm_dsi_manager_connector_init(struct msm_dsi *msm_dsi,
> >  	if (ret)
> >  		return ret;
> >  
> > -	connector = drm_bridge_connector_init(dev, encoder);
> > +	connector = drm_bridge_connector_init(dev, encoder, BIT(HDMI_COLORSPACE_RGB));
> 
> And this totally depends on the bridge chain. If we have a DSI-to-HDMI
> bridge somewhere in the middle, we are able to output YUV data to the
> HDMI connector.
That's actually the usecase for this patch: to allow passing other color
formats, but this patch is a transitory patch to further expose the fact
drm_bridge_connector_init was embedding BIT(HDMI_COLORSPACE_RGB) for the
format. See rockchip implementation for this bit, the last patch in this
series.
> 
> >  	if (IS_ERR(connector)) {
> >  		DRM_ERROR("Unable to create bridge connector\n");
> >  		return PTR_ERR(connector);
> 
> -- 
> With best wishes
> Dmitry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2025-09-11 17:34 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-11 13:07 [PATCH v3 0/8] Add new general DRM property "color format" Marius Vlad
2025-09-11 13:07 ` [PATCH 1/8] drm/amd/display: Remove unnecessary SIGNAL_TYPE_HDMI_TYPE_A check Marius Vlad
2025-09-11 13:07 ` [PATCH 2/8] hdmi: Add HDMI_COLORSPACE_AUTO enum option Marius Vlad
2025-09-12 15:17   ` Maxime Ripard
2025-09-12 18:39     ` Marius Vlad
2025-09-17 14:42       ` Maxime Ripard
2025-09-11 13:07 ` [PATCH 3/8] drm: Add new general DRM property "color format" Marius Vlad
2025-09-11 13:50   ` Dmitry Baryshkov
2025-09-11 17:15     ` Marius Vlad
2025-09-15  0:57       ` Dmitry Baryshkov
2025-09-15 10:33         ` Daniel Stone
2025-09-15 10:46           ` Dmitry Baryshkov
2025-09-16 11:04             ` Daniel Stone
2025-09-16  8:29           ` Maxime Ripard
2025-09-16 10:46             ` Daniel Stone
2025-09-16 10:48               ` Daniel Stone
2025-09-16 10:57                 ` Dmitry Baryshkov
2025-09-16 11:11                   ` Daniel Stone
2025-09-16 11:15                     ` Dmitry Baryshkov
2025-09-16 11:35                       ` Daniel Stone
2025-09-16 16:13                         ` Dmitry Baryshkov
2025-09-11 13:07 ` [PATCH 4/8] drm: Add enum conversion from/to HDMI_COLORSPACE to DRM_COLOR_FORMAT Marius Vlad
2025-09-12 15:19   ` Maxime Ripard
2025-09-26 14:50     ` Cristian Ciocaltea
2025-09-30 11:40       ` Maxime Ripard
2025-09-11 13:07 ` [PATCH 5/8] drm: Pass supported color formats straight onto drm_bridge Marius Vlad
2025-09-11 13:55   ` Dmitry Baryshkov
2025-09-11 17:34     ` Marius Vlad [this message]
2025-09-12 15:31       ` Maxime Ripard
2025-09-12 18:57         ` Marius Vlad
2025-09-12 21:17           ` Dmitry Baryshkov
2025-09-12 15:33   ` Maxime Ripard
2025-09-12 19:09     ` Marius Vlad
2025-09-15  0:59       ` Dmitry Baryshkov
2025-09-11 13:07 ` [PATCH 6/8] drm/i915: Implement the "color format" DRM property Marius Vlad
2025-09-11 13:07 ` [PATCH 7/8] drm/amdgpu: Implement " Marius Vlad
2025-09-11 13:07 ` [PATCH 8/8] drm/rockchip: " Marius Vlad
2025-09-26 17:58   ` Cristian Ciocaltea

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aMMIOBfuQ7oJFH6i@xpredator \
    --to=marius.vlad@collabora.com \
    --cc=andri@yngvason.is \
    --cc=christian.koenig@amd.com \
    --cc=daniel.stone@collabora.com \
    --cc=derek.foreman@collabora.com \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=harry.wentland@amd.com \
    --cc=jani.nikula@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=sebastian.wick@redhat.com \
    --cc=simona.vetter@ffwll.ch \
    --cc=tzimmermann@suse.de \
    --cc=wse@tuxedocomputers.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.