devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sean Paul <sean@poorly.run>
To: Damian Kos <dkos@cadence.com>
Cc: Mark Rutland <mark.rutland@arm.com>,
	David Airlie <airlied@linux.ie>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	pgaj@cadence.com,
	Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
	quentin.schulz@bootlin.com, jartur@cadence.com,
	ltyrala@cadence.com, linux-rockchip@lists.infradead.org,
	piotrs@cadence.com, devicetree@vger.kernel.org,
	rafalc@cadence.com, jbergsagel@ti.com,
	Rob Herring <robh+dt@kernel.org>, Sean Paul <sean@poorly.run>,
	linux-arm-kernel@lists.infradead.org,
	Quentin Schulz <quentin.schulz@free-electrons.com>
Subject: Re: [PATCH v5 3/5] drm/dp: make dp_get_lane_status usable from outside of the core
Date: Fri, 28 Sep 2018 03:21:29 -0400	[thread overview]
Message-ID: <20180928072129.GX72545@art_vandelay> (raw)
In-Reply-To: <1537866837-4408-4-git-send-email-dkos@cadence.com>

On Tue, Sep 25, 2018 at 10:13:33AM +0100, Damian Kos wrote:
> From: Quentin Schulz <quentin.schulz@free-electrons.com>
> 
> dp_get_lane_status is pretty generic and can be used for other means,
> so let's make it "public".
> 
> This adds drm_dp_get_lane_status to the header file and add the appropriate
> EXPORT_SYMBOL for it so that it can be used by other drivers, be they compiled
> built-in or as modules.
> 
> Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com>
> Signed-off-by: Damian Kos <dkos@cadence.com>

Now that you've refactored mhdp_validate_cr(), you no longer need this patch.

Sean

> ---
>  drivers/gpu/drm/drm_dp_helper.c | 9 +++++----
>  include/drm/drm_dp_helper.h     | 2 ++
>  2 files changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
> index 735ebde5c2f0..169db52f92f5 100644
> --- a/drivers/gpu/drm/drm_dp_helper.c
> +++ b/drivers/gpu/drm/drm_dp_helper.c
> @@ -48,14 +48,15 @@ static u8 dp_link_status(const u8 link_status[DP_LINK_STATUS_SIZE], int r)
>  	return link_status[r - DP_LANE0_1_STATUS];
>  }
>  
> -static u8 dp_get_lane_status(const u8 link_status[DP_LINK_STATUS_SIZE],
> -			     int lane)
> +u8 drm_dp_get_lane_status(const u8 link_status[DP_LINK_STATUS_SIZE],
> +			  int lane)
>  {
>  	int i = DP_LANE0_1_STATUS + (lane >> 1);
>  	int s = (lane & 1) * 4;
>  	u8 l = dp_link_status(link_status, i);
>  	return (l >> s) & 0xf;
>  }
> +EXPORT_SYMBOL(drm_dp_get_lane_status);
>  
>  bool drm_dp_channel_eq_ok(const u8 link_status[DP_LINK_STATUS_SIZE],
>  			  int lane_count)
> @@ -69,7 +70,7 @@ bool drm_dp_channel_eq_ok(const u8 link_status[DP_LINK_STATUS_SIZE],
>  	if ((lane_align & DP_INTERLANE_ALIGN_DONE) == 0)
>  		return false;
>  	for (lane = 0; lane < lane_count; lane++) {
> -		lane_status = dp_get_lane_status(link_status, lane);
> +		lane_status = drm_dp_get_lane_status(link_status, lane);
>  		if ((lane_status & DP_CHANNEL_EQ_BITS) != DP_CHANNEL_EQ_BITS)
>  			return false;
>  	}
> @@ -84,7 +85,7 @@ bool drm_dp_clock_recovery_ok(const u8 link_status[DP_LINK_STATUS_SIZE],
>  	u8 lane_status;
>  
>  	for (lane = 0; lane < lane_count; lane++) {
> -		lane_status = dp_get_lane_status(link_status, lane);
> +		lane_status = drm_dp_get_lane_status(link_status, lane);
>  		if ((lane_status & DP_LANE_CR_DONE) == 0)
>  			return false;
>  	}
> diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
> index 698082a02b97..973d2fda9654 100644
> --- a/include/drm/drm_dp_helper.h
> +++ b/include/drm/drm_dp_helper.h
> @@ -952,6 +952,8 @@
>  #define DP_MST_LOGICAL_PORT_0 8
>  
>  #define DP_LINK_STATUS_SIZE	   6
> +
> +u8 drm_dp_get_lane_status(const u8 link_status[DP_LINK_STATUS_SIZE], int lane);
>  bool drm_dp_channel_eq_ok(const u8 link_status[DP_LINK_STATUS_SIZE],
>  			  int lane_count);
>  bool drm_dp_clock_recovery_ok(const u8 link_status[DP_LINK_STATUS_SIZE],
> -- 
> 2.17.1
> 

-- 
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2018-09-28  7:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-25  9:13 [PATCH v5 0/5] drm: add support for Cadence MHDP DPI/DP bridge Damian Kos
2018-09-25  9:13 ` [PATCH v5 1/5] drm/rockchip: prepare common code for cdns and rk dpi/dp driver Damian Kos
2018-09-25  9:13 ` [PATCH v5 2/5] drm/dp: fix link probing for devices supporting DP 1.4+ Damian Kos
2018-09-25 11:18   ` Heiko Stuebner
2018-09-25  9:13 ` [PATCH v5 3/5] drm/dp: make dp_get_lane_status usable from outside of the core Damian Kos
2018-09-28  7:21   ` Sean Paul [this message]
2018-09-25  9:13 ` [PATCH v5 4/5] dt-bindings: drm/bridge: Document Cadence MHDP bridge bindings Damian Kos
2018-09-27 17:38   ` Rob Herring
2018-09-25  9:13 ` [PATCH v5 5/5] drm: bridge: add support for Cadence MHDP DPI/DP bridge Damian Kos

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=20180928072129.GX72545@art_vandelay \
    --to=sean@poorly.run \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=airlied@linux.ie \
    --cc=devicetree@vger.kernel.org \
    --cc=dkos@cadence.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jartur@cadence.com \
    --cc=jbergsagel@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=ltyrala@cadence.com \
    --cc=mark.rutland@arm.com \
    --cc=pgaj@cadence.com \
    --cc=piotrs@cadence.com \
    --cc=quentin.schulz@bootlin.com \
    --cc=quentin.schulz@free-electrons.com \
    --cc=rafalc@cadence.com \
    --cc=robh+dt@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).