overlay support

5 messages, 3 authors, 2006-09-12 · open the first message on its own page

overlay support

From: Jorge Luis Zapata Muga <hidden>
Date: 2006-09-12 13:27:03

hi all,

i coded a while ago a framebuffer driver for an old video card i have
(a SiS 6326, just for learning) but now i would like to support its
video extension (overlay support, this card can also capture from an
external input, but my version doesnt has the input connectors). ive
read on the mailing list and on external projects about how to support
overlay on the fb device, but i still dont find a good way to do it,
maybe you can help me out.

one way is to add another fb device, but it is good only if the device
has a different memory space assigned to it, if you only have a chunk
of memory for both layers (the overlay and the normal rgb which is
this case) there should be a way to resize the memory space assigned
to each of them. i dont like this way because is adding a policy on
kernel space to manage the memory. am i correct with this assumptions?

another way is to support a video4linux device (overlay type) for it,
in this case there are other problems too. does the v4l device should
be dependant to the fb device? i mean, make the fb device map all the
display memory and support the common mmap, then the v4l has to
receive the fb mem pointer to setup the registers, and finally from
userspace open both devices to actually support overlaying?

is there other solution?

thanks for your comments.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

Re: overlay support

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: 2006-09-12 13:34:40

On Tue, 12 Sep 2006, Jorge Luis Zapata Muga wrote:
i coded a while ago a framebuffer driver for an old video card i have
(a SiS 6326, just for learning) but now i would like to support its
video extension (overlay support, this card can also capture from an
external input, but my version doesnt has the input connectors). ive
read on the mailing list and on external projects about how to support
overlay on the fb device, but i still dont find a good way to do it,
maybe you can help me out.

one way is to add another fb device, but it is good only if the device
has a different memory space assigned to it, if you only have a chunk
of memory for both layers (the overlay and the normal rgb which is
this case) there should be a way to resize the memory space assigned
to each of them. i dont like this way because is adding a policy on
kernel space to manage the memory. am i correct with this assumptions?
If there are just 2 users of the memory (i.e. 2 frame buffers), you can avoid
adding a policy to the kernel by making the split dynamic.
Let the first frame buffer `allocate' (based on xres_virtual, yres_virtual, and
bits_per_pixel) from the bottom of memory, and the second frame buffer from the
top of memory. Each frame buffer can shrink whatever it wants, or grow, as long
as it doesn't conflict with the memory size of the other.

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

Re: overlay support

From: Jorge Luis Zapata Muga <hidden>
Date: 2006-09-12 13:55:54

On 9/12/06, Geert Uytterhoeven [off-list ref] wrote:
On Tue, 12 Sep 2006, Jorge Luis Zapata Muga wrote:
quoted
i coded a while ago a framebuffer driver for an old video card i have
(a SiS 6326, just for learning) but now i would like to support its
video extension (overlay support, this card can also capture from an
external input, but my version doesnt has the input connectors). ive
read on the mailing list and on external projects about how to support
overlay on the fb device, but i still dont find a good way to do it,
maybe you can help me out.

one way is to add another fb device, but it is good only if the device
has a different memory space assigned to it, if you only have a chunk
of memory for both layers (the overlay and the normal rgb which is
this case) there should be a way to resize the memory space assigned
to each of them. i dont like this way because is adding a policy on
kernel space to manage the memory. am i correct with this assumptions?
If there are just 2 users of the memory (i.e. 2 frame buffers), you can avoid
adding a policy to the kernel by making the split dynamic.
Let the first frame buffer `allocate' (based on xres_virtual, yres_virtual, and
bits_per_pixel) from the bottom of memory, and the second frame buffer from the
top of memory. Each frame buffer can shrink whatever it wants, or grow, as long
as it doesn't conflict with the memory size of the other.
indeed, this is another solution, but what happens if the requested
size of the framebuffer will overlap the other framebuffer memory
space? wouldnt be better to manage the framebuffer memory from
userspace and use the v4l interface for the overlay?
Gr{oetje,eeting}s,

                                                Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                                            -- Linus Torvalds

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Linux-fbdev-devel mailing list
Linux-fbdev-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-fbdev-devel
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

