Skip to contentSkip to conversation

Expose the same formats for SKL primary/sprite planes

PATCH Applied Damien Lespiau 4 participants 26 messages May 12, 2015 – May 14, 2015

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

cover Expose the same formats for SKL primary/sprite planes

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.

Signature · 27 lines
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
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

PATCH 1/10 drm/i915/skl: Leave a new line between variable declarations and code

---
 drivers/gpu/drm/i915/intel_display.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/intel_display.c +3 -0
index 895d7c7..f533519 100644
@@ -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;
Signature · 6 lines
2.1.0

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 1/10
#2 lore raw

Re: [PATCH 01/10] drm/i915/skl: Leave a new line between variable declarations and code

Quoted 41 lines

-----Original Message-----
From: Lespiau, Damien
Sent: Tuesday, May 12, 2015 8:13 AM
To: [email protected]
Cc: Konduru, Chandra
Subject: [PATCH 01/10] drm/i915/skl: Leave a new line between variable declarations and code

---
 drivers/gpu/drm/i915/intel_display.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/intel_display.c +1 -0
index 895d7c7..f533519 100644
@@ -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) {

drivers/gpu/drm/i915/intel_display.c +2 -1
 	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;
--
Quoted 1 line

2.1.0

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

#3 lore raw

PATCH 2/10 drm/i915/skl: Add a new line before return

In reply to Damien Lespiau

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

---
 drivers/gpu/drm/i915/intel_display.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/i915/intel_display.c +2 -0
index f533519..c6419e8 100644
@@ -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;
 }
 
Signature · 6 lines
2.1.0

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 2/10
#4 lore raw

Re: [PATCH 02/10] drm/i915/skl: Add a new line before return

Quoted 38 lines

-----Original Message-----
From: Lespiau, Damien
Sent: Tuesday, May 12, 2015 8:13 AM
To: [email protected]
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.

---
 drivers/gpu/drm/i915/intel_display.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/i915/intel_display.c +2 -1
index f533519..c6419e8 100644
@@ -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;
 }
 
--
Quoted 1 line

2.1.0

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

#5 lore raw

PATCH 3/10 drm/i915/skl: Rename a local variable to fit in 80 chars

In reply to Damien Lespiau

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

---
 drivers/gpu/drm/i915/intel_display.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)
drivers/gpu/drm/i915/intel_display.c +13 -13
index c6419e8..e2b01d9 100644
@@ -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)
Signature · 6 lines
2.1.0

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

Re: [PATCH 03/10] drm/i915/skl: Rename a local variable to fit in 80 chars

Quoted 2 lines · Damien Lespiau

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.

Quoted 86 lines
---
 drivers/gpu/drm/i915/intel_display.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)
drivers/gpu/drm/i915/intel_display.c +13 -13
index c6419e8..e2b01d9 100644
@@ -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)
Signature · 6 lines
2.1.0

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 3/10
#7 lore raw

Re: [PATCH 03/10] drm/i915/skl: Rename a local variable to fit in 80 chars

In reply to Damien Lespiau
Quoted 104 lines

-----Original Message-----
From: Lespiau, Damien
Sent: Tuesday, May 12, 2015 8:13 AM
To: [email protected]
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.

---
 drivers/gpu/drm/i915/intel_display.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)
