OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

> Sl6000 Hardware Accelerated Display?, Anyone figured out how to use it?
cwaig
post Dec 3 2004, 01:52 AM
Post #1





Group: Members
Posts: 153
Joined: 5-January 04
Member No.: 1,081



I've been looking at the kernel source for the SL6000's framebuffer driver, and I can see an API provided to access the hardware acceleration - but it's documentation is pretty much zero sad.gif

The only example of it being actually used in the driver itself is the tc6393_clear_screen() function, that uses the hardware rectangle fill to clear the screen. There's a very interesting looking command set provided in the tc6393fb.h file, and an ioctl provided to pass lists of commands to the graphics hardware for processing - but the actual commands (although defined) aren't actually documented sad.gif

The clear screen example in the driver is
static u32 cmd[6];
cmd[0] = PXAIO_COMDI_DSADR|PXAIO_COMDD_DSADR(((int)remapped_fbuf));
cmd[1] = PXAIO_COMDI_DHPIX|PXAIO_COMDD_DHPIX(xres - 1);
cmd[2] = PXAIO_COMDI_DVPIX|PXAIO_COMDD_DVPIX(yres - 1);
cmd[3] = PXAIO_COMDI_FILL|PXAIO_COMDD_FILL(0xffff);
cmd[4] = PXAIO_COMDI_FLGO;

Using the ioctl interface to the framebuffer, this would be:
static u32 cmd[6];
cmd[0] = 5;
cmd[1] = PXAIO_COMDI_DSADR|PXAIO_COMDD_DSADR(((int)remapped_fbuf));
cmd[2] = PXAIO_COMDI_DHPIX|PXAIO_COMDD_DHPIX(xres - 1);
cmd[3] = PXAIO_COMDI_DVPIX|PXAIO_COMDD_DVPIX(yres - 1);
cmd[4] = PXAIO_COMDI_FILL|PXAIO_COMDD_FILL(0xffff);
cmd[5] = PXAIO_COMDI_FLGO;
ioctl(fbHandle,TC6393FB_ACC_CMD_WRITE,cmd);

and then I'm guessing that if you want to make sure it's completed before carrying on, you can use:
ioctl(fbHandle,TC6393FB_ACC_SYNC,0);

But the tc6393 looks like it can do blitting as well....I've no idea what the rest of the command API def's actually do though?

And glory be - Toshiba haven't released a datasheet for the chip sad.gif
When I eventually get my hands on my SL6000 (my wife's hidden it 'til Christmas) I'll start trying some of the commands, see if I can work it out through trial & error.....unless someone else beats me to it of course smile.gif

SDL would go much quicker with a bit of the ol' hardware accel...
Go to the top of the page
 
+Quote Post
 
Start new topic
Replies
xenophobe
post Jan 24 2006, 05:30 AM
Post #2





Group: Members
Posts: 25
Joined: 29-September 04
From: Ukraine
Member No.: 4,801



I had achieve some more progress in graphics acceleration with TC6393.

Here is code snippets for:

1 Draw solid rectangular area with top left corner in point (x,y) and dimensions (width,height) and color(color).
CODE
static uint32_t cmd [11];
int len = 0;
int ret;

cmd[++len] = PXAIO_COMDI_DSADR  | PXAIO_COMDD_DSADR ((x*2+((long)960L*y)));
cmd[++len] = PXAIO_COMDI_DHPIX  | PXAIO_COMDD_DHPIX (width);
cmd[++len] = PXAIO_COMDI_DVPIX  | PXAIO_COMDD_DVPIX (height);
cmd[++len] = PXAIO_COMDI_FILL   | PXAIO_COMDD_FILL (color);
cmd[++len] = PXAIO_COMDI_FLGO;
cmd[0] = len;
if ((ret = ioctl (fd, TC6393FB_ACC_CMD_WRITE, cmd)) < 0)
        perror ("ioctl");

printf ("TC6393FB_ACC_CMD_WRITE returned %d\n", ret);

if ((ret = ioctl (fd, TC6393FB_ACC_SYNC, 0)) < 0)
        perror("ioctl");

printf ("TC6393FB_ACC_SYNC returned %d\n", ret);


2 Setup pattern for ROP3 filling and copying. Pattern is at patAddr in TC6393 video memory, and pattern dimension is patWidth,patHeight
CODE
       static uint32_t cmd [11];
       int len = 0;
       int ret;
       /* Pattern setup */
       cmd[++len] = PXAIO_COMDI_PSADR  | PXAIO_COMDD_PSADR (patAddr);
       cmd[++len] = PXAIO_COMDI_POADR  | PXAIO_COMDD_POADR (patAddr);
       cmd[++len] = PXAIO_COMDI_PHPIX  | PXAIO_COMDD_PHPIX (patWidth);
       cmd[++len] = PXAIO_COMDI_PVPIX  | PXAIO_COMDD_PVPIX (patHeight);
       cmd[++len] = PXAIO_COMDI_PHOFS  | PXAIO_COMDD_PHOFS (0);
       cmd[++len] = PXAIO_COMDI_PVOFS  | PXAIO_COMDD_PVOFS (0);
       cmd[0] = len;
       if ((ret = ioctl (fd, TC6393FB_ACC_CMD_WRITE, cmd)) < 0)
               perror ("ioctl");


