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 13/37] drm: xlnx: zynqmp_dpsub: Don't pass CRTC to zynqmp_disp_setup_clock()
Date: Thu, 29 Sep 2022 01:46:55 +0300	[thread overview]
Message-ID: <20220928224719.3291-14-laurent.pinchart@ideasonboard.com> (raw)
In-Reply-To: <20220928224719.3291-1-laurent.pinchart@ideasonboard.com>

To prepare for usage of the clock setup function outside of the CRTC
code, replace the DRM-specific structures passed as parameters with a
pointer to the zynqmp_disp and the requested clock rate. This doesn't
introduce any functional change.

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

diff --git a/drivers/gpu/drm/xlnx/zynqmp_disp.c b/drivers/gpu/drm/xlnx/zynqmp_disp.c
index eae28a3c6d45..14ecc58f5470 100644
--- a/drivers/gpu/drm/xlnx/zynqmp_disp.c
+++ b/drivers/gpu/drm/xlnx/zynqmp_disp.c
@@ -1410,16 +1410,9 @@ static void zynqmp_disp_disable(struct zynqmp_disp *disp)
 	zynqmp_disp_avbuf_disable(disp);
 }
 
-static inline struct zynqmp_disp *crtc_to_disp(struct drm_crtc *crtc)
+static int zynqmp_disp_setup_clock(struct zynqmp_disp *disp,
+				   unsigned long mode_clock)
 {
-	return container_of(crtc, struct zynqmp_disp, crtc);
-}
-
-static int zynqmp_disp_crtc_setup_clock(struct drm_crtc *crtc,
-					struct drm_display_mode *adjusted_mode)
-{
-	struct zynqmp_disp *disp = crtc_to_disp(crtc);
-	unsigned long mode_clock = adjusted_mode->clock * 1000;
 	unsigned long rate;
 	long diff;
 	int ret;
@@ -1444,6 +1437,11 @@ static int zynqmp_disp_crtc_setup_clock(struct drm_crtc *crtc,
 	return 0;
 }
 
+static inline struct zynqmp_disp *crtc_to_disp(struct drm_crtc *crtc)
+{
+	return container_of(crtc, struct zynqmp_disp, crtc);
+}
+
 static void
 zynqmp_disp_crtc_atomic_enable(struct drm_crtc *crtc,
 			       struct drm_atomic_state *state)
@@ -1454,7 +1452,7 @@ zynqmp_disp_crtc_atomic_enable(struct drm_crtc *crtc,
 
 	pm_runtime_get_sync(disp->dev);
 
-	zynqmp_disp_crtc_setup_clock(crtc, adjusted_mode);
+	zynqmp_disp_setup_clock(disp, adjusted_mode->clock * 1000);
 
 	ret = clk_prepare_enable(disp->pclk);
 	if (ret) {
-- 
Regards,

Laurent Pinchart


  parent reply	other threads:[~2022-09-28 22:48 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 ` [PATCH v2 05/37] drm: xlnx: zynqmp_dpsub: Don't access connector in zynqmp_dp_set_format() Laurent Pinchart
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 ` Laurent Pinchart [this message]
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-14-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.