From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Nemesa Garg <nemesa.garg@intel.com>
Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm/i915/display: After joiner compute pfit_dst
Date: Fri, 20 Dec 2024 11:04:58 +0200 [thread overview]
Message-ID: <Z2UzOhulIWgjP7oL@intel.com> (raw)
In-Reply-To: <Z2RDkcPdNv5vMJOl@intel.com>
On Thu, Dec 19, 2024 at 06:02:25PM +0200, Ville Syrjälä wrote:
> On Thu, Dec 12, 2024 at 08:03:28PM +0530, Nemesa Garg wrote:
> > In panel fitter/pipe scaler scenario the pch_pfit configuration
> > currently takes place before accounting for pipe_src width for
> > joiner. This causes issue when pch_pfit and joiner get enabled
> > together.So once pipe src is computed adjust the pfit_dst.
> > It can be done by computing per pipe output area first and then
> > and then find the intersection of above area with pfit_dst and
> > then adjust the coordinates.
> >
> > Signed-off-by: Nemesa Garg <nemesa.garg@intel.com>
> > ---
> > drivers/gpu/drm/i915/display/intel_display.c | 41 ++++++++++++++++++++
> > 1 file changed, 41 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> > index 21319f753a34..7be2ea11b8b0 100644
> > --- a/drivers/gpu/drm/i915/display/intel_display.c
> > +++ b/drivers/gpu/drm/i915/display/intel_display.c
> > @@ -2563,6 +2563,36 @@ static int intel_crtc_compute_pipe_src(struct intel_crtc_state *crtc_state)
> > return 0;
> > }
> >
> > +/*
> > + * The x-coordinate for Primary should be calculated in such a way
> > + * that it remains consistent whether the pipes are joined or not.
> > + * This means we need to consider the full width of the display even
> > + * when the pipes are joined. The x-coordinate for secondaries is 0
> > + * because it starts at the leftmost point of its own display area,
> > + * ensuring that the framebuffer is centered within Pipe B’s portion
> > + * of the overall display.
> > + */
> > +static int intel_crtc_compute_pfit(struct intel_atomic_state *state,
> > + struct intel_crtc_state *crtc_state)
> > +{
> > + struct drm_display_mode *mode = &crtc_state->hw.pipe_mode;
>
> const struct drm_display_mode *pipe_mode = ...
>
> > + struct drm_rect area;
> > +
> > + if (!crtc_state->pch_pfit.enabled)
> > + return 0;
> > +
> > + drm_rect_init(&area, 0, 0,
>
> This needs a proper x offset to match the pipe's positon in
> the overall screen layout (can be determined similarly to
> intel_joiner_adjust_pipe_src(), except using crtc_hdisplay
> as the width instead of the pipe_src width).
>
> > + mode->crtc_hdisplay,
> > + mode->crtc_vdisplay);
> > +
> > + if (!drm_rect_intersect(&crtc_state->pch_pfit.dst, &area))
> > + return -EINVAL;
> > +
> > + drm_rect_translate(&crtc_state->pch_pfit.dst, -area.x1, -area.y1);
>
> And this needs to remove the same offset we added originally.
Hmm. Now that I looked at this a bit I think we need a lot
more than this to make things actually work correctly.
I think what we need is roughly:
- move pipesrc/pfit.dst/pixel_rate calculations out from
intel_crtc_compute_config() into some new function (could
call it something like intel_crtc_compute_config_final(())
which needs to be called after the joiner state copy has been
performed (ie. where we now call intel_joiner_adjust_pipe_src()
in intel_atomic_check()).
- redesign the pipesrc readout to iterate through all the joined
pipes to accumulate the x offset for the pipes, since not all
the joined pipes necessarily have the same pipesrc width
- reuse the same for the uapi.mode hdisplay/vdisplay fixup
- steal the scaled clipping code from
intel_atomic_plane_check_clipping() to properly calculate
both pipesrc and pfit.dst
--
Ville Syrjälä
Intel
next prev parent reply other threads:[~2024-12-20 9:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-12 14:33 [PATCH 0/2] Consider joiner calculation for panel fitting Nemesa Garg
2024-12-12 14:33 ` [PATCH 1/2] drm/i915/display: After joiner compute pfit_dst Nemesa Garg
2024-12-12 15:54 ` Cavitt, Jonathan
2024-12-19 15:13 ` Garg, Nemesa
2024-12-19 16:02 ` Ville Syrjälä
2024-12-20 6:07 ` Garg, Nemesa
2024-12-20 9:04 ` Ville Syrjälä [this message]
2025-01-29 12:54 ` Garg, Nemesa
2024-12-12 14:33 ` [PATCH 2/2] drm/i915/display: Initialize pipe_src in compute stage Nemesa Garg
2024-12-12 15:54 ` Cavitt, Jonathan
2024-12-19 15:15 ` Garg, Nemesa
2024-12-12 15:52 ` ✗ i915.CI.BAT: failure for Consider joiner calculation for panel fitting (rev6) 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=Z2UzOhulIWgjP7oL@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=nemesa.garg@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).