PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Toshiba E-740 findings

Hi,

I just got an E-740 to try some benchmarking.. I can report the following in addition to everything else that has been mentioned on the forum:

(1) The ATI display adapter uses synchronized buffer flip. This means no more tearing while scrolling. Performance-wise this will save at least 4 ms each frame (not having to copy the back buffer to display but just changing the display memory pointer). The current ATI implementation however is not done in an optimized way since the flip is synchronous and it seems to only update the display at 20FPS or so (this can be seen in the scrolling intro to the MFC sample).
(2) The natural orientation of the display is GDDISPMODE_NORMAL (like the Casio E-125).

The performance hit is however really bad. GapiDraw always reads all data in a cache-optimized way. Despite this, using lots of small sprites such as in the MFC demo the performance drops to a halt. In landscape mode, the IPAQ is capable of displaying 180 key sourced sprites at 30 FPS. On the E740, it barely reaches 50 (in normal mode it can reach 100 sprites though).

So.. If one wants to target the E740, and is willing to use NORMAL display mode, the performance loss will probably never exceed 50%. If the display driver gets fixed the loss will probably be closer to 30%. Using landscape mode the performance loss is extreme.

/Johan
If the flip is synchronous, you could use a separate thread to build an asynchronous flip... How is the individual buffers accessed? Does GXBeginDraw() return a different address each time?
As I'm now officially on vacation I left the 740 at the office.. But now I want to dig a bit more.. Hm. I will ask two of the guys I work with (who also are named Johan and Johan) to check it out.

Johan/Johan: I'll email you separately. The 740 is on my desk. Could you check:

(1) Subclass CGapiApplication. On ProcessNextFrame() do nothing. Use m_timer.GetActualFrameTime() to get the time each frame takes to process. You could then simply call SetError() and use the minimum/avg/maximum times as either string or hr. The time will be shown before the main app exits.

(1b) Repeat above with different target FPS settings. Try 10, 20, 30, 40, 50, 100, and 1000.

(2) Link to gx.lib directly in a new simple WinMain loop. Do not subclass CGapiApplication. Call BeginDraw(), EndDraw, and BeginDraw again. Check the return values from BeginDraw to see if the address differs between each call.

Or.. If someone else out there has a 740.. Perhaps you can get the test done quicker (it would take 10-15 minutes of coding work at maximum)....

/Johan
Hello,

I hope you will keep us informed about this issue, as I think it's of major interest to all developers.

Not only about this particular device, but all new devices, especially those using the XScale.

If crappy video interfaces get to be common place on PocketPC devices, we'll have to adapt..

Regards,

Eric Fortier
UMCP_matt · 20 Jul 2002, 22:14 UTC — so is it slow no matter what gfx lib used right?
No matter if i use gapidraw.. overloaded..pocketetfrog

itll all be the same slow speed on the e740 right?
:oops:
As long as the library _adds_ just 1 word to each pixel in every get/set pixel loop it will work in a cache-optimized way. This means that the width/height sometimes must be flipped (depending on the display alignment), and that the inner pitch always is +1 (which means the offset and pitch may have to be adjusted as well). EasyCE for example adds xPitch to each pixel without doing the proper adjustment (if for example xPitch is > 1 word, and the screen is aligned in a non-optimal way, this can cause extreme performance penalties on the E740).

An optimized loop will always be similar to:
Code:
for (y=0; y<axis1; ++y)
{
dest = destpointer;
for (x=0; x<axis2; ++x)
{
<do something with the pixel>
dest++;
} 
destpointer += axis1pitch;
}

GapiDraw works this way and I am almost certain that PocketFrog is optimized this way as well. I have not looked into the Overloaded project so I cannot comment on that. EasyCE is not optimized.

/Johan
Here are the results you asked for Johan and some interesting facts about the Toshiba e740:

Getting a higher framerate than 53 fps on the e740 seem to be an impossible mission.

We have compared it to the iPAQ 3630 and our results shows that the iPAQ 3630 is a much faster device, when it comes to graphic routines, than the e740.

The following table shows our results.
<pre>-----------------------------------------------------
FPS Target | Min | Max | Average
-----------------------------------------------------

IPAQ3630 50 | 50,0 | 52,2 | 50,07
-----------------------------------------------------
E740 50 | 49,5 | 52 | 50,0

IPAQ3630 100 | 99,1 | 102,4 | 100,1
-----------------------------------------------------
E740 100 | 53,53 | 54,7 | 53,85

IPAQ3630 200 | 142 | 152 | 143
-----------------------------------------------------
E740 200 | 52 | 54 | 53,5

* NOTE: No process intensive work was done during each processNextFrame().
</pre>
GXBeginDraw() routine returns the same address each time on Toshiba e740 (as well as on an iPAQ 3630).

/Johan&Johan
If the address returned is always the same, then I guess the display is not double-buffered. This also means that much better performances should be possible.

Is the video buffer actual video memory? If not, we need to find a way to directly access it. Perhaps there is a way to "enable" double buffering?
Good questions..

Personally I get this kind of "this device really, really needs DirectDraw now" feeling.. :) To have an ATI accelerator and accessing it with GAPI feels like trying to create a new game in mode13 to work with WindowsXP (one may get it to work but it will look bad and be slow like ---)..

