[Openchrome-devel] New "openchrome" DRM driver segfault
Thomas Hellström
thomas
Mon Jan 26 02:17:22 PST 2009
Hi!
Erik-Jan wrote:
> Hi,
>
> I tried the new openchrome DRM driver. When I insert the openchome.ko
> module (by starting Xorg or doing it manually) it gives a lot of errors
> and then segfaults.
>
> Looking in the source, I found that in via_detect_vram, it tries to do a
> switch/case on fn3->device. But on my hardware (CLE266, device=0x3122),
> fn3 doesn't get initialized (I don't know if it even exists) so the
> switch errors out.
>
> So, I made a small patch that fixes this. Now I can start X.
>
> It does sort of work: there are lots of errors in syslog:
> kernel: [drm:drm_unlocked_ioctl] *ERROR* ret = 53 -85
> and exiting X and returning to console leaves the screen all black. But
> hey, it's experimental :))
>
> Bye
> Erik-Jan
>
>
>
Yes, I forgot to mention that for some unichromes I haven't set up the
drm initialization yet.
It's tested on CN400, PM800, CX700, K8M800 and P4M890. Chrome9 devices
don't work yet.
Don't mind the ERROR thing. Somebody added this to the modesetting
branch of DRM, and the -85 is a
legitimate error. It happens when you move the cursor while the X server
is waiting for the GPU. The drm then stops what it's doing to service
the cursor move request.
I think when you exit X you might get a segfault. I see that with
Xserver-1.6-branch, and that's probably why it doesn't restore the
console. I'll take a look at that, and push the CLE266 init fix when I
get some time over.
BTW does VT switching work? Can you suspend / resume to disk (RAM should
not work yet) ? What about 3D?
Thanks,
/Thomas
> ------------------------------------------------------------------------
>
> diff -Naur drm-modesetting-newttm-20090123-orig/linux-core/openchrome/via_init.c drm-modesetting-newttm-20090123/linux-core/openchrome/via_init.c
> --- drm-modesetting-newttm-20090123-orig/linux-core/openchrome/via_init.c 2009-01-23 21:26:28.000000000 +0100
> +++ drm-modesetting-newttm-20090123/linux-core/openchrome/via_init.c 2009-01-25 23:34:25.597824414 +0100
> @@ -444,16 +444,20 @@
> */
>
> dev_priv->vram_direct = 0;
> - switch (fn3->device) {
> - case 0x3204:
> - pci_read_config_byte(fn3, 0x47, &size);
> - dev_priv->vram_start = size << 24;
> - dev_priv->vram_start -= dev_priv->vram_size * 1024;
> - dev_priv->vram_direct = 1;
> - break;
> - default:
> + if (fn3 == NULL) {
> dev_priv->vram_start = pci_resource_start(dev->pdev, 0);
> - break;
> + } else {
> + switch (fn3->device) {
> + case 0x3204:
> + pci_read_config_byte(fn3, 0x47, &size);
> + dev_priv->vram_start = size << 24;
> + dev_priv->vram_start -= dev_priv->vram_size * 1024;
> + dev_priv->vram_direct = 1;
> + break;
> + default:
> + dev_priv->vram_start = pci_resource_start(dev->pdev, 0);
> + break;
> + }
> }
>
> if (dev_priv->vram_direct)
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Openchrome-devel mailing list
> Openchrome-devel at openchrome.org
> http://wiki.openchrome.org/mailman/listinfo/openchrome-devel
>
More information about the Openchrome-devel
mailing list