All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Fritz Koenig <frkoenig@google.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915 : clip yuv primary planes to hw constraints
Date: Fri, 25 May 2018 21:12:07 +0300	[thread overview]
Message-ID: <20180525181207.GI23723@intel.com> (raw)
In-Reply-To: <20180525180023.204274-1-frkoenig@google.com>

On Fri, May 25, 2018 at 11:00:23AM -0700, Fritz Koenig wrote:
> YUV planes need to be multiples of 2 to scan out. This was
> handled correctly for planes other than the primary in the
> intel_check_sprite_plane, where the code fixes up the plane
> and makes it compliant. Move this code into a location that
> allows the primary check to access it as well.
> 
> Signed-off-by: Fritz Koenig <frkoenig@google.com>
> ---
> 
> Hi,
> 
> I think this is a better implementation where instead of rejecting
> yuv planes that are not correctly aligned, they are fixed up.  This
> is done by reusing the sprite check code that was already doing that.
> 
>  drivers/gpu/drm/i915/intel_display.c | 170 +++++++++++++++++++++++++++
>  drivers/gpu/drm/i915/intel_drv.h     |   2 +
>  drivers/gpu/drm/i915/intel_sprite.c  | 154 +-----------------------
>  3 files changed, 175 insertions(+), 151 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 56004ffbd8bb..1328fb90367f 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -12854,6 +12854,170 @@ skl_max_scale(struct intel_crtc *intel_crtc, struct intel_crtc_state *crtc_state
>  	return max_scale;
>  }
>  
> +int
> +intel_clip_src_rect(struct intel_plane *plane,
> +		    struct intel_crtc_state *crtc_state,
> +		    struct intel_plane_state *state)
> +{
> +	struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
> +	struct intel_crtc *crtc = to_intel_crtc(crtc_state->base.crtc);
> +	struct drm_framebuffer *fb = state->base.fb;
> +	int crtc_x, crtc_y;
> +	unsigned int crtc_w, crtc_h;
> +	uint32_t src_x, src_y, src_w, src_h;
> +	struct drm_rect *src = &state->base.src;
> +	struct drm_rect *dst = &state->base.dst;
> +	struct drm_rect clip = {};
> +	int hscale, vscale;
> +	int max_scale, min_scale;
> +	bool can_scale;
> +
> +	*src = drm_plane_state_src(&state->base);
> +	*dst = drm_plane_state_dest(&state->base);
> +
> +	/* setup can_scale, min_scale, max_scale */
> +	if (INTEL_GEN(dev_priv) >= 9) {
> +		/* use scaler when colorkey is not required */
> +		if (!state->ckey.flags) {
> +			can_scale = 1;
> +			min_scale = 1;
> +			max_scale = skl_max_scale(crtc, crtc_state);
> +		} else {
> +			can_scale = 0;
> +			min_scale = DRM_PLANE_HELPER_NO_SCALING;
> +			max_scale = DRM_PLANE_HELPER_NO_SCALING;
> +		}
> +	} else {
> +		can_scale = plane->can_scale;
> +		max_scale = plane->max_downscale << 16;
> +		min_scale = plane->can_scale ? 1 : (1 << 16);
> +	}
> +
> +	/*
> +	 * FIXME the following code does a bunch of fuzzy adjustments to the
> +	 * coordinates and sizes. We probably need some way to decide whether
> +	 * more strict checking should be done instead.
> +	 */
> +	drm_rect_rotate(src, fb->width << 16, fb->height << 16,
> +			state->base.rotation);
> +
> +	hscale = drm_rect_calc_hscale_relaxed(src, dst, min_scale, max_scale);
> +	BUG_ON(hscale < 0);
> +
> +	vscale = drm_rect_calc_vscale_relaxed(src, dst, min_scale, max_scale);
> +	BUG_ON(vscale < 0);

Your baseline is already outdated.

-- 
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2018-05-25 18:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-25 18:00 [PATCH] drm/i915 : clip yuv primary planes to hw constraints Fritz Koenig
2018-05-25 18:06 ` ✗ Fi.CI.BAT: failure for " Patchwork
2018-05-25 18:12 ` Ville Syrjälä [this message]
2018-05-25 20:48   ` [PATCH] " Fritz Koenig
  -- strict thread matches above, loose matches on Subject: below --
2018-05-25 19:27 Fritz Koenig
2018-05-30 16:58 ` Ville Syrjälä

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=20180525181207.GI23723@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=frkoenig@google.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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.