Skip to contentSkip to conversation

drm/i915/skl: Support Y tiling in MMIO flips

PATCH In review Tvrtko Ursulin 4 participants 9 messages Apr 20, 2015 – Apr 23, 2015

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

PATCH 1/1 drm/i915/skl: Support Y tiling in MMIO flips

From: Tvrtko Ursulin <[email protected]>

Add Y tiling support to skl_do_mmio_flip.

Cc Damien Lespiau <[email protected]>
Cc Sonika Jindal <[email protected]>
Cc Daniel Vetter <[email protected]>

---
Looks like we completely missed this completely parallel instance of plane programming code when working on Y tiling support!

Will rotation need supporting here as well?

And what about the comment at intel_do_mmio_flip saying this was only temporary code?

---
 drivers/gpu/drm/i915/intel_display.c | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/intel_display.c +17 -6
index bac82d5..4d37f74 100644
@@ -10480,23 +10480,34 @@ static void skl_do_mmio_flip(struct intel_crtc *intel_crtc)
 	struct drm_device *dev = intel_crtc->base.dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct drm_framebuffer *fb = intel_crtc->base.primary->fb;
-	struct intel_framebuffer *intel_fb = to_intel_framebuffer(fb);
-	struct drm_i915_gem_object *obj = intel_fb->obj;
 	const enum pipe pipe = intel_crtc->pipe;
 	u32 ctl, stride;
 
 	ctl = I915_READ(PLANE_CTL(pipe, 0));
 	ctl &= ~PLANE_CTL_TILED_MASK;
-	if (obj->tiling_mode == I915_TILING_X)
+	switch (fb->modifier[0]) {
+	case DRM_FORMAT_MOD_NONE:
+		break;
+	case I915_FORMAT_MOD_X_TILED:
 		ctl |= PLANE_CTL_TILED_X;
+		break;
+	case I915_FORMAT_MOD_Y_TILED:
+		ctl |= PLANE_CTL_TILED_Y;
+		break;
+	case I915_FORMAT_MOD_Yf_TILED:
+		ctl |= PLANE_CTL_TILED_YF;
+		break;
+	default:
+		MISSING_CASE(fb->modifier[0]);
+	}
 
 	/*
 	 * The stride is either expressed as a multiple of 64 bytes chunks for
 	 * linear buffers or in number of tiles for tiled buffers.
 	 */
