Skip to contentSkip to conversation

drm/i915/skl: Enable pipe gamma for sprite planes.

PATCH In review Bob Paauwe 5 participants 11 messages Aug 27, 2015 – Oct 15, 2015

Subsystems (2)
lore
Share & tools
lore

Bob Paauwe

author
#0 lore raw

PATCH 1/2 drm/i915/skl: Enable pipe gamma for sprite planes.

Since SKL has universal planes, we should configure the sprite planes and the primary plane the same. For the primary plane we do enable the pipe gamma on the plane so do the same for the non-primary planes.

Without this, the pipe CRC values will be different for something displayed on the primary plane and something displayed on a sprite plane when the ARGB8888 format is used.

---
 drivers/gpu/drm/i915/intel_sprite.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/i915/intel_sprite.c +1 -0
index 9d8af2f..048d397 100644
@@ -189,6 +189,7 @@ skl_update_plane(struct drm_plane *drm_plane, struct drm_crtc *crtc,
 	int scaler_id;
 
 	plane_ctl = PLANE_CTL_ENABLE |
+		PLANE_CTL_PIPE_GAMMA_ENABLE |
 		PLANE_CTL_PIPE_CSC_ENABLE;
 
 	plane_ctl |= skl_plane_ctl_format(fb->pixel_format);
Signature · 6 lines
2.1.0

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

PATCH 2/2 drm/i915/skl+: Enable pipe CSC on cursor planes.

Extend this to SKL and BXT as it's needed for these platforms as well.

---
 drivers/gpu/drm/i915/intel_display.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_display.c +2 -1
index 88f9764..007bf7d 100644
@@ -10001,7 +10001,8 @@ static void i9xx_update_cursor(struct drm_crtc *crtc, u32 base)
 		}
 		cntl |= pipe << 28; /* Connect to correct pipe */
 
-		if (IS_HASWELL(dev) || IS_BROADWELL(dev))
+		if (IS_HASWELL(dev) || IS_BROADWELL(dev) ||
+		    IS_SKYLAKE(dev) || IS_BROXTON(dev))
 			cntl |= CURSOR_PIPE_CSC_ENABLE;
 	}
 
Signature · 6 lines
2.1.0

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

Re: [PATCH 2/2] drm/i915/skl+: Enable pipe CSC on cursor planes.

Hi Bob,

Quoted 12 lines · Bob Paauwe

Extend this to SKL and BXT as it's needed for these platforms as well.

---
 drivers/gpu/drm/i915/intel_display.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_display.c +0 -0
index 88f9764..007bf7d 100644

drivers/gpu/drm/i915/intel_display.c static void i9xx_update_cursor(struct drm_crtc *crtc, u32 base) · line 10006

Quoted 7 lines
drivers/gpu/drm/i915/intel_display.c +2 -1
@@ -10001,7 +10001,8 @@ static void i9xx_update_cursor(struct drm_crtc *crtc, u32 base)
                }
                cntl |= pipe << 28; /* Connect to correct pipe */
 
-               if (IS_HASWELL(dev) || IS_BROADWELL(dev))
+               if (IS_HASWELL(dev) || IS_BROADWELL(dev) ||
+                   IS_SKYLAKE(dev) || IS_BROXTON(dev))
                        cntl |= CURSOR_PIPE_CSC_ENABLE;

For both this and the previous patch, cf. the corresponding patch for HSW/BDW[0], have you ensured these values are sanitised at startup, even if UEFI hasn't set something clever? Enabling fastboot on my (UEFI-based) BDW caused a black screen because were enabling CSC but with an empty table.

Cheers,
Daniel

[0]: https://www.mail-archive.com/[email protected]/msg67294.html
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

author
#3 lore raw

Re: [PATCH 2/2] drm/i915/skl+: Enable pipe CSC on cursor planes.

Quoted 29 lines · On Fri, 28 Aug 2015 15:19:04 +0100 Daniel Stone <[email protected]> wrote:

Hi Bob,

Quoted 12 lines · Bob Paauwe

