[igt-dev] [PATCH i-g-t 1/4] lib/igt_kms: Return the first overlay not the last one

Ville Syrjala ville.syrjala at linux.intel.com
Fri Jan 31 20:15:51 UTC 2020


From: Ville Syrjälä <ville.syrjala at linux.intel.com>

For some reason igt_pipe_get_plane_type() returns the last overlay
plane it can find. I'd prefer it to do the opposite since on
Intel hw the set of features supported by the plane generally
goes down the further up you go.

Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
 lib/igt_kms.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index d20daaad7764..645e6c54c041 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -2293,9 +2293,12 @@ igt_plane_t *igt_pipe_get_plane_type(igt_pipe_t *pipe, int plane_type)
 		plane_idx = pipe->plane_primary;
 		break;
 	case DRM_PLANE_TYPE_OVERLAY:
-		for(i = 0; i < pipe->n_planes; i++)
-			if (pipe->planes[i].type == DRM_PLANE_TYPE_OVERLAY)
-			    plane_idx = i;
+		for(i = 0; i < pipe->n_planes; i++) {
+			if (pipe->planes[i].type == DRM_PLANE_TYPE_OVERLAY) {
+				plane_idx = i;
+				break;
+			}
+		}
 		break;
 	default:
 		break;
-- 
2.24.1



More information about the igt-dev mailing list