-	stride = fb->pitches[0] >> 6;
-	if (obj->tiling_mode == I915_TILING_X)
-		stride = fb->pitches[0] >> 9; /* X tiles are 512 bytes wide */
+	stride = fb->pitches[0] /
+		 intel_fb_stride_alignment(dev, fb->modifier[0],
+					   fb->pixel_format);
 
 	/*
 	 * Both PLANE_CTL and PLANE_STRIDE are not updated on vblank but on
Signature · 6 lines
2.3.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw
Quoted 8 lines · Tvrtko Ursulin

From: Tvrtko Ursulin <[email protected]>

Add Y tiling support to skl_do_mmio_flip.

Cc Damien Lespiau <[email protected]>
Cc Sonika Jindal <[email protected]>
Cc Daniel Vetter <[email protected]>
Quoted 5 lines

---
Looks like we completely missed this completely parallel instance of plane programming code when working on Y tiling support!

Will rotation need supporting here as well?

Oh dear this is a bit ugly. We definitely need either this for 4.1 or take out the Y-tiling support for 4.1. Rotation only made 4.2, so I think we're good, but we do indeed need to take rotation into account here too.

And it seems like we also need a pile of igt testcases to make sure Y-tiling, rotation (even 180 probably) works correctly with pageflips. Yay for kms_flip growing even more.

Quoted 2 lines

And what about the comment at intel_do_mmio_flip saying this was only temporary code?

Well once we have atomic this code will disappear, but it sounds like that's still a bit off unfortunately.
-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
#2 lore raw
Quoted 13 lines · Daniel Vetter
Quoted 12 lines · Tvrtko Ursulin

From: Tvrtko Ursulin <[email protected]>

Add Y tiling support to skl_do_mmio_flip.

Cc Damien Lespiau <[email protected]>
Cc Sonika Jindal <[email protected]>
Cc Daniel Vetter <[email protected]>

---
Looks like we completely missed this completely parallel instance of plane programming code when working on Y tiling support!

Quoted 5 lines
Quoted 1 line

Will rotation need supporting here as well?

Oh dear this is a bit ugly. We definitely need either this for 4.1 or take out the Y-tiling support for 4.1. Rotation only made 4.2, so I think we're good, but we do indeed need to take rotation into account here too.

What is ugly, this patch or the overall situation?

Quoted 3 lines

And it seems like we also need a pile of igt testcases to make sure Y-tiling, rotation (even 180 probably) works correctly with pageflips. Yay for kms_flip growing even more.

I added Y to kms_flip_tiling back then - but both that one and kms_flip don't do any pipe crc. So not much use in automated fashion. And testdisplay apparently does not hit this path.

I did not have working crc hw back then, maybe that has changed, I'll check it and then, depending on the outcome, see if I can add something automated.

Either way, adding this fix sounds better than reverting everything.

Regards,

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

#3 lore raw
Quoted 15 lines · Tvrtko Ursulin
Quoted 13 lines · Daniel Vetter
Quoted 12 lines · Tvrtko Ursulin

From: Tvrtko Ursulin <[email protected]>

Add Y tiling support to skl_do_mmio_flip.

Cc Damien Lespiau <[email protected]>
Cc Sonika Jindal <[email protected]>
Cc Daniel Vetter <[email protected]>

---
Looks like we completely missed this completely parallel instance of plane programming code when working on Y tiling support!

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

Will rotation need supporting here as well?

Oh dear this is a bit ugly. We definitely need either this for 4.1 or take out the Y-tiling support for 4.1. Rotation only made 4.2, so I think we're good, but we do indeed need to take rotation into account here too.

What is ugly, this patch or the overall situation?

The situation, since catching this kind of stuff is why we should have a real userspace implementation ;-)

Quoted 10 lines
Quoted 3 lines

And it seems like we also need a pile of igt testcases to make sure Y-tiling, rotation (even 180 probably) works correctly with pageflips. Yay for kms_flip growing even more.

I added Y to kms_flip_tiling back then - but both that one and kms_flip don't do any pipe crc. So not much use in automated fashion. And testdisplay apparently does not hit this path.

I did not have working crc hw back then, maybe that has changed, I'll check it and then, depending on the outcome, see if I can add something automated.

Hm right we'd need a real crc based testcase, not just exercising the codepaths. Simplest solution might be to extend the rotation test with a new subtests which does a pageflip before sampling the crc. Adding crc checks to the kms_flip monster is probably not a good idea.

Quoted 1 line

Either way, adding this fix sounds better than reverting everything.

I don't mean to revert everything, just disable the feature in case we can't fix it up properly.
-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
#4 lore raw
In reply to Tvrtko Ursulin
Quoted 27 lines · Tvrtko Ursulin
Quoted 13 lines · Daniel Vetter
Quoted 12 lines · Tvrtko Ursulin

From: Tvrtko Ursulin <[email protected]>

Add Y tiling support to skl_do_mmio_flip.

Cc Damien Lespiau <[email protected]>
Cc Sonika Jindal <[email protected]>
Cc Daniel Vetter <[email protected]>

---
Looks like we completely missed this completely parallel instance of plane programming code when working on Y tiling support!

Quoted 5 lines
Quoted 1 line

Will rotation need supporting here as well?

Oh dear this is a bit ugly. We definitely need either this for 4.1 or take out the Y-tiling support for 4.1. Rotation only made 4.2, so I think we're good, but we do indeed need to take rotation into account here too.

What is ugly, this patch or the overall situation?

Quoted 3 lines

And it seems like we also need a pile of igt testcases to make sure Y-tiling, rotation (even 180 probably) works correctly with pageflips. Yay for kms_flip growing even more.

Quoted 8 lines

I added Y to kms_flip_tiling back then - but both that one and kms_flip don't do any pipe crc. So not much use in automated fashion. And testdisplay apparently does not hit this path.

I did not have working crc hw back then, maybe that has changed, I'll check it and then, depending on the outcome, see if I can add something automated.

Either way, adding this fix sounds better than reverting everything.

On 2nd thought skl is still tagged as preliminary, so we don't have any issues here at all. Queued for -next, thanks for the patch.

While looking at skl_do_mmio_flip I noticed though that rotation support seems to be completely absent. Or did I miss something? -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
#5 lore raw
Quoted 35 lines · Daniel Vetter
Quoted 34 lines · Tvrtko Ursulin
Quoted 13 lines · Daniel Vetter
Quoted 12 lines · Tvrtko Ursulin

From: Tvrtko Ursulin <[email protected]>

Add Y tiling support to skl_do_mmio_flip.

Cc Damien Lespiau <[email protected]>
Cc Sonika Jindal <[email protected]>
Cc Daniel Vetter <[email protected]>

---
Looks like we completely missed this completely parallel instance of plane programming code when working on Y tiling support!

Quoted 5 lines
Quoted 1 line

Will rotation need supporting here as well?

Oh dear this is a bit ugly. We definitely need either this for 4.1 or take out the Y-tiling support for 4.1. Rotation only made 4.2, so I think we're good, but we do indeed need to take rotation into account here too.

What is ugly, this patch or the overall situation?

Quoted 3 lines

And it seems like we also need a pile of igt testcases to make sure Y-tiling, rotation (even 180 probably) works correctly with pageflips. Yay for kms_flip growing even more.

I added Y to kms_flip_tiling back then - but both that one and kms_flip don't do any pipe crc. So not much use in automated fashion. And testdisplay apparently does not hit this path.

I did not have working crc hw back then, maybe that has changed, I'll check it and then, depending on the outcome, see if I can add something automated.

Quoted 7 lines
Quoted 1 line

Either way, adding this fix sounds better than reverting everything.

On 2nd thought skl is still tagged as preliminary, so we don't have any issues here at all. Queued for -next, thanks for the patch.

While looking at skl_do_mmio_flip I noticed though that rotation support seems to be completely absent. Or did I miss something?

Yes, it doesn't exist.
Is it because of it being temporary as per the following comment:
"/*
* XXX: This is the temporary way to update the plane registers until
we get
* around to using the usual plane update functions for MMIO flips */
"

Quoted 2 lines

-Daniel

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

#6 lore raw
Quoted 50 lines · Sonika
Quoted 42 lines · Daniel Vetter
Quoted 41 lines · Tvrtko Ursulin
Quoted 14 lines · Daniel Vetter
Quoted 13 lines · Tvrtko Ursulin

From: Tvrtko Ursulin <[email protected]>

Add Y tiling support to skl_do_mmio_flip.

Cc Damien Lespiau <[email protected]>
Cc Sonika Jindal <[email protected]>
Cc Daniel Vetter <[email protected]>

---
Looks like we completely missed this completely parallel instance of plane
programming code when working on Y tiling support!

Quoted 7 lines
Quoted 1 line

Will rotation need supporting here as well?

Oh dear this is a bit ugly. We definitely need either this for 4.1 or take
out the Y-tiling support for 4.1. Rotation only made 4.2, so I think we're good, but we do indeed need to take rotation into account here too.

What is ugly, this patch or the overall situation?

Quoted 4 lines

And it seems like we also need a pile of igt testcases to make sure Y-tiling, rotation (even 180 probably) works correctly with pageflips. Yay
for kms_flip growing even more.

I added Y to kms_flip_tiling back then - but both that one and kms_flip don't do any pipe crc. So not much use in automated fashion. And testdisplay
apparently does not hit this path.

