Skip to contentSkip to conversation

Adding NV12 support for SKL display

PATCH In review Vidya Srinivas 3 participants 18 messages Jun 20, 2017 – Jul 7, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover Adding NV12 support for SKL display

This patch series is adding NV12 support for Skylake display after rebasing on latest drm-intel-nightly. Initial series of the patches can be found here:
https://lists.freedesktop.org/archives/intel-gfx/2015-May/066786.html

Feature has been currently tested with custom linux based test tool IGT test development is under progress. Floating these patches for initial review. These NV12 patches are dependent on Ville's patches mentioned below.

Update from last rev:
Patches were initial reviewed last when floated but currently there was a design change with respect to
- the way fb offset is handled
- the way rotation is handled
Rebase of the current NV12 patch series has been done as per the current changes on drm-intel-nightly.
Review comments from Ville (12th June 2017) have been addressed

Chandra Konduru (6):
drm/i915: Set scaler mode for NV12
drm/i915: Update format_is_yuv() to include NV12 drm/i915: Upscale scaler max scale for NV12 drm/i915: Add NV12 as supported format for primary plane drm/i915: Add NV12 as supported format for sprite plane drm/i915: Add NV12 support to intel_framebuffer_init

Ville Syrjälä (2):
drm/i915: Implement .get_format_info() hook for CCS drm/i915: Add render decompression support

 drivers/gpu/drm/drm_fourcc.c         |   2 +-
 drivers/gpu/drm/i915/i915_reg.h      |  24 +++
 drivers/gpu/drm/i915/intel_atomic.c  |   8 +-
 drivers/gpu/drm/i915/intel_display.c | 312 ++++++++++++++++++++++++++++++++---
 drivers/gpu/drm/i915/intel_drv.h     |   3 +-
 drivers/gpu/drm/i915/intel_pm.c      |  29 +++-
 drivers/gpu/drm/i915/intel_sprite.c  |  18 +-
 include/drm/drm_mode_config.h        |   3 +-
 include/uapi/drm/drm_fourcc.h        |   3 +
 9 files changed, 366 insertions(+), 36 deletions(-)
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

PATCH 1/8 drm/i915: Implement .get_format_info() hook for CCS

From: Ville Syrjälä <[email protected]>

SKL+ display engine can scan out certain kinds of compressed surfaces produced by the render engine. This involved telling the display engine the location of the color control surfae (CCS) which describes which parts of the main surface are compressed and which are not. The location of CCS is provided by userspace as just another plane with its own offset.

By providing our own format information for the CCS formats, we should be able to make framebuffer_check() do the right thing for the CCS surface as well.

Note that we'll return the same format info for both Y and Yf tiled format as that's what happens with the non-CCS Y vs. Yf as well. If desired, we could potentially return a unique pointer for each pixel_format+tiling+ccs combination, in which case we immediately be able to tell if any of that stuff changed by just comparing the pointers. But that does sound a bit wasteful space wise.

v2: Drop the 'dev' argument from the hook
v3: Include the description of the CCS surface layout
v4: Pretend CCS tiles are regular 128 byte wide Y tiles (Jason)

---
 drivers/gpu/drm/drm_fourcc.c         |  2 +-
 drivers/gpu/drm/i915/intel_display.c | 37 ++++++++++++++++++++++++++++++++++++
 include/drm/drm_mode_config.h        |  3 ++-
 include/uapi/drm/drm_fourcc.h        |  3 +++
 4 files changed, 43 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_fourcc.c +1 -1
index 9c0152d..50da618 100644
@@ -222,7 +222,7 @@ const struct drm_format_info *drm_format_info(u32 format)
 	const struct drm_format_info *info = NULL;
 
 	if (dev->mode_config.funcs->get_format_info)
-		info = dev->mode_config.funcs->get_format_info(mode_cmd);
+		info = dev->mode_config.funcs->get_format_info(dev, mode_cmd);
 
 	if (!info)
 		info = drm_format_info(mode_cmd->pixel_format);
drivers/gpu/drm/i915/intel_display.c +37 -0
index dec9e58..80d09d6 100644
@@ -2433,6 +2433,42 @@ static unsigned int intel_fb_modifier_to_tiling(uint64_t fb_modifier)
 	}
 }
 
+static const struct drm_format_info ccs_formats[] = {
+	{ .format = DRM_FORMAT_XRGB8888, .depth = 24, .num_planes = 2, .cpp = { 4, 1, }, .hsub = 16, .vsub = 8, },
+	{ .format = DRM_FORMAT_XBGR8888, .depth = 24, .num_planes = 2, .cpp = { 4, 1, }, .hsub = 16, .vsub = 8, },
+	{ .format = DRM_FORMAT_ARGB8888, .depth = 32, .num_planes = 2, .cpp = { 4, 1, }, .hsub = 16, .vsub = 8, },
+	{ .format = DRM_FORMAT_ABGR8888, .depth = 32, .num_planes = 2, .cpp = { 4, 1, }, .hsub = 16, .vsub = 8, },
+};
+
+static const struct drm_format_info *
+lookup_format_info(const struct drm_format_info formats[],
+		   int num_formats, u32 format)
+{
+	int i;
+
+	for (i = 0; i < num_formats; i++) {
+		if (formats[i].format == format)
+			return &formats[i];
+	}
+
+	return NULL;
+}
+
+static const struct drm_format_info *
+intel_get_format_info(struct drm_device *dev,
+		      const struct drm_mode_fb_cmd2 *cmd)
+{
+	switch (cmd->modifier[0]) {
+	case I915_FORMAT_MOD_Y_TILED_CCS:
+	case I915_FORMAT_MOD_Yf_TILED_CCS:
+		return lookup_format_info(ccs_formats,
+					  ARRAY_SIZE(ccs_formats),
+					  cmd->pixel_format);
+	default:
+		return NULL;
+	}
+}
+
 static int
 intel_fill_fb_info(struct drm_i915_private *dev_priv,
 		   struct drm_framebuffer *fb)