I guess one could try some reads/write to the memory address returned from GXBeginDraw and compare the performance from plain memory. I never remember if it was reading or writing that didn´t use cache on the ARM (I guess it was writing), but it could show a difference.

My colleagues are playing with the 740 right now, and I will dig some more when I get back. I guess an email to ATI wouldn´t hurt either (I mean, all libraries out there would benefit from some kind of API, even a low level one), so I'll send one that way as well...

/Johan
UMCPmatt · 22 Jul 2002, 23:33 UTC — so whats the bottom line
The e310 I traded in to get the e740 was a bad idea?

Cmon can someone say something positive about the xscale on the e740 and future games??
like maybe.. .when .net is out it will be quicker?

How can ATI adverties a gfx chip and the reality of it be that it is actually slower than what is there before?

I NEED GOOD NEWS. Make me feel good about my e740 purchase please
How's this:

After evaluating ALL available PDAs on the market for our PocketPC game design class this autumn we finally decided on the E-740 (each student will receive one). The performance loss is not THAT bad if you use cache-optimized data reads, and based on our findings above the graphics performance has the potential to be improved significantly if back buffer locking becomes available in a future GAPI driver update. The main drawback with true double buffering is that it would probably break several games, since the address returned from GXBeginDraw will change on each frame.

The current ATI chip will not be able to store hardware surfaces (internal memory is a mere 384kb, and each 16-bit surface is at minimum 150kb which basically is enough for display and back buffer but not much more). So several of the cool tricks with hardware surfaces is still not possible on any handheld device and will not be so in the near future as well...

As for games that take advantage of the built-in WLAN of the E740, I have a new release of OpenTrek (OpenTrek NG) to be released soon which will be really cool. You will have >10 WLAN games for your new Toshiba in 2-3 months.

/Johan
Games that don't call GXBeginDraw() / GXEndDraw() each frame don't deserve to run on the new hardware.

GAPI was designed with these calls to allow maximum flexibility to the library implementation. This work just like BeginScene() / EndScene() in DirectX. Games (and their players) who use the API properly should not be penalized by lazy and sloppy programmers.
Kzinti,
The problem with that is there are quite a few popular games and applications that OEMs want their new devices to work with that don't call GXBeginDraw/GXEndDraw each frame. They have to choose between doing things the "right" way and backwards compatibility with existing software titles. The overwhelming majority of Pocket PC owners don't even know what GXBeginDraw is (not programmers), but they do want to be able to run existing games on their new devices.

I had "Larry BitBank" tell me that calling GXBeginDraw each frame was ridiculous since it returns the same thing each frame. I then asked him if he had actually measured the overhead from making calls to GXBegin/EndDraw each frame. He said that any unnecessary overhead was uncalled for in his applications and that I shouldn't call it each frame either. Whatever. This was from a developer who knows obviously knows the platform, has several apps in the market, and should be smarter than to do things like this (and encourage other to do the same).

GAPI is an abomination as far as APIs are concerned. If DirectDraw ever makes it on Pocket PC devices then this sort of thing will be reduced because there are rules that apps and drivers follow that are spelled out quite clearly in the docs. I suppose someone like Larry could cache the pointer returned by locking the primary surface, but once the surface is unlocked the pointer is invalid. If he keeps the surface locked so that the pointer remains valid, any blits to/from or attempts to get a DC from the surface will fail.
Digby,

You are absolutely right about backward compatibility. I've work at Matrox in the past writing Direct3D drivers and tons of applications back then would call BeginScene() at the start of the game and EndScene() at the end (if ever). Others would go "BeginScene()/Flip()" without ever calling EndScene(). Some games would even call BeginScene()/EndScene() multiple times before a single Flip().

Of course, Matrox (and other IHV) wanted all games to work on their accelerators... We implemented everything needed to make sure it would work with all game... At a cost of performances. It makes sense for a IHV to ensure backward compatiblity for money reasons.

But, this remains a pet peeve of mine. I feel an unjustified lost in performances is imposed on the users. It is obvious (to me anyways) that the intend of GAPI is that you call GXBeginDraw()/GXEndDraw() each frame. In any case, you need to do this on Casio devices otherwise nothing will work. So why do it differently on the IPAQ vs the E125? As for the overhead, it is negligeable... GXBeginDraw() is only called once per frame and it simply returns a pointer (on the IPAQ anyways).

I don't know who Larry BitBank is, but I know he his not right in caching this pointer and not calling GXBeginDraw()/GXEndDraw(). It might works on most (IPAQ) devices... But it's certainly not "upward" compatible. The E740 is a good example: what if the GAPI implementation was to offer double buffering? (It doesn't... but this will never come to be if programmers continue to cache the pointer).
Here's a link to the guy's website that contains a list of his work:
[url]http://www.bitbanksoftware.com[/url]

I agree with you, if developers would have heeded the GAPI flags Compaq would have never had to implement the "intermediate" buffer in its 38xx iPaqs for backwards compatibility with their 36xx devices. Also, the driver *could* have supported true page flipping if apps would call GXBeginDraw/EndDraw each frame instead of caching the pointer.