All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] drm/i915/vlv: Update Wait for FIFO and wait for 20 free entries.
@ 2013-11-27 15:46 deepak.s
  2013-11-27 17:53 ` Ville Syrjälä
  0 siblings, 1 reply; 2+ messages in thread
From: deepak.s @ 2013-11-27 15:46 UTC (permalink / raw)
  To: intel-gfx; +Cc: Deepak S

From: Deepak S <deepak.s@intel.com>

On VLV, FIFO will be shared by both SW and HW. So, we read the
free entries through register and update dev_priv variable
and wait for only 20 entries to be free

Signed-off-by: Deepak S <deepak.s@intel.com>
---
 drivers/gpu/drm/i915/intel_uncore.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
index eac5661..3e7848a 100644
--- a/drivers/gpu/drm/i915/intel_uncore.c
+++ b/drivers/gpu/drm/i915/intel_uncore.c
@@ -147,6 +147,12 @@ static int __gen6_gt_wait_for_fifo(struct drm_i915_private *dev_priv)
 {
 	int ret = 0;
 
+	/* On VLV, FIFO will be shared by both SW and HW.
+	 * So, we need to read the FREE_ENTRIES everytime */
+	if (IS_VALLEYVIEW(dev_priv->dev))
+		dev_priv->uncore.fifo_count =
+			__raw_i915_read32(dev_priv, GT_FIFO_FREE_ENTRIES);
+
 	if (dev_priv->uncore.fifo_count < GT_FIFO_NUM_RESERVED_ENTRIES) {
 		int loop = 500;
 		u32 fifo = __raw_i915_read32(dev_priv, GT_FIFO_FREE_ENTRIES);
-- 
1.8.4.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/2] drm/i915/vlv: Update Wait for FIFO and wait for 20 free entries.
  2013-11-27 15:46 [PATCH 2/2] drm/i915/vlv: Update Wait for FIFO and wait for 20 free entries deepak.s
@ 2013-11-27 17:53 ` Ville Syrjälä
  0 siblings, 0 replies; 2+ messages in thread
From: Ville Syrjälä @ 2013-11-27 17:53 UTC (permalink / raw)
  To: deepak.s; +Cc: intel-gfx

On Wed, Nov 27, 2013 at 09:16:42PM +0530, deepak.s@intel.com wrote:
> From: Deepak S <deepak.s@intel.com>
> 
> On VLV, FIFO will be shared by both SW and HW.

SW I take it means MMIO access coming from the CPU, and HW means eg.
LRI from some CS?

Are there any docs clearly stating this? The Gunit HAS is next to
useless trying to figure out how the internal register accesses
get routed.

> So, we read the
> free entries through register and update dev_priv variable
> and wait for only 20 entries to be free
> 
> Signed-off-by: Deepak S <deepak.s@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_uncore.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
> index eac5661..3e7848a 100644
> --- a/drivers/gpu/drm/i915/intel_uncore.c
> +++ b/drivers/gpu/drm/i915/intel_uncore.c
> @@ -147,6 +147,12 @@ static int __gen6_gt_wait_for_fifo(struct drm_i915_private *dev_priv)
>  {
>  	int ret = 0;
>  
> +	/* On VLV, FIFO will be shared by both SW and HW.
> +	 * So, we need to read the FREE_ENTRIES everytime */
> +	if (IS_VALLEYVIEW(dev_priv->dev))
> +		dev_priv->uncore.fifo_count =
> +			__raw_i915_read32(dev_priv, GT_FIFO_FREE_ENTRIES);

This would need to mask the free entries. I sent out a patch to fix the
already existing cases, but you'd need to do it here too.

> +
>  	if (dev_priv->uncore.fifo_count < GT_FIFO_NUM_RESERVED_ENTRIES) {
>  		int loop = 500;
>  		u32 fifo = __raw_i915_read32(dev_priv, GT_FIFO_FREE_ENTRIES);
> -- 
> 1.8.4.2
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel OTC

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-11-27 17:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-27 15:46 [PATCH 2/2] drm/i915/vlv: Update Wait for FIFO and wait for 20 free entries deepak.s
2013-11-27 17:53 ` Ville Syrjälä

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.