Eddie Dawydiuk wrote:
> 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;
> }
>
Thank you very much for your reply, I haven't thought of this method.
How about the second question? Could you give me some information on how
to load the firmware from inside the driver? I'm thinking of using the
request_firmware() interface so I can load any firmware on demand but I
want to know how to send it to the FPGA.
Fotis
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/
|