Bug 14393 - Card detected as NV20 (endian issue?) With nv driver run first, fifo lockup on nv11ppc machine
Summary: Card detected as NV20 (endian issue?) With nv driver run first, fifo lockup o...
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/nouveau (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Nouveau Project
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-05 17:06 UTC by Henrik Sørensen
Modified: 2011-12-05 10:09 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Xorg log (57.89 KB, application/octet-stream)
2008-02-05 17:06 UTC, Henrik Sørensen
no flags Details
Kernel log (11.38 KB, application/octet-stream)
2008-02-05 17:07 UTC, Henrik Sørensen
no flags Details
X log (70.54 KB, application/octet-stream)
2008-02-14 07:05 UTC, Henrik Sørensen
no flags Details
kernel log (13.04 KB, application/octet-stream)
2008-02-14 07:08 UTC, Henrik Sørensen
no flags Details
correctly set endian access in nouveau_state.c (401 bytes, patch)
2008-07-10 21:28 UTC, Danny
no flags Details | Splinter Review

Description Henrik Sørensen 2008-02-05 17:06:52 UTC
Created attachment 14162 [details]
Xorg log

The system is a gigabit g4 powermac with a PC AGP NV11 (10de:0110) flashed with a mac ROM. 

While the drm module seems to identify it as a NV11, the nouveau ddx driver
does not.


[drm] Detected an NV11 generation card (0x011000b2)
vs 
(--) NOUVEAU(0): Chipset: "NVIDIA NV20"

There's also a message in further down in the log that seems to suggest endian issues.

(EE) NOUVEAU(0): Card is in big endian mode, something is very wrong !
Comment 1 Henrik Sørensen 2008-02-05 17:07:24 UTC
Created attachment 14163 [details]
Kernel log
Comment 2 Henrik Sørensen 2008-02-14 07:05:43 UTC
Created attachment 14309 [details]
X log
Comment 3 Henrik Sørensen 2008-02-14 07:06:44 UTC
Either because of code changes or due to the system firmware being upgraded to 4.2.8, the card is now detected as a nv11. However it does not get far without crashing with a fifo lockup, the x checkboard partern and x cursor is shown for only a second.
Comment 4 Henrik Sørensen 2008-02-14 07:08:03 UTC
Created attachment 14310 [details]
kernel log
Comment 5 Henrik Sørensen 2008-02-14 08:10:25 UTC
Sigh.. I was way to quick. The card had been initialised by the nv driver before  I started X with the nouveau driver. If the machine is booted without nv having run, it is back to the old behaviour. (NV20 detected and 0 MiB of ram).
Comment 6 Danny 2008-07-10 21:28:09 UTC
Created attachment 17630 [details] [review]
correctly set endian access in nouveau_state.c

The first issue (card being in the wrong mode) is probably a bug in the drm. 
Both nv and nvidiafb set up BE access by writing 0x01000001 to NV03_PMC_BOOT_1 (instead of 0x00000001 as done by drm). This also explains why it worked after running nv (nv set up the card correctly).

Patch is attached. The second problem is probably something else. It may have been fixed in the meantime, so pls test.

Actually, the drm used to write 0x01000001 but this was changed by marcheu in commit 30353c8efcc026ee8940f3eadab084c42a3acd4e. I do not know the reason of this change.

d.
Comment 7 Pekka Paalanen 2009-09-23 04:56:41 UTC
The code in current DRM still is:

#ifdef __BIG_ENDIAN
	/* Put the card in BE mode if it's not */
	if (nv_rd32(dev, NV03_PMC_BOOT_1))
		nv_wr32(dev, NV03_PMC_BOOT_1, 0x00000001);

	DRM_MEMORYBARRIER();
#endif

Does the patch change anything?
How does Nouveau currently work with and without the patch?

The patch may not apply as is, but you can easily do the equivalent change by hand in drivers/gpu/drm/nouveau/nouveau_state.c in the nouveau/linux-2.6 kernel tree, near line 540.
Comment 8 Chí-Thanh Christopher Nguyễn 2009-09-23 05:16:57 UTC
Reports in IRC suggest that the issue still exists.

It might be a good idea to ask the committer of 30353c8efcc026ee8940f3eadab084c42a3acd4e what was the reasoning behind the change.
Comment 9 Stephane Marchesin 2009-09-23 05:27:20 UTC
(In reply to comment #8)
> Reports in IRC suggest that the issue still exists.
> 
> It might be a good idea to ask the committer of
> 30353c8efcc026ee8940f3eadab084c42a3acd4e what was the reasoning behind the
> change.
> 

That change was motivated by the fact that it fixed at least one system.

If you (PPC guys) can come up with a patch that pleases everyone with a PPC, I think we're more than happy to merge it...
Comment 10 Emil Velikov 2011-08-23 13:32:07 UTC
Changes almost identical to the proposed patch are part of upstream for a while now.

Can you try the latest nouvea-git or linux-3.1

Both of which include the commit "drm/nouveau: fix big-endian switch"

Thanks


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.