From: Thierry Reding <thierry.reding@gmail.com>
To: Lyude Paul <lyude@redhat.com>
Cc: nouveau@lists.freedesktop.org, Sam Ravnborg <sam@ravnborg.org>,
David Airlie <airlied@linux.ie>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org, Jerry Zuo <Jerry.Zuo@amd.com>,
Sean Paul <seanpaul@chromium.org>,
Ben Skeggs <bskeggs@redhat.com>, Daniel Vetter <daniel@ffwll.ch>,
David Airlie <airlied@redhat.com>,
Harry Wentland <harry.wentland@amd.com>,
Juston Li <juston.li@intel.com>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Subject: Re: [Nouveau] [PATCH 1/3] drm/nouveau/kms/nv50-: Call outp_atomic_check_view() before handling PBN
Date: Mon, 18 Nov 2019 14:41:17 +0100 [thread overview]
Message-ID: <20191118134117.GF2246533@ulmo> (raw)
In-Reply-To: <20191115210728.3467-2-lyude@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 3291 bytes --]
On Fri, Nov 15, 2019 at 04:07:18PM -0500, Lyude Paul wrote:
> Since nv50_outp_atomic_check_view() can set crtc_state->mode_changed, we
> probably should be calling it before handling any PBN changes. Just a
> precaution.
>
> Signed-off-by: Lyude Paul <lyude@redhat.com>
> Fixes: 232c9eec417a ("drm/nouveau: Use atomic VCPI helpers for MST")
> Cc: Ben Skeggs <bskeggs@redhat.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: David Airlie <airlied@redhat.com>
> Cc: Jerry Zuo <Jerry.Zuo@amd.com>
> Cc: Harry Wentland <harry.wentland@amd.com>
> Cc: Juston Li <juston.li@intel.com>
> Cc: Sean Paul <seanpaul@chromium.org>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: <stable@vger.kernel.org> # v5.1+
> ---
> drivers/gpu/drm/nouveau/dispnv50/disp.c | 44 ++++++++++++++-----------
> 1 file changed, 24 insertions(+), 20 deletions(-)
Looks reasonable:
Reviewed-by: Thierry Reding <treding@nvidia.com>
> diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c
> index 549486f1d937..6327aaf37c08 100644
> --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
> +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
> @@ -770,32 +770,36 @@ nv50_msto_atomic_check(struct drm_encoder *encoder,
> struct nv50_mstm *mstm = mstc->mstm;
> struct nv50_head_atom *asyh = nv50_head_atom(crtc_state);
> int slots;
> + int ret;
>
> - if (crtc_state->mode_changed || crtc_state->connectors_changed) {
> - /*
> - * When restoring duplicated states, we need to make sure that
> - * the bw remains the same and avoid recalculating it, as the
> - * connector's bpc may have changed after the state was
> - * duplicated
> - */
> - if (!state->duplicated) {
> - const int bpp = connector->display_info.bpc * 3;
> - const int clock = crtc_state->adjusted_mode.clock;
> + ret = nv50_outp_atomic_check_view(encoder, crtc_state, conn_state,
> + mstc->native);
> + if (ret)
> + return ret;
>
> - asyh->dp.pbn = drm_dp_calc_pbn_mode(clock, bpp);
> - }
> + if (!crtc_state->mode_changed && !crtc_state->connectors_changed)
> + return 0;
>
> - slots = drm_dp_atomic_find_vcpi_slots(state, &mstm->mgr,
> - mstc->port,
> - asyh->dp.pbn);
> - if (slots < 0)
> - return slots;
> + /*
> + * When restoring duplicated states, we need to make sure that the bw
> + * remains the same and avoid recalculating it, as the connector's bpc
> + * may have changed after the state was duplicated
> + */
> + if (!state->duplicated) {
> + const int bpp = connector->display_info.bpc * 3;
> + const int clock = crtc_state->adjusted_mode.clock;
>
> - asyh->dp.tu = slots;
> + asyh->dp.pbn = drm_dp_calc_pbn_mode(clock, bpp);
> }
>
> - return nv50_outp_atomic_check_view(encoder, crtc_state, conn_state,
> - mstc->native);
> + slots = drm_dp_atomic_find_vcpi_slots(state, &mstm->mgr, mstc->port,
> + asyh->dp.pbn);
> + if (slots < 0)
> + return slots;
> +
> + asyh->dp.tu = slots;
> +
> + return 0;
> }
>
> static void
> --
> 2.21.0
>
> _______________________________________________
> Nouveau mailing list
> Nouveau@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/nouveau
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: Thierry Reding <thierry.reding@gmail.com>
To: Lyude Paul <lyude@redhat.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
David Airlie <airlied@linux.ie>,
nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org, Jerry Zuo <Jerry.Zuo@amd.com>,
Sean Paul <seanpaul@chromium.org>,
dri-devel@lists.freedesktop.org,
David Airlie <airlied@redhat.com>,
Sam Ravnborg <sam@ravnborg.org>, Juston Li <juston.li@intel.com>,
Ben Skeggs <bskeggs@redhat.com>
Subject: Re: [Nouveau] [PATCH 1/3] drm/nouveau/kms/nv50-: Call outp_atomic_check_view() before handling PBN
Date: Mon, 18 Nov 2019 14:41:17 +0100 [thread overview]
Message-ID: <20191118134117.GF2246533@ulmo> (raw)
Message-ID: <20191118134117.XiiOU0Uwwt73UPbOLCgobEeYix_hH7TXrAcYa8G4wTM@z> (raw)
In-Reply-To: <20191115210728.3467-2-lyude@redhat.com>
[-- Attachment #1.1: Type: text/plain, Size: 3291 bytes --]
On Fri, Nov 15, 2019 at 04:07:18PM -0500, Lyude Paul wrote:
> Since nv50_outp_atomic_check_view() can set crtc_state->mode_changed, we
> probably should be calling it before handling any PBN changes. Just a
> precaution.
>
> Signed-off-by: Lyude Paul <lyude@redhat.com>
> Fixes: 232c9eec417a ("drm/nouveau: Use atomic VCPI helpers for MST")
> Cc: Ben Skeggs <bskeggs@redhat.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: David Airlie <airlied@redhat.com>
> Cc: Jerry Zuo <Jerry.Zuo@amd.com>
> Cc: Harry Wentland <harry.wentland@amd.com>
> Cc: Juston Li <juston.li@intel.com>
> Cc: Sean Paul <seanpaul@chromium.org>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: <stable@vger.kernel.org> # v5.1+
> ---
> drivers/gpu/drm/nouveau/dispnv50/disp.c | 44 ++++++++++++++-----------
> 1 file changed, 24 insertions(+), 20 deletions(-)
Looks reasonable:
Reviewed-by: Thierry Reding <treding@nvidia.com>
> diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c
> index 549486f1d937..6327aaf37c08 100644
> --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
> +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
> @@ -770,32 +770,36 @@ nv50_msto_atomic_check(struct drm_encoder *encoder,
> struct nv50_mstm *mstm = mstc->mstm;
> struct nv50_head_atom *asyh = nv50_head_atom(crtc_state);
> int slots;
> + int ret;
>
> - if (crtc_state->mode_changed || crtc_state->connectors_changed) {
> - /*
> - * When restoring duplicated states, we need to make sure that
> - * the bw remains the same and avoid recalculating it, as the
> - * connector's bpc may have changed after the state was
> - * duplicated
> - */
> - if (!state->duplicated) {
> - const int bpp = connector->display_info.bpc * 3;
> - const int clock = crtc_state->adjusted_mode.clock;
> + ret = nv50_outp_atomic_check_view(encoder, crtc_state, conn_state,
> + mstc->native);
> + if (ret)
> + return ret;
>
> - asyh->dp.pbn = drm_dp_calc_pbn_mode(clock, bpp);
> - }
> + if (!crtc_state->mode_changed && !crtc_state->connectors_changed)
> + return 0;
>
> - slots = drm_dp_atomic_find_vcpi_slots(state, &mstm->mgr,
> - mstc->port,
> - asyh->dp.pbn);
> - if (slots < 0)
> - return slots;
> + /*
> + * When restoring duplicated states, we need to make sure that the bw
> + * remains the same and avoid recalculating it, as the connector's bpc
> + * may have changed after the state was duplicated
> + */
> + if (!state->duplicated) {
> + const int bpp = connector->display_info.bpc * 3;
> + const int clock = crtc_state->adjusted_mode.clock;
>
> - asyh->dp.tu = slots;
> + asyh->dp.pbn = drm_dp_calc_pbn_mode(clock, bpp);
> }
>
> - return nv50_outp_atomic_check_view(encoder, crtc_state, conn_state,
> - mstc->native);
> + slots = drm_dp_atomic_find_vcpi_slots(state, &mstm->mgr, mstc->port,
> + asyh->dp.pbn);
> + if (slots < 0)
> + return slots;
> +
> + asyh->dp.tu = slots;
> +
> + return 0;
> }
>
> static void
> --
> 2.21.0
>
> _______________________________________________
> Nouveau mailing list
> Nouveau@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/nouveau
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2019-11-18 13:41 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-15 21:07 [PATCH 0/3] MST BPC fixes for nouveau Lyude Paul
2019-11-15 21:07 ` Lyude Paul
2019-11-15 21:07 ` [PATCH 1/3] drm/nouveau/kms/nv50-: Call outp_atomic_check_view() before handling PBN Lyude Paul
2019-11-15 21:07 ` Lyude Paul
2019-11-18 13:41 ` Thierry Reding [this message]
2019-11-18 13:41 ` [Nouveau] " Thierry Reding
2019-11-15 21:07 ` [PATCH 2/3] drm/nouveau/kms/nv50-: Store the bpc we're using in nv50_head_atom Lyude Paul
2019-11-15 21:07 ` Lyude Paul
2019-11-18 13:35 ` [Nouveau] " Thierry Reding
2019-11-18 13:35 ` Thierry Reding
2019-11-15 21:07 ` [PATCH 3/3] drm/nouveau/kms/nv50-: Limit MST BPC to 8 Lyude Paul
2019-11-15 21:07 ` Lyude Paul
2019-11-18 13:36 ` [Nouveau] " Thierry Reding
2019-11-18 13:36 ` Thierry Reding
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=20191118134117.GF2246533@ulmo \
--to=thierry.reding@gmail.com \
--cc=Jerry.Zuo@amd.com \
--cc=airlied@linux.ie \
--cc=airlied@redhat.com \
--cc=bskeggs@redhat.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=harry.wentland@amd.com \
--cc=juston.li@intel.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lyude@redhat.com \
--cc=nouveau@lists.freedesktop.org \
--cc=sam@ravnborg.org \
--cc=seanpaul@chromium.org \
--cc=stable@vger.kernel.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.