diff options
author | Trent Piepho <xyzzy@speakeasy.org> | 2009-03-10 19:28:16 -0700 |
---|---|---|
committer | Trent Piepho <xyzzy@speakeasy.org> | 2009-03-10 19:28:16 -0700 |
commit | 446d4199a156728c0a046418719b2f3a0645ad84 (patch) | |
tree | 031379f345df3039f3957ca113f76c855e4b9764 /linux/drivers/media/video/saa7191.c | |
parent | 9cdf820ab3b93d84c0cce39e8748aaeee12a7327 (diff) | |
download | mediapointer-dvb-s2-446d4199a156728c0a046418719b2f3a0645ad84.tar.gz mediapointer-dvb-s2-446d4199a156728c0a046418719b2f3a0645ad84.tar.bz2 |
zoran: Unify buffer descriptors
From: Trent Piepho <xyzzy@speakeasy.org>
The zoran driver had two kinds of buffer descriptors, one for jpg buffers
and one for raw buffers. They were mostly the same with only a couple
different fields. A file handle had two sets of descriptors even though
only one could be in use at once.
I've combined the two kinds into a single buffer descriptor that has the
different parts in a union. Each file handle (struct zoran_fh) now only
has one set of buffers. The device itself (struct zoran) still has two
since it can have both raw and jpg buffers in use at the same time.
Along the way, I re-wrapped many lines that were ugly.
Some code which was duplicated for both raw and jpg buffers is now merged.
The code to setup buffers in zoran_open_init_session() can be merged, as
can the code to delete the buffers in zoran_close_end_session(). Lots of
code in zoran_vm_close() and zoran_mmap() is merged as well.
Since there is now only one set of buffer size & count fields, it's
important they get set correctly when changing modes. So I created helper
functions to change fh->map_mode which also set the buffer size & count to
the proper values.
jpg_sync() should only be called in jpg mode, it used to be able to tell
the difference between jpg mode active and raw mode, but now there is only
one active field.
In zoran_streamoff() the spin lock is held for the entire sequence of
operations to disable streaming.
Priority: normal
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Diffstat (limited to 'linux/drivers/media/video/saa7191.c')
0 files changed, 0 insertions, 0 deletions