drivers/gpu/drm/i915/intel_display.c +4 -4
index c6419e8..e2b01d9 100644
@@ -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;
drivers/gpu/drm/i915/intel_display.c +0 -1
 	/*
 	 * 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 |

drivers/gpu/drm/i915/intel_display.c +1 -0
+		format = PLANE_CTL_FORMAT_XRGB_8888 |

PLANE_CTL_ORDER_RGBX |

drivers/gpu/drm/i915/intel_display.c +2 -3
 			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;

drivers/gpu/drm/i915/intel_display.c +1 -0
+		format = PLANE_CTL_ORDER_RGBX |

PLANE_CTL_FORMAT_XRGB_2101010;

drivers/gpu/drm/i915/intel_display.c +0 -1
 		break;
 	case DRM_FORMAT_YUYV:
-		plane_ctl_format = PLANE_CTL_FORMAT_YUV422 |

PLANE_CTL_YUV422_YUYV;

drivers/gpu/drm/i915/intel_display.c +1 -0
+		format = PLANE_CTL_FORMAT_YUV422 |

PLANE_CTL_YUV422_YUYV;

drivers/gpu/drm/i915/intel_display.c +0 -1
 		break;
 	case DRM_FORMAT_YVYU:
-		plane_ctl_format = PLANE_CTL_FORMAT_YUV422 |

PLANE_CTL_YUV422_YVYU;

drivers/gpu/drm/i915/intel_display.c +1 -0
+		format = PLANE_CTL_FORMAT_YUV422 |

PLANE_CTL_YUV422_YVYU;

drivers/gpu/drm/i915/intel_display.c +0 -1
 		break;
 	case DRM_FORMAT_UYVY:
-		plane_ctl_format = PLANE_CTL_FORMAT_YUV422 |

PLANE_CTL_YUV422_UYVY;

drivers/gpu/drm/i915/intel_display.c +1 -0
+		format = PLANE_CTL_FORMAT_YUV422 |

PLANE_CTL_YUV422_UYVY;

drivers/gpu/drm/i915/intel_display.c +0 -1
 		break;
 	case DRM_FORMAT_VYUY:
-		plane_ctl_format = PLANE_CTL_FORMAT_YUV422 |

PLANE_CTL_YUV422_VYUY;

drivers/gpu/drm/i915/intel_display.c +1 -0
+		format = PLANE_CTL_FORMAT_YUV422 |

PLANE_CTL_YUV422_VYUY;

drivers/gpu/drm/i915/intel_display.c +1 -2
 		break;
 	default:
 		BUG();
 	}
 
-	return plane_ctl_format;
+	return format;
 }
 
 u32 skl_plane_ctl_tiling(uint64_t fb_modifier)
--
Quoted 1 line

2.1.0

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

#8 lore raw

PATCH 4/10 drm/i915/skl: Replace BUG() by MISSING_CASE() in skl_plane_ctl_format()

In reply to Damien Lespiau

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.

---
 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 e2b01d9..49d7227 100644
@@ -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;
Signature · 6 lines
2.1.0

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 4/10
#9 lore raw

Re: [PATCH 04/10] drm/i915/skl: Replace BUG() by MISSING_CASE() in skl_plane_ctl_format()

Quoted 24 lines

-----Original Message-----
From: Intel-gfx [mailto:[email protected]] On Behalf Of Damien Lespiau
Sent: Tuesday, May 12, 2015 8:13 AM
To: [email protected]
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.

---
 drivers/gpu/drm/i915/intel_display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_display.c +0 -0
index e2b01d9..49d7227 100644

drivers/gpu/drm/i915/intel_display.c u32 skl_plane_ctl_format(uint32_t pixel_format) · line 3001

Quoted 6 lines
drivers/gpu/drm/i915/intel_display.c +1 -1
@@ -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.

Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +0 -0
 	}
 

return format;
--
2.1.0

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

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

#10 lore raw

PATCH 5/10 drm/i915/skl: Support the advertized index format

In reply to Damien Lespiau

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

---
 drivers/gpu/drm/i915/intel_display.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/intel_display.c +3 -0
index 49d7227..dadb52a 100644
@@ -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;
Signature · 6 lines
2.1.0

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

Re: [PATCH 05/10] drm/i915/skl: Support the advertized index format

Quoted 34 lines

-----Original Message-----
From: Intel-gfx [mailto:[email protected]] On Behalf Of Damien Lespiau
Sent: Tuesday, May 12, 2015 8:13 AM
To: [email protected]
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.

---
 drivers/gpu/drm/i915/intel_display.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/intel_display.c +3 -1
index 49d7227..dadb52a 100644
@@ -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

Quoted 4 lines

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

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

#12 lore raw

PATCH 6/10 drm/i915: Don't use the intel_ prefix for gen-specific data

In reply to Damien Lespiau

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

---
 drivers/gpu/drm/i915/intel_display.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/intel_display.c +6 -6
index dadb52a..8adf3bf 100644
@@ -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,
Signature · 6 lines
2.1.0

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

Re: [PATCH 06/10] drm/i915: Don't use the intel_ prefix for gen-specific data

Quoted 13 lines · Damien Lespiau

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

---
 drivers/gpu/drm/i915/intel_display.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/intel_display.c +0 -0
index dadb52a..8adf3bf 100644

drivers/gpu/drm/i915/intel_display.c line 56

Quoted 5 lines
drivers/gpu/drm/i915/intel_display.c +1 -1
@@ -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_

drivers/gpu/drm/i915/intel_display.c line 63

Quoted 8 lines
drivers/gpu/drm/i915/intel_display.c +1 -1
 	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

Quoted 26 lines
drivers/gpu/drm/i915/intel_display.c +4 -4
 	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,
Signature · 6 lines
2.1.0

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#14 lore raw

Re: [PATCH 06/10] drm/i915: Don't use the intel_ prefix for gen-specific data

Quoted 33 lines · Daniel Vetter
Quoted 13 lines · Damien Lespiau

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

---
 drivers/gpu/drm/i915/intel_display.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/intel_display.c +0 -0
index dadb52a..8adf3bf 100644

drivers/gpu/drm/i915/intel_display.c line 56

Quoted 5 lines
drivers/gpu/drm/i915/intel_display.c +1 -1
@@ -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_

drivers/gpu/drm/i915/intel_display.c line 63

Quoted 8 lines
drivers/gpu/drm/i915/intel_display.c +1 -1
 	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_

Quoted 5 lines

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

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#15 lore raw

PATCH 7/10 drm/i915/skl: Don't advertize ARGB2101010 and ABGR2101010

In reply to Damien Lespiau

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.

---
 drivers/gpu/drm/i915/intel_display.c | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/intel_display.c +16 -4
index 8adf3bf..13efade 100644
@@ -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,
Signature · 6 lines
2.1.0

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

Re: [PATCH 07/10] drm/i915/skl: Don't advertize ARGB2101010 and ABGR2101010

Quoted 6 lines · Damien Lespiau

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.

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

Quoted 51 lines
---
 drivers/gpu/drm/i915/intel_display.c | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/intel_display.c +16 -4
index 8adf3bf..13efade 100644
@@ -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,
Signature · 6 lines
2.1.0

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#17 lore raw

Re: [PATCH 07/10] drm/i915/skl: Don't advertize ARGB2101010 and ABGR2101010

Quoted 10 lines · Daniel Vetter
Quoted 6 lines · Damien Lespiau

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.

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.

Signature · 5 lines
Damien
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#18 lore raw

Re: [PATCH 07/10] drm/i915/skl: Don't advertize ARGB2101010 and ABGR2101010

Quoted 9 lines · Damien Lespiau
Quoted 8 lines · Daniel Vetter
Quoted 6 lines · Damien Lespiau

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.

Quoted 8 lines
Quoted 2 lines

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

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#19 lore raw

Re: [PATCH 07/10] drm/i915/skl: Don't advertize ARGB2101010 and ABGR2101010

In reply to Damien Lespiau
Quoted 15 lines · Damien Lespiau

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.

---
 drivers/gpu/drm/i915/intel_display.c | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/intel_display.c +0 -0
index 8adf3bf..13efade 100644

drivers/gpu/drm/i915/intel_display.c static const uint32_t gen4_primary_formats[] = { · line 75

Quoted 6 lines
drivers/gpu/drm/i915/intel_display.c +3 -0
@@ -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.

Quoted 36 lines
drivers/gpu/drm/i915/intel_display.c +13 -4
+	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,
Signature · 6 lines
2.1.0

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#20 lore raw

PATCH 8/10 drm/i915/skl: Make primary and sprite plane advertize the same formats

In reply to Damien Lespiau

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

---
 drivers/gpu/drm/i915/intel_display.c | 4 ++++
 drivers/gpu/drm/i915/intel_sprite.c  | 3 +++
 2 files changed, 7 insertions(+)
drivers/gpu/drm/i915/intel_display.c +4 -0
index 13efade..c32abe1 100644
@@ -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,
 };
 
 
drivers/gpu/drm/i915/intel_sprite.c +3 -0
index 497e795..d510b60 100644
@@ -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,
Signature · 6 lines
2.1.0

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

Re: [PATCH 08/10] drm/i915/skl: Make primary and sprite plane advertize the same formats

Quoted 4 lines · Damien Lespiau

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

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

Quoted 46 lines
---
 drivers/gpu/drm/i915/intel_display.c | 4 ++++
 drivers/gpu/drm/i915/intel_sprite.c  | 3 +++
 2 files changed, 7 insertions(+)
drivers/gpu/drm/i915/intel_display.c +4 -0
index 13efade..c32abe1 100644
@@ -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,
 };
 
 
drivers/gpu/drm/i915/intel_sprite.c +3 -0
index 497e795..d510b60 100644
@@ -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,
Signature · 6 lines
2.1.0

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#22 lore raw

Re: [PATCH 08/10] drm/i915/skl: Make primary and sprite plane advertize the same formats

In reply to Damien Lespiau
Quoted 14 lines · Damien Lespiau

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

---
 drivers/gpu/drm/i915/intel_display.c | 4 ++++
 drivers/gpu/drm/i915/intel_sprite.c  | 3 +++
 2 files changed, 7 insertions(+)
drivers/gpu/drm/i915/intel_display.c +0 -0
index 13efade..c32abe1 100644

drivers/gpu/drm/i915/intel_display.c static const uint32_t gen4_primary_formats[] = { · line 74

Quoted 7 lines
drivers/gpu/drm/i915/intel_display.c +4 -0
@@ -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[]

Quoted 29 lines
drivers/gpu/drm/i915/intel_display.c +0 -0
 };
 
 
drivers/gpu/drm/i915/intel_sprite.c +3 -0
index 497e795..d510b60 100644
@@ -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,
Signature · 6 lines
2.1.0

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#23 lore raw

PATCH 9/10 drm/i915/skl: Factor skl_plane_get_formats()

In reply to Damien Lespiau

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.

---
 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(-)
drivers/gpu/drm/i915/intel_display.c +20 -7
index c32abe1..980afae 100644
@@ -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);
drivers/gpu/drm/i915/intel_drv.h +2 -0
index 47bc729..0277ca6 100644
@@ -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);
drivers/gpu/drm/i915/intel_sprite.c +3 -17
index d510b60..21950f0 100644
@@ -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);
Signature · 6 lines
2.1.0

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

PATCH 10/10 drm/i915: Make the sprite formats const

In reply to Damien Lespiau
---
 drivers/gpu/drm/i915/intel_sprite.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_sprite.c +3 -3
index 21950f0..c8d4644 100644
@@ -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,
Signature · 6 lines
2.1.0

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

Re: [PATCH 10/10] drm/i915: Make the sprite formats const

Quoted 1 line · Damien Lespiau

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

Quoted 42 lines
---
 drivers/gpu/drm/i915/intel_sprite.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_sprite.c +3 -3
index 21950f0..c8d4644 100644
@@ -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,
Signature · 6 lines
2.1.0

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx