LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 07-18-2010, 04:46 AM   #1
XXLRay
Member
 
Registered: May 2010
Posts: 133

Rep: Reputation: 16
[Ubuntu] unknown field ‘dri_library_name’ when making VIA chrome9 driver


I have a VIA pc3500g mainborad with C7 CPU. It has a VIA Chrome9 video chip , VIA CN896 North Bridge and VIA 8237A or VT8237S South Bridge.
I run Ubuntu and try to install the VIA propriatary driver.
Code:
$ cat /etc/issue.net && uname -r
Ubuntu 10.04 LTS
2.6.32-23-generic
I was following the instructions from https://help.ubuntu.com/community/OpenChrome . The installation of the openchrome project driver succeeded but it lacks performance. Thus I tried to install the driver from VIA http://linux.via.com.tw/support/downloadFiles.action -> http://linux.via.com.tw/support/begi...id=310&fid=605.
When doing "make" I have the following error message:
Code:
$ cd via-xserver-86a-50283_src/DRM/H5DRM_Independent_2.6.27_28/
$ make
make -C /lib/modules/2.6.32-23-generic/build M=/home/media/via-xserver-86a-50283_src/DRM/H5DRM_Independent_2.6.27_28 modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.32-23-generic'
  CC [M]  /home/media/via-xserver-86a-50283_src/DRM/H5DRM_Independent_2.6.27_28/via_chrome9_drv.o
/home/media/via-xserver-86a-50283_src/DRM/H5DRM_Independent_2.6.27_28/via_chrome9_drv.c:220: error: unknown field ‘dri_library_name’ specified in initializer
/home/media/via-xserver-86a-50283_src/DRM/H5DRM_Independent_2.6.27_28/via_chrome9_drv.c:220: warning: initialization from incompatible pointer type
/home/media/via-xserver-86a-50283_src/DRM/H5DRM_Independent_2.6.27_28/via_chrome9_drv.c:233: warning: initialization from incompatible pointer type
make[2]: *** [/home/media/via-xserver-86a-50283_src/DRM/H5DRM_Independent_2.6.27_28/via_chrome9_drv.o] Error 1
make[1]: *** [_module_/home/media/via-xserver-86a-50283_src/DRM/H5DRM_Independent_2.6.27_28] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.32-23-generic'
make: *** [default] Error 2
I found some more threads about this error but no fix at all. The only hint I could discover is that the sources might be created for older kernel sources.

Is anybody else able to perform "make" on the 2d/DRM files and verify the error or can tell me how to fix my problem?
 
Old 07-18-2010, 10:56 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,376

Rep: Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336
Am I correct in thinking your driver tried to compile a driver version for kernel 2.6.27_28 in a kernel source 2.6.32-23?
I thought the whole point of giving these things numbers was because when guys changed them and added stuff they gave it a new number. I'd suggest a driver source and kernel source with the same kernel version.
 
Old 07-18-2010, 03:01 PM   #3
XXLRay
Member
 
Registered: May 2010
Posts: 133

Original Poster
Rep: Reputation: 16
The problem is that there are not any newer source files from VIA. I think going back to an old kernel is no option, is it? The question is whether there is any other way to compile the source files for the present kernel.
 
Old 07-19-2010, 03:14 AM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,376

Rep: Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336
OK, I'm far from being a programming head, so take this with a health warning.
Quote:
/home/media/via-xserver-86a-50283_src/DRM/H5DRM_Independent_2.6.27_28/via_chrome9_drv.c:220: error: unknown field ‘dri_library_name’ specified in initializer
Is that defined anywhere? It may be as simple as that. If you cd to /home/media/via-xserver-86a-50283_src/DRM/H5DRM_Independent_2.6.27_28 & run
grep -rC3 dri_library_name * |less

You will see how that is used, and maybr get an idea of how to sort this. It looks like a small error. Have you tried via's linux forum?
 
Old 07-19-2010, 11:08 AM   #5
XXLRay
Member
 
Registered: May 2010
Posts: 133

Original Poster
Rep: Reputation: 16
Code:
$ grep -ri "dri_library_name" /home/media/via-xserver-86a-50283_src/DRM/H5DRM_Independent_2.6.27_28/
/home/media/via-xserver-86a-50283_src/DRM/H5DRM_Independent_2.6.27_28/via_chrome9_drv.c:static int dri_library_name(struct drm_device *dev, char *buf)
/home/media/via-xserver-86a-50283_src/DRM/H5DRM_Independent_2.6.27_28/via_chrome9_drv.c:	.dri_library_name = dri_library_name,
Thus the only file it is used seems to be via_chrome9_drv.c ->
Code:
$ grep -iC3 "dri_library_name" /home/media/via-xserver-86a-50283_src/DRM/H5DRM_Independent_2.6.27_28/via_chrome9_drv.c
#define RING_BUFFER_INIT_FLAG 1
#define RING_BUFFER_CLEANUP_FLAG 2

static int dri_library_name(struct drm_device *dev, char *buf)
{
	return snprintf(buf, PAGE_SIZE, "via_chrome9");
}
--
	.load = via_chrome9_driver_load,
	.unload = via_chrome9_driver_unload,
	.device_is_agp = via_chrome9_is_agp,
	.dri_library_name = dri_library_name,
	.reclaim_buffers = drm_core_reclaim_buffers,
	.reclaim_buffers_locked = NULL,
	.reclaim_buffers_idlelocked = via_chrome9_reclaim_buffers_locked,
Where the error coming from line 220 as shown in the error message is as follows:
Code:
$ sed -n "220p" /home/media/via-xserver-86a-50283_src/DRM/H5DRM_Independent_2.6.27_28/via_chrome9_drv.c
	.dri_library_name = dri_library_name,
I have some programming background by the way but I have to admit that I am more into Java than into C. I am not rather sure what line 220 is supposed to do. The whole section around line 220 is a struct:
Code:
static struct drm_driver driver = {
        .driver_features = DRIVER_USE_AGP | DRIVER_REQUIRE_AGP |
                DRIVER_HAVE_DMA | DRIVER_FB_DMA | DRIVER_USE_MTRR |
                DRIVER_SG,
        .open = via_chrome9_driver_open,
        .load = via_chrome9_driver_load,
        .unload = via_chrome9_driver_unload,
        .device_is_agp = via_chrome9_is_agp,
        .dri_library_name = dri_library_name,
        .reclaim_buffers = drm_core_reclaim_buffers,
        .reclaim_buffers_locked = NULL,
        .reclaim_buffers_idlelocked = via_chrome9_reclaim_buffers_locked,
        .lastclose = via_chrome9_lastclose,
        .preclose = via_chrome9_preclose,
        .get_map_ofs = drm_core_get_map_ofs,
        .get_reg_ofs = drm_core_get_reg_ofs,
        .ioctls = via_chrome9_ioctls,
        .fops = {
                 .owner = THIS_MODULE,
                 .open = drm_open,
                 .release = drm_release,
                 .ioctl = drm_ioctl,
                 .mmap = drm_mmap,
                 .poll = drm_poll,
                 .fasync = drm_fasync,
        },
        .pci_driver = {
                 .name = DRIVER_NAME,
                 .id_table = pciidlist,
                 .resume = via_chrome9_drm_resume,
                 .suspend = via_chrome9_drm_suspend,
        },

        .name = DRIVER_NAME,
        .desc = DRIVER_DESC,
        .date = DRIVER_DATE,
        .major = DRIVER_MAJOR,
        .minor = DRIVER_MINOR,
        .patchlevel = DRIVER_PATCHLEVEL,
};
In the VIA forum users are a bit lost. Their answer is to ask VIA support personally for a new driver. I will do so of course but I do not expect very much of it. Linux drivers do not seem to have a very high priority for VIA.
 
Old 07-20-2010, 03:19 AM   #6
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,376

Rep: Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336
Yeah, Via are crap. I'll tell how what you have to do. Post on their most highly visible windows/general/new stuff Forum. Write a well argued diatribe against Via and their linux support. They will whip your post off that forum and shove it onto the least used linux forum, but you will get the attention of a (not very bright) developer to shut you up :-D.

static int dri_library_name(struct drm_device *dev, char *buf)

http://tigcc.ticalc.org/doc/keywords.html#static

