From: Matt Roper <matthew.d.roper@intel.com>
To: "Konduru, Chandra" <chandra.konduru@intel.com>
Cc: "Vetter, Daniel" <daniel.vetter@intel.com>,
"intel-gfx@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>,
"Conselvan De Oliveira,
Ander" <ander.conselvan.de.oliveira@intel.com>
Subject: Re: [PATCH 06/14] drm/i915: Keep sprite plane src rect in 16.16 format
Date: Thu, 9 Apr 2015 15:22:36 -0700 [thread overview]
Message-ID: <20150409222236.GI9016@intel.com> (raw)
In-Reply-To: <76A9B330A4D78C4D99CB292C4CC06C0E36F988C3@fmsmsx101.amr.corp.intel.com>
On Thu, Apr 09, 2015 at 03:08:55PM -0700, Konduru, Chandra wrote:
>
>
> > -----Original Message-----
> > From: Roper, Matthew D
> > Sent: Thursday, April 09, 2015 2:51 PM
> > To: Konduru, Chandra
> > Cc: intel-gfx@lists.freedesktop.org; Vetter, Daniel; Conselvan De Oliveira, Ander
> > Subject: Re: [PATCH 06/14] drm/i915: Keep sprite plane src rect in 16.16 format
> >
> > On Tue, Apr 07, 2015 at 03:28:39PM -0700, Chandra Konduru wrote:
> > > This patch keeps intel_plane_state->src rect back into 16.16 format.
> > >
> > > v2:
> > > -sprite src rect to match primary format (Matt, Daniel)
> > >
> > > Signed-off-by: Chandra Konduru <chandra.konduru@intel.com>
> >
> > This looks good, and matches what we had discussed, but don't you also need to
> > add the corresponding unshift in intel_commit_sprite_plane() when we actually
> > pull the values out and make use of them?
> The unshift is in patch #14 which should have been in this patch.
>
> From #14 relevant hunk is:
> @@ -1081,10 +1122,10 @@ intel_commit_sprite_plane(struct drm_plane *plane,
> crtc_y = state->dst.y1;
> crtc_w = drm_rect_width(&state->dst);
> crtc_h = drm_rect_height(&state->dst);
> - src_x = state->src.x1;
> - src_y = state->src.y1;
> - src_w = drm_rect_width(&state->src);
> - src_h = drm_rect_height(&state->src);
> + src_x = state->src.x1 >> 16;
> + src_y = state->src.y1 >> 16;
> + src_w = drm_rect_width(&state->src) >> 16;
> + src_h = drm_rect_height(&state->src) >> 16;
> intel_plane->update_plane(plane, crtc, fb,
> crtc_x, crtc_y, crtc_w, crtc_h,
> src_x, src_y, src_w, src_h);
Yep, you're right; I got the patch numbers mixed up while flipping back
and forth between patches, and then confused myself further by looking
at the wrong patch while writing my follow up reply.
As long as we pull this hunk from #14 back into this patch, that should
be the proper fix. You can ignore my other comments below where I was
just confusing myself by looking at the wrong patch numbers.
Matt
>
> > The goal is to keep the meaning of
> > the structure fields consistent at all times
> > (16.16 fixed pt), but once we pull the values out of the structure, we wind up
> > passing them to functions that doing use fixed point, so we do need to unshift at
> > that point.
> >
> > It looks like in patch #13 you do switch the low-level
> > skl_update_plane() to make use of 16.16 input parameters. However any
> > commit that we bisect through between #6 and #13 is going to wind up treating
> > 16.16 values as integer values, which I assume will blow up.
> Patch #13 doesn't touches skl_update_plane(). Perhaps you may be referring to #14.
> In #14, it does unshift as I mentioned above. I think I need to move above hunk
> to #6 to fix any potential issue due to bisect.
>
> Let me know if you see any potential issue after moving the above hunk to #6.
>
> > Also, you haven't touched any of the other platforms (ilk, vlv, ivb,
> > etc.) so they're all still going to have problems.
> Shifting and unshifting is happening in intel_check_plane and intel_commit_plane
> which is common for all platforms. I don't see what the problem you
> are referring to?
> >
> > I think the easiest short-term solution is to do the unshifting in commit_plane
> > and leave the hardware-specific programming functions as-is.
> This is what I'm doing now keeping platform_update_plane(parameters) use
> unshifted values (i.e., regular ints). I don't see any value to pass function parameters
> as 16.16 values. If there is a need arise we can change the semantics of parameters
> at a later time.
>
> > Longer term,
> > maybe it makes sense for a future patchset to change the actual register-
> > programming functions (foo_update_plane) so that they take a plane_state
> > directly and do their own unshifting? In that case we'd need to update them to
> > do their own unshifting, but at least we wouldn't have to pull all the values out in
> > commit_plane, just to pass them to these functions.
> >
> >
> > Matt
> >
> > > ---
> > > drivers/gpu/drm/i915/intel_sprite.c | 8 ++++----
> > > 1 file changed, 4 insertions(+), 4 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/i915/intel_sprite.c
> > > b/drivers/gpu/drm/i915/intel_sprite.c
> > > index ac4aa68..c05fb36 100644
> > > --- a/drivers/gpu/drm/i915/intel_sprite.c
> > > +++ b/drivers/gpu/drm/i915/intel_sprite.c
> > > @@ -1006,10 +1006,10 @@ intel_check_sprite_plane(struct drm_plane
> > *plane,
> > > }
> > >
> > > if (state->visible) {
> > > - src->x1 = src_x;
> > > - src->x2 = src_x + src_w;
> > > - src->y1 = src_y;
> > > - src->y2 = src_y + src_h;
> > > + src->x1 = src_x << 16;
> > > + src->x2 = (src_x + src_w) << 16;
> > > + src->y1 = src_y << 16;
> > > + src->y2 = (src_y + src_h) << 16;
> > > }
> > >
> > > dst->x1 = crtc_x;
> > > --
> > > 1.7.9.5
> > >
> >
> > --
> > Matt Roper
> > Graphics Software Engineer
> > IoTG Platform Enabling & Development
> > Intel Corporation
> > (916) 356-2795
--
Matt Roper
Graphics Software Engineer
IoTG Platform Enabling & Development
Intel Corporation
(916) 356-2795
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-04-09 22:22 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-07 22:28 [PATCH 00/14] skylake display scalers Chandra Konduru
2015-04-07 22:28 ` [PATCH 01/14] drm: Adding drm helper function drm_plane_from_index() Chandra Konduru
2015-04-10 0:36 ` Chandra Konduru
2015-04-10 6:59 ` Daniel Vetter
2015-04-10 16:30 ` Konduru, Chandra
2015-04-07 22:28 ` [PATCH 02/14] drm/i915: Register definitions for skylake scalers Chandra Konduru
2015-04-07 22:28 ` [PATCH 03/14] drm/i915: skylake scaler structure definitions Chandra Konduru
2015-04-07 22:28 ` [PATCH 04/14] drm/i915: Initialize plane colorkey to NONE Chandra Konduru
2015-04-07 22:28 ` [PATCH 05/14] drm/i915: Initialize skylake scalers Chandra Konduru
2015-04-07 22:28 ` [PATCH 06/14] drm/i915: Keep sprite plane src rect in 16.16 format Chandra Konduru
2015-04-09 21:50 ` Matt Roper
2015-04-09 22:08 ` Konduru, Chandra
2015-04-09 22:22 ` Matt Roper [this message]
2015-04-09 22:27 ` Konduru, Chandra
2015-04-09 23:41 ` Chandra Konduru
2015-04-09 23:57 ` Matt Roper
2015-04-07 22:28 ` [PATCH 07/14] drm/i915: Dump scaler_state too as part of dumping crtc_state Chandra Konduru
2015-04-07 22:28 ` [PATCH 08/14] drm/i915: Preserve scaler state when clearing crtc_state Chandra Konduru
2015-04-07 22:28 ` [PATCH 09/14] drm/i915: setup scalers for crtc_compute_config Chandra Konduru
2015-04-09 21:51 ` Matt Roper
2015-04-09 22:07 ` Konduru, Chandra
2015-04-09 23:42 ` Chandra Konduru
2015-04-07 22:28 ` [PATCH 10/14] drm/i915: Ensure setting up scalers into staged crtc_state Chandra Konduru
2015-04-07 22:28 ` [PATCH 11/14] drm/i915: copy staged scaler state from drm state to crtc->config Chandra Konduru
2015-04-07 22:28 ` [PATCH 12/14] drm/i915: skylake panel fitting using shared scalers Chandra Konduru
2015-04-07 22:28 ` [PATCH 13/14] drm/i915: skylake primary plane scaling " Chandra Konduru
2015-04-09 21:51 ` Matt Roper
2015-04-09 22:14 ` Konduru, Chandra
2015-04-13 9:46 ` Daniel Vetter
2015-04-13 18:12 ` Daniel Vetter
2015-04-13 18:18 ` Konduru, Chandra
2015-04-14 7:00 ` Daniel Vetter
2015-04-15 22:14 ` Chandra Konduru
2015-04-15 23:08 ` Konduru, Chandra
2015-04-16 7:36 ` Daniel Vetter
2015-04-16 8:17 ` Jindal, Sonika
2015-04-23 20:20 ` Daniel Vetter
2015-04-27 5:13 ` Konduru, Chandra
2015-05-04 8:16 ` Daniel Vetter
2015-04-27 20:48 ` Chandra Konduru
2015-04-29 12:12 ` Jani Nikula
2015-04-29 16:26 ` Konduru, Chandra
2015-05-01 16:47 ` Matt Roper
2015-04-07 22:28 ` [PATCH 14/14] drm/i915: skylake sprite " Chandra Konduru
2015-04-09 23:43 ` Chandra Konduru
2015-04-10 0:01 ` Matt Roper
2015-04-15 22:15 ` Chandra Konduru
2015-04-16 7:42 ` Daniel Vetter
2015-04-16 8:18 ` Jindal, Sonika
2015-04-09 21:53 ` [PATCH 00/14] skylake display scalers Matt Roper
2015-04-09 22:12 ` Matt Roper
2015-04-09 22:22 ` Konduru, Chandra
2015-04-10 9:34 ` Daniel Vetter
2015-04-10 16:29 ` Konduru, Chandra
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=20150409222236.GI9016@intel.com \
--to=matthew.d.roper@intel.com \
--cc=ander.conselvan.de.oliveira@intel.com \
--cc=chandra.konduru@intel.com \
--cc=daniel.vetter@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox