[01/21] drm/i915: Account for the size of the chroma plane for the rotated gtt view
diff mbox

Message ID 1455569699-27905-2-git-send-email-ville.syrjala@linux.intel.com
State New
Headers show

Commit Message

Ville Syrjälä Feb. 15, 2016, 8:54 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

The size of the rotated ggtt mapping ought to include the size of the
chroma plane as well. Not a huge deal since we don't expose NV12 (or any
pother planar format for that matter) yet.

Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Fixes: 9e759ff1f4a0 ("drm/i915: Return correct size for rotated views")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_gem_gtt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tvrtko Ursulin Feb. 16, 2016, 11:40 a.m. UTC | #1
On 15/02/16 20:54, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> The size of the rotated ggtt mapping ought to include the size of the
> chroma plane as well. Not a huge deal since we don't expose NV12 (or any
> pother planar format for that matter) yet.
>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Fixes: 9e759ff1f4a0 ("drm/i915: Return correct size for rotated views")
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>   drivers/gpu/drm/i915/i915_gem_gtt.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
> index 9127f8f3561c..4ccc8ec7003c 100644
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> @@ -3636,7 +3636,7 @@ i915_ggtt_view_size(struct drm_i915_gem_object *obj,
>   	if (view->type == I915_GGTT_VIEW_NORMAL) {
>   		return obj->base.size;
>   	} else if (view->type == I915_GGTT_VIEW_ROTATED) {
> -		return view->params.rotated.size;
> +		return view->params.rotated.size + view->params.rotated.size_uv;
>   	} else if (view->type == I915_GGTT_VIEW_PARTIAL) {
>   		return view->params.partial.size << PAGE_SHIFT;
>   	} else {
>

Oops! But the fixes tag is not correct. NV12 was added after the 
referenced patch in:

commit 89e3e1427629027dc33e576fc002880a02a7e50c
Author: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Date:   Mon Sep 21 10:45:34 2015 +0100

     drm/i915: Support NV12 in rotated GGTT mapping

Anyway,

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

And no idea on what is the NV12 support status.

Regards,

Tvrtko
Ville Syrjälä Feb. 16, 2016, 11:49 a.m. UTC | #2
On Tue, Feb 16, 2016 at 11:40:48AM +0000, Tvrtko Ursulin wrote:
> 
> 
> On 15/02/16 20:54, ville.syrjala@linux.intel.com wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > The size of the rotated ggtt mapping ought to include the size of the
> > chroma plane as well. Not a huge deal since we don't expose NV12 (or any
> > pother planar format for that matter) yet.
> >
> > Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> > Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> > Fixes: 9e759ff1f4a0 ("drm/i915: Return correct size for rotated views")
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >   drivers/gpu/drm/i915/i915_gem_gtt.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
> > index 9127f8f3561c..4ccc8ec7003c 100644
> > --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> > +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> > @@ -3636,7 +3636,7 @@ i915_ggtt_view_size(struct drm_i915_gem_object *obj,
> >   	if (view->type == I915_GGTT_VIEW_NORMAL) {
> >   		return obj->base.size;
> >   	} else if (view->type == I915_GGTT_VIEW_ROTATED) {
> > -		return view->params.rotated.size;
> > +		return view->params.rotated.size + view->params.rotated.size_uv;
> >   	} else if (view->type == I915_GGTT_VIEW_PARTIAL) {
> >   		return view->params.partial.size << PAGE_SHIFT;
> >   	} else {
> >
> 
> Oops! But the fixes tag is not correct. NV12 was added after the 
> referenced patch in:
> 
> commit 89e3e1427629027dc33e576fc002880a02a7e50c
> Author: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Date:   Mon Sep 21 10:45:34 2015 +0100
> 
>      drm/i915: Support NV12 in rotated GGTT mapping

I stand corrected.

> 
> Anyway,
> 
> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> And no idea on what is the NV12 support status.

Not there yet. There's a patch in the end of this series that adds some
AUX_DIST stuff. Beyond that we need to resurrect Chandra's NV12 patches
eventually.
Joonas Lahtinen Feb. 17, 2016, 12:51 p.m. UTC | #3
Hi,

On ma, 2016-02-15 at 22:54 +0200, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> The size of the rotated ggtt mapping ought to include the size of the
> chroma plane as well. Not a huge deal since we don't expose NV12 (or any
> pother planar format for that matter) yet.
> 
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Fixes: 9e759ff1f4a0 ("drm/i915: Return correct size for rotated views")
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

A good catch. (That line even stays exactly below 80 character limit.)

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

> ---
>  drivers/gpu/drm/i915/i915_gem_gtt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
> index 9127f8f3561c..4ccc8ec7003c 100644
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> @@ -3636,7 +3636,7 @@ i915_ggtt_view_size(struct drm_i915_gem_object *obj,
>  	if (view->type == I915_GGTT_VIEW_NORMAL) {
>  		return obj->base.size;
>  	} else if (view->type == I915_GGTT_VIEW_ROTATED) {
> -		return view->params.rotated.size;
> +		return view->params.rotated.size + view->params.rotated.size_uv;
>  	} else if (view->type == I915_GGTT_VIEW_PARTIAL) {
>  		return view->params.partial.size << PAGE_SHIFT;
>  	} else {

Patch
diff mbox

diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 9127f8f3561c..4ccc8ec7003c 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -3636,7 +3636,7 @@  i915_ggtt_view_size(struct drm_i915_gem_object *obj,
 	if (view->type == I915_GGTT_VIEW_NORMAL) {
 		return obj->base.size;
 	} else if (view->type == I915_GGTT_VIEW_ROTATED) {
-		return view->params.rotated.size;
+		return view->params.rotated.size + view->params.rotated.size_uv;
 	} else if (view->type == I915_GGTT_VIEW_PARTIAL) {
 		return view->params.partial.size << PAGE_SHIFT;
 	} else {