From: Danilo Krummrich <danilokrummrich-q2z19idT6fYRctDU1SCqIg@public.gmane.org>
To: bskeggs-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
airlied-cv59FeDIM0c@public.gmane.org,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: [PATCH 2/3] drm/nouveau/disp: quirk for SOR crossbar routing
Date: Mon, 5 Feb 2018 02:22:55 +0100 [thread overview]
Message-ID: <20180205012256.2198-2-danilokrummrich@dk-develop.de> (raw)
In-Reply-To: <20180205012256.2198-1-danilokrummrich-q2z19idT6fYRctDU1SCqIg@public.gmane.org>
With DCB 4.1 implemented by VBIOS since GM20x GPUs, SOR crossbar
routing should be possible, such that any SOR sublink can drive
any macro link.
Unfortunately, there's at least one card where some SOR sublinks
being connected to a particular macro link are causing failures.
To work around this issue, supply a quirk for such cards which
prevents a dynamic mapping of SOR sublink and macro link and
instead relies on identity mapping.
Signed-off-by: Danilo Krummrich <danilokrummrich@dk-develop.de>
---
drivers/gpu/drm/nouveau/include/nvkm/core/device.h | 1 +
drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c | 18 ++++++++++++++++--
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/device.h b/drivers/gpu/drm/nouveau/include/nvkm/core/device.h
index 560265b15ec2..d384cb03ad85 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/core/device.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/core/device.h
@@ -184,6 +184,7 @@ struct nvkm_device_func {
struct nvkm_device_quirk {
u8 tv_pin_mask;
u8 tv_gpio;
+ u8 outp_links_skip;
};
struct nvkm_device_chip {
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c
index be9e7f8c3b23..47303bdb7ee0 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c
@@ -99,6 +99,17 @@ nvkm_outp_release(struct nvkm_outp *outp, u8 user)
}
}
+static inline bool
+nvkm_outp_ior_route_quirk(struct nvkm_outp *outp)
+{
+ struct nvkm_device *dev = outp->disp->engine.subdev.device;
+
+ if (unlikely(dev->quirk))
+ return !(dev->quirk->outp_links_skip & BIT(outp->index));
+
+ return true;
+}
+
static inline int
nvkm_outp_acquire_ior(struct nvkm_outp *outp, u8 user, struct nvkm_ior *ior)
{
@@ -115,6 +126,7 @@ nvkm_outp_acquire(struct nvkm_outp *outp, u8 user)
struct nvkm_ior *ior = outp->ior;
enum nvkm_ior_proto proto;
enum nvkm_ior_type type;
+ bool route_crossbar = nvkm_outp_ior_route_quirk(outp);
OUTP_TRACE(outp, "acquire %02x |= %02x %p", outp->acquired, user, ior);
if (ior) {
@@ -138,7 +150,8 @@ nvkm_outp_acquire(struct nvkm_outp *outp, u8 user)
/* Failing that, a completely unused OR is the next best thing. */
list_for_each_entry(ior, &outp->disp->ior, head) {
if (!ior->asy.outp && ior->type == type && !ior->arm.outp &&
- (ior->func->route.set || ior->id == __ffs(outp->info.or)))
+ ((ior->func->route.set && route_crossbar) ||
+ ior->id == __ffs(outp->info.or)))
return nvkm_outp_acquire_ior(outp, user, ior);
}
@@ -147,7 +160,8 @@ nvkm_outp_acquire(struct nvkm_outp *outp, u8 user)
*/
list_for_each_entry(ior, &outp->disp->ior, head) {
if (!ior->asy.outp && ior->type == type &&
- (ior->func->route.set || ior->id == __ffs(outp->info.or)))
+ ((ior->func->route.set && route_crossbar) ||
+ ior->id == __ffs(outp->info.or)))
return nvkm_outp_acquire_ior(outp, user, ior);
}
--
2.14.1
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau
next prev parent reply other threads:[~2018-02-05 1:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-05 1:22 [PATCH 1/3] drm/nouveau/pci: PCI IDs for pascal architecture Danilo Krummrich
[not found] ` <20180205012256.2198-1-danilokrummrich-q2z19idT6fYRctDU1SCqIg@public.gmane.org>
2018-02-05 1:22 ` Danilo Krummrich [this message]
2018-02-05 1:22 ` [PATCH 3/3] drm/nouveau/pci: SOR crossbar quirk for 10b0:1b81 Danilo Krummrich
2018-02-05 1:37 ` [Nouveau] " Ben Skeggs
[not found] ` <CACAvsv6svP0jGHsJ09m_fHLR8DddmPf7oWHoLbzMjQi87Sy0cA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-02-05 1:39 ` Ben Skeggs
[not found] ` <CACAvsv5uV8CpZ8FT-V80DHefLLXkLoLmcbT+6tjo_0zPTqiF0g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-02-05 2:19 ` Danilo Krummrich
2018-02-05 2:47 ` [Nouveau] " Ben Skeggs
[not found] ` <CABDvA=kuMrzhQOhhuNAdQ25XNMhk+HVenFLMu3tZQnvGPien1A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-02-05 11:14 ` Danilo Krummrich
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=20180205012256.2198-2-danilokrummrich@dk-develop.de \
--to=danilokrummrich-q2z19idt6fyrctdu1scqig@public.gmane.org \
--cc=airlied-cv59FeDIM0c@public.gmane.org \
--cc=bskeggs-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.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.