All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: Intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 4/7] drm/i915: Helper function to determine GGTT view from plane state
Date: Mon, 23 Mar 2015 15:05:54 +0200	[thread overview]
Message-ID: <1427115954.2390.6.camel@jlahtine-mobl1> (raw)
In-Reply-To: <1427109038-19597-5-git-send-email-tvrtko.ursulin@linux.intel.com>

On ma, 2015-03-23 at 11:10 +0000, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> For now only default implementation defaulting to normal view.
> 
> v2: Some code review cleanups. (Joonas Lahtinen)
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> (v2)
> ---
>  drivers/gpu/drm/i915/intel_display.c | 25 ++++++++++++++++++++++---
>  1 file changed, 22 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 4d8a397..d3fa09b 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -2288,6 +2288,15 @@ intel_fb_align_height(struct drm_device *dev, unsigned int height,
>  					       fb_format_modifier));
>  }
>  
> +static int
> +intel_fill_fb_ggtt_view(struct i915_ggtt_view *view, struct drm_framebuffer *fb,
> +			const struct drm_plane_state *plane_state)
> +{
> +	*view = i915_ggtt_view_normal;
> +
> +	return 0;
> +}
> +
>  int
>  intel_pin_and_fence_fb_obj(struct drm_plane *plane,
>  			   struct drm_framebuffer *fb,
> @@ -2297,6 +2306,7 @@ intel_pin_and_fence_fb_obj(struct drm_plane *plane,
>  	struct drm_device *dev = fb->dev;
>  	struct drm_i915_private *dev_priv = dev->dev_private;
>  	struct drm_i915_gem_object *obj = intel_fb_obj(fb);
> +	struct i915_ggtt_view view;
>  	u32 alignment;
>  	int ret;
>  
> @@ -2333,6 +2343,10 @@ intel_pin_and_fence_fb_obj(struct drm_plane *plane,
>  		return -EINVAL;
>  	}
>  
> +	ret = intel_fill_fb_ggtt_view(&view, fb, plane_state);
> +	if (ret)
> +		return ret;
> +
>  	/* Note that the w/a also requires 64 PTE of padding following the
>  	 * bo. We currently fill all unused PTE with the shadow page and so
>  	 * we should always have valid PTE following the scanout preventing
> @@ -2352,7 +2366,7 @@ intel_pin_and_fence_fb_obj(struct drm_plane *plane,
>  
>  	dev_priv->mm.interruptible = false;
>  	ret = i915_gem_object_pin_to_display_plane(obj, alignment, pipelined,
> -						   &i915_ggtt_view_normal);
> +						   &view);
>  	if (ret)
>  		goto err_interruptible;
>  
> @@ -2372,7 +2386,7 @@ intel_pin_and_fence_fb_obj(struct drm_plane *plane,
>  	return 0;
>  
>  err_unpin:
> -	i915_gem_object_unpin_from_display_plane(obj, &i915_ggtt_view_normal);
> +	i915_gem_object_unpin_from_display_plane(obj, &view);
>  err_interruptible:
>  	dev_priv->mm.interruptible = true;
>  	intel_runtime_pm_put(dev_priv);
> @@ -2383,11 +2397,16 @@ static void intel_unpin_fb_obj(struct drm_framebuffer *fb,
>  			       const struct drm_plane_state *plane_state)
>  {
>  	struct drm_i915_gem_object *obj = intel_fb_obj(fb);
> +	struct i915_ggtt_view view;
> +	int ret;
>  
>  	WARN_ON(!mutex_is_locked(&obj->base.dev->struct_mutex));
>  
> +	ret = intel_fill_fb_ggtt_view(&view, fb, plane_state);
> +	WARN_ONCE(ret, "Couldn't get view from plane state!");
> +
>  	i915_gem_object_unpin_fence(obj);
> -	i915_gem_object_unpin_from_display_plane(obj, &i915_ggtt_view_normal);
> +	i915_gem_object_unpin_from_display_plane(obj, &view);
>  }
>  
>  /* Computes the linear offset to the base tile and adjusts x, y. bytes per pixel


_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-03-23 13:05 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-23 11:10 [PATCH v5 0/7] Skylake 90/270 display rotation Tvrtko Ursulin
2015-03-23 11:10 ` [PATCH 1/7] drm/i915/skl: Extract tile height code into a helper function Tvrtko Ursulin
2015-03-23 11:10 ` [PATCH 2/7] drm/i915: Use GGTT view when (un)pinning objects to planes Tvrtko Ursulin
2015-03-23 13:07   ` Joonas Lahtinen
2015-03-23 13:58     ` Daniel Vetter
2015-03-23 11:10 ` [PATCH 3/7] drm/i915: Pass in plane state when (un)pinning frame buffers Tvrtko Ursulin
2015-03-23 11:10 ` [PATCH 4/7] drm/i915: Helper function to determine GGTT view from plane state Tvrtko Ursulin
2015-03-23 13:05   ` Joonas Lahtinen [this message]
2015-03-23 11:10 ` [PATCH 5/7] drm/i915/skl: Support secondary (rotated) frame buffer mapping Tvrtko Ursulin
2015-03-23 13:03   ` Joonas Lahtinen
2015-03-23 11:10 ` [PATCH 6/7] drm/i915/skl: Query display address through a wrapper Tvrtko Ursulin
2015-03-23 11:10 ` [PATCH 7/7] drm/i915/skl: Take 90/270 rotation into account in watermark calculations Tvrtko Ursulin
2015-03-23 14:12   ` Daniel Vetter
2015-03-23 14:16     ` Tvrtko Ursulin
2015-03-24 15:58   ` shuang.he
  -- strict thread matches above, loose matches on Subject: below --
2015-03-17 15:45 [PATCH v4 0/7] Skylake 90/270 display rotation Tvrtko Ursulin
2015-03-17 15:45 ` [PATCH 4/7] drm/i915: Helper function to determine GGTT view from plane state Tvrtko Ursulin
2015-03-18 14:10   ` Joonas Lahtinen
2015-03-05 14:07 [PATCH v3 0/7] Skylake 90/270 display rotation Tvrtko Ursulin
2015-03-05 14:07 ` [PATCH 4/7] drm/i915: Helper function to determine GGTT view from plane state Tvrtko Ursulin

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=1427115954.2390.6.camel@jlahtine-mobl1 \
    --to=joonas.lahtinen@linux.intel.com \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=tvrtko.ursulin@linux.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 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.