VERSION = 2
PATCHLEVEL = 4
SUBLEVEL = 5
-EXTRAVERSION =-pre6
+EXTRAVERSION =
KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
fi
fi
-# The machine must be able to support more than 8GB physical memory
-# before large vmalloc might even pretend to be an issue.
-if [ "$CONFIG_ALPHA_GENERIC" = "y" -o "$CONFIG_ALPHA_DP264" = "y" \
- -o "$CONFIG_ALPHA_WILDFIRE" = "y" -o "$CONFIG_ALPHA_TITAN" = "y" ]
-then
- bool 'Large VMALLOC support' CONFIG_ALPHA_LARGE_VMALLOC
-else
- define_bool CONFIG_ALPHA_LARGE_VMALLOC n
-fi
+# LARGE_VMALLOC is racy, if you *really* need it then fix it first
+define_bool CONFIG_ALPHA_LARGE_VMALLOC n
source drivers/pci/Config.in
EXPORT_SYMBOL(write_lock);
EXPORT_SYMBOL(read_lock);
#endif
+EXPORT_SYMBOL(cpu_present_mask);
#endif /* CONFIG_SMP */
EXPORT_SYMBOL(rtc_lock);
EXPORT_SYMBOL_NOVERS(__remqu);
EXPORT_SYMBOL_NOVERS(memcpy);
EXPORT_SYMBOL_NOVERS(memset);
+EXPORT_SYMBOL_NOVERS(memchr);
EXPORT_SYMBOL(get_wchan);
{
spinlock_t lock;
struct pci_controller *hose;
+#define IOMMU_INVALID_PTE 0x2 /* 32:63 bits MBZ */
unsigned long *ptes;
dma_addr_t dma_base;
unsigned int size;
return (bytes + PAGE_SIZE - 1) >> PAGE_SHIFT;
}
\f
+static void __init
+iommu_arena_fixup(struct pci_iommu_arena * arena)
+{
+ unsigned long base, size;
+
+ /*
+ * The Cypress chip has a quirk, it get confused by addresses
+ * above -1M so reserve the pagetables that maps pci addresses
+ * above -1M.
+ */
+ base = arena->dma_base;
+ size = arena->size;
+ if (base + size > 0xfff00000) {
+ int i = (0xfff00000 - base) >> PAGE_SHIFT;
+ for (; i < (0x100000 >> PAGE_SHIFT); i++)
+ arena->ptes[i] = IOMMU_INVALID_PTE;
+ }
+}
+
struct pci_iommu_arena *
iommu_arena_new(struct pci_controller *hose, dma_addr_t base,
unsigned long window_size, unsigned long align)
unless there are chip bugs. */
arena->align_entry = 1;
+ iommu_arena_fixup(arena);
+
return arena;
}
}
}
- /* Success. Mark them all in use, ie not zero. Typically
- bit zero is the valid bit, so write ~1 into everything.
+ /* Success. Mark them all in use, ie not zero and invalid
+ for the iommu tlb that could load them from under us.
The chip specific bits will fill this in with something
kosher when we return. */
for (i = 0; i < n; ++i)
- ptes[p+i] = ~1UL;
+ ptes[p+i] = IOMMU_INVALID_PTE;
arena->next_entry = p + n;
spin_unlock_irqrestore(&arena->lock, flags);
#include <linux/pci.h>
#include <linux/init.h>
+#define __EXTERN_INLINE inline
+#include <asm/io.h>
+#include <asm/core_tsunami.h>
+#undef __EXTERN_INLINE
+
#include <asm/ptrace.h>
#include <asm/system.h>
#include <asm/dma.h>
#include <asm/irq.h>
#include <asm/bitops.h>
#include <asm/mmu_context.h>
-#include <asm/io.h>
#include <asm/pgtable.h>
-#include <asm/core_tsunami.h>
#include <asm/hwrpb.h>
#include "proto.h"
void __init setup_arch(char **cmdline_p)
{
- unsigned long bootmap_size;
+ unsigned long bootmap_size, low_mem_size;
unsigned long start_pfn, max_pfn, max_low_pfn;
int i;
request_resource(&ioport_resource, standard_io_resources+i);
/* Tell the PCI layer not to allocate too close to the RAM area.. */
- pci_mem_start = ((max_low_pfn << PAGE_SHIFT) + 0xfffff) & ~0xfffff;
+ low_mem_size = ((max_low_pfn << PAGE_SHIFT) + 0xfffff) & ~0xfffff;
+ if (low_mem_size > pci_mem_start)
+ pci_mem_start = low_mem_size;
#ifdef CONFIG_VT
#if defined(CONFIG_VGA_CONSOLE)
static struct board_features_t {
char* compatible;
u32 features;
-} board_features_datas[] __init =
+} board_features_datas[] __initdata =
{
{ "AAPL,PowerMac G3", 0 }, /* Beige G3 */
{ "iMac,1", 0 }, /* First iMac (gossamer) */
int ide_cdrom_open (struct inode *ip, struct file *fp, ide_drive_t *drive)
{
struct cdrom_info *info = drive->driver_data;
- int rc;
+ int rc = -ENOMEM;
MOD_INC_USE_COUNT;
if (info->buffer == NULL)
info->buffer = (char *) kmalloc(SECTOR_BUFFER_SIZE, GFP_KERNEL);
- if ((rc = cdrom_fops.open(ip, fp))) {
+ if ((info->buffer == NULL) || (rc = cdrom_fops.open(ip, fp))) {
drive->usage--;
MOD_DEC_USE_COUNT;
}
continue;
}
mddev = alloc_mddev(MKDEV(MD_MAJOR,minor));
+ if (mddev == NULL) {
+ printk("md: kmalloc failed - cannot start array %d\n", minor);
+ continue;
+ }
if (md_setup_args.pers[minor]) {
/* non-persistent */
mdu_array_info_t ainfo;
*/
dev->base_addr += 0x10;
- ret = tmsdev_init(dev,0,pdev);
- /* XXX: should be the max PCI32 DMA max */
+ ret = tmsdev_init(dev, PCI_MAX_ADDRESS, pdev);
if (ret) {
printk("%s: unable to get memory for dev->priv.\n",
dev->name);
printk(":%2.2x", dev->dev_addr[i]);
printk("\n");
+ /* XXX is ISA_MAX_ADDRESS correct here? */
if (tmsdev_init(dev, ISA_MAX_ADDRESS, NULL)) {
printk("%s: unable to get memory for dev->priv.\n",
dev->name);
* fragments following.
*/
+/* XXX is there some better way to do this? */
#define ISA_MAX_ADDRESS 0x00ffffff
+#define PCI_MAX_ADDRESS 0xffffffff
#pragma pack(1)
typedef struct {
printk(":%2.2x", dev->dev_addr[i]);
printk("\n");
- ret = tmsdev_init(dev,0, pdev);
- /* XXX: should be the max PCI32 DMA max */
+ ret = tmsdev_init(dev, PCI_MAX_ADDRESS, pdev);
if (ret) {
printk("%s: unable to get memory for dev->priv.\n", dev->name);
goto err_out_irq;
dev->stop = tms380tr_close;
ret = register_trdev(dev);
- if (!ret)
+ if (ret)
goto err_out_tmsdev;
pci_set_drvdata(pdev, dev);
usbcore-objs := usb.o usb-debug.o hub.o
ifneq ($(CONFIG_USB_PWC),n)
- # By default we use the C colour conversion functions unless we
- # detect an Intel CPU, for which there is assembly available
- ccvt-objs := ccvt_c.o vcvt_c.o
- ifeq ($(CONFIG_X86),y)
- ccvt-objs := ccvt_i386.o vcvt_i386.o
- endif
-
export-objs += pwc-uncompress.o
list-multi += pwc.o
endif
-pwc-objs := pwc-if.o pwc-misc.o pwc-ctrl.o pwc-uncompress.o $(ccvt-objs)
+pwc-objs := pwc-if.o pwc-misc.o pwc-ctrl.o pwc-uncompress.o
# Optional parts of multipart objects.
+++ /dev/null
-/*
- (C) 2000 Nemosoft Unv. nemosoft@smcc.demon.nl
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-*/
-
-#ifndef CCVT_H
-#define CCVT_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Colour ConVerT: going from one colour space to another
-
- Format descriptions:
- 420i = "4:2:0 interlaced"
- YYYY UU YYYY UU even lines
- YYYY VV YYYY VV odd lines
- U/V data is subsampled by 2 both in horizontal
- and vertical directions, and intermixed with the Y values.
-
- 420p = "4:2:0 planar"
- YYYYYYYY N lines
- UUUU N/2 lines
- VVVV N/2 lines
- U/V is again subsampled, but all the Ys, Us and Vs are placed
- together in separate buffers. The buffers may be placed in
- one piece of contiguous memory though, with Y buffer first,
- followed by U, followed by V.
-
- yuyv = "4:2:2 interlaced"
- YUYV YUYV YUYV ... N lines
- The U/V data is subsampled by 2 in horizontal direction only.
-
- bgr24 = 3 bytes per pixel, in the order Blue Green Red (whoever came up
- with that idea...)
- rgb24 = 3 bytes per pixel, in the order Red Green Blue (which is sensible)
- rgb32 = 4 bytes per pixel, in the order Red Green Blue Alpha, with
- Alpha really being a filler byte (0)
- bgr32 = last but not least, 4 bytes per pixel, in the order Blue Green Red
- Alpha, Alpha again a filler byte (0)
- */
-
-/* Functions in ccvt_i386.S/ccvt_c.c */
-/* 4:2:0 YUV interlaced to RGB/BGR */
-void ccvt_420i_bgr24(int width, int height, void *src, void *dst);
-void ccvt_420i_rgb24(int width, int height, void *src, void *dst);
-void ccvt_420i_bgr32(int width, int height, void *src, void *dst);
-void ccvt_420i_rgb32(int width, int height, void *src, void *dst);
-
-/* 4:2:2 YUYV interlaced to RGB/BGR */
-void ccvt_yuyv_rgb32(int width, int height, void *src, void *dst);
-void ccvt_yuyv_bgr32(int width, int height, void *src, void *dst);
-
-/* 4:2:0 YUV planar to RGB/BGR */
-void ccvt_420p_rgb32(int width, int height, void *srcy, void *srcu, void *srcv, void *dst);
-void ccvt_420p_bgr32(int width, int height, void *srcy, void *srcu, void *srcv, void *dst);
-
-/* RGB/BGR to 4:2:0 YUV interlaced */
-
-/* RGB/BGR to 4:2:0 YUV planar */
-void ccvt_rgb24_420p(int width, int height, void *src, void *dsty, void *dstu, void *dstv);
-void ccvt_bgr24_420p(int width, int height, void *src, void *dsty, void *dstu, void *dstv);
-
-/* Go from 420i to other yuv formats */
-void ccvt_420i_420p(int width, int height, void *src, void *dsty, void *dstu, void *dstv);
-void ccvt_420i_yuyv(int width, int height, void *src, void *dst);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
+++ /dev/null
-/*
- Colour conversion routines (RGB <-> YUV) in plain C
- (C) 2000-2001 Nemosoft Unv. nemosoft@smcc.demon.nl
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-
-#include "ccvt.h"
-#include "vcvt.h"
-
-/* We use the viewport routines, with a viewport width that is exactly
- the same as the image width. The overhead for computing the view/image
- offsets is very small anyway.
-
- The assembly routines are still different, since they are quite optimized.
- */
-void ccvt_420i_rgb24(int width, int height, void *src, void *dst)
-{
- vcvt_420i_rgb24(width, height, width, src, dst);
-}
-
-void ccvt_420i_bgr24(int width, int height, void *src, void *dst)
-{
- vcvt_420i_bgr24(width, height, width, src, dst);
-}
-
-void ccvt_420i_rgb32(int width, int height, void *src, void *dst)
-{
- vcvt_420i_rgb32(width, height, width, src, dst);
-}
-
-void ccvt_420i_bgr32(int width, int height, void *src, void *dst)
-{
- vcvt_420i_bgr32(width, height, width, src, dst);
-}
-
-
-void ccvt_420i_420p(int width, int height, void *src, void *dsty, void *dstu, void *dstv)
-{
- vcvt_420i_420p(width, height, width, src, dsty, dstu, dstv);
-}
-
-void ccvt_420i_yuyv(int width, int height, void *src, void *dst)
-{
- vcvt_420i_yuyv(width, height, width, src, dst);
-}
+++ /dev/null
-/*
-Colour conversion routines (RGB <-> YUV) in x86 assembly
-
-(C) 2000 Nemosoft Unv. nemosoft@smcc.demon.nl
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-*/
-
-
-/* The ccvt_* functions always start with width and height, so these
- parameters are in 8(%ebp) and 12 (%ebp). The other parameters can be
- 2 to 4 pointers, and one of these combinations:
- *src, *dst
- *srcy, *srcu, *srv, *dst
- *src, *dsty, *dstu, *dstv
- */
-
-#define __ASSEMBLY__
-#include <linux/linkage.h>
-
-#define Width 8(%ebp)
-#define Height 12(%ebp)
-
-/* 2 parameters, 1 in, 1 out */
-#define Src2 16(%ebp)
-#define Dst2 20(%ebp)
-
-/* 4 parameters, 3 in, 1 out */
-#define SrcY 16(%ebp)
-#define SrcU 20(%ebp)
-#define SrcV 24(%ebp)
-#define Dst4 28(%ebp)
-
-/* 4 parameters, 1 in, 3 out */
-#define Src4 16(%ebp)
-#define DstY 20(%ebp)
-#define DstU 24(%ebp)
-#define DstV 28(%ebp)
-
-/* This buffer space used to be staticly allocted, but this is going to
- give problems with multiple cams (though I have yet to see it).
- Therefor, we reserve at least 64 + 8 = 72 bytes on the stack with
- `enter'.
- */
-
-#define PixelBuffer -64(%ebp)
-#define Uptr -68(%ebp)
-#define Vptr -72(%ebp)
-
- .text
-
-/* This function will load the src and destination pointers, including
- Uptr/Vptr when necessary, and test the width/height parameters.
- - %esi will be set to Src or SrcY
- - %edi will be set to Dst or DstY
- the carry flag will be set if any of these tests fail.
- It assumes %ebp has been set.
- */
-/* 2 parameters, src & dst */
-test_param_2:
- mov Src2, %esi
- mov Dst2, %edi
-
- cmp $0, %esi # NULL pointers?
- je param_fail
- cmp $0, %edi
- je param_fail
-
- jmp test_width_height
-
-/* 3 inputs, 1 output */
-test_param_31:
- mov Dst4, %edi # NULL pointers
- cmp $0, %edi
- je param_fail
-
- mov SrcV, %esi
- cmp $0, %esi
- je param_fail
- mov %esi, Vptr
-
- mov SrcU, %esi
- cmp $0, %esi
- je param_fail
- mov %esi, Uptr
-
- mov SrcY, %esi
- cmp $0, %esi
- je param_fail
-
- jmp test_width_height
-
-/* 1 input, 3 output */
-test_param_13:
- mov Src4, %esi # NULL pointers
- cmp $0, %esi
- je param_fail
-
- mov DstV, %edi
- cmp $0, %edi
- je param_fail
- mov %edi, Vptr
-
- mov DstU, %edi
- cmp $0, %edi
- je param_fail
- mov %edi, Uptr
-
- mov DstY, %edi
- cmp $0, %edi
- je param_fail
-
- jmp test_width_height
-
- nop
-
-test_width_height:
- cmpl $0, Width
- jbe param_fail
- testl $3, Width # multiple of 4?
- jnz param_fail # Nope...
-
- cmp $0, Height # check illegal height
- jbe param_fail
- testl $1, Height # Odd no. of lines?
- jnz param_fail # Aye
-
- /* fall through */
-
-/* exit points */
-param_ok:
- clc # Success: clear carry
- ret
-
-param_fail:
- stc # Fail: set carry
- ret
-
-
-
-# This will fill PixelBuffer with 4 grey scale pixels (Y)
-# In: %eax = Value (Y3Y2Y1Y0)
-# Out:
-# Modifies: %ecx (-4)
-# Destroys: %edx
-expand_4_y:
- mov %eax, %edx # Keep in edx (we need eax)
- lea PixelBuffer, %edi
-
-0: # This code is executed 4 times
- movzbl %dl, %eax # move, zero extending byte-to-long
- shl $8, %eax # 8 digit precision
-
- stosl # Expand into PixelBuffer
- stosl
- stosl
- add $4, %edi # Skip alpha
-
- shr $8, %edx # next Y
-
- dec %ecx
- test $3, %ecx
- jnz 0b
-
- ret # from expand_4_y
-
-# This will add the color factors to the (grey) values in PixelBuffer
-# In: %ebx (U1U0V1V0)
-# Out:
-# Modifies:
-# Destroys: %edi, %ebx, %eax, %edx
-expand_4_uv:
- lea PixelBuffer, %edi # reset pointer
-
- # V0
- sub $128, %bl
- movsbl %bl, %eax
- mov $359, %edx # Vr
- mul %edx
- add %eax, 0x00(%edi)
- add %eax, 0x10(%edi)
-
- movsbl %bl, %eax
- mov $183, %edx # Vg
- mul %edx
- sub %eax, 0x04(%edi)
- sub %eax, 0x14(%edi)
-
- # V1
- sub $128, %bh
- movsbl %bh, %eax
- mov $359, %edx # Vr
- mul %edx
- add %eax, 0x20(%edi)
- add %eax, 0x30(%edi)
-
- movsbl %bh, %eax
- mov $183, %edx # Vg
- mul %edx
- sub %eax, 0x24(%edi)
- sub %eax, 0x34(%edi)
-
- # U0
- bswap %ebx # Get U values in lower half
- sub $128, %bh
- movsbl %bh, %eax
- mov $88, %edx # Ug
- mul %edx
- sub %eax, 0x04(%edi)
- sub %eax, 0x14(%edi)
-
- movsbl %bh, %eax
- mov $454, %edx # Ub
- mul %edx
- add %eax, 0x08(%edi)
- add %eax, 0x18(%edi)
-
- # U1
- sub $128, %bl
- movsbl %bl, %eax
- mov $88, %edx # Ug
- mul %edx
- sub %eax, 0x24(%edi)
- sub %eax, 0x34(%edi)
-
- movsbl %bl, %eax
- mov $454, %edx # Ub
- mul %edx
- add %eax, 0x28(%edi)
- add %eax, 0x38(%edi)
- ret # expand_4_uv
-
-
-/* This function expands 4 420i pixels into PixelBuffer */
-do_four_yuvi:
- push %edi
-
- lodsl # 4 bytes at a time
-
- call expand_4_y
-
- # now do UV values. on even lines, Y is followed by U values; on
- # odd lines V values follow. The U and V values are always pushed
- # on the stack in this order:
- # U V
-
- # First, calculate offset per line (1.5 * width)
- mov Width, %ebx # width
- shl %ebx # 2 *
- add Width, %ebx # 3 *
- shr %ebx # 1.5 *
-
- # even or odd lines
- testl $1, Height
- jz 2f
-
- # odd line; we are at V data, but do U data first
- neg %ebx # make ebx offset negative
- mov (%esi,%ebx),%ax # U
- push %ax
- lodsw # V
- push %ax
- jmp 3f
-
-2: # even line
- lodsw # U
- push %ax
- sub $2, %ebx
- mov (%esi,%ebx), %ax # V
- push %ax
-
-3: # Okay, so we now have the U and V values... expand into PixelBuffer
-
- pop %ebx
- call expand_4_uv
-
- pop %edi
- ret # from do_four_yuvi
-
-
-# Do four pixels, in planar format
-do_four_yuvp:
- push %edi
-
- # The first part is the same as for interlaced (4 bytes Y)
- lodsl # 4 bytes at a time
- call expand_4_y
-
- # now gather U and V values...
- mov Uptr, %ebx # Use Uptr/Vptr
- mov (%ebx), %ax
- push %ax
- add $2, %ebx
- mov %ebx, Uptr
-
- mov Vptr, %ebx
- mov (%ebx), %ax
- push %ax
- add $2, %ebx
- mov %ebx, Vptr
-
- pop %ebx
- call expand_4_uv
-
- pop %edi
- ret
-
-
-# Do four pixels, in yuyv interlaced format
-do_four_yuyv:
- push %edi
-
- lodsl # v0y1u0y0
- mov %eax, %ebx
- bswap %ebx # y0u0y1v0
- mov %bh, %ah # v0y1y1y0
- and $0x00ff00ff, %ebx # __u0__v0
- push %ax # y1y0
-
- lodsl # v1y3u1y2 # mix register instructions
- mov %eax, %edx # so CPU pipeline doesnt stall
- rol $16, %eax # u1y2v1y3
- mov %dl, %dh # v1y3y2y2
- and $0xff00ff00, %eax # u1__v1__
- mov $0, %dl # v1y3y2__
- or %eax, %ebx # u1u0v1v0
- shl $8, %edx # y3y2____
- pop %dx # y3y2y1y0
- mov %edx, %eax
- call expand_4_y
- call expand_4_uv
-
- pop %edi
- ret
-
-limit_pixels:
- # Limit all values in PixelBuffer
- push %esi
- push %edi
- push %ecx
- lea PixelBuffer, %esi
- mov %esi, %edi
- mov $16, %ecx
-0: lodsl
- cmp $0, %eax # this would have been a perfect spot for CMOVxx instructions...
- jl 2f # except they only work on Pentium Pro processors,
- cmp $0xff00, %eax # and not even all of them
- jg 3f
- add $4, %edi # no use for stosl here
- loop 0b
- jmp 9f
-2: mov $0, %eax
- stosl
- loop 0b
- jmp 9f
-3: mov $0xff00, %eax
- stosl
- loop 0b
- jmp 9f
-
-9: pop %ecx
- pop %edi
- pop %esi
- ret # from limit_pixels
-
-/* Copy RGB values from PixelBuffer into destination buffer, 4 bytes
- with alpha
- */
-
-/* Push 3 pixel (12 bytes), in correct order */
-push_rgb24:
- push %ecx
- push %esi
- lea PixelBuffer, %esi
- mov $4, %ecx
-0: lodsl
- shr $8, %eax
- mov %al, (%edi) # Red
- lodsl
- shr $8, %eax
- mov %al, 1(%edi) # Green
- lodsl
- shr $8, %eax
- mov %al, 2(%edi) # Blue
- add $3, %edi
- lodsl # dummy
- loop 0b
- pop %esi
- pop %ecx
- ret
-
-/* Push 3 pixels (12 bytes), in wrong order */
-push_bgr24:
- push %ecx
- push %esi
- lea PixelBuffer, %esi
- mov $4, %ecx
-0: lodsl
- shr $8, %eax
- mov %al, 2(%edi) # Red
- lodsl
- shr $8, %eax
- mov %al, 1(%edi) # Green
- lodsl
- shr $8, %eax
- mov %al, (%edi) # Blue
- add $3, %edi
- lodsl # dummy
- loop 0b
- pop %esi
- pop %ecx
- ret
-
-/* The simplest format: push 4 bytes, RGBa */
-push_rgb32:
- push %ecx
- push %esi
- mov $16, %ecx
- lea PixelBuffer, %esi
-0: lodsl # red
- shr $8, %eax # 8 bit precision
- stosb
- loop 0b
- pop %esi
- pop %ecx
- ret
-
-
-/* Gosh. Would you believe it. They even made this format... (Qt 2.*) */
-push_bgr32:
- # copy all 4 values to output buffer
- push %ecx
- push %esi
- mov $4, %ecx
- lea PixelBuffer, %esi
-0: lodsl # red
- shr $8, %eax # 8 bit precision
- mov %al, 2(%edi)
- lodsl # green
- shr $8, %eax
- mov %al, 1(%edi)
- lodsl # blue
- shr $8, %eax
- mov %al, (%edi)
- add $4, %edi
- lodsl # dummy
- loop 0b
- pop %esi
- pop %ecx
- ret
-
-/*************************************/
-
-/* Functions to go from YUV interlaced formats to RGB */
-
-/* Go from interlaced to RGB, red first */
-
-ENTRY(ccvt_420i_rgb24)
- enter $72, $0 # no extra space, no stackframes
- push %ebx
- push %esi
- push %edi
-
- call test_param_2
- jc 9f
-
-0: mov Width, %ecx # width
-1: call do_four_yuvi
- call limit_pixels
- call push_rgb24
-
- cmp $0, %ecx
- jnz 1b # end of line?
- decl Height # yes; decrement line counter
- jnz 0b
-
-9: pop %edi
- pop %esi
- pop %ebx
- leave
- ret
-
-/* Go from interlaced to BGR, blue first */
-
-ENTRY(ccvt_420i_bgr24)
- enter $72, $0 # no extra space, no stackframes
- push %ebx
- push %esi
- push %edi
-
- call test_param_2
- jc 9f
-
-0: mov Width, %ecx # width
-1: call do_four_yuvi
- call limit_pixels
- call push_bgr24
-
- cmp $0, %ecx
- jnz 1b # end of line?
- decl Height # yes; decrement line counter
- jnz 0b
-
-9: pop %edi
- pop %esi
- pop %ebx
- leave
- ret
-
-
-/* From interlaced to RGBa */
-
-ENTRY(ccvt_420i_rgb32)
- enter $72, $0 # no extra space, no stackframes
- push %ebx
- push %esi
- push %edi
-
- call test_param_2
- jc 9f
-
-0: mov Width, %ecx # width
-1: call do_four_yuvi
- call limit_pixels
- call push_rgb32
-
- cmp $0, %ecx # end of line?
- jnz 1b
- decl Height # yes; decrement line counter
- jnz 0b
-
-9: pop %edi
- pop %esi
- pop %ebx
- leave
- ret
-
-/* Guess what? Go from interlaced to BGRa */
-
-ENTRY(ccvt_420i_bgr32)
- enter $72, $0 # no extra space, no stackframes
- push %ebx
- push %esi
- push %edi
-
- call test_param_2
- jc 9f
-
-0: mov Width, %ecx # width
-1: call do_four_yuvi
- call limit_pixels
- call push_bgr32
-
- cmp $0, %ecx # end of line?
- jnz 1b
- decl Height # yes; decrement line counter
- jnz 0b
-
-9: pop %edi
- pop %esi
- pop %ebx
- leave
- ret
-
-
-
-
-/* From YUYV to RGBa */
-
-ENTRY(ccvt_yuyv_rgb32)
- enter $72, $0 # no extra space, no stackframes
- push %ebx
- push %esi
- push %edi
-
- call test_param_2
- jc 9f
-
-0: mov Width, %ecx # width
-1: call do_four_yuyv
- call limit_pixels
- call push_rgb32
-
- cmp $0, %ecx # end of line?
- jnz 1b
-
-8: decl Height # yes; decrement line counter
- jnz 0b
-
-9: pop %edi
- pop %esi
- pop %ebx
- leave
- ret
-
-/* From YUYV to BGRa */
-ENTRY(ccvt_yuyv_bgr32)
- enter $72, $0 # no extra space, no stackframes
- push %ebx
- push %esi
- push %edi
-
- call test_param_2
- jc 9f
-
- # YUYV -> RGBa RGBa
-
-0: mov Width, %ecx # width
-1: call do_four_yuyv
- call limit_pixels
- call push_bgr32
-
- cmp $0, %ecx # end of line?
- jnz 1b
-
-8: decl Height # yes; decrement line counter
- jnz 0b
-
-9: pop %edi
- pop %esi
- pop %ebx
- leave
- ret
-
-
-
-
-/* Planar to RGBa */
-
-ENTRY(ccvt_420p_rgb32)
- enter $72, $0
- push %ebx
- push %esi
- push %edi
-
- call test_param_31
- jc 9f
-
- mov Width, %eax # width
- mull Height # * height
- mov SrcU, %eax # Copy U/V pointers
- mov %eax, Uptr
- mov SrcV, %eax
- mov %eax, Vptr
-
-0: mov Width, %ecx # width
-1: call do_four_yuvp
- call limit_pixels
- call push_rgb32
-
- cmp $0, %ecx # end of line?
- jnz 1b
-
- testl $1, Height # odd/even line
- jnz 8f
-
- mov Width, %eax # Even: rewind U/V pointers
- shr %eax
- sub %eax, Uptr
- sub %eax, Vptr
-
-8: decl Height # yes; decrement line counter
- jnz 0b
-
-9: pop %edi
- pop %esi
- pop %ebx
- leave
- ret
-
-/* Okay... eventually, you end up with a very complete set of conversion
- routines. I just wished things were a bit simpler. */
-
-ENTRY(ccvt_420p_bgr32)
- enter $72, $0
- push %ebx
- push %esi
- push %edi
-
- call test_param_31
- jc 9f
-
- mov Width, %eax # width
- mull Height # * height
- mov SrcU, %eax # Copy U/V pointers
- mov %eax, Uptr
- mov SrcV, %eax
- mov %eax, Vptr
-
-0: mov Width, %ecx # width
-1: call do_four_yuvp
- call limit_pixels
- call push_bgr32
-
- cmp $0, %ecx # end of line?
- jnz 1b
-
- testl $1, Height # odd/even line
- jnz 8f
-
- mov Width, %eax # Even: rewind U/V pointers
- shr %eax
- sub %eax, Uptr
- sub %eax, Vptr
-
-8: decl Height # yes; decrement line counter
- jnz 0b
-
-9: pop %edi
- pop %esi
- pop %ebx
- leave
- ret
-
-
-
-
-/* Go from RGB (red first) to 4:2:0 planar.
- * Note: this requires decimation of the U/V space by 2 in both directions
- * Also, a matrix multiply would be QUITE convenient...
-
- This is the matrix:
- (Y ) ( 77 150 29) (R)
- (Cb) = (-43 -85 128) * (G)
- (Cr) (128 -107 -21) (B)
- */
-
-ENTRY(ccvt_rgb24_420p)
- enter $96, $0 # 24 bytes extra stack, no stackframes
- push %ebx # -76: line width in bytes
- push %esi # -80: height (copy)
- push %edi # -84: width (copy)
- # -88: red factor
- # -92: green factor
- # -96: blue factor
- call test_param_13
- jc 9f
-
- mov Width, %eax
- shl %eax
- add Width, %eax # 3 * width = line increment
- mov %eax, -76(%ebp)
-
- mov Height, %eax
- mov %eax, -80(%ebp) # copy height into stackframe
-
- /*
- This is a bit complicated... since U/V decimation is taking
- place both in horizontal and vertical direction, we have to
- process 2 lines in parallel. Also, 2 adjacent pixels are
- considered. We average the U/V values over these 4 pixels
- (of course, we could have just taken the U/V value of the first
- pixel and be done with it, but that's not how we do things around
- here)
- */
-
- # 1st pass: Y values. Set factors
- movl $77 , -88(%ebp) # 0.299
- movl $150, -92(%ebp) # 0.587
- movl $29 , -96(%ebp) # 0.114
-
-0: mov Width, %ecx # width
-1: xor %ebx, %ebx # 0
- call rgb_multiply
- shr $8, %ebx # divide by 256 (no need for limitor, since 77 + 150 + 29 = 256)
- mov %bl, %al
- stosb # store it into Y buffer
-
- dec %ecx # end of line?
- jnz 1b
- decl -80(%ebp) # end of image?
- jnz 0b
-
- # Okay, now the U/V pointers...
- # The following code is passed twice, with different factors
- # Note that the %esi pointer jumps around quite a bit
-
- # factors for U
- movl $-43, -88(%ebp) # -0.1687
- movl $-85, -92(%ebp) # -0.3313
- movl $128, -96(%ebp) # 0.5
- mov DstU, %edi # Set %edi register now
-
-7: mov Src4, %esi # Rewind source pointer
-
- mov Height, %eax # height
- shr %eax # / 2
- mov %eax, -80(%ebp) # copy
-
-2: mov Width, %eax # width
- shr %eax # / 2
- mov %eax, -84(%ebp) # copy
-
-3: xor %ebx, %ebx # 0
- mov $4, %ecx # average over 4 pixels
-
-4: call rgb_multiply
-
- dec %ecx
- jz 5f # done?
- cmp $2, %ecx # 3rd pixel.. move %esi to next line, with offset
- jne 4b
- sub $6, %esi # backup to where we started
- add -76(%ebp), %esi # add line increment
- jmp 4b
-
-5: # okay, 4 pixels done...
- sub -76(%ebp), %esi # Get %esi back to its proper place
-
- add $0x20000, %ebx # add 0.5 factor
- shr $10, %ebx # Divide by 4 * 256
- mov %bl, %al
- stosb # store it!
-
- decl -84(%ebp) # end of line?
- jnz 3b
- add -76(%ebp), %esi # %esi to next line (actually, 2 lines further)
- decl -80(%ebp) # end of image?
- jnz 2b
-
- # check if 3rd pass has been done
- cmpl $128, -88(%ebp)
- je 9f # Done!
- # Set factors for V pass
- movl $128 , -88(%ebp) # 0.5
- movl $-107, -92(%ebp) # -0.4187
- movl $-21 , -96(%ebp) # -0.0813
- mov DstV, %edi # %edi to V buffer
- jmp 7b # "Do it to me one more time..."
-
-9: pop %edi
- pop %esi
- pop %ebx
- leave
- ret
-
-
-
-
-ENTRY(ccvt_bgr24_420p)
- enter $96, $0 # 24 bytes extra stack, no stackframes
- push %ebx # -4: line width in bytes
- push %esi # -8: height (copy)
- push %edi # -12: width (copy)
- # -16: red factor
- # -20: green factor
- # -24: blue factor
- call test_param_13
- jc 9f
-
- /* No surprise, this code looks just like rgb24_420p, but with swapped factors */
-
- mov Width, %eax
- shl %eax
- add Width, %eax # 3 * width = line increment
- mov %eax, -76(%ebp)
-
- mov Height, %eax
- mov %eax, -80(%ebp) # copy height into stackframe
-
- # 1st pass: Y values. Set factors
- movl $29 , -88(%ebp) # 0.114
- movl $150, -92(%ebp) # 0.587
- movl $77 , -96(%ebp) # 0.299
-
-0: mov Width, %ecx # width
-1: xor %ebx, %ebx # 0
- call rgb_multiply
- shr $8, %ebx # divide by 256 (no need for limitor, since 77 + 150 + 29 = 256)
- mov %bl, %al
- stosb # store it into Y buffer
-
- dec %ecx # end of line?
- jnz 1b
- decl -80(%ebp) # end of image?
- jnz 0b
-
- # Okay, now the U/V pointers...
- # The following code is passed twice, with different factors
- # Note that the %esi pointer jumps around quite a bit
-
- # factors for U
- movl $123, -88(%ebp) # 0.5
- movl $-85, -92(%ebp) # -0.3313
- movl $-43, -96(%ebp) # -0.1687
- mov DstU, %edi # Set %edi register now
-
-7: mov Src4, %esi # Rewind source pointer
-
- mov Height, %eax # height
- shr %eax # / 2
- mov %eax, -80(%ebp) # copy
-
-2: mov Width, %eax # width
- shr %eax # / 2
- mov %eax, -84(%ebp) # copy
-
-3: xor %ebx, %ebx # 0
- mov $4, %ecx # average over 4 pixels
-
-4: call rgb_multiply
-
- dec %ecx
- jz 5f # done?
- cmp $2, %ecx # 3rd pixel.. move %esi to next line, with offset
- jne 4b
- sub $6, %esi # backup to where we started
- add -76(%ebp), %esi # add line increment
- jmp 4b
-
-5: # okay, 4 pixels done...
- sub -76(%ebp), %esi # Get %esi back to its proper place
-
- add $0x20000, %ebx # add 0.5 factor
- shr $10, %ebx # Divide by 4 * 256
- mov %bl, %al
- stosb # store it!
-
- decl -84(%ebp) # end of line?
- jnz 3b
- add -76(%ebp), %esi # %esi to next line (actually, 2 lines further)
- decl -80(%ebp) # end of image?
- jnz 2b
-
- # check if 3rd pass has been done
- cmpl $-21, -88(%ebp)
- je 9f # Done!
- # Set factors for V pass
- movl $-21 , -88(%ebp) # -0.0813
- movl $-107, -92(%ebp) # -0.4187
- movl $128 , -96(%ebp) # 0.5
- mov DstV, %edi # %edi to V buffer
- jmp 7b # "Do it to me one more time..."
-
-9: pop %edi
- pop %esi
- pop %ebx
- leave
- ret
-
-
-/* RGB-to-YUV helper functions */
-
-rgb_multiply:
- # do one RGB vector multiplication; its assumed the RGB factors
- # are set on the stack. The data is accumulated in ebx.
- lodsb # red byte
- and $0xff, %eax
- mov -88(%ebp), %edx # red factor
- mul %edx
- add %eax, %ebx
- lodsb # green byte
- and $0xff, %eax
- mov -92(%ebp), %edx # green factor
- mul %edx
- add %eax, %ebx
- lodsb # blue byte
- and $0xff, %eax
- mov -96(%ebp), %edx # blue factor
- mul %edx
- add %eax, %ebx # ebx now contains sum
- ret
-
-
-
-/**************************************************************************/
-
-
-/* Go from 'interlaced' (YYYY UU/VV) format to planar */
-
-ENTRY(ccvt_420i_420p)
- enter $76, $0 # 4 bytes extra space, no stackframes
- push %ebx # -4: width / 4
- push %esi
- push %edi
-
- call test_param_13
- jc 9f
-
- # Okay, this is fairly easy... we first grab the Y values (4 bytes
- # at a time), then rewind and do the U values, and repeat for V.
- # This leaves us with a nice planar format
-
- mov Width, %eax
- shr %eax
- shr %eax # width / 4
- mov %eax, -76(%ebp) # Store
-
- # Y
- mov Height, %edx # line counter
-0: mov -76(%ebp), %ecx
-1: lodsl # get 4 bytes...
- stosl # ...push 4 bytes
- add $2, %esi # Skip U or V
- loop 1b
- dec %edx
- jnz 0b
-
- # U
- mov Src4, %esi # rewind source pointer
- mov DstU, %edi
- add $4, %esi # set to U
- mov Height, %edx
- shr %edx # height / 2
- mov Width, %ebx
- shl %ebx
- add Width, %ebx
- shr %ebx # Width * 1.5 (line offset)
-
-2: mov -76(%ebp), %ecx # width / 4
-3: lodsw # 2 bytes at a time
- stosw
- add $4, %esi # skip Y
- loop 3b
- add %ebx, %esi # Skip line (U is on even lines)
- dec %edx
- jnz 2b
-
- # V
- mov Src4, %esi # rewind, set to V in first odd line
- add $4, %esi
- add %ebx, %esi # register re-use; no compiler can beat that :)
- mov DstV, %edi # V ptr
- mov Height, %edx
- shr %edx # height / 2
-
-4: mov -76(%ebp), %ecx # Get width/4
-5: lodsw
- stosw
- add $4, %esi # Skip Y
- loop 5b
- add %ebx, %esi # Skip line (V is on odd lines)
- dec %edx
- jnz 4b
-
- /* That's it! */
-
-9: pop %edi
- pop %esi
- pop %ebx
- leave
- ret
-
-
-/* Go from 4:2:0 interlaced to 'normal' YUYV */
-
-ENTRY(ccvt_420i_yuyv)
- enter $80, $0 # 8 bytes extra space, no stackframes
- push %ebx
- push %esi
- push %edi
-
- call test_param_2
- jc 9f
-
- mov Width, %ecx # -4: width / 4 = no. loops per line
- shr %ecx
- shr %ecx
- mov %ecx, -76(%ebp)
-
- mov Width, %ebx # -8: width * 1.5 = line offset
- shl %ebx
- add Width, %ebx
- shr %ebx
- mov %ebx, -80(%ebp)
-
- # Okay, this requires a bit of byte shuffling... we go from
- # YYYY UU
- # YYYY VV
- # to
- # YUYV YUYV
- # YUYV YUYV
- # which indeed takes up more space
-
- #
-
-0: mov -76(%ebp), %ecx
-
-1: lodsl # 4 Y in eax
- testl $1, Height # even or odd line?
- jnz 2f
-
- # Even
- mov -80(%ebp), %ebx
- mov (%ebx, %esi), %dx # 16 bits V
- shl $16, %edx # store in high word
- mov (%esi), %dx # 16 bits U
- add $2, %esi
- jmp 3f
-
-2: # Odd
- mov -80(%ebp), %ebx
- neg %ebx # negative offset
- mov (%esi), %dx # 16 bits V
- shl $16, %edx # store in high word
- mov (%ebx, %esi), %dx # 16 bits U
- add $2, %esi
-
-3: # eax = Y3Y2Y1Y0, edx = V1V0U1U0, ebx is free
- push %eax
-
- movzbl %al, %ebx # ______y0
- and $0xFF00, %eax # ____y1__
- shl $8, %eax # __y1____
- or %ebx, %eax # __y1__y0
- mov %edx, %ebx # v1v0u1u0
- shl $8, %ebx # v0u1u0__
- and $0xff00ff00, %ebx # v0__u0__
- or %ebx, %eax # v0y1u0y0
- stosl
-
- pop %eax # y3y2y1y0
- # Second half
- shr $8, %eax # __y3y2y1
- shr $8, %ax # __y3__y2
- and $0xff00ff00, %edx # v1__u1__
- or %edx, %eax # v1y3u1y2
- stosl
-
- loop 1b
-
-
- decl Height # height--
- jnz 0b
- # Done
-
-9: pop %edi
- pop %esi
- pop %ebx
- leave
- ret
+++ /dev/null
- /* SQCIF */
- {
- /* 5 fps */
- {
- {0, },
- {0, },
- {0, },
- {0, },
- },
- /* 10 fps */
- {
- {0, },
- {0, },
- {0, },
- {0, },
- },
- /* 15 fps */
- {
- {0, },
- {0, },
- {0, },
- {0, },
- },
- /* 20 fps */
- {
- {0, },
- {0, },
- {0, },
- {0, },
- },
- /* 25 fps */
- {
- {0, },
- {0, },
- {0, },
- {0, },
- },
- /* 30 fps */
- {
- {0, },
- {0, },
- {0, },
- {0, },
- },
- },
- /* QSIF */
- {
- /* 5 fps */
- {
- {1, 146, 0, {0x1D, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0x00, 0x80}},
- {1, 146, 0, {0x1D, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0x00, 0x80}},
- {1, 146, 0, {0x1D, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0x00, 0x80}},
- {1, 146, 0, {0x1D, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0x00, 0x80}},
- },
- /* 10 fps */
- {
- {2, 291, 0, {0x1C, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x23, 0x01, 0x80}},
- {1, 192, 630, {0x14, 0xF4, 0x30, 0x13, 0xA9, 0x12, 0xE1, 0x17, 0x08, 0xC0, 0x00, 0x80}},
- {1, 192, 630, {0x14, 0xF4, 0x30, 0x13, 0xA9, 0x12, 0xE1, 0x17, 0x08, 0xC0, 0x00, 0x80}},
- {1, 192, 630, {0x14, 0xF4, 0x30, 0x13, 0xA9, 0x12, 0xE1, 0x17, 0x08, 0xC0, 0x00, 0x80}},
- },
- /* 15 fps */
- {
- {3, 437, 0, {0x1B, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0xB5, 0x01, 0x80}},
- {2, 292, 640, {0x13, 0xF4, 0x30, 0x13, 0xF7, 0x13, 0x2F, 0x13, 0x20, 0x24, 0x01, 0x80}},
- {2, 292, 640, {0x13, 0xF4, 0x30, 0x13, 0xF7, 0x13, 0x2F, 0x13, 0x20, 0x24, 0x01, 0x80}},
- {1, 192, 420, {0x13, 0xF4, 0x30, 0x0D, 0x1B, 0x0C, 0x53, 0x1E, 0x18, 0xC0, 0x00, 0x80}},
- },
- /* 20 fps */
- {
- {4, 589, 0, {0x1A, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x4D, 0x02, 0x80}},
- {3, 448, 730, {0x12, 0xF4, 0x30, 0x16, 0xC9, 0x16, 0x01, 0x0E, 0x18, 0xC0, 0x01, 0x80}},
- {2, 292, 476, {0x12, 0xF4, 0x30, 0x0E, 0xD8, 0x0E, 0x10, 0x19, 0x18, 0x24, 0x01, 0x80}},
- {1, 192, 312, {0x12, 0xF4, 0x50, 0x09, 0xB3, 0x08, 0xEB, 0x1E, 0x18, 0xC0, 0x00, 0x80}},
- },
- /* 25 fps */
- {
- {5, 703, 0, {0x19, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0xBF, 0x02, 0x80}},
- {3, 447, 610, {0x11, 0xF4, 0x30, 0x13, 0x0B, 0x12, 0x43, 0x14, 0x28, 0xBF, 0x01, 0x80}},
- {2, 292, 398, {0x11, 0xF4, 0x50, 0x0C, 0x6C, 0x0B, 0xA4, 0x1E, 0x28, 0x24, 0x01, 0x80}},
- {1, 193, 262, {0x11, 0xF4, 0x50, 0x08, 0x23, 0x07, 0x5B, 0x1E, 0x28, 0xC1, 0x00, 0x80}},
- },
- /* 30 fps */
- {
- {8, 874, 0, {0x18, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x6A, 0x03, 0x80}},
- {5, 704, 730, {0x10, 0xF4, 0x30, 0x16, 0xC9, 0x16, 0x01, 0x0E, 0x28, 0xC0, 0x02, 0x80}},
- {3, 448, 492, {0x10, 0xF4, 0x30, 0x0F, 0x5D, 0x0E, 0x95, 0x15, 0x28, 0xC0, 0x01, 0x80}},
- {2, 292, 320, {0x10, 0xF4, 0x50, 0x09, 0xFB, 0x09, 0x33, 0x1E, 0x28, 0x24, 0x01, 0x80}},
- },
- },
- /* QCIF */
- {
- /* 5 fps */
- {
- {0, },
- {0, },
- {0, },
- {0, },
- },
- /* 10 fps */
- {
- {0, },
- {0, },
- {0, },
- {0, },
- },
- /* 15 fps */
- {
- {0, },
- {0, },
- {0, },
- {0, },
- },
- /* 20 fps */
- {
- {0, },
- {0, },
- {0, },
- {0, },
- },
- /* 25 fps */
- {
- {0, },
- {0, },
- {0, },
- {0, },
- },
- /* 30 fps */
- {
- {0, },
- {0, },
- {0, },
- {0, },
- },
- },
- /* SIF */
- {
- /* 5 fps */
- {
- {4, 582, 0, {0x0D, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x46, 0x02, 0x80}},
- {3, 387, 1276, {0x05, 0xF4, 0x30, 0x27, 0xD8, 0x26, 0x48, 0x03, 0x10, 0x83, 0x01, 0x80}},
- {2, 291, 960, {0x05, 0xF4, 0x30, 0x1D, 0xF2, 0x1C, 0x62, 0x04, 0x10, 0x23, 0x01, 0x80}},
- {1, 191, 630, {0x05, 0xF4, 0x50, 0x13, 0xA9, 0x12, 0x19, 0x05, 0x18, 0xBF, 0x00, 0x80}},
- },
- /* 10 fps */
- {
- {0, },
- {6, 775, 1278, {0x04, 0xF4, 0x30, 0x27, 0xE8, 0x26, 0x58, 0x05, 0x30, 0x07, 0x03, 0x80}},
- {3, 447, 736, {0x04, 0xF4, 0x30, 0x16, 0xFB, 0x15, 0x6B, 0x05, 0x28, 0xBF, 0x01, 0x80}},
- {2, 292, 480, {0x04, 0xF4, 0x70, 0x0E, 0xF9, 0x0D, 0x69, 0x09, 0x28, 0x24, 0x01, 0x80}},
- },
- /* 15 fps */
- {
- {0, },
- {9, 955, 1050, {0x03, 0xF4, 0x30, 0x20, 0xCF, 0x1F, 0x3F, 0x06, 0x48, 0xBB, 0x03, 0x80}},
- {4, 592, 650, {0x03, 0xF4, 0x30, 0x14, 0x44, 0x12, 0xB4, 0x08, 0x30, 0x50, 0x02, 0x80}},
- {3, 448, 492, {0x03, 0xF4, 0x50, 0x0F, 0x52, 0x0D, 0xC2, 0x09, 0x38, 0xC0, 0x01, 0x80}},
- },
- /* 20 fps */
- {
- {0, },
- {9, 958, 782, {0x02, 0xF4, 0x30, 0x18, 0x6A, 0x16, 0xDA, 0x0B, 0x58, 0xBE, 0x03, 0x80}},
- {5, 703, 574, {0x02, 0xF4, 0x50, 0x11, 0xE7, 0x10, 0x57, 0x0B, 0x40, 0xBF, 0x02, 0x80}},
- {3, 446, 364, {0x02, 0xF4, 0x90, 0x0B, 0x5C, 0x09, 0xCC, 0x0E, 0x38, 0xBE, 0x01, 0x80}},
- },
- /* 25 fps */
- {
- {0, },
- {9, 958, 654, {0x01, 0xF4, 0x30, 0x14, 0x66, 0x12, 0xD6, 0x0B, 0x50, 0xBE, 0x03, 0x80}},
- {6, 776, 530, {0x01, 0xF4, 0x50, 0x10, 0x8C, 0x0E, 0xFC, 0x0C, 0x48, 0x08, 0x03, 0x80}},
- {4, 592, 404, {0x01, 0xF4, 0x70, 0x0C, 0x96, 0x0B, 0x06, 0x0B, 0x48, 0x50, 0x02, 0x80}},
- },
- /* 30 fps */
- {
- {0, },
- {9, 957, 526, {0x00, 0xF4, 0x50, 0x10, 0x68, 0x0E, 0xD8, 0x0D, 0x58, 0xBD, 0x03, 0x80}},
- {6, 775, 426, {0x00, 0xF4, 0x70, 0x0D, 0x48, 0x0B, 0xB8, 0x0F, 0x50, 0x07, 0x03, 0x80}},
- {4, 590, 324, {0x00, 0x7A, 0x88, 0x0A, 0x1C, 0x08, 0xB4, 0x0E, 0x50, 0x4E, 0x02, 0x80}},
- },
- },
- /* CIF */
- {
- /* 5 fps */
- {
- {0, },
- {0, },
- {0, },
- {0, },
- },
- /* 10 fps */
- {
- {0, },
- {0, },
- {0, },
- {0, },
- },
- /* 15 fps */
- {
- {0, },
- {0, },
- {0, },
- {0, },
- },
- /* 20 fps */
- {
- {0, },
- {0, },
- {0, },
- {0, },
- },
- /* 25 fps */
- {
- {0, },
- {0, },
- {0, },
- {0, },
- },
- /* 30 fps */
- {
- {0, },
- {0, },
- {0, },
- {0, },
- },
- },
- /* VGA */
- {
- /* 5 fps */
- {
- {0, },
- {6, 773, 1272, {0x25, 0xF4, 0x30, 0x27, 0xB6, 0x24, 0x96, 0x02, 0x30, 0x05, 0x03, 0x80}},
- {4, 592, 976, {0x25, 0xF4, 0x50, 0x1E, 0x78, 0x1B, 0x58, 0x03, 0x30, 0x50, 0x02, 0x80}},
- {3, 448, 738, {0x25, 0xF4, 0x90, 0x17, 0x0C, 0x13, 0xEC, 0x04, 0x30, 0xC0, 0x01, 0x80}},
- },
- /* 10 fps */
- {
- {0, },
- {9, 956, 788, {0x24, 0xF4, 0x70, 0x18, 0x9C, 0x15, 0x7C, 0x03, 0x48, 0xBC, 0x03, 0x80}},
- {6, 776, 640, {0x24, 0xF4, 0xB0, 0x13, 0xFC, 0x11, 0x2C, 0x04, 0x48, 0x08, 0x03, 0x80}},
- {4, 592, 488, {0x24, 0x7A, 0xE8, 0x0F, 0x3C, 0x0C, 0x6C, 0x06, 0x48, 0x50, 0x02, 0x80}},
- },
- /* 15 fps */
- {
- {0, },
- {9, 957, 526, {0x23, 0x7A, 0xE8, 0x10, 0x68, 0x0D, 0x98, 0x06, 0x58, 0xBD, 0x03, 0x80}},
- {9, 957, 526, {0x23, 0x7A, 0xE8, 0x10, 0x68, 0x0D, 0x98, 0x06, 0x58, 0xBD, 0x03, 0x80}},
- {8, 895, 492, {0x23, 0x7A, 0xE8, 0x0F, 0x5D, 0x0C, 0x8D, 0x06, 0x58, 0x7F, 0x03, 0x80}},
- },
- /* 20 fps */
- {
- {0, },
- {0, },
- {0, },
- {0, },
- },
- /* 25 fps */
- {
- {0, },
- {0, },
- {0, },
- {0, },
- },
- /* 30 fps */
- {
- {0, },
- {0, },
- {0, },
- {0, },
- },
- },
+++ /dev/null
- /* SQCIF */
- {
- {0, 0, {0x04, 0x01, 0x03}},
- {8, 0, {0x05, 0x01, 0x03}},
- {7, 0, {0x08, 0x01, 0x03}},
- {7, 0, {0x0A, 0x01, 0x03}},
- {6, 0, {0x0C, 0x01, 0x03}},
- {5, 0, {0x0F, 0x01, 0x03}},
- {4, 0, {0x14, 0x01, 0x03}},
- {3, 0, {0x18, 0x01, 0x03}},
- },
- /* QSIF */
- {
- {0},
- {0},
- {0},
- {0},
- {0},
- {0},
- {0},
- {0},
- },
- /* QCIF */
- {
- {0, 0, {0x04, 0x01, 0x02}},
- {8, 0, {0x05, 0x01, 0x02}},
- {7, 0, {0x08, 0x01, 0x02}},
- {6, 0, {0x0A, 0x01, 0x02}},
- {5, 0, {0x0C, 0x01, 0x02}},
- {4, 0, {0x0F, 0x01, 0x02}},
- {1, 0, {0x14, 0x01, 0x02}},
- {1, 0, {0x18, 0x01, 0x02}},
- },
- /* SIF */
- {
- {0},
- {0},
- {0},
- {0},
- {0},
- {0},
- {0},
- {0},
- },
- /* CIF */
- {
- {4, 0, {0x04, 0x01, 0x01}},
- {7, 1, {0x05, 0x03, 0x01}},
- {6, 1, {0x08, 0x03, 0x01}},
- {4, 1, {0x0A, 0x03, 0x01}},
- {3, 1, {0x0C, 0x03, 0x01}},
- {2, 1, {0x0F, 0x03, 0x01}},
- {0},
- {0},
- },
- /* VGA */
- {
- {0},
- {0},
- {0},
- {0},
- {0},
- {0},
- {0},
- {0},
- },
static struct Nala_table_entry Nala_table[PSZ_MAX][8] =
{
-#include "nala.inc"
+#include "pwc_nala.h"
};
/* This tables contains entries for the 675/680/690 (Timon) camera, with
static struct Timon_table_entry Timon_table[PSZ_MAX][6][4] =
{
-#include "timon.inc"
+#include "pwc_timon.h"
};
/* Entries for the Kiara (730/740) camera */
static struct Kiara_table_entry Kiara_table[PSZ_MAX][6][4] =
{
-#include "kiara.inc"
+#include "pwc_kiara.h"
};
static inline int send_video_command(struct usb_device *udev, int index, void *buf, int buflen)
{
-#ifdef __KERNEL__
return usb_control_msg(udev,
usb_sndctrlpipe(udev, 0),
SET_EP_STREAM_CTL,
VIDEO_OUTPUT_CONTROL_FORMATTER,
index,
buf, buflen, HZ);
-#else
- return 0;
-#endif
}
#endif
/* Function prototypes and driver templates */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
/* hotplug device table support */
static __devinitdata struct usb_device_id pwc_device_table [] = {
disconnect: usb_pwc_disconnect, /* disconnect() */
};
-#else
-
-static void *usb_pwc_probe(struct usb_device *udev, unsigned int ifnum);
-static void usb_pwc_disconnect(struct usb_device *udev, void *ptr);
-
-static struct usb_driver pwc_driver =
-{
- name: "Philips webcam", /* name */
- probe: usb_pwc_probe, /* probe() */
- disconnect: usb_pwc_disconnect, /* disconnect() */
-};
-#endif
-
-
static int default_size = PSZ_QCIF;
static int default_fps = 10;
static int default_palette = VIDEO_PALETTE_RGB24; /* This is normal for webcams */
static int pwc_video_mmap(struct video_device *dev, const char *adr, unsigned long size);
static struct video_device pwc_template = {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,3)
- owner: NULL,
-#endif
+ owner: THIS_MODULE,
name: "Philips Webcam", /* Filled in later */
type: VID_TYPE_CAPTURE,
-#ifdef VID_HARDWARE_PWC
hardware: VID_HARDWARE_PWC, /* Let's pretend for now */
-#else
- hardware: 0, /* 2.2.14 backport (?) */
-#endif
open: pwc_video_open,
close: pwc_video_close,
read: pwc_video_read,
static int pwc_set_palette(struct pwc_device *pdev, int pal)
{
- if ( pal == VIDEO_PALETTE_RGB24
- || pal == VIDEO_PALETTE_RGB32
- || pal == (VIDEO_PALETTE_RGB24 | 0x80)
- || pal == (VIDEO_PALETTE_RGB32 | 0x80)
- || pal == VIDEO_PALETTE_YUYV
- || pal == VIDEO_PALETTE_YUV422
- || pal == VIDEO_PALETTE_YUV420
- || pal == VIDEO_PALETTE_YUV420P
+ if (
+ pal == VIDEO_PALETTE_YUV420
#if PWC_DEBUG
|| pal == VIDEO_PALETTE_RAW
#endif
Trace(TRACE_OPEN, "video_open called(0x%p, 0%o).\n", vdev, mode);
- if (vdev == NULL) {
- Err("video_open() called with NULL structure?\n");
- return -EFAULT;
- }
+ if (vdev == NULL)
+ BUG();
pdev = (struct pwc_device *)vdev->priv;
- if (pdev == NULL) {
- Err("video_open() called with NULL pwc_device.\n");
- return -EFAULT;
- }
+ if (pdev == NULL)
+ BUG();
- MOD_INC_USE_COUNT;
down(&pdev->modlock);
if (!pdev->usb_init) {
Trace(TRACE_OPEN, "Doing first time initialization.\n");
i = pwc_allocate_buffers(pdev);
if (i < 0) {
Trace(TRACE_OPEN, "Failed to allocate memory.\n");
- MOD_DEC_USE_COUNT;
up(&pdev->modlock);
return i;
}
}
if (i) {
Trace(TRACE_OPEN, "Second attempt at set_video_mode failed.\n");
- MOD_DEC_USE_COUNT;
up(&pdev->modlock);
return i;
}
i = usb_set_interface(pdev->udev, 0, pdev->valternate);
if (i) {
Trace(TRACE_OPEN, "Failed to set alternate interface = %d.\n", i);
- MOD_DEC_USE_COUNT;
up(&pdev->modlock);
return -EINVAL;
}
int i;
Trace(TRACE_OPEN, "video_close called(0x%p).\n", vdev);
- if (vdev == NULL) {
- Err("video_close() called with NULL structure?\n");
- return;
- }
+
pdev = (struct pwc_device *)vdev->priv;
- if (pdev == NULL) {
- Err("video_close() called with NULL pwc_device.\n");
- return;
- }
if (pdev->vopen == 0)
Info("video_close() called on closed device?\n");
/* wake up _disconnect() routine */
if (pdev->unplugged)
wake_up(&pdev->remove_ok);
-
- MOD_DEC_USE_COUNT;
}
+/*
+ * FIXME: what about two parallel reads ????
+ */
+
static long pwc_video_read(struct video_device *vdev, char *buf, unsigned long count, int noblock)
{
struct pwc_device *pdev;
if (copy_from_user(&p, arg, sizeof(p)))
return -EFAULT;
+ /*
+ * FIXME: Suppose we are mid read
+ */
pwc_set_brightness(pdev, p.brightness);
pwc_set_contrast(pdev, p.contrast);
pwc_set_gamma(pdev, p.whiteness);
conflict with read(), but any programmer that uses
read() and mmap() simultaneously should be given
a job at Micro$oft. As janitor.
+
+ FIXME: needs auditing for safety.
*/
while (pdev->full_frames == NULL) {
interruptible_sleep_on(&pdev->frameq);
unsigned long page, pos;
Trace(TRACE_READ, "mmap(0x%p, 0x%p, %lu) called.\n", vdev, adr, size);
- if (vdev == NULL)
- return -EFAULT;
pdev = vdev->priv;
- if (pdev == NULL)
- return -EFAULT;
+
+ /* FIXME - audit mmap during a read */
pos = (unsigned long)pdev->image_data;
while (size > 0) {
* is loaded.
*/
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
static void *usb_pwc_probe(struct usb_device *udev, unsigned int ifnum, const struct usb_device_id *id)
-#else
-static void *usb_pwc_probe(struct usb_device *udev, unsigned int ifnum)
-#endif
{
struct pwc_device *pdev = NULL;
struct video_device *vdev;
vendor_id = udev->descriptor.idVendor;
product_id = udev->descriptor.idProduct;
- if (vendor_id != 0x0471 && vendor_id != 0x069A)
- return NULL; /* Not Philips or Askey, for sure. */
if (vendor_id == 0x0471) {
switch (product_id) {
break;
}
}
- if (vendor_id == 0x069A) {
+ else if (vendor_id == 0x069A) {
switch(product_id) {
case 0x0001:
Info("Askey VC010 type 1 USB webcam detected.\n");
break;
}
}
+ else return NULL; /* Not Philips or Askey, for sure. */
+
if (udev->descriptor.bNumConfigurations > 1)
Info("Warning: more than 1 configuration available.\n");
}
memcpy(vdev, &pwc_template, sizeof(pwc_template));
sprintf(vdev->name, "Philips %d webcam", pdev->type);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,3)
SET_MODULE_OWNER(vdev);
-#endif
pdev->vdev = vdev;
vdev->priv = pdev;
}
if (palette) {
/* Determine default palette */
- if (!strcmp(palette, "bgr24"))
- default_palette = VIDEO_PALETTE_RGB24;
- else if (!strcmp(palette, "rgb24"))
- default_palette = VIDEO_PALETTE_RGB24 | 0x80;
- else if (!strcmp(palette, "bgr32"))
- default_palette = VIDEO_PALETTE_RGB32;
- else if (!strcmp(palette, "rgb32"))
- default_palette = VIDEO_PALETTE_RGB32 | 0x80;
- else if (!strcmp(palette, "yuyv"))
- default_palette = VIDEO_PALETTE_YUYV;
- else if (!strcmp(palette, "yuv420"))
+ if (!strcmp(palette, "yuv420"))
default_palette = VIDEO_PALETTE_YUV420;
- else if (!strcmp(palette, "yuv420p"))
- default_palette = VIDEO_PALETTE_YUV420P;
else {
- Err("Palette not recognized: try palette=[bgr24 | rgb24 | bgr32 | rgb32 | yuyv | yuv420 | yuv420p].\n");
+ Err("Palette not recognized: try palette=yuv420.\n");
return -EINVAL;
}
Info("Default palette set to %d.\n", default_palette);
themselves. It also has a decompressor wrapper function.
*/
-#include "ccvt.h"
-#include "vcvt.h"
#include "pwc.h"
#include "pwc-uncompress.h"
/* This contains a list of all registered decompressors */
-LIST_HEAD(pwc_decompressor_list);
+static LIST_HEAD(pwc_decompressor_list);
/* Should the pwc_decompress structure ever change, we increase the
version number so that we don't get nasty surprises, or can
if (pdev->image.x == pdev->view.x && pdev->image.y == pdev->view.y) {
/* Sizes matches; make it quick */
switch(pdev->vpalette) {
- case VIDEO_PALETTE_RGB24 | 0x80:
- ccvt_420i_rgb24(pdev->image.x, pdev->image.y, yuv, image);
- break;
- case VIDEO_PALETTE_RGB24:
- ccvt_420i_bgr24(pdev->image.x, pdev->image.y, yuv, image);
- break;
- case VIDEO_PALETTE_RGB32 | 0x80:
- ccvt_420i_rgb32(pdev->image.x, pdev->image.y, yuv, image);
- break;
- case VIDEO_PALETTE_RGB32:
- ccvt_420i_bgr32(pdev->image.x, pdev->image.y, yuv, image);
- break;
- case VIDEO_PALETTE_YUYV:
- case VIDEO_PALETTE_YUV422:
- ccvt_420i_yuyv(pdev->image.x, pdev->image.y, yuv, image);
- break;
case VIDEO_PALETTE_YUV420:
memcpy(image, yuv, pdev->image.size);
break;
- case VIDEO_PALETTE_YUV420P:
- n = pdev->image.x * pdev->image.y;
- ccvt_420i_420p(pdev->image.x, pdev->image.y, yuv, image, image + n, image + n + (n / 4));
- break;
}
}
else {
/* Size mismatch; use viewport conversion routines */
switch(pdev->vpalette) {
- case VIDEO_PALETTE_RGB24 | 0x80:
- vcvt_420i_rgb24(pdev->image.x, pdev->image.y, pdev->view.x, yuv, image + pdev->offset.size);
- break;
- case VIDEO_PALETTE_RGB24:
- vcvt_420i_bgr24(pdev->image.x, pdev->image.y, pdev->view.x, yuv, image + pdev->offset.size);
- break;
- case VIDEO_PALETTE_RGB32 | 0x80:
- vcvt_420i_rgb32(pdev->image.x, pdev->image.y, pdev->view.x, yuv, image + pdev->offset.size);
- break;
- case VIDEO_PALETTE_RGB32:
- vcvt_420i_bgr32(pdev->image.x, pdev->image.y, pdev->view.x, yuv, image + pdev->offset.size);
- break;
- case VIDEO_PALETTE_YUYV:
- case VIDEO_PALETTE_YUV422:
- vcvt_420i_yuyv(pdev->image.x, pdev->image.y, pdev->view.x, yuv, image + pdev->offset.size);
- break;
case VIDEO_PALETTE_YUV420:
dst = image + pdev->offset.size;
w = pdev->view.x * 6;
yuv += c;
}
break;
- case VIDEO_PALETTE_YUV420P:
- n = pdev->view.x * pdev->view.y;
- vcvt_420i_420p(pdev->image.x, pdev->image.y, pdev->view.x, yuv,
- image + pdev->offset.size,
- image + n + pdev->offset.size / 4,
- image + n + n / 4 + pdev->offset.size / 4);
- break;
}
}
return 0;
}
-
-/* wrapper functions.
- By using these wrapper functions and exporting them with no VERSIONING,
- I can be sure the pwcx.o module will load on all systems.
-*/
-
-void *pwc_kmalloc(size_t size, int priority)
-{
- return kmalloc(size, priority);
-}
-
-void pwc_kfree(const void *pointer)
-{
- kfree(pointer);
-}
-
/* Make sure these functions are available for the decompressor plugin
both when this code is compiled into the kernel or as as module.
- We are using unversioned names!
*/
+
EXPORT_SYMBOL_NOVERS(pwc_decompressor_version);
-EXPORT_SYMBOL_NOVERS(pwc_register_decompressor);
-EXPORT_SYMBOL_NOVERS(pwc_unregister_decompressor);
-EXPORT_SYMBOL_NOVERS(pwc_find_decompressor);
-EXPORT_SYMBOL_NOVERS(pwc_kmalloc);
-EXPORT_SYMBOL_NOVERS(pwc_kfree);
+EXPORT_SYMBOL(pwc_register_decompressor);
+EXPORT_SYMBOL(pwc_unregister_decompressor);
+EXPORT_SYMBOL(pwc_find_decompressor);
#ifndef PWC_H
#define PWC_H
-#ifdef __KERNEL__
+#include <linux/config.h>
#include <linux/module.h>
-#include <asm/semaphore.h>
-#include <asm/errno.h>
#include <linux/usb.h>
#include <linux/spinlock.h>
-#include <linux/slab.h>
-#else
-#include <errno.h>
-#include <sys/types.h>
-
-#define printk printf
-#define KERN_DEBUG "<7>"
-#define KERN_INFO "<6>"
-#define KERN_ERR "<3>"
-#endif
-
-#include <linux/config.h>
#include <linux/videodev.h>
#include <linux/wait.h>
+#include <asm/semaphore.h>
+#include <asm/errno.h>
+
/* Defines and structures for the Philips webcam */
/* Used for checking memory corruption/pointer validation */
#define PWC_MAGIC 0x89DC10ABUL
#define TRACE_SIZE 0x0040
#define TRACE_SEQUENCE 0x1000
-#define Trace(R, A...) if (pwc_trace & R) printk(KERN_DEBUG PWC_NAME " " ##A)
-#define Debug(A...) printk(KERN_DEBUG PWC_NAME " " ##A)
-#define Info(A...) printk(KERN_INFO PWC_NAME " " ##A)
-#define Err(A...) printk(KERN_ERR PWC_NAME " " ##A)
+#define Trace(R, A...) if (pwc_trace & R) printk(KERN_DEBUG PWC_NAME " " A)
+#define Debug(A...) printk(KERN_DEBUG PWC_NAME " " A)
+#define Info(A...) printk(KERN_INFO PWC_NAME " " A)
+#define Err(A...) printk(KERN_ERR PWC_NAME " " A)
/* Defines for ToUCam cameras */
void *data;
int length;
int read;
-#ifdef __KERNEL__
purb_t urb;
-#endif
};
/* intermediate buffers with raw data from the USB cam */
int image_read_pos; /* In case we read data in pieces, keep track of were we are in the imagebuffer */
int image_used[MAX_IMAGES]; /* For MCAPTURE and SYNC */
-#ifdef __KERNEL__
/* Kernel specific structures. These were once moved to the end
of the structure and padded with bytes after I found out
some of these have different sizes in different kernel versions.
#if PWC_INT_PIPE
void *usb_int_handler; /* for the interrupt endpoint */
#endif
-#endif
};
/* Enumeration of image sizes */
--- /dev/null
+ /* SQCIF */
+ {
+ /* 5 fps */
+ {
+ {0, },
+ {0, },
+ {0, },
+ {0, },
+ },
+ /* 10 fps */
+ {
+ {0, },
+ {0, },
+ {0, },
+ {0, },
+ },
+ /* 15 fps */
+ {
+ {0, },
+ {0, },
+ {0, },
+ {0, },
+ },
+ /* 20 fps */
+ {
+ {0, },
+ {0, },
+ {0, },
+ {0, },
+ },
+ /* 25 fps */
+ {
+ {0, },
+ {0, },
+ {0, },
+ {0, },
+ },
+ /* 30 fps */
+ {
+ {0, },
+ {0, },
+ {0, },
+ {0, },
+ },
+ },
+ /* QSIF */
+ {
+ /* 5 fps */
+ {
+ {1, 146, 0, {0x1D, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0x00, 0x80}},
+ {1, 146, 0, {0x1D, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0x00, 0x80}},
+ {1, 146, 0, {0x1D, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0x00, 0x80}},
+ {1, 146, 0, {0x1D, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0x00, 0x80}},
+ },
+ /* 10 fps */
+ {
+ {2, 291, 0, {0x1C, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x23, 0x01, 0x80}},
+ {1, 192, 630, {0x14, 0xF4, 0x30, 0x13, 0xA9, 0x12, 0xE1, 0x17, 0x08, 0xC0, 0x00, 0x80}},
+ {1, 192, 630, {0x14, 0xF4, 0x30, 0x13, 0xA9, 0x12, 0xE1, 0x17, 0x08, 0xC0, 0x00, 0x80}},
+ {1, 192, 630, {0x14, 0xF4, 0x30, 0x13, 0xA9, 0x12, 0xE1, 0x17, 0x08, 0xC0, 0x00, 0x80}},
+ },
+ /* 15 fps */
+ {
+ {3, 437, 0, {0x1B, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0xB5, 0x01, 0x80}},
+ {2, 292, 640, {0x13, 0xF4, 0x30, 0x13, 0xF7, 0x13, 0x2F, 0x13, 0x20, 0x24, 0x01, 0x80}},
+ {2, 292, 640, {0x13, 0xF4, 0x30, 0x13, 0xF7, 0x13, 0x2F, 0x13, 0x20, 0x24, 0x01, 0x80}},
+ {1, 192, 420, {0x13, 0xF4, 0x30, 0x0D, 0x1B, 0x0C, 0x53, 0x1E, 0x18, 0xC0, 0x00, 0x80}},
+ },
+ /* 20 fps */
+ {
+ {4, 589, 0, {0x1A, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x4D, 0x02, 0x80}},
+ {3, 448, 730, {0x12, 0xF4, 0x30, 0x16, 0xC9, 0x16, 0x01, 0x0E, 0x18, 0xC0, 0x01, 0x80}},
+ {2, 292, 476, {0x12, 0xF4, 0x30, 0x0E, 0xD8, 0x0E, 0x10, 0x19, 0x18, 0x24, 0x01, 0x80}},
+ {1, 192, 312, {0x12, 0xF4, 0x50, 0x09, 0xB3, 0x08, 0xEB, 0x1E, 0x18, 0xC0, 0x00, 0x80}},
+ },
+ /* 25 fps */
+ {
+ {5, 703, 0, {0x19, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0xBF, 0x02, 0x80}},
+ {3, 447, 610, {0x11, 0xF4, 0x30, 0x13, 0x0B, 0x12, 0x43, 0x14, 0x28, 0xBF, 0x01, 0x80}},
+ {2, 292, 398, {0x11, 0xF4, 0x50, 0x0C, 0x6C, 0x0B, 0xA4, 0x1E, 0x28, 0x24, 0x01, 0x80}},
+ {1, 193, 262, {0x11, 0xF4, 0x50, 0x08, 0x23, 0x07, 0x5B, 0x1E, 0x28, 0xC1, 0x00, 0x80}},
+ },
+ /* 30 fps */
+ {
+ {8, 874, 0, {0x18, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x6A, 0x03, 0x80}},
+ {5, 704, 730, {0x10, 0xF4, 0x30, 0x16, 0xC9, 0x16, 0x01, 0x0E, 0x28, 0xC0, 0x02, 0x80}},
+ {3, 448, 492, {0x10, 0xF4, 0x30, 0x0F, 0x5D, 0x0E, 0x95, 0x15, 0x28, 0xC0, 0x01, 0x80}},
+ {2, 292, 320, {0x10, 0xF4, 0x50, 0x09, 0xFB, 0x09, 0x33, 0x1E, 0x28, 0x24, 0x01, 0x80}},
+ },
+ },
+ /* QCIF */
+ {
+ /* 5 fps */
+ {
+ {0, },
+ {0, },
+ {0, },
+ {0, },
+ },
+ /* 10 fps */
+ {
+ {0, },
+ {0, },
+ {0, },
+ {0, },
+ },
+ /* 15 fps */
+ {
+ {0, },
+ {0, },
+ {0, },
+ {0, },
+ },
+ /* 20 fps */
+ {
+ {0, },
+ {0, },
+ {0, },
+ {0, },
+ },
+ /* 25 fps */
+ {
+ {0, },
+ {0, },
+ {0, },
+ {0, },
+ },
+ /* 30 fps */
+ {
+ {0, },
+ {0, },
+ {0, },
+ {0, },
+ },
+ },
+ /* SIF */
+ {
+ /* 5 fps */
+ {
+ {4, 582, 0, {0x0D, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x46, 0x02, 0x80}},
+ {3, 387, 1276, {0x05, 0xF4, 0x30, 0x27, 0xD8, 0x26, 0x48, 0x03, 0x10, 0x83, 0x01, 0x80}},
+ {2, 291, 960, {0x05, 0xF4, 0x30, 0x1D, 0xF2, 0x1C, 0x62, 0x04, 0x10, 0x23, 0x01, 0x80}},
+ {1, 191, 630, {0x05, 0xF4, 0x50, 0x13, 0xA9, 0x12, 0x19, 0x05, 0x18, 0xBF, 0x00, 0x80}},
+ },
+ /* 10 fps */
+ {
+ {0, },
+ {6, 775, 1278, {0x04, 0xF4, 0x30, 0x27, 0xE8, 0x26, 0x58, 0x05, 0x30, 0x07, 0x03, 0x80}},
+ {3, 447, 736, {0x04, 0xF4, 0x30, 0x16, 0xFB, 0x15, 0x6B, 0x05, 0x28, 0xBF, 0x01, 0x80}},
+ {2, 292, 480, {0x04, 0xF4, 0x70, 0x0E, 0xF9, 0x0D, 0x69, 0x09, 0x28, 0x24, 0x01, 0x80}},
+ },
+ /* 15 fps */
+ {
+ {0, },
+ {9, 955, 1050, {0x03, 0xF4, 0x30, 0x20, 0xCF, 0x1F, 0x3F, 0x06, 0x48, 0xBB, 0x03, 0x80}},
+ {4, 592, 650, {0x03, 0xF4, 0x30, 0x14, 0x44, 0x12, 0xB4, 0x08, 0x30, 0x50, 0x02, 0x80}},
+ {3, 448, 492, {0x03, 0xF4, 0x50, 0x0F, 0x52, 0x0D, 0xC2, 0x09, 0x38, 0xC0, 0x01, 0x80}},
+ },
+ /* 20 fps */
+ {
+ {0, },
+ {9, 958, 782, {0x02, 0xF4, 0x30, 0x18, 0x6A, 0x16, 0xDA, 0x0B, 0x58, 0xBE, 0x03, 0x80}},
+ {5, 703, 574, {0x02, 0xF4, 0x50, 0x11, 0xE7, 0x10, 0x57, 0x0B, 0x40, 0xBF, 0x02, 0x80}},
+ {3, 446, 364, {0x02, 0xF4, 0x90, 0x0B, 0x5C, 0x09, 0xCC, 0x0E, 0x38, 0xBE, 0x01, 0x80}},
+ },
+ /* 25 fps */
+ {
+ {0, },
+ {9, 958, 654, {0x01, 0xF4, 0x30, 0x14, 0x66, 0x12, 0xD6, 0x0B, 0x50, 0xBE, 0x03, 0x80}},
+ {6, 776, 530, {0x01, 0xF4, 0x50, 0x10, 0x8C, 0x0E, 0xFC, 0x0C, 0x48, 0x08, 0x03, 0x80}},
+ {4, 592, 404, {0x01, 0xF4, 0x70, 0x0C, 0x96, 0x0B, 0x06, 0x0B, 0x48, 0x50, 0x02, 0x80}},
+ },
+ /* 30 fps */
+ {
+ {0, },
+ {9, 957, 526, {0x00, 0xF4, 0x50, 0x10, 0x68, 0x0E, 0xD8, 0x0D, 0x58, 0xBD, 0x03, 0x80}},
+ {6, 775, 426, {0x00, 0xF4, 0x70, 0x0D, 0x48, 0x0B, 0xB8, 0x0F, 0x50, 0x07, 0x03, 0x80}},
+ {4, 590, 324, {0x00, 0x7A, 0x88, 0x0A, 0x1C, 0x08, 0xB4, 0x0E, 0x50, 0x4E, 0x02, 0x80}},
+ },
+ },
+ /* CIF */
+ {
+ /* 5 fps */
+ {
+ {0, },
+ {0, },
+ {0, },
+ {0, },
+ },
+ /* 10 fps */
+ {
+ {0, },
+ {0, },
+ {0, },
+ {0, },
+ },
+ /* 15 fps */
+ {
+ {0, },
+ {0, },
+ {0, },
+ {0, },
+ },
+ /* 20 fps */
+ {
+ {0, },
+ {0, },
+ {0, },
+ {0, },
+ },
+ /* 25 fps */
+ {
+ {0, },
+ {0, },
+ {0, },
+ {0, },
+ },
+ /* 30 fps */
+ {
+ {0, },
+ {0, },
+ {0, },
+ {0, },
+ },
+ },
+ /* VGA */
+ {
+ /* 5 fps */
+ {
+ {0, },
+ {6, 773, 1272, {0x25, 0xF4, 0x30, 0x27, 0xB6, 0x24, 0x96, 0x02, 0x30, 0x05, 0x03, 0x80}},
+ {4, 592, 976, {0x25, 0xF4, 0x50, 0x1E, 0x78, 0x1B, 0x58, 0x03, 0x30, 0x50, 0x02, 0x80}},
+ {3, 448, 738, {0x25, 0xF4, 0x90, 0x17, 0x0C, 0x13, 0xEC, 0x04, 0x30, 0xC0, 0x01, 0x80}},
+ },
+ /* 10 fps */
+ {
+ {0, },
+ {9, 956, 788, {0x24, 0xF4, 0x70, 0x18, 0x9C, 0x15, 0x7C, 0x03, 0x48, 0xBC, 0x03, 0x80}},
+ {6, 776, 640, {0x24, 0xF4, 0xB0, 0x13, 0xFC, 0x11, 0x2C, 0x04, 0x48, 0x08, 0x03, 0x80}},
+ {4, 592, 488, {0x24, 0x7A, 0xE8, 0x0F, 0x3C, 0x0C, 0x6C, 0x06, 0x48, 0x50, 0x02, 0x80}},
+ },
+ /* 15 fps */
+ {
+ {0, },
+ {9, 957, 526, {0x23, 0x7A, 0xE8, 0x10, 0x68, 0x0D, 0x98, 0x06, 0x58, 0xBD, 0x03, 0x80}},
+ {9, 957, 526, {0x23, 0x7A, 0xE8, 0x10, 0x68, 0x0D, 0x98, 0x06, 0x58, 0xBD, 0x03, 0x80}},
+ {8, 895, 492, {0x23, 0x7A, 0xE8, 0x0F, 0x5D, 0x0C, 0x8D, 0x06, 0x58, 0x7F, 0x03, 0x80}},
+ },
+ /* 20 fps */
+ {
+ {0, },
+ {0, },
+ {0, },
+ {0, },
+ },
+ /* 25 fps */
+ {
+ {0, },
+ {0, },
+ {0, },
+ {0, },
+ },
+ /* 30 fps */
+ {
+ {0, },
+ {0, },
+ {0, },
+ {0, },
+ },
+ },
--- /dev/null
+ /* SQCIF */
+ {
+ {0, 0, {0x04, 0x01, 0x03}},
+ {8, 0, {0x05, 0x01, 0x03}},
+ {7, 0, {0x08, 0x01, 0x03}},
+ {7, 0, {0x0A, 0x01, 0x03}},
+ {6, 0, {0x0C, 0x01, 0x03}},
+ {5, 0, {0x0F, 0x01, 0x03}},
+ {4, 0, {0x14, 0x01, 0x03}},
+ {3, 0, {0x18, 0x01, 0x03}},
+ },
+ /* QSIF */
+ {
+ {0},
+ {0},
+ {0},
+ {0},
+ {0},
+ {0},
+ {0},
+ {0},
+ },
+ /* QCIF */
+ {
+ {0, 0, {0x04, 0x01, 0x02}},
+ {8, 0, {0x05, 0x01, 0x02}},
+ {7, 0, {0x08, 0x01, 0x02}},
+ {6, 0, {0x0A, 0x01, 0x02}},
+ {5, 0, {0x0C, 0x01, 0x02}},
+ {4, 0, {0x0F, 0x01, 0x02}},
+ {1, 0, {0x14, 0x01, 0x02}},
+ {1, 0, {0x18, 0x01, 0x02}},
+ },
+ /* SIF */
+ {
+ {0},
+ {0},
+ {0},
+ {0},
+ {0},
+ {0},
+ {0},
+ {0},
+ },
+ /* CIF */
+ {
+ {4, 0, {0x04, 0x01, 0x01}},
+ {7, 1, {0x05, 0x03, 0x01}},
+ {6, 1, {0x08, 0x03, 0x01}},
+ {4, 1, {0x0A, 0x03, 0x01}},
+ {3, 1, {0x0C, 0x03, 0x01}},
+ {2, 1, {0x0F, 0x03, 0x01}},
+ {0},
+ {0},
+ },
+ /* VGA */
+ {
+ {0},
+ {0},
+ {0},
+ {0},
+ {0},
+ {0},
+ {0},
+ {0},
+ },
--- /dev/null
+ /* SQCIF */
+ {
+ /* 5 fps */
+ {
+ {1, 140, 0, {0x05, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x8C, 0xFC, 0x80, 0x02}},
+ {1, 140, 0, {0x05, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x8C, 0xFC, 0x80, 0x02}},
+ {1, 140, 0, {0x05, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x8C, 0xFC, 0x80, 0x02}},
+ {1, 140, 0, {0x05, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x8C, 0xFC, 0x80, 0x02}},
+ },
+ /* 10 fps */
+ {
+ {2, 280, 0, {0x04, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x18, 0xA9, 0x80, 0x02}},
+ {2, 280, 0, {0x04, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x18, 0xA9, 0x80, 0x02}},
+ {2, 280, 0, {0x04, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x18, 0xA9, 0x80, 0x02}},
+ {2, 280, 0, {0x04, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x18, 0xA9, 0x80, 0x02}},
+ },
+ /* 15 fps */
+ {
+ {3, 410, 0, {0x03, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x9A, 0x71, 0x80, 0x02}},
+ {3, 410, 0, {0x03, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x9A, 0x71, 0x80, 0x02}},
+ {3, 410, 0, {0x03, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x9A, 0x71, 0x80, 0x02}},
+ {3, 410, 0, {0x03, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x9A, 0x71, 0x80, 0x02}},
+ },
+ /* 20 fps */
+ {
+ {4, 559, 0, {0x02, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x2F, 0x56, 0x80, 0x02}},
+ {4, 559, 0, {0x02, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x2F, 0x56, 0x80, 0x02}},
+ {4, 559, 0, {0x02, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x2F, 0x56, 0x80, 0x02}},
+ {4, 559, 0, {0x02, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x2F, 0x56, 0x80, 0x02}},
+ },
+ /* 25 fps */
+ {
+ {5, 659, 0, {0x01, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x93, 0x46, 0x80, 0x02}},
+ {5, 659, 0, {0x01, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x93, 0x46, 0x80, 0x02}},
+ {5, 659, 0, {0x01, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x93, 0x46, 0x80, 0x02}},
+ {5, 659, 0, {0x01, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x93, 0x46, 0x80, 0x02}},
+ },
+ /* 30 fps */
+ {
+ {7, 838, 0, {0x00, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x46, 0x3B, 0x80, 0x02}},
+ {7, 838, 0, {0x00, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x46, 0x3B, 0x80, 0x02}},
+ {7, 838, 0, {0x00, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x46, 0x3B, 0x80, 0x02}},
+ {7, 838, 0, {0x00, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x46, 0x3B, 0x80, 0x02}},
+ },
+ },
+ /* QSIF */
+ {
+ /* 5 fps */
+ {
+ {1, 146, 0, {0x2D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0xFC, 0xC0, 0x02}},
+ {1, 146, 0, {0x2D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0xFC, 0xC0, 0x02}},
+ {1, 146, 0, {0x2D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0xFC, 0xC0, 0x02}},
+ {1, 146, 0, {0x2D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0xFC, 0xC0, 0x02}},
+ },
+ /* 10 fps */
+ {
+ {2, 291, 0, {0x2C, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x23, 0xA1, 0xC0, 0x02}},
+ {1, 191, 630, {0x2C, 0xF4, 0x05, 0x13, 0xA9, 0x12, 0xE1, 0x17, 0x08, 0xBF, 0xF4, 0xC0, 0x02}},
+ {1, 191, 630, {0x2C, 0xF4, 0x05, 0x13, 0xA9, 0x12, 0xE1, 0x17, 0x08, 0xBF, 0xF4, 0xC0, 0x02}},
+ {1, 191, 630, {0x2C, 0xF4, 0x05, 0x13, 0xA9, 0x12, 0xE1, 0x17, 0x08, 0xBF, 0xF4, 0xC0, 0x02}},
+ },
+ /* 15 fps */
+ {
+ {3, 437, 0, {0x2B, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0xB5, 0x6D, 0xC0, 0x02}},
+ {2, 291, 640, {0x2B, 0xF4, 0x05, 0x13, 0xF7, 0x13, 0x2F, 0x13, 0x08, 0x23, 0xA1, 0xC0, 0x02}},
+ {2, 291, 640, {0x2B, 0xF4, 0x05, 0x13, 0xF7, 0x13, 0x2F, 0x13, 0x08, 0x23, 0xA1, 0xC0, 0x02}},
+ {1, 191, 420, {0x2B, 0xF4, 0x0D, 0x0D, 0x1B, 0x0C, 0x53, 0x1E, 0x08, 0xBF, 0xF4, 0xC0, 0x02}},
+ },
+ /* 20 fps */
+ {
+ {4, 588, 0, {0x2A, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x4C, 0x52, 0xC0, 0x02}},
+ {3, 447, 730, {0x2A, 0xF4, 0x05, 0x16, 0xC9, 0x16, 0x01, 0x0E, 0x18, 0xBF, 0x69, 0xC0, 0x02}},
+ {2, 292, 476, {0x2A, 0xF4, 0x0D, 0x0E, 0xD8, 0x0E, 0x10, 0x19, 0x18, 0x24, 0xA1, 0xC0, 0x02}},
+ {1, 192, 312, {0x2A, 0xF4, 0x1D, 0x09, 0xB3, 0x08, 0xEB, 0x1E, 0x18, 0xC0, 0xF4, 0xC0, 0x02}},
+ },
+ /* 25 fps */
+ {
+ {5, 703, 0, {0x29, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0xBF, 0x42, 0xC0, 0x02}},
+ {3, 447, 610, {0x29, 0xF4, 0x05, 0x13, 0x0B, 0x12, 0x43, 0x14, 0x18, 0xBF, 0x69, 0xC0, 0x02}},
+ {2, 292, 398, {0x29, 0xF4, 0x0D, 0x0C, 0x6C, 0x0B, 0xA4, 0x1E, 0x18, 0x24, 0xA1, 0xC0, 0x02}},
+ {1, 192, 262, {0x29, 0xF4, 0x25, 0x08, 0x23, 0x07, 0x5B, 0x1E, 0x18, 0xC0, 0xF4, 0xC0, 0x02}},
+ },
+ /* 30 fps */
+ {
+ {8, 873, 0, {0x28, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x69, 0x37, 0xC0, 0x02}},
+ {5, 704, 774, {0x28, 0xF4, 0x05, 0x18, 0x21, 0x17, 0x59, 0x0F, 0x18, 0xC0, 0x42, 0xC0, 0x02}},
+ {3, 448, 492, {0x28, 0xF4, 0x05, 0x0F, 0x5D, 0x0E, 0x95, 0x15, 0x18, 0xC0, 0x69, 0xC0, 0x02}},
+ {2, 291, 320, {0x28, 0xF4, 0x1D, 0x09, 0xFB, 0x09, 0x33, 0x1E, 0x18, 0x23, 0xA1, 0xC0, 0x02}},
+ },
+ },
+ /* QCIF */
+ {
+ /* 5 fps */
+ {
+ {1, 193, 0, {0x0D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0xC1, 0xF4, 0xC0, 0x02}},
+ {1, 193, 0, {0x0D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0xC1, 0xF4, 0xC0, 0x02}},
+ {1, 193, 0, {0x0D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0xC1, 0xF4, 0xC0, 0x02}},
+ {1, 193, 0, {0x0D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0xC1, 0xF4, 0xC0, 0x02}},
+ },
+ /* 10 fps */
+ {
+ {3, 385, 0, {0x0C, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x81, 0x79, 0xC0, 0x02}},
+ {2, 291, 800, {0x0C, 0xF4, 0x05, 0x18, 0xF4, 0x18, 0x18, 0x11, 0x08, 0x23, 0xA1, 0xC0, 0x02}},
+ {2, 291, 800, {0x0C, 0xF4, 0x05, 0x18, 0xF4, 0x18, 0x18, 0x11, 0x08, 0x23, 0xA1, 0xC0, 0x02}},
+ {1, 194, 532, {0x0C, 0xF4, 0x05, 0x10, 0x9A, 0x0F, 0xBE, 0x1B, 0x08, 0xC2, 0xF0, 0xC0, 0x02}},
+ },
+ /* 15 fps */
+ {
+ {4, 577, 0, {0x0B, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x41, 0x52, 0xC0, 0x02}},
+ {3, 447, 818, {0x0B, 0xF4, 0x05, 0x19, 0x89, 0x18, 0xAD, 0x0F, 0x10, 0xBF, 0x69, 0xC0, 0x02}},
+ {2, 292, 534, {0x0B, 0xF4, 0x05, 0x10, 0xA3, 0x0F, 0xC7, 0x19, 0x10, 0x24, 0xA1, 0xC0, 0x02}},
+ {1, 195, 356, {0x0B, 0xF4, 0x15, 0x0B, 0x11, 0x0A, 0x35, 0x1E, 0x10, 0xC3, 0xF0, 0xC0, 0x02}},
+ },
+ /* 20 fps */
+ {
+ {6, 776, 0, {0x0A, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x08, 0x3F, 0xC0, 0x02}},
+ {4, 591, 804, {0x0A, 0xF4, 0x05, 0x19, 0x1E, 0x18, 0x42, 0x0F, 0x18, 0x4F, 0x4E, 0xC0, 0x02}},
+ {3, 447, 608, {0x0A, 0xF4, 0x05, 0x12, 0xFD, 0x12, 0x21, 0x15, 0x18, 0xBF, 0x69, 0xC0, 0x02}},
+ {2, 291, 396, {0x0A, 0xF4, 0x15, 0x0C, 0x5E, 0x0B, 0x82, 0x1E, 0x18, 0x23, 0xA1, 0xC0, 0x02}},
+ },
+ /* 25 fps */
+ {
+ {9, 928, 0, {0x09, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0xA0, 0x33, 0xC0, 0x02}},
+ {5, 703, 800, {0x09, 0xF4, 0x05, 0x18, 0xF4, 0x18, 0x18, 0x10, 0x18, 0xBF, 0x42, 0xC0, 0x02}},
+ {3, 447, 508, {0x09, 0xF4, 0x0D, 0x0F, 0xD2, 0x0E, 0xF6, 0x1B, 0x18, 0xBF, 0x69, 0xC0, 0x02}},
+ {2, 292, 332, {0x09, 0xF4, 0x1D, 0x0A, 0x5A, 0x09, 0x7E, 0x1E, 0x18, 0x24, 0xA1, 0xC0, 0x02}},
+ },
+ /* 30 fps */
+ {
+ {0, },
+ {9, 956, 876, {0x08, 0xF4, 0x05, 0x1B, 0x58, 0x1A, 0x7C, 0x0E, 0x20, 0xBC, 0x33, 0x10, 0x02}},
+ {4, 592, 542, {0x08, 0xF4, 0x05, 0x10, 0xE4, 0x10, 0x08, 0x17, 0x20, 0x50, 0x4E, 0x10, 0x02}},
+ {2, 291, 266, {0x08, 0xF4, 0x25, 0x08, 0x48, 0x07, 0x6C, 0x1E, 0x20, 0x23, 0xA1, 0x10, 0x02}},
+ },
+ },
+ /* SIF */
+ {
+ /* 5 fps */
+ {
+ {4, 582, 0, {0x35, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x46, 0x52, 0x60, 0x02}},
+ {3, 387, 1276, {0x35, 0xF4, 0x05, 0x27, 0xD8, 0x26, 0x48, 0x03, 0x10, 0x83, 0x79, 0x60, 0x02}},
+ {2, 291, 960, {0x35, 0xF4, 0x0D, 0x1D, 0xF2, 0x1C, 0x62, 0x04, 0x10, 0x23, 0xA1, 0x60, 0x02}},
+ {1, 191, 630, {0x35, 0xF4, 0x1D, 0x13, 0xA9, 0x12, 0x19, 0x05, 0x08, 0xBF, 0xF4, 0x60, 0x02}},
+ },
+ /* 10 fps */
+ {
+ {0, },
+ {6, 775, 1278, {0x34, 0xF4, 0x05, 0x27, 0xE8, 0x26, 0x58, 0x05, 0x30, 0x07, 0x3F, 0x10, 0x02}},
+ {3, 447, 736, {0x34, 0xF4, 0x15, 0x16, 0xFB, 0x15, 0x6B, 0x05, 0x18, 0xBF, 0x69, 0x10, 0x02}},
+ {2, 291, 480, {0x34, 0xF4, 0x2D, 0x0E, 0xF9, 0x0D, 0x69, 0x09, 0x18, 0x23, 0xA1, 0x10, 0x02}},
+ },
+ /* 15 fps */
+ {
+ {0, },
+ {9, 955, 1050, {0x33, 0xF4, 0x05, 0x20, 0xCF, 0x1F, 0x3F, 0x06, 0x48, 0xBB, 0x33, 0x10, 0x02}},
+ {4, 591, 650, {0x33, 0xF4, 0x15, 0x14, 0x44, 0x12, 0xB4, 0x08, 0x30, 0x4F, 0x4E, 0x10, 0x02}},
+ {3, 448, 492, {0x33, 0xF4, 0x25, 0x0F, 0x52, 0x0D, 0xC2, 0x09, 0x28, 0xC0, 0x69, 0x10, 0x02}},
+ },
+ /* 20 fps */
+ {
+ {0, },
+ {9, 958, 782, {0x32, 0xF4, 0x0D, 0x18, 0x6A, 0x16, 0xDA, 0x0B, 0x58, 0xBE, 0x33, 0xD0, 0x02}},
+ {5, 703, 574, {0x32, 0xF4, 0x1D, 0x11, 0xE7, 0x10, 0x57, 0x0B, 0x40, 0xBF, 0x42, 0xD0, 0x02}},
+ {3, 446, 364, {0x32, 0xF4, 0x3D, 0x0B, 0x5C, 0x09, 0xCC, 0x0E, 0x30, 0xBE, 0x69, 0xD0, 0x02}},
+ },
+ /* 25 fps */
+ {
+ {0, },
+ {9, 958, 654, {0x31, 0xF4, 0x15, 0x14, 0x66, 0x12, 0xD6, 0x0B, 0x50, 0xBE, 0x33, 0x90, 0x02}},
+ {6, 776, 530, {0x31, 0xF4, 0x25, 0x10, 0x8C, 0x0E, 0xFC, 0x0C, 0x48, 0x08, 0x3F, 0x90, 0x02}},
+ {4, 592, 404, {0x31, 0xF4, 0x35, 0x0C, 0x96, 0x0B, 0x06, 0x0B, 0x38, 0x50, 0x4E, 0x90, 0x02}},
+ },
+ /* 30 fps */
+ {
+ {0, },
+ {9, 957, 526, {0x30, 0xF4, 0x25, 0x10, 0x68, 0x0E, 0xD8, 0x0D, 0x58, 0xBD, 0x33, 0x60, 0x02}},
+ {6, 775, 426, {0x30, 0xF4, 0x35, 0x0D, 0x48, 0x0B, 0xB8, 0x0F, 0x50, 0x07, 0x3F, 0x60, 0x02}},
+ {4, 590, 324, {0x30, 0x7A, 0x4B, 0x0A, 0x1C, 0x08, 0xB4, 0x0E, 0x40, 0x4E, 0x52, 0x60, 0x02}},
+ },
+ },
+ /* CIF */
+ {
+ /* 5 fps */
+ {
+ {6, 771, 0, {0x15, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x3F, 0x80, 0x02}},
+ {4, 465, 1278, {0x15, 0xF4, 0x05, 0x27, 0xEE, 0x26, 0x36, 0x03, 0x18, 0xD1, 0x65, 0x80, 0x02}},
+ {2, 291, 800, {0x15, 0xF4, 0x15, 0x18, 0xF4, 0x17, 0x3C, 0x05, 0x18, 0x23, 0xA1, 0x80, 0x02}},
+ {1, 193, 528, {0x15, 0xF4, 0x2D, 0x10, 0x7E, 0x0E, 0xC6, 0x0A, 0x18, 0xC1, 0xF4, 0x80, 0x02}},
+ },
+ /* 10 fps */
+ {
+ {0, },
+ {9, 932, 1278, {0x14, 0xF4, 0x05, 0x27, 0xEE, 0x26, 0x36, 0x04, 0x30, 0xA4, 0x33, 0x10, 0x02}},
+ {4, 591, 812, {0x14, 0xF4, 0x15, 0x19, 0x56, 0x17, 0x9E, 0x06, 0x28, 0x4F, 0x4E, 0x10, 0x02}},
+ {2, 291, 400, {0x14, 0xF4, 0x3D, 0x0C, 0x7A, 0x0A, 0xC2, 0x0E, 0x28, 0x23, 0xA1, 0x10, 0x02}},
+ },
+ /* 15 fps */
+ {
+ {0, },
+ {9, 956, 876, {0x13, 0xF4, 0x0D, 0x1B, 0x58, 0x19, 0xA0, 0x05, 0x38, 0xBC, 0x33, 0x60, 0x02}},
+ {5, 703, 644, {0x13, 0xF4, 0x1D, 0x14, 0x1C, 0x12, 0x64, 0x08, 0x38, 0xBF, 0x42, 0x60, 0x02}},
+ {3, 448, 410, {0x13, 0xF4, 0x3D, 0x0C, 0xC4, 0x0B, 0x0C, 0x0E, 0x38, 0xC0, 0x69, 0x60, 0x02}},
+ },
+ /* 20 fps */
+ {
+ {0, },
+ {9, 956, 650, {0x12, 0xF4, 0x1D, 0x14, 0x4A, 0x12, 0x92, 0x09, 0x48, 0xBC, 0x33, 0x10, 0x03}},
+ {6, 776, 528, {0x12, 0xF4, 0x2D, 0x10, 0x7E, 0x0E, 0xC6, 0x0A, 0x40, 0x08, 0x3F, 0x10, 0x03}},
+ {4, 591, 402, {0x12, 0xF4, 0x3D, 0x0C, 0x8F, 0x0A, 0xD7, 0x0E, 0x40, 0x4F, 0x4E, 0x10, 0x03}},
+ },
+ /* 25 fps */
+ {
+ {0, },
+ {9, 956, 544, {0x11, 0xF4, 0x25, 0x10, 0xF4, 0x0F, 0x3C, 0x0A, 0x48, 0xBC, 0x33, 0xC0, 0x02}},
+ {7, 840, 478, {0x11, 0xF4, 0x2D, 0x0E, 0xEB, 0x0D, 0x33, 0x0B, 0x48, 0x48, 0x3B, 0xC0, 0x02}},
+ {5, 703, 400, {0x11, 0xF4, 0x3D, 0x0C, 0x7A, 0x0A, 0xC2, 0x0E, 0x48, 0xBF, 0x42, 0xC0, 0x02}},
+ },
+ /* 30 fps */
+ {
+ {0, },
+ {9, 956, 438, {0x10, 0xF4, 0x35, 0x0D, 0xAC, 0x0B, 0xF4, 0x0D, 0x50, 0xBC, 0x33, 0x10, 0x02}},
+ {7, 838, 384, {0x10, 0xF4, 0x45, 0x0B, 0xFD, 0x0A, 0x45, 0x0F, 0x50, 0x46, 0x3B, 0x10, 0x02}},
+ {6, 773, 354, {0x10, 0x7A, 0x4B, 0x0B, 0x0C, 0x09, 0x80, 0x10, 0x50, 0x05, 0x3F, 0x10, 0x02}},
+ },
+ },
+ /* VGA */
+ {
+ /* 5 fps */
+ {
+ {0, },
+ {6, 773, 1272, {0x1D, 0xF4, 0x15, 0x27, 0xB6, 0x24, 0x96, 0x02, 0x30, 0x05, 0x3F, 0x10, 0x02}},
+ {4, 592, 976, {0x1D, 0xF4, 0x25, 0x1E, 0x78, 0x1B, 0x58, 0x03, 0x30, 0x50, 0x4E, 0x10, 0x02}},
+ {3, 448, 738, {0x1D, 0xF4, 0x3D, 0x17, 0x0C, 0x13, 0xEC, 0x04, 0x30, 0xC0, 0x69, 0x10, 0x02}},
+ },
+ /* 10 fps */
+ {
+ {0, },
+ {9, 956, 788, {0x1C, 0xF4, 0x35, 0x18, 0x9C, 0x15, 0x7C, 0x03, 0x48, 0xBC, 0x33, 0x10, 0x02}},
+ {6, 776, 640, {0x1C, 0x7A, 0x53, 0x13, 0xFC, 0x11, 0x2C, 0x04, 0x48, 0x08, 0x3F, 0x10, 0x02}},
+ {4, 592, 488, {0x1C, 0x7A, 0x6B, 0x0F, 0x3C, 0x0C, 0x6C, 0x06, 0x48, 0x50, 0x4E, 0x10, 0x02}},
+ },
+ /* 15 fps */
+ {
+ {0, },
+ {9, 957, 526, {0x1B, 0x7A, 0x63, 0x10, 0x68, 0x0D, 0x98, 0x06, 0x58, 0xBD, 0x33, 0x80, 0x02}},
+ {9, 957, 526, {0x1B, 0x7A, 0x63, 0x10, 0x68, 0x0D, 0x98, 0x06, 0x58, 0xBD, 0x33, 0x80, 0x02}},
+ {8, 895, 492, {0x1B, 0x7A, 0x6B, 0x0F, 0x5D, 0x0C, 0x8D, 0x06, 0x58, 0x7F, 0x37, 0x80, 0x02}},
+ },
+ /* 20 fps */
+ {
+ {0, },
+ {0, },
+ {0, },
+ {0, },
+ },
+ /* 25 fps */
+ {
+ {0, },
+ {0, },
+ {0, },
+ {0, },
+ },
+ /* 30 fps */
+ {
+ {0, },
+ {0, },
+ {0, },
+ {0, },
+ },
+ },
+++ /dev/null
- /* SQCIF */
- {
- /* 5 fps */
- {
- {1, 140, 0, {0x05, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x8C, 0xFC, 0x80, 0x02}},
- {1, 140, 0, {0x05, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x8C, 0xFC, 0x80, 0x02}},
- {1, 140, 0, {0x05, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x8C, 0xFC, 0x80, 0x02}},
- {1, 140, 0, {0x05, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x8C, 0xFC, 0x80, 0x02}},
- },
- /* 10 fps */
- {
- {2, 280, 0, {0x04, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x18, 0xA9, 0x80, 0x02}},
- {2, 280, 0, {0x04, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x18, 0xA9, 0x80, 0x02}},
- {2, 280, 0, {0x04, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x18, 0xA9, 0x80, 0x02}},
- {2, 280, 0, {0x04, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x18, 0xA9, 0x80, 0x02}},
- },
- /* 15 fps */
- {
- {3, 410, 0, {0x03, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x9A, 0x71, 0x80, 0x02}},
- {3, 410, 0, {0x03, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x9A, 0x71, 0x80, 0x02}},
- {3, 410, 0, {0x03, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x9A, 0x71, 0x80, 0x02}},
- {3, 410, 0, {0x03, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x9A, 0x71, 0x80, 0x02}},
- },
- /* 20 fps */
- {
- {4, 559, 0, {0x02, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x2F, 0x56, 0x80, 0x02}},
- {4, 559, 0, {0x02, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x2F, 0x56, 0x80, 0x02}},
- {4, 559, 0, {0x02, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x2F, 0x56, 0x80, 0x02}},
- {4, 559, 0, {0x02, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x2F, 0x56, 0x80, 0x02}},
- },
- /* 25 fps */
- {
- {5, 659, 0, {0x01, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x93, 0x46, 0x80, 0x02}},
- {5, 659, 0, {0x01, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x93, 0x46, 0x80, 0x02}},
- {5, 659, 0, {0x01, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x93, 0x46, 0x80, 0x02}},
- {5, 659, 0, {0x01, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x93, 0x46, 0x80, 0x02}},
- },
- /* 30 fps */
- {
- {7, 838, 0, {0x00, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x46, 0x3B, 0x80, 0x02}},
- {7, 838, 0, {0x00, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x46, 0x3B, 0x80, 0x02}},
- {7, 838, 0, {0x00, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x46, 0x3B, 0x80, 0x02}},
- {7, 838, 0, {0x00, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x46, 0x3B, 0x80, 0x02}},
- },
- },
- /* QSIF */
- {
- /* 5 fps */
- {
- {1, 146, 0, {0x2D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0xFC, 0xC0, 0x02}},
- {1, 146, 0, {0x2D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0xFC, 0xC0, 0x02}},
- {1, 146, 0, {0x2D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0xFC, 0xC0, 0x02}},
- {1, 146, 0, {0x2D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0xFC, 0xC0, 0x02}},
- },
- /* 10 fps */
- {
- {2, 291, 0, {0x2C, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x23, 0xA1, 0xC0, 0x02}},
- {1, 191, 630, {0x2C, 0xF4, 0x05, 0x13, 0xA9, 0x12, 0xE1, 0x17, 0x08, 0xBF, 0xF4, 0xC0, 0x02}},
- {1, 191, 630, {0x2C, 0xF4, 0x05, 0x13, 0xA9, 0x12, 0xE1, 0x17, 0x08, 0xBF, 0xF4, 0xC0, 0x02}},
- {1, 191, 630, {0x2C, 0xF4, 0x05, 0x13, 0xA9, 0x12, 0xE1, 0x17, 0x08, 0xBF, 0xF4, 0xC0, 0x02}},
- },
- /* 15 fps */
- {
- {3, 437, 0, {0x2B, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0xB5, 0x6D, 0xC0, 0x02}},
- {2, 291, 640, {0x2B, 0xF4, 0x05, 0x13, 0xF7, 0x13, 0x2F, 0x13, 0x08, 0x23, 0xA1, 0xC0, 0x02}},
- {2, 291, 640, {0x2B, 0xF4, 0x05, 0x13, 0xF7, 0x13, 0x2F, 0x13, 0x08, 0x23, 0xA1, 0xC0, 0x02}},
- {1, 191, 420, {0x2B, 0xF4, 0x0D, 0x0D, 0x1B, 0x0C, 0x53, 0x1E, 0x08, 0xBF, 0xF4, 0xC0, 0x02}},
- },
- /* 20 fps */
- {
- {4, 588, 0, {0x2A, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x4C, 0x52, 0xC0, 0x02}},
- {3, 447, 730, {0x2A, 0xF4, 0x05, 0x16, 0xC9, 0x16, 0x01, 0x0E, 0x18, 0xBF, 0x69, 0xC0, 0x02}},
- {2, 292, 476, {0x2A, 0xF4, 0x0D, 0x0E, 0xD8, 0x0E, 0x10, 0x19, 0x18, 0x24, 0xA1, 0xC0, 0x02}},
- {1, 192, 312, {0x2A, 0xF4, 0x1D, 0x09, 0xB3, 0x08, 0xEB, 0x1E, 0x18, 0xC0, 0xF4, 0xC0, 0x02}},
- },
- /* 25 fps */
- {
- {5, 703, 0, {0x29, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0xBF, 0x42, 0xC0, 0x02}},
- {3, 447, 610, {0x29, 0xF4, 0x05, 0x13, 0x0B, 0x12, 0x43, 0x14, 0x18, 0xBF, 0x69, 0xC0, 0x02}},
- {2, 292, 398, {0x29, 0xF4, 0x0D, 0x0C, 0x6C, 0x0B, 0xA4, 0x1E, 0x18, 0x24, 0xA1, 0xC0, 0x02}},
- {1, 192, 262, {0x29, 0xF4, 0x25, 0x08, 0x23, 0x07, 0x5B, 0x1E, 0x18, 0xC0, 0xF4, 0xC0, 0x02}},
- },
- /* 30 fps */
- {
- {8, 873, 0, {0x28, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x69, 0x37, 0xC0, 0x02}},
- {5, 704, 774, {0x28, 0xF4, 0x05, 0x18, 0x21, 0x17, 0x59, 0x0F, 0x18, 0xC0, 0x42, 0xC0, 0x02}},
- {3, 448, 492, {0x28, 0xF4, 0x05, 0x0F, 0x5D, 0x0E, 0x95, 0x15, 0x18, 0xC0, 0x69, 0xC0, 0x02}},
- {2, 291, 320, {0x28, 0xF4, 0x1D, 0x09, 0xFB, 0x09, 0x33, 0x1E, 0x18, 0x23, 0xA1, 0xC0, 0x02}},
- },
- },
- /* QCIF */
- {
- /* 5 fps */
- {
- {1, 193, 0, {0x0D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0xC1, 0xF4, 0xC0, 0x02}},
- {1, 193, 0, {0x0D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0xC1, 0xF4, 0xC0, 0x02}},
- {1, 193, 0, {0x0D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0xC1, 0xF4, 0xC0, 0x02}},
- {1, 193, 0, {0x0D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0xC1, 0xF4, 0xC0, 0x02}},
- },
- /* 10 fps */
- {
- {3, 385, 0, {0x0C, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x81, 0x79, 0xC0, 0x02}},
- {2, 291, 800, {0x0C, 0xF4, 0x05, 0x18, 0xF4, 0x18, 0x18, 0x11, 0x08, 0x23, 0xA1, 0xC0, 0x02}},
- {2, 291, 800, {0x0C, 0xF4, 0x05, 0x18, 0xF4, 0x18, 0x18, 0x11, 0x08, 0x23, 0xA1, 0xC0, 0x02}},
- {1, 194, 532, {0x0C, 0xF4, 0x05, 0x10, 0x9A, 0x0F, 0xBE, 0x1B, 0x08, 0xC2, 0xF0, 0xC0, 0x02}},
- },
- /* 15 fps */
- {
- {4, 577, 0, {0x0B, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x41, 0x52, 0xC0, 0x02}},
- {3, 447, 818, {0x0B, 0xF4, 0x05, 0x19, 0x89, 0x18, 0xAD, 0x0F, 0x10, 0xBF, 0x69, 0xC0, 0x02}},
- {2, 292, 534, {0x0B, 0xF4, 0x05, 0x10, 0xA3, 0x0F, 0xC7, 0x19, 0x10, 0x24, 0xA1, 0xC0, 0x02}},
- {1, 195, 356, {0x0B, 0xF4, 0x15, 0x0B, 0x11, 0x0A, 0x35, 0x1E, 0x10, 0xC3, 0xF0, 0xC0, 0x02}},
- },
- /* 20 fps */
- {
- {6, 776, 0, {0x0A, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x08, 0x3F, 0xC0, 0x02}},
- {4, 591, 804, {0x0A, 0xF4, 0x05, 0x19, 0x1E, 0x18, 0x42, 0x0F, 0x18, 0x4F, 0x4E, 0xC0, 0x02}},
- {3, 447, 608, {0x0A, 0xF4, 0x05, 0x12, 0xFD, 0x12, 0x21, 0x15, 0x18, 0xBF, 0x69, 0xC0, 0x02}},
- {2, 291, 396, {0x0A, 0xF4, 0x15, 0x0C, 0x5E, 0x0B, 0x82, 0x1E, 0x18, 0x23, 0xA1, 0xC0, 0x02}},
- },
- /* 25 fps */
- {
- {9, 928, 0, {0x09, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0xA0, 0x33, 0xC0, 0x02}},
- {5, 703, 800, {0x09, 0xF4, 0x05, 0x18, 0xF4, 0x18, 0x18, 0x10, 0x18, 0xBF, 0x42, 0xC0, 0x02}},
- {3, 447, 508, {0x09, 0xF4, 0x0D, 0x0F, 0xD2, 0x0E, 0xF6, 0x1B, 0x18, 0xBF, 0x69, 0xC0, 0x02}},
- {2, 292, 332, {0x09, 0xF4, 0x1D, 0x0A, 0x5A, 0x09, 0x7E, 0x1E, 0x18, 0x24, 0xA1, 0xC0, 0x02}},
- },
- /* 30 fps */
- {
- {0, },
- {9, 956, 876, {0x08, 0xF4, 0x05, 0x1B, 0x58, 0x1A, 0x7C, 0x0E, 0x20, 0xBC, 0x33, 0x10, 0x02}},
- {4, 592, 542, {0x08, 0xF4, 0x05, 0x10, 0xE4, 0x10, 0x08, 0x17, 0x20, 0x50, 0x4E, 0x10, 0x02}},
- {2, 291, 266, {0x08, 0xF4, 0x25, 0x08, 0x48, 0x07, 0x6C, 0x1E, 0x20, 0x23, 0xA1, 0x10, 0x02}},
- },
- },
- /* SIF */
- {
- /* 5 fps */
- {
- {4, 582, 0, {0x35, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x46, 0x52, 0x60, 0x02}},
- {3, 387, 1276, {0x35, 0xF4, 0x05, 0x27, 0xD8, 0x26, 0x48, 0x03, 0x10, 0x83, 0x79, 0x60, 0x02}},
- {2, 291, 960, {0x35, 0xF4, 0x0D, 0x1D, 0xF2, 0x1C, 0x62, 0x04, 0x10, 0x23, 0xA1, 0x60, 0x02}},
- {1, 191, 630, {0x35, 0xF4, 0x1D, 0x13, 0xA9, 0x12, 0x19, 0x05, 0x08, 0xBF, 0xF4, 0x60, 0x02}},
- },
- /* 10 fps */
- {
- {0, },
- {6, 775, 1278, {0x34, 0xF4, 0x05, 0x27, 0xE8, 0x26, 0x58, 0x05, 0x30, 0x07, 0x3F, 0x10, 0x02}},
- {3, 447, 736, {0x34, 0xF4, 0x15, 0x16, 0xFB, 0x15, 0x6B, 0x05, 0x18, 0xBF, 0x69, 0x10, 0x02}},
- {2, 291, 480, {0x34, 0xF4, 0x2D, 0x0E, 0xF9, 0x0D, 0x69, 0x09, 0x18, 0x23, 0xA1, 0x10, 0x02}},
- },
- /* 15 fps */
- {
- {0, },
- {9, 955, 1050, {0x33, 0xF4, 0x05, 0x20, 0xCF, 0x1F, 0x3F, 0x06, 0x48, 0xBB, 0x33, 0x10, 0x02}},
- {4, 591, 650, {0x33, 0xF4, 0x15, 0x14, 0x44, 0x12, 0xB4, 0x08, 0x30, 0x4F, 0x4E, 0x10, 0x02}},
- {3, 448, 492, {0x33, 0xF4, 0x25, 0x0F, 0x52, 0x0D, 0xC2, 0x09, 0x28, 0xC0, 0x69, 0x10, 0x02}},
- },
- /* 20 fps */
- {
- {0, },
- {9, 958, 782, {0x32, 0xF4, 0x0D, 0x18, 0x6A, 0x16, 0xDA, 0x0B, 0x58, 0xBE, 0x33, 0xD0, 0x02}},
- {5, 703, 574, {0x32, 0xF4, 0x1D, 0x11, 0xE7, 0x10, 0x57, 0x0B, 0x40, 0xBF, 0x42, 0xD0, 0x02}},
- {3, 446, 364, {0x32, 0xF4, 0x3D, 0x0B, 0x5C, 0x09, 0xCC, 0x0E, 0x30, 0xBE, 0x69, 0xD0, 0x02}},
- },
- /* 25 fps */
- {
- {0, },
- {9, 958, 654, {0x31, 0xF4, 0x15, 0x14, 0x66, 0x12, 0xD6, 0x0B, 0x50, 0xBE, 0x33, 0x90, 0x02}},
- {6, 776, 530, {0x31, 0xF4, 0x25, 0x10, 0x8C, 0x0E, 0xFC, 0x0C, 0x48, 0x08, 0x3F, 0x90, 0x02}},
- {4, 592, 404, {0x31, 0xF4, 0x35, 0x0C, 0x96, 0x0B, 0x06, 0x0B, 0x38, 0x50, 0x4E, 0x90, 0x02}},
- },
- /* 30 fps */
- {
- {0, },
- {9, 957, 526, {0x30, 0xF4, 0x25, 0x10, 0x68, 0x0E, 0xD8, 0x0D, 0x58, 0xBD, 0x33, 0x60, 0x02}},
- {6, 775, 426, {0x30, 0xF4, 0x35, 0x0D, 0x48, 0x0B, 0xB8, 0x0F, 0x50, 0x07, 0x3F, 0x60, 0x02}},
- {4, 590, 324, {0x30, 0x7A, 0x4B, 0x0A, 0x1C, 0x08, 0xB4, 0x0E, 0x40, 0x4E, 0x52, 0x60, 0x02}},
- },
- },
- /* CIF */
- {
- /* 5 fps */
- {
- {6, 771, 0, {0x15, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x3F, 0x80, 0x02}},
- {4, 465, 1278, {0x15, 0xF4, 0x05, 0x27, 0xEE, 0x26, 0x36, 0x03, 0x18, 0xD1, 0x65, 0x80, 0x02}},
- {2, 291, 800, {0x15, 0xF4, 0x15, 0x18, 0xF4, 0x17, 0x3C, 0x05, 0x18, 0x23, 0xA1, 0x80, 0x02}},
- {1, 193, 528, {0x15, 0xF4, 0x2D, 0x10, 0x7E, 0x0E, 0xC6, 0x0A, 0x18, 0xC1, 0xF4, 0x80, 0x02}},
- },
- /* 10 fps */
- {
- {0, },
- {9, 932, 1278, {0x14, 0xF4, 0x05, 0x27, 0xEE, 0x26, 0x36, 0x04, 0x30, 0xA4, 0x33, 0x10, 0x02}},
- {4, 591, 812, {0x14, 0xF4, 0x15, 0x19, 0x56, 0x17, 0x9E, 0x06, 0x28, 0x4F, 0x4E, 0x10, 0x02}},
- {2, 291, 400, {0x14, 0xF4, 0x3D, 0x0C, 0x7A, 0x0A, 0xC2, 0x0E, 0x28, 0x23, 0xA1, 0x10, 0x02}},
- },
- /* 15 fps */
- {
- {0, },
- {9, 956, 876, {0x13, 0xF4, 0x0D, 0x1B, 0x58, 0x19, 0xA0, 0x05, 0x38, 0xBC, 0x33, 0x60, 0x02}},
- {5, 703, 644, {0x13, 0xF4, 0x1D, 0x14, 0x1C, 0x12, 0x64, 0x08, 0x38, 0xBF, 0x42, 0x60, 0x02}},
- {3, 448, 410, {0x13, 0xF4, 0x3D, 0x0C, 0xC4, 0x0B, 0x0C, 0x0E, 0x38, 0xC0, 0x69, 0x60, 0x02}},
- },
- /* 20 fps */
- {
- {0, },
- {9, 956, 650, {0x12, 0xF4, 0x1D, 0x14, 0x4A, 0x12, 0x92, 0x09, 0x48, 0xBC, 0x33, 0x10, 0x03}},
- {6, 776, 528, {0x12, 0xF4, 0x2D, 0x10, 0x7E, 0x0E, 0xC6, 0x0A, 0x40, 0x08, 0x3F, 0x10, 0x03}},
- {4, 591, 402, {0x12, 0xF4, 0x3D, 0x0C, 0x8F, 0x0A, 0xD7, 0x0E, 0x40, 0x4F, 0x4E, 0x10, 0x03}},
- },
- /* 25 fps */
- {
- {0, },
- {9, 956, 544, {0x11, 0xF4, 0x25, 0x10, 0xF4, 0x0F, 0x3C, 0x0A, 0x48, 0xBC, 0x33, 0xC0, 0x02}},
- {7, 840, 478, {0x11, 0xF4, 0x2D, 0x0E, 0xEB, 0x0D, 0x33, 0x0B, 0x48, 0x48, 0x3B, 0xC0, 0x02}},
- {5, 703, 400, {0x11, 0xF4, 0x3D, 0x0C, 0x7A, 0x0A, 0xC2, 0x0E, 0x48, 0xBF, 0x42, 0xC0, 0x02}},
- },
- /* 30 fps */
- {
- {0, },
- {9, 956, 438, {0x10, 0xF4, 0x35, 0x0D, 0xAC, 0x0B, 0xF4, 0x0D, 0x50, 0xBC, 0x33, 0x10, 0x02}},
- {7, 838, 384, {0x10, 0xF4, 0x45, 0x0B, 0xFD, 0x0A, 0x45, 0x0F, 0x50, 0x46, 0x3B, 0x10, 0x02}},
- {6, 773, 354, {0x10, 0x7A, 0x4B, 0x0B, 0x0C, 0x09, 0x80, 0x10, 0x50, 0x05, 0x3F, 0x10, 0x02}},
- },
- },
- /* VGA */
- {
- /* 5 fps */
- {
- {0, },
- {6, 773, 1272, {0x1D, 0xF4, 0x15, 0x27, 0xB6, 0x24, 0x96, 0x02, 0x30, 0x05, 0x3F, 0x10, 0x02}},
- {4, 592, 976, {0x1D, 0xF4, 0x25, 0x1E, 0x78, 0x1B, 0x58, 0x03, 0x30, 0x50, 0x4E, 0x10, 0x02}},
- {3, 448, 738, {0x1D, 0xF4, 0x3D, 0x17, 0x0C, 0x13, 0xEC, 0x04, 0x30, 0xC0, 0x69, 0x10, 0x02}},
- },
- /* 10 fps */
- {
- {0, },
- {9, 956, 788, {0x1C, 0xF4, 0x35, 0x18, 0x9C, 0x15, 0x7C, 0x03, 0x48, 0xBC, 0x33, 0x10, 0x02}},
- {6, 776, 640, {0x1C, 0x7A, 0x53, 0x13, 0xFC, 0x11, 0x2C, 0x04, 0x48, 0x08, 0x3F, 0x10, 0x02}},
- {4, 592, 488, {0x1C, 0x7A, 0x6B, 0x0F, 0x3C, 0x0C, 0x6C, 0x06, 0x48, 0x50, 0x4E, 0x10, 0x02}},
- },
- /* 15 fps */
- {
- {0, },
- {9, 957, 526, {0x1B, 0x7A, 0x63, 0x10, 0x68, 0x0D, 0x98, 0x06, 0x58, 0xBD, 0x33, 0x80, 0x02}},
- {9, 957, 526, {0x1B, 0x7A, 0x63, 0x10, 0x68, 0x0D, 0x98, 0x06, 0x58, 0xBD, 0x33, 0x80, 0x02}},
- {8, 895, 492, {0x1B, 0x7A, 0x6B, 0x0F, 0x5D, 0x0C, 0x8D, 0x06, 0x58, 0x7F, 0x37, 0x80, 0x02}},
- },
- /* 20 fps */
- {
- {0, },
- {0, },
- {0, },
- {0, },
- },
- /* 25 fps */
- {
- {0, },
- {0, },
- {0, },
- {0, },
- },
- /* 30 fps */
- {
- {0, },
- {0, },
- {0, },
- {0, },
- },
- },
+/*
+ *
+ * Hardware accelerated Matrox Millennium I, II, Mystique, G100, G200, G400 and G450.
+ *
+ * (c) 1998-2001 Petr Vandrovec <vandrove@vc.cvut.cz>
+ *
+ * Version: 1.52 2001/05/25
+ *
+ */
+
#include "matroxfb_maven.h"
#include "matroxfb_crtc2.h"
#include "matroxfb_misc.h"
void* oldcrtc2;
d = kmalloc(sizeof(*d), GFP_KERNEL);
+ if (!d) {
+ return -ENOMEM;
+ }
memset(d, 0, sizeof(*d));
matroxfb_unregister_driver(&crtc2);
}
-MODULE_AUTHOR("(c) 1999,2000 Petr Vandrovec <vandrove@vc.cvut.cz>");
+MODULE_AUTHOR("(c) 1999-2001 Petr Vandrovec <vandrove@vc.cvut.cz>");
MODULE_DESCRIPTION("Matrox G400 CRTC2 driver");
module_init(matroxfb_crtc2_init);
module_exit(matroxfb_crtc2_exit);
to do in order to release the ramdisk memory is to destroy dirty buffers.
These are two special cases. Normal usage imply the device driver
- to issue a sync on the device (without waiting I/O completation) and
+ to issue a sync on the device (without waiting I/O completion) and
then an invalidate_buffers call that doesn't trash dirty buffers. */
void __invalidate_buffers(kdev_t dev, int destroy_dirty_buffers)
{
balance_dirty(NODEV);
if (free_shortage())
page_launder(GFP_BUFFER, 0);
- grow_buffers(size);
+ if (!grow_buffers(size)) {
+ wakeup_bdflush(1);
+ current->policy |= SCHED_YIELD;
+ __set_current_state(TASK_RUNNING);
+ schedule();
+ }
}
void init_buffer(struct buffer_head *bh, bh_end_io_t *handler, void *private)
write_unlock(&hash_table_lock);
spin_unlock(&lru_list_lock);
refill_freelist(size);
+ /* FIXME: getblk should fail if there's no enough memory */
goto repeat;
}
/* -1 -> no need to flush
0 -> async flush
- 1 -> sync flush (wait for I/O completation) */
+ 1 -> sync flush (wait for I/O completion) */
int balance_dirty_state(kdev_t dev)
{
unsigned long dirty, tot, hard_dirty_limit, soft_dirty_limit;
{
struct buffer_head *bh, *head, *tail;
+ /* FIXME: create_buffers should fail if there's no enough memory */
head = create_buffers(page, blocksize, 1);
if (page->buffers)
BUG();
spin_lock(&free_list[index].lock);
tmp = bh;
do {
- struct buffer_head *p = tmp;
-
- tmp = tmp->b_this_page;
- if (buffer_busy(p))
+ if (buffer_busy(tmp))
goto busy_buffer_page;
+ tmp = tmp->b_this_page;
} while (tmp != bh);
spin_lock(&unused_list_lock);
file_list_unlock();
}
-struct proc_dir_entry *proc_symlink(const char *name,
- struct proc_dir_entry *parent, const char *dest)
+static struct proc_dir_entry *proc_create(struct proc_dir_entry **parent,
+ const char *name,
+ mode_t mode,
+ nlink_t nlink)
{
struct proc_dir_entry *ent = NULL;
const char *fn = name;
int len;
- if (!parent && xlate_proc_name(name, &parent, &fn) != 0)
+ /* make sure name is valid */
+ if (!name || !strlen(name)) goto out;
+
+ if (!(*parent) && xlate_proc_name(name, parent, &fn) != 0)
goto out;
len = strlen(fn);
ent = kmalloc(sizeof(struct proc_dir_entry) + len + 1, GFP_KERNEL);
- if (!ent)
- goto out;
+ if (!ent) goto out;
+
memset(ent, 0, sizeof(struct proc_dir_entry));
- memcpy(((char *) ent) + sizeof(*ent), fn, len + 1);
+ memcpy(((char *) ent) + sizeof(struct proc_dir_entry), fn, len + 1);
ent->name = ((char *) ent) + sizeof(*ent);
ent->namelen = len;
- ent->nlink = 1;
- ent->mode = S_IFLNK|S_IRUGO|S_IWUGO|S_IXUGO;
- ent->data = kmalloc((ent->size=strlen(dest))+1, GFP_KERNEL);
- if (!ent->data) {
- kfree(ent);
- ent = NULL;
- goto out;
- }
- strcpy((char*)ent->data,dest);
+ ent->mode = mode;
+ ent->nlink = nlink;
+ out:
+ return ent;
+}
- proc_register(parent, ent);
-
-out:
+struct proc_dir_entry *proc_symlink(const char *name,
+ struct proc_dir_entry *parent, const char *dest)
+{
+ struct proc_dir_entry *ent;
+
+ ent = proc_create(&parent,name,
+ (S_IFLNK | S_IRUGO | S_IWUGO | S_IXUGO),1);
+
+ if (ent) {
+ ent->data = kmalloc((ent->size=strlen(dest))+1, GFP_KERNEL);
+ if (ent->data) {
+ strcpy((char*)ent->data,dest);
+ proc_register(parent, ent);
+ } else {
+ kfree(ent);
+ ent = NULL;
+ }
+ }
return ent;
}
struct proc_dir_entry *proc_mknod(const char *name, mode_t mode,
struct proc_dir_entry *parent, kdev_t rdev)
{
- struct proc_dir_entry *ent = NULL;
- const char *fn = name;
- int len;
-
- if (!parent && xlate_proc_name(name, &parent, &fn) != 0)
- goto out;
- len = strlen(fn);
-
- ent = kmalloc(sizeof(struct proc_dir_entry) + len + 1, GFP_KERNEL);
- if (!ent)
- goto out;
- memset(ent, 0, sizeof(struct proc_dir_entry));
- memcpy(((char *) ent) + sizeof(*ent), fn, len + 1);
- ent->name = ((char *) ent) + sizeof(*ent);
- ent->namelen = len;
- ent->nlink = 1;
- ent->mode = mode;
- ent->rdev = rdev;
+ struct proc_dir_entry *ent;
- proc_register(parent, ent);
-
-out:
+ ent = proc_create(&parent,name,mode,1);
+ if (ent) {
+ ent->rdev = rdev;
+ proc_register(parent, ent);
+ }
return ent;
}
struct proc_dir_entry *proc_mkdir(const char *name, struct proc_dir_entry *parent)
{
- struct proc_dir_entry *ent = NULL;
- const char *fn = name;
- int len;
+ struct proc_dir_entry *ent;
- if (!parent && xlate_proc_name(name, &parent, &fn) != 0)
- goto out;
- len = strlen(fn);
-
- ent = kmalloc(sizeof(struct proc_dir_entry) + len + 1, GFP_KERNEL);
- if (!ent)
- goto out;
- memset(ent, 0, sizeof(struct proc_dir_entry));
- memcpy(((char *) ent) + sizeof(*ent), fn, len + 1);
- ent->name = ((char *) ent) + sizeof(*ent);
- ent->namelen = len;
- ent->proc_fops = &proc_dir_operations;
- ent->proc_iops = &proc_dir_inode_operations;
- ent->nlink = 2;
- ent->mode = S_IFDIR | S_IRUGO | S_IXUGO;
+ ent = proc_create(&parent,name,
+ (S_IFDIR | S_IRUGO | S_IXUGO),2);
+ if (ent) {
+ ent->proc_fops = &proc_dir_operations;
+ ent->proc_iops = &proc_dir_inode_operations;
- proc_register(parent, ent);
-
-out:
+ proc_register(parent, ent);
+ }
return ent;
}
struct proc_dir_entry *create_proc_entry(const char *name, mode_t mode,
struct proc_dir_entry *parent)
{
- struct proc_dir_entry *ent = NULL;
- const char *fn = name;
- int len;
-
- if (!parent && xlate_proc_name(name, &parent, &fn) != 0)
- goto out;
- len = strlen(fn);
-
- ent = kmalloc(sizeof(struct proc_dir_entry) + len + 1, GFP_KERNEL);
- if (!ent)
- goto out;
- memset(ent, 0, sizeof(struct proc_dir_entry));
- memcpy(((char *) ent) + sizeof(*ent), fn, len + 1);
- ent->name = ((char *) ent) + sizeof(*ent);
- ent->namelen = len;
+ struct proc_dir_entry *ent;
+ nlink_t nlink;
if (S_ISDIR(mode)) {
if ((mode & S_IALLUGO) == 0)
- mode |= S_IRUGO | S_IXUGO;
- ent->proc_fops = &proc_dir_operations;
- ent->proc_iops = &proc_dir_inode_operations;
- ent->nlink = 2;
+ mode |= S_IRUGO | S_IXUGO;
+ nlink = 2;
} else {
if ((mode & S_IFMT) == 0)
mode |= S_IFREG;
if ((mode & S_IALLUGO) == 0)
mode |= S_IRUGO;
- ent->nlink = 1;
+ nlink = 1;
}
- ent->mode = mode;
- proc_register(parent, ent);
-
-out:
+ ent = proc_create(&parent,name,mode,nlink);
+ if (ent) {
+ if (S_ISDIR(mode)) {
+ ent->proc_fops = &proc_dir_operations;
+ ent->proc_iops = &proc_dir_inode_operations;
+ }
+ proc_register(parent, ent);
+ }
return ent;
}
static LIST_HEAD(vfsmntlist);
+struct vfsmount *alloc_vfsmnt(void)
+{
+ struct vfsmount *mnt = kmalloc(sizeof(struct vfsmount), GFP_KERNEL);
+ if (mnt) {
+ memset(mnt, 0, sizeof(struct vfsmount));
+ atomic_set(&mnt->mnt_count,1);
+ INIT_LIST_HEAD(&mnt->mnt_clash);
+ INIT_LIST_HEAD(&mnt->mnt_child);
+ INIT_LIST_HEAD(&mnt->mnt_mounts);
+ INIT_LIST_HEAD(&mnt->mnt_list);
+ mnt->mnt_owner = current->uid;
+ }
+ return mnt;
+}
+
static void detach_mnt(struct vfsmount *mnt, struct nameidata *old_nd)
{
old_nd->dentry = mnt->mnt_mountpoint;
* Potential reason for failure (aside of trivial lack of memory) is a
* deleted mountpoint. Caller must hold ->i_zombie on mountpoint
* dentry (if any).
- *
- * Node is marked as MNT_VISIBLE (visible in /proc/mounts) unless both
- * @nd and @devname are %NULL. It works since we pass non-%NULL @devname
- * when we are mounting root and kern_mount() filesystems are deviceless.
- * If we will get a kern_mount() filesystem with nontrivial @devname we
- * will have to pass the visibility flag explicitly, so if we will add
- * support for such beasts we'll have to change prototype.
*/
static struct vfsmount *add_vfsmnt(struct nameidata *nd,
struct super_block *sb = root->d_inode->i_sb;
char *name;
- mnt = kmalloc(sizeof(struct vfsmount), GFP_KERNEL);
+ mnt = alloc_vfsmnt();
if (!mnt)
goto out;
- memset(mnt, 0, sizeof(struct vfsmount));
-
- if (nd || dev_name)
- mnt->mnt_flags = MNT_VISIBLE;
/* It may be NULL, but who cares? */
if (dev_name) {
mnt->mnt_devname = name;
}
}
- mnt->mnt_owner = current->uid;
- atomic_set(&mnt->mnt_count,1);
mnt->mnt_sb = sb;
spin_lock(&dcache_lock);
} else {
mnt->mnt_mountpoint = mnt->mnt_root;
mnt->mnt_parent = mnt;
- INIT_LIST_HEAD(&mnt->mnt_child);
- INIT_LIST_HEAD(&mnt->mnt_clash);
}
- INIT_LIST_HEAD(&mnt->mnt_mounts);
list_add(&mnt->mnt_instances, &sb->s_mounts);
list_add(&mnt->mnt_list, vfsmntlist.prev);
spin_unlock(&dcache_lock);
+ if (sb->s_type->fs_flags & FS_SINGLE)
+ get_filesystem(sb->s_type);
out:
return mnt;
fail:
for (p = vfsmntlist.next; p != &vfsmntlist; p = p->next) {
struct vfsmount *tmp = list_entry(p, struct vfsmount, mnt_list);
- if (!(tmp->mnt_flags & MNT_VISIBLE))
- continue;
path = d_path(tmp->mnt_root, tmp, buffer, PAGE_SIZE);
if (!path)
continue;
sb = fs_type->kern_mnt->mnt_sb;
if (!sb)
BUG();
- get_filesystem(fs_type);
do_remount_sb(sb, flags, data);
return sb;
}
struct vfsmount *kern_mount(struct file_system_type *type)
{
- kdev_t dev = get_unnamed_dev();
struct super_block *sb;
- struct vfsmount *mnt;
- if (!dev)
+ struct vfsmount *mnt = alloc_vfsmnt();
+ kdev_t dev;
+
+ if (!mnt)
+ return ERR_PTR(-ENOMEM);
+
+ dev = get_unnamed_dev();
+ if (!dev) {
+ kfree(mnt);
return ERR_PTR(-EMFILE);
+ }
sb = read_super(dev, NULL, type, 0, NULL, 0);
if (!sb) {
put_unnamed_dev(dev);
+ kfree(mnt);
return ERR_PTR(-EINVAL);
}
- mnt = add_vfsmnt(NULL, sb->s_root, NULL);
- if (!mnt) {
- kill_super(sb);
- return ERR_PTR(-ENOMEM);
- }
+ mnt->mnt_sb = sb;
+ mnt->mnt_root = dget(sb->s_root);
+ mnt->mnt_mountpoint = mnt->mnt_root;
+ mnt->mnt_parent = mnt;
+ spin_lock(&dcache_lock);
+ list_add(&mnt->mnt_instances, &sb->s_mounts);
+ spin_unlock(&dcache_lock);
type->kern_mnt = mnt;
return mnt;
}
goto out2;
err = -ENOMEM;
- if (old_nd.mnt->mnt_sb->s_type->fs_flags & FS_SINGLE)
- get_filesystem(old_nd.mnt->mnt_sb->s_type);
down(&mount_sem);
/* there we go */
err = 0;
up(&new_nd.dentry->d_inode->i_zombie);
up(&mount_sem);
- if (err && old_nd.mnt->mnt_sb->s_type->fs_flags & FS_SINGLE)
- put_filesystem(old_nd.mnt->mnt_sb->s_type);
out2:
path_release(&new_nd);
out1:
return retval;
fail:
- if (fstype->fs_flags & FS_SINGLE)
- put_filesystem(fstype);
kill_super(sb);
goto unlock_out;
}
#define _LINUX_MOUNT_H
#ifdef __KERNEL__
-#define MNT_VISIBLE 1
-
struct vfsmount
{
struct dentry *mnt_mountpoint; /* dentry of mountpoint */
/* Power Management Registers */
+#define PCI_PM_PMC 2 /* PM Capabilities Register */
#define PCI_PM_CAP_VER_MASK 0x0007 /* Version */
#define PCI_PM_CAP_PME_CLOCK 0x0008 /* PME clock required */
-#define PCI_PM_CAP_AUX_POWER 0x0010 /* Auxilliary power support */
+#define PCI_PM_CAP_RESERVED 0x0010 /* Reserved field */
#define PCI_PM_CAP_DSI 0x0020 /* Device specific initialization */
+#define PCI_PM_CAP_AUX_POWER 0x01C0 /* Auxilliary power support mask */
#define PCI_PM_CAP_D1 0x0200 /* D1 power state support */
#define PCI_PM_CAP_D2 0x0400 /* D2 power state support */
#define PCI_PM_CAP_PME 0x0800 /* PME pin supported */
+#define PCI_PM_CAP_PME_MASK 0xF800 /* PME Mask of all supported states */
+#define PCI_PM_CAP_PME_D0 0x0800 /* PME# from D0 */
+#define PCI_PM_CAP_PME_D1 0x1000 /* PME# from D1 */
+#define PCI_PM_CAP_PME_D2 0x2000 /* PME# from D2 */
+#define PCI_PM_CAP_PME_D3 0x4000 /* PME# from D3 (hot) */
+#define PCI_PM_CAP_PME_D3cold 0x8000 /* PME# from D3 (cold) */
#define PCI_PM_CTRL 4 /* PM control and status register */
#define PCI_PM_CTRL_STATE_MASK 0x0003 /* Current power state (D0 to D3) */
#define PCI_PM_CTRL_PME_ENABLE 0x0100 /* PME pin enable */
spin_unlock(&kmap_lock);
}
+#define POOL_SIZE 32
+
+/*
+ * This lock gets no contention at all, normally.
+ */
+static spinlock_t emergency_lock = SPIN_LOCK_UNLOCKED;
+
+int nr_emergency_pages;
+static LIST_HEAD(emergency_pages);
+
+int nr_emergency_bhs;
+static LIST_HEAD(emergency_bhs);
+
/*
* Simple bounce buffer support for highmem pages.
* This will be moved to the block layer in 2.5.
static inline void bounce_end_io (struct buffer_head *bh, int uptodate)
{
+ struct page *page;
struct buffer_head *bh_orig = (struct buffer_head *)(bh->b_private);
+ unsigned long flags;
bh_orig->b_end_io(bh_orig, uptodate);
- __free_page(bh->b_page);
+
+ page = bh->b_page;
+
+ spin_lock_irqsave(&emergency_lock, flags);
+ if (nr_emergency_pages >= POOL_SIZE)
+ __free_page(page);
+ else {
+ /*
+ * We are abusing page->list to manage
+ * the highmem emergency pool:
+ */
+ list_add(&page->list, &emergency_pages);
+ nr_emergency_pages++;
+ }
+
+ if (nr_emergency_bhs >= POOL_SIZE) {
#ifdef HIGHMEM_DEBUG
- /* Don't clobber the constructed slab cache */
- init_waitqueue_head(&bh->b_wait);
+ /* Don't clobber the constructed slab cache */
+ init_waitqueue_head(&bh->b_wait);
#endif
- kmem_cache_free(bh_cachep, bh);
+ kmem_cache_free(bh_cachep, bh);
+ } else {
+ /*
+ * Ditto in the bh case, here we abuse b_inode_buffers:
+ */
+ list_add(&bh->b_inode_buffers, &emergency_bhs);
+ nr_emergency_bhs++;
+ }
+ spin_unlock_irqrestore(&emergency_lock, flags);
+}
+
+static __init int init_emergency_pool(void)
+{
+ spin_lock_irq(&emergency_lock);
+ while (nr_emergency_pages < POOL_SIZE) {
+ struct page * page = alloc_page(GFP_ATOMIC);
+ if (!page) {
+ printk("couldn't refill highmem emergency pages");
+ break;
+ }
+ list_add(&page->list, &emergency_pages);
+ nr_emergency_pages++;
+ }
+ while (nr_emergency_bhs < POOL_SIZE) {
+ struct buffer_head * bh = kmem_cache_alloc(bh_cachep, SLAB_ATOMIC);
+ if (!bh) {
+ printk("couldn't refill highmem emergency bhs");
+ break;
+ }
+ list_add(&bh->b_inode_buffers, &emergency_bhs);
+ nr_emergency_bhs++;
+ }
+ spin_unlock_irq(&emergency_lock);
+ printk("allocated %d pages and %d bhs reserved for the highmem bounces\n",
+ nr_emergency_pages, nr_emergency_bhs);
+
+ return 0;
}
+__initcall(init_emergency_pool);
+
static void bounce_end_io_write (struct buffer_head *bh, int uptodate)
{
bounce_end_io(bh, uptodate);
bounce_end_io(bh, uptodate);
}
+struct page *alloc_bounce_page (void)
+{
+ struct list_head *tmp;
+ struct page *page;
+
+repeat_alloc:
+ page = alloc_page(GFP_BUFFER);
+ if (page)
+ return page;
+ /*
+ * No luck. First, kick the VM so it doesnt idle around while
+ * we are using up our emergency rations.
+ */
+ wakeup_bdflush(0);
+
+ /*
+ * Try to allocate from the emergency pool.
+ */
+ tmp = &emergency_pages;
+ spin_lock_irq(&emergency_lock);
+ if (!list_empty(tmp)) {
+ page = list_entry(tmp->next, struct page, list);
+ list_del(tmp->next);
+ nr_emergency_pages--;
+ }
+ spin_unlock_irq(&emergency_lock);
+ if (page)
+ return page;
+
+ /* we need to wait I/O completion */
+ run_task_queue(&tq_disk);
+
+ current->policy |= SCHED_YIELD;
+ __set_current_state(TASK_RUNNING);
+ schedule();
+ goto repeat_alloc;
+}
+
+struct buffer_head *alloc_bounce_bh (void)
+{
+ struct list_head *tmp;
+ struct buffer_head *bh;
+
+repeat_alloc:
+ bh = kmem_cache_alloc(bh_cachep, SLAB_BUFFER);
+ if (bh)
+ return bh;
+ /*
+ * No luck. First, kick the VM so it doesnt idle around while
+ * we are using up our emergency rations.
+ */
+ wakeup_bdflush(0);
+
+ /*
+ * Try to allocate from the emergency pool.
+ */
+ tmp = &emergency_bhs;
+ spin_lock_irq(&emergency_lock);
+ if (!list_empty(tmp)) {
+ bh = list_entry(tmp->next, struct buffer_head, b_inode_buffers);
+ list_del(tmp->next);
+ nr_emergency_bhs--;
+ }
+ spin_unlock_irq(&emergency_lock);
+ if (bh)
+ return bh;
+
+ /* we need to wait I/O completion */
+ run_task_queue(&tq_disk);
+
+ current->policy |= SCHED_YIELD;
+ __set_current_state(TASK_RUNNING);
+ schedule();
+ goto repeat_alloc;
+}
+
struct buffer_head * create_bounce(int rw, struct buffer_head * bh_orig)
{
struct page *page;
if (!PageHighMem(bh_orig->b_page))
return bh_orig;
-repeat_bh:
- bh = kmem_cache_alloc(bh_cachep, SLAB_BUFFER);
- if (!bh) {
- wakeup_bdflush(1); /* Sets task->state to TASK_RUNNING */
- goto repeat_bh;
- }
+ bh = alloc_bounce_bh();
/*
* This is wasteful for 1k buffers, but this is a stopgap measure
* and we are being ineffective anyway. This approach simplifies
* things immensly. On boxes with more than 4GB RAM this should
* not be an issue anyway.
*/
-repeat_page:
- page = alloc_page(GFP_BUFFER);
- if (!page) {
- wakeup_bdflush(1); /* Sets task->state to TASK_RUNNING */
- goto repeat_page;
- }
+ page = alloc_bounce_page();
+
set_bh_page(bh, page, 0);
bh->b_next = NULL;
water_mark = z->pages_high;
}
- if (z->free_pages + z->inactive_clean_pages > water_mark) {
+ if (z->free_pages + z->inactive_clean_pages >= water_mark) {
struct page *page = NULL;
/* If possible, reclaim a page directly. */
- if (direct_reclaim && z->free_pages < z->pages_min + 8)
+ if (direct_reclaim)
page = reclaim_page(z);
/* If that fails, fall back to rmqueue. */
if (!page)
if (order == 0 && (gfp_mask & __GFP_WAIT))
direct_reclaim = 1;
- /*
- * If we are about to get low on free pages and we also have
- * an inactive page shortage, wake up kswapd.
- */
- if (inactive_shortage() > inactive_target / 2 && free_shortage())
- wakeup_kswapd();
- /*
- * If we are about to get low on free pages and cleaning
- * the inactive_dirty pages would fix the situation,
- * wake up bdflush.
- */
- else if (free_shortage() && nr_inactive_dirty_pages > free_shortage()
- && nr_inactive_dirty_pages >= freepages.high)
- wakeup_bdflush(0);
-
try_again:
/*
* First, see if we have any zones with lots of free memory.
* before we get around to moving them to the other
* list, so this is a relatively cheap operation.
*/
- if (free_shortage())
+ if (free_shortage()) {
ret += page_launder(gfp_mask, user);
+ shrink_dcache_memory(DEF_PRIORITY, gfp_mask);
+ shrink_icache_memory(DEF_PRIORITY, gfp_mask);
+ }
/*
* If needed, we move pages from the active list
ret += refill_inactive(gfp_mask, user);
/*
- * Delete pages from the inode and dentry caches and
- * reclaim unused slab cache if memory is low.
+ * Reclaim unused slab cache if memory is low.
*/
- if (free_shortage()) {
- shrink_dcache_memory(DEF_PRIORITY, gfp_mask);
- shrink_icache_memory(DEF_PRIORITY, gfp_mask);
- } else {
- /*
- * Illogical, but true. At least for now.
- *
- * If we're _not_ under shortage any more, we
- * reap the caches. Why? Because a noticeable
- * part of the caches are the buffer-heads,
- * which we'll want to keep if under shortage.
- */
- kmem_cache_reap(gfp_mask);
- }
+ kmem_cache_reap(gfp_mask);
return ret;
}