diff options
author | Chandra Konduru <chandra.konduru@intel.com> | 2018-05-11 17:33:16 -0400 |
---|---|---|
committer | Maarten Lankhorst <maarten.lankhorst@linux.intel.com> | 2018-05-11 04:19:48 -0400 |
commit | c0b56ab544c0aaefc0aa5526471f72e2324e002c (patch) | |
tree | 60be825d6282dfd9232c11b884fabbab2236189e | |
parent | e44134f2673cf104c0ce42bfdebaf9f11bbef997 (diff) |
drm/i915: Add NV12 as supported format for primary plane
This patch adds NV12 to list of supported formats for
primary plane
v2: Rebased (Chandra Konduru)
v3: Rebased (me)
v4: Review comments by Ville addressed
Removed the skl_primary_formats_with_nv12 and
added NV12 case in existing skl_primary_formats
v5: Rebased (me)
v6: Missed the Tested-by/Reviewed-by in the previous series
Adding the same to commit message in this version.
v7: Review comments by Ville addressed
Restricting the NV12 for BXT and on PIPE A and B
Rebased (me)
v8: Rebased (me)
Modified restricting the NV12 support for both BXT and KBL.
v9: Rebased (me)
v10: Addressed review comments from Maarten.
Adding NV12 inside skl_primary_formats itself.
v11: Adding Reviewed By tag from Shashank Sharma
v12: Addressed review comments from Juha-Pekka Heikkila
"NV12 not to be supported by SKL"
v13: Addressed review comments from Ville
Added skl_pri_planar_formats to include NV12
and skl_plane_has_planar function to check for
NV12 support on plane. Added NV12 format to
skl_mod_supported. These were review comments
from Kristian Høgsberg <hoegsberg@gmail.com>
v14: Added reviewed by from Juha-Pekka Heikkila
v15: Rebased the series
v16: Added all tiling support under mod supported
for NV12. Credits to Megha Aggarwal
v17: Added RB by Maarten and Kristian
v18: Review comments from Maarten addressed -
Removing BROXTON support for NV12 due to WA826
v19: Addressed review comments from Maarten
Make changes to skl_mod_supported
Credits-to: Megha Aggarwal megha.aggarwal@intel.com
Credits-to: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Tested-by: Clinton Taylor <clinton.a.taylor@intel.com>
Reviewed-by: Kristian Høgsberg <hoegsberg@gmail.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Clinton Taylor <clinton.a.taylor@intel.com>
Reviewed-by: Shashank Sharma <shashank.sharma@intel.com>
Signed-off-by: Chandra Konduru <chandra.konduru@intel.com>
Signed-off-by: Nabendu Maiti <nabendu.bikash.maiti@intel.com>
Signed-off-by: Vidya Srinivas <vidya.srinivas@intel.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1526074397-10457-6-git-send-email-vidya.srinivas@intel.com
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 50 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_drv.h | 2 |
2 files changed, 50 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 1492cf9d71d3..ad588d564198 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -88,6 +88,22 @@ static const uint32_t skl_primary_formats[] = { | |||
88 | DRM_FORMAT_VYUY, | 88 | DRM_FORMAT_VYUY, |
89 | }; | 89 | }; |
90 | 90 | ||
91 | static const uint32_t skl_pri_planar_formats[] = { | ||
92 | DRM_FORMAT_C8, | ||
93 | DRM_FORMAT_RGB565, | ||
94 | DRM_FORMAT_XRGB8888, | ||
95 | DRM_FORMAT_XBGR8888, | ||
96 | DRM_FORMAT_ARGB8888, | ||
97 | DRM_FORMAT_ABGR8888, | ||
98 | DRM_FORMAT_XRGB2101010, | ||
99 | DRM_FORMAT_XBGR2101010, | ||
100 | DRM_FORMAT_YUYV, | ||
101 | DRM_FORMAT_YVYU, | ||
102 | DRM_FORMAT_UYVY, | ||
103 | DRM_FORMAT_VYUY, | ||
104 | DRM_FORMAT_NV12, | ||
105 | }; | ||
106 | |||
91 | static const uint64_t skl_format_modifiers_noccs[] = { | 107 | static const uint64_t skl_format_modifiers_noccs[] = { |
92 | I915_FORMAT_MOD_Yf_TILED, | 108 | I915_FORMAT_MOD_Yf_TILED, |
93 | I915_FORMAT_MOD_Y_TILED, | 109 | I915_FORMAT_MOD_Y_TILED, |
@@ -13218,6 +13234,7 @@ static bool skl_mod_supported(uint32_t format, uint64_t modifier) | |||
13218 | case DRM_FORMAT_YVYU: | 13234 | case DRM_FORMAT_YVYU: |
13219 | case DRM_FORMAT_UYVY: | 13235 | case DRM_FORMAT_UYVY: |
13220 | case DRM_FORMAT_VYUY: | 13236 | case DRM_FORMAT_VYUY: |
13237 | case DRM_FORMAT_NV12: | ||
13221 | if (modifier == I915_FORMAT_MOD_Yf_TILED) | 13238 | if (modifier == I915_FORMAT_MOD_Yf_TILED) |
13222 | return true; | 13239 | return true; |
13223 | /* fall through */ | 13240 | /* fall through */ |
@@ -13425,6 +13442,30 @@ static bool skl_plane_has_fbc(struct drm_i915_private *dev_priv, | |||
13425 | return pipe == PIPE_A && plane_id == PLANE_PRIMARY; | 13442 | return pipe == PIPE_A && plane_id == PLANE_PRIMARY; |
13426 | } | 13443 | } |
13427 | 13444 | ||
13445 | bool skl_plane_has_planar(struct drm_i915_private *dev_priv, | ||
13446 | enum pipe pipe, enum plane_id plane_id) | ||
13447 | { | ||
13448 | if (plane_id == PLANE_PRIMARY) { | ||
13449 | if (IS_SKYLAKE(dev_priv) || IS_BROXTON(dev_priv)) | ||
13450 | return false; | ||
13451 | else if ((INTEL_GEN(dev_priv) == 9 && pipe == PIPE_C) && | ||
13452 | !IS_GEMINILAKE(dev_priv)) | ||
13453 | return false; | ||
13454 | } else if (plane_id >= PLANE_SPRITE0) { | ||
13455 | if (plane_id == PLANE_CURSOR) | ||
13456 | return false; | ||
13457 | if (IS_GEMINILAKE(dev_priv) || INTEL_GEN(dev_priv) == 10) { | ||
13458 | if (plane_id != PLANE_SPRITE0) | ||
13459 | return false; | ||
13460 | } else { | ||
13461 | if (plane_id != PLANE_SPRITE0 || pipe == PIPE_C || | ||
13462 | IS_SKYLAKE(dev_priv) || IS_BROXTON(dev_priv)) | ||
13463 | return false; | ||
13464 | } | ||
13465 | } | ||
13466 | return true; | ||
13467 | } | ||
13468 | |||
13428 | static struct intel_plane * | 13469 | static struct intel_plane * |
13429 | intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe) | 13470 | intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe) |
13430 | { | 13471 | { |
@@ -13485,8 +13526,13 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe) | |||
13485 | primary->check_plane = intel_check_primary_plane; | 13526 | primary->check_plane = intel_check_primary_plane; |
13486 | 13527 | ||
13487 | if (INTEL_GEN(dev_priv) >= 9) { | 13528 | if (INTEL_GEN(dev_priv) >= 9) { |
13488 | intel_primary_formats = skl_primary_formats; | 13529 | if (skl_plane_has_planar(dev_priv, pipe, PLANE_PRIMARY)) { |
13489 | num_formats = ARRAY_SIZE(skl_primary_formats); | 13530 | intel_primary_formats = skl_pri_planar_formats; |
13531 | num_formats = ARRAY_SIZE(skl_pri_planar_formats); | ||
13532 | } else { | ||
13533 | intel_primary_formats = skl_primary_formats; | ||
13534 | num_formats = ARRAY_SIZE(skl_primary_formats); | ||
13535 | } | ||
13490 | 13536 | ||
13491 | if (skl_plane_has_ccs(dev_priv, pipe, PLANE_PRIMARY)) | 13537 | if (skl_plane_has_ccs(dev_priv, pipe, PLANE_PRIMARY)) |
13492 | modifiers = skl_format_modifiers_ccs; | 13538 | modifiers = skl_format_modifiers_ccs; |
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 038870abe989..d7dbca1aabff 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h | |||
@@ -2082,6 +2082,8 @@ bool skl_plane_get_hw_state(struct intel_plane *plane); | |||
2082 | bool skl_plane_has_ccs(struct drm_i915_private *dev_priv, | 2082 | bool skl_plane_has_ccs(struct drm_i915_private *dev_priv, |
2083 | enum pipe pipe, enum plane_id plane_id); | 2083 | enum pipe pipe, enum plane_id plane_id); |
2084 | bool intel_format_is_yuv(uint32_t format); | 2084 | bool intel_format_is_yuv(uint32_t format); |
2085 | bool skl_plane_has_planar(struct drm_i915_private *dev_priv, | ||
2086 | enum pipe pipe, enum plane_id plane_id); | ||
2085 | 2087 | ||
2086 | /* intel_tv.c */ | 2088 | /* intel_tv.c */ |
2087 | void intel_tv_init(struct drm_i915_private *dev_priv); | 2089 | void intel_tv_init(struct drm_i915_private *dev_priv); |