mitsud90: Bugfixes for panorama mode

This commit is contained in:
Solomon Peachy 2024-01-11 22:27:08 -05:00
parent 123a357a73
commit fa74802dba

View file

@ -976,7 +976,7 @@ static int mitsud90_panorama_splitjob(struct mitsud90_printjob *injob, struct mi
newjobs[i]->hdr.sharp_v = 0;
newjobs[i]->hdr.pano.on = 1;
newjobs[i]->hdr.pano.total = numpanels;
newjobs[i]->hdr.pano.page = i;
newjobs[i]->hdr.pano.page = i + 1;
newjobs[i]->hdr.pano.rows = cpu_to_be16(panel_rows[i]);
newjobs[i]->hdr.pano.rows2 = cpu_to_be16(panel_rows[i] - 0x30);
newjobs[i]->hdr.pano.overlap = cpu_to_be16(overlap_rows);
@ -1097,12 +1097,12 @@ static int mitsud90_read_parse(void *vctx, const void **vjob, int data_fd, int c
/* Sanity check panorama parameters */
if (job->hdr.pano.on &&
ctx->conn->type == P_MITSU_D90) {
if ((be16_to_cpu(job->hdr.pano.total) < 2 &&
be16_to_cpu(job->hdr.pano.total) > 3) ||
(be16_to_cpu(job->hdr.pano.page) < 1 &&
be16_to_cpu(job->hdr.pano.page) > 3) ||
be16_to_cpu(job->hdr.pano.page) != (ctx->pano_page + 1) ||
be16_to_cpu(job->hdr.pano.rows != 2428) ||
if ((job->hdr.pano.total < 2 &&
job->hdr.pano.total > 3) ||
(job->hdr.pano.page < 1 &&
job->hdr.pano.page > 3) ||
job->hdr.pano.page != (ctx->pano_page + 1) ||
(job->hdr.pano.rows != 2428) ||
be16_to_cpu(job->hdr.pano.rows2 != (2428-0x30)) ||
be16_to_cpu(job->hdr.pano.overlap != 600)
) {
@ -1328,9 +1328,9 @@ static int mitsud90_main_loop(void *vctx, const void *vjob, int wait_for_return)
if (ctx->conn->type == P_MITSU_D90) {
if (job->hdr.pano.on) {
ctx->pano_page++;
if (be16_to_cpu(job->hdr.pano.page) != ctx->pano_page) {
if (job->hdr.pano.page != ctx->pano_page) {
ERROR("Invalid panorama state (page %d of %d)\n",
ctx->pano_page, be16_to_cpu(job->hdr.pano.page));
ctx->pano_page, job->hdr.pano.page);
return CUPS_BACKEND_FAILED;
}
if (copies > 1) {
@ -2428,7 +2428,7 @@ static const char *mitsud90_prefixes[] = {
/* Exported */
const struct dyesub_backend mitsud90_backend = {
.name = "Mitsubishi CP-D90/CP-M1/CP-W5000",
.version = "0.48" " (lib " LIBMITSU_VER ")",
.version = "0.49" " (lib " LIBMITSU_VER ")",
.flags = BACKEND_FLAG_DUMMYPRINT,
.uri_prefixes = mitsud90_prefixes,
.cmdline_arg = mitsud90_cmdline_arg,
@ -2459,6 +2459,7 @@ const struct dyesub_backend mitsud90_backend = {
* any sort of counters
* sleep and waking up
* cut limit?
* Job combining (M1 in particular, but D90 too maybe?)
* Validate Fujifilm ASK500 support & spool format (likely moot now)
* Validate Panorama mode
* W5000 validate media type vs loaded LUT, if possible?
@ -2482,10 +2483,10 @@ const struct dyesub_backend mitsud90_backend = {
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 MM == 0 for no margin cut, 1 for margin cut
QQ RR SS HH VV 00 00 00 00 00 ZZ 00 JJ II 09 7c QQ == 02 matte (D90) or 03 (M1), 00 glossy,
09 4c 00 00 02 58 00 0c 00 06 00 00 00 00 00 00 RR == 00 auto, (D90: 03 == fine, 02 == superfine), (M1: 05 == Fast)
Z0 Z1 Z2 00 00 00 00 00 00 00 00 00 00 00 00 00 SS == 00 colorcorr, 01 == none (always 01 on M1)
Z0 Z1 Z2 00 00 00 00 00 00 00 00 00 00 00 00 00 SS == 00 colorcorr, 01 == none (01 on M1 or D90 if LUT done in driver)
HH/VV sharpening for Horiz/Vert, 0-8, 0 is off, 4 is normal (always 00 on M1)
TT is waittime (100 max, always 100 on D90)
ZZ is 0x02 on M1, D90 see below
ZZ is 0x02 on M1, D90 see PANORAMA
Z0 is 0x01 (M1 windows) (00 Linux and d90 UNK!)
Z1 is RGB Rate (M1)
Z2 is OP Rate (M1)
@ -2501,7 +2502,7 @@ const struct dyesub_backend mitsud90_backend = {
9x6div3 == 2724 02 03 90 01 00 07 14 00 00 00 00 00 00
9x6div4 == 2628 03 02 97 01 00 05 22 00 00 07 ad 00 00
from [ZZ 00 03 03] onwards, only shows in 8x20" PANORAMA prints. Assume 2" overlap.
PANORAMA [ZZ 00 03 03] onwards, only shows in 8x20" PANORAMA prints. Assume 2" overlap.
ZZ == 00 (normal) or 01 (panorama)
JJ == 02 03 (num of panorama panels)
II == 01 02 03 (which panel # in panorama!)