[Openchrome-users] New 2133 User

Varol Okan varokan
Sat Jan 17 06:17:33 PST 2009


Hello,

I am new to this list so excuse if this question has been asked before ( 
though I did not see it in the archives )

I have the hp2133 Netbook and have the latest openchrome driver 
installed. Obviously I know that 3D is currently not supported but I was 
trying the following and it seems to almost work

OpenSuSE 11.1, svn version of openchrome, and via_chrome9.ko from 
http://linux.via.com.tw/support/downloadFiles.action -> Ubuntu 8.10 source.

The via_chrome9 modules compiles and I can load it without any problems. 
When I try to use glxgears, or glxinfo I get:
>  glxinfo
name of display: :0.0
libGL: XF86DRIGetClientDriverName: 5.0.0 unichrome (screen 0)
libGL: OpenDriver: trying /usr/lib/dri/updates/unichrome_dri.so
libGL error: dlopen /usr/lib/dri/updates/unichrome_dri.so failed 
(/usr/lib/dri/updates/unichrome_dri.so: cannot open shared object file: 
No such file or directory)
libGL: OpenDriver: trying /usr/lib/dri/unichrome_dri.so
drmOpenDevice: node name is /dev/dri/card0
drmOpenDevice: open result is 4, (OK)
drmOpenByBusid: Searching for BusID PCI:1:0:0
drmOpenDevice: node name is /dev/dri/card0
drmOpenDevice: open result is 4, (OK)
drmOpenByBusid: drmOpenMinor returns 4
drmOpenByBusid: drmGetBusid reports pci:0000:01:00.0
libGL error:
Can't open configuration file /root/.drirc: No such file or directory.
Mesa warning: couldn't open libtxc_dxtn.so, software DXTn 
compression/decompression unavailable
AllocateDmaBuffer fail
X Error of failed request: BadAlloc (insufficient resources for operation)
Major opcode of failed request: 155 (GLX)
Minor opcode of failed request: 3 (X_GLXCreateContext)
Serial number of failed request: 26
Current serial number in output stream: 27

Looking at dmesg I see :
[drm:via_chrome9_ioctl_allocate_mem_base] *ERROR* User want to alloc 
memory from pcie heap but via_chrome9.ko has no this heap exist.
[drm:via_chrome9_ioctl_allocate_mem_wrapper] *ERROR* Allocate memory error!.
[drm:via_chrome9_ioctl_allocate_mem_base] *ERROR* Attempt to allocate 
from uninitialized         memory manager.
[drm:via_chrome9_ioctl_allocate_mem_base] *ERROR* User want to alloc 
memory from pcie heap but via_chrome9.ko has no this heap exist.
[drm:via_chrome9_ioctl_allocate_mem_wrapper] *ERROR* Allocate memory error!.
[drm:via_chrome9_ioctl_allocate_mem_base] *ERROR* Attempt to allocate 
from uninitialized         memory manager.

Which comes from via_chrome_mm.c
int via_chrome9_ioctl_allocate_mem_base(struct drm_device *dev, void 
*data, struct drm_file *file_priv)
{
        struct drm_via_chrome9_mem *mem = data;
        struct drm_memblock_item *item;
        struct drm_via_chrome9_private *dev_priv =
                (struct drm_via_chrome9_private *) dev->dev_private;
        unsigned long tmpSize = 0, offset = 0, alignment = 0;
        /* modify heap_type to agp for pcie, since we treat pcie/agp heap
        no difference in heap management */
        if (mem->type == memory_heap_pcie) {
                if (dev_priv->chip_agp != CHIP_PCIE) {
                        DRM_ERROR("User want to alloc memory from pcie 
heap \
                        but via_chrome9.ko has no this heap exist.\n");
                        return -EINVAL;
                }
        mem->type = memory_heap_agp;
        }

        if (mem->type > VIA_CHROME9_MEM_AGP) {
                DRM_ERROR("Unknown memory type allocation\n");
                return -EINVAL;
        }
        mutex_lock(&dev->struct_mutex);
        if (0 == ((mem->type == VIA_CHROME9_MEM_VIDEO) ?
                dev_priv->vram_initialized : dev_priv->agp_initialized)) {
                DRM_ERROR("Attempt to allocate from uninitialized\
                        memory manager.\n");
                mutex_unlock(&dev->struct_mutex);
                return -EINVAL;
                }
        tmpSize = (mem->size + VIA_CHROME9_MM_GRANULARITY_MASK) >>
                VIA_CHROME9_MM_GRANULARITY;
        mem->size = tmpSize << VIA_CHROME9_MM_GRANULARITY;
        alignment = (dev_priv->alignment & 0x80000000) ? dev_priv->
        alignment & 0x7FFFFFFF : 0;
        alignment /= (1 << VIA_CHROME9_MM_GRANULARITY);
        item = drm_sman_alloc(&dev_priv->sman, mem->type, tmpSize, 
alignment,
        (unsigned long)file_priv);
        mutex_unlock(&dev->struct_mutex);
        /* alloc failed */
        if (!item) {
                DRM_ERROR("Allocate memory failed ******ERROR******.\n");
                return -ENOMEM;
        }
        /* Till here every thing is ok, we check the memory type allocated
        and return appropriate value to user mode  Here the value return to
        user is very difficult to operate. BE CAREFULLY!!! */
        /* offset is used by user mode ap to calculate the virtual address
        which is used to access the memory allocated */
        mem->index = item->user_hash.key;
        offset = item->mm->offset(item->mm, item->mm_info) <<
        VIA_CHROME9_MM_GRANULARITY;
        switch (mem->type) {
        case VIA_CHROME9_MEM_VIDEO:
                mem->offset = offset + dev_priv->back_offset;
                break;
        case VIA_CHROME9_MEM_AGP:
        /* return different value to user according to the chip type */
                if (dev_priv->chip_agp == CHIP_PCIE) {
                        mem->offset = offset +
                        ((struct drm_via_chrome9_DMA_manager *)dev_priv->
                                dma_manager)->DMASize * sizeof(unsigned 
long);
                } else {
                mem->offset = offset;
                }
                break;
        default:
       /* Strange thing happen! Faint. Code bug! */
                DRM_ERROR("Enter here is impossible ******\
                ERROR******.\n");
                return -EINVAL;
        }
        /*DONE. Need we call function copy_to_user ?NO. We can't even
        touch user's space.But we are lucky, since kernel drm:drm_ioctl
        will to the job for us.  */
        return 0;
}

Can any one tell me what to do next ?

Varol :)





More information about the Openchrome-users mailing list