Bug 58185 - Green lines at bottom/right when using XV to render only part of a image
Summary: Green lines at bottom/right when using XV to render only part of a image
Status: RESOLVED NOTOURBUG
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/intel (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Chris Wilson
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-12 11:18 UTC by Sebastian Dröge (slomo)
Modified: 2012-12-13 10:52 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Sebastian Dröge (slomo) 2012-12-12 11:18:37 UTC
https://bugzilla.gnome.org/show_bug.cgi?id=685305

Since GStreamer 1.0 we sometimes allocate a larger XV image for the video with padding on all four sides but then call Xv(Shm)PutImage() to render a part of this image. With intel drivers this (depending on resolutions) sometimes causes a 1-2 pixel wide green line at the right side or bottom.

The resolutions in question or usually perfect multiples of 16, e.g. 672x416 is allocated and 640x360 (16 pixel padding at left/right/top, 40 pixel padding at bottom) is rendered.

When allocating and rendering 672x416 or 640x360 directly (i.e. no offsets or anything) there are no green lines anywhere.
Comment 1 Sebastian Dröge (slomo) 2012-12-12 11:20:12 UTC
Forgot to mention that this (at least) happens with the I420 color format
Comment 2 Chris Wilson 2012-12-12 11:26:40 UTC
Can I have an Xorg.log or two from the people affected by this? Overlay or textured video?
Comment 3 Chris Wilson 2012-12-12 11:39:08 UTC
Installed gstreamer1.0, and I can reproduce. Thanks.
Comment 4 Chris Wilson 2012-12-12 11:51:10 UTC
The green is an artifact of you padding with zero and the hardware sampling those border pixels. Step 1: stop lying.
Comment 5 Chris Wilson 2012-12-12 12:02:42 UTC
This will hide the issue for unscaled videos:

commit 9001263b32efde1361555432914d9ac3ee780511
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Dec 12 12:03:40 2012 +0000

    sna/gen3+: Use nearest for unscaled videos
    
    If the output is unscaled, then we do not require pixel interpolation
    (and planar formats are exactly subsampled).
    
    References: https://bugs.freedesktop.org/show_bug.cgi?id=58185
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

But you need to be more careful with your source data.
Comment 6 wim.taymans@gmail.com 2012-12-12 14:01:36 UTC
(In reply to comment #4)
> The green is an artifact of you padding with zero and the hardware sampling
> those border pixels. Step 1: stop lying.

Step 1: don't read pixels outside of the given region

> But you need to be more careful with your source data.

I suspect there is more going on. Filling the complete image with the same color also creates a small line when cropping so I don't know where it is getting these other colors from.
Comment 7 Chris Wilson 2012-12-12 15:18:56 UTC
(In reply to comment #6)
> (In reply to comment #4)
> > The green is an artifact of you padding with zero and the hardware sampling
> > those border pixels. Step 1: stop lying.
> 
> Step 1: don't read pixels outside of the given region

Ah, but it is not. You've included the pad pixels in your source region.

> > But you need to be more careful with your source data.
> 
> I suspect there is more going on. Filling the complete image with the same
> color also creates a small line when cropping so I don't know where it is
> getting these other colors from.

What do you mean by complete image?
Comment 8 Sebastian Dröge (slomo) 2012-12-13 10:52:53 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > (In reply to comment #4)
> > > The green is an artifact of you padding with zero and the hardware sampling
> > > those border pixels. Step 1: stop lying.
> > 
> > Step 1: don't read pixels outside of the given region
> 
> Ah, but it is not. You've included the pad pixels in your source region.

What do you mean? The source region only contains the part that should be rendered, i.e. not the padding.

> > > But you need to be more careful with your source data.
> > 
> > I suspect there is more going on. Filling the complete image with the same
> > color also creates a small line when cropping so I don't know where it is
> > getting these other colors from.
> 
> What do you mean by complete image?

The complete XvImage


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.