* [PATCH] drm/i915: Use pixel size for computing linear offsets into a sprite
@ 2012-12-19 12:14 Chris Wilson
2012-12-19 12:22 ` Ville Syrjälä
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Chris Wilson @ 2012-12-19 12:14 UTC (permalink / raw)
To: intel-gfx; +Cc: Daniel Vetter
This fixes an original bug in the sprite code that miscomputed the
source offset into a linear YUV packed framebuffer, that was magnified
into an oops with
commit 5a35e99e8162d6820013a56ad15ea8bf937af5a6
Author: Damien Lespiau <damien.lespiau@intel.com>
Date: Fri Oct 26 18:20:12 2012 +0100
drm/i915: adjust sprite base address
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.com>
Cc: Damien Lespiau <damien.lespiau@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
drivers/gpu/drm/i915/intel_sprite.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
index 3e05d79..fef3cfb 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -120,11 +120,10 @@ ivb_update_plane(struct drm_plane *plane, struct drm_framebuffer *fb,
I915_WRITE(SPRSTRIDE(pipe), fb->pitches[0]);
I915_WRITE(SPRPOS(pipe), (crtc_y << 16) | crtc_x);
- linear_offset = y * fb->pitches[0] + x * (fb->bits_per_pixel / 8);
+ linear_offset = y * fb->pitches[0] + x * pixel_size;
sprsurf_offset =
intel_gen4_compute_offset_xtiled(&x, &y,
- fb->bits_per_pixel / 8,
- fb->pitches[0]);
+ pixel_size, fb->pitches[0]);
linear_offset -= sprsurf_offset;
/* HSW consolidates SPRTILEOFF and SPRLINOFF into a single SPROFFSET
@@ -296,11 +295,10 @@ ilk_update_plane(struct drm_plane *plane, struct drm_framebuffer *fb,
I915_WRITE(DVSSTRIDE(pipe), fb->pitches[0]);
I915_WRITE(DVSPOS(pipe), (crtc_y << 16) | crtc_x);
- linear_offset = y * fb->pitches[0] + x * (fb->bits_per_pixel / 8);
+ linear_offset = y * fb->pitches[0] + x * pixel_size;
dvssurf_offset =
intel_gen4_compute_offset_xtiled(&x, &y,
- fb->bits_per_pixel / 8,
- fb->pitches[0]);
+ pixel_size, fb->pitches[0]);
linear_offset -= dvssurf_offset;
if (obj->tiling_mode != I915_TILING_NONE)
--
1.7.10.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] drm/i915: Use pixel size for computing linear offsets into a sprite
2012-12-19 12:14 [PATCH] drm/i915: Use pixel size for computing linear offsets into a sprite Chris Wilson
@ 2012-12-19 12:22 ` Ville Syrjälä
2012-12-19 17:48 ` Ville Syrjälä
2013-01-08 10:59 ` Daniel Vetter
2 siblings, 0 replies; 6+ messages in thread
From: Ville Syrjälä @ 2012-12-19 12:22 UTC (permalink / raw)
To: Chris Wilson; +Cc: intel-gfx, Daniel Vetter
On Wed, Dec 19, 2012 at 12:14:22PM +0000, Chris Wilson wrote:
> This fixes an original bug in the sprite code that miscomputed the
> source offset into a linear YUV packed framebuffer, that was magnified
> into an oops with
>
> commit 5a35e99e8162d6820013a56ad15ea8bf937af5a6
> Author: Damien Lespiau <damien.lespiau@intel.com>
> Date: Fri Oct 26 18:20:12 2012 +0100
>
> drm/i915: adjust sprite base address
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Daniel Vetter <daniel.vetter@ffwll.com>
> Cc: Damien Lespiau <damien.lespiau@intel.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
--
Ville Syrjälä
Intel OTC
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] drm/i915: Use pixel size for computing linear offsets into a sprite
2012-12-19 12:14 [PATCH] drm/i915: Use pixel size for computing linear offsets into a sprite Chris Wilson
2012-12-19 12:22 ` Ville Syrjälä
@ 2012-12-19 17:48 ` Ville Syrjälä
2013-01-09 13:20 ` Daniel Vetter
2013-01-08 10:59 ` Daniel Vetter
2 siblings, 1 reply; 6+ messages in thread
From: Ville Syrjälä @ 2012-12-19 17:48 UTC (permalink / raw)
To: Chris Wilson; +Cc: intel-gfx, Daniel Vetter
On Wed, Dec 19, 2012 at 12:14:22PM +0000, Chris Wilson wrote:
> This fixes an original bug in the sprite code that miscomputed the
> source offset into a linear YUV packed framebuffer, that was magnified
> into an oops with
>
> commit 5a35e99e8162d6820013a56ad15ea8bf937af5a6
> Author: Damien Lespiau <damien.lespiau@intel.com>
> Date: Fri Oct 26 18:20:12 2012 +0100
>
> drm/i915: adjust sprite base address
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Daniel Vetter <daniel.vetter@ffwll.com>
> Cc: Damien Lespiau <damien.lespiau@intel.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
--
Ville Syrjälä
Intel OTC
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] drm/i915: Use pixel size for computing linear offsets into a sprite
2012-12-19 12:14 [PATCH] drm/i915: Use pixel size for computing linear offsets into a sprite Chris Wilson
2012-12-19 12:22 ` Ville Syrjälä
2012-12-19 17:48 ` Ville Syrjälä
@ 2013-01-08 10:59 ` Daniel Vetter
2013-01-08 11:46 ` Ville Syrjälä
2 siblings, 1 reply; 6+ messages in thread
From: Daniel Vetter @ 2013-01-08 10:59 UTC (permalink / raw)
To: Chris Wilson; +Cc: intel-gfx, Daniel Vetter
On Wed, Dec 19, 2012 at 12:14:22PM +0000, Chris Wilson wrote:
> This fixes an original bug in the sprite code that miscomputed the
> source offset into a linear YUV packed framebuffer, that was magnified
> into an oops with
>
> commit 5a35e99e8162d6820013a56ad15ea8bf937af5a6
> Author: Damien Lespiau <damien.lespiau@intel.com>
> Date: Fri Oct 26 18:20:12 2012 +0100
>
> drm/i915: adjust sprite base address
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Daniel Vetter <daniel.vetter@ffwll.com>
> Cc: Damien Lespiau <damien.lespiau@intel.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/i915/intel_sprite.c | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
> index 3e05d79..fef3cfb 100644
> --- a/drivers/gpu/drm/i915/intel_sprite.c
> +++ b/drivers/gpu/drm/i915/intel_sprite.c
> @@ -120,11 +120,10 @@ ivb_update_plane(struct drm_plane *plane, struct drm_framebuffer *fb,
> I915_WRITE(SPRSTRIDE(pipe), fb->pitches[0]);
> I915_WRITE(SPRPOS(pipe), (crtc_y << 16) | crtc_x);
>
> - linear_offset = y * fb->pitches[0] + x * (fb->bits_per_pixel / 8);
> + linear_offset = y * fb->pitches[0] + x * pixel_size;
Shouldn't we round x to an even offset for packed yuv? Maybe even using
drm_format_horz_chroma_subsampling ... The idea being that a generic
client can't really know the resolution for our source offsets.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] drm/i915: Use pixel size for computing linear offsets into a sprite
2013-01-08 10:59 ` Daniel Vetter
@ 2013-01-08 11:46 ` Ville Syrjälä
0 siblings, 0 replies; 6+ messages in thread
From: Ville Syrjälä @ 2013-01-08 11:46 UTC (permalink / raw)
To: Daniel Vetter; +Cc: intel-gfx, Daniel Vetter
On Tue, Jan 08, 2013 at 11:59:57AM +0100, Daniel Vetter wrote:
> On Wed, Dec 19, 2012 at 12:14:22PM +0000, Chris Wilson wrote:
> > This fixes an original bug in the sprite code that miscomputed the
> > source offset into a linear YUV packed framebuffer, that was magnified
> > into an oops with
> >
> > commit 5a35e99e8162d6820013a56ad15ea8bf937af5a6
> > Author: Damien Lespiau <damien.lespiau@intel.com>
> > Date: Fri Oct 26 18:20:12 2012 +0100
> >
> > drm/i915: adjust sprite base address
> >
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Daniel Vetter <daniel.vetter@ffwll.com>
> > Cc: Damien Lespiau <damien.lespiau@intel.com>
> > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> > drivers/gpu/drm/i915/intel_sprite.c | 10 ++++------
> > 1 file changed, 4 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
> > index 3e05d79..fef3cfb 100644
> > --- a/drivers/gpu/drm/i915/intel_sprite.c
> > +++ b/drivers/gpu/drm/i915/intel_sprite.c
> > @@ -120,11 +120,10 @@ ivb_update_plane(struct drm_plane *plane, struct drm_framebuffer *fb,
> > I915_WRITE(SPRSTRIDE(pipe), fb->pitches[0]);
> > I915_WRITE(SPRPOS(pipe), (crtc_y << 16) | crtc_x);
> >
> > - linear_offset = y * fb->pitches[0] + x * (fb->bits_per_pixel / 8);
> > + linear_offset = y * fb->pitches[0] + x * pixel_size;
>
> Shouldn't we round x to an even offset for packed yuv? Maybe even using
> drm_format_horz_chroma_subsampling ... The idea being that a generic
> client can't really know the resolution for our source offsets.
Yeah either we round, or we just reject the operation. Both options have
some merit, so I think we need some kind of user controlled knob to select
the mode.
The "proper clipping" patch in the atomic branch rounds to nearest
macropixel, and it also handles the scaling limitations in a fuzzy
manner. I still need to split that stuff out, and then we need to
figure out how the user is supposed to select the rounding mode
(a per plane property perhaps, or just a global flag?).
--
Ville Syrjälä
Intel OTC
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] drm/i915: Use pixel size for computing linear offsets into a sprite
2012-12-19 17:48 ` Ville Syrjälä
@ 2013-01-09 13:20 ` Daniel Vetter
0 siblings, 0 replies; 6+ messages in thread
From: Daniel Vetter @ 2013-01-09 13:20 UTC (permalink / raw)
To: Ville Syrjälä; +Cc: intel-gfx, Daniel Vetter
On Wed, Dec 19, 2012 at 07:48:50PM +0200, Ville Syrjälä wrote:
> On Wed, Dec 19, 2012 at 12:14:22PM +0000, Chris Wilson wrote:
> > This fixes an original bug in the sprite code that miscomputed the
> > source offset into a linear YUV packed framebuffer, that was magnified
> > into an oops with
> >
> > commit 5a35e99e8162d6820013a56ad15ea8bf937af5a6
> > Author: Damien Lespiau <damien.lespiau@intel.com>
> > Date: Fri Oct 26 18:20:12 2012 +0100
> >
> > drm/i915: adjust sprite base address
> >
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Daniel Vetter <daniel.vetter@ffwll.com>
> > Cc: Damien Lespiau <damien.lespiau@intel.com>
> > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Picked up for -fixes, thanks for the patch.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-01-09 13:18 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-19 12:14 [PATCH] drm/i915: Use pixel size for computing linear offsets into a sprite Chris Wilson
2012-12-19 12:22 ` Ville Syrjälä
2012-12-19 17:48 ` Ville Syrjälä
2013-01-09 13:20 ` Daniel Vetter
2013-01-08 10:59 ` Daniel Vetter
2013-01-08 11:46 ` 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.