Extend this to SKL and BXT as it's needed for these platforms as well.

---
 drivers/gpu/drm/i915/intel_display.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_display.c +0 -0
index 88f9764..007bf7d 100644

drivers/gpu/drm/i915/intel_display.c static void i9xx_update_cursor(struct drm_crtc *crtc, u32 base) · line 10006

Quoted 7 lines
drivers/gpu/drm/i915/intel_display.c +2 -1
@@ -10001,7 +10001,8 @@ static void i9xx_update_cursor(struct drm_crtc *crtc, u32 base)
                }
                cntl |= pipe << 28; /* Connect to correct pipe */
 
-               if (IS_HASWELL(dev) || IS_BROADWELL(dev))
+               if (IS_HASWELL(dev) || IS_BROADWELL(dev) ||
+                   IS_SKYLAKE(dev) || IS_BROXTON(dev))
                        cntl |= CURSOR_PIPE_CSC_ENABLE;

For both this and the previous patch, cf. the corresponding patch for HSW/BDW[0], have you ensured these values are sanitised at startup, even if UEFI hasn't set something clever? Enabling fastboot on my (UEFI-based) BDW caused a black screen because were enabling CSC but with an empty table.

Quoted 4 lines

Cheers,
Daniel

[0]: https://www.mail-archive.com/[email protected]/msg67294.html

Hmm, no I didn't. I assumed that it was all set up correctly since for SKL+ the primary plane always has PIPE_CSC enabled. My two patches are just to ensure that both the cursor and sprite planes also have it enabled. If all the planes are configured the same, it causes a lot of CRC failures in the igt tests.

Unless I'm missing something (very possible), the pipe CSC setup/lack of setup is a separate issue.

Looking at Maarten's patch, it looks like mine above should have been written as

if (HAS_DDI(dev))

instead of all the separate conditions.

Bob

Signature · 11 lines
--
Bob Paauwe                  
[email protected]
IOTG / PED Software Organization
Intel Corp.  Folsom, CA
(916) 356-6193    

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

Re: [PATCH 2/2] drm/i915/skl+: Enable pipe CSC on cursor planes.

Hi,

Quoted 8 lines · Bob Paauwe
Quoted 6 lines · On Fri, 28 Aug 2015 15:19:04 +0100 Daniel Stone <[email protected]> wrote:

For both this and the previous patch, cf. the corresponding patch for HSW/BDW[0], have you ensured these values are sanitised at startup, even if UEFI hasn't set something clever? Enabling fastboot on my (UEFI-based) BDW caused a black screen because were enabling CSC but with an empty table.

Quoted 7 lines
Quoted 4 lines

Cheers,
Daniel

[0]: https://www.mail-archive.com/[email protected]/msg67294.html

Hmm, no I didn't. I assumed that it was all set up correctly since for SKL+ the primary plane always has PIPE_CSC enabled.

So does HSW/BDW. ;) The problem is that a CSC is only applied in the modeset path; when using 'fastboot' to skip the original modeset (i.e. to achieve flicker-free and quicker boot), the plane configuration applies CSC/gamma, but the tables are only applied on modeset. So you may end up with an invalid configuration (and blank screen), without a similar patch.

Quoted 7 lines

My two patches are
just to ensure that both the cursor and sprite planes also have it enabled. If all the planes are configured the same, it causes a lot of CRC failures in the igt tests.

Unless I'm missing something (very possible), the pipe CSC setup/lack of setup is a separate issue.

Yeah, it is. But it'd be good to make sure Maarten's patch gets dragged in too.

Quoted 6 lines

Looking at Maarten's patch, it looks like mine above should have been written as

if (HAS_DDI(dev))

instead of all the separate conditions.

Yeah, indeed. I'd misread the HAS_DDI bit myself, so it seems fine. Are you able to test Maarten's patch to always program the CSC tables and make sure it doesn't break SKL/BXT?

Thanks, and sorry for the confusion.

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

author
#5 lore raw

