All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: dri-devel@lists.freedesktop.org
Cc: Michal Simek <michal.simek@xilinx.com>,
	Jianqiang Chen <jianqian@xilinx.com>
Subject: [PATCH v2 05/37] drm: xlnx: zynqmp_dpsub: Don't access connector in zynqmp_dp_set_format()
Date: Thu, 29 Sep 2022 01:46:47 +0300	[thread overview]
Message-ID: <20220928224719.3291-6-laurent.pinchart@ideasonboard.com> (raw)
In-Reply-To: <20220928224719.3291-1-laurent.pinchart@ideasonboard.com>

To prepare for the removal of the connector from the DP encoder, pass
the display info pointer to the zynqmp_dp_set_format() function instead
of accessing the connector internally. The display info is NULL when the
function is called at initialization time, as we have no display info at
that point. This doesn't change the existing behaviour, given that the
zynqmp_dp_set_format() was already handling this as a special case (the
display info isn't initialized at init time and is all zeroes).

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/gpu/drm/xlnx/zynqmp_dp.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/xlnx/zynqmp_dp.c b/drivers/gpu/drm/xlnx/zynqmp_dp.c
index 8acd5cfbbd1d..ca566553e547 100644
--- a/drivers/gpu/drm/xlnx/zynqmp_dp.c
+++ b/drivers/gpu/drm/xlnx/zynqmp_dp.c
@@ -1109,6 +1109,7 @@ static void zynqmp_dp_update_misc(struct zynqmp_dp *dp)
 /**
  * zynqmp_dp_set_format - Set the input format
  * @dp: DisplayPort IP core structure
+ * @info: Display info
  * @format: input format
  * @bpc: bits per component
  *
@@ -1117,10 +1118,10 @@ static void zynqmp_dp_update_misc(struct zynqmp_dp *dp)
  * Return: 0 on success, or -EINVAL.
  */
 static int zynqmp_dp_set_format(struct zynqmp_dp *dp,
+				const struct drm_display_info *info,
 				enum zynqmp_dpsub_format format,
 				unsigned int bpc)
 {
-	static const struct drm_display_info *display;
 	struct zynqmp_dp_config *config = &dp->config;
 	unsigned int num_colors;
 
@@ -1153,12 +1154,11 @@ static int zynqmp_dp_set_format(struct zynqmp_dp *dp,
 		return -EINVAL;
 	}
 
-	display = &dp->connector.display_info;
-	if (display->bpc && bpc > display->bpc) {
+	if (info && info->bpc && bpc > info->bpc) {
 		dev_warn(dp->dev,
 			 "downgrading requested %ubpc to display limit %ubpc\n",
-			 bpc, display->bpc);
-		bpc = display->bpc;
+			 bpc, info->bpc);
+		bpc = info->bpc;
 	}
 
 	config->misc0 &= ~ZYNQMP_DP_MAIN_STREAM_MISC0_BPC_MASK;
@@ -1353,7 +1353,8 @@ static void zynqmp_dp_bridge_atomic_enable(struct drm_bridge *bridge,
 	adjusted_mode = &crtc_state->adjusted_mode;
 	mode = &crtc_state->mode;
 
-	zynqmp_dp_set_format(dp, ZYNQMP_DPSUB_FORMAT_RGB, 8);
+	zynqmp_dp_set_format(dp, &connector->display_info,
+			     ZYNQMP_DPSUB_FORMAT_RGB, 8);
 
 	/* Check again as bpp or format might have been changed */
 	rate = zynqmp_dp_max_rate(dp->link_config.max_rate,
@@ -1714,7 +1715,7 @@ int zynqmp_dp_drm_init(struct zynqmp_dpsub *dpsub)
 	int ret;
 
 	dp->config.misc0 &= ~ZYNQMP_DP_MAIN_STREAM_MISC0_SYNC_LOCK;
-	zynqmp_dp_set_format(dp, ZYNQMP_DPSUB_FORMAT_RGB, 8);
+	zynqmp_dp_set_format(dp, NULL, ZYNQMP_DPSUB_FORMAT_RGB, 8);
 
 	/*
 	 * Initialize the bridge. Setting the device and encoder manually is a
-- 
Regards,

Laurent Pinchart


  parent reply	other threads:[~2022-09-28 22:47 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-28 22:46 [PATCH v2 00/37] drm: xlnx: zynqmp_dpsub: Initial live video input support Laurent Pinchart
2022-09-28 22:46 ` Laurent Pinchart
2022-09-28 22:46 ` [PATCH v2 01/37] dt-bindings: display: xlnx: zynqmp-dpsub: Add OF graph ports Laurent Pinchart
2022-09-28 22:46   ` Laurent Pinchart
2022-09-28 22:46 ` [PATCH v2 02/37] drm: xlnx: zynqmp_dpsub: Switch to atomic encoder enable/disable Laurent Pinchart
2022-09-28 22:46 ` [PATCH v2 03/37] drm: xlnx: zynqmp_dpsub: Constify mode argument to function Laurent Pinchart
2022-09-28 22:46 ` [PATCH v2 04/37] drm: xlnx: zynqmp_dpsub: Create DRM bridge to model DP encoder Laurent Pinchart
2022-09-28 22:46 ` Laurent Pinchart [this message]
2022-09-28 22:46 ` [PATCH v2 06/37] drm: xlnx: zynqmp_dpsub: Move connector registration to bridge attach Laurent Pinchart
2022-09-28 22:46 ` [PATCH v2 07/37] drm: xlnx: zynqmp_dpsub: Move encoder to DPSUB core Laurent Pinchart
2022-09-28 22:46 ` [PATCH v2 08/37] drm: xlnx: zynqmp_dpsub: Attach to the next bridge Laurent Pinchart
2022-09-28 22:46 ` [PATCH v2 09/37] drm: xlnx: zynqmp_dpsub: Use DRM connector bridge helper Laurent Pinchart
2022-09-28 22:46 ` [PATCH v2 10/37] drm: xlnx: zynqmp_dpsub: Report HPD through the bridge Laurent Pinchart
2022-09-28 22:46 ` [PATCH v2 11/37] drm: xlnx: zynqmp_dpsub: Drop unused zynqmp_disp.event field Laurent Pinchart
2022-09-28 22:46 ` [PATCH v2 12/37] drm: xlnx: zynqmp_dpsub: Drop unused zynqmp_disp_format.bus_fmt field Laurent Pinchart
2022-09-28 22:46 ` [PATCH v2 13/37] drm: xlnx: zynqmp_dpsub: Don't pass CRTC to zynqmp_disp_setup_clock() Laurent Pinchart
2022-09-28 22:46 ` [PATCH v2 14/37] drm: xlnx: zynqmp_dpsub: Configure blender in zynqmp_disp_enable() Laurent Pinchart
2022-09-28 22:46 ` [PATCH v2 15/37] drm: xlnx: zynqmp_dpsub: Use local variable in zynqmp_disp_layer_update() Laurent Pinchart
2022-09-28 22:46 ` [PATCH v2 16/37] drm: xlnx: zynqmp_dpsub: Pass format info to zynqmp_disp_layer_set_format() Laurent Pinchart
2022-09-28 22:46 ` [PATCH v2 17/37] drm: xlnx: zynqmp_dpsub: Remplace hardcoded values with ARRAY_SIZE() Laurent Pinchart
2022-09-28 22:47 ` [PATCH v2 18/37] drm: xlnx: zynqmp_dpsub: Don't use drmm_kcalloc() for temporary data Laurent Pinchart
2022-09-28 22:47 ` [PATCH v2 19/37] drm: xlnx: zynqmp_dpsub: Move pclk from zynqmp_disp to zynqmp_dpsub Laurent Pinchart
2022-09-28 22:47 ` [PATCH v2 20/37] drm: xlnx: zynqmp_dpsub: Move audio clk " Laurent Pinchart
2022-09-28 22:47 ` [PATCH v2 21/37] drm: xlnx: zynqmp_dpsub: Move CRTC to zynqmp_dpsub structure Laurent Pinchart
2022-09-28 22:47 ` [PATCH v2 22/37] drm: xlnx: zynqmp_dpsub: Move planes " Laurent Pinchart
2022-09-28 22:47 ` [PATCH v2 23/37] drm: xlnx: zynqmp_dpsub: Move DRM/KMS initialization to separate file Laurent Pinchart
2022-09-28 22:47 ` [PATCH v2 24/37] drm: xlnx: zynqmp_dpsub: Move CRTC handling to zynqmp_kms.c Laurent Pinchart
2022-09-28 22:47 ` [PATCH v2 25/37] drm: xlnx: zynqmp_dpsub: Move planes " Laurent Pinchart
2022-09-28 22:47 ` [PATCH v2 26/37] drm: xlnx: zynqmp_dpsub: Register AUX bus at bridge attach time Laurent Pinchart
2022-09-28 22:47 ` [PATCH v2 27/37] drm: xlnx: zynqmp_dpsub: Move DP bridge init to zynqmp_dp_probe() Laurent Pinchart
2022-09-28 22:47 ` [PATCH v2 28/37] drm: xlnx: zynqmp_dpsub: Manage DP and DISP allocations manually Laurent Pinchart
2022-09-28 22:47 ` [PATCH v2 29/37] drm: xlnx: zynqmp_dpsub: Move all DRM init and cleanup to zynqmp_kms.c Laurent Pinchart
2022-09-28 22:47 ` [PATCH v2 30/37] drm: xlnx: zynqmp_dpsub: Decouple DRM device from zynqmp_dpsub Laurent Pinchart
2022-09-28 22:47 ` [PATCH v2 31/37] drm: xlnx: zynqmp_dpsub: Rename zynqmp_dpsub_handle_vblank with DRM prefix Laurent Pinchart
2022-09-28 22:47 ` [PATCH v2 32/37] drm: xlnx: zynqmp_dpsub: Parse DT to find connected ports Laurent Pinchart
2022-09-28 22:47 ` [PATCH v2 33/37] drm: xlnx: zynqmp_dpsub: Allow configuration of layer mode Laurent Pinchart
2022-09-28 22:47 ` [PATCH v2 34/37] drm: xlnx: zynqmp_dpsub: Support operation without DMA engine Laurent Pinchart
2022-09-28 22:47 ` [PATCH v2 35/37] drm: xlnx: zynqmp_dpsub: Add support for live video input Laurent Pinchart
2022-09-28 22:47 ` [PATCH v2 36/37] arm64: dts: zynqmp: Add ports for the DisplayPort subsystem Laurent Pinchart
2022-09-28 22:47   ` Laurent Pinchart
2022-10-19 15:59   ` Laurent Pinchart
2022-10-20  6:50     ` Michal Simek
2022-10-20  6:50       ` Michal Simek
2022-09-28 22:47 ` [PATCH v2 37/37] arm64: dts: zynqmp: zcu106a: Describe DisplayPort connector Laurent Pinchart
2022-09-28 22:47   ` Laurent Pinchart

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=20220928224719.3291-6-laurent.pinchart@ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jianqian@xilinx.com \
    --cc=michal.simek@xilinx.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.