All of 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 2/3] lib/igt_fb: Add support for Y410/Y416 formats, v5.
Date: Thu, 28 Mar 2019 21:16:19 +0200	[thread overview]
Message-ID: <20190328191619.GK3888@intel.com> (raw)
In-Reply-To: <20190328180845.3905-2-maarten.lankhorst@linux.intel.com>

On Thu, Mar 28, 2019 at 07:08:44PM +0100, Maarten Lankhorst wrote:
> Y410 is packed with compressed a channel and only 32 bpp, like
> 10 bits RGB formats. Y416 is a packed 16 bits per component format.
> 
> Changes since v1:
> - Rebase on top of upstream YUV changes.
> Changes since v2:
> - Discard alpha channel, not used upstream.
> Changes since v3:
> - Handle the XVYU formats and Y41x formats correctly.
> Changes since v4:
> - Fix YUV conversion routines. (Ville)
> - Use memset64 to clear initial fb. (Ville)
> 
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
>  lib/igt_color_encoding.c |   6 +
>  lib/igt_fb.c             | 257 +++++++++++++++++++++++++++++++++++----
>  2 files changed, 238 insertions(+), 25 deletions(-)
> 
> diff --git a/lib/igt_color_encoding.c b/lib/igt_color_encoding.c
> index 9f9dc1439ee4..7de6d5abd690 100644
> --- a/lib/igt_color_encoding.c
> +++ b/lib/igt_color_encoding.c
> @@ -154,6 +154,12 @@ static const struct color_encoding_format {
>  	{ DRM_FORMAT_Y210, 65472.f, 4096.f, 60160.f, 4096.f, 32768.f, 61440.f },
>  	{ DRM_FORMAT_Y212, 65520.f, 4096.f, 60160.f, 4096.f, 32768.f, 61440.f },
>  	{ DRM_FORMAT_Y216, 65535.f, 4096.f, 60160.f, 4096.f, 32768.f, 61440.f },
> +	{ DRM_FORMAT_Y410, 1023.f, 64.f, 940.f, 64.f, 512.f, 960.f },
> +	{ DRM_FORMAT_Y412, 65520.f, 4096.f, 60160.f, 4096.f, 32768.f, 61440.f },
> +	{ DRM_FORMAT_Y416, 65535.f, 4096.f, 60160.f, 4096.f, 32768.f, 61440.f },
> +	{ DRM_FORMAT_XVYU2101010, 1023.f, 64.f, 940.f, 64.f, 512.f, 960.f },
> +	{ DRM_FORMAT_XVYU12_16161616, 65520.f, 4096.f, 60160.f, 4096.f, 32768.f, 61440.f },
> +	{ DRM_FORMAT_XVYU16161616, 65535.f, 4096.f, 60160.f, 4096.f, 32768.f, 61440.f },
>  };
>  
>  static const struct color_encoding_format *lookup_fourcc(uint32_t fourcc)
> diff --git a/lib/igt_fb.c b/lib/igt_fb.c
> index c5b1e169a5ff..600d9c246e30 100644
> --- a/lib/igt_fb.c
> +++ b/lib/igt_fb.c
> @@ -221,6 +221,36 @@ static const struct format_desc_struct {
>  	  .num_planes = 3, .plane_bpp = { 8, 8, 8, },
>  	  .hsub = 2, .vsub = 1,
>  	},
> +	{ .name = "Y410", .depth = -1, .drm_id = DRM_FORMAT_Y410,
> +	  .cairo_id = CAIRO_FORMAT_RGBA128F,
> +	  .num_planes = 1, .plane_bpp = { 32, },
> +	  .hsub = 1, .vsub = 1,
> +	},
> +	{ .name = "Y412", .depth = -1, .drm_id = DRM_FORMAT_Y412,
> +	  .cairo_id = CAIRO_FORMAT_RGBA128F,
> +	  .num_planes = 1, .plane_bpp = { 64, },
> +	  .hsub = 1, .vsub = 1,
> +	},
> +	{ .name = "Y416", .depth = -1, .drm_id = DRM_FORMAT_Y416,
> +	  .cairo_id = CAIRO_FORMAT_RGBA128F,
> +	  .num_planes = 1, .plane_bpp = { 64, },
> +	  .hsub = 1, .vsub = 1,
> +	},
> +	{ .name = "XV30", .depth = -1, .drm_id = DRM_FORMAT_XVYU2101010,
> +	  .cairo_id = CAIRO_FORMAT_RGB96F,
> +	  .num_planes = 1, .plane_bpp = { 32, },
> +	  .hsub = 1, .vsub = 1,
> +	},
> +	{ .name = "XV36", .depth = -1, .drm_id = DRM_FORMAT_XVYU12_16161616,
> +	  .cairo_id = CAIRO_FORMAT_RGB96F,
> +	  .num_planes = 1, .plane_bpp = { 64, },
> +	  .hsub = 1, .vsub = 1,
> +	},
> +	{ .name = "XV48", .depth = -1, .drm_id = DRM_FORMAT_XVYU16161616,
> +	  .cairo_id = CAIRO_FORMAT_RGB96F,
> +	  .num_planes = 1, .plane_bpp = { 64, },
> +	  .hsub = 1, .vsub = 1,
> +	},
>  	{ .name = "P010", .depth = -1, .drm_id = DRM_FORMAT_P010,
>  	  .cairo_id = CAIRO_FORMAT_RGB96F,
>  	  .num_planes = 2, .plane_bpp = { 16, 32 },
> @@ -638,6 +668,12 @@ uint64_t igt_fb_tiling_to_mod(uint64_t tiling)
>  	}
>  }
>  
> +static void memset64(uint64_t *s, uint64_t c, size_t n)
> +{
> +	for (int i = 0; i < n; i++)
> +		s[i] = c;
> +}
> +
>  static void clear_yuv_buffer(struct igt_fb *fb)
>  {
>  	bool full_range = fb->color_range == IGT_COLOR_YCBCR_FULL_RANGE;
> @@ -690,6 +726,21 @@ static void clear_yuv_buffer(struct igt_fb *fb)
>  			fb->strides[0] * fb->plane_height[0] / sizeof(wchar_t));
>  		break;
>  
> +	case DRM_FORMAT_XVYU2101010:
> +	case DRM_FORMAT_Y410:
> +		wmemset(ptr + fb->offsets[0],
> +			full_range ? 0x20000200 : 0x20010200,
> +		fb->strides[0] * fb->plane_height[0] / sizeof(wchar_t));

