All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Rodrigo Vivi <rodrigo.vivi@gmail.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Enable FBC at Haswell.
Date: Tue, 16 Apr 2013 09:06:06 +0100	[thread overview]
Message-ID: <20130416080606.GE4106@cantiga.alporthouse.com> (raw)
In-Reply-To: <1366070188-954-1-git-send-email-rodrigo.vivi@gmail.com>

On Mon, Apr 15, 2013 at 08:56:28PM -0300, Rodrigo Vivi wrote:
> This patch introduce Frame Buffer Compression (FBC) support for HSW.
> It adds a new function haswell_enable_fbc to avoid getting
> ironlake_enable_fbc messed with many IS_HASWELL checks.
> 
> v2: Fixes from Ville.
>      	*  Fix Plane. FBC is tied to primary plane A in HSW
>     	*  Fix DPFC initial write to avoid let trash on the register.
> 
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.c |  1 +
>  drivers/gpu/drm/i915/i915_reg.h |  6 ++++++
>  drivers/gpu/drm/i915/intel_pm.c | 46 ++++++++++++++++++++++++++++++++++++++++-
>  3 files changed, 52 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 0cfc778..88fd6fb 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -291,6 +291,7 @@ static const struct intel_device_info intel_haswell_m_info = {
>  	GEN7_FEATURES,
>  	.is_haswell = 1,
>  	.is_mobile = 1,
> +	.has_fbc = 1,
>  };
>  
>  static const struct pci_device_id pciidlist[] = {		/* aka */
> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> index 5e91fbb..cb8e213 100644
> --- a/drivers/gpu/drm/i915/i915_reg.h
> +++ b/drivers/gpu/drm/i915/i915_reg.h
> @@ -849,6 +849,12 @@
>  #define   SNB_CPU_FENCE_ENABLE	(1<<29)
>  #define DPFC_CPU_FENCE_OFFSET	0x100104
>  
> +/* Framebuffer compression for Haswell */
> +#define HSW_FBC_RT_BASE			0x7020
> +#define   HSW_FBC_RT_BASE_ADDR_SHIFT	12
> +
> +#define   HSW_DPFC_CTL_FENCE_EN		(1<<28)
> +#define   HSW_DPFC_CTL_DISABLE_SLB_INIT	(1<<15)
>  
>  /*
>   * GPIO regs
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 27f94cd..f3b35c4 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -253,6 +253,45 @@ static bool ironlake_fbc_enabled(struct drm_device *dev)
>  	return I915_READ(ILK_DPFC_CONTROL) & DPFC_CTL_EN;
>  }
>  
> +static void haswell_enable_fbc(struct drm_crtc *crtc, unsigned long interval)
> +{
> +	struct drm_device *dev = crtc->dev;
> +	struct drm_i915_private *dev_priv = dev->dev_private;
> +	struct drm_framebuffer *fb = crtc->fb;
> +	struct intel_framebuffer *intel_fb = to_intel_framebuffer(fb);
> +	struct drm_i915_gem_object *obj = intel_fb->obj;
> +	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
> +	unsigned long stall_watermark = 200;
> +
> +	/* FBC is tied to primary plane A in HSW */
> +	if (intel_crtc->plane != PLANE_A) {
> +	    dev_priv->no_fbc_reason = FBC_BAD_PLANE;
> +	    return;
> +	}
Already checked in intel_update_fbc()

Otherwise looks fine.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

  reply	other threads:[~2013-04-16  8:06 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-08 21:49 [PATCH 0/3] Enable HSW FBC Rodrigo Vivi
2013-04-08 21:49 ` [PATCH 1/3] drm/i915: Enable FBC at Haswell Rodrigo Vivi
2013-04-09  8:35   ` Ville Syrjälä
2013-04-09 18:13     ` Rodrigo Vivi
2013-04-10  8:18       ` Ville Syrjälä
2013-04-10  8:52         ` Daniel Vetter
2013-04-10  9:28           ` Chris Wilson
2013-04-15 21:14         ` Rodrigo Vivi
2013-04-16 10:28           ` Ville Syrjälä
2013-04-16 13:23             ` Rodrigo Vivi
2013-04-16 13:37               ` Ville Syrjälä
2013-04-16 13:53                 ` Rodrigo Vivi
2013-04-15 23:56   ` [PATCH] " Rodrigo Vivi
2013-04-16  8:06     ` Chris Wilson [this message]
2013-04-16 13:26   ` Rodrigo Vivi
2013-04-16 14:52   ` Rodrigo Vivi
2013-04-16 16:33   ` Rodrigo Vivi
2013-04-16 17:49     ` Ville Syrjälä
2013-04-16 20:54       ` Rodrigo Vivi
2013-04-17 15:42     ` Chris Wilson
2013-04-08 21:49 ` [PATCH 2/3] drm/i915: HSW FBC WaFbcAsynchFlipDisableFbcQueue Rodrigo Vivi
2013-04-08 21:49 ` [PATCH 3/3] drm/i915: HSW FBC WaFbcDisableDpfcClockGating Rodrigo Vivi
2013-04-09  8:37   ` Ville Syrjälä
2013-04-09 18:05     ` Rodrigo Vivi
2013-04-10  8:07       ` Ville Syrjälä
2013-04-16  0:03   ` [PATCH] " 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=20130416080606.GE4106@cantiga.alporthouse.com \
    --to=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=rodrigo.vivi@gmail.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 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.