From 2414d3c8ac40d9aec65a4650c41f6dcd1a45a02f Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Thu, 29 Aug 2024 10:37:03 -0400 Subject: [PATCH] kodak6900: Printer doesn't return a list of legal print sizes ...so don't check. --- backend_shinkos6145.c | 24 ++++++++++++++++++++---- backend_sinfonia.h | 1 + 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/backend_shinkos6145.c b/backend_shinkos6145.c index c4bc972..5bca1de 100644 --- a/backend_shinkos6145.c +++ b/backend_shinkos6145.c @@ -46,6 +46,8 @@ #warning "No dynamic loading support!" #endif +#define NATIVE_KA6900 + /* Image processing library function prototypes */ typedef void (*dump_announceFN)(FILE *fp); @@ -654,7 +656,9 @@ struct shinkos6145_ctx { static const char *s2245_drivermodes(uint8_t val); static int shinkos2245_get_imagecorr(struct shinkos6145_ctx *ctx, uint8_t options); +#ifdef NATIVE_KA6900 static int kodak6900_get_imagecorr(struct shinkos6145_ctx *ctx, uint8_t options, uint16_t rows); +#endif static int shinkos6145_get_imagecorr(struct shinkos6145_ctx *ctx); static int shinkos6145_get_eeprom(struct shinkos6145_ctx *ctx); @@ -806,9 +810,12 @@ static int shinkos6145_dump_corrdata(struct shinkos6145_ctx *ctx, const char *fn { int ret; +#ifdef NATIVE_KA6900 if (ctx->dev.conn->type == P_KODAK_6900) { ret = kodak6900_get_imagecorr(ctx, 0x0a, 2436); // XXX have to supply something.. this is HQ matte. - } else if (ctx->is_2245) { + } else +#endif + if (ctx->is_2245) { ret = shinkos2245_get_imagecorr(ctx, 0x0a); // XXX have to supply something.. this is HQ matte. } else { ret = shinkos6145_get_imagecorr(ctx); @@ -983,6 +990,8 @@ static int shinkos2245_get_imagecorr(struct shinkos6145_ctx *ctx, uint8_t option done: return ret; } + +#ifdef NATIVE_KA6900 static int kodak6900_get_imagecorr(struct shinkos6145_ctx *ctx, uint8_t options, uint16_t rows) { struct s2245_imagecorr_req cmd; @@ -1048,6 +1057,7 @@ static int kodak6900_get_imagecorr(struct shinkos6145_ctx *ctx, uint8_t options, done: return ret; } +#endif static int shinkos6145_get_eeprom(struct shinkos6145_ctx *ctx) { @@ -1636,7 +1646,8 @@ static int shinkos6145_main_loop(void *vctx, const void *vjob, int wait_for_retu ctx->media.items[i].code == job->jp.media) break; } - if (i == ctx->media.count) { + if (i == ctx->media.count && + ctx->dev.conn->type != P_KODAK_6900) { ERROR("Incorrect media loaded for print!\n"); return CUPS_BACKEND_HOLD; } @@ -1772,9 +1783,12 @@ top: /* Get image correction parameters if necessary */ if (updated || !ctx->corrdata || !ctx->corrdatalen) { +#ifdef NATIVE_KA6900 if (ctx->dev.conn->type == P_KODAK_6900) { ret = kodak6900_get_imagecorr(ctx, oc_mode, job->jp.rows); - } else if (ctx->is_2245) { + } else +#endif + if (ctx->is_2245) { ret = shinkos2245_get_imagecorr(ctx, oc_mode); } else { ret = shinkos6145_get_imagecorr(ctx); @@ -1891,8 +1905,10 @@ top: print.ipp = 0; /* Not used */ print.method = cpu_to_le32(job->jp.method | SINFONIA_PRINT28_METHOD_ERR_RECOVERY | SINFONIA_PRINT28_METHOD_PREHEAT); +#ifdef NATIVE_KA6900 if (ctx->dev.conn->type == P_KODAK_6900) print.method |= cpu_to_le32(SINFONIA_PRINT28_METHOD_IPPHDR); +#endif if ((ret = sinfonia_docmd(&ctx->dev, (uint8_t*)&print, sizeof(print), @@ -2100,7 +2116,7 @@ static const struct device_id shinkos6145_devices[] = { const struct dyesub_backend shinkos6145_backend = { .name = "Shinko/Sinfonia CHC-S6145/CS2/S2245/S3", - .version = "0.54" " (lib " LIBSINFONIA_VER ")", + .version = "0.55" " (lib " LIBSINFONIA_VER ")", .uri_prefixes = shinkos6145_prefixes, .devices = shinkos6145_devices, .cmdline_usage = shinkos6145_cmdline, diff --git a/backend_sinfonia.h b/backend_sinfonia.h index 0e3a975..cab6a38 100644 --- a/backend_sinfonia.h +++ b/backend_sinfonia.h @@ -646,6 +646,7 @@ struct kodak8810_cutlist { #define CODE_6x8 0x06 #define CODE_2x6 0x07 #define CODE_6x6 0x08 +// XXX 09, 10, 11 om 5/6" sizes? #define CODE_8x10 0x10 #define CODE_8x12 0x11