Commit 88c18346 authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds

[PATCH] remove non-cleanroom pwc driver compression

The original pwc author raised some questions about the reverse
engineering of the decompressor algorithms used in the pwc driver.
Having done some detailed investigation it appears those concerns that
clean room policy was not followed are reasonable.  I've also had a
friendly discussion with Philips to ask their view on this.

This removes the problem items of code which reduces the pwc
functionality in the kernel a little but leaves all the framework for
setup that will be needed for decompressors in user space (where they
eventually belong).  This change set is designed to be the minimal risk
change set given that 2.6.12 is hopefully close to hand, with a view to
merging the much updated pwc code in 2.6.13 series kernels.

Someone else can then redo the decompressors properly (clean room) in
user space.

Note that while its easy to say that it should have been caught earlier,
but the violation was really only obvious to someone who had access to
both the proprietary source and the 'GPL' source.
parent 5d9e4ea5
ifneq ($(KERNELRELEASE),) ifneq ($(KERNELRELEASE),)
pwc-objs := pwc-if.o pwc-misc.o pwc-ctrl.o pwc-uncompress.o pwc-dec1.o pwc-dec23.o pwc-kiara.o pwc-timon.o pwc-objs := pwc-if.o pwc-misc.o pwc-ctrl.o pwc-uncompress.o pwc-timon.o pwc-kiara.o
obj-$(CONFIG_USB_PWC) += pwc.o obj-$(CONFIG_USB_PWC) += pwc.o
......
...@@ -246,7 +246,7 @@ static inline int set_video_mode_Nala(struct pwc_device *pdev, int size, int fra ...@@ -246,7 +246,7 @@ static inline int set_video_mode_Nala(struct pwc_device *pdev, int size, int fra
switch(pdev->type) { switch(pdev->type) {
case 645: case 645:
case 646: case 646:
pwc_dec1_init(pdev->type, pdev->release, buf, pdev->decompress_data); /* pwc_dec1_init(pdev->type, pdev->release, buf, pdev->decompress_data); */
break; break;
case 675: case 675:
...@@ -256,7 +256,7 @@ static inline int set_video_mode_Nala(struct pwc_device *pdev, int size, int fra ...@@ -256,7 +256,7 @@ static inline int set_video_mode_Nala(struct pwc_device *pdev, int size, int fra
case 730: case 730:
case 740: case 740:
case 750: case 750:
pwc_dec23_init(pdev->type, pdev->release, buf, pdev->decompress_data); /* pwc_dec23_init(pdev->type, pdev->release, buf, pdev->decompress_data); */
break; break;
} }
} }
...@@ -318,8 +318,8 @@ static inline int set_video_mode_Timon(struct pwc_device *pdev, int size, int fr ...@@ -318,8 +318,8 @@ static inline int set_video_mode_Timon(struct pwc_device *pdev, int size, int fr
if (ret < 0) if (ret < 0)
return ret; return ret;
if (pChoose->bandlength > 0 && pdev->vpalette != VIDEO_PALETTE_RAW) /* if (pChoose->bandlength > 0 && pdev->vpalette != VIDEO_PALETTE_RAW)
pwc_dec23_init(pdev->type, pdev->release, buf, pdev->decompress_data); pwc_dec23_init(pdev->type, pdev->release, buf, pdev->decompress_data); */
pdev->cmd_len = 13; pdev->cmd_len = 13;
memcpy(pdev->cmd_buf, buf, 13); memcpy(pdev->cmd_buf, buf, 13);
...@@ -397,8 +397,8 @@ static inline int set_video_mode_Kiara(struct pwc_device *pdev, int size, int fr ...@@ -397,8 +397,8 @@ static inline int set_video_mode_Kiara(struct pwc_device *pdev, int size, int fr
if (ret < 0) if (ret < 0)
return ret; return ret;
if (pChoose->bandlength > 0 && pdev->vpalette != VIDEO_PALETTE_RAW) /* if (pChoose->bandlength > 0 && pdev->vpalette != VIDEO_PALETTE_RAW)
pwc_dec23_init(pdev->type, pdev->release, buf, pdev->decompress_data); pwc_dec23_init(pdev->type, pdev->release, buf, pdev->decompress_data); */
pdev->cmd_len = 12; pdev->cmd_len = 12;
memcpy(pdev->cmd_buf, buf, 12); memcpy(pdev->cmd_buf, buf, 12);
......
/* Linux driver for Philips webcam
Decompression for chipset version 1
(C) 2004 Luc Saillard (luc@saillard.org)
NOTE: this version of pwc is an unofficial (modified) release of pwc & pcwx
driver and thus may have bugs that are not present in the original version.
Please send bug reports and support requests to <luc@saillard.org>.
The decompression routines have been implemented by reverse-engineering the
Nemosoft binary pwcx module. Caveat emptor.
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 "pwc-dec1.h"
void pwc_dec1_init(int type, int release, void *buffer, void *table)
{
}
void pwc_dec1_exit(void)
{
}
/* Linux driver for Philips webcam
(C) 2004 Luc Saillard (luc@saillard.org)
NOTE: this version of pwc is an unofficial (modified) release of pwc & pcwx
driver and thus may have bugs that are not present in the original version.
Please send bug reports and support requests to <luc@saillard.org>.
The decompression routines have been implemented by reverse-engineering the
Nemosoft binary pwcx module. Caveat emptor.
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 PWC_DEC1_H
#define PWC_DEC1_H
void pwc_dec1_init(int type, int release, void *buffer, void *private_data);
void pwc_dec1_exit(void);
#endif
This diff is collapsed.
/* Linux driver for Philips webcam
(C) 2004 Luc Saillard (luc@saillard.org)
NOTE: this version of pwc is an unofficial (modified) release of pwc & pcwx
driver and thus may have bugs that are not present in the original version.
Please send bug reports and support requests to <luc@saillard.org>.
The decompression routines have been implemented by reverse-engineering the
Nemosoft binary pwcx module. Caveat emptor.
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 PWC_DEC23_H
#define PWC_DEC23_H
struct pwc_dec23_private
{
unsigned char xx,yy,zz,zzmask;
unsigned char table_0004[2*0x4000];
unsigned char table_8004[2*0x1000];
unsigned int table_a004[256*12];
unsigned char table_d004[8*256];
unsigned int table_d800[256];
unsigned int table_dc00[256];
};
void pwc_dec23_init(int type, int release, unsigned char *buffer, void *private_data);
void pwc_dec23_exit(void);
void pwc_dec23_decompress(const struct pwc_coord *image,
const struct pwc_coord *view,
const struct pwc_coord *offset,
const void *src,
void *dst,
int flags,
const void *data,
int bandlength);
#endif
...@@ -68,8 +68,6 @@ ...@@ -68,8 +68,6 @@
#include "pwc-ioctl.h" #include "pwc-ioctl.h"
#include "pwc-kiara.h" #include "pwc-kiara.h"
#include "pwc-timon.h" #include "pwc-timon.h"
#include "pwc-dec23.h"
#include "pwc-dec1.h"
#include "pwc-uncompress.h" #include "pwc-uncompress.h"
/* Function prototypes and driver templates */ /* Function prototypes and driver templates */
...@@ -322,6 +320,7 @@ static int pwc_allocate_buffers(struct pwc_device *pdev) ...@@ -322,6 +320,7 @@ static int pwc_allocate_buffers(struct pwc_device *pdev)
case 730: case 730:
case 740: case 740:
case 750: case 750:
#if 0
Trace(TRACE_MEMORY,"private_data(%zu)\n",sizeof(struct pwc_dec23_private)); Trace(TRACE_MEMORY,"private_data(%zu)\n",sizeof(struct pwc_dec23_private));
kbuf = kmalloc(sizeof(struct pwc_dec23_private), GFP_KERNEL); /* Timon & Kiara */ kbuf = kmalloc(sizeof(struct pwc_dec23_private), GFP_KERNEL); /* Timon & Kiara */
break; break;
...@@ -330,6 +329,8 @@ static int pwc_allocate_buffers(struct pwc_device *pdev) ...@@ -330,6 +329,8 @@ static int pwc_allocate_buffers(struct pwc_device *pdev)
/* TODO & FIXME */ /* TODO & FIXME */
kbuf = kmalloc(sizeof(struct pwc_dec23_private), GFP_KERNEL); kbuf = kmalloc(sizeof(struct pwc_dec23_private), GFP_KERNEL);
break; break;
#endif
;
} }
if (kbuf == NULL) { if (kbuf == NULL) {
Err("Failed to allocate decompress table.\n"); Err("Failed to allocate decompress table.\n");
...@@ -1131,11 +1132,11 @@ static int pwc_video_close(struct inode *inode, struct file *file) ...@@ -1131,11 +1132,11 @@ static int pwc_video_close(struct inode *inode, struct file *file)
case 730: case 730:
case 740: case 740:
case 750: case 750:
pwc_dec23_exit(); /* Timon & Kiara */ /* pwc_dec23_exit(); *//* Timon & Kiara */
break; break;
case 645: case 645:
case 646: case 646:
pwc_dec1_exit(); /* pwc_dec1_exit(); */
break; break;
} }
......
This diff is collapsed.
This diff is collapsed.
...@@ -122,6 +122,7 @@ int pwc_decompress(struct pwc_device *pdev) ...@@ -122,6 +122,7 @@ int pwc_decompress(struct pwc_device *pdev)
switch (pdev->type) switch (pdev->type)
{ {
#if 0
case 675: case 675:
case 680: case 680:
case 690: case 690:
...@@ -137,6 +138,7 @@ int pwc_decompress(struct pwc_device *pdev) ...@@ -137,6 +138,7 @@ int pwc_decompress(struct pwc_device *pdev)
case 645: case 645:
case 646: case 646:
/* TODO & FIXME */ /* TODO & FIXME */
#endif
return -ENXIO; /* No such device or address: missing decompressor */ return -ENXIO; /* No such device or address: missing decompressor */
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment