LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-20-2007, 04:35 AM   #1
qwijibow
LQ Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Rep: Reputation: 47
Fixed amd geode-klx framebuffer driver... how to sumbit a patch ?


EDIT: oops, will a mederator please edit the subject line to read "geode-lx" instead of "geode-klx", Thanks.

Hey Guys....

AMD provide a linux kernel patch ( for 2.6.11 ) to add a driver
for the geode-lx hardware accelerated framebuffer.

This patch is also circulated by embedded hardware vendors who use the geode-lx.

this driver is almost completely useless to userland applications ( thanks to an unitiialised frame buffer base pointer )

the X11 Hardware acceleration works... but any attempt to read / write from /dev/fb0 will fail, and fbset -i reports the framebuffer address as NULL
any attempt to mmap the framebuffer will fail !

Anyways... The Fix is a 2 liner...

Does anyone know how i can submit a patch to amd ?
there are no links / info on how at amd.com, or amd's open source driver page

For the mean time....
I will post it here.. ( as no doubt others will be googling )

After patching your 2.6.11 kernel (straight from kernel.org )
with this patch http://www.amd.com/files/connectivit....03.0100.patch


then open the file
drivers/video/geode/geodefb_lx.c

find the following function
Code:
static int 
lxfb_mem_init(struct lxfb_par *par) 
{  
	int ret;
  
	par->fbsize = (maxmem * 1024);
	if (par->fbsize > cim_get_fb_active())
		par->fbsize = cim_get_fb_active();

	KWRN("Allocating %dK of framebuffer memory\n", par->fbsize / 1024);

	par->fbphys = cim_get_fb_base();
	par->fbvirt = cim_get_fb_ptr();

	ret = cim_get_memory("geodefb", "framebuffer", par->fbsize, CIM_F_PUBLIC);
	if (!ret) return -ENOMEM;

	/* Set up acceleration - if this fails, its not fatal */

#ifdef CONFIG_FB_GEODE_ACCEL
	if (accel) {
		par->gpphys = cim_get_cmd_base();
		par->gpsize = cim_get_cmd_size();
    
		if (par->gpphys) 
			par->accel = ACCEL_NOT_READY;
	}
#endif
  
	return 0;
}

On The Line After "par->fbvirt = cim_get_fb_ptr();"

add these 2 lines
Code:
	lxfb_fix.smem_start = par->fbphys;
	lxfb_fix.smem_len = par->fbsize;
so the function now looks like this...
Code:
static int 
lxfb_mem_init(struct lxfb_par *par) 
{  
	int ret;
  
	par->fbsize = (maxmem * 1024);
	if (par->fbsize > cim_get_fb_active())
		par->fbsize = cim_get_fb_active();

	KWRN("Allocating %dK of framebuffer memory\n", par->fbsize / 1024);

	par->fbphys = cim_get_fb_base();
	par->fbvirt = cim_get_fb_ptr();

	/* ADD THESE 2 LINES */
	lxfb_fix.smem_start = par->fbphys;
	lxfb_fix.smem_len = par->fbsize;

	ret = cim_get_memory("geodefb", "framebuffer", par->fbsize, CIM_F_PUBLIC);
	if (!ret) return -ENOMEM;

	/* Set up acceleration - if this fails, its not fatal */

#ifdef CONFIG_FB_GEODE_ACCEL
	if (accel) {
		par->gpphys = cim_get_cmd_base();
		par->gpsize = cim_get_cmd_size();
    
		if (par->gpphys) 
			par->accel = ACCEL_NOT_READY;
	}
#endif
  
	return 0;
}
Now re-compile your kernel.
/dev/fb0 will now work as expected.

Good Luck

Last edited by qwijibow; 01-20-2007 at 04:40 AM.
 
  


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
AMD bug fixed in new Kernels????? pkathgr Linux - Hardware 1 01-12-2005 12:05 PM
AMD bug problem fixed in newer kernels??? pkathgr Slackware 1 01-12-2005 06:48 AM
UT2K4 doesn't lunch after fixed patch hyperion57070 Linux - Games 4 06-14-2004 10:44 AM
gcc pass 2 -no fixed includes patch problems? SciYro Linux From Scratch 0 12-22-2003 06:30 PM
Framebuffer+RADEON+Fixed Sync Monitor Radicalm16 Linux - Hardware 0 04-11-2003 06:03 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:50 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