intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Manasi Navare <manasi.d.navare@intel.com>,
	Anusha Srivatsa <anusha.srivatsa@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [v2 1/6] i915/dp/fec: Cache the FEC_CAPABLE DPCD register
Date: Tue, 16 Oct 2018 10:43:51 +0300	[thread overview]
Message-ID: <87y3ayl4js.fsf@intel.com> (raw)
In-Reply-To: <20181015220522.GD2371@intel.com>

On Mon, 15 Oct 2018, Manasi Navare <manasi.d.navare@intel.com> wrote:
> On Mon, Oct 15, 2018 at 02:50:32PM -0700, Anusha Srivatsa wrote:
>> Similar to DSC DPCD registers, let us cache
>> FEC_CAPABLE register to avoid using stale
>> values. With this we can avoid aux reads
>> everytime and instead read the cached values.
>> 
>> Suggested-by: Jani Nikula <jani.nikula@linux.intel.com>
>> Cc: Jani Nikula <jani.nikula@linux.intel.com>
>> Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
>> Cc: Manasi Navare <manasi.d.navare@intel.com>
>> Signed-off-by: Anusha Srivatsa <anusha.srivatsa@intel.com>
>> ---
>>  drivers/gpu/drm/i915/intel_dp.c  | 8 ++++++++
>>  drivers/gpu/drm/i915/intel_drv.h | 1 +
>>  2 files changed, 9 insertions(+)
>> 
>> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
>> index dcc5a207fcbd..8a0e0a0b26f6 100644
>> --- a/drivers/gpu/drm/i915/intel_dp.c
>> +++ b/drivers/gpu/drm/i915/intel_dp.c
>> @@ -4163,8 +4163,10 @@ static void intel_dp_get_dsc_sink_cap(struct intel_dp *intel_dp)
>>  	/*
>>  	 *Clear the cached register set to avoid using stale values
>>  	 * for the sinks that do not support DSC.
>> +	 * Similarly, clear the cached FEC register.
>>  	 */
>>  	memset(intel_dp->dsc_dpcd, 0, sizeof(intel_dp->dsc_dpcd));
>> +	memset(intel_dp->fec_dpcd, 0, sizeof(intel_dp->fec_dpcd));
>
> Memset is an expensive opertaion for just a single value,
> just set that to 0

Agreed on making it a single byte and setting it to 0, but the memset
impact on performance is noise compared to e.g. the native aux
transactions on this path.

BR,
Jani.


>
>>  
>>  	/* Cache the DSC DPCD if eDP or DP rev >= 1.4 */
>>  	if (intel_dp->dpcd[DP_DPCD_REV] >= 0x14 ||
>> @@ -4179,6 +4181,12 @@ static void intel_dp_get_dsc_sink_cap(struct intel_dp *intel_dp)
>>  			      (int)sizeof(intel_dp->dsc_dpcd),
>>  			      intel_dp->dsc_dpcd);
>>  	}
>> +	/* FEC is supported only on DP 1.4 */
>> +	if (!intel_dp_is_edp(intel_dp) && intel_dp->dpcd[DP_DPCD_REV] >= 0x14) {
>> +		if (drm_dp_dpcd_readb(&intel_dp->aux, DP_FEC_CAPABILITY,
>> +				      intel_dp->fec_dpcd) < 0)
>> +			DRM_ERROR("Failed to read FEC DPCD register\n");
>> +	}
>>  }
>>  
>>  static bool
>> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
>> index 7b4af8cba279..b87ea052c9ca 100644
>> --- a/drivers/gpu/drm/i915/intel_drv.h
>> +++ b/drivers/gpu/drm/i915/intel_drv.h
>> @@ -1086,6 +1086,7 @@ struct intel_dp {
>>  	uint8_t downstream_ports[DP_MAX_DOWNSTREAM_PORTS];
>>  	uint8_t edp_dpcd[EDP_DISPLAY_CTL_CAP_SIZE];
>>  	u8 dsc_dpcd[DP_DSC_RECEIVER_CAP_SIZE];
>> +	u8 fec_dpcd[1];
>
> Why create an array for just 1 value, I think just a u8 fec_capable field
> will suffice
>
> Manasi
>
>>  	/* source rates */
>>  	int num_source_rates;
>>  	const int *source_rates;
>> -- 
>> 2.17.1
>> 

-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2018-10-16  7:44 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-15 21:50 [v2 0/6] Forward Error Correction Anusha Srivatsa
2018-10-15 21:50 ` [v2 1/6] i915/dp/fec: Cache the FEC_CAPABLE DPCD register Anusha Srivatsa
2018-10-15 22:05   ` Manasi Navare
2018-10-16  7:43     ` Jani Nikula [this message]
2018-10-15 21:50 ` [v2 2/6] drm/dp/fec: DRM helper for Forward Error Correction Anusha Srivatsa
2018-10-15 21:50 ` [v2 3/6] i915/dp/fec: Check for FEC Support Anusha Srivatsa
2018-10-18 22:45   ` Manasi Navare
2018-10-15 21:50 ` [v2 4/6] drm/i915/fec: Set FEC_READY in FEC_CONFIGURATION Anusha Srivatsa
2018-10-18 22:59   ` Manasi Navare
2018-10-15 21:50 ` [v2 5/6] i915/dp/fec: Configure the Forward Error Correction bits Anusha Srivatsa
2018-10-18 23:08   ` Manasi Navare
2018-10-19 18:39   ` Ville Syrjälä
2018-10-19 19:24     ` Manasi Navare
2018-10-19 19:58       ` Ville Syrjälä
2018-10-19 20:29         ` Manasi Navare
2018-10-19 20:46           ` Srivatsa, Anusha
2018-10-19 23:11           ` Ville Syrjälä
2018-10-22 18:04             ` Srivatsa, Anusha
2018-10-22 18:26               ` Ville Syrjälä
2018-10-22 18:37                 ` Srivatsa, Anusha
2018-10-23 23:59                 ` Manasi Navare
2018-10-22 18:27               ` Manasi Navare
2018-10-15 21:50 ` [v2 6/6] drm/i915/fec: Disable FEC state Anusha Srivatsa
2018-10-18 23:16   ` Manasi Navare
2018-10-19 18:13     ` Srivatsa, Anusha
2018-10-19 18:41   ` Ville Syrjälä
2018-10-15 22:16 ` ✗ Fi.CI.BAT: failure for Forward Error Correction (rev2) Patchwork

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=87y3ayl4js.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=anusha.srivatsa@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=manasi.d.navare@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).