Indentation fail.

> +		break;
> +
> +	case DRM_FORMAT_XVYU12_16161616:
> +	case DRM_FORMAT_XVYU16161616:
> +	case DRM_FORMAT_Y412:
> +	case DRM_FORMAT_Y416:
> +		memset64(ptr + fb->offsets[0],
> +			 full_range ? 0x800000008000 : 0x800010008000ULL,

Missing ULL?

Apart from that this looks good to me.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

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

  reply	other threads:[~2019-03-28 19:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-28 18:08 [igt-dev] [PATCH i-g-t 1/3] lib/igt_fb: Add support for Y21x formats as well, v3 Maarten Lankhorst
2019-03-28 18:08 ` [igt-dev] [PATCH i-g-t 2/3] lib/igt_fb: Add support for Y410/Y416 formats, v5 Maarten Lankhorst
2019-03-28 19:16   ` Ville Syrjälä [this message]
2019-03-28 18:08 ` [igt-dev] [PATCH i-g-t 3/3] tests/kms_yuv: Add yuv specific tests, v4 Maarten Lankhorst
2019-03-28 19:25   ` Ville Syrjälä
2019-03-29  9:10     ` Maarten Lankhorst
2019-03-28 18:55 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/3] lib/igt_fb: Add support for Y21x formats as well, v3 Patchwork
2019-03-29  4:31 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

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=20190328191619.GK3888@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 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.