Re: [PATCH 2/2] drm/i915/skl+: Enable pipe CSC on cursor planes.

Quoted 31 lines · On Fri, 28 Aug 2015 17:12:12 +0100 Daniel Stone <[email protected]> wrote:

Hi,

Quoted 8 lines · Bob Paauwe
Quoted 6 lines · On Fri, 28 Aug 2015 15:19:04 +0100 Daniel Stone <[email protected]> wrote:

For both this and the previous patch, cf. the corresponding patch for HSW/BDW[0], have you ensured these values are sanitised at startup, even if UEFI hasn't set something clever? Enabling fastboot on my (UEFI-based) BDW caused a black screen because were enabling CSC but with an empty table.

Quoted 7 lines
Quoted 4 lines

Cheers,
Daniel

[0]: https://www.mail-archive.com/[email protected]/msg67294.html

Hmm, no I didn't. I assumed that it was all set up correctly since for SKL+ the primary plane always has PIPE_CSC enabled.

So does HSW/BDW. ;) The problem is that a CSC is only applied in the modeset path; when using 'fastboot' to skip the original modeset (i.e. to achieve flicker-free and quicker boot), the plane configuration applies CSC/gamma, but the tables are only applied on modeset. So you may end up with an invalid configuration (and blank screen), without a similar patch.

Quoted 5 lines

My two patches are
just to ensure that both the cursor and sprite planes also have it enabled. If all the planes are configured the same, it causes a lot of CRC failures in the igt tests.

Quoted 4 lines
Quoted 2 lines

Unless I'm missing something (very possible), the pipe CSC setup/lack of setup is a separate issue.

Yeah, it is. But it'd be good to make sure Maarten's patch gets dragged in too.

That's what I thought you meant, but wanted to make sure I wasn't confused.

Quoted 11 lines
Quoted 7 lines

Looking at Maarten's patch, it looks like mine above should have been written as

if (HAS_DDI(dev))

instead of all the separate conditions.

Yeah, indeed. I'd misread the HAS_DDI bit myself, so it seems fine. Are you able to test Maarten's patch to always program the CSC tables and make sure it doesn't break SKL/BXT?

I did apply his series and it doesn't change the behavior on my SKL, but I also don't have any issues if I enable fastboot without his series. Which I guess means that my UEFI is setting up the table correctly.

Quoted 2 lines

Thanks, and sorry for the confusion.

You made me dig into how CSC works a bit more and that a good thing! Thanks for bring it up.

Quoted 3 lines

Cheers,
Daniel

Bob

Signature · 11 lines
--
Bob Paauwe                  
[email protected]
IOTG / PED Software Organization
Intel Corp.  Folsom, CA
(916) 356-6193    

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

PATCH 2/2 drm/i915/skl+: Enable pipe CSC on cursor planes. (v2)

In reply to Bob Paauwe

Extend this to SKL and BXT as it's needed for these platforms as well.

v2: Change if condition to HAS_DDI() instead of listing each platform

---
 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 88f9764..ba180f6 100644
@@ -10001,7 +10001,7 @@ static void i9xx_update_cursor(struct drm_crtc *crtc, u32 base)
 		}
 		cntl |= pipe << 28; /* Connect to correct pipe */
 
-		if (IS_HASWELL(dev) || IS_BROADWELL(dev))
+		if (HAS_DDI(dev))
 			cntl |= CURSOR_PIPE_CSC_ENABLE;
 	}
 
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/2
#7 lore raw

Re: [PATCH 2/2] drm/i915/skl+: Enable pipe CSC on cursor planes. (v2)

Quoted 13 lines · Bob Paauwe

Extend this to SKL and BXT as it's needed for these platforms as well.

v2: Change if condition to HAS_DDI() instead of listing each platform

---
 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 88f9764..ba180f6 100644

drivers/gpu/drm/i915/intel_display.c static void i9xx_update_cursor(struct drm_crtc *crtc, u32 base) · line 10004

