All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/10] Expose the same formats for SKL primary/sprite planes
@ 2015-05-12 15:13 Damien Lespiau
  2015-05-12 15:13 ` [PATCH 01/10] drm/i915/skl: Leave a new line between variable declarations and code Damien Lespiau
                   ` (9 more replies)
  0 siblings, 10 replies; 26+ messages in thread
From: Damien Lespiau @ 2015-05-12 15:13 UTC (permalink / raw)
  To: intel-gfx

On Skylake, the hardware supports the same formats on all panes (well, except
NV12 which is a bit special). Make sure we expose those common formats to
user-space then.

Used libdrm's tests/modetest to inspect the list of exposed formats.

-- 
Damien

Damien Lespiau (10):
  drm/i915/skl: Leave a new line between variable declarations and code
  drm/i915/skl: Add a new line before return
  drm/i915/skl: Rename a local variable to fit in 80 chars
  drm/i915/skl: Replace BUG() by MISSING_CASE() in
    skl_plane_ctl_format()
  drm/i915/skl: Support the advertized index format
  drm/i915: Don't use the intel_ prefix for gen-specific data
  drm/i915/skl: Don't advertize ARGB2101010 and ABGR2101010
  drm/i915/skl: Make primary and sprite plane advertize the same formats
  drm/i915/skl: Factor skl_plane_get_formats()
  drm/i915: Make the sprite formats const

 drivers/gpu/drm/i915/intel_display.c | 79 ++++++++++++++++++++++++++----------
 drivers/gpu/drm/i915/intel_drv.h     |  2 +
 drivers/gpu/drm/i915/intel_sprite.c  | 23 +++--------
 3 files changed, 66 insertions(+), 38 deletions(-)

-- 
2.1.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH 01/10] drm/i915/skl: Leave a new line between variable declarations and code
  2015-05-12 15:13 [PATCH 00/10] Expose the same formats for SKL primary/sprite planes Damien Lespiau
@ 2015-05-12 15:13 ` Damien Lespiau
  2015-05-14  5:19   ` Konduru, Chandra
  2015-05-12 15:13 ` [PATCH 02/10] drm/i915/skl: Add a new line before return Damien Lespiau
                   ` (8 subsequent siblings)
  9 siblings, 1 reply; 26+ messages in thread
From: Damien Lespiau @ 2015-05-12 15:13 UTC (permalink / raw)
  To: intel-gfx

Cc: Chandra Konduru <chandra.konduru@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 895d7c7..f533519 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2954,6 +2954,7 @@ void skl_detach_scalers(struct intel_crtc *intel_crtc)
 u32 skl_plane_ctl_format(uint32_t pixel_format)
 {
 	u32 plane_ctl_format = 0;
+
 	switch (pixel_format) {
 	case DRM_FORMAT_RGB565:
 		plane_ctl_format = PLANE_CTL_FORMAT_RGB_565;
@@ -3004,6 +3005,7 @@ u32 skl_plane_ctl_format(uint32_t pixel_format)
 u32 skl_plane_ctl_tiling(uint64_t fb_modifier)
 {
 	u32 plane_ctl_tiling = 0;
+
 	switch (fb_modifier) {
 	case DRM_FORMAT_MOD_NONE:
 		break;
@@ -3025,6 +3027,7 @@ u32 skl_plane_ctl_tiling(uint64_t fb_modifier)
 u32 skl_plane_ctl_rotation(unsigned int rotation)
 {
 	u32 plane_ctl_rotation = 0;
+
 	switch (rotation) {
 	case BIT(DRM_ROTATE_0):
 		break;
-- 
2.1.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 02/10] drm/i915/skl: Add a new line before return
  2015-05-12 15:13 [PATCH 00/10] Expose the same formats for SKL primary/sprite planes Damien Lespiau
  2015-05-12 15:13 ` [PATCH 01/10] drm/i915/skl: Leave a new line between variable declarations and code Damien Lespiau
@ 2015-05-12 15:13 ` Damien Lespiau
  2015-05-14  5:20   ` Konduru, Chandra
  2015-05-12 15:13 ` [PATCH 03/10] drm/i915/skl: Rename a local variable to fit in 80 chars Damien Lespiau
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 26+ messages in thread
From: Damien Lespiau @ 2015-05-12 15:13 UTC (permalink / raw)
  To: intel-gfx

We usually use a new line before those kind of return statements. Also
the various skl_plane_ctl*() functions weren't consistent.

Cc: Chandra Konduru <chandra.konduru@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index f533519..c6419e8 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2999,6 +2999,7 @@ u32 skl_plane_ctl_format(uint32_t pixel_format)
 	default:
 		BUG();
 	}
+
 	return plane_ctl_format;
 }
 
@@ -3021,6 +3022,7 @@ u32 skl_plane_ctl_tiling(uint64_t fb_modifier)
 	default:
 		MISSING_CASE(fb_modifier);
 	}
+
 	return plane_ctl_tiling;
 }
 
-- 
2.1.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 03/10] drm/i915/skl: Rename a local variable to fit in 80 chars
  2015-05-12 15:13 [PATCH 00/10] Expose the same formats for SKL primary/sprite planes Damien Lespiau
  2015-05-12 15:13 ` [PATCH 01/10] drm/i915/skl: Leave a new line between variable declarations and code Damien Lespiau
  2015-05-12 15:13 ` [PATCH 02/10] drm/i915/skl: Add a new line before return Damien Lespiau
