It seems you have the same pb as I had.
First of all, install the graphics DDK (http://betas.qnx.com/ddk/repository)
Then do as told in the readme : copy the whole sources to a place where you
can edit them.
After that edit the file :
${root_dir}/ddk-6.1.0/graphics/src/hardware/devg/chips_hiqv/mode.c:
In hiqv_ms_get_modelist()
change the whole code to
{
uint16_t VModes[DISP_MAX_MODES + 1];
int i, j=0;
VESAInfoBlockStruct VIB;
VESAModeInfoStruct VMI;
if (dispno != 0)
return -1;
// this is a 640x480 mode with 256 colors
list[0] = 0x4101; // mode VESA 0x101 = mode VGA 0x70, with 0x4000 for
internal consistency
list[1] = DISP_MODE_LISTEND;
return 0;
}
in hiqv_ms_get_modeinfo():
change the code to
{
hiqv_context_t *h_ctx=adp->ms_ctx;
VESAModeInfoStruct vmode;
VESAInfoBlockStruct VIB;
DISP_ASSERT(dispno == 0);
memset(info, 0, sizeof (*info));
vga_enter(adp);
info->size = sizeof (*info);
info->mode = mode;
info->xres = 640;
info->yres = 480;
/* Linear frame buffer properties */
info->fb_addr = 0x80000000; // put here the base address of you video board
memory
info->fb_stride = 640 x 1; // 640 x nb of bytes for color
info->fb_size = 0x20 * 0x10000; // the size of your video memory
info->pixel_format = DISP_SURFACE_FORMAT_PAL8;
info->caps = DISP_MCAP_SET_DISPLAY_OFFSET | DISP_MCAP_VIRTUAL_PANNING;
info->crtc_pitch_gran = 16;
info->crtc_start_gran = 1; // bytes per pixel
info->max_virtual_width = 2048;
info->max_virtual_height = 1600;
info->u.fixed.refresh[0] = 60; /* More than likely if not VESA 3 */
info->u.fixed.refresh[1] = 0;
vga_leave(adp);
return 0;
}
set_mode()
{
vbios_regs_t regs;
int rc=0;
memset(®s, 0, sizeof regs);
if (mode != 0x4101)
{
return (-1);
}
else
{
vga_enter(h_ctx->adapter);
disp_printf(h_ctx->adapter,“On vient d’entrer\n”);
regs.eax = 0x70;
if (vbios_int(h_ctx->adapter->vbios, 0x10, ®s, 0) == -1)
{
disp_printf(h_ctx->adapter,“L’appel au bios video s’est plante\n”);
vga_leave(h_ctx->adapter);
return (-1);
}
}
out8(0x3D6, 0x20);
// Set BitBlt bpp format.
switch(h_ctx->cur_mode_fmt)
{
case DISP_SURFACE_FORMAT_PAL8:
out8(0x3D7, 0);
break;
case DISP_SURFACE_FORMAT_ARGB1555:
out8(0x3D7, 0x10);
break;
case DISP_SURFACE_FORMAT_RGB565:
out8(0x3D7, 0x10);
break;
case DISP_SURFACE_FORMAT_RGB888:
disp_printf(h_ctx->adapter,“Tout va bien\n”);
out8(0x3D7, 0x20);
break;
default :
disp_printf(h_ctx->adapter,“Format not supported\n”);
rc=-1;
goto done;
break;
}
out8(0x3D4,0x13);
out8(0x3D5,(h_ctx->cur_mode_stride/8)&0xff);
out8(0x3d4,0x41);
out8(0x3d5,((h_ctx->cur_mode_stride/8) & 0xf00)>>8);
vga_leave(h_ctx->adapter);
return rc;
}
Then edit the file
${root_dir}/ddk-6.1.0/graphics/src/hardware/devg/chips_hiqv/init.c
in hiqv_init() :
{
hiqv_context_t *h_ctx=NULL;
vbios_regs_t regs;
VESAInfoBlockStruct *VIPtr;
uint32_t memphys,temp2;
unsigned char temp;
int hsize=0,vsize=0;
uint8_t *rom;
if (vbios_register(adp, 0) == -1)
goto fail;
/* Register with the display utility lib */
if (disp_register_adapter(adp) == -1)
goto fail;
/*
- Grab ownership of the legacy VGA hardware before activating
- the device.
*/
if (disp_acquire_vga_resources(adp) == -1)
goto fail;
if (disp_pci_init(adp, DISP_PCI_INIT_BASES | DISP_PCI_INIT_ROM)
== -1)
disp_printf(adp,"\nPCI init failed");
if ((rom = disp_get_rom_image(adp, 0, NULL, 0, 0)) != NULL) {
disp_warm_boot(adp, rom);
free(rom);
}
// Setup the mode switchers private contexts.
h_ctx = adp->gd_ctx = adp->ms_ctx = malloc(sizeof (hiqv_context_t));
if(h_ctx ==NULL)
goto fail;
memset(h_ctx, 0, sizeof (*h_ctx));
h_ctx->adapter = adp;
h_ctx->vbios = adp->vbios;
VIPtr = (void *)adp->vbios->xfer_area_ptr;
memphys = 0x80000000; // base adress of your video boeard memory
// Map registers.
h_ctx->regbase = disp_mmap_device_memory(memphys+0x400000, 0x40,
PROT_READ|PROT_WRITE|PROT_NOCACHE, 0);
// 64K gateway to display memory from CPU.
h_ctx->bltbase = disp_mmap_device_memory(memphys+0x410000, 0x10000,
PROT_WRITE|PROT_NOCACHE, 0);
// Any mappings failed?
if (h_ctx->regbase != NULL && h_ctx->bltbase != NULL)
{ // Get address of linear aperture.
h_ctx->vidbase = memphys;
h_ctx->vidsize = adp->adapter_ram = 0x200000; // video memory size
// h_ctx->vidptr is initialised in mode.c setmode() as we don’t have
// the required information here.
h_ctx->usable_ram[0].byte_offset = 0;
h_ctx->usable_ram[0].byte_length = adp->adapter_ram;
adp->caps = (DISP_CAP_2D_ACCEL|DISP_CAP_MULTI_MONITOR_SAFE);
if(optstring != NULL) {
if(!(strcmp(optstring,“CRT”)))
h_ctx->fix_panel = 1;
else
h_ctx->fix_panel = 0;
}
disp_device_active(adp, 0, 1);
disp_release_vga_resources(adp);
// Initialisation successfull(Max one display controller supported).
return 1;
}
fail:
// Initialisation failed.
disp_release_vga_resources(adp);
disp_unregister_adapter(adp);
free(h_ctx);
return -1;
}
}
And thats all (at least that was for me!).
I hope this will help you. Beware to change the base adress and video memory
size (I already changed what was needed for your 8bit color depth, you will
run in vga mode 0x70).
Have a look at the original files, it’ll help to understand.
Good luck,
Didier.
“Richard.Bebbington” <electric.mini@ntlworld.com> a écrit dans le message de
news: 3C152BC0.2080902@ntlworld.com…
Hi Didier,
I only need one mode, 640 x 480 with at least 256 colours
( I have a 640 x 480 LCD panel attached ).
As far as I can tell, the board’s BIOS does support VGA, even SVGA
and XGA, but there’s no mention of VESA.
I’ll try the revised command line Erick posted first, and see if that
sorts it out…
Thanks,
–
Richard Bebbington
Electric Mini pickup
http:/homepage.ntlworld.com/electric.mini/