@@ -14607,6 +14643,7 @@ static void intel_atomic_state_free(struct drm_atomic_state *state)
 
 static const struct drm_mode_config_funcs intel_mode_funcs = {
 	.fb_create = intel_user_framebuffer_create,
+	.get_format_info = intel_get_format_info,
 	.output_poll_changed = intel_fbdev_output_poll_changed,
 	.atomic_check = intel_atomic_check,
 	.atomic_commit = intel_atomic_commit,
include/drm/drm_mode_config.h +2 -1
index 4298171..f0d3d38 100644
@@ -81,7 +81,8 @@ struct drm_mode_config_funcs {
 	 * The format information specific to the given fb metadata, or
 	 * NULL if none is found.
 	 */
-	const struct drm_format_info *(*get_format_info)(const struct drm_mode_fb_cmd2 *mode_cmd);
+	const struct drm_format_info *(*get_format_info)(struct drm_device *dev,
+		const struct drm_mode_fb_cmd2 *mode_cmd);
 
 	/**
 	 * @output_poll_changed:
include/uapi/drm/drm_fourcc.h +3 -0
index 7586c46..ee59109 100644
@@ -252,6 +252,9 @@
  */
 #define I915_FORMAT_MOD_Yf_TILED fourcc_mod_code(INTEL, 3)
 
+#define I915_FORMAT_MOD_Y_TILED_CCS	fourcc_mod_code(INTEL, 4)
+#define I915_FORMAT_MOD_Yf_TILED_CCS	fourcc_mod_code(INTEL, 5)
+
 /*
  * Tiled, NV12MT, grouped in 64 (pixels) x 32 (lines) -sized macroblocks
  *
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw

PATCH 2/8 drm/i915: Add render decompression support

In reply to Vidya Srinivas

From: Ville Syrjälä <[email protected]>

SKL+ display engine can scan out certain kinds of compressed surfaces produced by the render engine. This involved telling the display engine the location of the color control surfae (CCS) which describes which parts of the main surface are compressed and which are not. The location of CCS is provided by userspace as just another plane with its own offset.

Add the required stuff to validate the user provided AUX plane metadata and convert the user provided linear offset into something the hardware can consume.

Due to hardware limitations we require that the main surface and the AUX surface (CCS) be part of the same bo. The hardware also makes life hard by not allowing you to provide separate x/y offsets for the main and AUX surfaces (excpet with NV12), so finding suitable offsets for both requires a bit of work. Assuming we still want keep playing tricks with the offsets. I've just gone with a dumb "search backward for suitable offsets" approach, which is far from optimal,
but it works.

Also not all planes will be capable of scanning out compressed surfaces, and eg. 90/270 degree rotation is not supported in combination with decompression either.

This patch may contain work from at least the following people:
* Vandana Kannan <[email protected]>
* Daniel Vetter <[email protected]>
* Ben Widawsky <[email protected]>

v2: Deal with display workarounds 0390, 0531, 1125 (Paulo)
v3: Pretend CCS tiles are regular 128 byte wide Y tiles (Jason)
Put the AUX register defines to the correct place Fix up the slightly bogus rotation check
v4: Use I915_WRITE_FW() due to plane update locking changes
s/return -EINVAL/goto err/ in intel_framebuffer_init()
Eliminate a bunch hardcoded numbers in CCS code

Cc Paulo Zanoni <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Ben Widawsky <[email protected]>
Cc Jason Ekstrand <[email protected]>
---
 drivers/gpu/drm/i915/i915_reg.h      |  23 ++++
 drivers/gpu/drm/i915/intel_display.c | 241 ++++++++++++++++++++++++++++++++---
 drivers/gpu/drm/i915/intel_pm.c      |  29 ++++-
 drivers/gpu/drm/i915/intel_sprite.c  |   5 +
 4 files changed, 279 insertions(+), 19 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +23 -0
index c8647cf..41ddd25 100644
@@ -6106,6 +6106,10 @@ enum {
 #define _PLANE_KEYMSK_2_A			0x70298
 #define _PLANE_KEYMAX_1_A			0x701a0
 #define _PLANE_KEYMAX_2_A			0x702a0
+#define _PLANE_AUX_DIST_1_A			0x701c0
+#define _PLANE_AUX_DIST_2_A			0x702c0
+#define _PLANE_AUX_OFFSET_1_A			0x701c4
+#define _PLANE_AUX_OFFSET_2_A			0x702c4
 #define _PLANE_COLOR_CTL_1_A			0x701CC /* GLK+ */
 #define _PLANE_COLOR_CTL_2_A			0x702CC /* GLK+ */
 #define _PLANE_COLOR_CTL_3_A			0x703CC /* GLK+ */
@@ -6212,6 +6216,24 @@ enum {
 #define PLANE_NV12_BUF_CFG(pipe, plane)	\
 	_MMIO_PLANE(plane, _PLANE_NV12_BUF_CFG_1(pipe), _PLANE_NV12_BUF_CFG_2(pipe))
 
+#define _PLANE_AUX_DIST_1_B		0x711c0
+#define _PLANE_AUX_DIST_2_B		0x712c0
+#define _PLANE_AUX_DIST_1(pipe) \
+			_PIPE(pipe, _PLANE_AUX_DIST_1_A, _PLANE_AUX_DIST_1_B)
+#define _PLANE_AUX_DIST_2(pipe) \
+			_PIPE(pipe, _PLANE_AUX_DIST_2_A, _PLANE_AUX_DIST_2_B)
+#define PLANE_AUX_DIST(pipe, plane)     \
+	_MMIO_PLANE(plane, _PLANE_AUX_DIST_1(pipe), _PLANE_AUX_DIST_2(pipe))
+
+#define _PLANE_AUX_OFFSET_1_B		0x711c4
+#define _PLANE_AUX_OFFSET_2_B		0x712c4
+#define _PLANE_AUX_OFFSET_1(pipe)       \
+		_PIPE(pipe, _PLANE_AUX_OFFSET_1_A, _PLANE_AUX_OFFSET_1_B)
+#define _PLANE_AUX_OFFSET_2(pipe)       \
+		_PIPE(pipe, _PLANE_AUX_OFFSET_2_A, _PLANE_AUX_OFFSET_2_B)
+#define PLANE_AUX_OFFSET(pipe, plane)   \
+	_MMIO_PLANE(plane, _PLANE_AUX_OFFSET_1(pipe), _PLANE_AUX_OFFSET_2(pipe))
+
 #define _PLANE_COLOR_CTL_1_B			0x711CC
 #define _PLANE_COLOR_CTL_2_B			0x712CC
 #define _PLANE_COLOR_CTL_3_B			0x713CC
@@ -6695,6 +6717,7 @@ enum {
 # define CHICKEN3_DGMG_DONE_FIX_DISABLE		(1 << 2)
 
 #define CHICKEN_PAR1_1		_MMIO(0x42080)
+#define  SKL_RC_HASH_OUTSIDE	(1 << 15)
 #define  DPA_MASK_VBLANK_SRD	(1 << 15)
 #define  FORCE_ARB_IDLE_PLANES	(1 << 14)
 #define  SKL_EDP_PSR_FIX_RDWRAP	(1 << 3)
drivers/gpu/drm/i915/intel_display.c +224 -17

384 lines not on this page · raw message

drivers/gpu/drm/i915/intel_pm.c +27 -2
index b5b7372..f11205a 100644
@@ -62,6 +62,20 @@ static void gen9_init_clock_gating(struct drm_i915_private *dev_priv)
 	I915_WRITE(CHICKEN_PAR1_1,
 		   I915_READ(CHICKEN_PAR1_1) | SKL_EDP_PSR_FIX_RDWRAP);
 
+	/*
+	 * Display WA#0390: skl,bxt,kbl,glk
+	 *
+	 * Must match Sampler, Pixel Back End, and Media
+	 * (0xE194 bit 8, 0x7014 bit 13, 0x4DDC bits 27 and 31).
+	 *
+	 * Including bits outside the page in the hash would
+	 * require 2 (or 4?) MiB alignment of resources. Just
+	 * assume the defaul hashing mode which only uses bits
+	 * within the page.
+	 */
+	I915_WRITE(CHICKEN_PAR1_1,
+		   I915_READ(CHICKEN_PAR1_1) & ~SKL_RC_HASH_OUTSIDE);
+
 	I915_WRITE(GEN8_CONFIG0,
 		   I915_READ(GEN8_CONFIG0) | GEN9_DEFAULT_FIXES);
 
@@ -4070,7 +4084,9 @@ int skl_check_pipe_max_pixel_rate(struct intel_crtc *intel_crtc,
 
 	/* For Non Y-tile return 8-blocks */
 	if (fb->modifier != I915_FORMAT_MOD_Y_TILED &&
-	    fb->modifier != I915_FORMAT_MOD_Yf_TILED)
+	    fb->modifier != I915_FORMAT_MOD_Yf_TILED &&
+	    fb->modifier != I915_FORMAT_MOD_Y_TILED_CCS &&
+	    fb->modifier != I915_FORMAT_MOD_Yf_TILED_CCS)
 		return 8;
 
 	/*
@@ -4376,7 +4392,9 @@ static int skl_compute_plane_wm(const struct drm_i915_private *dev_priv,
 	}
 
 	y_tiled = fb->modifier == I915_FORMAT_MOD_Y_TILED ||
-		  fb->modifier == I915_FORMAT_MOD_Yf_TILED;
+		  fb->modifier == I915_FORMAT_MOD_Yf_TILED ||
+		  fb->modifier == I915_FORMAT_MOD_Y_TILED_CCS ||
+		  fb->modifier == I915_FORMAT_MOD_Yf_TILED_CCS;
 	x_tiled = fb->modifier == I915_FORMAT_MOD_X_TILED;
 
 	/* Display WA #1141: kbl,cfl */
@@ -4475,6 +4493,13 @@ static int skl_compute_plane_wm(const struct drm_i915_private *dev_priv,
 	res_lines = div_round_up_fixed16(selected_result,
 					 plane_blocks_per_line);
 
+	/* Display WA #1125: skl,bxt,kbl,glk */
+	if (level == 0 &&
+	    (fb->modifier == I915_FORMAT_MOD_Y_TILED_CCS ||
+	     fb->modifier == I915_FORMAT_MOD_Yf_TILED_CCS))
+		res_blocks += fixed_16_16_to_u32_round_up(y_tile_minimum);
+
+	/* Display WA #1126: skl,bxt,kbl,glk */
 	if (level >= 1 && level <= 7) {
 		if (y_tiled) {
 			res_blocks += fixed_16_16_to_u32_round_up(y_tile_minimum);
drivers/gpu/drm/i915/intel_sprite.c +5 -0
index 0c650c2..3e4549a 100644
@@ -244,6 +244,7 @@ void intel_pipe_update_end(struct intel_crtc *crtc, struct intel_flip_work *work
 	u32 surf_addr = plane_state->main.offset;
 	unsigned int rotation = plane_state->base.rotation;
 	u32 stride = skl_plane_stride(fb, 0, rotation);
+	u32 aux_stride = skl_plane_stride(fb, 1, rotation);
 	int crtc_x = plane_state->base.dst.x1;
 	int crtc_y = plane_state->base.dst.y1;
 	uint32_t crtc_w = drm_rect_width(&plane_state->base.dst);
@@ -278,6 +279,10 @@ void intel_pipe_update_end(struct intel_crtc *crtc, struct intel_flip_work *work
 	I915_WRITE_FW(PLANE_OFFSET(pipe, plane_id), (y << 16) | x);
 	I915_WRITE_FW(PLANE_STRIDE(pipe, plane_id), stride);
 	I915_WRITE_FW(PLANE_SIZE(pipe, plane_id), (src_h << 16) | src_w);
+	I915_WRITE_FW(PLANE_AUX_DIST(pipe, plane_id),
+		      (plane_state->aux.offset - surf_addr) | aux_stride);
+	I915_WRITE_FW(PLANE_AUX_OFFSET(pipe, plane_id),
+		      (plane_state->aux.y << 16) | plane_state->aux.x);
 
 	/* program plane scaler */
 	if (plane_state->scaler_id >= 0) {
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw

PATCH 3/8 drm/i915: Set scaler mode for NV12

In reply to Vidya Srinivas

From: Chandra Konduru <[email protected]>

This patch sets appropriate scaler mode for NV12 format. In this mode, skylake scaler does either chroma-upsampling or chroma-upsampling and resolution scaling

v2: Review comments from Ville addressed
NV12 case to be checked first for setting the scaler

v3: Rebased (me)

---
 drivers/gpu/drm/i915/i915_reg.h     | 1 +
 drivers/gpu/drm/i915/intel_atomic.c | 8 +++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_reg.h +1 -0
index 41ddd25..5c3b120 100644
@@ -6390,6 +6390,7 @@ enum {
 #define PS_SCALER_MODE_MASK (3 << 28)
 #define PS_SCALER_MODE_DYN  (0 << 28)
 #define PS_SCALER_MODE_HQ  (1 << 28)
+#define PS_SCALER_MODE_NV12 (2 << 28)
 #define PS_PLANE_SEL_MASK  (7 << 25)
 #define PS_PLANE_SEL(plane) (((plane) + 1) << 25)
 #define PS_FILTER_MASK         (3 << 23)
drivers/gpu/drm/i915/intel_atomic.c +7 -1
index 36d4e63..808f8e6 100644
@@ -325,7 +325,13 @@ int intel_atomic_setup_scalers(struct drm_i915_private *dev_priv,
 		}
 
 		/* set scaler mode */
-		if (IS_GEMINILAKE(dev_priv) || IS_CANNONLAKE(dev_priv)) {
+		if (plane_state && plane_state->base.fb &&
+			plane_state->base.fb->format->format ==
+			DRM_FORMAT_NV12) {
+			DRM_ERROR("NV12 format setting scaler mode\n");
+			scaler_state->scalers[*scaler_id].mode =
+				PS_SCALER_MODE_NV12;
+		} else if (IS_GEMINILAKE(dev_priv) || IS_CANNONLAKE(dev_priv)) {
 			scaler_state->scalers[*scaler_id].mode = 0;
 		} else if (num_scalers_need == 1 && intel_crtc->pipe != PIPE_C) {
 			/*
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tested-by Reviewed-by on v1 3/8
#4 lore raw

Re: [PATCH 3/8] drm/i915: Set scaler mode for NV12

-Clint

Quoted 41 lines · Vidya Srinivas

From: Chandra Konduru <[email protected]>

This patch sets appropriate scaler mode for NV12 format. In this mode, skylake scaler does either chroma-upsampling or chroma-upsampling and resolution scaling

v2: Review comments from Ville addressed
NV12 case to be checked first for setting the scaler

v3: Rebased (me)

---
  drivers/gpu/drm/i915/i915_reg.h     | 1 +
  drivers/gpu/drm/i915/intel_atomic.c | 8 +++++++-
  2 files changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_reg.h +1 -0
index 41ddd25..5c3b120 100644
@@ -6390,6 +6390,7 @@ enum {
  #define PS_SCALER_MODE_MASK (3 << 28)
  #define PS_SCALER_MODE_DYN  (0 << 28)
  #define PS_SCALER_MODE_HQ  (1 << 28)
+#define PS_SCALER_MODE_NV12 (2 << 28)
  #define PS_PLANE_SEL_MASK  (7 << 25)
  #define PS_PLANE_SEL(plane) (((plane) + 1) << 25)
  #define PS_FILTER_MASK         (3 << 23)
drivers/gpu/drm/i915/intel_atomic.c +0 -1
index 36d4e63..808f8e6 100644
@@ -325,7 +325,13 @@ int intel_atomic_setup_scalers(struct drm_i915_private *dev_priv,
  		}
 
  		/* set scaler mode */
-		if (IS_GEMINILAKE(dev_priv) || IS_CANNONLAKE(dev_priv)) {

drivers/gpu/drm/i915/intel_atomic.c int intel_atomic_setup_scalers(struct drm_i915_private *dev_priv, · line 337

Quoted 10 lines
drivers/gpu/drm/i915/intel_atomic.c +7 -0
+		if (plane_state && plane_state->base.fb &&
+			plane_state->base.fb->format->format ==
+			DRM_FORMAT_NV12) {
+			DRM_ERROR("NV12 format setting scaler mode\n");
+			scaler_state->scalers[*scaler_id].mode =
+				PS_SCALER_MODE_NV12;
+		} else if (IS_GEMINILAKE(dev_priv) || IS_CANNONLAKE(dev_priv)) {
  			scaler_state->scalers[*scaler_id].mode = 0;
  		} else if (num_scalers_need == 1 && intel_crtc->pipe != PIPE_C) {
  			/*

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#5 lore raw

PATCH 4/8 drm/i915: Update format_is_yuv() to include NV12

In reply to Vidya Srinivas

From: Chandra Konduru <[email protected]>

This patch adds NV12 to format_is_yuv() function and made it available for both primary and sprite planes

v2:
-Use intel_ prefix for format_is_yuv (Ville)

v3: Rebased (me)

---
 drivers/gpu/drm/i915/intel_sprite.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_sprite.c +4 -3
index 3e4549a..fba8f02 100644
@@ -41,13 +41,14 @@
 #include "i915_drv.h"
 
 static bool
-format_is_yuv(uint32_t format)
+intel_format_is_yuv(uint32_t format)
 {
 	switch (format) {
 	case DRM_FORMAT_YUYV:
 	case DRM_FORMAT_UYVY:
 	case DRM_FORMAT_VYUY:
 	case DRM_FORMAT_YVYU:
+	case DRM_FORMAT_NV12:
 		return true;
 	default:
 		return false;
@@ -336,7 +337,7 @@ void intel_pipe_update_end(struct intel_crtc *crtc, struct intel_flip_work *work
 	enum plane_id plane_id = plane->id;
 
 	/* Seems RGB data bypasses the CSC always */
-	if (!format_is_yuv(format))
+	if (!intel_format_is_yuv(format))
 		return;
 
 	/*
@@ -900,7 +901,7 @@ static u32 g4x_sprite_ctl(const struct intel_crtc_state *crtc_state,
 		src_y = src->y1 >> 16;
 		src_h = drm_rect_height(src) >> 16;
 
-		if (format_is_yuv(fb->format->format)) {
+		if (intel_format_is_yuv(fb->format->format)) {
 			src_x &= ~1;
 			src_w &= ~1;
 
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tested-by Reviewed-by on v1 4/8
#6 lore raw

Re: [PATCH 4/8] drm/i915: Update format_is_yuv() to include NV12

Quoted 4 lines · Vidya Srinivas

From: Chandra Konduru <[email protected]>

This patch adds NV12 to format_is_yuv() function and made it available for both primary and sprite planes

small nit on the commit message:
static function in intel_sprite.c is not available to the primary
plane functions.

-Clint

Quoted 43 lines

v2:
-Use intel_ prefix for format_is_yuv (Ville)

v3: Rebased (me)

---
  drivers/gpu/drm/i915/intel_sprite.c | 7 ++++---
  1 file changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_sprite.c +3 -2
index 3e4549a..fba8f02 100644
@@ -41,13 +41,14 @@
  #include "i915_drv.h"
 
  static bool
-format_is_yuv(uint32_t format)
+intel_format_is_yuv(uint32_t format)
  {
  	switch (format) {
  	case DRM_FORMAT_YUYV:
  	case DRM_FORMAT_UYVY:
  	case DRM_FORMAT_VYUY:
  	case DRM_FORMAT_YVYU:
+	case DRM_FORMAT_NV12:
  		return true;
  	default:
  		return false;
@@ -336,7 +337,7 @@ void intel_pipe_update_end(struct intel_crtc *crtc, struct intel_flip_work *work
  	enum plane_id plane_id = plane->id;
 
  	/* Seems RGB data bypasses the CSC always */
-	if (!format_is_yuv(format))
+	if (!intel_format_is_yuv(format))
  		return;
 
  	/*

drivers/gpu/drm/i915/intel_sprite.c static u32 g4x_sprite_ctl(const struct intel_crtc_state *crtc_state, · line 907

Quoted 8 lines
drivers/gpu/drm/i915/intel_sprite.c +1 -1
@@ -900,7 +901,7 @@ static u32 g4x_sprite_ctl(const struct intel_crtc_state *crtc_state,
  		src_y = src->y1 >> 16;
  		src_h = drm_rect_height(src) >> 16;
 
-		if (format_is_yuv(fb->format->format)) {
+		if (intel_format_is_yuv(fb->format->format)) {
  			src_x &= ~1;
  			src_w &= ~1;
 

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#7 lore raw

PATCH 5/8 drm/i915: Upscale scaler max scale for NV12

In reply to Vidya Srinivas

From: Chandra Konduru <[email protected]>

This patch updates scaler max limit support for NV12

v2: Rebased (me)

---
 drivers/gpu/drm/i915/intel_display.c | 28 ++++++++++++++++++++--------
 drivers/gpu/drm/i915/intel_drv.h     |  3 ++-
 drivers/gpu/drm/i915/intel_sprite.c  |  3 ++-
 3 files changed, 24 insertions(+), 10 deletions(-)
drivers/gpu/drm/i915/intel_display.c +20 -8
index 18559c8..9de836e 100644
@@ -3438,6 +3438,8 @@ static u32 skl_plane_ctl_format(uint32_t pixel_format)
 		return PLANE_CTL_FORMAT_YUV422 | PLANE_CTL_YUV422_UYVY;
 	case DRM_FORMAT_VYUY:
 		return PLANE_CTL_FORMAT_YUV422 | PLANE_CTL_YUV422_VYUY;
+	case DRM_FORMAT_NV12:
+		return PLANE_CTL_FORMAT_NV12;
 	default:
 		MISSING_CASE(pixel_format);
 	}
@@ -4801,7 +4803,8 @@ static void cpt_verify_modeset(struct drm_device *dev, int pipe)
 static int
 skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach,
 		  unsigned int scaler_user, int *scaler_id,
-		  int src_w, int src_h, int dst_w, int dst_h)
+		  int src_w, int src_h, int dst_w, int dst_h,
+		  uint32_t pixel_format)
 {
 	struct intel_crtc_scaler_state *scaler_state =
 		&crtc_state->scaler_state;
@@ -4814,7 +4817,8 @@ static void cpt_verify_modeset(struct drm_device *dev, int pipe)
 	 * the 90/270 degree plane rotation cases (to match the
 	 * GTT mapping), hence no need to account for rotation here.
 	 */
-	need_scaling = src_w != dst_w || src_h != dst_h;
+	need_scaling = src_w != dst_w || src_h != dst_h ||
+					(pixel_format == DRM_FORMAT_NV12);
 
 	/*
 	 * if plane is being disabled or scaler is no more required or force detach
@@ -4878,7 +4882,7 @@ int skl_update_scaler_crtc(struct intel_crtc_state *state)
 	return skl_update_scaler(state, !state->base.active, SKL_CRTC_INDEX,
 		&state->scaler_state.scaler_id,
 		state->pipe_src_w, state->pipe_src_h,
-		adjusted_mode->crtc_hdisplay, adjusted_mode->crtc_vdisplay);
+		adjusted_mode->crtc_hdisplay, adjusted_mode->crtc_vdisplay, 0);
 }
 
 /**
@@ -4908,7 +4912,8 @@ static int skl_update_scaler_plane(struct intel_crtc_state *crtc_state,
 				drm_rect_width(&plane_state->base.src) >> 16,
 				drm_rect_height(&plane_state->base.src) >> 16,
 				drm_rect_width(&plane_state->base.dst),
-				drm_rect_height(&plane_state->base.dst));
+				drm_rect_height(&plane_state->base.dst),
+				fb ? fb->format->format : 0);
 
 	if (ret || plane_state->scaler_id < 0)
 		return ret;
@@ -4934,6 +4939,7 @@ static int skl_update_scaler_plane(struct intel_crtc_state *crtc_state,
 	case DRM_FORMAT_YVYU:
 	case DRM_FORMAT_UYVY:
 	case DRM_FORMAT_VYUY:
+	case DRM_FORMAT_NV12:
 		break;
 	default:
 		DRM_DEBUG_KMS("[PLANE:%d:%s] FB:%d unsupported scaling format 0x%x\n",
@@ -13641,7 +13647,8 @@ static int intel_atomic_commit(struct drm_device *dev,
 }
 
 int
-skl_max_scale(struct intel_crtc *intel_crtc, struct intel_crtc_state *crtc_state)
+skl_max_scale(struct intel_crtc *intel_crtc,
+	struct intel_crtc_state *crtc_state, uint32_t pixel_format)
 {
 	struct drm_i915_private *dev_priv;
 	int max_scale;
@@ -13667,8 +13674,9 @@ static int intel_atomic_commit(struct drm_device *dev,
 	 *            or
 	 *    cdclk/crtc_clock
 	 */
-	max_scale = min((1 << 16) * 3 - 1,
-			(1 << 8) * ((max_dotclk << 8) / crtc_clock));
+	max_scale = min((1 << 16) *
+				(pixel_format == DRM_FORMAT_NV12 ? 2 : 3) - 1,
+				(1 << 8) * ((max_dotclk << 8) / crtc_clock));
 
 	return max_scale;
 }
@@ -13689,7 +13697,11 @@ static int intel_atomic_commit(struct drm_device *dev,
 		/* use scaler when colorkey is not required */
 		if (state->ckey.flags == I915_SET_COLORKEY_NONE) {
 			min_scale = 1;
-			max_scale = skl_max_scale(to_intel_crtc(crtc), crtc_state);
+			max_scale = skl_max_scale(to_intel_crtc(crtc),
+						crtc_state,
+						state->base.fb ?
+						state->base.fb->format->format :
+						0);
 		}
 		can_position = true;
 	}
drivers/gpu/drm/i915/intel_drv.h +2 -1
index d93efb4..f6ebe45 100644
@@ -1480,7 +1480,8 @@ void intel_mode_from_pipe_config(struct drm_display_mode *mode,
 				 struct intel_crtc_state *pipe_config);
 
 int skl_update_scaler_crtc(struct intel_crtc_state *crtc_state);
-int skl_max_scale(struct intel_crtc *crtc, struct intel_crtc_state *crtc_state);
+int skl_max_scale(struct intel_crtc *crtc, struct intel_crtc_state *crtc_state,
+	uint32_t pixel_format);
 
 static inline u32 intel_plane_ggtt_offset(const struct intel_plane_state *state)
 {
drivers/gpu/drm/i915/intel_sprite.c +2 -1
index fba8f02..d4665d2 100644
@@ -823,7 +823,8 @@ static u32 g4x_sprite_ctl(const struct intel_crtc_state *crtc_state,
 		if (state->ckey.flags == I915_SET_COLORKEY_NONE) {
 			can_scale = 1;
 			min_scale = 1;
-			max_scale = skl_max_scale(crtc, crtc_state);
+			max_scale = skl_max_scale(crtc, crtc_state,
+							fb->format->format);
 		} else {
 			can_scale = 0;
 			min_scale = DRM_PLANE_HELPER_NO_SCALING;
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tested-by Reviewed-by on v1 5/8
#8 lore raw

Re: [PATCH 5/8] drm/i915: Upscale scaler max scale for NV12

Quoted 5 lines · Vidya Srinivas

From: Chandra Konduru <[email protected]>

This patch updates scaler max limit support for NV12

v2: Rebased (me)

Needs rebase again.

Quoted 123 lines
---
  drivers/gpu/drm/i915/intel_display.c | 28 ++++++++++++++++++++--------
  drivers/gpu/drm/i915/intel_drv.h     |  3 ++-
  drivers/gpu/drm/i915/intel_sprite.c  |  3 ++-
  3 files changed, 24 insertions(+), 10 deletions(-)
drivers/gpu/drm/i915/intel_display.c +20 -8
index 18559c8..9de836e 100644
@@ -3438,6 +3438,8 @@ static u32 skl_plane_ctl_format(uint32_t pixel_format)
  		return PLANE_CTL_FORMAT_YUV422 | PLANE_CTL_YUV422_UYVY;
  	case DRM_FORMAT_VYUY:
  		return PLANE_CTL_FORMAT_YUV422 | PLANE_CTL_YUV422_VYUY;
+	case DRM_FORMAT_NV12:
+		return PLANE_CTL_FORMAT_NV12;
  	default:
  		MISSING_CASE(pixel_format);
  	}
@@ -4801,7 +4803,8 @@ static void cpt_verify_modeset(struct drm_device *dev, int pipe)
  static int
  skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach,
  		  unsigned int scaler_user, int *scaler_id,
-		  int src_w, int src_h, int dst_w, int dst_h)
+		  int src_w, int src_h, int dst_w, int dst_h,
+		  uint32_t pixel_format)
  {
  	struct intel_crtc_scaler_state *scaler_state =
  		&crtc_state->scaler_state;
@@ -4814,7 +4817,8 @@ static void cpt_verify_modeset(struct drm_device *dev, int pipe)
  	 * the 90/270 degree plane rotation cases (to match the
  	 * GTT mapping), hence no need to account for rotation here.
  	 */
-	need_scaling = src_w != dst_w || src_h != dst_h;
+	need_scaling = src_w != dst_w || src_h != dst_h ||
+					(pixel_format == DRM_FORMAT_NV12);
 
  	/*
  	 * if plane is being disabled or scaler is no more required or force detach
@@ -4878,7 +4882,7 @@ int skl_update_scaler_crtc(struct intel_crtc_state *state)
  	return skl_update_scaler(state, !state->base.active, SKL_CRTC_INDEX,
  		&state->scaler_state.scaler_id,
  		state->pipe_src_w, state->pipe_src_h,
-		adjusted_mode->crtc_hdisplay, adjusted_mode->crtc_vdisplay);
+		adjusted_mode->crtc_hdisplay, adjusted_mode->crtc_vdisplay, 0);
  }
 
  /**
@@ -4908,7 +4912,8 @@ static int skl_update_scaler_plane(struct intel_crtc_state *crtc_state,
  				drm_rect_width(&plane_state->base.src) >> 16,
  				drm_rect_height(&plane_state->base.src) >> 16,
  				drm_rect_width(&plane_state->base.dst),
-				drm_rect_height(&plane_state->base.dst));
+				drm_rect_height(&plane_state->base.dst),
+				fb ? fb->format->format : 0);
 
  	if (ret || plane_state->scaler_id < 0)
  		return ret;
@@ -4934,6 +4939,7 @@ static int skl_update_scaler_plane(struct intel_crtc_state *crtc_state,
  	case DRM_FORMAT_YVYU:
  	case DRM_FORMAT_UYVY:
  	case DRM_FORMAT_VYUY:
+	case DRM_FORMAT_NV12:
  		break;
  	default:
  		DRM_DEBUG_KMS("[PLANE:%d:%s] FB:%d unsupported scaling format 0x%x\n",
@@ -13641,7 +13647,8 @@ static int intel_atomic_commit(struct drm_device *dev,
  }
 
  int
-skl_max_scale(struct intel_crtc *intel_crtc, struct intel_crtc_state *crtc_state)
+skl_max_scale(struct intel_crtc *intel_crtc,
+	struct intel_crtc_state *crtc_state, uint32_t pixel_format)
  {
  	struct drm_i915_private *dev_priv;
  	int max_scale;
@@ -13667,8 +13674,9 @@ static int intel_atomic_commit(struct drm_device *dev,
  	 *            or
  	 *    cdclk/crtc_clock
  	 */
-	max_scale = min((1 << 16) * 3 - 1,
-			(1 << 8) * ((max_dotclk << 8) / crtc_clock));
+	max_scale = min((1 << 16) *
+				(pixel_format == DRM_FORMAT_NV12 ? 2 : 3) - 1,
+				(1 << 8) * ((max_dotclk << 8) / crtc_clock));
 
  	return max_scale;
  }
@@ -13689,7 +13697,11 @@ static int intel_atomic_commit(struct drm_device *dev,
  		/* use scaler when colorkey is not required */
  		if (state->ckey.flags == I915_SET_COLORKEY_NONE) {
  			min_scale = 1;
-			max_scale = skl_max_scale(to_intel_crtc(crtc), crtc_state);
+			max_scale = skl_max_scale(to_intel_crtc(crtc),
+						crtc_state,
+						state->base.fb ?
+						state->base.fb->format->format :
+						0);
  		}
  		can_position = true;
  	}
drivers/gpu/drm/i915/intel_drv.h +2 -1
index d93efb4..f6ebe45 100644
@@ -1480,7 +1480,8 @@ void intel_mode_from_pipe_config(struct drm_display_mode *mode,
  				 struct intel_crtc_state *pipe_config);
 
  int skl_update_scaler_crtc(struct intel_crtc_state *crtc_state);
-int skl_max_scale(struct intel_crtc *crtc, struct intel_crtc_state *crtc_state);
+int skl_max_scale(struct intel_crtc *crtc, struct intel_crtc_state *crtc_state,
+	uint32_t pixel_format);
 
  static inline u32 intel_plane_ggtt_offset(const struct intel_plane_state *state)
  {
drivers/gpu/drm/i915/intel_sprite.c +0 -0
index fba8f02..d4665d2 100644

drivers/gpu/drm/i915/intel_sprite.c static u32 g4x_sprite_ctl(const struct intel_crtc_state *crtc_state, · line 830

Quoted 9 lines
drivers/gpu/drm/i915/intel_sprite.c +2 -1
@@ -823,7 +823,8 @@ static u32 g4x_sprite_ctl(const struct intel_crtc_state *crtc_state,
  		if (state->ckey.flags == I915_SET_COLORKEY_NONE) {
  			can_scale = 1;
  			min_scale = 1;
-			max_scale = skl_max_scale(crtc, crtc_state);
+			max_scale = skl_max_scale(crtc, crtc_state,
+							fb->format->format);
  		} else {
  			can_scale = 0;
  			min_scale = DRM_PLANE_HELPER_NO_SCALING;

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#9 lore raw

PATCH 6/8 drm/i915: Add NV12 as supported format for primary plane

In reply to Vidya Srinivas

From: Chandra Konduru <[email protected]>

This patch adds NV12 to list of supported formats for primary plane

v2: Rebased (Chandra Konduru)

v3: Rebased (me)

v4: Review comments by Ville addressed
Removed the skl_primary_formats_with_nv12 and added NV12 case in existing skl_primary_formats

---
 drivers/gpu/drm/i915/intel_display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_display.c +1 -1
index 9de836e..83b20fd 100644
@@ -85,6 +85,7 @@ static bool is_mmio_work(struct intel_flip_work *work)
 	DRM_FORMAT_YVYU,
 	DRM_FORMAT_UYVY,
 	DRM_FORMAT_VYUY,
+	DRM_FORMAT_NV12,
 };
 
 /* Cursor formats */
@@ -13984,7 +13985,6 @@ void intel_plane_destroy(struct drm_plane *plane)
 	if (INTEL_GEN(dev_priv) >= 9) {
 		intel_primary_formats = skl_primary_formats;
 		num_formats = ARRAY_SIZE(skl_primary_formats);
-
 		primary->update_plane = skylake_update_primary_plane;
 		primary->disable_plane = skylake_disable_primary_plane;
 	} else if (INTEL_GEN(dev_priv) >= 4) {
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tested-by Reviewed-by on v1 6/8
#10 lore raw

Re: [PATCH 6/8] drm/i915: Add NV12 as supported format for primary plane

Quoted 5 lines · Vidya Srinivas

From: Chandra Konduru <[email protected]>

This patch adds NV12 to list of supported formats for primary plane

Quoted 7 lines

v2: Rebased (Chandra Konduru)

v3: Rebased (me)

v4: Review comments by Ville addressed
Removed the skl_primary_formats_with_nv12 and added NV12 case in existing skl_primary_formats

-Clint

Quoted 21 lines
---
  drivers/gpu/drm/i915/intel_display.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_display.c +1 -0
index 9de836e..83b20fd 100644
@@ -85,6 +85,7 @@ static bool is_mmio_work(struct intel_flip_work *work)
  	DRM_FORMAT_YVYU,
  	DRM_FORMAT_UYVY,
  	DRM_FORMAT_VYUY,
+	DRM_FORMAT_NV12,
  };
 
  /* Cursor formats */

drivers/gpu/drm/i915/intel_display.c void intel_plane_destroy(struct drm_plane *plane) · line 13990

Quoted 7 lines
drivers/gpu/drm/i915/intel_display.c +0 -1
@@ -13984,7 +13985,6 @@ void intel_plane_destroy(struct drm_plane *plane)
  	if (INTEL_GEN(dev_priv) >= 9) {
  		intel_primary_formats = skl_primary_formats;
  		num_formats = ARRAY_SIZE(skl_primary_formats);
-
  		primary->update_plane = skylake_update_primary_plane;
  		primary->disable_plane = skylake_disable_primary_plane;
  	} else if (INTEL_GEN(dev_priv) >= 4) {

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#11 lore raw

PATCH 7/8 drm/i915: Add NV12 as supported format for sprite plane

In reply to Vidya Srinivas

From: Chandra Konduru <[email protected]>

This patch adds NV12 to list of supported formats for sprite plane.

v2: Rebased (me)

v3: Review comments by Ville addressed
- Removed skl_plane_formats_with_nv12 and added NV12 case in existing skl_plane_formats
- Added the 10bpc RGB formats

---
 drivers/gpu/drm/i915/intel_sprite.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/intel_sprite.c +3 -0
index d4665d2..2a388b6f 100644
@@ -1074,10 +1074,13 @@ int intel_sprite_set_colorkey(struct drm_device *dev, void *data,
 	DRM_FORMAT_ARGB8888,
 	DRM_FORMAT_XBGR8888,
 	DRM_FORMAT_XRGB8888,
+	DRM_FORMAT_XBGR2101010,
+	DRM_FORMAT_ABGR2101010,
 	DRM_FORMAT_YUYV,
 	DRM_FORMAT_YVYU,
 	DRM_FORMAT_UYVY,
 	DRM_FORMAT_VYUY,
+	DRM_FORMAT_NV12,
 };
 
 struct intel_plane *
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#12 lore raw

Re: [PATCH 7/8] drm/i915: Add NV12 as supported format for sprite plane

Quoted 23 lines · Vidya Srinivas

From: Chandra Konduru <[email protected]>

This patch adds NV12 to list of supported formats for sprite plane.

v2: Rebased (me)

v3: Review comments by Ville addressed
- Removed skl_plane_formats_with_nv12 and added NV12 case in existing skl_plane_formats
- Added the 10bpc RGB formats

---
  drivers/gpu/drm/i915/intel_sprite.c | 3 +++
  1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/intel_sprite.c +0 -0
index d4665d2..2a388b6f 100644

drivers/gpu/drm/i915/intel_sprite.c int intel_sprite_set_colorkey(struct drm_device *dev, void *data, · line 1078

Quoted 5 lines
drivers/gpu/drm/i915/intel_sprite.c +2 -0
@@ -1074,10 +1074,13 @@ int intel_sprite_set_colorkey(struct drm_device *dev, void *data,
  	DRM_FORMAT_ARGB8888,
  	DRM_FORMAT_XBGR8888,
  	DRM_FORMAT_XRGB8888,
+	DRM_FORMAT_XBGR2101010,
+	DRM_FORMAT_ABGR2101010,

Why are we adding 10 bit RGB formats with the NV12 series patches? Trying to set XR30 or AB30 results in error returned even though the modes are advertised for the planes.

-Clint

drivers/gpu/drm/i915/intel_sprite.c int intel_sprite_set_colorkey(struct drm_device *dev, void *data, · line 1086

Quoted 8 lines
drivers/gpu/drm/i915/intel_sprite.c +1 -0
  	DRM_FORMAT_YUYV,
  	DRM_FORMAT_YVYU,
  	DRM_FORMAT_UYVY,
  	DRM_FORMAT_VYUY,
+	DRM_FORMAT_NV12,
  };
 
  struct intel_plane *

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#13 lore raw

Re: [PATCH 7/8] drm/i915: Add NV12 as supported format for sprite plane

Quoted 38 lines

-----Original Message-----
From: Taylor, Clinton A
Sent: Friday, July 7, 2017 4:20 AM
To: Srinivas, Vidya <[email protected]>; intel- [email protected]
Subject: Re: [Intel-gfx] [PATCH 7/8] drm/i915: Add NV12 as supported format for sprite plane

drivers/gpu/drm/i915/intel_sprite.c int intel_sprite_set_colorkey(struct

Quoted 24 lines · Vidya Srinivas

From: Chandra Konduru <[email protected]>

This patch adds NV12 to list of supported formats for sprite plane.

v2: Rebased (me)

v3: Review comments by Ville addressed
- Removed skl_plane_formats_with_nv12 and added NV12 case in existing skl_plane_formats
- Added the 10bpc RGB formats

---
  drivers/gpu/drm/i915/intel_sprite.c | 3 +++
  1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/intel_sprite.c +0 -0
index d4665d2..2a388b6f 100644
@@ -1074,10 +1074,13 @@ int intel_sprite_set_colorkey(struct

drm_device *dev, void *data,

Quoted 9 lines

drivers/gpu/drm/i915/intel_sprite.c int intel_sprite_set_colorkey(struct drm_device *dev, void *data, · line 1078

Quoted 5 lines
drivers/gpu/drm/i915/intel_sprite.c +2 -0
  	DRM_FORMAT_ARGB8888,
  	DRM_FORMAT_XBGR8888,
  	DRM_FORMAT_XRGB8888,
+	DRM_FORMAT_XBGR2101010,
+	DRM_FORMAT_ABGR2101010,

Why are we adding 10 bit RGB formats with the NV12 series patches? Trying to set XR30 or AB30 results in error returned even though the modes are advertised for the planes.

Thank you. I will address the review comments and re-send the patches after rebasing.

Regards
Vidya

Quoted 11 lines

-Clint

drivers/gpu/drm/i915/intel_sprite.c int intel_sprite_set_colorkey(struct drm_device *dev, void *data, · line 1086

Quoted 8 lines
drivers/gpu/drm/i915/intel_sprite.c +1 -0
  	DRM_FORMAT_YUYV,
  	DRM_FORMAT_YVYU,
  	DRM_FORMAT_UYVY,
  	DRM_FORMAT_VYUY,
+	DRM_FORMAT_NV12,
  };
 
  struct intel_plane *

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#14 lore raw

PATCH 8/8 drm/i915: Add NV12 support to intel_framebuffer_init

In reply to Vidya Srinivas

From: Chandra Konduru <[email protected]>

This patch adds NV12 as supported format
to intel_framebuffer_init and performs various checks.

v2:
-Fix an issue in checks added (Chandra Konduru)

v3: rebased (me)

v4: Review comments by Ville addressed
Added platform check for NV12 in intel_framebuffer_init Removed offset checks for NV12 case

---
 drivers/gpu/drm/i915/intel_display.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/i915/intel_display.c +4 -0
index 83b20fd..56fd9ae 100644
@@ -14765,6 +14765,10 @@ static int intel_framebuffer_init(struct intel_framebuffer *intel_fb,
 			goto err;
 		}
 		break;
+	case DRM_FORMAT_NV12:
+		if (INTEL_GEN(dev_priv) >= 9)
+			break;
+		goto err;
 	default:
 		DRM_DEBUG_KMS("unsupported pixel format: %s\n",
 			      drm_get_format_name(mode_cmd->pixel_format, &format_name));
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tested-by Reviewed-by on v1 8/8
#15 lore raw

Re: [PATCH 8/8] drm/i915: Add NV12 support to intel_framebuffer_init

Quoted 26 lines · Vidya Srinivas

From: Chandra Konduru <[email protected]>

This patch adds NV12 as supported format
to intel_framebuffer_init and performs various checks.

v2:
-Fix an issue in checks added (Chandra Konduru)

v3: rebased (me)

v4: Review comments by Ville addressed
Added platform check for NV12 in intel_framebuffer_init Removed offset checks for NV12 case

---
  drivers/gpu/drm/i915/intel_display.c | 4 ++++
  1 file changed, 4 insertions(+)
drivers/gpu/drm/i915/intel_display.c +0 -0
index 83b20fd..56fd9ae 100644

drivers/gpu/drm/i915/intel_display.c static int intel_framebuffer_init(struct intel_framebuffer *intel_fb, · line 14771

Quoted 7 lines
drivers/gpu/drm/i915/intel_display.c +4 -0
@@ -14765,6 +14765,10 @@ static int intel_framebuffer_init(struct intel_framebuffer *intel_fb,
  			goto err;
  		}
  		break;
+	case DRM_FORMAT_NV12:
+		if (INTEL_GEN(dev_priv) >= 9)
+			break;
+		goto err;

This NV12 support only correctly works on SKL. Plane color space conversion is different on GLK and later platforms causing the colors to display incorrectly. Ville's plane color space property patch series in review will fix this issue.

-Clint

drivers/gpu/drm/i915/intel_display.c static int intel_framebuffer_init(struct intel_framebuffer *intel_fb, · line 14774

Quoted 3 lines
drivers/gpu/drm/i915/intel_display.c +0 -0
  	default:
  		DRM_DEBUG_KMS("unsupported pixel format: %s\n",
  			      drm_get_format_name(mode_cmd->pixel_format, &format_name));

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#16 lore raw

Re: [PATCH 8/8] drm/i915: Add NV12 support to intel_framebuffer_init

Quoted 41 lines

-----Original Message-----
From: Taylor, Clinton A
Sent: Friday, July 7, 2017 4:26 AM
To: Srinivas, Vidya <[email protected]>; intel- [email protected]
Subject: Re: [Intel-gfx] [PATCH 8/8] drm/i915: Add NV12 support to intel_framebuffer_init

drivers/gpu/drm/i915/intel_display.c static int intel_framebuffer_init(struct

Quoted 27 lines · Vidya Srinivas

From: Chandra Konduru <[email protected]>

This patch adds NV12 as supported format to intel_framebuffer_init and performs various checks.

v2:
-Fix an issue in checks added (Chandra Konduru)

v3: rebased (me)

v4: Review comments by Ville addressed
Added platform check for NV12 in intel_framebuffer_init Removed offset checks for NV12 case

---
  drivers/gpu/drm/i915/intel_display.c | 4 ++++
  1 file changed, 4 insertions(+)
drivers/gpu/drm/i915/intel_display.c +0 -0
index 83b20fd..56fd9ae 100644
@@ -14765,6 +14765,10 @@ static int intel_framebuffer_init(struct

intel_framebuffer *intel_fb,

Quoted 12 lines

drivers/gpu/drm/i915/intel_display.c static int intel_framebuffer_init(struct intel_framebuffer *intel_fb, · line 14771

Quoted 7 lines
drivers/gpu/drm/i915/intel_display.c +4 -0
  			goto err;
  		}
  		break;
+	case DRM_FORMAT_NV12:
+		if (INTEL_GEN(dev_priv) >= 9)
+			break;
+		goto err;

This NV12 support only correctly works on SKL. Plane color space conversion is different on GLK and later platforms causing the colors to display incorrectly. Ville's plane color space property patch series in review will fix this issue.

Thank you. I will address the review comments and re-send the patches after rebasing.

Quoted 9 lines

-Clint

Quoted 4 lines
drivers/gpu/drm/i915/intel_display.c +0 -0
  	default:
  		DRM_DEBUG_KMS("unsupported pixel format: %s\n",
  			      drm_get_format_name(mode_cmd-

pixel_format, &format_name));

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#17 lore raw

✓ Fi.CI.BAT: success for Adding NV12 support for SKL display (rev2)

In reply to Vidya Srinivas
== Series Details ==

== Series Details ==

Series: Adding NV12 support for SKL display (rev2)
URL : https://patchwork.freedesktop.org/series/25377/
State : success

== Summary ==

Series 25377v2 Adding NV12 support for SKL display
https://patchwork.freedesktop.org/api/1.0/series/25377/revisions/2/mbox/

Test gem_exec_flush:

        Subgroup basic-batch-kernel-default-uc:
                fail       -> PASS       (fi-snb-2600) fdo#100007
Test gem_exec_suspend:
        Subgroup basic-s4-devices:
                dmesg-warn -> PASS       (fi-kbl-7560u) fdo#100125 +1
Test kms_cursor_legacy:
        Subgroup basic-busy-flip-before-cursor-atomic:
                pass       -> FAIL       (fi-snb-2600) fdo#100215

fdo#100007 https://bugs.freedesktop.org/show_bug.cgi?id=100007
fdo#100125 https://bugs.freedesktop.org/show_bug.cgi?id=100125
fdo#100215 https://bugs.freedesktop.org/show_bug.cgi?id=100215

fi-bdw-5557u     total:278  pass:267  dwarn:0   dfail:0   fail:0   skip:11  time:468s
fi-bdw-gvtdvm    total:278  pass:256  dwarn:8   dfail:0   fail:0   skip:14  time:481s
fi-bsw-n3050     total:278  pass:242  dwarn:0   dfail:0   fail:0   skip:36  time:570s
fi-bxt-j4205     total:278  pass:259  dwarn:0   dfail:0   fail:0   skip:19  time:548s
fi-byt-j1900     total:278  pass:254  dwarn:0   dfail:0   fail:0   skip:24  time:495s
fi-byt-n2820     total:278  pass:250  dwarn:0   dfail:0   fail:0   skip:28  time:496s
fi-glk-2a        total:278  pass:259  dwarn:0   dfail:0   fail:0   skip:19  time:583s
fi-hsw-4770      total:278  pass:262  dwarn:0   dfail:0   fail:0   skip:16  time:433s
fi-hsw-4770r     total:278  pass:261  dwarn:0   dfail:0   fail:0   skip:16  time:422s
fi-ilk-650       total:278  pass:227  dwarn:0   dfail:0   fail:0   skip:50  time:457s
fi-ivb-3520m     total:278  pass:259  dwarn:0   dfail:0   fail:0   skip:18  time:497s
fi-ivb-3770      total:278  pass:259  dwarn:0   dfail:0   fail:0   skip:18  time:515s
fi-kbl-7500u     total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18  time:476s
fi-kbl-7560u     total:278  pass:268  dwarn:0   dfail:0   fail:0   skip:10  time:576s
fi-kbl-r         total:278  pass:259  dwarn:1   dfail:0   fail:0   skip:18  time:569s
fi-skl-6260u     total:278  pass:268  dwarn:0   dfail:0   fail:0   skip:10  time:489s
fi-skl-6700k     total:278  pass:256  dwarn:4   dfail:0   fail:0   skip:18  time:509s
fi-skl-6770hq    total:278  pass:268  dwarn:0   dfail:0   fail:0   skip:10  time:500s
fi-skl-gvtdvm    total:278  pass:265  dwarn:0   dfail:0   fail:0   skip:13  time:502s
fi-snb-2520m     total:278  pass:249  dwarn:0   dfail:0   fail:0   skip:28  time:620s
fi-snb-2600      total:278  pass:247  dwarn:0   dfail:0   fail:1   skip:29  time:404s

fi-skl-6700hq failed to connect after reboot

28880958b7cd59f14172c942d82182acf104d880 drm-tip: 2017y-06m-19d-21h-07m-06s UTC integration manifest a1e41f9 drm/i915: Add NV12 support to intel_framebuffer_init
67b6ec5 drm/i915: Add NV12 as supported format for sprite plane
ddacd16 drm/i915: Add NV12 as supported format for primary plane
73530b8 drm/i915: Upscale scaler max scale for NV12
facfc33 drm/i915: Update format_is_yuv() to include NV12
96b69cc drm/i915: Set scaler mode for NV12
cebb4ae drm/i915: Add render decompression support
2c7382b drm/i915: Implement .get_format_info() hook for CCS

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_4991/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx