This patch adds NV12 to list of supported formats for primary plane. Signed-off-by: Chandra Konduru <chandra.konduru@xxxxxxxxx> Testcase: igt/kms_nv12 --- drivers/gpu/drm/i915/intel_display.c | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index c235a66..d3773d2 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -59,7 +59,7 @@ static const uint32_t intel_primary_formats_gen2[] = { DRM_FORMAT_ARGB1555, }; -/* Primary plane formats for gen >= 4 */ +/* Primary plane formats for gen 4 to 8 */ static const uint32_t intel_primary_formats_gen4[] = { COMMON_PRIMARY_FORMATS, \ DRM_FORMAT_XBGR8888, @@ -70,6 +70,28 @@ static const uint32_t intel_primary_formats_gen4[] = { DRM_FORMAT_ABGR2101010, }; +/* Primary plane formats for gen >= 9 */ +static const uint32_t intel_primary_formats_gen9[] = { + COMMON_PRIMARY_FORMATS, \ + DRM_FORMAT_XBGR8888, + DRM_FORMAT_ABGR8888, + DRM_FORMAT_XRGB2101010, + DRM_FORMAT_ARGB2101010, + DRM_FORMAT_XBGR2101010, + DRM_FORMAT_ABGR2101010, +}; + +static const uint32_t intel_primary_formats_with_nv12_gen9[] = { + COMMON_PRIMARY_FORMATS, \ + DRM_FORMAT_XBGR8888, + DRM_FORMAT_ABGR8888, + DRM_FORMAT_XRGB2101010, + DRM_FORMAT_ARGB2101010, + DRM_FORMAT_XBGR2101010, + DRM_FORMAT_ABGR2101010, + DRM_FORMAT_NV12, +}; + /* Cursor formats */ static const uint32_t intel_cursor_formats[] = { DRM_FORMAT_ARGB8888, @@ -13204,6 +13226,14 @@ static struct drm_plane *intel_primary_plane_create(struct drm_device *dev, if (INTEL_INFO(dev)->gen <= 3) { intel_primary_formats = intel_primary_formats_gen2; num_formats = ARRAY_SIZE(intel_primary_formats_gen2); + } else if (INTEL_INFO(dev)->gen >= 9) { + if (pipe == PIPE_A || pipe == PIPE_B) { + intel_primary_formats = intel_primary_formats_with_nv12_gen9; + num_formats = ARRAY_SIZE(intel_primary_formats_with_nv12_gen9); + } else { + intel_primary_formats = intel_primary_formats_gen9; + num_formats = ARRAY_SIZE(intel_primary_formats_gen9); + } } else { intel_primary_formats = intel_primary_formats_gen4; num_formats = ARRAY_SIZE(intel_primary_formats_gen4); -- 1.7.9.5 _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/intel-gfx