LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Lyude Paul <lyude@redhat.com>
To: Sasha Levin <sashal@kernel.org>,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
Ben Skeggs <bskeggs@redhat.com>
Cc: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org
Subject: Re: [PATCH AUTOSEL 5.10 16/18] drm/nouveau/kms/nv50: workaround EFI GOP window channel format differences
Date: Tue, 24 Aug 2021 13:07:06 -0400 [thread overview]
Message-ID: <1bd0bb90d6367307ad375d692563c6ba1fc43d50.camel@redhat.com> (raw)
In-Reply-To: <20210824005432.631154-16-sashal@kernel.org>
Ben, do we even have Ampere support in 5.10?
On Mon, 2021-08-23 at 20:54 -0400, Sasha Levin wrote:
> From: Ben Skeggs <bskeggs@redhat.com>
>
> [ Upstream commit e78b1b545c6cfe9f87fc577128e00026fff230ba ]
>
> Should fix some initial modeset failures on (at least) Ampere boards.
>
> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
> Reviewed-by: Lyude Paul <lyude@redhat.com>
> Signed-off-by: Sasha Levin <sashal@kernel.org>
> ---
> drivers/gpu/drm/nouveau/dispnv50/disp.c | 27 +++++++++++++++++++++++++
> drivers/gpu/drm/nouveau/dispnv50/head.c | 13 ++++++++----
> drivers/gpu/drm/nouveau/dispnv50/head.h | 1 +
> 3 files changed, 37 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c
> b/drivers/gpu/drm/nouveau/dispnv50/disp.c
> index 5b8cabb099eb..c2d34c91e840 100644
> --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
> +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
> @@ -2202,6 +2202,33 @@ nv50_disp_atomic_commit_tail(struct drm_atomic_state
> *state)
> interlock[NV50_DISP_INTERLOCK_CORE] = 0;
> }
>
> + /* Finish updating head(s)...
> + *
> + * NVD is rather picky about both where window assignments can
> change,
> + * *and* about certain core and window channel states matching.
> + *
> + * The EFI GOP driver on newer GPUs configures window channels with
> a
> + * different output format to what we do, and the core channel
> update
> + * in the assign_windows case above would result in a state
> mismatch.
> + *
> + * Delay some of the head update until after that point to
> workaround
> + * the issue. This only affects the initial modeset.
> + *
> + * TODO: handle this better when adding flexible window mapping
> + */
> + for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state,
> new_crtc_state, i) {
> + struct nv50_head_atom *asyh =
> nv50_head_atom(new_crtc_state);
> + struct nv50_head *head = nv50_head(crtc);
> +
> + NV_ATOMIC(drm, "%s: set %04x (clr %04x)\n", crtc->name,
> + asyh->set.mask, asyh->clr.mask);
> +
> + if (asyh->set.mask) {
> + nv50_head_flush_set_wndw(head, asyh);
> + interlock[NV50_DISP_INTERLOCK_CORE] = 1;
> + }
> + }
> +
> /* Update plane(s). */
> for_each_new_plane_in_state(state, plane, new_plane_state, i) {
> struct nv50_wndw_atom *asyw =
> nv50_wndw_atom(new_plane_state);
> diff --git a/drivers/gpu/drm/nouveau/dispnv50/head.c
> b/drivers/gpu/drm/nouveau/dispnv50/head.c
> index 841edfaf5b9d..61826cac3061 100644
> --- a/drivers/gpu/drm/nouveau/dispnv50/head.c
> +++ b/drivers/gpu/drm/nouveau/dispnv50/head.c
> @@ -49,11 +49,8 @@ nv50_head_flush_clr(struct nv50_head *head,
> }
>
> void
> -nv50_head_flush_set(struct nv50_head *head, struct nv50_head_atom *asyh)
> +nv50_head_flush_set_wndw(struct nv50_head *head, struct nv50_head_atom
> *asyh)
> {
> - if (asyh->set.view ) head->func->view (head, asyh);
> - if (asyh->set.mode ) head->func->mode (head, asyh);
> - if (asyh->set.core ) head->func->core_set(head, asyh);
> if (asyh->set.olut ) {
> asyh->olut.offset = nv50_lut_load(&head->olut,
> asyh->olut.buffer,
> @@ -61,6 +58,14 @@ nv50_head_flush_set(struct nv50_head *head, struct
> nv50_head_atom *asyh)
> asyh->olut.load);
> head->func->olut_set(head, asyh);
> }
> +}
> +
> +void
> +nv50_head_flush_set(struct nv50_head *head, struct nv50_head_atom *asyh)
> +{
> + if (asyh->set.view ) head->func->view (head, asyh);
> + if (asyh->set.mode ) head->func->mode (head, asyh);
> + if (asyh->set.core ) head->func->core_set(head, asyh);
> if (asyh->set.curs ) head->func->curs_set(head, asyh);
> if (asyh->set.base ) head->func->base (head, asyh);
> if (asyh->set.ovly ) head->func->ovly (head, asyh);
> diff --git a/drivers/gpu/drm/nouveau/dispnv50/head.h
> b/drivers/gpu/drm/nouveau/dispnv50/head.h
> index dae841dc05fd..0bac6be9ba34 100644
> --- a/drivers/gpu/drm/nouveau/dispnv50/head.h
> +++ b/drivers/gpu/drm/nouveau/dispnv50/head.h
> @@ -21,6 +21,7 @@ struct nv50_head {
>
> struct nv50_head *nv50_head_create(struct drm_device *, int index);
> void nv50_head_flush_set(struct nv50_head *head, struct nv50_head_atom
> *asyh);
> +void nv50_head_flush_set_wndw(struct nv50_head *head, struct nv50_head_atom
> *asyh);
> void nv50_head_flush_clr(struct nv50_head *head,
> struct nv50_head_atom *asyh, bool flush);
>
--
Cheers,
Lyude Paul (she/her)
Software Engineer at Red Hat
next prev parent reply other threads:[~2021-08-24 17:09 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-24 0:54 [PATCH AUTOSEL 5.10 01/18] iwlwifi: pnvm: accept multiple HW-type TLVs Sasha Levin
2021-08-24 0:54 ` [PATCH AUTOSEL 5.10 02/18] opp: remove WARN when no valid OPPs remain Sasha Levin
2021-08-24 0:54 ` [PATCH AUTOSEL 5.10 03/18] cpufreq: blocklist Qualcomm sm8150 in cpufreq-dt-platdev Sasha Levin
2021-08-24 0:54 ` [PATCH AUTOSEL 5.10 04/18] virtio: Improve vq->broken access to avoid any compiler optimization Sasha Levin
2021-08-24 0:54 ` [PATCH AUTOSEL 5.10 05/18] virtio_pci: Support surprise removal of virtio pci device Sasha Levin
2021-08-24 0:54 ` [PATCH AUTOSEL 5.10 06/18] virtio_vdpa: reject invalid vq indices Sasha Levin
2021-08-24 0:54 ` [PATCH AUTOSEL 5.10 07/18] vringh: Use wiov->used to check for read/write desc order Sasha Levin
2021-08-24 0:54 ` [PATCH AUTOSEL 5.10 08/18] tools/virtio: fix build Sasha Levin
2021-08-24 0:54 ` [PATCH AUTOSEL 5.10 09/18] qed: qed ll2 race condition fixes Sasha Levin
2021-08-24 0:54 ` [PATCH AUTOSEL 5.10 10/18] qed: Fix null-pointer dereference in qed_rdma_create_qp() Sasha Levin
2021-08-24 0:54 ` [PATCH AUTOSEL 5.10 11/18] Revert "drm/amd/pm: fix workload mismatch on vega10" Sasha Levin
2021-08-24 0:54 ` [PATCH AUTOSEL 5.10 12/18] drm/amd/pm: change the workload type for some cards Sasha Levin
2021-08-24 0:54 ` [PATCH AUTOSEL 5.10 13/18] blk-mq: don't grab rq's refcount in blk_mq_check_expired() Sasha Levin
2021-08-24 0:54 ` [PATCH AUTOSEL 5.10 14/18] drm: Copy drm_wait_vblank to user before returning Sasha Levin
2021-08-24 0:54 ` [PATCH AUTOSEL 5.10 15/18] drm/nouveau/disp: power down unused DP links during init Sasha Levin
2021-08-24 0:54 ` [PATCH AUTOSEL 5.10 16/18] drm/nouveau/kms/nv50: workaround EFI GOP window channel format differences Sasha Levin
2021-08-24 17:07 ` Lyude Paul [this message]
2021-08-24 0:54 ` [PATCH AUTOSEL 5.10 17/18] drm/nouveau: block a bunch of classes from userspace Sasha Levin
2021-08-24 0:54 ` [PATCH AUTOSEL 5.10 18/18] net/rds: dma_map_sg is entitled to merge entries Sasha Levin
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=1bd0bb90d6367307ad375d692563c6ba1fc43d50.camel@redhat.com \
--to=lyude@redhat.com \
--cc=bskeggs@redhat.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nouveau@lists.freedesktop.org \
--cc=sashal@kernel.org \
--cc=stable@vger.kernel.org \
--subject='Re: [PATCH AUTOSEL 5.10 16/18] drm/nouveau/kms/nv50: workaround EFI GOP window channel format differences' \
/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
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).