ts-7000
[Top] [All Lists]

Re: [ts-7000] ts-7300 framebuffer for linux kernel 2.6

To:
Subject: Re: [ts-7000] ts-7300 framebuffer for linux kernel 2.6
From: Eddie Dawydiuk <>
Date: Fri, 30 Nov 2007 09:23:03 -0700
Hello,

> I have written a framebuffer device driver for kernel 2.6.21-ts. It
> works fine (tested with embedded qt and other programs which use the 
> framebuffer device) but the big problem is that I have to pass the 
> screen resolution as a parameter. At 
> http://tech.groups.yahoo.com/group/ts-7000/message/6327 I saw that the 
> TS driver for kernel version 2.4 can automatically detect the screen 
> resolution. How can this be done?
> I would also like to know how can I load my own firmware. Are there any 
> sources?

The bit blit functionality is implemented in the firmware. So the bit 
blit knows what the resolution of the screen. In order to determine the 
screen resolution you can write 0xFF to the first two rows, then bit 
blit a rectangle 2 pixels tall by 1 pixel wide of color 0x0. Then start 
looking for the offset of the second pixel that is 0x0. This would give 
you the width of the screen. We assume the aspect ratio is 4:3, and 
calculate the video height. Below is the routine to accomplish this in 
the 2.4 framebuffer driver...

/* Use a bit blit to determine the screen resolution, assumes 4:3 aspect 
ratio*/
int detect_screen_width()
{
         unsigned int i=0, found = 0;
         unsigned short *mem = (unsigned short *) fb_info.fb_virt_start;

         ts7300_blt(0xFFFF, 0, MAX_WIDTH-1, 2, 1);
         ts7300_blt(0, 0, 1-1, 2, 1);

         for(i=0;i<(MAX_WIDTH*2);i++) {
                 if(mem[i] == 0x0) found++;
                 if(found == 2) break;
         }

         if(found != 2) {
                 printk("Framebuffer doesn't support this video core\n");
                 return 0;
         } else { //Assumes a 4:3 aspect ratio
                 fb_info.xres=i;
                 fb_info.yres=i*3/4;
                 printk("Detected %dx%d video core\n",
                   fb_info.xres, fb_info.yres);
         }

         return 1;
}

-- 
Best Regards,
________________________________________________________________
  Eddie Dawydiuk, Technologic Systems | voice:  (480) 837-5200
  16610 East Laser Drive Suite 10     | fax:    (480) 837-5300
  Fountain Hills, AZ 85268            | web: www.embeddedARM.com


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU