Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,732,206 Members 44,160 Now Online
XDA Developers Android and Mobile Development Forum

[PROJ] Overclocking the Adreno GPU on Snapdragon Devices

Tip us?
 
jlevy73
Old
#21  
jlevy73's Avatar
Senior Member
Thanks Meter 1224
Posts: 9,124
Join Date: Nov 2009
Location: Los Angeles
Quote:
Originally Posted by Geniusdog254 View Post
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.
 
Geniusdog254
Old
#22  
Geniusdog254's Avatar
Retired Recognized Developer - OP
Thanks Meter 166
Posts: 1,094
Join Date: Jan 2009
Location: St. Louis

 
DONATE TO ME
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.
Follow me on Twitter @Geniusdog254

If you like my work, please buy one of my apps on the Market or donate!
  • Reflex-A-Tron - A colorful, addicting, & fun game to test yourself & challenge friends for only $.99!
  • Search2Play - Control your music with your device's buttons!
  • Task'd - A beautiful to-do list app!

Phones:
Android Dev Phone 1 - Dec. '08
Rogers HTC Dream - Sept. '09
AT&T Nexus One - March '10
Motorola Droid - Apr. '10
HTC Evo - Jun. '10
HTC Evo 3D - Jun. '11
Sprint Galaxy Nexus - May '12
 
Geniusdog254
Old
#23  
Geniusdog254's Avatar
Retired Recognized Developer - OP
Thanks Meter 166
Posts: 1,094
Join Date: Jan 2009
Location: St. Louis

 
DONATE TO ME
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.
Follow me on Twitter @Geniusdog254

If you like my work, please buy one of my apps on the Market or donate!
  • Reflex-A-Tron - A colorful, addicting, & fun game to test yourself & challenge friends for only $.99!
  • Search2Play - Control your music with your device's buttons!
  • Task'd - A beautiful to-do list app!

Phones:
Android Dev Phone 1 - Dec. '08
Rogers HTC Dream - Sept. '09
AT&T Nexus One - March '10
Motorola Droid - Apr. '10
HTC Evo - Jun. '10
HTC Evo 3D - Jun. '11
Sprint Galaxy Nexus - May '12
 
Geniusdog254
Old
#24  
Geniusdog254's Avatar
Retired Recognized Developer - OP
Thanks Meter 166
Posts: 1,094
Join Date: Jan 2009
Location: St. Louis

 
DONATE TO ME
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.
Follow me on Twitter @Geniusdog254

If you like my work, please buy one of my apps on the Market or donate!
  • Reflex-A-Tron - A colorful, addicting, & fun game to test yourself & challenge friends for only $.99!
  • Search2Play - Control your music with your device's buttons!
  • Task'd - A beautiful to-do list app!

Phones:
Android Dev Phone 1 - Dec. '08
Rogers HTC Dream - Sept. '09
AT&T Nexus One - March '10
Motorola Droid - Apr. '10
HTC Evo - Jun. '10
HTC Evo 3D - Jun. '11
Sprint Galaxy Nexus - May '12
 
e4604
Old
#25  
e4604's Avatar
Senior Member
Thanks Meter 0
Posts: 120
Join Date: Aug 2007
Location: Seattle
You guys are awesome, keep up the good work
 
goffmj
Old
#26  
Senior Member
Thanks Meter 10
Posts: 118
Join Date: Mar 2010
Location: Minneapolis
Quote:
Originally Posted by Geniusdog254 View Post
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.
 
Geniusdog254
Old
(Last edited by Geniusdog254; 27th June 2010 at 04:43 AM.)
#27  
Geniusdog254's Avatar
Retired Recognized Developer - OP
Thanks Meter 166
Posts: 1,094
Join Date: Jan 2009
Location: St. Louis

 
DONATE TO ME
Quote:
Originally Posted by goffmj View Post
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.
Follow me on Twitter @Geniusdog254

If you like my work, please buy one of my apps on the Market or donate!
  • Reflex-A-Tron - A colorful, addicting, & fun game to test yourself & challenge friends for only $.99!
  • Search2Play - Control your music with your device's buttons!
  • Task'd - A beautiful to-do list app!

Phones:
Android Dev Phone 1 - Dec. '08
Rogers HTC Dream - Sept. '09
AT&T Nexus One - March '10
Motorola Droid - Apr. '10
HTC Evo - Jun. '10
HTC Evo 3D - Jun. '11
Sprint Galaxy Nexus - May '12
 
fstluxe
Old
#28  
fstluxe's Avatar
Senior Member
Thanks Meter 14
Posts: 226
Join Date: Sep 2009
Location: New York
are you doing that by chaning the freq or adding this at the end of the freq something like this hexa +0x40);
My Phone history..

HTC One X Current device
SGS1 @1.7 GHZ
HTC desire @ 1.3 GHZ
HTC HD2 Android @1.3 GHZ
HTC Kaiser130 @560 MHZ

Oh almost forgot something
 
Geniusdog254
Old
#29  
Geniusdog254's Avatar
Retired Recognized Developer - OP
Thanks Meter 166
Posts: 1,094
Join Date: Jan 2009
Location: St. Louis

 
DONATE TO ME
Quote:
Originally Posted by fstluxe View Post
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.
Follow me on Twitter @Geniusdog254

If you like my work, please buy one of my apps on the Market or donate!
  • Reflex-A-Tron - A colorful, addicting, & fun game to test yourself & challenge friends for only $.99!
  • Search2Play - Control your music with your device's buttons!
  • Task'd - A beautiful to-do list app!

Phones:
Android Dev Phone 1 - Dec. '08
Rogers HTC Dream - Sept. '09
AT&T Nexus One - March '10
Motorola Droid - Apr. '10
HTC Evo - Jun. '10
HTC Evo 3D - Jun. '11
Sprint Galaxy Nexus - May '12
 
babijoee
Old
#30  
babijoee's Avatar
Retired Forum Moderator
Thanks Meter 161
Posts: 1,525
Join Date: Dec 2008
Location: Melbourne

 
DONATE TO ME
keep up the good work. When i see galaxy S get 50-60fps in neocore it makes me sad when n1 get 25-30fps


| TOUCHPRO | NEXUS ONE | DESIRE HD | GALAXY S III | GALAXY NEXUS | GALAXY S III 4G | SONY XPERIA Z |


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes