mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Aradhya Bhatia <a-bhatia1@ti.com>
To: Tomi Valkeinen <tomba@kernel.org>, Jyri Sarha <jyri.sarha@iki.fi>,
	David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Andrzej Hajda <andrzej.hajda@intel.com>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Robert Foss <rfoss@kernel.org>, Jonas Karlman <jonas@kwiboo.se>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Rahul T R <r-ravikumar@ti.com>,
	Swapnil Jakhade <sjakhade@cadence.com>,
	Boris Brezillon <boris.brezillon@collabora.com>,
	Francesco Dolcini <francesco@dolcini.it>
Cc: DRI Development List <dri-devel@lists.freedesktop.org>,
	Linux Kernel List <linux-kernel@vger.kernel.org>,
	Nishanth Menon <nm@ti.com>, Vignesh Raghavendra <vigneshr@ti.com>,
	Devarsh Thakkar <devarsht@ti.com>,
	Jayesh Choudhary <j-choudhary@ti.com>,
	Aradhya Bhatia <a-bhatia1@ti.com>
Subject: [PATCH v6 1/8] drm/bridge: tfp410: Support format negotiation hooks
Date: Tue, 9 May 2023 15:00:29 +0530	[thread overview]
Message-ID: <20230509093036.3303-2-a-bhatia1@ti.com> (raw)
In-Reply-To: <20230509093036.3303-1-a-bhatia1@ti.com>

From: Nikhil Devshatwar <nikhil.nd@ti.com>

With new connector model, tfp410 will not create the connector and
SoC driver will rely on format negotiation to setup the encoder format.

Support format negotiations hooks in the drm_bridge_funcs.
Use helper functions for state management.

Input format is the one selected by the bridge from DT properties.

Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
[a-bhatia1: Removed output fmt condition check]
Signed-off-by: Aradhya Bhatia <a-bhatia1@ti.com>
---

Notes:
    changes from v1:
    * Use only MEDIA_BUS_FMT_FIXED for output

    changes from V5:
    * Dropped the output format check condition because the output
      format for HDMI bridges should be RGB888_1X24 and not FIXED.
      Hence, also dropped Tomi Valkeinen's and Laurent Pinchart's
      R-b tags.

 drivers/gpu/drm/bridge/ti-tfp410.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/drivers/gpu/drm/bridge/ti-tfp410.c b/drivers/gpu/drm/bridge/ti-tfp410.c
index ab63225cd635..7dacc7e03eee 100644
--- a/drivers/gpu/drm/bridge/ti-tfp410.c
+++ b/drivers/gpu/drm/bridge/ti-tfp410.c
@@ -206,12 +206,38 @@ static enum drm_mode_status tfp410_mode_valid(struct drm_bridge *bridge,
 	return MODE_OK;
 }
 
+static u32 *tfp410_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)
+{
+	struct tfp410 *dvi = drm_bridge_to_tfp410(bridge);
+	u32 *input_fmts;
+
+	*num_input_fmts = 0;
+
+	input_fmts = kzalloc(sizeof(*input_fmts), GFP_KERNEL);
+	if (!input_fmts)
+		return NULL;
+
+	*num_input_fmts = 1;
+	input_fmts[0] = dvi->bus_format;
+
+	return input_fmts;
+}
+
 static const struct drm_bridge_funcs tfp410_bridge_funcs = {
 	.attach		= tfp410_attach,
 	.detach		= tfp410_detach,
 	.enable		= tfp410_enable,
 	.disable	= tfp410_disable,
 	.mode_valid	= tfp410_mode_valid,
+	.atomic_reset = drm_atomic_helper_bridge_reset,
+	.atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state,
+	.atomic_destroy_state = drm_atomic_helper_bridge_destroy_state,
+	.atomic_get_input_bus_fmts = tfp410_get_input_bus_fmts,
 };
 
 static const struct drm_bridge_timings tfp410_default_timings = {
-- 
2.40.1


  reply	other threads:[~2023-05-09  9:31 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-09  9:30 [PATCH v6 0/8] drm/tidss: Use new connector model for tidss Aradhya Bhatia
2023-05-09  9:30 ` Aradhya Bhatia [this message]
2023-05-09  9:30 ` [PATCH v6 2/8] drm/bridge: tfp410: Set input_bus_flags in atomic_check Aradhya Bhatia
2023-05-16  7:25   ` Neil Armstrong
2023-05-16 14:27     ` Aradhya Bhatia
2023-05-09  9:30 ` [PATCH v6 3/8] drm/bridge: mhdp8546: Add minimal format negotiation Aradhya Bhatia
2023-05-12  9:15   ` Tomi Valkeinen
2023-05-15 15:59     ` Aradhya Bhatia
2023-05-16  7:21       ` Neil Armstrong
2023-05-16 14:25         ` Aradhya Bhatia
2023-05-26  9:29           ` Tomi Valkeinen
2023-05-29  5:37             ` Aradhya Bhatia
2023-05-29 11:12               ` Tomi Valkeinen
2023-05-09  9:30 ` [PATCH v6 4/8] drm/bridge: mhdp8546: Set input_bus_flags from atomic_check Aradhya Bhatia
2023-05-16  7:24   ` Neil Armstrong
2023-05-17  5:48     ` Aradhya Bhatia
2023-05-22  8:05       ` neil.armstrong
2023-05-23  5:57         ` Aradhya Bhatia
2023-05-09  9:30 ` [PATCH v6 5/8] drm/bridge: sii902x: Support format negotiation hooks Aradhya Bhatia
2023-05-16  7:16   ` Neil Armstrong
2023-05-09  9:30 ` [PATCH v6 6/8] drm/bridge: sii902x: Set input_bus_flags in atomic_check Aradhya Bhatia
2023-05-16  7:24   ` Neil Armstrong
2023-05-09  9:30 ` [PATCH v6 7/8] drm/tidss: Update encoder/bridge chain connect model Aradhya Bhatia
2023-05-09  9:30 ` [PATCH v6 8/8] drm/bridge: cdns-mhdp8546: Fix the interrupt enable/disable Aradhya Bhatia
2023-05-12  9:20 ` [PATCH v6 0/8] drm/tidss: Use new connector model for tidss Tomi Valkeinen

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=20230509093036.3303-2-a-bhatia1@ti.com \
    --to=a-bhatia1@ti.com \
    --cc=airlied@gmail.com \
    --cc=andrzej.hajda@intel.com \
    --cc=boris.brezillon@collabora.com \
    --cc=daniel@ffwll.ch \
    --cc=devarsht@ti.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=francesco@dolcini.it \
    --cc=j-choudhary@ti.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=jyri.sarha@iki.fi \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=nm@ti.com \
    --cc=r-ravikumar@ti.com \
    --cc=rfoss@kernel.org \
    --cc=sjakhade@cadence.com \
    --cc=tomba@kernel.org \
    --cc=vigneshr@ti.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®