From: Mika Kahola <mika.kahola@intel.com>
To: Vidya Srinivas <vidya.srinivas@intel.com>,
intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2 6/6] drm/i915: Do not do fb src adjustments for NV12
Date: Tue, 17 Apr 2018 12:18:48 +0300 [thread overview]
Message-ID: <1523956728.16539.18.camel@intel.com> (raw)
In-Reply-To: <1523621644-32363-7-git-send-email-vidya.srinivas@intel.com>
On Fri, 2018-04-13 at 17:44 +0530, Vidya Srinivas wrote:
> We skip src trunction/adjustments for
> NV12 case and handle the sizes directly.
> Without this, pipe fifo underruns are seen on APL/KBL.
>
> v2: For NV12, making the src coordinates multiplier of 4
>
> Credits-to: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Signed-off-by: Vidya Srinivas <vidya.srinivas@intel.com>
> ---
> drivers/gpu/drm/i915/intel_display.c | 11 +++++++++++
> drivers/gpu/drm/i915/intel_sprite.c | 15 +++++++++++++++
> 2 files changed, 26 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c
> b/drivers/gpu/drm/i915/intel_display.c
> index bc83f10..f64708f 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -12978,6 +12978,10 @@ intel_check_primary_plane(struct intel_plane
> *plane,
> bool can_position = false;
> int ret;
> uint32_t pixel_format = 0;
> + struct drm_plane_state *plane_state = &state->base;
> + struct drm_rect *src = &plane_state->src;
This seems unnecessary. We could use the line below to get the src's.
> +
> + *src = drm_plane_state_src(plane_state);
>
> if (INTEL_GEN(dev_priv) >= 9) {
> /* use scaler when colorkey is not required */
> @@ -13001,6 +13005,13 @@ intel_check_primary_plane(struct intel_plane
> *plane,
> if (!state->base.fb)
> return 0;
>
> + if (pixel_format == DRM_FORMAT_NV12) {
> + src->x1 = (((src->x1 >> 16)/4)*4) << 16;
> + src->x2 = (((src->x2 >> 16)/4)*4) << 16;
> + src->y1 = (((src->y1 >> 16)/4)*4) << 16;
> + src->y2 = (((src->y2 >> 16)/4)*4) << 16;
> + }
> +
> if (INTEL_GEN(dev_priv) >= 9) {
> ret = skl_check_plane_surface(crtc_state, state);
> if (ret)
> diff --git a/drivers/gpu/drm/i915/intel_sprite.c
> b/drivers/gpu/drm/i915/intel_sprite.c
> index 8b7947d..c1dd85e 100644
> --- a/drivers/gpu/drm/i915/intel_sprite.c
> +++ b/drivers/gpu/drm/i915/intel_sprite.c
> @@ -1035,11 +1035,20 @@ intel_check_sprite_plane(struct intel_plane
> *plane,
> return vscale;
> }
>
> + if (fb->format->format == DRM_FORMAT_NV12) {
> + if (src->x2 >> 16 == 16)
> + src->x2 = 16 << 16;
> + if (src->y2 >> 16 == 16)
> + src->y2 = 16 << 16;
> + goto nv12_min_no_clip;
> + }
> +
> /* Make the source viewport size an exact multiple
> of the scaling factors. */
> drm_rect_adjust_size(src,
> drm_rect_width(dst) * hscale -
> drm_rect_width(src),
> drm_rect_height(dst) * vscale -
> drm_rect_height(src));
>
> +nv12_min_no_clip:
> drm_rect_rotate_inv(src, fb->width << 16, fb->height
> << 16,
> state->base.rotation);
>
> @@ -1105,6 +1114,12 @@ intel_check_sprite_plane(struct intel_plane
> *plane,
> src->x2 = (src_x + src_w) << 16;
> src->y1 = src_y << 16;
> src->y2 = (src_y + src_h) << 16;
> + if (fb->format->format == DRM_FORMAT_NV12) {
> + src->x1 = (((src->x1 >> 16)/4)*4) << 16;
> + src->x2 = (((src->x2 >> 16)/4)*4) << 16;
> + src->y1 = (((src->y1 >> 16)/4)*4) << 16;
> + src->y2 = (((src->y2 >> 16)/4)*4) << 16;
> + }
> }
>
> dst->x1 = crtc_x;
--
Mika Kahola - Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-04-17 9:18 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-13 12:13 [PATCH v2 0/6] Enable NV12 support Vidya Srinivas
2018-04-13 12:13 ` [PATCH v2 1/6] drm/i915: Enable display workaround 827 for all planes, v2 Vidya Srinivas
2018-04-13 12:14 ` [PATCH v2 2/6] drm/i915: Add NV12 as supported format for primary plane Vidya Srinivas
2018-04-13 16:15 ` Kristian Høgsberg
2018-04-13 12:14 ` [PATCH v2 3/6] drm/i915: Add NV12 as supported format for sprite plane Vidya Srinivas
2018-04-13 16:13 ` Kristian Høgsberg
2018-04-16 3:05 ` Srinivas, Vidya
2018-04-13 12:14 ` [PATCH v2 4/6] drm/i915: Add NV12 support to intel_framebuffer_init Vidya Srinivas
2018-04-13 12:14 ` [PATCH v2 5/6] drm/i915: Enable Display WA 0528 Vidya Srinivas
2018-04-13 12:14 ` [PATCH v2 6/6] drm/i915: Do not do fb src adjustments for NV12 Vidya Srinivas
2018-04-17 9:18 ` Mika Kahola [this message]
2018-04-17 9:20 ` Srinivas, Vidya
2018-04-13 12:30 ` ✗ Fi.CI.CHECKPATCH: warning for Enable NV12 support Patchwork
2018-04-13 12:46 ` ✓ Fi.CI.BAT: success " Patchwork
2018-04-13 13:33 ` ✓ Fi.CI.IGT: " Patchwork
[not found] <1523527177-14285-6-git-send-email-vidya.srinivas@intel.com>
[not found] ` <1523596958-26701-1-git-send-email-vidya.srinivas@intel.com>
[not found] ` <d729da8e-d5d5-9da9-221e-5da0f590ce0e@linux.intel.com>
[not found] ` <F653A0A18852B74D88578FA2EB7094EAB6850B06@BGSMSX108.gar.corp.intel.com>
2018-04-17 6:03 ` [PATCH v2 6/6] drm/i915: Do not do fb src adjustments for NV12 Saarinen, Jani
2018-04-17 7:25 ` Maarten Lankhorst
2018-04-17 7:38 ` Srinivas, Vidya
2018-04-17 7:50 ` Maarten Lankhorst
2018-04-17 8:02 ` Srinivas, Vidya
2018-04-17 8:09 ` Srinivas, Vidya
2018-04-17 9:34 ` Maarten Lankhorst
2018-04-17 9:42 ` Srinivas, Vidya
2018-04-17 10:01 ` Maarten Lankhorst
2018-04-17 10:18 ` Srinivas, Vidya
2018-04-17 10:48 ` Srinivas, Vidya
2018-04-17 10:52 ` Saarinen, Jani
2018-04-18 3:55 ` Srinivas, Vidya
2018-04-18 5:36 ` Saarinen, Jani
2018-04-18 5:55 ` Srinivas, Vidya
2018-04-18 4:16 ` Srinivas, Vidya
[not found] ` <F653A0A18852B74D88578FA2EB7094EAB6850CA9@BGSMSX108.gar.corp.intel.com>
2018-04-17 6:06 ` Saarinen, Jani
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1523956728.16539.18.camel@intel.com \
--to=mika.kahola@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=vidya.srinivas@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.