All of lore.kernel.org
 help / color / mirror / Atom feed
From: Biju Das <biju.das.jz@bp.renesas.com>
To: cip-dev@lists.cip-project.org,
	Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>,
	Pavel Machek <pavel@denx.de>
Cc: Chris Paterson <chris.paterson2@renesas.com>,
	Biju Das <biju.das.jz@bp.renesas.com>,
	Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>
Subject: [cip-dev] [PATCH 4.19.y-cip 05/17] drm: rcar-du: Skip LVDS1 output on Gen3 when using dual-link LVDS mode
Date: Wed, 22 Jul 2020 17:34:37 +0100	[thread overview]
Message-ID: <20200722163449.3513-6-biju.das.jz@bp.renesas.com> (raw)
In-Reply-To: <20200722163449.3513-1-biju.das.jz@bp.renesas.com>

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

From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

commit 8e8fddab0d0acdefb1ad76852d954b2bbaa3896d upstream.

In dual-link LVDS mode, the LVDS1 encoder is used as a companion for
LVDS0, and both encoders transmit data from DU0. The LVDS1 output of DU1
can't be used in that case, don't create an encoder and connector for
it.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Tested-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
 drivers/gpu/drm/rcar-du/rcar_du_encoder.c | 12 ++++++++++++
 drivers/gpu/drm/rcar-du/rcar_du_kms.c     |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/rcar-du/rcar_du_encoder.c b/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
index 5cca7f7aacd8..de8fe74c0362 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
@@ -21,6 +21,7 @@
 #include "rcar_du_drv.h"
 #include "rcar_du_encoder.h"
 #include "rcar_du_kms.h"
+#include "rcar_lvds.h"
 
 /* -----------------------------------------------------------------------------
  * Encoder
@@ -60,6 +61,17 @@ int rcar_du_encoder_init(struct rcar_du_device *rcdu,
 		goto done;
 	}
 
+	/*
+	 * On Gen3 skip the LVDS1 output if the LVDS1 encoder is used as a
+	 * companion for LVDS0 in dual-link mode.
+	 */
+	if (rcdu->info->gen >= 3 && output == RCAR_DU_OUTPUT_LVDS1) {
+		if (rcar_lvds_dual_link(bridge)) {
+			ret = -ENOLINK;
+			goto done;
+		}
+	}
+
 	ret = drm_encoder_init(rcdu->ddev, encoder, &encoder_funcs,
 			       DRM_MODE_ENCODER_NONE, NULL);
 	if (ret < 0)
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_kms.c b/drivers/gpu/drm/rcar-du/rcar_du_kms.c
index 3257aca39a65..5cf0331defd4 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_kms.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_kms.c
@@ -380,7 +380,7 @@ static int rcar_du_encoders_init_one(struct rcar_du_device *rcdu,
 	}
 
 	ret = rcar_du_encoder_init(rcdu, output, entity);
-	if (ret && ret != -EPROBE_DEFER)
+	if (ret && ret != -EPROBE_DEFER && ret != -ENOLINK)
 		dev_warn(rcdu->dev,
 			 "failed to initialize encoder %pOF on output %u (%d), skipping\n",
 			 entity, output, ret);
-- 
2.17.1


[-- Attachment #2: Type: text/plain, Size: 419 bytes --]

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#4966): https://lists.cip-project.org/g/cip-dev/message/4966
Mute This Topic: https://lists.cip-project.org/mt/75730028/4520388
Group Owner: cip-dev+owner@lists.cip-project.org
Unsubscribe: https://lists.cip-project.org/g/cip-dev/leave/8129055/727948398/xyzzy  [cip-dev@archiver.kernel.org]
-=-=-=-=-=-=-=-=-=-=-=-

  parent reply	other threads:[~2020-07-22 17:47 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-22 16:34 [cip-dev] [PATCH 4.19.y-cip 00/17] Add RZ/G2E Dual LVDS display Biju Das
2020-07-22 16:34 ` [cip-dev] [PATCH 4.19.y-cip 01/17] drm: rcar-du: lvds: Remove LVDS double-enable checks Biju Das
2020-07-22 16:34 ` [cip-dev] [PATCH 4.19.y-cip 02/17] drm: bridge: Add dual_link field to the drm_bridge_timings structure Biju Das
2020-07-22 16:34 ` [cip-dev] [PATCH 4.19.y-cip 03/17] dt-bindings: display: renesas: lvds: Add renesas,companion property Biju Das
2020-07-22 16:34 ` [cip-dev] [PATCH 4.19.y-cip 04/17] drm: rcar-du: lvds: Add support for dual-link mode Biju Das
2020-07-22 16:34 ` Biju Das [this message]
2020-07-22 16:34 ` [cip-dev] [PATCH 4.19.y-cip 06/17] drm: rcar_lvds: Fix dual link mode operations Biju Das
2020-07-22 16:34 ` [cip-dev] [PATCH 4.19.y-cip 07/17] drm: Add drm_atomic_get_(old|new)_connector_for_encoder() helpers Biju Das
2020-07-22 16:34 ` [cip-dev] [PATCH 4.19.y-cip 08/17] drm: Add atomic variants for bridge enable/disable Biju Das
2020-07-22 16:34 ` [cip-dev] [PATCH 4.19.y-cip 09/17] drm: rcar-du: lvds: Get mode from state Biju Das
2020-07-22 16:34 ` [cip-dev] [PATCH 4.19.y-cip 10/17] drm: rcar-du: lvds: Improve identification of panels Biju Das
2020-07-22 16:34 ` [cip-dev] [PATCH 4.19.y-cip 11/17] drm: of: Add drm_of_lvds_get_dual_link_pixel_order Biju Das
2020-07-22 21:38   ` Pavel Machek
2020-07-23  6:56     ` Biju Das
2020-07-22 16:34 ` [cip-dev] [PATCH 4.19.y-cip 12/17] drm: rcar-du: lvds: Get dual link configuration from DT Biju Das
2020-07-22 16:34 ` [cip-dev] [PATCH 4.19.y-cip 13/17] drm: rcar-du: lvds: Allow for even and odd pixels swap Biju Das
2020-07-22 16:34 ` [cip-dev] [PATCH 4.19.y-cip 14/17] arm64: dts: renesas: r8a774c0: Point LVDS0 to its companion LVDS1 Biju Das
2020-07-22 16:34 ` [cip-dev] [PATCH 4.19.y-cip 15/17] arm64: dts: renesas: rzg2: Add reset control properties for display Biju Das
2020-07-22 16:34 ` [cip-dev] [PATCH 4.19.y-cip 16/17] dt-bindings: display: Add idk-2121wr binding Biju Das
2020-07-22 16:34 ` [cip-dev] [PATCH 4.19.y-cip 17/17] arm64: dts: renesas: Add EK874 board with idk-2121wr display support Biju Das
2020-07-22 21:49 ` [cip-dev] [PATCH 4.19.y-cip 00/17] Add RZ/G2E Dual LVDS display Pavel Machek
2020-07-24  7:30   ` Pavel Machek

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=20200722163449.3513-6-biju.das.jz@bp.renesas.com \
    --to=biju.das.jz@bp.renesas.com \
    --cc=chris.paterson2@renesas.com \
    --cc=cip-dev@lists.cip-project.org \
    --cc=nobuhiro1.iwamatsu@toshiba.co.jp \
    --cc=pavel@denx.de \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.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.