From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Remove src adjustment in intel_check_sprite_plane.
Date: Mon, 23 Apr 2018 17:30:04 +0300 [thread overview]
Message-ID: <20180423143004.GJ13908@intel.com> (raw)
In-Reply-To: <20180423104922.6557-1-maarten.lankhorst@linux.intel.com>
On Mon, Apr 23, 2018 at 12:49:22PM +0200, Maarten Lankhorst wrote:
> The rounding can cause a perfectly normal 16x16 src to full-screen
> dst to be rounded down, even without clipping involved. Because of
> this we should just remove the adjustment, as no other driver or plane
> does it.
>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
> drivers/gpu/drm/i915/intel_sprite.c | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
> index a1d048af0261..203ca8b362a5 100644
> --- a/drivers/gpu/drm/i915/intel_sprite.c
> +++ b/drivers/gpu/drm/i915/intel_sprite.c
> @@ -996,11 +996,6 @@ intel_check_sprite_plane(struct intel_plane *plane,
> return vscale;
> }
>
> - /* 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));
> -
This makes the scaling factor checks a slightly incorrect. Ie. we might
exceed the max h/vscale a bit without realizing it. It's a shame the
hardware doesn't let us actually program the scaling factors/increments
and starting phases anymore :( Also we don't actually know how the
hardware calculates that stuff (assuming it has such things internally),
so I'm not actually sure how we should be checking the max limit so
that we actually check what the hardware will use.
Without a more detailed study of the hardware behaviour I'm thinking
we should perhaps just check the final src vs. dst coordinates like so:
if (src > dst*max)
fail;
as that would avoid the precision issues with the .16 scaling factors.
Another option could be to round h/vscale up. That should guarantee
that we never exceed the max.
> drm_rect_rotate_inv(src, fb->width << 16, fb->height << 16,
> state->base.rotation);
>
> --
> 2.17.0
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Ville Syrjälä
Intel
_______________________________________________
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-23 14:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-23 10:49 [PATCH] drm/i915: Remove src adjustment in intel_check_sprite_plane Maarten Lankhorst
2018-04-23 14:04 ` ✓ Fi.CI.BAT: success for " Patchwork
2018-04-23 14:30 ` Ville Syrjälä [this message]
2018-04-23 14:39 ` [PATCH] " Maarten Lankhorst
2018-04-23 15:16 ` Ville Syrjälä
2018-04-23 18:16 ` ✓ Fi.CI.IGT: success for " Patchwork
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=20180423143004.GJ13908@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=maarten.lankhorst@linux.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.