MP800/MP800R fixes and TPU support added, doc updates for MP980

merge-requests/1/head
Nicolas Martin 2008-12-21 14:51:26 +00:00
rodzic 8a48c49721
commit 316027d93d
5 zmienionych plików z 115 dodań i 63 usunięć

Wyświetl plik

@ -1,3 +1,11 @@
2008-12-21 Nicolas Martin <nicols-guest at users.alioth.debian.org>
* doc/descriptions/pixma.desc, doc/sane-pixma.man,
backend/pixma_mp150.c:
MP800/MP800R: Fixed bug and color planes shift issues, added TPU support
for 48 bits images depth up to 1200 dpi.
MP980: following a user feedback, declared as working.
Doc and man pages updated.
2008-12-18 m. allan noah <kitno455 a t gmail d o t com> 2008-12-18 m. allan noah <kitno455 a t gmail d o t com>
* backend/fujitsu.[ch]: backend v86 * backend/fujitsu.[ch]: backend v86
- get_pixelsize() sets back window ID for back side scans - get_pixelsize() sets back window ID for back side scans

Wyświetl plik

@ -132,13 +132,13 @@
/* PIXMA 2008 vintage */ /* PIXMA 2008 vintage */
#define MP980_PID 0x172d /* Untested */ #define MP980_PID 0x172d /* Untested */
#define MP630_PID 0x172e /* Untested */ #define MP630_PID 0x172e
#define MP620_PID 0x172f /* Untested */ #define MP620_PID 0x172f
#define MP540_PID 0x1730 /* Untested */ #define MP540_PID 0x1730 /* Untested */
#define MP480_PID 0x1731 /* Untested */ #define MP480_PID 0x1731 /* Untested */
#define MP240_PID 0x1732 /* Untested */ #define MP240_PID 0x1732 /* Untested */
#define MP260_PID 0x1733 /* Untested */ #define MP260_PID 0x1733 /* Untested */
#define MP190_PID 0x1734 /* Untested */ #define MP190_PID 0x1734
@ -359,7 +359,32 @@ select_source (pixma_t * s)
uint8_t *data; uint8_t *data;
data = pixma_newcmd (&mp->cb, cmd_select_source, 12, 0); data = pixma_newcmd (&mp->cb, cmd_select_source, 12, 0);
if (s->cfg->pid == MP830_PID) data[5] = ((mp->generation == 2) ? 1 : 0);
switch (s->param->source)
{
case PIXMA_SOURCE_FLATBED:
data[0] = 1;
data[1] = 1;
break;
case PIXMA_SOURCE_ADF:
data[0] = 2;
data[5] = 1;
data[6] = 1;
break;
case PIXMA_SOURCE_ADFDUP:
data[0] = 2;
data[5] = 3;
data[6] = 3;
break;
case PIXMA_SOURCE_TPU:
data[0] = 4;
data[1] = 2;
break;
}
/* if (s->cfg->pid == MP830_PID)
{ {
switch (s->param->source) switch (s->param->source)
{ {
@ -378,7 +403,6 @@ select_source (pixma_t * s)
case PIXMA_SOURCE_TPU: case PIXMA_SOURCE_TPU:
PDBG (pixma_dbg (1, "BUG:select_source(): unsupported source %d\n", PDBG (pixma_dbg (1, "BUG:select_source(): unsupported source %d\n",
s->param->source)); s->param->source));
/* fall through */
case PIXMA_SOURCE_FLATBED: case PIXMA_SOURCE_FLATBED:
data[0] = 1; data[0] = 1;
@ -394,7 +418,7 @@ select_source (pixma_t * s)
{ {
data[5] = 1; data[5] = 1;
} }
} } */
return pixma_exec (s, &mp->cb); return pixma_exec (s, &mp->cb);
} }
@ -412,7 +436,7 @@ send_get_tpu_info_3 (pixma_t * s)
} }
static int static int
send_set_tpu_info_3 (pixma_t * s) send_set_tpu_info (pixma_t * s)
{ {
mp150_t *mp = (mp150_t *) s->subdriver; mp150_t *mp = (mp150_t *) s->subdriver;
uint8_t *data; uint8_t *data;
@ -517,13 +541,9 @@ static unsigned
calc_shifting (pixma_t * s) calc_shifting (pixma_t * s)
{ {
mp150_t *mp = (mp150_t *) s->subdriver; mp150_t *mp = (mp150_t *) s->subdriver;
unsigned base_shift;
/* Default: no shift to apply (e.g. CIS sensord) */ /* If stripes shift needed (CCD devices), how many pixels shift */
mp->stripe_shift = 0; mp->stripe_shift = 0;
mp->color_shift = 0;
/* If color plane shift (CCD devices), how many pixels shift */
switch (s->cfg->pid) switch (s->cfg->pid)
{ {
case MP970_PID: /* MP970 at 4800 dpi */ case MP970_PID: /* MP970 at 4800 dpi */
@ -535,39 +555,54 @@ calc_shifting (pixma_t * s)
mp->stripe_shift = 3; mp->stripe_shift = 3;
} }
break; break;
case MP800_PID:
case MP800R_PID:
case MP830_PID:
case MP960_PID:
case MP810_PID: case MP810_PID:
if (s->param->xdpi == 2400) if (s->param->xdpi == 2400)
mp->stripe_shift = 3; mp->stripe_shift = 3;
break; break;
case MP800_PID:
case MP830_PID:
case MP960_PID:
default: /* all CIS devices */ default: /* Default, and all CIS devices */
break; break;
} }
if (has_ccd_sensor (s) && s->param->ydpi > 75) /* If color plane shift (CCD devices), how many pixels shift */
mp->color_shift = s->param->ydpi / 50; mp->color_shift = mp->shift[0] = mp->shift[1] = mp->shift[2] = 0;
if (s->param->ydpi > 75)
base_shift = get_cis_ccd_line_size (s) * mp->color_shift;
/* If color plane shift, how to apply the shift */
switch (s->cfg->pid)
{ {
case MP970_PID: switch (s->cfg->pid)
mp->shift[0] = 0; {
mp->shift[1] = base_shift; case MP970_PID:
mp->shift[2] = 2 * base_shift; mp->color_shift = s->param->ydpi / 50;
break; mp->shift[1] = mp->color_shift * get_cis_ccd_line_size (s);
mp->shift[0] = 0;
mp->shift[2] = 2 * mp->shift[1];
break;
case MP800_PID: case MP800_PID:
case MP810_PID: case MP800R_PID:
case MP830_PID: case MP830_PID:
case MP960_PID: mp->color_shift = s->param->ydpi / ((s->param->ydpi < 1200) ? 150 : 75);
default: if (is_scanning_from_tpu (s))
mp->shift[0] = 2 * base_shift; mp->color_shift = s->param->ydpi / 75;
mp->shift[1] = base_shift; mp->shift[1] = mp->color_shift * get_cis_ccd_line_size (s);
mp->shift[2] = 0; mp->shift[0] = 2 * mp->shift[1];
mp->shift[2] = 0;
break;
case MP810_PID:
case MP960_PID:
mp->color_shift = s->param->ydpi / 50;
mp->shift[1] = mp->color_shift * get_cis_ccd_line_size (s);
mp->shift[0] = 2 * mp->shift[1];
mp->shift[2] = 0;
break;
default:
break;
}
} }
return (2 * mp->color_shift + mp->stripe_shift); return (2 * mp->color_shift + mp->stripe_shift);
} }
@ -592,6 +627,7 @@ send_scan_param (pixma_t * s)
pixma_set_be32 (h, data + 0x14); pixma_set_be32 (h, data + 0x14);
data[0x18] = ((s->param->channels != 1) || is_ccd_grayscale (s)) ? 0x08 : 0x04; data[0x18] = ((s->param->channels != 1) || is_ccd_grayscale (s)) ? 0x08 : 0x04;
data[0x19] = s->param->depth * ((is_ccd_grayscale (s)) ? 3 : s->param->channels); /* bits per pixel */ data[0x19] = s->param->depth * ((is_ccd_grayscale (s)) ? 3 : s->param->channels); /* bits per pixel */
data[0x1a] = (is_scanning_from_tpu (s) ? 1 : 0);
data[0x20] = 0xff; data[0x20] = 0xff;
data[0x23] = 0x81; data[0x23] = 0x81;
data[0x26] = 0x02; data[0x26] = 0x02;
@ -857,15 +893,14 @@ shift_colors (uint8_t * dptr, uint8_t * sptr,
int * colshft, unsigned strshft) int * colshft, unsigned strshft)
{ {
unsigned i, sr, sg, sb, st; unsigned i, sr, sg, sb, st;
UNUSED(dpi);
UNUSED(pid);
sr = colshft[0]; sg = colshft[1]; sb = colshft[2]; sr = colshft[0]; sg = colshft[1]; sb = colshft[2];
for (i = 0; i < w; i++) for (i = 0; i < w; i++)
{ {
st = 0; /* stripes shift for MP970 at 4800 dpi, MP800, MP800R, MP810 at 2400 dpi */
/* MP970 at 4800 dpi exception stripes shift */ st = (i % 2 == 0) ? strshft : 0;
if (pid == MP970_PID && dpi == 4800 && i % 2 == 0) st = strshft;
/* MP810 at 2400 dpi exception stripes shift */
if (pid == MP810_PID && dpi == 2400 && i % 2 == 0) st = strshft;
*sptr++ = *(dptr++ + sr + st); *sptr++ = *(dptr++ + sr + st);
if (c == 6) *sptr++ = *(dptr++ + sr + st); if (c == 6) *sptr++ = *(dptr++ + sr + st);
@ -1067,7 +1102,7 @@ mp150_check_param (pixma_t * s, pixma_scan_param_t * sp)
sp->depth = 8; /* MP150 only supports 8 bit per channel. */ sp->depth = 8; /* MP150 only supports 8 bit per channel. */
#ifdef TPU_48 #ifdef TPU_48
#ifndef DEBUG_TPU_48 #ifndef DEBUG_TPU_48
if (mp->generation == 3 && sp->source == PIXMA_SOURCE_TPU) if (sp->source == PIXMA_SOURCE_TPU)
#endif #endif
sp->depth = 16; /* TPU in 16 bits mode */ sp->depth = 16; /* TPU in 16 bits mode */
#endif #endif
@ -1076,10 +1111,10 @@ mp150_check_param (pixma_t * s, pixma_scan_param_t * sp)
{ {
/* mod 32 and expansion of the X scan limits */ /* mod 32 and expansion of the X scan limits */
sp->w += (sp->x) % 32; sp->w += (sp->x) % 32;
sp->w = calc_raw_width (mp, sp);
sp->x = ALIGN_INF (sp->x, 32); sp->x = ALIGN_INF (sp->x, 32);
} }
sp->line_size = calc_raw_width (mp, sp) * sp->channels * (sp->depth / 8); sp->w = calc_raw_width (mp, sp);
sp->line_size = sp->w * sp->channels * (sp->depth / 8);
/* Some exceptions here for particular devices */ /* Some exceptions here for particular devices */
/* MX850 and MX7600 can scan up to 14" with ADF, but A4 11.7" in flatbed */ /* MX850 and MX7600 can scan up to 14" with ADF, but A4 11.7" in flatbed */
@ -1087,11 +1122,14 @@ mp150_check_param (pixma_t * s, pixma_scan_param_t * sp)
&& sp->source == PIXMA_SOURCE_FLATBED) && sp->source == PIXMA_SOURCE_FLATBED)
sp->h = MIN (sp->h, 877 * sp->ydpi / 75); sp->h = MIN (sp->h, 877 * sp->ydpi / 75);
/* MP970 in TPU mode: lowest res is 300 dpi */ /* TPU mode: lowest res is 150 or 300 dpi */
if (s->cfg->pid == MP970_PID && sp->source == PIXMA_SOURCE_TPU) if (sp->source == PIXMA_SOURCE_TPU)
{ {
uint8_t k; uint8_t k;
k = MAX (sp->xdpi, 300) / sp->xdpi; if (mp->generation >= 3)
k = MAX (sp->xdpi, 300) / sp->xdpi;
else
k = MAX (sp->xdpi, 150) / sp->xdpi;
sp->x *= k; sp->x *= k;
sp->y *= k; sp->y *= k;
sp->w *= k; sp->w *= k;
@ -1195,8 +1233,8 @@ mp150_scan (pixma_t * s)
if ((error >= 0) && !is_scanning_from_tpu (s)) if ((error >= 0) && !is_scanning_from_tpu (s))
for (i = (mp->generation == 3) ? 3 : 1 ; i > 0 && error >= 0; i--) for (i = (mp->generation == 3) ? 3 : 1 ; i > 0 && error >= 0; i--)
error = send_gamma_table (s); error = send_gamma_table (s);
else if (mp->generation == 3) /* FIXME: Does this apply also to gen2 ? */ else /* if (mp->generation == 3) FIXME: Does this apply also to gen1/2 ? YES */
error = send_set_tpu_info_3 (s); error = send_set_tpu_info (s);
} }
else /* ADF pageid != 0 and gen3 */ else /* ADF pageid != 0 and gen3 */
pixma_sleep (1000000); pixma_sleep (1000000);
@ -1281,7 +1319,7 @@ mp150_fill_buffer (pixma_t * s, pixma_imagebuf_t * ib)
#ifndef DEBUG_TPU_48 #ifndef DEBUG_TPU_48
#ifndef TPU_48 #ifndef TPU_48
#ifndef DEBUG_TPU_24 #ifndef DEBUG_TPU_24
if (mp->generation == 3 && is_scanning_from_tpu (s)) if (is_scanning_from_tpu (s))
#endif #endif
bytes_received = pack_48_24_bpc (mp->imgbuf + mp->data_left_len, bytes_received); bytes_received = pack_48_24_bpc (mp->imgbuf + mp->data_left_len, bytes_received);
#endif #endif
@ -1310,8 +1348,8 @@ mp150_finish_scan (pixma_t * s)
case state_scanning: case state_scanning:
case state_warmup: case state_warmup:
case state_finished: case state_finished:
/* For gen3 TPU , send the get TPU info message */ /* Send the get TPU info message */
if (mp->generation == 3 && is_scanning_from_tpu (s) && mp->tpu_datalen == 0) if (is_scanning_from_tpu (s) && mp->tpu_datalen == 0)
send_get_tpu_info_3 (s); send_get_tpu_info_3 (s);
/* FIXME: to process several pages ADF scan, must not send /* FIXME: to process several pages ADF scan, must not send
* abort_session and start_session between pages (last_block=0x28) */ * abort_session and start_session between pages (last_block=0x28) */

Wyświetl plik

@ -139,20 +139,20 @@
:model "PIXMA MP800" :model "PIXMA MP800"
:interface "USB" :interface "USB"
:usbid "0x04a9" "0x170d" :usbid "0x04a9" "0x170d"
:status :basic :status :good
:comment "No film scan." :comment "All resolutions supported up to 2400DPI. TPU scan up to 1200DPI."
:model "PIXMA MP800R" :model "PIXMA MP800R"
:interface "USB" :interface "USB"
:usbid "0x04a9" "0x170e" :usbid "0x04a9" "0x170e"
:status :basic :status :basic
:comment "No film scan." :comment "All resolutions supported up to 2400DPI. TPU scan up to 1200DPI."
:model "PIXMA MP810" :model "PIXMA MP810"
:interface "USB" :interface "USB"
:usbid "0x04a9" "0x171a" :usbid "0x04a9" "0x171a"
:status :good :status :good
:comment "All resolutions supported up to 4800 dpi (but vertical lines issue at 4800 dpi). USB Snoops needed for TPU film scan." :comment "All resolutions supported up to 2400DPI. Vertical stripes at 4800DPI. USB Snoops needed for TPU film scan."
:model "PIXMA MP830" :model "PIXMA MP830"
:interface "USB" :interface "USB"
@ -246,8 +246,8 @@
:model "PIXMA MP980" :model "PIXMA MP980"
:interface "USB Ethernet" :interface "USB Ethernet"
:usbid "0x04a9" "0x172d" :usbid "0x04a9" "0x172d"
:status :untested :status :good
:comment "Same protocol as Pixma Generation 3? Testers needed!" :comment "Reported to be working fine."
:model "PIXMA MP630" :model "PIXMA MP630"
:interface "USB" :interface "USB"
@ -288,8 +288,8 @@
:model "PIXMA MP190" :model "PIXMA MP190"
:interface "USB" :interface "USB"
:usbid "0x04a9" "0x1734" :usbid "0x04a9" "0x1734"
:status :untested :status :good
:comment "Same protocol as Pixma Generation 3? Testers needed!" :comment "All resolutions supported (up to 600DPI)"
:model "imageCLASS MF5630" :model "imageCLASS MF5630"
:interface "USB" :interface "USB"

Wyświetl plik

@ -1,4 +1,4 @@
.TH "sane\-pixma" "5" "25 Oct 2008" "@PACKAGEVERSION@" "SANE Scanner Access Now Easy" .TH "sane\-pixma" "5" "21 Dec 2008" "@PACKAGEVERSION@" "SANE Scanner Access Now Easy"
.IX sane\-pixma .IX sane\-pixma
.SH NAME .SH NAME
sane\-pixma \- SANE backend for Canon PIXMA MP series sane\-pixma \- SANE backend for Canon PIXMA MP series
@ -12,7 +12,7 @@ using Canon's BJNP protocol.
Currently, the following models work with this backend: Currently, the following models work with this backend:
.PP .PP
.RS .RS
PIXMA MP140, MP150, MP160, MP170, MP180, MP210, MP220 PIXMA MP140, MP150, MP160, MP170, MP180, MP190, MP210, MP220
.br .br
PIXMA MP450, MP460, MP470, MP500, MP510, MP520, MP530 PIXMA MP450, MP460, MP470, MP500, MP510, MP520, MP530
.br .br
@ -44,7 +44,7 @@ Feedback in the Sane-dev mailing list welcome.
.RS .RS
PIXMA MP740 PIXMA MP740
.br .br
PIXMA MP190, MP240, MP260, MP480, MP540, MP980 PIXMA MP240, MP260, MP480, MP540, MP980
.br .br
ImageCLASS MF3110, MF3240 ImageCLASS MF3110, MF3240
.br .br

Wyświetl plik

@ -97,6 +97,9 @@
/* Define to 1 if you have the `i386_set_ioperm' function. */ /* Define to 1 if you have the `i386_set_ioperm' function. */
#undef HAVE_I386_SET_IOPERM #undef HAVE_I386_SET_IOPERM
/* Define to 1 if you have the <ifaddrs.h> header file. */
#undef HAVE_IFADDRS_H
/* Define to 1 if you have the `inet_addr' function. */ /* Define to 1 if you have the `inet_addr' function. */
#undef HAVE_INET_ADDR #undef HAVE_INET_ADDR
@ -216,6 +219,9 @@
/* Define to 1 if you have the `pthread_testcancel' function. */ /* Define to 1 if you have the `pthread_testcancel' function. */
#undef HAVE_PTHREAD_TESTCANCEL #undef HAVE_PTHREAD_TESTCANCEL
/* Define to 1 if you have the <pwd.h> header file. */
#undef HAVE_PWD_H
/* define if you have the resmgr library */ /* define if you have the resmgr library */
#undef HAVE_RESMGR #undef HAVE_RESMGR