Skip to contentSkip to conversation

drm/mm: Do DRM_MM_CREATE_TOP adj_start calculation after color_adjust

PATCH Applied Michel Thierry 4 participants 4 messages Aug 16, 2015 – Aug 25, 2015

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

PATCH 1/1 drm/mm: Do DRM_MM_CREATE_TOP adj_start calculation after color_adjust

The adj_start calculation for DRM_MM_CREATE_TOP should happen after mm->color_adjust. There was an inconsistency between drm_mm_insert_helper_range
and drm_mm_insert_helper, as the later was already updating after color_adjust.

Didn't spot it before, as color_adjust is only done in systems without LLC. But I'm not aware of anybody using this test case yet.

---
 drivers/gpu/drm/drm_mm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/drm_mm.c +3 -3
index 3427b11..04de6fd 100644
@@ -267,12 +267,12 @@ static void drm_mm_insert_helper_range(struct drm_mm_node *hole_node,
 	if (adj_end > end)
 		adj_end = end;
 
-	if (flags & DRM_MM_CREATE_TOP)
-		adj_start = adj_end - size;
-
 	if (mm->color_adjust)
 		mm->color_adjust(hole_node, color, &adj_start, &adj_end);
 
+	if (flags & DRM_MM_CREATE_TOP)
+		adj_start = adj_end - size;
+
 	if (alignment) {
 		u64 tmp = adj_start;
 		unsigned rem;
Signature · 6 lines
2.5.0

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

The adj_start calculation for DRM_MM_CREATE_TOP should happen after mm->color_adjust. There was an inconsistency between drm_mm_insert_helper_range
and drm_mm_insert_helper, as the later was already updating after color_adjust.

Didn't spot it before, as color_adjust is only done in systems without LLC. But I'm not aware of anybody using this test case yet.

I sent this patch a few years ago, when I was using a top-down allocator before llc and I have a similar patch in my tree which I kept meaning to polish up and warn you about before PIN_HIGH.

-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw
Quoted 10 lines · Chris Wilson
Quoted 9 lines · Michel Thierry

The adj_start calculation for DRM_MM_CREATE_TOP should happen after mm->color_adjust. There was an inconsistency between drm_mm_insert_helper_range
and drm_mm_insert_helper, as the later was already updating after color_adjust.

Didn't spot it before, as color_adjust is only done in systems without LLC. But I'm not aware of anybody using this test case yet.

Quoted 7 lines
Quoted 1 line

I sent this patch a few years ago, when I was using a top-down allocator before llc and I have a similar patch in my tree which I kept meaning to polish up and warn you about before PIN_HIGH.

Applied to drm-misc, thanks.
-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
#3 lore raw
In reply to Michel Thierry

Task id: 7208 -------------------------------------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 -1 283/283 282/283
HSW 378/378 378/378
-------------------------------------Detailed-------------------------------------
Platform Test drm-intel-nightly Series Applied
*ILK igt@kms_flip@rcs-wf_vblank-vs-dpms-interruptible PASS(1) DMESG_WARN(1)
*BYT igt@gem_partial_pwrite_pread@reads-uncached PASS(1) FAIL(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