[PATCH v22 19/19] drm/i915: Do not do fb src adjustments for NV12
Vidya Srinivas
vidya.srinivas at intel.com
Mon Apr 9 08:43:09 UTC 2018
We skip src trunction/adjustments for
NV12 case and handle the sizes directly.
Without this, pipe fifo underruns are seen on APL/KBL.
Credits-to: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
Signed-off-by: Vidya Srinivas <vidya.srinivas at intel.com>
---
drivers/gpu/drm/i915/intel_atomic_plane.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/drivers/gpu/drm/i915/intel_atomic_plane.c b/drivers/gpu/drm/i915/intel_atomic_plane.c
index 5f329c3..c12d93a 100644
--- a/drivers/gpu/drm/i915/intel_atomic_plane.c
+++ b/drivers/gpu/drm/i915/intel_atomic_plane.c
@@ -183,9 +183,18 @@ intel_atomic_helper_check_plane_state(struct drm_plane_state *plane_state,
if (crtc_state->enable)
drm_mode_get_hv_timing(&crtc_state->mode, &clip.x2, &clip.y2);
+ if (INTEL_GEN(dev_priv) >= 9 &&
+ fb->format->format == DRM_FORMAT_NV12) {
+ plane_state->visible =
+ (drm_rect_width(dst) > 0 &&
+ drm_rect_height(dst) > 0);
+ goto skip_rect_clipping;
+ }
+
plane_state->visible =
drm_rect_clip_scaled(src, dst, &clip, hscale, vscale);
+skip_rect_clipping:
if (plane->type == DRM_PLANE_TYPE_OVERLAY) {
crtc_x = dst->x1;
crtc_y = dst->y1;
@@ -196,6 +205,10 @@ intel_atomic_helper_check_plane_state(struct drm_plane_state *plane_state,
if (plane_state->visible) {
if (plane->type == DRM_PLANE_TYPE_OVERLAY) {
+ if (INTEL_GEN(dev_priv) >= 9 &&
+ fb->format->format == DRM_FORMAT_NV12)
+ goto skip_rect_adjust;
+
/*
* Make the source viewport size an
* exact multiple of the scaling factors
@@ -207,6 +220,7 @@ intel_atomic_helper_check_plane_state(struct drm_plane_state *plane_state,
drm_rect_height(src)));
}
+skip_rect_adjust:
drm_rect_rotate_inv(src, fb->width << 16,
fb->height << 16, rotation);
@@ -282,6 +296,10 @@ intel_atomic_helper_check_plane_state(struct drm_plane_state *plane_state,
}
}
+ if (INTEL_GEN(dev_priv) >= 9 &&
+ fb->format->format == DRM_FORMAT_NV12)
+ goto out;
+
if (plane_state->visible) {
src->x1 = src_x << 16;
src->x2 = (src_x + src_w) << 16;
@@ -294,6 +312,7 @@ intel_atomic_helper_check_plane_state(struct drm_plane_state *plane_state,
dst->y2 = crtc_y + crtc_h;
}
+out:
if (plane->type == DRM_PLANE_TYPE_PRIMARY) {
if (!plane_state->visible)
/*
--
2.7.4
More information about the Intel-gfx-trybot
mailing list