Re: overlay support

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: 2006-09-12 14:02:26

On Tue, 12 Sep 2006, Jorge Luis Zapata Muga wrote:
On 9/12/06, Geert Uytterhoeven [off-list ref] wrote:
quoted
On Tue, 12 Sep 2006, Jorge Luis Zapata Muga wrote:
quoted
i coded a while ago a framebuffer driver for an old video card i have
(a SiS 6326, just for learning) but now i would like to support its
video extension (overlay support, this card can also capture from an
external input, but my version doesnt has the input connectors). ive
read on the mailing list and on external projects about how to support
overlay on the fb device, but i still dont find a good way to do it,
maybe you can help me out.

one way is to add another fb device, but it is good only if the device
has a different memory space assigned to it, if you only have a chunk
of memory for both layers (the overlay and the normal rgb which is
this case) there should be a way to resize the memory space assigned
to each of them. i dont like this way because is adding a policy on
kernel space to manage the memory. am i correct with this assumptions?
If there are just 2 users of the memory (i.e. 2 frame buffers), you can avoid
adding a policy to the kernel by making the split dynamic.
Let the first frame buffer `allocate' (based on xres_virtual, yres_virtual, and
bits_per_pixel) from the bottom of memory, and the second frame buffer from the
top of memory. Each frame buffer can shrink whatever it wants, or grow, as long
as it doesn't conflict with the memory size of the other.
indeed, this is another solution, but what happens if the requested
size of the framebuffer will overlap the other framebuffer memory
space? wouldnt be better to manage the framebuffer memory from
userspace and use the v4l interface for the overlay?
In that case, fb_ops.fb_check_var() should return an error.

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

Re: overlay support

From: Raphael Assenat <hidden>
Date: 2006-09-12 14:48:15

Geert Uytterhoeven wrote:
On Tue, 12 Sep 2006, Jorge Luis Zapata Muga wrote:
quoted
i coded a while ago a framebuffer driver for an old video card i have
(a SiS 6326, just for learning) but now i would like to support its
video extension (overlay support, this card can also capture from an
external input, but my version doesnt has the input connectors). ive
read on the mailing list and on external projects about how to support
overlay on the fb device, but i still dont find a good way to do it,
maybe you can help me out.

one way is to add another fb device, but it is good only if the device
has a different memory space assigned to it, if you only have a chunk
of memory for both layers (the overlay and the normal rgb which is
this case) there should be a way to resize the memory space assigned
to each of them. i dont like this way because is adding a policy on
kernel space to manage the memory. am i correct with this assumptions?

If there are just 2 users of the memory (i.e. 2 frame buffers), you can avoid
adding a policy to the kernel by making the split dynamic.
Let the first frame buffer `allocate' (based on xres_virtual, yres_virtual, and
bits_per_pixel) from the bottom of memory, and the second frame buffer from the
top of memory. Each frame buffer can shrink whatever it wants, or grow, as long
as it doesn't conflict with the memory size of the other.
How about creating an ioctl specific to this device, which could be used to pass a
struct to the driver containing information such as size, position, pixel format, overlay 
memory address(es), plane(s) stride? With this approach, the userspace application decides 
where to place the overlay in memory based on it's knowledge of it's regular framebuffer 
memory usage. If both areas conflict, it's the userspace app fault and corruption appears 
on the screen.

That's the approach I use in the mbxfb driver. (see [PATCH 4/5] mbxfb: Add YUV video 
overlay suport).

If many drivers were to implement overlays this way, we could create a new framebuffer 
ioctl for this purpose and remove the need for driver specific ioctls.

Best regards,
Raphael Assenat

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help