[Openchrome-devel] Some fixes for VX800 in kms-branch

James Simmons jsimmons
Wed Nov 2 15:58:09 PDT 2011

> Dear James,
> thank you for your work of extending and actualizing the openchrome driver and 
> the via drm kernel module. I'm currently testing the new openchrome driver 
> (revision 1020) without any drm kernel module on my Samsung NC20 (VIA VX800 
> chipset). To be able to use it successfully, I am using the attached small 
> patch which I want to share with you.
> It contains following (small) modifications:
> 1. Remove "static" from VIAFreeRec()
>    The function VIAFreeRec() is used in several C-Files, so it should not be
>    "static".
> 2. Remove "Bool ret" from VIAEnterVT()
>    The return value "ret" is never assigned, so depending on the old stack
>    contents, the function VIAEnterVT() may return FALSE accidently.
> 3. Directly use VIALeaveVT() in VIACloseScreen()
>    I get a NULL-pointer dereference in VIACloseScreen() without this change.
>    Maybe the function pointer is already set to NULL when VIACloseScreen() is
>    called? Unfortunately here I don't exactly know why the current code does
>    not work... ;-(
> 4. Remove call to VIAUnmapMem() in VIACloseScreen()
>    If this function would be called, a subsequent VIAScreenInit() crashes.
>    This happens on KDE logout without having "TerminateServer" set in kdmrc.
> 5. Do not call via_dp_init() in ViaOutputsDetect() for VX800
>    Without this change, Xorg would hang on startup.
> I think at least modification 1, 2, and 4 are correct fixes, whereas 
> modifications 3 and 5 may just be workarounds for deeper problems I didn't 
> find.

Case 3 is a left over from when I had a different LeaveVT for KMS and UMS.
This patch is correct as I compare it to other xorg drivers. As for case 4
VIAUnmapMem needs to be called for cleanup. I'm going to move that to 
VIAFreeScreen. Fix 5 makes me nervous. Do you have any logs from the 

> Hopefully this may help you to further improve the openchrome driver.

Thank you for thee fixes. I commited your changes, can it give it a try. 
Only the patch for case 5 is not applied.

More information about the Openchrome-devel mailing list