linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/nouveau/bios: Use HWSQ entry 1 for PowerBook6,1
@ 2022-02-14 15:55 Icenowy Zheng
  2022-02-14 16:07 ` Ilia Mirkin
  0 siblings, 1 reply; 3+ messages in thread
From: Icenowy Zheng @ 2022-02-14 15:55 UTC (permalink / raw)
  To: Ben Skeggs, David Airlie, Daniel Vetter
  Cc: dri-devel, nouveau, linux-kernel, Icenowy Zheng

On PowerBook6,1 (PowerBook G4 867 12") HWSQ entry 0 (which is currently
always used by nouveau) fails, but the BIOS declares 2 HWSQ entries and
entry 1 works.

Add a quirk to use HWSQ entry 1.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
---
 drivers/gpu/drm/nouveau/nouveau_bios.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c
index e8c445eb11004..2691d0e0cf9f1 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bios.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bios.c
@@ -1977,6 +1977,13 @@ static int load_nv17_hw_sequencer_ucode(struct drm_device *dev,
 	if (!hwsq_offset)
 		return 0;
 
+#ifdef __powerpc__
+	/* HWSQ entry 0 fails on PowerBook G4 867 12" (Al) */
+	if (of_machine_is_compatible("PowerBook6,1"))
+		return load_nv17_hwsq_ucode_entry(dev, bios,
+						  hwsq_offset + sz, 1);
+#endif
+
 	/* always use entry 0? */
 	return load_nv17_hwsq_ucode_entry(dev, bios, hwsq_offset + sz, 0);
 }
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/nouveau/bios: Use HWSQ entry 1 for PowerBook6,1
  2022-02-14 15:55 [PATCH] drm/nouveau/bios: Use HWSQ entry 1 for PowerBook6,1 Icenowy Zheng
@ 2022-02-14 16:07 ` Ilia Mirkin
  2022-02-14 16:31   ` Icenowy Zheng
  0 siblings, 1 reply; 3+ messages in thread
From: Ilia Mirkin @ 2022-02-14 16:07 UTC (permalink / raw)
  To: Icenowy Zheng
  Cc: Ben Skeggs, David Airlie, Daniel Vetter, nouveau, LKML, dri-devel

I'm not saying this is wrong, but could you file a bug at
gitlab.freedesktop.org/drm/nouveau/-/issues and include the VBIOS
(/sys/kernel/debug/dri/0/vbios.rom)? That would make it easier to
review the full situation.

On Mon, Feb 14, 2022 at 11:03 AM Icenowy Zheng <icenowy@aosc.io> wrote:
>
> On PowerBook6,1 (PowerBook G4 867 12") HWSQ entry 0 (which is currently
> always used by nouveau) fails, but the BIOS declares 2 HWSQ entries and
> entry 1 works.
>
> Add a quirk to use HWSQ entry 1.
>
> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
> ---
>  drivers/gpu/drm/nouveau/nouveau_bios.c | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c
> index e8c445eb11004..2691d0e0cf9f1 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_bios.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_bios.c
> @@ -1977,6 +1977,13 @@ static int load_nv17_hw_sequencer_ucode(struct drm_device *dev,
>         if (!hwsq_offset)
>                 return 0;
>
> +#ifdef __powerpc__
> +       /* HWSQ entry 0 fails on PowerBook G4 867 12" (Al) */
> +       if (of_machine_is_compatible("PowerBook6,1"))
> +               return load_nv17_hwsq_ucode_entry(dev, bios,
> +                                                 hwsq_offset + sz, 1);
> +#endif
> +
>         /* always use entry 0? */
>         return load_nv17_hwsq_ucode_entry(dev, bios, hwsq_offset + sz, 0);
>  }
> --
> 2.30.2
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/nouveau/bios: Use HWSQ entry 1 for PowerBook6,1
  2022-02-14 16:07 ` Ilia Mirkin
@ 2022-02-14 16:31   ` Icenowy Zheng
  0 siblings, 0 replies; 3+ messages in thread
From: Icenowy Zheng @ 2022-02-14 16:31 UTC (permalink / raw)
  To: Ilia Mirkin
  Cc: Ben Skeggs, David Airlie, Daniel Vetter, nouveau, LKML, dri-devel

在 2022-02-14星期一的 11:07 -0500,Ilia Mirkin写道:
> I'm not saying this is wrong, but could you file a bug at
> gitlab.freedesktop.org/drm/nouveau/-/issues and include the VBIOS
> (/sys/kernel/debug/dri/0/vbios.rom)? That would make it easier to
> review the full situation.

Created at https://gitlab.freedesktop.org/drm/nouveau/-/issues/158 .

> 
> On Mon, Feb 14, 2022 at 11:03 AM Icenowy Zheng <icenowy@aosc.io> wrote:
> > 
> > On PowerBook6,1 (PowerBook G4 867 12") HWSQ entry 0 (which is
> > currently
> > always used by nouveau) fails, but the BIOS declares 2 HWSQ entries
> > and
> > entry 1 works.
> > 
> > Add a quirk to use HWSQ entry 1.
> > 
> > Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
> > ---
> >  drivers/gpu/drm/nouveau/nouveau_bios.c | 7 +++++++
> >  1 file changed, 7 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c
> > b/drivers/gpu/drm/nouveau/nouveau_bios.c
> > index e8c445eb11004..2691d0e0cf9f1 100644
> > --- a/drivers/gpu/drm/nouveau/nouveau_bios.c
> > +++ b/drivers/gpu/drm/nouveau/nouveau_bios.c
> > @@ -1977,6 +1977,13 @@ static int load_nv17_hw_sequencer_ucode(struct
> > drm_device *dev,
> >         if (!hwsq_offset)
> >                 return 0;
> > 
> > +#ifdef __powerpc__
> > +       /* HWSQ entry 0 fails on PowerBook G4 867 12" (Al) */
> > +       if (of_machine_is_compatible("PowerBook6,1"))
> > +               return load_nv17_hwsq_ucode_entry(dev, bios,
> > +                                                 hwsq_offset + sz,
> > 1);
> > +#endif
> > +
> >         /* always use entry 0? */
> >         return load_nv17_hwsq_ucode_entry(dev, bios, hwsq_offset +
> > sz, 0);
> >  }
> > --
> > 2.30.2
> > 



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-14 16:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-14 15:55 [PATCH] drm/nouveau/bios: Use HWSQ entry 1 for PowerBook6,1 Icenowy Zheng
2022-02-14 16:07 ` Ilia Mirkin
2022-02-14 16:31   ` Icenowy Zheng

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).