From: Malluru, P. <Pur...@po...> - 2007-07-03 19:34:38
|
Thanks Brian I made those changes. I see screen getting cleared followed by some garbage on screen. I am wondering whether I am returning wrong values from video driver. In glutInit(), from a gdb session, I printed the values of FixedInfo and varInfo. They are below. (gdb) print FixedInfo=20 $1 =3D {id =3D '\0' <repeats 15 times>, smem_start =3D 0, smem_len =3D = 7056000, type =3D 0, type_aux =3D 0, visual =3D 4, xpanstep =3D 0,=20 ypanstep =3D 0, ywrapstep =3D 0, line_length =3D 6720, mmio_start =3D = 0, mmio_len =3D 0, accel =3D 0, reserved =3D {0, 0, 0}} (gdb) print VarInfo $2 =3D {xres =3D 1280, yres =3D 720, xres_virtual =3D 1280, yres_virtual = =3D 720, xoffset =3D 0, yoffset =3D 0, bits_per_pixel =3D 32,=20 grayscale =3D 0, red =3D {offset =3D 16, length =3D 8, msb_right =3D = 0}, green =3D {offset =3D 8, length =3D 8, msb_right =3D 0}, blue =3D { offset =3D 0, length =3D 8, msb_right =3D 0}, transp =3D {offset =3D = 24, length =3D 8, msb_right =3D 0}, nonstd =3D 0, activate =3D 0,=20 height =3D 0, width =3D 0, accel_flags =3D 0, pixclock =3D 0, = left_margin =3D 0, right_margin =3D 0, upper_margin =3D 0, lower_margin =3D 0,=20 hsync_len =3D 0, vsync_len =3D 0, sync =3D 0, vmode =3D 0, rotate =3D = 0, reserved =3D {0, 0, 0, 0, 0}} (gdb) The Frame buffer size is 1680x1050, but I am trying to use it as 1280x720 type frame buffer. Is there any test program to test glFbDev type builds instead of reverse enginnering like what I am doing? I am using Mesa 6.5.2 code base. -----Original Message----- From: Brian Paul [mailto:bri...@tu...]=20 Sent: Tuesday, July 03, 2007 11:40 AM To: Malluru, Puri Cc: mes...@li... Subject: Re: [Mesa3d-users] Looking for help with glFbDev flavor of Mesa Malluru, Puri wrote: > Hi >=20 > I am new to Opengl. I am trying to run couple of sample programs from=20 > Mesa3d progs/redbook folder on our embedded platform. Our codec runs on=20 > PowerPC platform (Freescale e300 core) with embedded Linux as OS. We=20 > don't have any graphics chip on the board. So I cross compiled Mesa3d=20 > glFbdev flavor for this platform. I changed our graphics driver to=20 > return the values that OpenGL code is expecting(like bits per pixel, max=20 > width and height etc). I am able to run model app from progs/redbook.=20 > But I don't see anything on screen. >=20 > The way the video driver works, after writing to framebuffer, we need to=20 > do a write() call with the coordinates of the dirty rect. Then the video=20 > driver copies the corresponding area of the framebuffer over PCI bus to=20 > FPGA memory which then gets displayed on screen. >=20 > =20 >=20 > What is the right place to do this? >=20 > Do I need to provide some special ioctl() so that Mesa3d does this=20 > standard way? >=20 > When I attached to the process in gdb and step into glFlush() call, I=20 > see that Flush() function pointer is NULL. I don't know whether that is=20 > expected for glFbdev type devices. You'll need to add a new flush/finish() function in glfbdev.c and hook=20 it into the driver function table: static void flush_finish(GLcontext *ctx) { // write(dirty rect) here Mesa doesn't do any dirty rect tracking so you'll have to set the dirty rect to the whole framebuffer size. } In glFBDevCreateContext(), after _mesa_init_driver_functions(), plug in=20 the function with: functions.Flush =3D flush_finish; functions.Finish =3D flush_finish; In glFBDevSwapBuffers() you'll also want to call the flush_finish()=20 function. -Brian |