summaryrefslogtreecommitdiff
path: root/lib/igt_kms.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2018-03-16 19:11:59 +0200
committerVille Syrjälä <ville.syrjala@linux.intel.com>2018-11-27 23:15:00 +0200
commitb05c028ccdb6ac8e8d8499a041bb14dfe358ee26 (patch)
tree7ed3c788281aad921f8b77aa67f8d574c74fc482 /lib/igt_kms.c
parent0a961239c27bfbd60c045e6255b2970d4bf84411 (diff)
lib/igt_kms: Fill the plane format/mod information for pre-blobifier drivers
For drivers that don't support the IN_FORMATS blob we should just consult the format list returned by getplane. Since we can't know which modifiers are supported we'll assume linear-only. Obviously that may not work for every driver out there, but not much more we can do unless we start to actually probing with addfb. Cc: Ulrich Hecht <ulrich.hecht+renesas@gmail.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Diffstat (limited to 'lib/igt_kms.c')
-rw-r--r--lib/igt_kms.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 73cea75d..e5f42a6b 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -4132,8 +4132,28 @@ static void igt_fill_plane_format_mod(igt_display_t *display, igt_plane_t *plane
int idx = 0;
int count;
- if (!igt_plane_has_prop(plane, IGT_PLANE_IN_FORMATS))
+ if (!igt_plane_has_prop(plane, IGT_PLANE_IN_FORMATS)) {
+ drmModePlanePtr p = plane->drm_plane;
+
+ count = p->count_formats;
+
+ plane->format_mod_count = count;
+ plane->formats = calloc(count, sizeof(plane->formats[0]));
+ igt_assert(plane->formats);
+ plane->modifiers = calloc(count, sizeof(plane->modifiers[0]));
+ igt_assert(plane->modifiers);
+
+ /*
+ * We don't know which modifiers are
+ * supported, so we'll assume linear only.
+ */
+ for (int i = 0; i < count; i++) {
+ plane->formats[i] = p->formats[i];
+ plane->modifiers[i] = DRM_FORMAT_MOD_LINEAR;
+ }
+
return;
+ }
blob_id = igt_plane_get_prop(plane, IGT_PLANE_IN_FORMATS);