Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t 1/8] lib: Clear packed YUV formats to black
Date: Tue, 5 Jun 2018 13:13:29 +0300	[thread overview]
Message-ID: <20180605101329.GG23723@intel.com> (raw)
In-Reply-To: <1518277f-18fd-0832-1810-e8f1f2f4a6e1@linux.intel.com>

On Tue, Jun 05, 2018 at 11:42:53AM +0200, Maarten Lankhorst wrote:
> Op 23-05-18 om 20:31 schreef Ville Syrjala:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > As we do for NV12, let's also clear packed YUV formats to black instead
> > of zero. Avoids unexpected green screens.
> >
> > v2: Nuke the debug messages
> >
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  lib/igt_fb.c | 32 ++++++++++++++++++++++++++++----
> >  1 file changed, 28 insertions(+), 4 deletions(-)
> >
> > diff --git a/lib/igt_fb.c b/lib/igt_fb.c
> > index a926a08d44e1..4f17f9945419 100644
> > --- a/lib/igt_fb.c
> > +++ b/lib/igt_fb.c
> > @@ -335,6 +335,16 @@ uint64_t igt_fb_tiling_to_mod(uint64_t tiling)
> >  	}
> >  }
> >  
> > +static void *memset32(void *s, uint32_t c, size_t n)
> > +{
> > +	uint32_t *ptr = s;
> > +
> > +	for (int i = 0; i < n; i++)
> > +		*ptr++ = c;
> > +
> > +	return s;
> > +}
> Use wmemset?

Is that actually well defined?

> >  /* helpers to create nice-looking framebuffers */
> >  static int create_bo_for_fb(int fd, int width, int height,
> >  			    struct format_desc_struct *format,
> > @@ -369,6 +379,7 @@ static int create_bo_for_fb(int fd, int width, int height,
> >  
> >  		if (is_i915_device(fd)) {
> >  			uint8_t *ptr;
> > +			bool full_range = false; /* FIXME */
> >  
> >  			bo = gem_create(fd, size);
> >  			gem_set_tiling(fd, bo, igt_fb_mod_to_tiling(tiling), stride);
> > @@ -377,10 +388,23 @@ static int create_bo_for_fb(int fd, int width, int height,
> >  			ptr = gem_mmap__gtt(fd, bo, size, PROT_READ | PROT_WRITE);
> >  			igt_assert(*(uint32_t *)ptr == 0);
> >  
> > -			if (format->drm_id == DRM_FORMAT_NV12) {
> > -				/* component formats have a different zero point */
> > -				memset(ptr, 16, offsets[1]);
> > -				memset(ptr + offsets[1], 0x80, (height + 1)/2 * stride);
> > +			switch (format->drm_id) {
> > +			case DRM_FORMAT_NV12:
> > +				memset(ptr + offsets[0], full_range ? 0x00 : 0x10,
> > +				       calculated_stride * height);
> > +				memset(ptr + offsets[1], 0x80,
> > +				       calculated_stride * height/2);
> > +				break;
> > +			case DRM_FORMAT_YUYV:
> > +			case DRM_FORMAT_YVYU:
> > +				memset32(ptr, full_range ? 0x80008000 : 0x80108010,
> > +					 calculated_stride * height / 4);
> > +				break;
> > +			case DRM_FORMAT_UYVY:
> > +			case DRM_FORMAT_VYUY:
> > +				memset32(ptr, full_range ? 0x00800080 : 0x10801080,
> > +					 calculated_stride * height / 4);
> > +				break;
> >  			}
> >  			gem_munmap(ptr, size);
> >  
> 

-- 
Ville Syrjälä
Intel
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2018-06-05 10:13 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-23 18:31 [igt-dev] [PATCH i-g-t 1/8] lib: Clear packed YUV formats to black Ville Syrjala
2018-05-23 18:31 ` [igt-dev] [PATCH i-g-t 2/8] lib: Don't use dumb buffers for YCbCr Ville Syrjala
2018-06-05  9:51   ` Maarten Lankhorst
2018-05-23 18:31 ` [igt-dev] [PATCH i-g-t 3/8] lib: Clean up format_desc Ville Syrjala
2018-05-23 18:31 ` [igt-dev] [PATCH i-g-t 4/8] lib: Use igt_matrix for ycbcr<->rgb conversion Ville Syrjala
2018-06-06 10:11   ` Maarten Lankhorst
2018-05-23 18:31 ` [igt-dev] [PATCH i-g-t 5/8] lib: Add support for rendering into packed YCbCr framebuffers Ville Syrjala
2018-05-23 18:31 ` [igt-dev] [PATCH i-g-t 6/8] lib/fb: Add color_encoding/color_range to igt_fb Ville Syrjala
2018-05-23 18:31 ` [igt-dev] [PATCH i-g-t 7/8] lib/kms: Respect fb color_encoding/color_range Ville Syrjala
2018-05-23 18:31 ` [igt-dev] [PATCH i-g-t 8/8] tests/kms_plane: crc check plane pixel formats Ville Syrjala
2018-05-24 10:48   ` [igt-dev] [PATCH i-g-t v2 " Ville Syrjala
2018-06-07 15:18     ` Maarten Lankhorst
2018-05-23 19:09 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/8] lib: Clear packed YUV formats to black Patchwork
2018-05-23 23:27 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2018-05-24 17:15 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/8] lib: Clear packed YUV formats to black (rev2) Patchwork
2018-05-24 23:05 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2018-06-05  9:42 ` [igt-dev] [PATCH i-g-t 1/8] lib: Clear packed YUV formats to black Maarten Lankhorst
2018-06-05 10:13   ` Ville Syrjälä [this message]
2018-06-05 10:33     ` Maarten Lankhorst

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=20180605101329.GG23723@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=maarten.lankhorst@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