Post Reply

[PROJ] Overclocking the Adreno GPU on Snapdragon Devices

OP Geniusdog254

26th June 2010, 05:54 PM   |  #21  
jlevy73's Avatar
Senior Member
Los Angeles
Thanks Meter: 1,304
 
9,261 posts
Join Date:Joined: Nov 2009
Quote:
Originally Posted by Geniusdog254

I just woke back up. I guess I will remove the EBI1 overclock since I'm not sure what it does. I'm also not sure what increasing the GPU memory will do, but it's worth a shot.

I had noticed EBI1 is being set to 0 whenever it's diabled, and then setting it back at the time it's enabled. I'm gunna go back through and try to find another setting for the grp clock & a setting for the imem clock.

Be curious to see what increasing the memory of the GPU will do. I do recall when coohlbro came up with the 21mb hack. I took this straight from the OP of that thread (because I am too tired to paraphrase it):

This time, my RAM hack expands memory by 21MB total from the stock kernel. And this time, no camera PMEM is taken away! This is all thanks to the incrediblec kernel source released by HTC giving me some insight.

This is what I did, starting from the 8MB RAM hack:
- Expanded EBI1_BANK0 by 8MB because the incrediblec source said I could
- Moved 5MB GPU memory from EBI1_BANK0 to SMI
- Created extra memory bank in EBI1_BANK0 totalling 13MB
- Added 8MB camera PMEM back into SMI, and re-enabled camera PMEM

Version 2:
- Eliminated third memory bank in EBI1_BANK0 and added that memory into the first memory bank

As far as I know it's not possible to create a memory bank in the SMI and live to tell the tale, so that's why we're squeezing the 8MB of camera PMEM in there. In total, this adds 21MB of RAM from stock cm-kernel with seemingly no compromises.

The zImage is meant to be a proof of concept and only contains this tweak on top of normal cm-kernel. I don't suggest using this zImage for long, as it doesn't contain any "extras," and the regular custom kernels with all the extra features/optimizations will probably incorporate this soon.
27th June 2010, 01:25 AM   |  #22  
Geniusdog254's Avatar
OP Retired Recognized Developer
Flag St. Louis
Thanks Meter: 167
 
1,094 posts
Join Date:Joined: Jan 2009
Donate to Me
More
Changing the RAM tables won't be too difficult. I'm gunna play with some values here in a minute & try it out. I don't have my Nexus with me so I won't be able to test it for the next hour or two, but I will be able to go through some source right now.

As if we needed more proof as to how much we need is OC, look here: http://bit.ly/csSIzp

Our chip shouldn't struggle to come close to that at all, yet it does.
27th June 2010, 03:33 AM   |  #23  
Geniusdog254's Avatar
OP Retired Recognized Developer
Flag St. Louis
Thanks Meter: 167
 
1,094 posts
Join Date:Joined: Jan 2009
Donate to Me
More
I'm building a kernel right now that should return all the clock values for all the graphics related stuff. It won't tell me where it's set, but I can try and change the values elsewhere if I have to and hope they stick.

To get the current frequencies I'm using the pr_info method called every time kgsl is enabled. Here is the code:

Code:
        .... kgsl stuff up here ....
        // this *should* get the clock rate & print it in the kernel log
	pr_info("kgsl: grp_clock at ", clk_get_rate(kgsl_driver.grp_clk), "hz");
	pr_info("kgsl: imem_clock at ", clk_get_rate(kgsl_driver.imem_clk), "hz");
	pr_info("kgsl: ebi1_clock at ", clk_get_rate(kgsl_driver.ebi1_clk), "hz");	
        .... more kgsl stuff down here ....
This should return all the clock values for us, but then my C experience is nonexistant, so correct me if I made some obvious glaring mistake please.
27th June 2010, 04:20 AM   |  #24  
Geniusdog254's Avatar
OP Retired Recognized Developer
Flag St. Louis
Thanks Meter: 167
 
1,094 posts
Join Date:Joined: Jan 2009
Donate to Me
More
Wow, am I the only one who cares about this at this point?

The debug code was screwed up the first time. I changed it to this:

Which managed to return this in dmesg:

Code:
<6>[   70.681793] kgsl: grp_clock= 256000000
<6>[   70.682464] kgsl: imem_clock= 256000000
<6>[   70.683441] kgsl: ebi1_clock= 128000000
So that tells us that the graphics clock and the memory clock are at 256Mhz. It may be a coincidence that the memory clock and the GPU clock are set the same, but more likely is that they are set the same so they can keep up with each other. For instance the memory bus isn't feeding the GPU more than it can handle & the GPU isn't trying to get more data than it can be fed by the memory bus. Just a theory though.
27th June 2010, 04:25 AM   |  #25  
e4604's Avatar
Senior Member
Flag Seattle
Thanks Meter: 2
 
134 posts
Join Date:Joined: Aug 2007
More
You guys are awesome, keep up the good work
27th June 2010, 04:32 AM   |  #26  
Senior Member
Minneapolis
Thanks Meter: 10
 
119 posts
Join Date:Joined: Mar 2010
More
Quote:
Originally Posted by Geniusdog254

Wow, am I the only one who cares about this at this point?

The debug code was screwed up the first time. I changed it to this:

Which managed to return this in dmesg:

Code:
<6>[   70.681793] kgsl: grp_clock= 256000000
<6>[   70.682464] kgsl: imem_clock= 256000000
<6>[   70.683441] kgsl: ebi1_clock= 128000000
So that tells us that the graphics clock and the memory clock are at 256Mhz. It may be a coincidence that the memory clock and the GPU clock are set the same, but more likely is that they are set the same so they can keep up with each other. For instance the memory bus isn't feeding the GPU more than it can handle & the GPU isn't trying to get more data than it can be fed by the memory bus. Just a theory though.

Awesome work.

Ok, could you please do the Evo world a favor? Could you bring this post over to the GPU project thread in the Evo section? Perhaps someone could find out what the Evo is clocked at.
27th June 2010, 04:39 AM   |  #27  
Geniusdog254's Avatar
OP Retired Recognized Developer
Flag St. Louis
Thanks Meter: 167
 
1,094 posts
Join Date:Joined: Jan 2009
Donate to Me
More
Quote:
Originally Posted by goffmj

Awesome work.

Ok, could you please do the Evo world a favor? Could you bring this post over to the GPU project thread in the Evo section? Perhaps someone could find out what the Evo is clocked at.

I'm pretty sure the Evo is clocked the same, but I'm not sure. If I could get my Evo kernel to build, then I would try it myself. But the danged hacked source won't build on my machine, so I'm waiting for the real Evo source drop before I do any real work on mine.

EDIT: Also, I just tried changing the clock speeds before the kernel enables each the GPU & the memory bus clock, but when it goes and enables the clock, they're set back down to 256mhz. I'll try a version with the change being made after the clocks are enabled and see if that changes anything.
Last edited by Geniusdog254; 27th June 2010 at 04:43 AM.
27th June 2010, 04:48 AM   |  #28  
fstluxe's Avatar
Senior Member
Flag New York
Thanks Meter: 14
 
226 posts
Join Date:Joined: Sep 2009
More
are you doing that by chaning the freq or adding this at the end of the freq something like this hexa +0x40);
27th June 2010, 04:56 AM   |  #29  
Geniusdog254's Avatar
OP Retired Recognized Developer
Flag St. Louis
Thanks Meter: 167
 
1,094 posts
Join Date:Joined: Jan 2009
Donate to Me
More
Quote:
Originally Posted by fstluxe

are you doing that by chaning the freq or adding this at the end of the freq something like this hexa +0x40);

Well I'm trying to set it the same way that the stock kernel sets the ebi1 clock. The stock code looks like "clk_set_rate(kgsl_driver.ebi1_clk, 128000000);"

So to try and set the other 2 clocks I used:

Code:
	int imem_grp_clk = 384000000;

        //other code here
	clk_set_rate(kgsl_driver.imem_clk, imem_grp_clk);

        //other code here
	clk_set_rate(kgsl_driver.grp_clk, imem_grp_clk);
Should I be doing it another way? Like I already said, my C experience is almost nonexistant, so I'm probably doing it wrong. I know that in the original MSM7500 chips they used writel and then hex values like you showed, but that's over my head, so I don't know how to do it. If you tell me what code to put or how to do that, then I will try it and let you know.
27th June 2010, 08:00 AM   |  #30  
babijoee's Avatar
Retired Forum Moderator
Flag Melbourne
Thanks Meter: 161
 
1,527 posts
Join Date:Joined: Dec 2008
Donate to Me
More
keep up the good work. When i see galaxy S get 50-60fps in neocore it makes me sad when n1 get 25-30fps

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes