public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	Intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 4/4] drm/i915: Enable querying offset of UV plane with intel_plane_obj_offset
Date: Mon, 21 Sep 2015 14:19:50 +0300	[thread overview]
Message-ID: <1442834390.24060.7.camel@linux.intel.com> (raw)
In-Reply-To: <1442828735-9448-5-git-send-email-tvrtko.ursulin@linux.intel.com>

On ma, 2015-09-21 at 10:45 +0100, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> v2: Rebase.
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

> ---
>  drivers/gpu/drm/i915/i915_gem_gtt.c  |  2 ++
>  drivers/gpu/drm/i915/i915_gem_gtt.h  |  1 +
>  drivers/gpu/drm/i915/intel_display.c | 26 +++++++++++++++++++++-----
>  drivers/gpu/drm/i915/intel_drv.h     |  4 +++-
>  drivers/gpu/drm/i915/intel_sprite.c  |  2 +-
>  5 files changed, 28 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c
> b/drivers/gpu/drm/i915/i915_gem_gtt.c
> index 2df9d16dcefd..4023c86fabf9 100644
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> @@ -3322,6 +3322,8 @@ intel_rotate_fb_obj_pages(struct i915_ggtt_view
> *ggtt_view,
>  		if (offset_in_page(rot_info->uv_offset))
>  			uv_start_page--;
>  
> +		rot_info->uv_start_page = uv_start_page;
> +
>  		rotate_pages(page_addr_list, uv_start_page,
>  			     rot_info->width_pages_uv,
>  			     rot_info->height_pages_uv,
> diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.h
> b/drivers/gpu/drm/i915/i915_gem_gtt.h
> index 197183d5c543..430cc283d3c9 100644
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.h
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.h
> @@ -145,6 +145,7 @@ struct intel_rotation_info {
>  	uint64_t size;
>  	unsigned int width_pages_uv, height_pages_uv;
>  	uint64_t size_uv;
> +	unsigned int uv_start_page;
>  };
>  
>  struct i915_ggtt_view {
> diff --git a/drivers/gpu/drm/i915/intel_display.c
> b/drivers/gpu/drm/i915/intel_display.c
> index 2db7cc42539c..ebfd34beb841 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -2891,14 +2891,29 @@ u32 intel_fb_stride_alignment(struct
> drm_device *dev, uint64_t fb_modifier,
>  }
>  
>  unsigned long intel_plane_obj_offset(struct intel_plane
> *intel_plane,
> -				     struct drm_i915_gem_object
> *obj)
> +				     struct drm_i915_gem_object
> *obj,
> +				     unsigned int plane)
>  {
>  	const struct i915_ggtt_view *view = &i915_ggtt_view_normal;
> +	struct i915_vma *vma;
> +	unsigned char *offset;
>  
>  	if (intel_rotation_90_or_270(intel_plane->base.state
> ->rotation))
>  		view = &i915_ggtt_view_rotated;
>  
> -	return i915_gem_obj_ggtt_offset_view(obj, view);
> +	vma = i915_gem_obj_to_ggtt_view(obj, view);
> +	if (WARN(!vma, "ggtt vma for display object not found!
> (view=%u)\n",
> +		view->type))
> +		return -1;
> +
> +	offset = (unsigned char *)vma->node.start;
> +
> +	if (plane == 1) {
> +		offset += vma->ggtt_view.rotation_info.uv_start_page
> *
> +			  PAGE_SIZE;
> +	}
> +
> +	return (unsigned long)offset;
>  }
>  
>  static void skl_detach_scaler(struct intel_crtc *intel_crtc, int id)
> @@ -3054,7 +3069,7 @@ static void skylake_update_primary_plane(struct
> drm_crtc *crtc,
>  	obj = intel_fb_obj(fb);
>  	stride_div = intel_fb_stride_alignment(dev, fb->modifier[0],
>  					       fb->pixel_format);
> -	surf_addr = intel_plane_obj_offset(to_intel_plane(plane),
> obj);
> +	surf_addr = intel_plane_obj_offset(to_intel_plane(plane),
> obj, 0);
>  
>  	/*
>  	 * FIXME: intel_plane_state->src, dst aren't set when
> transitional
> @@ -11414,8 +11429,9 @@ static int intel_crtc_page_flip(struct
> drm_crtc *crtc,
>  	if (ret)
>  		goto cleanup_pending;
>  
> -	work->gtt_offset =
> intel_plane_obj_offset(to_intel_plane(primary), obj)
> -						  + intel_crtc
> ->dspaddr_offset;
> +	work->gtt_offset =
> intel_plane_obj_offset(to_intel_plane(primary),
> +						  obj, 0);
> +	work->gtt_offset += intel_crtc->dspaddr_offset;
>  
>  	if (mmio_flip) {
>  		ret = intel_queue_mmio_flip(dev, crtc, fb, obj,
> ring,
> diff --git a/drivers/gpu/drm/i915/intel_drv.h
> b/drivers/gpu/drm/i915/intel_drv.h
> index 94dab9bd8ebd..13c64c5ec22b 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -1166,7 +1166,9 @@ int skl_update_scaler_crtc(struct
> intel_crtc_state *crtc_state);
>  int skl_max_scale(struct intel_crtc *crtc, struct intel_crtc_state
> *crtc_state);
>  
>  unsigned long intel_plane_obj_offset(struct intel_plane
> *intel_plane,
> -				     struct drm_i915_gem_object
> *obj);
> +				     struct drm_i915_gem_object
> *obj,
> +				     unsigned int plane);
> +
>  u32 skl_plane_ctl_format(uint32_t pixel_format);
>  u32 skl_plane_ctl_tiling(uint64_t fb_modifier);
>  u32 skl_plane_ctl_rotation(unsigned int rotation);
> diff --git a/drivers/gpu/drm/i915/intel_sprite.c
> b/drivers/gpu/drm/i915/intel_sprite.c
> index 4372fa0b1ec5..4349fde4b72c 100644
> --- a/drivers/gpu/drm/i915/intel_sprite.c
> +++ b/drivers/gpu/drm/i915/intel_sprite.c
> @@ -235,7 +235,7 @@ skl_update_plane(struct drm_plane *drm_plane,
> struct drm_crtc *crtc,
>  	else if (key->flags & I915_SET_COLORKEY_SOURCE)
>  		plane_ctl |= PLANE_CTL_KEY_ENABLE_SOURCE;
>  
> -	surf_addr = intel_plane_obj_offset(intel_plane, obj);
> +	surf_addr = intel_plane_obj_offset(intel_plane, obj, 0);
>  
>  	if (intel_rotation_90_or_270(rotation)) {
>  		/* stride: Surface height in tiles */
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-09-21 11:19 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-21  9:45 [PATCH 0/4] NV12 rotation GTT handling prep work Tvrtko Ursulin
2015-09-21  9:45 ` [PATCH 1/4] drm/i915: Support planar formats in tile height calculations Tvrtko Ursulin
2015-09-21 10:57   ` Joonas Lahtinen
2015-09-21  9:45 ` [PATCH 2/4] drm/i915: Support appending to the rotated pages mapping Tvrtko Ursulin
2015-09-21 11:07   ` Joonas Lahtinen
2015-09-21  9:45 ` [PATCH 3/4] drm/i915: Support NV12 in rotated GGTT mapping Tvrtko Ursulin
2015-09-21 11:14   ` Joonas Lahtinen
2015-09-23 15:31     ` Daniel Vetter
2015-09-24 16:35   ` Ville Syrjälä
2015-09-25  9:44     ` Tvrtko Ursulin
2015-09-25 11:29       ` Ville Syrjälä
2015-09-28  8:37         ` Daniel Vetter
2015-09-28 12:41           ` Ville Syrjälä
2015-09-21  9:45 ` [PATCH 4/4] drm/i915: Enable querying offset of UV plane with intel_plane_obj_offset Tvrtko Ursulin
2015-09-21 11:19   ` Joonas Lahtinen [this message]
2015-09-21 12:18 ` [PATCH 0/4] NV12 rotation GTT handling prep work Ville Syrjälä
  -- strict thread matches above, loose matches on Subject: below --
2015-08-03 10:54 [PATCH v2 0/8] NV12 90/270 rotated GGTT mapping Tvrtko Ursulin
2015-08-03 10:54 ` [PATCH 4/4] drm/i915: Enable querying offset of UV plane with intel_plane_obj_offset Tvrtko Ursulin
2015-08-03 11:56   ` Chris Wilson
2015-08-03 12:20     ` Tvrtko Ursulin
2015-08-11  5:34   ` shuang.he

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=1442834390.24060.7.camel@linux.intel.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox