From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: "José Roberto de Souza" <jose.souza@intel.com>
Cc: intel-gfx@lists.freedesktop.org,
Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 6/9] drm/i915/psr: Check if source supports sink specific SU granularity
Date: Thu, 29 Nov 2018 15:03:51 -0800 [thread overview]
Message-ID: <20181129230351.GR8630@intel.com> (raw)
In-Reply-To: <20181127003710.18618-6-jose.souza@intel.com>
On Mon, Nov 26, 2018 at 04:37:07PM -0800, José Roberto de Souza wrote:
> According to eDP spec, sink can required specific selective update
> granularity that source must comply.
> Here caching the value if required and checking source supports it.
>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> ---
> drivers/gpu/drm/i915/i915_drv.h | 1 +
> drivers/gpu/drm/i915/intel_psr.c | 32 ++++++++++++++++++++++++++++++++
> 2 files changed, 33 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index f763b30f98d9..cbcd85af95bf 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -506,6 +506,7 @@ struct i915_psr {
> ktime_t last_exit;
> bool sink_not_reliable;
> bool irq_aux_error;
> + u16 su_x_granularity;
> };
>
> enum intel_pch {
> diff --git a/drivers/gpu/drm/i915/intel_psr.c b/drivers/gpu/drm/i915/intel_psr.c
> index 7607a58a6ec0..9215c9052381 100644
> --- a/drivers/gpu/drm/i915/intel_psr.c
> +++ b/drivers/gpu/drm/i915/intel_psr.c
> @@ -257,6 +257,21 @@ static u8 intel_dp_get_sink_sync_latency(struct intel_dp *intel_dp)
> return val;
> }
>
> +static u16 intel_dp_get_su_x_granulartiy(struct intel_dp *intel_dp)
> +{
> + u16 val = 0;
> + ssize_t r;
> +
> + if (!(intel_dp->psr_dpcd[1] & DP_PSR2_SU_GRANULARITY_REQUIRED))
> + return val;
> +
> + r = drm_dp_dpcd_read(&intel_dp->aux, DP_PSR2_SU_X_GRANULARITY, &val, 2);
> + if (r != 2)
> + DRM_WARN("Unable to read DP_PSR2_SU_X_GRANULARITY\n");
> +
> + return val;
> +}
> +
> void intel_psr_init_dpcd(struct intel_dp *intel_dp)
> {
> struct drm_i915_private *dev_priv =
> @@ -311,6 +326,8 @@ void intel_psr_init_dpcd(struct intel_dp *intel_dp)
> if (dev_priv->psr.sink_psr2_support) {
> dev_priv->psr.colorimetry_support =
> intel_dp_get_colorimetry_status(intel_dp);
> + dev_priv->psr.su_x_granularity =
> + intel_dp_get_su_x_granulartiy(intel_dp);
> }
> }
> }
> @@ -525,6 +542,21 @@ static bool intel_psr2_config_valid(struct intel_dp *intel_dp,
> return false;
> }
>
> + if (dev_priv->psr.su_x_granularity) {
> + /*
> + * HW will always send full lines in SU blocks, so X will
> + * always be 0 and we only need to check the width to validate
> + * horizontal granularity.
> + * About vertical granularity HW works by SU blocks starting
> + * at each 4 lines with height of 4 lines, what eDP states
> + * that sink should support.
> + */
> + if (crtc_hdisplay % dev_priv->psr.su_x_granularity) {
> + DRM_DEBUG_KMS("PSR2 not enabled, HW can not match sink SU granularity requirement\n");
> + return false;
I wonder if regardless this bit we still need to do a sort of
check anyway because spec states:
"
Sets the grid pattern granularity in the X direction.
A value of 0 indicates that no X-coordinate granularity requirement exists other than
the standard restrictions, wherein the:
•
Starting X-coordinate must be evenly divisible by 16
•
Rectangle width must be evenly divisible by 4
"
Also, why we are just checking X granularity and not Y? (0074h)
(maybe it would be useful to introduce along with previous patch
that I had just reviewed)
> + }
> + }
> +
> return true;
> }
>
> --
> 2.19.2
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2018-11-29 23:03 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-27 0:37 [PATCH 1/9] drm/i915: Disable PSR in Apple panels José Roberto de Souza
2018-11-27 0:37 ` [PATCH 2/9] drm/i915/psr: Don't tell sink that main link will be active while is active PSR2 José Roberto de Souza
2018-11-28 19:02 ` Rodrigo Vivi
2018-11-28 20:13 ` Souza, Jose
2018-11-30 1:09 ` Rodrigo Vivi
2018-11-27 0:37 ` [PATCH 3/9] drm/i915/psr: Enable sink to trigger a interruption on PSR2 CRC mismatch José Roberto de Souza
2018-11-29 22:04 ` Rodrigo Vivi
2018-11-29 23:37 ` Dhinakaran Pandiyan
2018-11-27 0:37 ` [PATCH 4/9] drm/i915/icl: Do not change reserved registers related to PSR2 José Roberto de Souza
2018-11-29 22:15 ` Rodrigo Vivi
2018-11-29 23:46 ` Souza, Jose
2018-11-30 21:21 ` Runyan, Arthur J
2018-11-27 0:37 ` [PATCH 5/9] drm: Add offset of PSR2 SU X granularity value José Roberto de Souza
2018-11-29 22:16 ` Rodrigo Vivi
2018-11-27 0:37 ` [PATCH 6/9] drm/i915/psr: Check if source supports sink specific SU granularity José Roberto de Souza
2018-11-29 23:03 ` Rodrigo Vivi [this message]
2018-11-30 0:00 ` Souza, Jose
2018-11-27 0:37 ` [PATCH 7/9] drm/i915/psr: Rename PSR2 macros to better match meaning José Roberto de Souza
2018-11-29 23:07 ` Rodrigo Vivi
2018-11-29 23:25 ` Dhinakaran Pandiyan
2018-11-30 0:17 ` Souza, Jose
2018-11-27 0:37 ` [PATCH 8/9] drm/i915/psr: Set the right frames values José Roberto de Souza
2018-11-29 23:10 ` Rodrigo Vivi
2018-11-30 0:48 ` Souza, Jose
2018-11-27 0:37 ` [PATCH 9/9] drm/i915: Remove old PSR2 FIXME about frontbuffer tracking José Roberto de Souza
2018-11-29 23:11 ` Rodrigo Vivi
2018-11-29 23:26 ` Dhinakaran Pandiyan
2018-11-27 13:38 ` [PATCH 1/9] drm/i915: Disable PSR in Apple panels Ville Syrjälä
2018-11-27 21:55 ` Souza, Jose
2018-11-29 23:44 ` Dhinakaran Pandiyan
2018-11-27 14:11 ` kbuild test robot
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=20181129230351.GR8630@intel.com \
--to=rodrigo.vivi@intel.com \
--cc=dhinakaran.pandiyan@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jose.souza@intel.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 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).