3 Filling area with pattern- area is (x,y,width,height), code of ROP3 operation is ropCode
(area copying with rop3 is similar)
CODE
       len=0;
       /* Destination setup and run command*/
       cmd[++len] = PXAIO_COMDI_DSADR  | PXAIO_COMDD_DSADR ((2*x+960*(y)));
       cmd[++len] = PXAIO_COMDI_DHPIX  | PXAIO_COMDD_DHPIX (width);
       cmd[++len] = PXAIO_COMDI_DVPIX  | PXAIO_COMDD_DVPIX (height);
       cmd[++len] = PXAIO_COMDI_RSTR   | PXAIO_COMDD_RSTR (ropCode);
       cmd[++len] = PXAIO_COMDI_FLGO | PXAIO_COMDD_FLGO_ROP3;
       cmd[0] = len;
       if ((ret = ioctl (fd, TC6393FB_ACC_CMD_WRITE, cmd)) < 0)
               perror ("ioctl");

       if ((ret = ioctl (fd, TC6393FB_ACC_SYNC, 0)) < 0)
               perror("ioctl");


4 Draw line from point (x1,y1) to point (x2,y2) with color (color)
CODE
 int dx = 0;
 int dy = 0;
 int flag = 0;
 int bk2 = 0;
 int ini = 0;
   if ( x1 < x2 )
   {
      dx = x2-x1;
   }
   else
   {
      dx = x1-x2;
      flag = flag | PXAIO_COMDD_LDGO_LHRV;
   }
   if ( y1 < y2 )
   {
      dy = y2-y1;
   }
   else
   {
      dy = y1-y2;
      flag = flag | PXAIO_COMDD_LDGO_LVRV;
   }
   if ( dy == 0 ) //special case for horizontal line
   {
     ini = 0x8000;
   }
   else if ( dy <= dx )
   {
     bk2 = (dy-dx)<<1;
   }
   else if ( dx == 0 )  //special case for vertical line
   {
     ini = 0x8000;
     flag = flag | PXAIO_COMDD_LDGO_LDMOD;
   }
   else
   {
     bk2 = (dx-dy)<<1;
     flag = flag | PXAIO_COMDD_LDGO_LDMOD;
   }

       static uint32_t cmd [11];
       int len = 0;
       int ret;
       cmd[++len] = PXAIO_COMDI_DSADR  | PXAIO_COMDD_DSADR ((x1*2+((long)960L*y1)));
       cmd[++len] = PXAIO_COMDI_DVPIX  | PXAIO_COMDD_DVPIX (dy);
       cmd[++len] = PXAIO_COMDI_DHPIX  | PXAIO_COMDD_DHPIX (dx);
       cmd[++len] = PXAIO_COMDI_LBINI  | PXAIO_COMDD_LBINI (ini);
       cmd[++len] = PXAIO_COMDI_LBK2  | PXAIO_COMDD_LBK2 (bk2);
       cmd[++len] = PXAIO_COMDI_FILL   | PXAIO_COMDD_FILL (color);
       cmd[++len] = PXAIO_COMDI_LDGO | flag;
       cmd[0] = len;

       if ((ret = ioctl (fd, TC6393FB_ACC_CMD_WRITE, cmd)) < 0)
               perror ("ioctl");

//      printf ("TC6393FB_ACC_CMD_WRITE returned %d\n", ret);

       if ((ret = ioctl (fd, TC6393FB_ACC_SYNC, 0)) < 0)
               perror("ioctl");


There are two unresolved issues: cursor movement and area stretching.
Last one is very hard to resolve because TC6393 hangs in case of wrong scaling parameters.

--
Happy hacking,
Eugene.
Go to the top of the page
 
+Quote Post