@ 2015-05-12 15:13 ` Damien Lespiau
  2015-05-12 16:20   ` Ville Syrjälä
  2015-05-14  5:20   ` Konduru, Chandra
  2015-05-12 15:13 ` [PATCH 04/10] drm/i915/skl: Replace BUG() by MISSING_CASE() in skl_plane_ctl_format() Damien Lespiau
                   ` (6 subsequent siblings)
  9 siblings, 2 replies; 26+ messages in thread
From: Damien Lespiau @ 2015-05-12 15:13 UTC (permalink / raw)
  To: intel-gfx

No reason to not follow the 80 chars rule, renaming the local variable
makes it easy.

Cc: Chandra Konduru <chandra.konduru@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index c6419e8..e2b01d9 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2953,17 +2953,17 @@ void skl_detach_scalers(struct intel_crtc *intel_crtc)
 
 u32 skl_plane_ctl_format(uint32_t pixel_format)
 {
-	u32 plane_ctl_format = 0;
+	u32 format = 0;
 
 	switch (pixel_format) {
 	case DRM_FORMAT_RGB565:
-		plane_ctl_format = PLANE_CTL_FORMAT_RGB_565;
+		format = PLANE_CTL_FORMAT_RGB_565;
 		break;
 	case DRM_FORMAT_XBGR8888:
-		plane_ctl_format = PLANE_CTL_FORMAT_XRGB_8888 | PLANE_CTL_ORDER_RGBX;
+		format = PLANE_CTL_FORMAT_XRGB_8888 | PLANE_CTL_ORDER_RGBX;
 		break;
 	case DRM_FORMAT_XRGB8888:
-		plane_ctl_format = PLANE_CTL_FORMAT_XRGB_8888;
+		format = PLANE_CTL_FORMAT_XRGB_8888;
 		break;
 	/*
 	 * XXX: For ARBG/ABGR formats we default to expecting scanout buffers
@@ -2971,36 +2971,36 @@ u32 skl_plane_ctl_format(uint32_t pixel_format)
 	 * DRM_FORMAT) for user-space to configure that.
 	 */
 	case DRM_FORMAT_ABGR8888:
-		plane_ctl_format = PLANE_CTL_FORMAT_XRGB_8888 | PLANE_CTL_ORDER_RGBX |
+		format = PLANE_CTL_FORMAT_XRGB_8888 | PLANE_CTL_ORDER_RGBX |
 			PLANE_CTL_ALPHA_SW_PREMULTIPLY;
 		break;
 	case DRM_FORMAT_ARGB8888:
-		plane_ctl_format = PLANE_CTL_FORMAT_XRGB_8888 |
+		format = PLANE_CTL_FORMAT_XRGB_8888 |
 			PLANE_CTL_ALPHA_SW_PREMULTIPLY;
 		break;
 	case DRM_FORMAT_XRGB2101010:
-		plane_ctl_format = PLANE_CTL_FORMAT_XRGB_2101010;
+		format = PLANE_CTL_FORMAT_XRGB_2101010;
 		break;
 	case DRM_FORMAT_XBGR2101010:
-		plane_ctl_format = PLANE_CTL_ORDER_RGBX | PLANE_CTL_FORMAT_XRGB_2101010;
+		format = PLANE_CTL_ORDER_RGBX | PLANE_CTL_FORMAT_XRGB_2101010;
 		break;
 	case DRM_FORMAT_YUYV:
-		plane_ctl_format = PLANE_CTL_FORMAT_YUV422 | PLANE_CTL_YUV422_YUYV;
+		format = PLANE_CTL_FORMAT_YUV422 | PLANE_CTL_YUV422_YUYV;
 		break;
 	case DRM_FORMAT_YVYU:
-		plane_ctl_format = PLANE_CTL_FORMAT_YUV422 | PLANE_CTL_YUV422_YVYU;
+		format = PLANE_CTL_FORMAT_YUV422 | PLANE_CTL_YUV422_YVYU;
 		break;
 	case DRM_FORMAT_UYVY:
-		plane_ctl_format = PLANE_CTL_FORMAT_YUV422 | PLANE_CTL_YUV422_UYVY;
+		format = PLANE_CTL_FORMAT_YUV422 | PLANE_CTL_YUV422_UYVY;
 		break;
 	case DRM_FORMAT_VYUY:
-		plane_ctl_format = PLANE_CTL_FORMAT_YUV422 | PLANE_CTL_YUV422_VYUY;
+		format = PLANE_CTL_FORMAT_YUV422 | PLANE_CTL_YUV422_VYUY;
 		break;
 	default:
 		BUG();
 	}
 
-	return plane_ctl_format;
+	return format;
 }
 
 u32 skl_plane_ctl_tiling(uint64_t fb_modifier)
-- 
2.1.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 04/10] drm/i915/skl: Replace BUG() by MISSING_CASE() in skl_plane_ctl_format()
  2015-05-12 15:13 [PATCH 00/10] Expose the same formats for SKL primary/sprite planes Damien Lespiau
                   ` (2 preceding siblings ...)
  2015-05-12 15:13 ` [PATCH 03/10] drm/i915/skl: Rename a local variable to fit in 80 chars Damien Lespiau
@ 2015-05-12 15:13 ` Damien Lespiau
  2015-05-14  5:24   ` Konduru, Chandra
  2015-05-12 15:13 ` [PATCH 05/10] drm/i915/skl: Support the advertized index format Damien Lespiau
                   ` (5 subsequent siblings)
  9 siblings, 1 reply; 26+ messages in thread
From: Damien Lespiau @ 2015-05-12 15:13 UTC (permalink / raw)
  To: intel-gfx

Let's be consistent with the others skl_plane_ctl_*() functions and use
a MISSING_CASE(). Not only that, but it's a rude to BUG() the whole
machine here.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index e2b01d9..49d7227 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2997,7 +2997,7 @@ u32 skl_plane_ctl_format(uint32_t pixel_format)
 		format = PLANE_CTL_FORMAT_YUV422 | PLANE_CTL_YUV422_VYUY;
 		break;
 	default:
-		BUG();
+		MISSING_CASE(pixel_format);
 	}
 
 	return format;
-- 
2.1.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 05/10] drm/i915/skl: Support the advertized index format
  2015-05-12 15:13 [PATCH 00/10] Expose the same formats for SKL primary/sprite planes Damien Lespiau
                   ` (3 preceding siblings ...)
  2015-05-12 15:13 ` [PATCH 04/10] drm/i915/skl: Replace BUG() by MISSING_CASE() in skl_plane_ctl_format() Damien Lespiau
@ 2015-05-12 15:13 ` Damien Lespiau
  2015-05-14  5:24   ` Konduru, Chandra
  2015-05-12 15:13 ` [PATCH 06/10] drm/i915: Don't use the intel_ prefix for gen-specific data Damien Lespiau
                   ` (4 subsequent siblings)
  9 siblings, 1 reply; 26+ messages in thread
From: Damien Lespiau @ 2015-05-12 15:13 UTC (permalink / raw)
  To: intel-gfx

We advertize C8 in the primary plane formats didn't have the
corresponding code to set PLANE_CTL accordingly.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 49d7227..dadb52a 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2956,6 +2956,9 @@ u32 skl_plane_ctl_format(uint32_t pixel_format)
 	u32 format = 0;
 
 	switch (pixel_format) {
+	case DRM_FORMAT_C8:
+		format = PLANE_CTL_FORMAT_INDEXED;
+		break;
 	case DRM_FORMAT_RGB565:
 		format = PLANE_CTL_FORMAT_RGB_565;
 		break;
-- 
2.1.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 06/10] drm/i915: Don't use the intel_ prefix for gen-specific data
  2015-05-12 15:13 [PATCH 00/10] Expose the same formats for SKL primary/sprite planes Damien Lespiau
                   ` (4 preceding siblings ...)
  2015-05-12 15:13 ` [PATCH 05/10] drm/i915/skl: Support the advertized index format Damien Lespiau
@ 2015-05-12 15:13 ` Damien Lespiau
  2015-05-12 16:04   ` Daniel Vetter
  2015-05-12 15:13 ` [PATCH 07/10] drm/i915/skl: Don't advertize ARGB2101010 and ABGR2101010 Damien Lespiau
                   ` (3 subsequent siblings)
  9 siblings, 1 reply; 26+ messages in thread
From: Damien Lespiau @ 2015-05-12 15:13 UTC (permalink / raw)
  To: intel-gfx

We now prefix our functions/enums/data with the first platform it has
been introduced. Do that for the primary plane formats.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index dadb52a..8adf3bf 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -53,14 +53,14 @@
 	DRM_FORMAT_ARGB8888
 
 /* Primary plane formats for gen <= 3 */
-static const uint32_t intel_primary_formats_gen2[] = {
+static const uint32_t gen2_primary_formats[] = {
 	COMMON_PRIMARY_FORMATS,
 	DRM_FORMAT_XRGB1555,
 	DRM_FORMAT_ARGB1555,
 };
 
 /* Primary plane formats for gen >= 4 */
-static const uint32_t intel_primary_formats_gen4[] = {
+static const uint32_t gen4_primary_formats[] = {
 	COMMON_PRIMARY_FORMATS, \
 	DRM_FORMAT_XBGR8888,
 	DRM_FORMAT_ABGR8888,
@@ -13288,11 +13288,11 @@ static struct drm_plane *intel_primary_plane_create(struct drm_device *dev,
 		primary->plane = !pipe;
 
 	if (INTEL_INFO(dev)->gen <= 3) {
-		intel_primary_formats = intel_primary_formats_gen2;
-		num_formats = ARRAY_SIZE(intel_primary_formats_gen2);
+		intel_primary_formats = gen2_primary_formats;
+		num_formats = ARRAY_SIZE(gen2_primary_formats);
 	} else {
-		intel_primary_formats = intel_primary_formats_gen4;
-		num_formats = ARRAY_SIZE(intel_primary_formats_gen4);
+		intel_primary_formats = gen4_primary_formats;
+		num_formats = ARRAY_SIZE(gen4_primary_formats);
 	}
 
 	drm_universal_plane_init(dev, &primary->base, 0,
-- 
2.1.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 07/10] drm/i915/skl: Don't advertize ARGB2101010 and ABGR2101010
  2015-05-12 15:13 [PATCH 00/10] Expose the same formats for SKL primary/sprite planes Damien Lespiau
                   ` (5 preceding siblings ...)
  2015-05-12 15:13 ` [PATCH 06/10] drm/i915: Don't use the intel_ prefix for gen-specific data Damien Lespiau
@ 2015-05-12 15:13 ` Damien Lespiau
  2015-05-12 16:13   ` Daniel Vetter
  2015-05-12 16:29   ` Ville Syrjälä
  2015-05-12 15:13 ` [PATCH 08/10] drm/i915/skl: Make primary and sprite plane advertize the same formats Damien Lespiau
                   ` (2 subsequent siblings)
  9 siblings, 2 replies; 26+ messages in thread
From: Damien Lespiau @ 2015-05-12 15:13 UTC (permalink / raw)
  To: intel-gfx

While we have been historically exposing those formats, but the hardware
doesn't do anything with the alpha bits. The DDX doesn't seem to
particularly care about those formats either, so just expose the
XRGB/XBGR variants.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 8adf3bf..13efade 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -70,6 +70,15 @@ static const uint32_t gen4_primary_formats[] = {
 	DRM_FORMAT_ABGR2101010,
 };
 
+
+static const uint32_t skl_primary_formats[] = {
+	COMMON_PRIMARY_FORMATS, \
+	DRM_FORMAT_XBGR8888,
+	DRM_FORMAT_ABGR8888,
+	DRM_FORMAT_XRGB2101010,
+	DRM_FORMAT_XBGR2101010,
+};
+
 /* Cursor formats */
 static const uint32_t intel_cursor_formats[] = {
 	DRM_FORMAT_ARGB8888,
@@ -13287,12 +13296,15 @@ static struct drm_plane *intel_primary_plane_create(struct drm_device *dev,
 	if (HAS_FBC(dev) && INTEL_INFO(dev)->gen < 4)
 		primary->plane = !pipe;
 
-	if (INTEL_INFO(dev)->gen <= 3) {
-		intel_primary_formats = gen2_primary_formats;
-		num_formats = ARRAY_SIZE(gen2_primary_formats);
-	} else {
+	if (INTEL_INFO(dev)->gen >= 9) {
+		intel_primary_formats = skl_primary_formats;
+		num_formats = ARRAY_SIZE(skl_primary_formats);
+	} else if (INTEL_INFO(dev)->gen >= 4) {
 		intel_primary_formats = gen4_primary_formats;
 		num_formats = ARRAY_SIZE(gen4_primary_formats);
+	} else {
+		intel_primary_formats = gen2_primary_formats;
+		num_formats = ARRAY_SIZE(gen2_primary_formats);
 	}
 
 	drm_universal_plane_init(dev, &primary->base, 0,
-- 
2.1.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 08/10] drm/i915/skl: Make primary and sprite plane advertize the same formats
  2015-05-12 15:13 [PATCH 00/10] Expose the same formats for SKL primary/sprite planes Damien Lespiau
                   ` (6 preceding siblings ...)
  2015-05-12 15:13 ` [PATCH 07/10] drm/i915/skl: Don't advertize ARGB2101010 and ABGR2101010 Damien Lespiau
@ 2015-05-12 15:13 ` Damien Lespiau
  2015-05-12 16:14   ` Daniel Vetter
  2015-05-12 16:33   ` Ville Syrjälä
  2015-05-12 15:13 ` [PATCH 09/10] drm/i915/skl: Factor skl_plane_get_formats() Damien Lespiau
  2015-05-12 15:13 ` [PATCH 10/10] drm/i915: Make the sprite formats const Damien Lespiau
  9 siblings, 2 replies; 26+ messages in thread
From: Damien Lespiau @ 2015-05-12 15:13 UTC (permalink / raw)
  To: intel-gfx

We have unified planes on SKL, they more similar than ever before and we
can advertize the same formats.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 4 ++++
 drivers/gpu/drm/i915/intel_sprite.c  | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 13efade..c32abe1 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -68,6 +68,10 @@ static const uint32_t gen4_primary_formats[] = {
 	DRM_FORMAT_ARGB2101010,
 	DRM_FORMAT_XBGR2101010,
 	DRM_FORMAT_ABGR2101010,
+	DRM_FORMAT_YUYV,
+	DRM_FORMAT_YVYU,
+	DRM_FORMAT_UYVY,
+	DRM_FORMAT_VYUY,
 };
 
 
diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
index 497e795..d510b60 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -1084,11 +1084,14 @@ static uint32_t vlv_plane_formats[] = {
 };
 
 static uint32_t skl_plane_formats[] = {
+	DRM_FORMAT_C8,
 	DRM_FORMAT_RGB565,
 	DRM_FORMAT_ABGR8888,
 	DRM_FORMAT_ARGB8888,
 	DRM_FORMAT_XBGR8888,
 	DRM_FORMAT_XRGB8888,
+	DRM_FORMAT_XBGR2101010,
+	DRM_FORMAT_XRGB2101010,
 	DRM_FORMAT_YUYV,
 	DRM_FORMAT_YVYU,
 	DRM_FORMAT_UYVY,
-- 
2.1.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 09/10] drm/i915/skl: Factor skl_plane_get_formats()
  2015-05-12 15:13 [PATCH 00/10] Expose the same formats for SKL primary/sprite planes Damien Lespiau
                   ` (7 preceding siblings ...)
  2015-05-12 15:13 ` [PATCH 08/10] drm/i915/skl: Make primary and sprite plane advertize the same formats Damien Lespiau
@ 2015-05-12 15:13 ` Damien Lespiau
  2015-05-12 15:13 ` [PATCH 10/10] drm/i915: Make the sprite formats const Damien Lespiau
  9 siblings, 0 replies; 26+ messages in thread
From: Damien Lespiau @ 2015-05-12 15:13 UTC (permalink / raw)
  To: intel-gfx

We can have a single function returns the list of formats. It's rather
simple for now but will be augmented with the NV12 work.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 27 ++++++++++++++++++++-------
 drivers/gpu/drm/i915/intel_drv.h     |  2 ++
 drivers/gpu/drm/i915/intel_sprite.c  | 20 +++-----------------
 3 files changed, 25 insertions(+), 24 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index c32abe1..980afae 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -74,13 +74,19 @@ static const uint32_t gen4_primary_formats[] = {
 	DRM_FORMAT_VYUY,
 };
 
-
-static const uint32_t skl_primary_formats[] = {
-	COMMON_PRIMARY_FORMATS, \
-	DRM_FORMAT_XBGR8888,
+static uint32_t skl_plane_formats[] = {
+	DRM_FORMAT_C8,
+	DRM_FORMAT_RGB565,
 	DRM_FORMAT_ABGR8888,
-	DRM_FORMAT_XRGB2101010,
+	DRM_FORMAT_ARGB8888,
+	DRM_FORMAT_XBGR8888,
+	DRM_FORMAT_XRGB8888,
 	DRM_FORMAT_XBGR2101010,
+	DRM_FORMAT_XRGB2101010,
+	DRM_FORMAT_YUYV,
+	DRM_FORMAT_YVYU,
+	DRM_FORMAT_UYVY,
+	DRM_FORMAT_VYUY,
 };
 
 /* Cursor formats */
@@ -2503,6 +2509,13 @@ static int i9xx_format_to_fourcc(int format)
 	}
 }
 
+void skl_plane_get_formats(int pipe, int plane,
+			   const uint32_t **formats, int *n_formats)
+{
+	*formats = skl_plane_formats;
+	*n_formats = ARRAY_SIZE(skl_plane_formats);
+}
+
 static int skl_format_to_fourcc(int format, bool rgb_order, bool alpha)
 {
 	switch (format) {
@@ -13301,8 +13314,8 @@ static struct drm_plane *intel_primary_plane_create(struct drm_device *dev,
 		primary->plane = !pipe;
 
 	if (INTEL_INFO(dev)->gen >= 9) {
-		intel_primary_formats = skl_primary_formats;
-		num_formats = ARRAY_SIZE(skl_primary_formats);
+		skl_plane_get_formats(pipe, 0,
+				      &intel_primary_formats, &num_formats);
 	} else if (INTEL_INFO(dev)->gen >= 4) {
 		intel_primary_formats = gen4_primary_formats;
 		num_formats = ARRAY_SIZE(gen4_primary_formats);
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 47bc729..0277ca6 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -1143,6 +1143,8 @@ int skl_max_scale(struct intel_crtc *crtc, struct intel_crtc_state *crtc_state);
 
 unsigned long intel_plane_obj_offset(struct intel_plane *intel_plane,
 				     struct drm_i915_gem_object *obj);
+void skl_plane_get_formats(int pipe, int plane,
+			   const uint32_t **formats, int *n_formats);
 u32 skl_plane_ctl_format(uint32_t pixel_format);
 u32 skl_plane_ctl_tiling(uint64_t fb_modifier);
 u32 skl_plane_ctl_rotation(unsigned int rotation);
diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
index d510b60..21950f0 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -1083,21 +1083,6 @@ static uint32_t vlv_plane_formats[] = {
 	DRM_FORMAT_VYUY,
 };
 
-static uint32_t skl_plane_formats[] = {
-	DRM_FORMAT_C8,
-	DRM_FORMAT_RGB565,
-	DRM_FORMAT_ABGR8888,
-	DRM_FORMAT_ARGB8888,
-	DRM_FORMAT_XBGR8888,
-	DRM_FORMAT_XRGB8888,
-	DRM_FORMAT_XBGR2101010,
-	DRM_FORMAT_XRGB2101010,
-	DRM_FORMAT_YUYV,
-	DRM_FORMAT_YVYU,
-	DRM_FORMAT_UYVY,
-	DRM_FORMAT_VYUY,
-};
-
 int
 intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane)
 {
@@ -1169,8 +1154,9 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane)
 		intel_plane->disable_plane = skl_disable_plane;
 		state->scaler_id = -1;
 
-		plane_formats = skl_plane_formats;
-		num_plane_formats = ARRAY_SIZE(skl_plane_formats);
+		/* plane + 1 because plane is the sprite number here */
+		skl_plane_get_formats(pipe, plane + 1,
+				      &plane_formats, &num_plane_formats);
 		break;
 	default:
 		kfree(intel_plane);
-- 
2.1.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 10/10] drm/i915: Make the sprite formats const
  2015-05-12 15:13 [PATCH 00/10] Expose the same formats for SKL primary/sprite planes Damien Lespiau
                   ` (8 preceding siblings ...)
  2015-05-12 15:13 ` [PATCH 09/10] drm/i915/skl: Factor skl_plane_get_formats() Damien Lespiau
@ 2015-05-12 15:13 ` Damien Lespiau
  2015-05-12 16:14   ` Daniel Vetter
  9 siblings, 1 reply; 26+ messages in thread
From: Damien Lespiau @ 2015-05-12 15:13 UTC (permalink / raw)
  To: intel-gfx

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
---
 drivers/gpu/drm/i915/intel_sprite.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
index 21950f0..c8d4644 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -1052,7 +1052,7 @@ int intel_plane_restore(struct drm_plane *plane)
 				       plane->state->src_w, plane->state->src_h);
 }
 
-static uint32_t ilk_plane_formats[] = {
+static const uint32_t ilk_plane_formats[] = {
 	DRM_FORMAT_XRGB8888,
 	DRM_FORMAT_YUYV,
 	DRM_FORMAT_YVYU,
@@ -1060,7 +1060,7 @@ static uint32_t ilk_plane_formats[] = {
 	DRM_FORMAT_VYUY,
 };
 
-static uint32_t snb_plane_formats[] = {
+static const uint32_t snb_plane_formats[] = {
 	DRM_FORMAT_XBGR8888,
 	DRM_FORMAT_XRGB8888,
 	DRM_FORMAT_YUYV,
@@ -1069,7 +1069,7 @@ static uint32_t snb_plane_formats[] = {
 	DRM_FORMAT_VYUY,
 };
 
-static uint32_t vlv_plane_formats[] = {
+static const uint32_t vlv_plane_formats[] = {
 	DRM_FORMAT_RGB565,
 	DRM_FORMAT_ABGR8888,
 	DRM_FORMAT_ARGB8888,
-- 
2.1.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [PATCH 06/10] drm/i915: Don't use the intel_ prefix for gen-specific data
  2015-05-12 15:13 ` [PATCH 06/10] drm/i915: Don't use the intel_ prefix for gen-specific data Damien Lespiau
@ 2015-05-12 16:04   ` Daniel Vetter
  2015-05-12 16:09     ` Daniel Vetter
  0 siblings, 1 reply; 26+ messages in thread
From: Daniel Vetter @ 2015-05-12 16:04 UTC (permalink / raw)
  To: Damien Lespiau; +Cc: intel-gfx

On Tue, May 12, 2015 at 04:13:18PM +0100, Damien Lespiau wrote:
> We now prefix our functions/enums/data with the first platform it has
> been introduced. Do that for the primary plane formats.
> 
> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index dadb52a..8adf3bf 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -53,14 +53,14 @@
>  	DRM_FORMAT_ARGB8888
>  
>  /* Primary plane formats for gen <= 3 */
> -static const uint32_t intel_primary_formats_gen2[] = {
> +static const uint32_t gen2_primary_formats[] = {

i8xx_

>  	COMMON_PRIMARY_FORMATS,
>  	DRM_FORMAT_XRGB1555,
>  	DRM_FORMAT_ARGB1555,
>  };
>  
>  /* Primary plane formats for gen >= 4 */
> -static const uint32_t intel_primary_formats_gen4[] = {
> +static const uint32_t gen4_primary_formats[] = {

i965_

Generally we use genX_ for the GT side of things and these iXXX_ names for
display (before ironlake) and codenames like ilk_/skl_ afterwards.
Exceptions do occur, but I think it'd be nice to be consistent here.

Merged all the preeceding patches to dinq, thanks.
-Daniel

>  	COMMON_PRIMARY_FORMATS, \
>  	DRM_FORMAT_XBGR8888,
>  	DRM_FORMAT_ABGR8888,
> @@ -13288,11 +13288,11 @@ static struct drm_plane *intel_primary_plane_create(struct drm_device *dev,
>  		primary->plane = !pipe;
>  
>  	if (INTEL_INFO(dev)->gen <= 3) {
> -		intel_primary_formats = intel_primary_formats_gen2;
> -		num_formats = ARRAY_SIZE(intel_primary_formats_gen2);
> +		intel_primary_formats = gen2_primary_formats;
> +		num_formats = ARRAY_SIZE(gen2_primary_formats);
>  	} else {
> -		intel_primary_formats = intel_primary_formats_gen4;
> -		num_formats = ARRAY_SIZE(intel_primary_formats_gen4);
> +		intel_primary_formats = gen4_primary_formats;
> +		num_formats = ARRAY_SIZE(gen4_primary_formats);
>  	}
>  
>  	drm_universal_plane_init(dev, &primary->base, 0,
> -- 
> 2.1.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 06/10] drm/i915: Don't use the intel_ prefix for gen-specific data
  2015-05-12 16:04   ` Daniel Vetter
@ 2015-05-12 16:09     ` Daniel Vetter
  0 siblings, 0 replies; 26+ messages in thread
From: Daniel Vetter @ 2015-05-12 16:09 UTC (permalink / raw)
  To: Damien Lespiau; +Cc: intel-gfx

On Tue, May 12, 2015 at 06:04:56PM +0200, Daniel Vetter wrote:
> On Tue, May 12, 2015 at 04:13:18PM +0100, Damien Lespiau wrote:
> > We now prefix our functions/enums/data with the first platform it has
> > been introduced. Do that for the primary plane formats.
> > 
> > Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_display.c | 12 ++++++------
> >  1 file changed, 6 insertions(+), 6 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index dadb52a..8adf3bf 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -53,14 +53,14 @@
> >  	DRM_FORMAT_ARGB8888
> >  
> >  /* Primary plane formats for gen <= 3 */
> > -static const uint32_t intel_primary_formats_gen2[] = {
> > +static const uint32_t gen2_primary_formats[] = {
> 
> i8xx_
> 
> >  	COMMON_PRIMARY_FORMATS,
> >  	DRM_FORMAT_XRGB1555,
> >  	DRM_FORMAT_ARGB1555,
> >  };
> >  
> >  /* Primary plane formats for gen >= 4 */
> > -static const uint32_t intel_primary_formats_gen4[] = {
> > +static const uint32_t gen4_primary_formats[] = {
> 
> i965_
> 
> Generally we use genX_ for the GT side of things and these iXXX_ names for
> display (before ironlake) and codenames like ilk_/skl_ afterwards.
> Exceptions do occur, but I think it'd be nice to be consistent here.
> 
> Merged all the preeceding patches to dinq, thanks.

Well used sed to repaint and applied directly. Please scream if you
dislike ;-)
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 07/10] drm/i915/skl: Don't advertize ARGB2101010 and ABGR2101010
  2015-05-12 15:13 ` [PATCH 07/10] drm/i915/skl: Don't advertize ARGB2101010 and ABGR2101010 Damien Lespiau
@ 2015-05-12 16:13   ` Daniel Vetter
  2015-05-12 16:18     ` Damien Lespiau
  2015-05-12 16:29   ` Ville Syrjälä
  1 sibling, 1 reply; 26+ messages in thread
From: Daniel Vetter @ 2015-05-12 16:13 UTC (permalink / raw)
  To: Damien Lespiau; +Cc: intel-gfx

On Tue, May 12, 2015 at 04:13:19PM +0100, Damien Lespiau wrote:
> While we have been historically exposing those formats, but the hardware
> doesn't do anything with the alpha bits. The DDX doesn't seem to
> particularly care about those formats either, so just expose the
> XRGB/XBGR variants.
> 
> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>

We have this problem with all the primary planes. Imo we should remove
this everywhere, since the ddx doesn't seem to care.
-Daniel

> ---
>  drivers/gpu/drm/i915/intel_display.c | 20 ++++++++++++++++----
>  1 file changed, 16 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 8adf3bf..13efade 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -70,6 +70,15 @@ static const uint32_t gen4_primary_formats[] = {
>  	DRM_FORMAT_ABGR2101010,
>  };
>  
> +
> +static const uint32_t skl_primary_formats[] = {
> +	COMMON_PRIMARY_FORMATS, \
> +	DRM_FORMAT_XBGR8888,
> +	DRM_FORMAT_ABGR8888,
> +	DRM_FORMAT_XRGB2101010,
> +	DRM_FORMAT_XBGR2101010,
> +};
> +
>  /* Cursor formats */
>  static const uint32_t intel_cursor_formats[] = {
>  	DRM_FORMAT_ARGB8888,
> @@ -13287,12 +13296,15 @@ static struct drm_plane *intel_primary_plane_create(struct drm_device *dev,
>  	if (HAS_FBC(dev) && INTEL_INFO(dev)->gen < 4)
>  		primary->plane = !pipe;
>  
> -	if (INTEL_INFO(dev)->gen <= 3) {
> -		intel_primary_formats = gen2_primary_formats;
> -		num_formats = ARRAY_SIZE(gen2_primary_formats);
> -	} else {
> +	if (INTEL_INFO(dev)->gen >= 9) {
> +		intel_primary_formats = skl_primary_formats;
> +		num_formats = ARRAY_SIZE(skl_primary_formats);
> +	} else if (INTEL_INFO(dev)->gen >= 4) {
>  		intel_primary_formats = gen4_primary_formats;
>  		num_formats = ARRAY_SIZE(gen4_primary_formats);
> +	} else {
> +		intel_primary_formats = gen2_primary_formats;
> +		num_formats = ARRAY_SIZE(gen2_primary_formats);
>  	}
>  
>  	drm_universal_plane_init(dev, &primary->base, 0,
> -- 
> 2.1.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 08/10] drm/i915/skl: Make primary and sprite plane advertize the same formats
  2015-05-12 15:13 ` [PATCH 08/10] drm/i915/skl: Make primary and sprite plane advertize the same formats Damien Lespiau
@ 2015-05-12 16:14   ` Daniel Vetter
  2015-05-12 16:33   ` Ville Syrjälä
  1 sibling, 0 replies; 26+ messages in thread
From: Daniel Vetter @ 2015-05-12 16:14 UTC (permalink / raw)
  To: Damien Lespiau; +Cc: intel-gfx

On Tue, May 12, 2015 at 04:13:20PM +0100, Damien Lespiau wrote:
> We have unified planes on SKL, they more similar than ever before and we
> can advertize the same formats.
> 
> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>

needs an igt patch to exercise the primary plane yuv support imo.
-Daniel

> ---
>  drivers/gpu/drm/i915/intel_display.c | 4 ++++
>  drivers/gpu/drm/i915/intel_sprite.c  | 3 +++
>  2 files changed, 7 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 13efade..c32abe1 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -68,6 +68,10 @@ static const uint32_t gen4_primary_formats[] = {
>  	DRM_FORMAT_ARGB2101010,
>  	DRM_FORMAT_XBGR2101010,
>  	DRM_FORMAT_ABGR2101010,
> +	DRM_FORMAT_YUYV,
> +	DRM_FORMAT_YVYU,
> +	DRM_FORMAT_UYVY,
> +	DRM_FORMAT_VYUY,
>  };
>  
>  
> diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
> index 497e795..d510b60 100644
> --- a/drivers/gpu/drm/i915/intel_sprite.c
> +++ b/drivers/gpu/drm/i915/intel_sprite.c
> @@ -1084,11 +1084,14 @@ static uint32_t vlv_plane_formats[] = {
>  };
>  
>  static uint32_t skl_plane_formats[] = {
> +	DRM_FORMAT_C8,
>  	DRM_FORMAT_RGB565,
>  	DRM_FORMAT_ABGR8888,
>  	DRM_FORMAT_ARGB8888,
>  	DRM_FORMAT_XBGR8888,
>  	DRM_FORMAT_XRGB8888,
> +	DRM_FORMAT_XBGR2101010,
> +	DRM_FORMAT_XRGB2101010,
>  	DRM_FORMAT_YUYV,
>  	DRM_FORMAT_YVYU,
>  	DRM_FORMAT_UYVY,
> -- 
> 2.1.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 10/10] drm/i915: Make the sprite formats const
  2015-05-12 15:13 ` [PATCH 10/10] drm/i915: Make the sprite formats const Damien Lespiau
@ 2015-05-12 16:14   ` Daniel Vetter
  0 siblings, 0 replies; 26+ messages in thread
From: Daniel Vetter @ 2015-05-12 16:14 UTC (permalink / raw)
  To: Damien Lespiau; +Cc: intel-gfx

On Tue, May 12, 2015 at 04:13:22PM +0100, Damien Lespiau wrote:
> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>

Queued for -next, thanks for the patch.
-Daniel

> ---
>  drivers/gpu/drm/i915/intel_sprite.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
> index 21950f0..c8d4644 100644
> --- a/drivers/gpu/drm/i915/intel_sprite.c
> +++ b/drivers/gpu/drm/i915/intel_sprite.c
> @@ -1052,7 +1052,7 @@ int intel_plane_restore(struct drm_plane *plane)
>  				       plane->state->src_w, plane->state->src_h);
>  }
>  
> -static uint32_t ilk_plane_formats[] = {
> +static const uint32_t ilk_plane_formats[] = {
>  	DRM_FORMAT_XRGB8888,
>  	DRM_FORMAT_YUYV,
>  	DRM_FORMAT_YVYU,
> @@ -1060,7 +1060,7 @@ static uint32_t ilk_plane_formats[] = {
>  	DRM_FORMAT_VYUY,
>  };
>  
> -static uint32_t snb_plane_formats[] = {
> +static const uint32_t snb_plane_formats[] = {
>  	DRM_FORMAT_XBGR8888,
>  	DRM_FORMAT_XRGB8888,
>  	DRM_FORMAT_YUYV,
> @@ -1069,7 +1069,7 @@ static uint32_t snb_plane_formats[] = {
>  	DRM_FORMAT_VYUY,
>  };
>  
> -static uint32_t vlv_plane_formats[] = {
> +static const uint32_t vlv_plane_formats[] = {
>  	DRM_FORMAT_RGB565,
>  	DRM_FORMAT_ABGR8888,
>  	DRM_FORMAT_ARGB8888,
> -- 
> 2.1.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 07/10] drm/i915/skl: Don't advertize ARGB2101010 and ABGR2101010
  2015-05-12 16:13   ` Daniel Vetter
@ 2015-05-12 16:18     ` Damien Lespiau
  2015-05-12 16:48       ` Daniel Vetter
  0 siblings, 1 reply; 26+ messages in thread
From: Damien Lespiau @ 2015-05-12 16:18 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: intel-gfx

On Tue, May 12, 2015 at 06:13:25PM +0200, Daniel Vetter wrote:
> On Tue, May 12, 2015 at 04:13:19PM +0100, Damien Lespiau wrote:
> > While we have been historically exposing those formats, but the hardware
> > doesn't do anything with the alpha bits. The DDX doesn't seem to
> > particularly care about those formats either, so just expose the
> > XRGB/XBGR variants.
> > 
> > Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
> 
> We have this problem with all the primary planes. Imo we should remove
> this everywhere, since the ddx doesn't seem to care.

Well technically that'd be breaking ABI (very unlikely, but still). So
I'd rather have this SKL-specific patch (because we haven't committed to
SKL just yet) separate from the patch removing the formats for previous
platforms in case we need to revert. I'll cook the patch for previous
platform as a follow up.

-- 
Damien
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 03/10] drm/i915/skl: Rename a local variable to fit in 80 chars
  2015-05-12 15:13 ` [PATCH 03/10] drm/i915/skl: Rename a local variable to fit in 80 chars Damien Lespiau
@ 2015-05-12 16:20   ` Ville Syrjälä
  2015-05-14  5:20   ` Konduru, Chandra
  1 sibling, 0 replies; 26+ messages in thread
From: Ville Syrjälä @ 2015-05-12 16:20 UTC (permalink / raw)
  To: Damien Lespiau; +Cc: intel-gfx

On Tue, May 12, 2015 at 04:13:15PM +0100, Damien Lespiau wrote:
> No reason to not follow the 80 chars rule, renaming the local variable
> makes it easy.

Or you could just kill the pointless local variable from all of these
functions.

> 
> Cc: Chandra Konduru <chandra.konduru@intel.com>
> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 26 +++++++++++++-------------
>  1 file changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index c6419e8..e2b01d9 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -2953,17 +2953,17 @@ void skl_detach_scalers(struct intel_crtc *intel_crtc)
>  
>  u32 skl_plane_ctl_format(uint32_t pixel_format)
>  {
> -	u32 plane_ctl_format = 0;
> +	u32 format = 0;
>  
>  	switch (pixel_format) {
>  	case DRM_FORMAT_RGB565:
> -		plane_ctl_format = PLANE_CTL_FORMAT_RGB_565;
> +		format = PLANE_CTL_FORMAT_RGB_565;
>  		break;
>  	case DRM_FORMAT_XBGR8888:
> -		plane_ctl_format = PLANE_CTL_FORMAT_XRGB_8888 | PLANE_CTL_ORDER_RGBX;
> +		format = PLANE_CTL_FORMAT_XRGB_8888 | PLANE_CTL_ORDER_RGBX;
>  		break;
>  	case DRM_FORMAT_XRGB8888:
> -		plane_ctl_format = PLANE_CTL_FORMAT_XRGB_8888;
> +		format = PLANE_CTL_FORMAT_XRGB_8888;
>  		break;
>  	/*
>  	 * XXX: For ARBG/ABGR formats we default to expecting scanout buffers
> @@ -2971,36 +2971,36 @@ u32 skl_plane_ctl_format(uint32_t pixel_format)
>  	 * DRM_FORMAT) for user-space to configure that.
>  	 */
>  	case DRM_FORMAT_ABGR8888:
> -		plane_ctl_format = PLANE_CTL_FORMAT_XRGB_8888 | PLANE_CTL_ORDER_RGBX |
> +		format = PLANE_CTL_FORMAT_XRGB_8888 | PLANE_CTL_ORDER_RGBX |
>  			PLANE_CTL_ALPHA_SW_PREMULTIPLY;
>  		break;
>  	case DRM_FORMAT_ARGB8888:
> -		plane_ctl_format = PLANE_CTL_FORMAT_XRGB_8888 |
> +		format = PLANE_CTL_FORMAT_XRGB_8888 |
>  			PLANE_CTL_ALPHA_SW_PREMULTIPLY;
>  		break;
>  	case DRM_FORMAT_XRGB2101010:
> -		plane_ctl_format = PLANE_CTL_FORMAT_XRGB_2101010;
> +		format = PLANE_CTL_FORMAT_XRGB_2101010;
>  		break;
>  	case DRM_FORMAT_XBGR2101010:
> -		plane_ctl_format = PLANE_CTL_ORDER_RGBX | PLANE_CTL_FORMAT_XRGB_2101010;
> +		format = PLANE_CTL_ORDER_RGBX | PLANE_CTL_FORMAT_XRGB_2101010;
>  		break;
>  	case DRM_FORMAT_YUYV:
> -		plane_ctl_format = PLANE_CTL_FORMAT_YUV422 | PLANE_CTL_YUV422_YUYV;
> +		format = PLANE_CTL_FORMAT_YUV422 | PLANE_CTL_YUV422_YUYV;
>  		break;
>  	case DRM_FORMAT_YVYU:
> -		plane_ctl_format = PLANE_CTL_FORMAT_YUV422 | PLANE_CTL_YUV422_YVYU;
> +		format = PLANE_CTL_FORMAT_YUV422 | PLANE_CTL_YUV422_YVYU;
>  		break;
>  	case DRM_FORMAT_UYVY:
> -		plane_ctl_format = PLANE_CTL_FORMAT_YUV422 | PLANE_CTL_YUV422_UYVY;
> +		format = PLANE_CTL_FORMAT_YUV422 | PLANE_CTL_YUV422_UYVY;
>  		break;
>  	case DRM_FORMAT_VYUY:
> -		plane_ctl_format = PLANE_CTL_FORMAT_YUV422 | PLANE_CTL_YUV422_VYUY;
> +		format = PLANE_CTL_FORMAT_YUV422 | PLANE_CTL_YUV422_VYUY;
>  		break;
>  	default:
>  		BUG();
>  	}
>  
> -	return plane_ctl_format;
> +	return format;
>  }
>  
>  u32 skl_plane_ctl_tiling(uint64_t fb_modifier)
> -- 
> 2.1.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 07/10] drm/i915/skl: Don't advertize ARGB2101010 and ABGR2101010
  2015-05-12 15:13 ` [PATCH 07/10] drm/i915/skl: Don't advertize ARGB2101010 and ABGR2101010 Damien Lespiau
  2015-05-12 16:13   ` Daniel Vetter
@ 2015-05-12 16:29   ` Ville Syrjälä
  1 sibling, 0 replies; 26+ messages in thread
From: Ville Syrjälä @ 2015-05-12 16:29 UTC (permalink / raw)
  To: Damien Lespiau; +Cc: intel-gfx

On Tue, May 12, 2015 at 04:13:19PM +0100, Damien Lespiau wrote:
> While we have been historically exposing those formats, but the hardware
> doesn't do anything with the alpha bits. The DDX doesn't seem to
> particularly care about those formats either, so just expose the
> XRGB/XBGR variants.
> 
> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 20 ++++++++++++++++----
>  1 file changed, 16 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 8adf3bf..13efade 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -70,6 +70,15 @@ static const uint32_t gen4_primary_formats[] = {
>  	DRM_FORMAT_ABGR2101010,
>  };
>  
> +
> +static const uint32_t skl_primary_formats[] = {
> +	COMMON_PRIMARY_FORMATS, \

Please kill COMMON_PRIMARY_FORMATS. It's making it hard to figure out
which formats are actually listed here.

> +	DRM_FORMAT_XBGR8888,
> +	DRM_FORMAT_ABGR8888,
> +	DRM_FORMAT_XRGB2101010,
> +	DRM_FORMAT_XBGR2101010,
> +};
> +
>  /* Cursor formats */
>  static const uint32_t intel_cursor_formats[] = {
>  	DRM_FORMAT_ARGB8888,
> @@ -13287,12 +13296,15 @@ static struct drm_plane *intel_primary_plane_create(struct drm_device *dev,
>  	if (HAS_FBC(dev) && INTEL_INFO(dev)->gen < 4)
>  		primary->plane = !pipe;
>  
> -	if (INTEL_INFO(dev)->gen <= 3) {
> -		intel_primary_formats = gen2_primary_formats;
> -		num_formats = ARRAY_SIZE(gen2_primary_formats);
> -	} else {
> +	if (INTEL_INFO(dev)->gen >= 9) {
> +		intel_primary_formats = skl_primary_formats;
> +		num_formats = ARRAY_SIZE(skl_primary_formats);
> +	} else if (INTEL_INFO(dev)->gen >= 4) {
>  		intel_primary_formats = gen4_primary_formats;
>  		num_formats = ARRAY_SIZE(gen4_primary_formats);
> +	} else {
> +		intel_primary_formats = gen2_primary_formats;
> +		num_formats = ARRAY_SIZE(gen2_primary_formats);
>  	}
>  
>  	drm_universal_plane_init(dev, &primary->base, 0,
> -- 
> 2.1.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 08/10] drm/i915/skl: Make primary and sprite plane advertize the same formats
  2015-05-12 15:13 ` [PATCH 08/10] drm/i915/skl: Make primary and sprite plane advertize the same formats Damien Lespiau
  2015-05-12 16:14   ` Daniel Vetter
@ 2015-05-12 16:33   ` Ville Syrjälä
  1 sibling, 0 replies; 26+ messages in thread
From: Ville Syrjälä @ 2015-05-12 16:33 UTC (permalink / raw)
  To: Damien Lespiau; +Cc: intel-gfx

On Tue, May 12, 2015 at 04:13:20PM +0100, Damien Lespiau wrote:
> We have unified planes on SKL, they more similar than ever before and we
> can advertize the same formats.
> 
> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 4 ++++
>  drivers/gpu/drm/i915/intel_sprite.c  | 3 +++
>  2 files changed, 7 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 13efade..c32abe1 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -68,6 +68,10 @@ static const uint32_t gen4_primary_formats[] = {
>  	DRM_FORMAT_ARGB2101010,
>  	DRM_FORMAT_XBGR2101010,
>  	DRM_FORMAT_ABGR2101010,
> +	DRM_FORMAT_YUYV,
> +	DRM_FORMAT_YVYU,
> +	DRM_FORMAT_UYVY,
> +	DRM_FORMAT_VYUY,

I take it these were supposed to land in skl_primary_formats[]

>  };
>  
>  
> diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
> index 497e795..d510b60 100644
> --- a/drivers/gpu/drm/i915/intel_sprite.c
> +++ b/drivers/gpu/drm/i915/intel_sprite.c
> @@ -1084,11 +1084,14 @@ static uint32_t vlv_plane_formats[] = {
>  };
>  
>  static uint32_t skl_plane_formats[] = {
> +	DRM_FORMAT_C8,
>  	DRM_FORMAT_RGB565,
>  	DRM_FORMAT_ABGR8888,
>  	DRM_FORMAT_ARGB8888,
>  	DRM_FORMAT_XBGR8888,
>  	DRM_FORMAT_XRGB8888,
> +	DRM_FORMAT_XBGR2101010,
> +	DRM_FORMAT_XRGB2101010,
>  	DRM_FORMAT_YUYV,
>  	DRM_FORMAT_YVYU,
>  	DRM_FORMAT_UYVY,
> -- 
> 2.1.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 07/10] drm/i915/skl: Don't advertize ARGB2101010 and ABGR2101010
  2015-05-12 16:18     ` Damien Lespiau
@ 2015-05-12 16:48       ` Daniel Vetter
  0 siblings, 0 replies; 26+ messages in thread
From: Daniel Vetter @ 2015-05-12 16:48 UTC (permalink / raw)
  To: Damien Lespiau; +Cc: intel-gfx

On Tue, May 12, 2015 at 05:18:47PM +0100, Damien Lespiau wrote:
> On Tue, May 12, 2015 at 06:13:25PM +0200, Daniel Vetter wrote:
> > On Tue, May 12, 2015 at 04:13:19PM +0100, Damien Lespiau wrote:
> > > While we have been historically exposing those formats, but the hardware
> > > doesn't do anything with the alpha bits. The DDX doesn't seem to
> > > particularly care about those formats either, so just expose the
> > > XRGB/XBGR variants.
> > > 
> > > Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
> > 
> > We have this problem with all the primary planes. Imo we should remove
> > this everywhere, since the ddx doesn't seem to care.
> 
> Well technically that'd be breaking ABI (very unlikely, but still). So
> I'd rather have this SKL-specific patch (because we haven't committed to
> SKL just yet) separate from the patch removing the formats for previous
> platforms in case we need to revert. I'll cook the patch for previous
> platform as a follow up.

It's only breaking ABI if someone notices, which is wiggle room we exploit
a _lot_ to fix up past mistakes. I'm ok with merging the skl and pre-skl
parts as two patches in case of reverting, but I really think we should do
them all in one go.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 01/10] drm/i915/skl: Leave a new line between variable declarations and code
  2015-05-12 15:13 ` [PATCH 01/10] drm/i915/skl: Leave a new line between variable declarations and code Damien Lespiau
@ 2015-05-14  5:19   ` Konduru, Chandra
  0 siblings, 0 replies; 26+ messages in thread
From: Konduru, Chandra @ 2015-05-14  5:19 UTC (permalink / raw)
  To: Lespiau, Damien, intel-gfx

Reviewed-by: Chandra Konduru <chandra.konduru@intel.com>

> -----Original Message-----
> From: Lespiau, Damien
> Sent: Tuesday, May 12, 2015 8:13 AM
> To: intel-gfx@lists.freedesktop.org
> Cc: Konduru, Chandra
> Subject: [PATCH 01/10] drm/i915/skl: Leave a new line between variable
> declarations and code
> 
> Cc: Chandra Konduru <chandra.konduru@intel.com>
> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c
> b/drivers/gpu/drm/i915/intel_display.c
> index 895d7c7..f533519 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -2954,6 +2954,7 @@ void skl_detach_scalers(struct intel_crtc *intel_crtc)
>  u32 skl_plane_ctl_format(uint32_t pixel_format)  {
>  	u32 plane_ctl_format = 0;
> +
>  	switch (pixel_format) {
>  	case DRM_FORMAT_RGB565:
>  		plane_ctl_format = PLANE_CTL_FORMAT_RGB_565; @@ -
> 3004,6 +3005,7 @@ u32 skl_plane_ctl_format(uint32_t pixel_format)
>  u32 skl_plane_ctl_tiling(uint64_t fb_modifier)  {
>  	u32 plane_ctl_tiling = 0;
> +
>  	switch (fb_modifier) {
>  	case DRM_FORMAT_MOD_NONE:
>  		break;
> @@ -3025,6 +3027,7 @@ u32 skl_plane_ctl_tiling(uint64_t fb_modifier)
>  u32 skl_plane_ctl_rotation(unsigned int rotation)  {
>  	u32 plane_ctl_rotation = 0;
> +
>  	switch (rotation) {
>  	case BIT(DRM_ROTATE_0):
>  		break;
> --
> 2.1.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 02/10] drm/i915/skl: Add a new line before return
  2015-05-12 15:13 ` [PATCH 02/10] drm/i915/skl: Add a new line before return Damien Lespiau
@ 2015-05-14  5:20   ` Konduru, Chandra
  0 siblings, 0 replies; 26+ messages in thread
From: Konduru, Chandra @ 2015-05-14  5:20 UTC (permalink / raw)
  To: Lespiau, Damien, intel-gfx

Reviewed-by: Chandra Konduru <Chandra.konduru@intel.com>

> -----Original Message-----
> From: Lespiau, Damien
> Sent: Tuesday, May 12, 2015 8:13 AM
> To: intel-gfx@lists.freedesktop.org
> Cc: Konduru, Chandra
> Subject: [PATCH 02/10] drm/i915/skl: Add a new line before return
> 
> We usually use a new line before those kind of return statements. Also the
> various skl_plane_ctl*() functions weren't consistent.
> 
> Cc: Chandra Konduru <chandra.konduru@intel.com>
> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c
> b/drivers/gpu/drm/i915/intel_display.c
> index f533519..c6419e8 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -2999,6 +2999,7 @@ u32 skl_plane_ctl_format(uint32_t pixel_format)
>  	default:
>  		BUG();
>  	}
> +
>  	return plane_ctl_format;
>  }
> 
> @@ -3021,6 +3022,7 @@ u32 skl_plane_ctl_tiling(uint64_t fb_modifier)
>  	default:
>  		MISSING_CASE(fb_modifier);
>  	}
> +
>  	return plane_ctl_tiling;
>  }
> 
> --
> 2.1.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 03/10] drm/i915/skl: Rename a local variable to fit in 80 chars
  2015-05-12 15:13 ` [PATCH 03/10] drm/i915/skl: Rename a local variable to fit in 80 chars Damien Lespiau
  2015-05-12 16:20   ` Ville Syrjälä
@ 2015-05-14  5:20   ` Konduru, Chandra
  1 sibling, 0 replies; 26+ messages in thread
From: Konduru, Chandra @ 2015-05-14  5:20 UTC (permalink / raw)
  To: Lespiau, Damien, intel-gfx

Reviewed-by: Chandra Konduru <Chandra.konduru@intel.com>


> -----Original Message-----
> From: Lespiau, Damien
> Sent: Tuesday, May 12, 2015 8:13 AM
> To: intel-gfx@lists.freedesktop.org
> Cc: Konduru, Chandra
> Subject: [PATCH 03/10] drm/i915/skl: Rename a local variable to fit in 80 chars
> 
> No reason to not follow the 80 chars rule, renaming the local variable makes it
> easy.
> 
> Cc: Chandra Konduru <chandra.konduru@intel.com>
> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 26 +++++++++++++-------------
>  1 file changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c
> b/drivers/gpu/drm/i915/intel_display.c
> index c6419e8..e2b01d9 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -2953,17 +2953,17 @@ void skl_detach_scalers(struct intel_crtc
> *intel_crtc)
> 
>  u32 skl_plane_ctl_format(uint32_t pixel_format)  {
> -	u32 plane_ctl_format = 0;
> +	u32 format = 0;
> 
>  	switch (pixel_format) {
>  	case DRM_FORMAT_RGB565:
> -		plane_ctl_format = PLANE_CTL_FORMAT_RGB_565;
> +		format = PLANE_CTL_FORMAT_RGB_565;
>  		break;
>  	case DRM_FORMAT_XBGR8888:
> -		plane_ctl_format = PLANE_CTL_FORMAT_XRGB_8888 |
> PLANE_CTL_ORDER_RGBX;
> +		format = PLANE_CTL_FORMAT_XRGB_8888 |
> PLANE_CTL_ORDER_RGBX;
>  		break;
>  	case DRM_FORMAT_XRGB8888:
> -		plane_ctl_format = PLANE_CTL_FORMAT_XRGB_8888;
> +		format = PLANE_CTL_FORMAT_XRGB_8888;
>  		break;
>  	/*
>  	 * XXX: For ARBG/ABGR formats we default to expecting scanout buffers
> @@ -2971,36 +2971,36 @@ u32 skl_plane_ctl_format(uint32_t pixel_format)
>  	 * DRM_FORMAT) for user-space to configure that.
>  	 */
>  	case DRM_FORMAT_ABGR8888:
> -		plane_ctl_format = PLANE_CTL_FORMAT_XRGB_8888 |
> PLANE_CTL_ORDER_RGBX |
> +		format = PLANE_CTL_FORMAT_XRGB_8888 |
> PLANE_CTL_ORDER_RGBX |
>  			PLANE_CTL_ALPHA_SW_PREMULTIPLY;
>  		break;
>  	case DRM_FORMAT_ARGB8888:
> -		plane_ctl_format = PLANE_CTL_FORMAT_XRGB_8888 |
> +		format = PLANE_CTL_FORMAT_XRGB_8888 |
>  			PLANE_CTL_ALPHA_SW_PREMULTIPLY;
>  		break;
>  	case DRM_FORMAT_XRGB2101010:
> -		plane_ctl_format = PLANE_CTL_FORMAT_XRGB_2101010;
> +		format = PLANE_CTL_FORMAT_XRGB_2101010;
>  		break;
>  	case DRM_FORMAT_XBGR2101010:
> -		plane_ctl_format = PLANE_CTL_ORDER_RGBX |
> PLANE_CTL_FORMAT_XRGB_2101010;
> +		format = PLANE_CTL_ORDER_RGBX |
> PLANE_CTL_FORMAT_XRGB_2101010;
>  		break;
>  	case DRM_FORMAT_YUYV:
> -		plane_ctl_format = PLANE_CTL_FORMAT_YUV422 |
> PLANE_CTL_YUV422_YUYV;
> +		format = PLANE_CTL_FORMAT_YUV422 |
> PLANE_CTL_YUV422_YUYV;
>  		break;
>  	case DRM_FORMAT_YVYU:
> -		plane_ctl_format = PLANE_CTL_FORMAT_YUV422 |
> PLANE_CTL_YUV422_YVYU;
> +		format = PLANE_CTL_FORMAT_YUV422 |
> PLANE_CTL_YUV422_YVYU;
>  		break;
>  	case DRM_FORMAT_UYVY:
> -		plane_ctl_format = PLANE_CTL_FORMAT_YUV422 |
> PLANE_CTL_YUV422_UYVY;
> +		format = PLANE_CTL_FORMAT_YUV422 |
> PLANE_CTL_YUV422_UYVY;
>  		break;
>  	case DRM_FORMAT_VYUY:
> -		plane_ctl_format = PLANE_CTL_FORMAT_YUV422 |
> PLANE_CTL_YUV422_VYUY;
> +		format = PLANE_CTL_FORMAT_YUV422 |
> PLANE_CTL_YUV422_VYUY;
>  		break;
>  	default:
>  		BUG();
>  	}
> 
> -	return plane_ctl_format;
> +	return format;
>  }
> 
>  u32 skl_plane_ctl_tiling(uint64_t fb_modifier)
> --
> 2.1.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 04/10] drm/i915/skl: Replace BUG() by MISSING_CASE() in skl_plane_ctl_format()
  2015-05-12 15:13 ` [PATCH 04/10] drm/i915/skl: Replace BUG() by MISSING_CASE() in skl_plane_ctl_format() Damien Lespiau
@ 2015-05-14  5:24   ` Konduru, Chandra
  0 siblings, 0 replies; 26+ messages in thread
From: Konduru, Chandra @ 2015-05-14  5:24 UTC (permalink / raw)
  To: Lespiau, Damien, intel-gfx



> -----Original Message-----
> From: Intel-gfx [mailto:intel-gfx-bounces@lists.freedesktop.org] On Behalf Of
> Damien Lespiau
> Sent: Tuesday, May 12, 2015 8:13 AM
> To: intel-gfx@lists.freedesktop.org
> Subject: [Intel-gfx] [PATCH 04/10] drm/i915/skl: Replace BUG() by
> MISSING_CASE() in skl_plane_ctl_format()
> 
> Let's be consistent with the others skl_plane_ctl_*() functions and use a
> MISSING_CASE(). Not only that, but it's a rude to BUG() the whole machine here.
> 
> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c
> b/drivers/gpu/drm/i915/intel_display.c
> index e2b01d9..49d7227 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -2997,7 +2997,7 @@ u32 skl_plane_ctl_format(uint32_t pixel_format)
>  		format = PLANE_CTL_FORMAT_YUV422 |
> PLANE_CTL_YUV422_VYUY;
>  		break;
>  	default:
> -		BUG();
> +		MISSING_CASE(pixel_format);
When I split update_plane into functions, I simply carried what was there. But agree that it should be a BUG.

Reviewed-by: Chandra Konduru <Chandra.konduru@intel.com>

>  	}
> 
>  	return format;
> --
> 2.1.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 05/10] drm/i915/skl: Support the advertized index format
  2015-05-12 15:13 ` [PATCH 05/10] drm/i915/skl: Support the advertized index format Damien Lespiau
@ 2015-05-14  5:24   ` Konduru, Chandra
  0 siblings, 0 replies; 26+ messages in thread
From: Konduru, Chandra @ 2015-05-14  5:24 UTC (permalink / raw)
  To: Lespiau, Damien, intel-gfx

Reviewed-by: Chandra Konduru <Chandra.konduru@intel.com>

> -----Original Message-----
> From: Intel-gfx [mailto:intel-gfx-bounces@lists.freedesktop.org] On Behalf Of
> Damien Lespiau
> Sent: Tuesday, May 12, 2015 8:13 AM
> To: intel-gfx@lists.freedesktop.org
> Subject: [Intel-gfx] [PATCH 05/10] drm/i915/skl: Support the advertized index
> format
> 
> We advertize C8 in the primary plane formats didn't have the corresponding
> code to set PLANE_CTL accordingly.
> 
> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c
> b/drivers/gpu/drm/i915/intel_display.c
> index 49d7227..dadb52a 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -2956,6 +2956,9 @@ u32 skl_plane_ctl_format(uint32_t pixel_format)
>  	u32 format = 0;
> 
>  	switch (pixel_format) {
> +	case DRM_FORMAT_C8:
> +		format = PLANE_CTL_FORMAT_INDEXED;
> +		break;
>  	case DRM_FORMAT_RGB565:
>  		format = PLANE_CTL_FORMAT_RGB_565;
>  		break;
> --
> 2.1.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2015-05-14  5:24 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-12 15:13 [PATCH 00/10] Expose the same formats for SKL primary/sprite planes Damien Lespiau
2015-05-12 15:13 ` [PATCH 01/10] drm/i915/skl: Leave a new line between variable declarations and code Damien Lespiau
2015-05-14  5:19   ` Konduru, Chandra
2015-05-12 15:13 ` [PATCH 02/10] drm/i915/skl: Add a new line before return Damien Lespiau
2015-05-14  5:20   ` Konduru, Chandra
2015-05-12 15:13 ` [PATCH 03/10] drm/i915/skl: Rename a local variable to fit in 80 chars Damien Lespiau
2015-05-12 16:20   ` Ville Syrjälä
2015-05-14  5:20   ` Konduru, Chandra
2015-05-12 15:13 ` [PATCH 04/10] drm/i915/skl: Replace BUG() by MISSING_CASE() in skl_plane_ctl_format() Damien Lespiau
2015-05-14  5:24   ` Konduru, Chandra
2015-05-12 15:13 ` [PATCH 05/10] drm/i915/skl: Support the advertized index format Damien Lespiau
2015-05-14  5:24   ` Konduru, Chandra
2015-05-12 15:13 ` [PATCH 06/10] drm/i915: Don't use the intel_ prefix for gen-specific data Damien Lespiau
2015-05-12 16:04   ` Daniel Vetter
2015-05-12 16:09     ` Daniel Vetter
2015-05-12 15:13 ` [PATCH 07/10] drm/i915/skl: Don't advertize ARGB2101010 and ABGR2101010 Damien Lespiau
2015-05-12 16:13   ` Daniel Vetter
2015-05-12 16:18     ` Damien Lespiau
2015-05-12 16:48       ` Daniel Vetter
2015-05-12 16:29   ` Ville Syrjälä
2015-05-12 15:13 ` [PATCH 08/10] drm/i915/skl: Make primary and sprite plane advertize the same formats Damien Lespiau
2015-05-12 16:14   ` Daniel Vetter
2015-05-12 16:33   ` Ville Syrjälä
2015-05-12 15:13 ` [PATCH 09/10] drm/i915/skl: Factor skl_plane_get_formats() Damien Lespiau
2015-05-12 15:13 ` [PATCH 10/10] drm/i915: Make the sprite formats const Damien Lespiau
2015-05-12 16:14   ` Daniel Vetter

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.