compositor-drm: Use matrix type to test for drm plane compatibility
authorKristian Høgsberg <krh@bitplanet.net>
Tue, 29 Jan 2013 21:56:15 +0000 (16:56 -0500)
committerKristian Høgsberg <krh@bitplanet.net>
Tue, 29 Jan 2013 21:56:15 +0000 (16:56 -0500)
The drm planes (sprites) only support translation and scaling.  Now that
we have matrix.type, we can just look there to see if the transform is
compatible with kms.

src/compositor-drm.c

index 82090f0..f1f7343 100644 (file)
@@ -698,32 +698,8 @@ drm_output_check_sprite_format(struct drm_sprite *s,
 static int
 drm_surface_transform_supported(struct weston_surface *es)
 {
-       struct weston_matrix *matrix = &es->transform.matrix;
-       int i;
-
-       if (!es->transform.enabled)
-               return 1;
-
-       for (i = 0; i < 16; i++) {
-               switch (i) {
-               case 10:
-               case 15:
-                       if (matrix->d[i] != 1.0)
-                               return 0;
-                       break;
-               case 0:
-               case 5:
-               case 12:
-               case 13:
-                       break;
-               default:
-                       if (matrix->d[i] != 0.0)
-                               return 0;
-                       break;
-               }
-       }
-
-       return 1;
+       return !es->transform.enabled ||
+               (es->transform.matrix.type < WESTON_MATRIX_TRANSFORM_ROTATE);
 }
 
 static struct weston_plane *