Posts in this topic
cwaig   Sl6000 Hardware Accelerated Display?   Dec 3 2004, 01:52 AM
GoLinux   Is this the same device? http://www.mnementh.co.u...   Dec 4 2004, 09:24 AM
cwaig   I believe the part number is TC6393XB - there...   Dec 4 2004, 10:30 AM
guylhem   That would be a sweet addon to libsdl   Dec 5 2004, 07:25 AM
GoLinux   cwaig, the information you can find at the link I...   Dec 6 2004, 10:38 PM
psycoman   asny news about TC6393XB video chip ?   Jan 2 2005, 10:02 AM
GoLinux   Not yet... I only found this guy who wrote a drive...   Jan 3 2005, 01:38 PM
psycoman   yeap, i send a email to this guy, he will send a p...   Jan 4 2005, 02:43 AM
jcabrer   QUOTE(psycoman @ Jan 4 2005, 03:43 AM)yeap, i...   Jan 4 2006, 05:09 PM
speculatrix   QUOTE(psycoman @ Jan 4 2005, 11:43 AM)yeap, i...   Jan 24 2006, 06:09 AM
psycoman   i get with ion, one documentation about the chip. ...   Jan 5 2005, 05:29 AM
cwaig   Has anyone made any progress with this (or seen th...   Jan 17 2005, 12:46 PM
seed   any new about the TC6393XB video chip ? do someone...   Apr 16 2005, 11:01 AM
xjqian   QUOTE(seed @ Apr 16 2005, 02:01 PM)do someone...   Apr 16 2005, 03:44 PM
seed   QUOTE(xjqian @ Apr 16 2005, 11:44 PM)QUOTE(se...   Apr 16 2005, 05:22 PM
xjqian   QUOTE(seed @ Apr 16 2005, 08:22 PM)QUOTE(xjqi...   Apr 17 2005, 10:52 AM
seed   [/quote] not sure about c1k and c3k. but worse tha...   Apr 17 2005, 01:51 PM
guylhem   cwaig, did you got the docs I sent ? Any progress...   Apr 17 2005, 11:53 AM
seed   any new about this   Jun 12 2005, 07:13 PM
the_oak   Any new developments in video hardware acceleratio...   Jul 30 2005, 10:04 AM
speculatrix   bump!   Nov 16 2005, 02:44 PM
guylhem   without the chip technical manual, no hope.   Nov 17 2005, 05:51 PM
mahadri   Sharp's tc6393fb.h has enough information to e...   Nov 28 2005, 02:28 AM
speculatrix   QUOTE(mahadri @ Nov 28 2005, 11:28 AM)Sharp...   Nov 28 2005, 02:40 AM
mahadri   QUOTE(speculatrix @ Nov 28 2005, 05:40 AM)thi...   Nov 28 2005, 03:10 AM
speculatrix   p.s. and I'll gladly contribute to a beer fund...   Nov 28 2005, 02:41 AM
guylhem   Hello By any chance, would you have the chip tech...   Dec 2 2005, 03:34 AM
xenophobe   QUOTESharp's tc6393fb.h has enough information...   Dec 8 2005, 08:15 AM
jcabrer   My first response from Toshiba is displayed below....   Jan 5 2006, 09:49 AM
speculatrix   Just to note that the MSDN site has a comment abou...   Jan 5 2006, 01:33 PM
jcabrer   QUOTE(speculatrix @ Jan 5 2006, 02:33 PM)Just...   Jan 5 2006, 02:20 PM
speculatrix   QUOTE(jcabrer @ Jan 5 2006, 11:20 PM)QUOTE(sp...   Jan 5 2006, 03:56 PM
jcabrer   Well, it's not the TC6393XB, but it is VERY CL...   Jan 5 2006, 03:03 PM
jgardia   QUOTE(jcabrer @ Jan 5 2006, 11:03 PM)Well, it...   Jan 5 2006, 03:51 PM
speculatrix   QUOTE(jgardia @ Jan 6 2006, 12:51 AM)group of...   Jan 5 2006, 03:57 PM
jgardia   QUOTE(speculatrix @ Jan 5 2006, 11:57 PM)QUOT...   Jan 5 2006, 04:17 PM
dirk   QUOTE(jcabrer @ Jan 6 2006, 12:03 AM)Well, it...   Jan 5 2006, 11:27 PM
speculatrix   looks quite useful, albeit it's a hardware ref...   Jan 5 2006, 03:45 PM
jcabrer   Ok. I don't think Toshiba is going to give me...   Jan 6 2006, 10:55 AM
jcabrer   Looks like I spoke too soon. QUOTEHi John, We...   Jan 6 2006, 03:42 PM
jcabrer   And here is the final nail in the coffin. The tec...   Jan 18 2006, 04:41 PM
DrWowe   I'm quite confident that, given some time, eve...   Jan 18 2006, 09:22 PM
speculatrix   progress seems quite slow on this... I am really r...   Jan 23 2006, 03:32 PM
xenophobe   I had achieve some more progress in graphics accel...   Jan 24 2006, 05:30 AM
xenophobe   One more thing about Tosa acceleration. If you tak...   Jan 24 2006, 05:42 AM
speculatrix   any news at all on this.. even a slightly improved...   Apr 9 2006, 02:33 PM
speculatrix   I now work in the science park in Cambridge, and t...   Jun 5 2006, 12:48 PM
GoLinux   Hi guys, I'm afraid it might only be about th...   Oct 29 2006, 07:33 PM
speculatrix   QUOTE(GoLinux @ Oct 30 2006, 04:33 AM)Hi guys...   Oct 30 2006, 02:45 AM
sdjf   I have found the Tosa ROM 1.12 to be extremely slo...   Aug 1 2008, 06:26 AM
speculatrix   QUOTE(sdjf @ Aug 1 2008, 03:26 PM) I have...   Aug 1 2008, 06:57 AM
sdjf   Uh, have done neither AFAIK but I'll go off an...   Aug 3 2008, 03:33 AM
the_oak   Mine has never been slow switching between already...   Aug 3 2008, 05:39 AM
sdjf   yeah, did that first thing I'm afraid of gett...   Aug 3 2008, 01:50 PM


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 25th December 2014 - 01:23 PM