Quoted 5 lines
drivers/gpu/drm/i915/intel_display.c +1 -1
@@ -10001,7 +10001,7 @@ static void i9xx_update_cursor(struct drm_crtc *crtc, u32 base)
 		}
 		cntl |= pipe << 28; /* Connect to correct pipe */
 
-		if (IS_HASWELL(dev) || IS_BROADWELL(dev))
+		if (HAS_DDI(dev))

Yeah, while cursors themselves don't change between non-DDI and DDI platforms, the reason for this stuff is the fact that that we use the pipe csc for HDMI color range mangling on DDI platforms, since they no longer have any other pipe/port controls for it.

So makese sense to check for DDI here too I think:

Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +0 -0
 			cntl |= CURSOR_PIPE_CSC_ENABLE;
 	}
 
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
#8 lore raw

Re: [PATCH 2/2] drm/i915/skl+: Enable pipe CSC on cursor planes. (v2)

Quoted 25 lines · Ville Syrjälä
Quoted 13 lines · Bob Paauwe

Extend this to SKL and BXT as it's needed for these platforms as well.

v2: Change if condition to HAS_DDI() instead of listing each platform

---
 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 88f9764..ba180f6 100644

drivers/gpu/drm/i915/intel_display.c static void i9xx_update_cursor(struct drm_crtc *crtc, u32 base) · line 10004

Quoted 5 lines
drivers/gpu/drm/i915/intel_display.c +1 -1
@@ -10001,7 +10001,7 @@ static void i9xx_update_cursor(struct drm_crtc *crtc, u32 base)
 		}
 		cntl |= pipe << 28; /* Connect to correct pipe */
 
-		if (IS_HASWELL(dev) || IS_BROADWELL(dev))
+		if (HAS_DDI(dev))

Yeah, while cursors themselves don't change between non-DDI and DDI platforms, the reason for this stuff is the fact that that we use the pipe csc for HDMI color range mangling on DDI platforms, since they no longer have any other pipe/port controls for it.

Quoted 2 lines

So makese sense to check for DDI here too I think:

Both patches applied, thanks.
-Daniel

Quoted 19 lines
Quoted 11 lines
drivers/gpu/drm/i915/intel_display.c +0 -0
 			cntl |= CURSOR_PIPE_CSC_ENABLE;
 	}
 
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
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
Tested-by on v1 2/2
#9 lore raw

Re: [PATCH 2/2] drm/i915/skl+: Enable pipe CSC on cursor planes.

In reply to Bob Paauwe

Task id: 7280 -------------------------------------Summary-------------------------------------
Platform Delta drm-intel-nightly Series Applied
ILK -1 302/302 301/302

SNB                                  315/315              315/315
IVB                                  336/336              336/336
BYT                                  283/283              283/283
HSW                                  378/378              378/378

-------------------------------------Detailed-------------------------------------
Platform Test drm-intel-nightly Series Applied
*ILK igt@kms_flip@wf_vblank-vs-modeset-interruptible PASS(1) DMESG_WARN(1)
Note: You need to pay more attention to line start with '*'
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reviewed-by on v1 1/2
#10 lore raw
In reply to Bob Paauwe
Quoted 9 lines · Bob Paauwe

Since SKL has universal planes, we should configure the sprite planes and the primary plane the same. For the primary plane we do enable the pipe gamma on the plane so do the same for the non-primary planes.

Without this, the pipe CRC values will be different for something displayed on the primary plane and something displayed on a sprite plane when the ARGB8888 format is used.

Quoted 23 lines
---
 drivers/gpu/drm/i915/intel_sprite.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/i915/intel_sprite.c +1 -0
index 9d8af2f..048d397 100644
@@ -189,6 +189,7 @@ skl_update_plane(struct drm_plane *drm_plane, struct drm_crtc *crtc,
 	int scaler_id;
 
 	plane_ctl = PLANE_CTL_ENABLE |
+		PLANE_CTL_PIPE_GAMMA_ENABLE |
 		PLANE_CTL_PIPE_CSC_ENABLE;
 
 	plane_ctl |= skl_plane_ctl_format(fb->pixel_format);
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