Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Write data into draw context memory slowly!: (7 Items)
   
Write data into draw context memory slowly!  
I write a program using draw context memory by the function PdCreateOffscreenContext(). This function returns a pointer 
to a PdOffscreenContext_t. After that i use the function PdGetOffscreenContextPtr() to get a pointer to the shared 
memory object. When i have that pointer i can change data in the context to blit them on the screen by the function 
PgContextBlit(). However i had a problem with writing data back into the context, it was very slow. For example: ptr is 
the pointer to context, d is a variable.
for(int i=0; i < CONTEXT_HEIGHT; ++i)
    for(int j=0; j < CONTEXT_WITH; ++j) {
       d = *(ptr + i * CONTEXT_WIDTH * 4 + j);(1)
      *(ptr + i * CONTEXT_WIDTH * 4 + j) = 2 * d; (2)
}

if i set CONTEXT_HEIGHT and CONTEXT_WIDTH small (about smaller than 256) the program run normal.
if i set CONTEXT_HEIGHT and CONTEXT_WIDTH biggerl (about 1024) the program run very slow.
I tried to test with bypassing either the line (1) or the line (2) and i realized that the line (2) made the program 
very slow. Can you help me to solve it? 
Re: Write data into draw context memory slowly!  
This is most likely expected -- when you get a pointer to a video (dedicated) memory. The memory access is facilitated 
by the graphics controller and is usually slow for reading (comparing to a RAM memory controller) and fast for writing.
What graphics adapter are you using?
Re: Write data into draw context memory slowly!  
Dear you!
I am using the graphics adapter Intel GFX. I used window OS to build
programs with the context memory and they always run normal, there were not
any problem. Do you have solutions for my problem? Can you help me. Please!

2011/5/31 Misha Nefedov <community-noreply@qnx.com>

> This is most likely expected -- when you get a pointer to a video
> (dedicated) memory. The memory access is facilitated by the graphics
> controller and is usually slow for reading (comparing to a RAM memory
> controller) and fast for writing.
> What graphics adapter are you using?
>
>
>
> _______________________________________________
>
> Advanced Graphics
> http://community.qnx.com/sf/go/post86272
>
>
Re: Write data into draw context memory slowly!  
I bought a computer from Advantech, its name is ARK-6622H-18ZE. You can see
details about graphic adapter on website of Advantech. Thank you.

2011/5/31 Thắng Bùi Quý <bqthangcndt@gmail.com>

> Dear you!
> I am using the graphics adapter Intel GFX. I used window OS to build
> programs with the context memory and they always run normal, there were not
> any problem. Do you have solutions for my problem? Can you help me. Please!
>
>
> 2011/5/31 Misha Nefedov <community-noreply@qnx.com>
>
>> This is most likely expected -- when you get a pointer to a video
>> (dedicated) memory. The memory access is facilitated by the graphics
>> controller and is usually slow for reading (comparing to a RAM memory
>> controller) and fast for writing.
>> What graphics adapter are you using?
>>
>>
>>
>> _______________________________________________
>>
>> Advanced Graphics
>> http://community.qnx.com/sf/go/post86272
>>
>>
>
Re: Write data into draw context memory slowly!  
The code is for a chassis. Please post a link to the board/graphics adapter details.
Re: Write data into draw context memory slowly!  
This is the link which contains datasheet of ARK-6622H-18ZE:
-
http://www.alldatasheet.net/datasheet-pdf/pdf/327854/ADVANTECH/ARK-6622H-18ZE.html
and this is the link for the board:
-
http://buy.advantech.com/AIMB270G200A1E/AIMB270G200A1E/model-AIMB-270G2-00A1E.htm

2011/5/31 Misha Nefedov <community-noreply@qnx.com>

> The code is for a chassis. Please post a link to the board/graphics adapter
> details.
>
>
>
> _______________________________________________
>
> Advanced Graphics
> http://community.qnx.com/sf/go/post86276
>
>
Re: Write data into draw context memory slowly!  
1. What graphics driver are you using? 
2. What version of the OS?
3. What is the output of 'pci -v' (relevant part only -- search for VGA)
4. What is the output of show_vesa ? (just the header -- not need for modes' descriptions).