I did not have working crc hw back then, maybe that has changed, I'll check
it and then, depending on the outcome, see if I can add something automated.

Quoted 7 lines
Quoted 1 line

Either way, adding this fix sounds better than reverting everything.

On 2nd thought skl is still tagged as preliminary, so we don't have any issues here at all. Queued for -next, thanks for the patch.

While looking at skl_do_mmio_flip I noticed though that rotation support seems to be completely absent. Or did I miss something?

Quoted 8 lines

Yes, it doesn't exist.
Is it because of it being temporary as per the following comment:
"/*
* XXX: This is the temporary way to update the plane registers until
we get
* around to using the usual plane update functions for MMIO flips */
"

Question is what are the prerequisites to start using plane update vfunc from here? Could we just do it now?

Regards,

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

#7 lore raw
Quoted 61 lines · Tvrtko Ursulin
Quoted 50 lines · Sonika
Quoted 42 lines · Daniel Vetter
Quoted 41 lines · Tvrtko Ursulin
Quoted 14 lines · Daniel Vetter
Quoted 13 lines · Tvrtko Ursulin

From: Tvrtko Ursulin <[email protected]>

Add Y tiling support to skl_do_mmio_flip.

Cc Damien Lespiau <[email protected]>
Cc Sonika Jindal <[email protected]>
Cc Daniel Vetter <[email protected]>

---
Looks like we completely missed this completely parallel instance of plane
programming code when working on Y tiling support!

Quoted 7 lines
Quoted 1 line

Will rotation need supporting here as well?

Oh dear this is a bit ugly. We definitely need either this for 4.1 or take
out the Y-tiling support for 4.1. Rotation only made 4.2, so I think we're good, but we do indeed need to take rotation into account here too.

What is ugly, this patch or the overall situation?

Quoted 4 lines

And it seems like we also need a pile of igt testcases to make sure Y-tiling, rotation (even 180 probably) works correctly with pageflips. Yay
for kms_flip growing even more.

I added Y to kms_flip_tiling back then - but both that one and kms_flip don't do any pipe crc. So not much use in automated fashion. And testdisplay
apparently does not hit this path.

I did not have working crc hw back then, maybe that has changed, I'll check
it and then, depending on the outcome, see if I can add something automated.

Quoted 7 lines
Quoted 1 line

Either way, adding this fix sounds better than reverting everything.

On 2nd thought skl is still tagged as preliminary, so we don't have any issues here at all. Queued for -next, thanks for the patch.

While looking at skl_do_mmio_flip I noticed though that rotation support seems to be completely absent. Or did I miss something?

Quoted 8 lines

Yes, it doesn't exist.
Is it because of it being temporary as per the following comment:
"/*
* XXX: This is the temporary way to update the plane registers until
we get
* around to using the usual plane update functions for MMIO flips */
"

Quoted 2 lines

Question is what are the prerequisites to start using plane update vfunc from here? Could we just do it now?

I'm not sure whether we can do some fancy intermediate step, in the end we'll need async atomic plane updates so that we can use the helpers to remap legacy page flips to atomic. But in any case if we don't fix this up right away we need to track this as a blocker to lift skl prelimary hw support. Adding Damien as an fyi.
-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
Tested-by on v1 1/1
#8 lore raw
In reply to Tvrtko Ursulin

Task id: 6236 -------------------------------------Summary-------------------------------------
Platform Delta drm-intel-nightly Series Applied

PNV                                  276/276              276/276
ILK                                  302/302              302/302
SNB                                  318/318              318/318
IVB                                  341/341              341/341
BYT                                  287/287              287/287
BDW                                  318/318              318/318

-------------------------------------Detailed-------------------------------------
Platform Test drm-intel-nightly Series Applied
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