From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Manasi Navare <manasi.d.navare@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH v3 3/6] drm/i915: Use drm_rect to store the pfit window pos/size
Date: Thu, 23 Apr 2020 18:38:46 +0300 [thread overview]
Message-ID: <20200423153846.GE6112@intel.com> (raw)
In-Reply-To: <20200422192005.GA28167@intel.com>
On Wed, Apr 22, 2020 at 12:20:06PM -0700, Manasi Navare wrote:
> On Wed, Apr 22, 2020 at 07:19:14PM +0300, Ville Syrjala wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > Make things a bit more abstract by replacing the pch_pfit.pos/size
> > raw register values with a drm_rect. Makes it slighly more convenient
> > to eg. compute the scaling factors.
> >
> > v2: Use drm_rect_init()
> >
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> > drivers/gpu/drm/i915/display/intel_display.c | 101 +++++++++++-------
> > .../drm/i915/display/intel_display_types.h | 3 +-
> > drivers/gpu/drm/i915/display/intel_panel.c | 13 ++-
> > 3 files changed, 67 insertions(+), 50 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> > index 96d0768ecf5d..6bb87965801e 100644
> > --- a/drivers/gpu/drm/i915/display/intel_display.c
> > +++ b/drivers/gpu/drm/i915/display/intel_display.c
> > @@ -6096,10 +6096,8 @@ static int skl_update_scaler_crtc(struct intel_crtc_state *crtc_state)
> > int width, height;
> >
> > if (crtc_state->pch_pfit.enabled) {
> > - u32 pfit_size = crtc_state->pch_pfit.size;
> > -
> > - width = pfit_size >> 16;
> > - height = pfit_size & 0xffff;
> > + width = drm_rect_width(&crtc_state->pch_pfit.dst);
> > + height = drm_rect_height(&crtc_state->pch_pfit.dst);
> > } else {
> > width = adjusted_mode->crtc_hdisplay;
> > height = adjusted_mode->crtc_vdisplay;
> > @@ -6219,11 +6217,20 @@ static void skl_pfit_enable(const struct intel_crtc_state *crtc_state)
> > {
> > struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
> > struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
> > - enum pipe pipe = crtc->pipe;
> > const struct intel_crtc_scaler_state *scaler_state =
> > &crtc_state->scaler_state;
> > + struct drm_rect src = {
> > + .x2 = crtc_state->pipe_src_w << 16,
> > + .y2 = crtc_state->pipe_src_h << 16,
>
> Its not clear to me why we left shift by 16 for both src_w and src_h? Where can I find the format of
> how this is stored?
>
> Other than that everything else looks good in terms of replacing with drm_rect()
>
> Manasi
>
<snip>
> > - hscale = (crtc_state->pipe_src_w << 16) / pfit_w;
> > - vscale = (crtc_state->pipe_src_h << 16) / pfit_h;
Same <<16 was here already. skl_scaler_calc_phase() wants
the scaling factor in .16 binary fixed point. Also
drm_rect_calc_{h,v}scale() assumes the src coordinates
to be .16 and returns the result in .16 as well.
> > + hscale = drm_rect_calc_hscale(&src, dst, 0, INT_MAX);
> > + vscale = drm_rect_calc_vscale(&src, dst, 0, INT_MAX);
> >
> > uv_rgb_hphase = skl_scaler_calc_phase(1, hscale, false);
> > uv_rgb_vphase = skl_scaler_calc_phase(1, vscale, false);
--
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:[~2020-04-23 15:38 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-22 16:19 [Intel-gfx] [PATCH v3 1/6] drm/i915: Fix skl+ non-scaled pfit modes Ville Syrjala
2020-04-22 16:19 ` [Intel-gfx] [PATCH v3 2/6] drm/i915: Flatten a bunch of the pfit functions Ville Syrjala
2020-04-22 16:19 ` [Intel-gfx] [PATCH v3 3/6] drm/i915: Use drm_rect to store the pfit window pos/size Ville Syrjala
2020-04-22 19:20 ` Manasi Navare
2020-04-23 15:38 ` Ville Syrjälä [this message]
2020-04-23 18:51 ` Manasi Navare
2020-04-22 16:19 ` [Intel-gfx] [PATCH v3 4/6] drm/i915: s/pipe_config/crtc_state/ in pfit functions Ville Syrjala
2020-04-22 19:26 ` Manasi Navare
2020-04-22 16:19 ` [Intel-gfx] [PATCH v3 5/6] drm/i915: Pass connector state to pfit calculations Ville Syrjala
2020-04-22 21:35 ` Manasi Navare
2020-04-22 16:19 ` [Intel-gfx] [PATCH v3 6/6] drm/i915: Have pfit calculations return an error code Ville Syrjala
2020-04-22 21:42 ` Manasi Navare
2020-04-22 18:21 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [v3,1/6] drm/i915: Fix skl+ non-scaled pfit modes Patchwork
2020-04-22 18:45 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2020-04-22 22:44 ` [Intel-gfx] ✓ Fi.CI.IGT: " 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=20200423153846.GE6112@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=manasi.d.navare@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.