[PATCH v21 19/19] drm/i915: Do not do fb src adjustments for NV12
Vidya Srinivas
vidya.srinivas at intel.com
Sat Apr 7 11:26:16 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 | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/drivers/gpu/drm/i915/intel_atomic_plane.c b/drivers/gpu/drm/i915/intel_atomic_plane.c
index 3ce808e..06c93f5 100644
--- a/drivers/gpu/drm/i915/intel_atomic_plane.c
+++ b/drivers/gpu/drm/i915/intel_atomic_plane.c
@@ -160,9 +160,17 @@ 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 (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:
crtc_x = dst->x1;
crtc_y = dst->y1;
crtc_w = drm_rect_width(dst);
@@ -186,6 +194,8 @@ intel_atomic_helper_check_plane_state(struct drm_plane_state *plane_state,
return vscale;
}
+ if (fb->format->format == DRM_FORMAT_NV12)
+ goto skip_rect_adjust;
/*
* Make the source viewport size an
* exact multiple of the scaling factors
@@ -196,6 +206,7 @@ intel_atomic_helper_check_plane_state(struct drm_plane_state *plane_state,
(drm_rect_height(dst) * vscale -
drm_rect_height(src)));
+skip_rect_adjust:
drm_rect_rotate_inv(src, fb->width << 16,
fb->height << 16, rotation);
@@ -258,6 +269,9 @@ intel_atomic_helper_check_plane_state(struct drm_plane_state *plane_state,
}
}
+ if (fb->format->format == DRM_FORMAT_NV12)
+ goto out;
+
if (plane_state->visible) {
src->x1 = src_x << 16;
src->x2 = (src_x + src_w) << 16;
@@ -269,6 +283,7 @@ intel_atomic_helper_check_plane_state(struct drm_plane_state *plane_state,
dst->y1 = crtc_y;
dst->y2 = crtc_y + crtc_h;
+out:
if (!plane_state->visible)
/*
* Plane isn't visible; some drivers can handle this
--
2.7.4
More information about the Intel-gfx-trybot
mailing list