That passes for a definition. But the blindingly obvious has finally struck me
make[1]: Leaving directory `/usr/src/linux-headers-2.6.32-23-generic'

/lib/modules/<version>/bujild should point at the kernel source, whereas you are building in linux-headers. What happens when you have the headers but not the source is that the build symlink is pointed by distros at them. Try this
bash-3.1$ cd /usr/src
bash-3.1$ du -sh linux-2.6.32*
616M linux-2.6.32

That's a kernel - built and it's over 600 megs. An exploded tarball is 400 Megs or bigger. Headers are 20 Megs. Have you got the source? If not, get it, copy in the .config of the kernel you are running, and make it. It's usually stored as /boot/config-version. FYI My source has directories
~/drivers/gpu/drm/via
~drivers/video/via
 
Old 07-20-2010, 10:55 AM   #7
XXLRay
Member
 
Registered: May 2010
Posts: 133

Original Poster
Rep: Reputation: 16
The symlink seems to point at the headers indeed:
Code:
$ ls -l /lib/modules/2.6.32-23-generic/build
lrwxrwxrwx 1 root root 40 2010-07-09 17:03 /lib/modules/2.6.32-23-generic/build -> /usr/src/linux-headers-2.6.32-23-generic
I only have the tarball in this location:
Code:
$ ls /usr/src/linux-source-2.6.32*
/usr/src/linux-source-2.6.32.tar.bz2
Normally I compile my kernels from my home directory (where the untared source files are located now). I did not completely understand what you are suggesting. Shall I compile my kernel again? I did that in the last days as I am optimizng my system but it had no effect on the link.
 
Old 07-20-2010, 02:13 PM   #8
XXLRay
Member
 
Registered: May 2010
Posts: 133

Original Poster
Rep: Reputation: 16
The answer from VIA has just arrived:

Quote:
(translated)

We do not offer direct support for PC3500 products from here. We offer support for for ViA embedded boards and systems.
Nevertheless you will find all up to date drivers on our Linux portal.
http://linux.via.com.tw/support/downloadFiles.action

For further support concerning this product please contact your dealer.
They nearly completely ignored what I wrote them. I mentioned that their drivers on exactly the link they are proposing are outdated. Furthermore I told them that I purchased the board from a private person. Alltogether this answer was quite useless.
 
Old 07-21-2010, 03:06 AM   #9
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,376

Rep: Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336
Quote:
Originally Posted by XXLRay View Post
The symlink seems to point at the headers indeed:
I did not completely understand what you are suggesting. Shall I compile my kernel again? I did that in the last days as I am optimizng my system but it had no effect on the link.
I would change the /lib/modules/2.6.32.whatever/build sumlink to point at the kermnel source. Then try compiling the driver, which will enter a different directory if you do that
 
Old 07-22-2010, 12:42 AM   #10
XXLRay
Member
 
Registered: May 2010
Posts: 133

Original Poster
Rep: Reputation: 16
Different directory but same error message:
Quote:
$ make
make: *** No targets specified and no makefile found. Stop.
media@media:~/via-xserver-86a-50283_src$ cd DRM/H5DRM_Independent_2.6.27_28/
media@media:~/via-xserver-86a-50283_src/DRM/H5DRM_Independent_2.6.27_28$ make
make -C /lib/modules/2.6.32-23-generic/build M=/home/media/via-xserver-86a-50283_src/DRM/H5DRM_Independent_2.6.27_28 modules
make[1]: Entering directory `/home/media/src/linux-source-2.6.32'
CC [M] /home/media/via-xserver-86a-50283_src/DRM/H5DRM_Independent_2.6.27_28/via_chrome9_drv.o
/home/media/via-xserver-86a-50283_src/DRM/H5DRM_Independent_2.6.27_28/via_chrome9_drv.c:220: error: unknown field ‘dri_library_name’ specified in initializer
/home/media/via-xserver-86a-50283_src/DRM/H5DRM_Independent_2.6.27_28/via_chrome9_drv.c:220: warning: initialization from incompatible pointer type
/home/media/via-xserver-86a-50283_src/DRM/H5DRM_Independent_2.6.27_28/via_chrome9_drv.c:233: warning: initialization from incompatible pointer type
make[2]: *** [/home/media/via-xserver-86a-50283_src/DRM/H5DRM_Independent_2.6.27_28/via_chrome9_drv.o] Error 1
make[1]: *** [_module_/home/media/via-xserver-86a-50283_src/DRM/H5DRM_Independent_2.6.27_28] Error 2
make[1]: Leaving directory `/home/media/src/linux-source-2.6.32'
make: *** [default] Error 2
 
Old 08-02-2010, 12:10 PM   #11
XXLRay
Member
 
Registered: May 2010
Posts: 133

Original Poster
Rep: Reputation: 16
One week ago I asked for the driver for a supported board with the same chipset. Today VIA was able to answer that the driver for Ubuntu 10.04 has not been released yet (surprise) and that they don't know when it will be released. I was advised to visit their website regularly for updates...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] awk: how to print a field when field position is unknown? elfoozo Programming 12 08-18-2010 03:52 AM
error unknown column 'xxx' in field list rajesh84210 Linux - Newbie 4 09-07-2009 11:22 PM
static struct pci_driver unknown field 'name' "has initializer but incomplete type" ddeeks Programming 0 05-27-2009 12:09 PM
VIA Chrome9 video chipset crashes while fedore core 9 is booting up... elqboy Linux - Software 5 07-19-2008 01:45 PM
Problems with Xorg and Via Chrome9 HC crosseyedalien Linux - Server 0 10-22-2007 06:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 05:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration