* [PATCH] devinit: lock/unlock crtc regs for all devices, not just pre-nv50
@ 2014-01-19 9:18 Ilia Mirkin
[not found] ` <1390123095-2032-1-git-send-email-imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Ilia Mirkin @ 2014-01-19 9:18 UTC (permalink / raw)
To: Ben Skeggs, Pekka Paalanen; +Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Also make nv_lockvgac work for nv50+ devices. This should fix IO_CONDITION and
related VBIOS opcodes that read/write the crtc regs.
See https://bugs.freedesktop.org/show_bug.cgi?id=60680
Signed-off-by: Ilia Mirkin <imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
---
Ben, is this what you had in mind? I haven't gotten a chance to test this yet
since your tree doesn't build against mine (which is largely based on
nouveau/linux-2.6 master + drm-nouveau-next patches merged in). Something
about nouveau_acpi/backlight.
Pekka, mind testing this out and see if it also fixes your issue? Grab Ben's
tree at http://cgit.freedesktop.org/~darktama/nouveau/ and apply this patch,
and build against a late 3.13-rcX release, I guess. (Still haven't figured out
which tree I need to have for this stuff to build.)
./autogen.sh; cd drm; make
should generate a nouveau.ko against your currently-running kernel.
nvkm/engine/disp/vga.c | 9 +++++++--
nvkm/subdev/devinit/base.c | 14 ++++++++++++++
nvkm/subdev/devinit/nv04.c | 13 ++++++++-----
nvkm/subdev/devinit/priv.h | 8 +++++---
4 files changed, 34 insertions(+), 10 deletions(-)
diff --git a/nvkm/engine/disp/vga.c b/nvkm/engine/disp/vga.c
index 5a1c684..8836c3c 100644
--- a/nvkm/engine/disp/vga.c
+++ b/nvkm/engine/disp/vga.c
@@ -138,10 +138,15 @@ nv_wrvgai(void *obj, int head, u16 port, u8 index, u8 value)
bool
nv_lockvgac(void *obj, bool lock)
{
+ struct nouveau_device *dev = nv_device(obj);
+
bool locked = !nv_rdvgac(obj, 0, 0x1f);
u8 data = lock ? 0x99 : 0x57;
- nv_wrvgac(obj, 0, 0x1f, data);
- if (nv_device(obj)->chipset == 0x11) {
+ if (dev->card_type < NV_50)
+ nv_wrvgac(obj, 0, 0x1f, data);
+ else
+ nv_wrvgac(obj, 0, 0x3f, data);
+ if (dev->chipset == 0x11) {
if (!(nv_rd32(obj, 0x001084) & 0x10000000))
nv_wrvgac(obj, 1, 0x1f, data);
}
diff --git a/nvkm/subdev/devinit/base.c b/nvkm/subdev/devinit/base.c
index 6b23d9a..a4df3fa 100644
--- a/nvkm/subdev/devinit/base.c
+++ b/nvkm/subdev/devinit/base.c
@@ -26,6 +26,7 @@
#include <subdev/bios.h>
#include <subdev/bios/init.h>
+#include <subdev/vga.h>
#include "priv.h"
@@ -38,6 +39,9 @@ _nouveau_devinit_fini(struct nouveau_object *object, bool suspend)
if (suspend)
devinit->post = true;
+ /* unlock the extended vga crtc regs */
+ nv_lockvgac(devinit, false);
+
return nouveau_subdev_fini(&devinit->base, suspend);
}
@@ -61,6 +65,16 @@ _nouveau_devinit_init(struct nouveau_object *object)
return 0;
}
+void
+_nouveau_devinit_dtor(struct nouveau_object *object)
+{
+ struct nouveau_devinit *devinit = (void *)object;
+
+ /* lock crtc regs */
+ nv_lockvgac(devinit, true);
+ nouveau_subdev_destroy(&devinit->base);
+}
+
int
nouveau_devinit_create_(struct nouveau_object *parent,
struct nouveau_object *engine,
diff --git a/nvkm/subdev/devinit/nv04.c b/nvkm/subdev/devinit/nv04.c
index 24025e4..7037eae 100644
--- a/nvkm/subdev/devinit/nv04.c
+++ b/nvkm/subdev/devinit/nv04.c
@@ -388,17 +388,21 @@ int
nv04_devinit_fini(struct nouveau_object *object, bool suspend)
{
struct nv04_devinit_priv *priv = (void *)object;
+ int ret;
/* make i2c busses accessible */
nv_mask(priv, 0x000200, 0x00000001, 0x00000001);
- /* unlock extended vga crtc regs, and unslave crtcs */
- nv_lockvgac(priv, false);
+ ret = nouveau_devinit_fini(&priv->base, suspend);
+ if (ret)
+ return ret;
+
+ /* unslave crtcs */
if (priv->owner < 0)
priv->owner = nv_rdvgaowner(priv);
nv_wrvgaowner(priv, 0);
- return nouveau_devinit_fini(&priv->base, suspend);
+ return 0;
}
int
@@ -426,9 +430,8 @@ nv04_devinit_dtor(struct nouveau_object *object)
{
struct nv04_devinit_priv *priv = (void *)object;
- /* restore vga owner saved at first init, and lock crtc regs */
+ /* restore vga owner saved at first init */
nv_wrvgaowner(priv, priv->owner);
- nv_lockvgac(priv, true);
nouveau_devinit_destroy(&priv->base);
}
diff --git a/nvkm/subdev/devinit/priv.h b/nvkm/subdev/devinit/priv.h
index c4179b6..822a2fb 100644
--- a/nvkm/subdev/devinit/priv.h
+++ b/nvkm/subdev/devinit/priv.h
@@ -15,8 +15,10 @@ struct nouveau_devinit_impl {
#define nouveau_devinit_create(p,e,o,d) \
nouveau_devinit_create_((p), (e), (o), sizeof(**d), (void **)d)
-#define nouveau_devinit_destroy(p) \
- nouveau_subdev_destroy(&(p)->base)
+#define nouveau_devinit_destroy(p) ({ \
+ struct nouveau_devinit *d = (p); \
+ _nouveau_devinit_dtor(nv_object(d)); \
+})
#define nouveau_devinit_init(p) ({ \
struct nouveau_devinit *d = (p); \
_nouveau_devinit_init(nv_object(d)); \
@@ -28,7 +30,7 @@ struct nouveau_devinit_impl {
int nouveau_devinit_create_(struct nouveau_object *, struct nouveau_object *,
struct nouveau_oclass *, int, void **);
-#define _nouveau_devinit_dtor _nouveau_subdev_dtor
+void _nouveau_devinit_dtor(struct nouveau_object *);
int _nouveau_devinit_init(struct nouveau_object *);
int _nouveau_devinit_fini(struct nouveau_object *, bool suspend);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] devinit: lock/unlock crtc regs for all devices, not just pre-nv50
[not found] ` <1390123095-2032-1-git-send-email-imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
@ 2014-01-19 16:14 ` Ilia Mirkin
[not found] ` <CAKb7UvhYBqky6ueYK7NBA7zJW-9w=FTCuKz1ajzcn2a4KAFspw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Ilia Mirkin @ 2014-01-19 16:14 UTC (permalink / raw)
To: Ben Skeggs, Pekka Paalanen, Andreas Reis
Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
On Sun, Jan 19, 2014 at 4:18 AM, Ilia Mirkin <imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org> wrote:
> Also make nv_lockvgac work for nv50+ devices. This should fix IO_CONDITION and
> related VBIOS opcodes that read/write the crtc regs.
>
> See https://bugs.freedesktop.org/show_bug.cgi?id=60680
>
> Signed-off-by: Ilia Mirkin <imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
> ---
>
> Ben, is this what you had in mind? I haven't gotten a chance to test this yet
> since your tree doesn't build against mine (which is largely based on
> nouveau/linux-2.6 master + drm-nouveau-next patches merged in). Something
> about nouveau_acpi/backlight.
>
> Pekka, mind testing this out and see if it also fixes your issue? Grab Ben's
> tree at http://cgit.freedesktop.org/~darktama/nouveau/ and apply this patch,
> and build against a late 3.13-rcX release, I guess. (Still haven't figured out
> which tree I need to have for this stuff to build.)
>
> ./autogen.sh; cd drm; make
>
> should generate a nouveau.ko against your currently-running kernel.
Andreas -- you had the same issue as Pekka, would you mind testing
this out? I'm not sure when he'll be able to give it a shot. This is
an alternate way of resolving the issue that produces itself as HDMI
output not working. You can get a pristine copy of the patch at
http://lists.freedesktop.org/archives/nouveau/2014-January/015770.html
-- but do note the instructions above, as it applies to a different
repo.
>
> nvkm/engine/disp/vga.c | 9 +++++++--
> nvkm/subdev/devinit/base.c | 14 ++++++++++++++
> nvkm/subdev/devinit/nv04.c | 13 ++++++++-----
> nvkm/subdev/devinit/priv.h | 8 +++++---
> 4 files changed, 34 insertions(+), 10 deletions(-)
>
> diff --git a/nvkm/engine/disp/vga.c b/nvkm/engine/disp/vga.c
> index 5a1c684..8836c3c 100644
> --- a/nvkm/engine/disp/vga.c
> +++ b/nvkm/engine/disp/vga.c
> @@ -138,10 +138,15 @@ nv_wrvgai(void *obj, int head, u16 port, u8 index, u8 value)
> bool
> nv_lockvgac(void *obj, bool lock)
> {
> + struct nouveau_device *dev = nv_device(obj);
> +
> bool locked = !nv_rdvgac(obj, 0, 0x1f);
> u8 data = lock ? 0x99 : 0x57;
> - nv_wrvgac(obj, 0, 0x1f, data);
> - if (nv_device(obj)->chipset == 0x11) {
> + if (dev->card_type < NV_50)
> + nv_wrvgac(obj, 0, 0x1f, data);
> + else
> + nv_wrvgac(obj, 0, 0x3f, data);
> + if (dev->chipset == 0x11) {
> if (!(nv_rd32(obj, 0x001084) & 0x10000000))
> nv_wrvgac(obj, 1, 0x1f, data);
> }
> diff --git a/nvkm/subdev/devinit/base.c b/nvkm/subdev/devinit/base.c
> index 6b23d9a..a4df3fa 100644
> --- a/nvkm/subdev/devinit/base.c
> +++ b/nvkm/subdev/devinit/base.c
> @@ -26,6 +26,7 @@
>
> #include <subdev/bios.h>
> #include <subdev/bios/init.h>
> +#include <subdev/vga.h>
>
> #include "priv.h"
>
> @@ -38,6 +39,9 @@ _nouveau_devinit_fini(struct nouveau_object *object, bool suspend)
> if (suspend)
> devinit->post = true;
>
> + /* unlock the extended vga crtc regs */
> + nv_lockvgac(devinit, false);
> +
> return nouveau_subdev_fini(&devinit->base, suspend);
> }
>
> @@ -61,6 +65,16 @@ _nouveau_devinit_init(struct nouveau_object *object)
> return 0;
> }
>
> +void
> +_nouveau_devinit_dtor(struct nouveau_object *object)
> +{
> + struct nouveau_devinit *devinit = (void *)object;
> +
> + /* lock crtc regs */
> + nv_lockvgac(devinit, true);
> + nouveau_subdev_destroy(&devinit->base);
> +}
> +
> int
> nouveau_devinit_create_(struct nouveau_object *parent,
> struct nouveau_object *engine,
> diff --git a/nvkm/subdev/devinit/nv04.c b/nvkm/subdev/devinit/nv04.c
> index 24025e4..7037eae 100644
> --- a/nvkm/subdev/devinit/nv04.c
> +++ b/nvkm/subdev/devinit/nv04.c
> @@ -388,17 +388,21 @@ int
> nv04_devinit_fini(struct nouveau_object *object, bool suspend)
> {
> struct nv04_devinit_priv *priv = (void *)object;
> + int ret;
>
> /* make i2c busses accessible */
> nv_mask(priv, 0x000200, 0x00000001, 0x00000001);
>
> - /* unlock extended vga crtc regs, and unslave crtcs */
> - nv_lockvgac(priv, false);
> + ret = nouveau_devinit_fini(&priv->base, suspend);
> + if (ret)
> + return ret;
> +
> + /* unslave crtcs */
> if (priv->owner < 0)
> priv->owner = nv_rdvgaowner(priv);
> nv_wrvgaowner(priv, 0);
>
> - return nouveau_devinit_fini(&priv->base, suspend);
> + return 0;
> }
>
> int
> @@ -426,9 +430,8 @@ nv04_devinit_dtor(struct nouveau_object *object)
> {
> struct nv04_devinit_priv *priv = (void *)object;
>
> - /* restore vga owner saved at first init, and lock crtc regs */
> + /* restore vga owner saved at first init */
> nv_wrvgaowner(priv, priv->owner);
> - nv_lockvgac(priv, true);
>
> nouveau_devinit_destroy(&priv->base);
> }
> diff --git a/nvkm/subdev/devinit/priv.h b/nvkm/subdev/devinit/priv.h
> index c4179b6..822a2fb 100644
> --- a/nvkm/subdev/devinit/priv.h
> +++ b/nvkm/subdev/devinit/priv.h
> @@ -15,8 +15,10 @@ struct nouveau_devinit_impl {
>
> #define nouveau_devinit_create(p,e,o,d) \
> nouveau_devinit_create_((p), (e), (o), sizeof(**d), (void **)d)
> -#define nouveau_devinit_destroy(p) \
> - nouveau_subdev_destroy(&(p)->base)
> +#define nouveau_devinit_destroy(p) ({ \
> + struct nouveau_devinit *d = (p); \
> + _nouveau_devinit_dtor(nv_object(d)); \
> +})
> #define nouveau_devinit_init(p) ({ \
> struct nouveau_devinit *d = (p); \
> _nouveau_devinit_init(nv_object(d)); \
> @@ -28,7 +30,7 @@ struct nouveau_devinit_impl {
>
> int nouveau_devinit_create_(struct nouveau_object *, struct nouveau_object *,
> struct nouveau_oclass *, int, void **);
> -#define _nouveau_devinit_dtor _nouveau_subdev_dtor
> +void _nouveau_devinit_dtor(struct nouveau_object *);
> int _nouveau_devinit_init(struct nouveau_object *);
> int _nouveau_devinit_fini(struct nouveau_object *, bool suspend);
>
> --
> 1.8.3.2
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] devinit: lock/unlock crtc regs for all devices, not just pre-nv50
[not found] ` <CAKb7UvhYBqky6ueYK7NBA7zJW-9w=FTCuKz1ajzcn2a4KAFspw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2014-01-19 18:46 ` Andreas Reis
[not found] ` <CAM_hTGFAGrJZWX-hHK7=F6DbCXDdBRHKR3SWL6z3roNS+R8PmQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Andreas Reis @ 2014-01-19 18:46 UTC (permalink / raw)
To: Ilia Mirkin
Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
Pekka Paalanen, Ben Skeggs
[-- Attachment #1: Type: text/plain, Size: 7284 bytes --]
No problem. I applied the patch (plus the other for the MXM issue),
replaced the preexisting nouveau.ko.gz in /lib/mod/… with the new
gzipped one, and rebuilt the initramfs. (With an updated DRIVER_DATE
define just to be sure.)
The HDMI output works fine.
Attached are the dmesg outputs before and after, grepped for
'nouveau'. As you can see, there's no real change.
On Sun, Jan 19, 2014 at 5:14 PM, Ilia Mirkin <imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org> wrote:
> On Sun, Jan 19, 2014 at 4:18 AM, Ilia Mirkin <imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org> wrote:
>> Also make nv_lockvgac work for nv50+ devices. This should fix IO_CONDITION and
>> related VBIOS opcodes that read/write the crtc regs.
>>
>> See https://bugs.freedesktop.org/show_bug.cgi?id=60680
>>
>> Signed-off-by: Ilia Mirkin <imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
>> ---
>>
>> Ben, is this what you had in mind? I haven't gotten a chance to test this yet
>> since your tree doesn't build against mine (which is largely based on
>> nouveau/linux-2.6 master + drm-nouveau-next patches merged in). Something
>> about nouveau_acpi/backlight.
>>
>> Pekka, mind testing this out and see if it also fixes your issue? Grab Ben's
>> tree at http://cgit.freedesktop.org/~darktama/nouveau/ and apply this patch,
>> and build against a late 3.13-rcX release, I guess. (Still haven't figured out
>> which tree I need to have for this stuff to build.)
>>
>> ./autogen.sh; cd drm; make
>>
>> should generate a nouveau.ko against your currently-running kernel.
>
> Andreas -- you had the same issue as Pekka, would you mind testing
> this out? I'm not sure when he'll be able to give it a shot. This is
> an alternate way of resolving the issue that produces itself as HDMI
> output not working. You can get a pristine copy of the patch at
> http://lists.freedesktop.org/archives/nouveau/2014-January/015770.html
> -- but do note the instructions above, as it applies to a different
> repo.
>
>>
>> nvkm/engine/disp/vga.c | 9 +++++++--
>> nvkm/subdev/devinit/base.c | 14 ++++++++++++++
>> nvkm/subdev/devinit/nv04.c | 13 ++++++++-----
>> nvkm/subdev/devinit/priv.h | 8 +++++---
>> 4 files changed, 34 insertions(+), 10 deletions(-)
>>
>> diff --git a/nvkm/engine/disp/vga.c b/nvkm/engine/disp/vga.c
>> index 5a1c684..8836c3c 100644
>> --- a/nvkm/engine/disp/vga.c
>> +++ b/nvkm/engine/disp/vga.c
>> @@ -138,10 +138,15 @@ nv_wrvgai(void *obj, int head, u16 port, u8 index, u8 value)
>> bool
>> nv_lockvgac(void *obj, bool lock)
>> {
>> + struct nouveau_device *dev = nv_device(obj);
>> +
>> bool locked = !nv_rdvgac(obj, 0, 0x1f);
>> u8 data = lock ? 0x99 : 0x57;
>> - nv_wrvgac(obj, 0, 0x1f, data);
>> - if (nv_device(obj)->chipset == 0x11) {
>> + if (dev->card_type < NV_50)
>> + nv_wrvgac(obj, 0, 0x1f, data);
>> + else
>> + nv_wrvgac(obj, 0, 0x3f, data);
>> + if (dev->chipset == 0x11) {
>> if (!(nv_rd32(obj, 0x001084) & 0x10000000))
>> nv_wrvgac(obj, 1, 0x1f, data);
>> }
>> diff --git a/nvkm/subdev/devinit/base.c b/nvkm/subdev/devinit/base.c
>> index 6b23d9a..a4df3fa 100644
>> --- a/nvkm/subdev/devinit/base.c
>> +++ b/nvkm/subdev/devinit/base.c
>> @@ -26,6 +26,7 @@
>>
>> #include <subdev/bios.h>
>> #include <subdev/bios/init.h>
>> +#include <subdev/vga.h>
>>
>> #include "priv.h"
>>
>> @@ -38,6 +39,9 @@ _nouveau_devinit_fini(struct nouveau_object *object, bool suspend)
>> if (suspend)
>> devinit->post = true;
>>
>> + /* unlock the extended vga crtc regs */
>> + nv_lockvgac(devinit, false);
>> +
>> return nouveau_subdev_fini(&devinit->base, suspend);
>> }
>>
>> @@ -61,6 +65,16 @@ _nouveau_devinit_init(struct nouveau_object *object)
>> return 0;
>> }
>>
>> +void
>> +_nouveau_devinit_dtor(struct nouveau_object *object)
>> +{
>> + struct nouveau_devinit *devinit = (void *)object;
>> +
>> + /* lock crtc regs */
>> + nv_lockvgac(devinit, true);
>> + nouveau_subdev_destroy(&devinit->base);
>> +}
>> +
>> int
>> nouveau_devinit_create_(struct nouveau_object *parent,
>> struct nouveau_object *engine,
>> diff --git a/nvkm/subdev/devinit/nv04.c b/nvkm/subdev/devinit/nv04.c
>> index 24025e4..7037eae 100644
>> --- a/nvkm/subdev/devinit/nv04.c
>> +++ b/nvkm/subdev/devinit/nv04.c
>> @@ -388,17 +388,21 @@ int
>> nv04_devinit_fini(struct nouveau_object *object, bool suspend)
>> {
>> struct nv04_devinit_priv *priv = (void *)object;
>> + int ret;
>>
>> /* make i2c busses accessible */
>> nv_mask(priv, 0x000200, 0x00000001, 0x00000001);
>>
>> - /* unlock extended vga crtc regs, and unslave crtcs */
>> - nv_lockvgac(priv, false);
>> + ret = nouveau_devinit_fini(&priv->base, suspend);
>> + if (ret)
>> + return ret;
>> +
>> + /* unslave crtcs */
>> if (priv->owner < 0)
>> priv->owner = nv_rdvgaowner(priv);
>> nv_wrvgaowner(priv, 0);
>>
>> - return nouveau_devinit_fini(&priv->base, suspend);
>> + return 0;
>> }
>>
>> int
>> @@ -426,9 +430,8 @@ nv04_devinit_dtor(struct nouveau_object *object)
>> {
>> struct nv04_devinit_priv *priv = (void *)object;
>>
>> - /* restore vga owner saved at first init, and lock crtc regs */
>> + /* restore vga owner saved at first init */
>> nv_wrvgaowner(priv, priv->owner);
>> - nv_lockvgac(priv, true);
>>
>> nouveau_devinit_destroy(&priv->base);
>> }
>> diff --git a/nvkm/subdev/devinit/priv.h b/nvkm/subdev/devinit/priv.h
>> index c4179b6..822a2fb 100644
>> --- a/nvkm/subdev/devinit/priv.h
>> +++ b/nvkm/subdev/devinit/priv.h
>> @@ -15,8 +15,10 @@ struct nouveau_devinit_impl {
>>
>> #define nouveau_devinit_create(p,e,o,d) \
>> nouveau_devinit_create_((p), (e), (o), sizeof(**d), (void **)d)
>> -#define nouveau_devinit_destroy(p) \
>> - nouveau_subdev_destroy(&(p)->base)
>> +#define nouveau_devinit_destroy(p) ({ \
>> + struct nouveau_devinit *d = (p); \
>> + _nouveau_devinit_dtor(nv_object(d)); \
>> +})
>> #define nouveau_devinit_init(p) ({ \
>> struct nouveau_devinit *d = (p); \
>> _nouveau_devinit_init(nv_object(d)); \
>> @@ -28,7 +30,7 @@ struct nouveau_devinit_impl {
>>
>> int nouveau_devinit_create_(struct nouveau_object *, struct nouveau_object *,
>> struct nouveau_oclass *, int, void **);
>> -#define _nouveau_devinit_dtor _nouveau_subdev_dtor
>> +void _nouveau_devinit_dtor(struct nouveau_object *);
>> int _nouveau_devinit_init(struct nouveau_object *);
>> int _nouveau_devinit_fini(struct nouveau_object *, bool suspend);
>>
>> --
>> 1.8.3.2
>>
[-- Attachment #2: dmesg_nouveau_new --]
[-- Type: application/octet-stream, Size: 3929 bytes --]
[ 0.649007] nouveau: unknown parameter 'msi' ignored
[ 0.650376] nouveau [ DEVICE][0000:01:00.0] BOOT0 : 0x096480a1
[ 0.650379] nouveau [ DEVICE][0000:01:00.0] Chipset: G96 (NV96)
[ 0.650381] nouveau [ DEVICE][0000:01:00.0] Family : NV50
[ 0.652222] nouveau [ VBIOS][0000:01:00.0] checking PRAMIN for image...
[ 0.751372] nouveau [ VBIOS][0000:01:00.0] ... appears to be valid
[ 0.751374] nouveau [ VBIOS][0000:01:00.0] using image from PRAMIN
[ 0.751549] nouveau [ VBIOS][0000:01:00.0] BIT signature found
[ 0.751552] nouveau [ VBIOS][0000:01:00.0] version 62.94.38.00.04
[ 0.772175] nouveau [ MXM][0000:01:00.0] BIOS version 2.1
[ 0.798334] nouveau [ MXM][0000:01:00.0] MXMS Version 2.1
[ 0.798350] nouveau [ MXM][0000:01:00.0] unmatched output device 0x96006403e8060100
[ 0.798352] nouveau [ MXM][0000:01:00.0] unmatched output device 0x0000004100009600
[ 0.798404] nouveau 0000:01:00.0: irq 45 for MSI/MSI-X
[ 0.798422] nouveau [ PMC][0000:01:00.0] MSI interrupts enabled
[ 0.798471] nouveau [ PFB][0000:01:00.0] RAM type: GDDR3
[ 0.798473] nouveau [ PFB][0000:01:00.0] RAM size: 512 MiB
[ 0.798475] nouveau [ PFB][0000:01:00.0] ZCOMP: 2048 tags
[ 0.803716] nouveau [ VOLT][0000:01:00.0] GPU voltage: 890000uv
[ 0.836520] nouveau [ PTHERM][0000:01:00.0] FAN control: none / external
[ 0.836528] nouveau [ PTHERM][0000:01:00.0] fan management: automatic
[ 0.836538] nouveau [ PTHERM][0000:01:00.0] internal sensor: yes
[ 0.836543] nouveau [ CLK][0000:01:00.0] 03: core 169 MHz shader 338 MHz memory 100 MHz
[ 0.836547] nouveau [ CLK][0000:01:00.0] 05: core 275 MHz shader 550 MHz memory 300 MHz
[ 0.836550] nouveau [ CLK][0000:01:00.0] 07: core 400 MHz shader 800 MHz memory 300 MHz
[ 0.836553] nouveau [ CLK][0000:01:00.0] 0f: core 500 MHz shader 1250 MHz memory 800 MHz
[ 0.836664] nouveau [ CLK][0000:01:00.0] --: core 275 MHz shader 550 MHz memory 300 MHz
[ 0.836880] nouveau [ DRM] VRAM: 512 MiB
[ 0.836882] nouveau [ DRM] GART: 1048576 MiB
[ 0.836885] nouveau [ DRM] TMDS table version 2.0
[ 0.836886] nouveau [ DRM] DCB version 4.0
[ 0.836888] nouveau [ DRM] DCB outp 00: 01000323 00010034
[ 0.836890] nouveau [ DRM] DCB outp 02: 04011312 00020010
[ 0.836892] nouveau [ DRM] DCB outp 04: 04033386 0f220020
[ 0.836894] nouveau [ DRM] DCB outp 05: 04033382 00020020
[ 0.836896] nouveau [ DRM] DCB outp 06: 02044300 00000028
[ 0.836898] nouveau [ DRM] DCB conn 00: 00000040
[ 0.836900] nouveau [ DRM] DCB conn 01: 00001131
[ 0.836902] nouveau [ DRM] DCB conn 02: 00002231
[ 0.836904] nouveau [ DRM] DCB conn 03: 00110346
[ 0.836905] nouveau [ DRM] DCB conn 04: 00000400
[ 0.836907] nouveau [ DRM] DCB conn 05: 00000510
[ 0.836909] nouveau [ DRM] DCB conn 06: 00000511
[ 0.836910] nouveau [ DRM] DCB conn 07: 00000513
[ 0.836912] nouveau [ DRM] DCB conn 08: 00002631
[ 0.836914] nouveau [ DRM] DCB conn 09: 00001731
[ 0.836915] nouveau [ DRM] DCB conn 10: 00002831
[ 0.836917] nouveau [ DRM] DCB conn 11: 00110946
[ 0.836919] nouveau [ DRM] DCB conn 12: 00000a00
[ 0.836920] nouveau [ DRM] DCB conn 13: 00000b10
[ 0.836922] nouveau [ DRM] DCB conn 14: 00000b11
[ 0.836924] nouveau [ DRM] DCB conn 15: 00000b13
[ 0.866108] nouveau [ DRM] MM: using CRYPT for buffer copies
[ 0.986225] nouveau [ DRM] allocated 1920x1080 fb: 0x70000, bo ffff8800bb9de400
[ 0.986279] fbcon: nouveaufb (fb0) is primary device
[ 2.374079] nouveau 0000:01:00.0: fb0: nouveaufb frame buffer device
[ 2.374081] nouveau 0000:01:00.0: registered panic notifier
[ 2.374085] [drm] Initialized nouveau 1.1.1 20140119 for 0000:01:00.0 on minor 0
[-- Attachment #3: dmesg_nouveau_old --]
[-- Type: application/octet-stream, Size: 3929 bytes --]
[ 0.648747] nouveau: unknown parameter 'msi' ignored
[ 0.650130] nouveau [ DEVICE][0000:01:00.0] BOOT0 : 0x096480a1
[ 0.650133] nouveau [ DEVICE][0000:01:00.0] Chipset: G96 (NV96)
[ 0.650135] nouveau [ DEVICE][0000:01:00.0] Family : NV50
[ 0.651963] nouveau [ VBIOS][0000:01:00.0] checking PRAMIN for image...
[ 0.750343] nouveau [ VBIOS][0000:01:00.0] ... appears to be valid
[ 0.750345] nouveau [ VBIOS][0000:01:00.0] using image from PRAMIN
[ 0.750498] nouveau [ VBIOS][0000:01:00.0] BIT signature found
[ 0.750500] nouveau [ VBIOS][0000:01:00.0] version 62.94.38.00.04
[ 0.770829] nouveau [ MXM][0000:01:00.0] BIOS version 2.1
[ 0.777004] nouveau [ MXM][0000:01:00.0] MXMS Version 2.1
[ 0.777020] nouveau [ MXM][0000:01:00.0] unmatched output device 0x96006403e8060100
[ 0.777022] nouveau [ MXM][0000:01:00.0] unmatched output device 0x0000004100009600
[ 0.777073] nouveau 0000:01:00.0: irq 45 for MSI/MSI-X
[ 0.777090] nouveau [ PMC][0000:01:00.0] MSI interrupts enabled
[ 0.777133] nouveau [ PFB][0000:01:00.0] RAM type: GDDR3
[ 0.777135] nouveau [ PFB][0000:01:00.0] RAM size: 512 MiB
[ 0.777137] nouveau [ PFB][0000:01:00.0] ZCOMP: 2048 tags
[ 0.782297] nouveau [ VOLT][0000:01:00.0] GPU voltage: 890000uv
[ 0.815086] nouveau [ PTHERM][0000:01:00.0] FAN control: none / external
[ 0.815094] nouveau [ PTHERM][0000:01:00.0] fan management: automatic
[ 0.815103] nouveau [ PTHERM][0000:01:00.0] internal sensor: yes
[ 0.815109] nouveau [ CLK][0000:01:00.0] 03: core 169 MHz shader 338 MHz memory 100 MHz
[ 0.815112] nouveau [ CLK][0000:01:00.0] 05: core 275 MHz shader 550 MHz memory 300 MHz
[ 0.815115] nouveau [ CLK][0000:01:00.0] 07: core 400 MHz shader 800 MHz memory 300 MHz
[ 0.815118] nouveau [ CLK][0000:01:00.0] 0f: core 500 MHz shader 1250 MHz memory 800 MHz
[ 0.815222] nouveau [ CLK][0000:01:00.0] --: core 275 MHz shader 550 MHz memory 300 MHz
[ 0.815436] nouveau [ DRM] VRAM: 512 MiB
[ 0.815437] nouveau [ DRM] GART: 1048576 MiB
[ 0.815440] nouveau [ DRM] TMDS table version 2.0
[ 0.815442] nouveau [ DRM] DCB version 4.0
[ 0.815444] nouveau [ DRM] DCB outp 00: 01000323 00010034
[ 0.815446] nouveau [ DRM] DCB outp 02: 04011312 00020010
[ 0.815448] nouveau [ DRM] DCB outp 04: 04033386 0f220020
[ 0.815449] nouveau [ DRM] DCB outp 05: 04033382 00020020
[ 0.815451] nouveau [ DRM] DCB outp 06: 02044300 00000028
[ 0.815453] nouveau [ DRM] DCB conn 00: 00000040
[ 0.815455] nouveau [ DRM] DCB conn 01: 00001131
[ 0.815457] nouveau [ DRM] DCB conn 02: 00002231
[ 0.815459] nouveau [ DRM] DCB conn 03: 00110346
[ 0.815461] nouveau [ DRM] DCB conn 04: 00000400
[ 0.815462] nouveau [ DRM] DCB conn 05: 00000510
[ 0.815464] nouveau [ DRM] DCB conn 06: 00000511
[ 0.815466] nouveau [ DRM] DCB conn 07: 00000513
[ 0.815467] nouveau [ DRM] DCB conn 08: 00002631
[ 0.815469] nouveau [ DRM] DCB conn 09: 00001731
[ 0.815471] nouveau [ DRM] DCB conn 10: 00002831
[ 0.815472] nouveau [ DRM] DCB conn 11: 00110946
[ 0.815474] nouveau [ DRM] DCB conn 12: 00000a00
[ 0.815476] nouveau [ DRM] DCB conn 13: 00000b10
[ 0.815477] nouveau [ DRM] DCB conn 14: 00000b11
[ 0.815479] nouveau [ DRM] DCB conn 15: 00000b13
[ 0.844770] nouveau [ DRM] MM: using CRYPT for buffer copies
[ 0.964803] nouveau [ DRM] allocated 1920x1080 fb: 0x70000, bo ffff8800bb9a1c00
[ 0.964858] fbcon: nouveaufb (fb0) is primary device
[ 2.357893] nouveau 0000:01:00.0: fb0: nouveaufb frame buffer device
[ 2.357895] nouveau 0000:01:00.0: registered panic notifier
[ 2.357899] [drm] Initialized nouveau 1.1.1 20120801 for 0000:01:00.0 on minor 0
[-- Attachment #4: Type: text/plain, Size: 181 bytes --]
_______________________________________________
Nouveau mailing list
Nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
http://lists.freedesktop.org/mailman/listinfo/nouveau
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] devinit: lock/unlock crtc regs for all devices, not just pre-nv50
[not found] ` <CAM_hTGFAGrJZWX-hHK7=F6DbCXDdBRHKR3SWL6z3roNS+R8PmQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2014-01-19 22:13 ` Ilia Mirkin
[not found] ` <CAKb7Uvhp=KYvLH_70b-i+dUAfVHKNxVws8HKb+QT_ha7fY8JOg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Ilia Mirkin @ 2014-01-19 22:13 UTC (permalink / raw)
To: Andreas Reis
Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
Pekka Paalanen, Ben Skeggs
That's great -- can you just confirm that this is what you did (every
so often things work for the wrong reasons):
(a) grabbed the ~darktama repo
(b) took the MXM patch, futzed with the paths (since it was against
the linux tree), applied it
(c) took the patch off the mailing list, applied it (paths should have
been fine)
(d) DID NOT apply the vbios-pq1 patch in any form
And then you built that and took the new nouveau.ko and replaced your
old one with it, and rebooted. And HDMI was fine. Yes?
Thanks,
-ilia
On Sun, Jan 19, 2014 at 1:46 PM, Andreas Reis <andreas.reis-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> No problem. I applied the patch (plus the other for the MXM issue),
> replaced the preexisting nouveau.ko.gz in /lib/mod/… with the new
> gzipped one, and rebuilt the initramfs. (With an updated DRIVER_DATE
> define just to be sure.)
>
> The HDMI output works fine.
>
> Attached are the dmesg outputs before and after, grepped for
> 'nouveau'. As you can see, there's no real change.
>
> On Sun, Jan 19, 2014 at 5:14 PM, Ilia Mirkin <imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org> wrote:
>> On Sun, Jan 19, 2014 at 4:18 AM, Ilia Mirkin <imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org> wrote:
>>> Also make nv_lockvgac work for nv50+ devices. This should fix IO_CONDITION and
>>> related VBIOS opcodes that read/write the crtc regs.
>>>
>>> See https://bugs.freedesktop.org/show_bug.cgi?id=60680
>>>
>>> Signed-off-by: Ilia Mirkin <imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
>>> ---
>>>
>>> Ben, is this what you had in mind? I haven't gotten a chance to test this yet
>>> since your tree doesn't build against mine (which is largely based on
>>> nouveau/linux-2.6 master + drm-nouveau-next patches merged in). Something
>>> about nouveau_acpi/backlight.
>>>
>>> Pekka, mind testing this out and see if it also fixes your issue? Grab Ben's
>>> tree at http://cgit.freedesktop.org/~darktama/nouveau/ and apply this patch,
>>> and build against a late 3.13-rcX release, I guess. (Still haven't figured out
>>> which tree I need to have for this stuff to build.)
>>>
>>> ./autogen.sh; cd drm; make
>>>
>>> should generate a nouveau.ko against your currently-running kernel.
>>
>> Andreas -- you had the same issue as Pekka, would you mind testing
>> this out? I'm not sure when he'll be able to give it a shot. This is
>> an alternate way of resolving the issue that produces itself as HDMI
>> output not working. You can get a pristine copy of the patch at
>> http://lists.freedesktop.org/archives/nouveau/2014-January/015770.html
>> -- but do note the instructions above, as it applies to a different
>> repo.
>>
>>>
>>> nvkm/engine/disp/vga.c | 9 +++++++--
>>> nvkm/subdev/devinit/base.c | 14 ++++++++++++++
>>> nvkm/subdev/devinit/nv04.c | 13 ++++++++-----
>>> nvkm/subdev/devinit/priv.h | 8 +++++---
>>> 4 files changed, 34 insertions(+), 10 deletions(-)
>>>
>>> diff --git a/nvkm/engine/disp/vga.c b/nvkm/engine/disp/vga.c
>>> index 5a1c684..8836c3c 100644
>>> --- a/nvkm/engine/disp/vga.c
>>> +++ b/nvkm/engine/disp/vga.c
>>> @@ -138,10 +138,15 @@ nv_wrvgai(void *obj, int head, u16 port, u8 index, u8 value)
>>> bool
>>> nv_lockvgac(void *obj, bool lock)
>>> {
>>> + struct nouveau_device *dev = nv_device(obj);
>>> +
>>> bool locked = !nv_rdvgac(obj, 0, 0x1f);
>>> u8 data = lock ? 0x99 : 0x57;
>>> - nv_wrvgac(obj, 0, 0x1f, data);
>>> - if (nv_device(obj)->chipset == 0x11) {
>>> + if (dev->card_type < NV_50)
>>> + nv_wrvgac(obj, 0, 0x1f, data);
>>> + else
>>> + nv_wrvgac(obj, 0, 0x3f, data);
>>> + if (dev->chipset == 0x11) {
>>> if (!(nv_rd32(obj, 0x001084) & 0x10000000))
>>> nv_wrvgac(obj, 1, 0x1f, data);
>>> }
>>> diff --git a/nvkm/subdev/devinit/base.c b/nvkm/subdev/devinit/base.c
>>> index 6b23d9a..a4df3fa 100644
>>> --- a/nvkm/subdev/devinit/base.c
>>> +++ b/nvkm/subdev/devinit/base.c
>>> @@ -26,6 +26,7 @@
>>>
>>> #include <subdev/bios.h>
>>> #include <subdev/bios/init.h>
>>> +#include <subdev/vga.h>
>>>
>>> #include "priv.h"
>>>
>>> @@ -38,6 +39,9 @@ _nouveau_devinit_fini(struct nouveau_object *object, bool suspend)
>>> if (suspend)
>>> devinit->post = true;
>>>
>>> + /* unlock the extended vga crtc regs */
>>> + nv_lockvgac(devinit, false);
>>> +
>>> return nouveau_subdev_fini(&devinit->base, suspend);
>>> }
>>>
>>> @@ -61,6 +65,16 @@ _nouveau_devinit_init(struct nouveau_object *object)
>>> return 0;
>>> }
>>>
>>> +void
>>> +_nouveau_devinit_dtor(struct nouveau_object *object)
>>> +{
>>> + struct nouveau_devinit *devinit = (void *)object;
>>> +
>>> + /* lock crtc regs */
>>> + nv_lockvgac(devinit, true);
>>> + nouveau_subdev_destroy(&devinit->base);
>>> +}
>>> +
>>> int
>>> nouveau_devinit_create_(struct nouveau_object *parent,
>>> struct nouveau_object *engine,
>>> diff --git a/nvkm/subdev/devinit/nv04.c b/nvkm/subdev/devinit/nv04.c
>>> index 24025e4..7037eae 100644
>>> --- a/nvkm/subdev/devinit/nv04.c
>>> +++ b/nvkm/subdev/devinit/nv04.c
>>> @@ -388,17 +388,21 @@ int
>>> nv04_devinit_fini(struct nouveau_object *object, bool suspend)
>>> {
>>> struct nv04_devinit_priv *priv = (void *)object;
>>> + int ret;
>>>
>>> /* make i2c busses accessible */
>>> nv_mask(priv, 0x000200, 0x00000001, 0x00000001);
>>>
>>> - /* unlock extended vga crtc regs, and unslave crtcs */
>>> - nv_lockvgac(priv, false);
>>> + ret = nouveau_devinit_fini(&priv->base, suspend);
>>> + if (ret)
>>> + return ret;
>>> +
>>> + /* unslave crtcs */
>>> if (priv->owner < 0)
>>> priv->owner = nv_rdvgaowner(priv);
>>> nv_wrvgaowner(priv, 0);
>>>
>>> - return nouveau_devinit_fini(&priv->base, suspend);
>>> + return 0;
>>> }
>>>
>>> int
>>> @@ -426,9 +430,8 @@ nv04_devinit_dtor(struct nouveau_object *object)
>>> {
>>> struct nv04_devinit_priv *priv = (void *)object;
>>>
>>> - /* restore vga owner saved at first init, and lock crtc regs */
>>> + /* restore vga owner saved at first init */
>>> nv_wrvgaowner(priv, priv->owner);
>>> - nv_lockvgac(priv, true);
>>>
>>> nouveau_devinit_destroy(&priv->base);
>>> }
>>> diff --git a/nvkm/subdev/devinit/priv.h b/nvkm/subdev/devinit/priv.h
>>> index c4179b6..822a2fb 100644
>>> --- a/nvkm/subdev/devinit/priv.h
>>> +++ b/nvkm/subdev/devinit/priv.h
>>> @@ -15,8 +15,10 @@ struct nouveau_devinit_impl {
>>>
>>> #define nouveau_devinit_create(p,e,o,d) \
>>> nouveau_devinit_create_((p), (e), (o), sizeof(**d), (void **)d)
>>> -#define nouveau_devinit_destroy(p) \
>>> - nouveau_subdev_destroy(&(p)->base)
>>> +#define nouveau_devinit_destroy(p) ({ \
>>> + struct nouveau_devinit *d = (p); \
>>> + _nouveau_devinit_dtor(nv_object(d)); \
>>> +})
>>> #define nouveau_devinit_init(p) ({ \
>>> struct nouveau_devinit *d = (p); \
>>> _nouveau_devinit_init(nv_object(d)); \
>>> @@ -28,7 +30,7 @@ struct nouveau_devinit_impl {
>>>
>>> int nouveau_devinit_create_(struct nouveau_object *, struct nouveau_object *,
>>> struct nouveau_oclass *, int, void **);
>>> -#define _nouveau_devinit_dtor _nouveau_subdev_dtor
>>> +void _nouveau_devinit_dtor(struct nouveau_object *);
>>> int _nouveau_devinit_init(struct nouveau_object *);
>>> int _nouveau_devinit_fini(struct nouveau_object *, bool suspend);
>>>
>>> --
>>> 1.8.3.2
>>>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] devinit: lock/unlock crtc regs for all devices, not just pre-nv50
[not found] ` <CAKb7Uvhp=KYvLH_70b-i+dUAfVHKNxVws8HKb+QT_ha7fY8JOg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2014-01-22 17:39 ` Andreas Reis
0 siblings, 0 replies; 5+ messages in thread
From: Andreas Reis @ 2014-01-22 17:39 UTC (permalink / raw)
To: Ilia Mirkin
Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
Pekka Paalanen, Ben Skeggs
Sorry for the delayed reply.
Yes, that's what I did. For the git diff, see here:
http://pastie.org/private/x6pwwrtz4n0pn73vbuagtq
On 19.01.2014 23:13, Ilia Mirkin wrote:
> That's great -- can you just confirm that this is what you did (every
> so often things work for the wrong reasons):
>
> (a) grabbed the ~darktama repo
> (b) took the MXM patch, futzed with the paths (since it was against
> the linux tree), applied it
> (c) took the patch off the mailing list, applied it (paths should have
> been fine)
> (d) DID NOT apply the vbios-pq1 patch in any form
>
> And then you built that and took the new nouveau.ko and replaced your
> old one with it, and rebooted. And HDMI was fine. Yes?
>
> Thanks,
>
> -ilia
>
> On Sun, Jan 19, 2014 at 1:46 PM, Andreas Reis <andreas.reis-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> No problem. I applied the patch (plus the other for the MXM issue),
>> replaced the preexisting nouveau.ko.gz in /lib/mod/… with the new
>> gzipped one, and rebuilt the initramfs. (With an updated DRIVER_DATE
>> define just to be sure.)
>>
>> The HDMI output works fine.
>>
>> Attached are the dmesg outputs before and after, grepped for
>> 'nouveau'. As you can see, there's no real change.
>>
>> On Sun, Jan 19, 2014 at 5:14 PM, Ilia Mirkin <imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org> wrote:
>>> On Sun, Jan 19, 2014 at 4:18 AM, Ilia Mirkin <imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org> wrote:
>>>> Also make nv_lockvgac work for nv50+ devices. This should fix IO_CONDITION and
>>>> related VBIOS opcodes that read/write the crtc regs.
>>>>
>>>> See https://bugs.freedesktop.org/show_bug.cgi?id=60680
>>>>
>>>> Signed-off-by: Ilia Mirkin <imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
>>>> ---
>>>>
>>>> Ben, is this what you had in mind? I haven't gotten a chance to test this yet
>>>> since your tree doesn't build against mine (which is largely based on
>>>> nouveau/linux-2.6 master + drm-nouveau-next patches merged in). Something
>>>> about nouveau_acpi/backlight.
>>>>
>>>> Pekka, mind testing this out and see if it also fixes your issue? Grab Ben's
>>>> tree at http://cgit.freedesktop.org/~darktama/nouveau/ and apply this patch,
>>>> and build against a late 3.13-rcX release, I guess. (Still haven't figured out
>>>> which tree I need to have for this stuff to build.)
>>>>
>>>> ./autogen.sh; cd drm; make
>>>>
>>>> should generate a nouveau.ko against your currently-running kernel.
>>>
>>> Andreas -- you had the same issue as Pekka, would you mind testing
>>> this out? I'm not sure when he'll be able to give it a shot. This is
>>> an alternate way of resolving the issue that produces itself as HDMI
>>> output not working. You can get a pristine copy of the patch at
>>> http://lists.freedesktop.org/archives/nouveau/2014-January/015770.html
>>> -- but do note the instructions above, as it applies to a different
>>> repo.
>>>
>>>>
>>>> nvkm/engine/disp/vga.c | 9 +++++++--
>>>> nvkm/subdev/devinit/base.c | 14 ++++++++++++++
>>>> nvkm/subdev/devinit/nv04.c | 13 ++++++++-----
>>>> nvkm/subdev/devinit/priv.h | 8 +++++---
>>>> 4 files changed, 34 insertions(+), 10 deletions(-)
>>>>
>>>> diff --git a/nvkm/engine/disp/vga.c b/nvkm/engine/disp/vga.c
>>>> index 5a1c684..8836c3c 100644
>>>> --- a/nvkm/engine/disp/vga.c
>>>> +++ b/nvkm/engine/disp/vga.c
>>>> @@ -138,10 +138,15 @@ nv_wrvgai(void *obj, int head, u16 port, u8 index, u8 value)
>>>> bool
>>>> nv_lockvgac(void *obj, bool lock)
>>>> {
>>>> + struct nouveau_device *dev = nv_device(obj);
>>>> +
>>>> bool locked = !nv_rdvgac(obj, 0, 0x1f);
>>>> u8 data = lock ? 0x99 : 0x57;
>>>> - nv_wrvgac(obj, 0, 0x1f, data);
>>>> - if (nv_device(obj)->chipset == 0x11) {
>>>> + if (dev->card_type < NV_50)
>>>> + nv_wrvgac(obj, 0, 0x1f, data);
>>>> + else
>>>> + nv_wrvgac(obj, 0, 0x3f, data);
>>>> + if (dev->chipset == 0x11) {
>>>> if (!(nv_rd32(obj, 0x001084) & 0x10000000))
>>>> nv_wrvgac(obj, 1, 0x1f, data);
>>>> }
>>>> diff --git a/nvkm/subdev/devinit/base.c b/nvkm/subdev/devinit/base.c
>>>> index 6b23d9a..a4df3fa 100644
>>>> --- a/nvkm/subdev/devinit/base.c
>>>> +++ b/nvkm/subdev/devinit/base.c
>>>> @@ -26,6 +26,7 @@
>>>>
>>>> #include <subdev/bios.h>
>>>> #include <subdev/bios/init.h>
>>>> +#include <subdev/vga.h>
>>>>
>>>> #include "priv.h"
>>>>
>>>> @@ -38,6 +39,9 @@ _nouveau_devinit_fini(struct nouveau_object *object, bool suspend)
>>>> if (suspend)
>>>> devinit->post = true;
>>>>
>>>> + /* unlock the extended vga crtc regs */
>>>> + nv_lockvgac(devinit, false);
>>>> +
>>>> return nouveau_subdev_fini(&devinit->base, suspend);
>>>> }
>>>>
>>>> @@ -61,6 +65,16 @@ _nouveau_devinit_init(struct nouveau_object *object)
>>>> return 0;
>>>> }
>>>>
>>>> +void
>>>> +_nouveau_devinit_dtor(struct nouveau_object *object)
>>>> +{
>>>> + struct nouveau_devinit *devinit = (void *)object;
>>>> +
>>>> + /* lock crtc regs */
>>>> + nv_lockvgac(devinit, true);
>>>> + nouveau_subdev_destroy(&devinit->base);
>>>> +}
>>>> +
>>>> int
>>>> nouveau_devinit_create_(struct nouveau_object *parent,
>>>> struct nouveau_object *engine,
>>>> diff --git a/nvkm/subdev/devinit/nv04.c b/nvkm/subdev/devinit/nv04.c
>>>> index 24025e4..7037eae 100644
>>>> --- a/nvkm/subdev/devinit/nv04.c
>>>> +++ b/nvkm/subdev/devinit/nv04.c
>>>> @@ -388,17 +388,21 @@ int
>>>> nv04_devinit_fini(struct nouveau_object *object, bool suspend)
>>>> {
>>>> struct nv04_devinit_priv *priv = (void *)object;
>>>> + int ret;
>>>>
>>>> /* make i2c busses accessible */
>>>> nv_mask(priv, 0x000200, 0x00000001, 0x00000001);
>>>>
>>>> - /* unlock extended vga crtc regs, and unslave crtcs */
>>>> - nv_lockvgac(priv, false);
>>>> + ret = nouveau_devinit_fini(&priv->base, suspend);
>>>> + if (ret)
>>>> + return ret;
>>>> +
>>>> + /* unslave crtcs */
>>>> if (priv->owner < 0)
>>>> priv->owner = nv_rdvgaowner(priv);
>>>> nv_wrvgaowner(priv, 0);
>>>>
>>>> - return nouveau_devinit_fini(&priv->base, suspend);
>>>> + return 0;
>>>> }
>>>>
>>>> int
>>>> @@ -426,9 +430,8 @@ nv04_devinit_dtor(struct nouveau_object *object)
>>>> {
>>>> struct nv04_devinit_priv *priv = (void *)object;
>>>>
>>>> - /* restore vga owner saved at first init, and lock crtc regs */
>>>> + /* restore vga owner saved at first init */
>>>> nv_wrvgaowner(priv, priv->owner);
>>>> - nv_lockvgac(priv, true);
>>>>
>>>> nouveau_devinit_destroy(&priv->base);
>>>> }
>>>> diff --git a/nvkm/subdev/devinit/priv.h b/nvkm/subdev/devinit/priv.h
>>>> index c4179b6..822a2fb 100644
>>>> --- a/nvkm/subdev/devinit/priv.h
>>>> +++ b/nvkm/subdev/devinit/priv.h
>>>> @@ -15,8 +15,10 @@ struct nouveau_devinit_impl {
>>>>
>>>> #define nouveau_devinit_create(p,e,o,d) \
>>>> nouveau_devinit_create_((p), (e), (o), sizeof(**d), (void **)d)
>>>> -#define nouveau_devinit_destroy(p) \
>>>> - nouveau_subdev_destroy(&(p)->base)
>>>> +#define nouveau_devinit_destroy(p) ({ \
>>>> + struct nouveau_devinit *d = (p); \
>>>> + _nouveau_devinit_dtor(nv_object(d)); \
>>>> +})
>>>> #define nouveau_devinit_init(p) ({ \
>>>> struct nouveau_devinit *d = (p); \
>>>> _nouveau_devinit_init(nv_object(d)); \
>>>> @@ -28,7 +30,7 @@ struct nouveau_devinit_impl {
>>>>
>>>> int nouveau_devinit_create_(struct nouveau_object *, struct nouveau_object *,
>>>> struct nouveau_oclass *, int, void **);
>>>> -#define _nouveau_devinit_dtor _nouveau_subdev_dtor
>>>> +void _nouveau_devinit_dtor(struct nouveau_object *);
>>>> int _nouveau_devinit_init(struct nouveau_object *);
>>>> int _nouveau_devinit_fini(struct nouveau_object *, bool suspend);
>>>>
>>>> --
>>>> 1.8.3.2
>>>>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-01-22 17:39 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-19 9:18 [PATCH] devinit: lock/unlock crtc regs for all devices, not just pre-nv50 Ilia Mirkin
[not found] ` <1390123095-2032-1-git-send-email-imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
2014-01-19 16:14 ` Ilia Mirkin
[not found] ` <CAKb7UvhYBqky6ueYK7NBA7zJW-9w=FTCuKz1ajzcn2a4KAFspw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-01-19 18:46 ` Andreas Reis
[not found] ` <CAM_hTGFAGrJZWX-hHK7=F6DbCXDdBRHKR3SWL6z3roNS+R8PmQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-01-19 22:13 ` Ilia Mirkin
[not found] ` <CAKb7Uvhp=KYvLH_70b-i+dUAfVHKNxVws8HKb+QT_ha7fY8JOg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-01-22 17:39 ` Andreas Reis
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.