Skip to contentSkip to conversation

lib/igt_kms: Fix atomic plane commit when fb_id is 0.

PATCH In review Marius Vlad 4 participants 6 messages Apr 4, 2016 – Apr 5, 2016 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib/igt_kms: Fix atomic plane commit when fb_id is 0.

igt_atomic_prepare_plane_commit() assumes that the framebuffer is always set-up.

---
 lib/igt_kms.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/igt_kms.c +1 -1
index 82257a6..30c5b7e 100644
@@ -1585,7 +1585,7 @@ igt_atomic_prepare_plane_commit(igt_plane_t *plane, igt_output_t *output,
 		igt_atomic_populate_plane_req(req, plane, IGT_PLANE_FB_ID, fb_id);
 	}
 
-	if (plane->position_changed || plane->size_changed) {
+	if ((plane->position_changed || plane->size_changed) && fb_id != 0) {
 		uint32_t src_x = IGT_FIXED(plane->fb->src_x, 0); /* src_x */
 		uint32_t src_y = IGT_FIXED(plane->fb->src_y, 0); /* src_y */
 		uint32_t src_w = IGT_FIXED(plane->fb->src_w, 0); /* src_w */
Signature · 6 lines
2.5.0

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

Hi Marius,

Thanks for this. I have the same patch on a branch I haven't send yet (oops).

In my patch I implemented this by setting src_* to 0 if fb_id == 0. I'm not sure what makes more sense but anyway :

Quoted 13 lines · Marius Vlad

igt_atomic_prepare_plane_commit() assumes that the framebuffer is always set-up.

---
  lib/igt_kms.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
lib/igt_kms.c +0 -0
index 82257a6..30c5b7e 100644

lib/igt_kms.c igt_atomic_prepare_plane_commit(igt_plane_t *plane, igt_output_t *output, · line 1591

Quoted 8 lines
lib/igt_kms.c +1 -1
@@ -1585,7 +1585,7 @@ igt_atomic_prepare_plane_commit(igt_plane_t *plane, igt_output_t *output,
  		igt_atomic_populate_plane_req(req, plane, IGT_PLANE_FB_ID, fb_id);
  	}
 
-	if (plane->position_changed || plane->size_changed) {
+	if ((plane->position_changed || plane->size_changed) && fb_id != 0) {
  		uint32_t src_x = IGT_FIXED(plane->fb->src_x, 0); /* src_x */
  		uint32_t src_y = IGT_FIXED(plane->fb->src_y, 0); /* src_y */
  		uint32_t src_w = IGT_FIXED(plane->fb->src_w, 0); /* src_w */

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

#2 lore raw
In reply to Marius Vlad
Quoted 13 lines · Marius Vlad

igt_atomic_prepare_plane_commit() assumes that the framebuffer is always set-up.

---
 lib/igt_kms.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/igt_kms.c +0 -0
index 82257a6..30c5b7e 100644

lib/igt_kms.c igt_atomic_prepare_plane_commit(igt_plane_t *plane, igt_output_t *output, · line 1591

Quoted 8 lines
lib/igt_kms.c +1 -1
@@ -1585,7 +1585,7 @@ igt_atomic_prepare_plane_commit(igt_plane_t *plane, igt_output_t *output,
 		igt_atomic_populate_plane_req(req, plane, IGT_PLANE_FB_ID, fb_id);
 	}
 
-	if (plane->position_changed || plane->size_changed) {
+	if ((plane->position_changed || plane->size_changed) && fb_id != 0) {
 		uint32_t src_x = IGT_FIXED(plane->fb->src_x, 0); /* src_x */
 		uint32_t src_y = IGT_FIXED(plane->fb->src_y, 0); /* src_y */
 		uint32_t src_w = IGT_FIXED(plane->fb->src_w, 0); /* src_w */

Someone should really move the src coordinates from the fb into the plane.

Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw
In reply to Marius Vlad

Op 04-04-16 om 17:47 schreef Marius Vlad:

Quoted 13 lines

igt_atomic_prepare_plane_commit() assumes that the framebuffer is always set-up.

---
 lib/igt_kms.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/igt_kms.c +0 -0
index 82257a6..30c5b7e 100644

lib/igt_kms.c igt_atomic_prepare_plane_commit(igt_plane_t *plane, igt_output_t *output, · line 1591

Quoted 8 lines
lib/igt_kms.c +1 -1
@@ -1585,7 +1585,7 @@ igt_atomic_prepare_plane_commit(igt_plane_t *plane, igt_output_t *output,
 		igt_atomic_populate_plane_req(req, plane, IGT_PLANE_FB_ID, fb_id);
 	}
 
-	if (plane->position_changed || plane->size_changed) {
+	if ((plane->position_changed || plane->size_changed) && fb_id != 0) {
 		uint32_t src_x = IGT_FIXED(plane->fb->src_x, 0); /* src_x */
 		uint32_t src_y = IGT_FIXED(plane->fb->src_y, 0); /* src_y */
 		uint32_t src_w = IGT_FIXED(plane->fb->src_w, 0); /* src_w */

Why is this needed?

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

#4 lore raw
Quoted 17 lines · Maarten Lankhorst

Op 04-04-16 om 17:47 schreef Marius Vlad:

Quoted 16 lines

igt_atomic_prepare_plane_commit() assumes that the framebuffer is always set-up.

---
 lib/igt_kms.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/igt_kms.c +0 -0
index 82257a6..30c5b7e 100644
@@ -1585,7 +1585,7 @@ igt_atomic_prepare_plane_commit(igt_plane_t *plane, igt_output_t *output,
 		igt_atomic_populate_plane_req(req, plane, IGT_PLANE_FB_ID, fb_id);
 	}
 
Quoted 6 lines

lib/igt_kms.c igt_atomic_prepare_plane_commit(igt_plane_t *plane, igt_output_t *output, · line 1591

Quoted 5 lines
lib/igt_kms.c +1 -1
-	if (plane->position_changed || plane->size_changed) {
+	if ((plane->position_changed || plane->size_changed) && fb_id != 0) {
 		uint32_t src_x = IGT_FIXED(plane->fb->src_x, 0); /* src_x */
 		uint32_t src_y = IGT_FIXED(plane->fb->src_y, 0); /* src_y */
 		uint32_t src_w = IGT_FIXED(plane->fb->src_w, 0); /* src_w */

Why is this needed?

Because plane->fb is NULL when fb_id == 0. Maybe Ville had a point, not having src_* in plane->fb.

Quoted 2 lines

~Maarten

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

#5 lore raw

Op 05-04-16 om 12:29 schreef Marius Vlad:

Quoted 18 lines · Maarten Lankhorst
Quoted 17 lines

Op 04-04-16 om 17:47 schreef Marius Vlad:

Quoted 16 lines

igt_atomic_prepare_plane_commit() assumes that the framebuffer is always set-up.

---
 lib/igt_kms.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/igt_kms.c +0 -0
index 82257a6..30c5b7e 100644
@@ -1585,7 +1585,7 @@ igt_atomic_prepare_plane_commit(igt_plane_t *plane, igt_output_t *output,
 		igt_atomic_populate_plane_req(req, plane, IGT_PLANE_FB_ID, fb_id);
 	}
 
Quoted 9 lines
Quoted 6 lines

lib/igt_kms.c igt_atomic_prepare_plane_commit(igt_plane_t *plane, igt_output_t *output, · line 1591

Quoted 5 lines
lib/igt_kms.c +1 -1
-	if (plane->position_changed || plane->size_changed) {
+	if ((plane->position_changed || plane->size_changed) && fb_id != 0) {
 		uint32_t src_x = IGT_FIXED(plane->fb->src_x, 0); /* src_x */
 		uint32_t src_y = IGT_FIXED(plane->fb->src_y, 0); /* src_y */
 		uint32_t src_w = IGT_FIXED(plane->fb->src_w, 0); /* src_w */

Why is this needed?

Because plane->fb is NULL when fb_id == 0. Maybe Ville had a point, not having src_* in plane->fb.

Indeed, it's a property of the plane, not the fb.

You could put the same fb on multiple planes with different src parameters. :)

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