From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 3/3] drm/i915/psr: Move sink-crc to intel_psr.c
Date: Tue, 24 Apr 2018 13:56:40 -0700 [thread overview]
Message-ID: <20180424205640.GH1994@intel.com> (raw)
In-Reply-To: <20180424025659.23659-3-dhinakaran.pandiyan@intel.com>
On Mon, Apr 23, 2018 at 07:56:59PM -0700, Dhinakaran Pandiyan wrote:
> With sink-crc now being relevant only for PSR static frames, move the
> code to intel_psr.c and rename the function.
>
> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
> drivers/gpu/drm/i915/i915_debugfs.c | 4 ++--
> drivers/gpu/drm/i915/intel_dp.c | 35 -----------------------------------
> drivers/gpu/drm/i915/intel_drv.h | 2 +-
> drivers/gpu/drm/i915/intel_psr.c | 35 +++++++++++++++++++++++++++++++++++
> 4 files changed, 38 insertions(+), 38 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 35fa1418cc07..9913258e20ed 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -2784,7 +2784,7 @@ static int i915_sink_crc(struct seq_file *m, void *data)
>
> intel_dp = enc_to_intel_dp(state->best_encoder);
>
> - ret = intel_dp_sink_crc(intel_dp, crc);
> + ret = intel_psr_sink_crc(intel_dp, crc);
> if (ret)
> goto err;
>
> @@ -4854,7 +4854,7 @@ static const struct drm_info_list i915_debugfs_list[] = {
> {"i915_ppgtt_info", i915_ppgtt_info, 0},
> {"i915_llc", i915_llc, 0},
> {"i915_edp_psr_status", i915_edp_psr_status, 0},
> - {"i915_sink_crc_eDP1", i915_sink_crc, 0},
> + {"i915_edp_psr_sink_crc", i915_sink_crc, 0},
> {"i915_energy_uJ", i915_energy_uJ, 0},
> {"i915_runtime_pm_status", i915_runtime_pm_status, 0},
> {"i915_power_domain_info", i915_power_domain_info, 0},
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 7352ab631ea8..ff7522d3632e 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -3876,41 +3876,6 @@ intel_dp_configure_mst(struct intel_dp *intel_dp)
> intel_dp->is_mst);
> }
>
> -int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc)
> -{
> - int count = 0, ret = 0, attempts;
> -
> - for (attempts = 0; attempts < 3 && count == 0; attempts++) {
> - u8 buf;
> -
> - /* Wait for approximately half a frame, we cannot wait for a
> - * vblank interrupt as it triggers PSR exit.
> - */
> - if (attempts)
> - usleep_range(8000, 8500);
> -
> - if (drm_dp_dpcd_readb(&intel_dp->aux,
> - DP_TEST_SINK_MISC, &buf) < 0) {
> - ret = -EIO;
> - goto out;
> - }
> - count = buf & DP_TEST_COUNT_MASK;
> - }
> -
> - if (attempts == 3) {
> - ret = -ETIMEDOUT;
> - goto out;
> - }
> -
> - if (drm_dp_dpcd_read(&intel_dp->aux, DP_TEST_CRC_R_CR, crc, 6) != 6) {
> - ret = -EIO;
> - goto out;
> - }
> -
> -out:
> - return ret;
> -}
> -
> static bool
> intel_dp_get_sink_irq(struct intel_dp *intel_dp, u8 *sink_irq_vector)
> {
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index cacee94749e2..0da7be3349cc 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -1644,7 +1644,6 @@ void intel_dp_sink_dpms(struct intel_dp *intel_dp, int mode);
> void intel_dp_encoder_reset(struct drm_encoder *encoder);
> void intel_dp_encoder_suspend(struct intel_encoder *intel_encoder);
> void intel_dp_encoder_destroy(struct drm_encoder *encoder);
> -int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc);
> bool intel_dp_compute_config(struct intel_encoder *encoder,
> struct intel_crtc_state *pipe_config,
> struct drm_connector_state *conn_state);
> @@ -1900,6 +1899,7 @@ void intel_psr_compute_config(struct intel_dp *intel_dp,
> struct intel_crtc_state *crtc_state);
> void intel_psr_irq_control(struct drm_i915_private *dev_priv, bool debug);
> void intel_psr_irq_handler(struct drm_i915_private *dev_priv, u32 psr_iir);
> +int intel_psr_sink_crc(struct intel_dp *intel_dp, u8 *crc);
>
> /* intel_runtime_pm.c */
> int intel_power_domains_init(struct drm_i915_private *);
> diff --git a/drivers/gpu/drm/i915/intel_psr.c b/drivers/gpu/drm/i915/intel_psr.c
> index 0d548292dd09..4ebd05b6e86d 100644
> --- a/drivers/gpu/drm/i915/intel_psr.c
> +++ b/drivers/gpu/drm/i915/intel_psr.c
> @@ -197,6 +197,41 @@ static u8 intel_dp_get_sink_sync_latency(struct intel_dp *intel_dp)
> return val;
> }
>
> +int intel_psr_sink_crc(struct intel_dp *intel_dp, u8 *crc)
> +{
> + int count = 0, ret = 0, attempts;
> +
> + for (attempts = 0; attempts < 3 && count == 0; attempts++) {
> + u8 buf;
> +
> + /* Wait for approximately half a frame, we cannot wait for a
> + * vblank interrupt as it triggers PSR exit.
> + */
> + if (attempts)
> + usleep_range(8000, 8500);
> +
> + if (drm_dp_dpcd_readb(&intel_dp->aux,
> + DP_TEST_SINK_MISC, &buf) < 0) {
> + ret = -EIO;
> + goto out;
> + }
> + count = buf & DP_TEST_COUNT_MASK;
> + }
> +
> + if (attempts == 3) {
> + ret = -ETIMEDOUT;
> + goto out;
> + }
> +
> + if (drm_dp_dpcd_read(&intel_dp->aux, DP_TEST_CRC_R_CR, crc, 6) != 6) {
> + ret = -EIO;
> + goto out;
> + }
> +
> +out:
> + return ret;
> +}
> +
> void intel_psr_init_dpcd(struct intel_dp *intel_dp)
> {
> struct drm_i915_private *dev_priv =
> --
> 2.14.1
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-04-24 20:56 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-24 2:56 [PATCH 1/3] drm/i915/dp: Check if the sink crc we read is 6 bytes Dhinakaran Pandiyan
2018-04-24 2:56 ` [PATCH 2/3] drm/i915/dp: Fix sink-crc reads Dhinakaran Pandiyan
2018-04-24 13:26 ` Mika Kahola
2018-04-24 18:12 ` Dhinakaran Pandiyan
2018-04-24 20:55 ` Rodrigo Vivi
2018-04-24 21:54 ` Dhinakaran Pandiyan
2018-04-25 21:57 ` [PATCH v2 " Dhinakaran Pandiyan
2018-04-25 23:19 ` Rodrigo Vivi
2018-04-26 13:37 ` Ville Syrjälä
2018-04-24 2:56 ` [PATCH 3/3] drm/i915/psr: Move sink-crc to intel_psr.c Dhinakaran Pandiyan
2018-04-24 20:56 ` Rodrigo Vivi [this message]
2018-04-25 21:58 ` [PATCH v2 " Dhinakaran Pandiyan
2018-04-25 23:19 ` Rodrigo Vivi
2018-04-24 3:25 ` ✗ Fi.CI.BAT: failure for series starting with [1/3] drm/i915/dp: Check if the sink crc we read is 6 bytes Patchwork
2018-04-24 7:21 ` Dhinakaran Pandiyan
2018-04-24 20:53 ` [PATCH 1/3] " Rodrigo Vivi
2018-04-25 22:32 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/3] drm/i915/dp: Check if the sink crc we read is 6 bytes. (rev3) Patchwork
2018-04-25 22:48 ` ✗ Fi.CI.BAT: failure " Patchwork
2018-04-25 23:21 ` Rodrigo Vivi
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=20180424205640.GH1994@intel.com \
--to=rodrigo.vivi@intel.com \
--cc=dhinakaran.pandiyan@intel.com \
--cc=intel-gfx@lists.freedesktop.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