sinfonia: The 'Set Tone Curve' calls were using the wrong IDs.

This commit is contained in:
Solomon Peachy 2019-09-19 14:56:37 -04:00
parent 9f32458aec
commit 1f27acbfc8
5 changed files with 30 additions and 25 deletions

View File

@ -702,7 +702,7 @@ static int kodak605_cmdline_arg(void *vctx, int argc, char **argv)
j = sinfonia_gettonecurve(&ctx->dev, TONECURVE_USER, optarg);
break;
case 'C':
j = sinfonia_settonecurve(&ctx->dev, TONECURVE_USER, optarg);
j = sinfonia_settonecurve(&ctx->dev, UPDATE_TARGET_TONE_USER, optarg);
break;
case 'e':
j = sinfonia_geterrorlog(&ctx->dev);
@ -717,7 +717,7 @@ static int kodak605_cmdline_arg(void *vctx, int argc, char **argv)
j = sinfonia_gettonecurve(&ctx->dev, TONECURVE_CURRENT, optarg);
break;
case 'L':
j = sinfonia_settonecurve(&ctx->dev, TONECURVE_CURRENT, optarg);
j = sinfonia_settonecurve(&ctx->dev, UPDATE_TARGET_TONE_CURRENT, optarg);
break;
case 'm':
kodak605_dump_mediainfo(ctx->media);
@ -775,7 +775,7 @@ static const char *kodak605_prefixes[] = {
/* Exported */
struct dyesub_backend kodak605_backend = {
.name = "Kodak 605/70xx",
.version = "0.48" " (lib " LIBSINFONIA_VER ")",
.version = "0.49" " (lib " LIBSINFONIA_VER ")",
.uri_prefixes = kodak605_prefixes,
.cmdline_usage = kodak605_cmdline,
.cmdline_arg = kodak605_cmdline_arg,

View File

@ -896,7 +896,7 @@ int shinkos6145_cmdline_arg(void *vctx, int argc, char **argv)
j = sinfonia_gettonecurve(&ctx->dev, TONECURVE_USER, optarg);
break;
case 'C':
j = sinfonia_settonecurve(&ctx->dev, TONECURVE_USER, optarg);
j = sinfonia_settonecurve(&ctx->dev, UPDATE_TARGET_TONE_USER, optarg);
break;
case 'e':
j = sinfonia_geterrorlog(&ctx->dev);
@ -931,7 +931,7 @@ int shinkos6145_cmdline_arg(void *vctx, int argc, char **argv)
j = sinfonia_gettonecurve(&ctx->dev, TONECURVE_CURRENT, optarg);
break;
case 'L':
j = sinfonia_settonecurve(&ctx->dev, TONECURVE_CURRENT, optarg);
j = sinfonia_settonecurve(&ctx->dev, UPDATE_TARGET_TONE_CURRENT, optarg);
break;
case 'm':
dump_mediainfo(&ctx->media);
@ -1521,7 +1521,7 @@ static const char *shinkos6145_prefixes[] = {
struct dyesub_backend shinkos6145_backend = {
.name = "Shinko/Sinfonia CHC-S6145/CS2/S2245/S3",
.version = "0.41" " (lib " LIBSINFONIA_VER ")",
.version = "0.42" " (lib " LIBSINFONIA_VER ")",
.uri_prefixes = shinkos6145_prefixes,
.cmdline_usage = shinkos6145_cmdline,
.cmdline_arg = shinkos6145_cmdline_arg,

View File

@ -826,7 +826,7 @@ int shinkos6245_cmdline_arg(void *vctx, int argc, char **argv)
j = sinfonia_gettonecurve(&ctx->dev, TONECURVE_USER, optarg);
break;
case 'C':
j = sinfonia_settonecurve(&ctx->dev, TONECURVE_USER, optarg);
j = sinfonia_settonecurve(&ctx->dev, UPDATE_TARGET_TONE_USER, optarg);
break;
case 'e':
if (ctx->dev.type == P_KODAK_8810) {
@ -865,7 +865,7 @@ int shinkos6245_cmdline_arg(void *vctx, int argc, char **argv)
j = sinfonia_gettonecurve(&ctx->dev, TONECURVE_CURRENT, optarg);
break;
case 'L':
j = sinfonia_settonecurve(&ctx->dev, TONECURVE_CURRENT, optarg);
j = sinfonia_settonecurve(&ctx->dev, UPDATE_TARGET_TONE_CURRENT, optarg);
break;
case 'm':
dump_mediainfo(&ctx->media);
@ -1257,7 +1257,7 @@ static const char *shinkos6245_prefixes[] = {
struct dyesub_backend shinkos6245_backend = {
.name = "Sinfonia CHC-S6245 / Kodak 8810",
.version = "0.26" " (lib " LIBSINFONIA_VER ")",
.version = "0.27" " (lib " LIBSINFONIA_VER ")",
.uri_prefixes = shinkos6245_prefixes,
.cmdline_usage = shinkos6245_cmdline,
.cmdline_arg = shinkos6245_cmdline_arg,

View File

@ -660,7 +660,7 @@ int sinfonia_settonecurve(struct sinfonia_usbdev *usbh, int target, char *fname)
struct sinfonia_status_hdr resp;
int ret, num = 0;
INFO("Set %s Tone Curve from '%s'\n", sinfonia_update_targets(target), fname);
INFO("Set %s from '%s'\n", sinfonia_update_targets(target), fname);
uint16_t *data = malloc(TONE_CURVE_SIZE * sizeof(uint16_t));
if (!data) {
@ -780,10 +780,16 @@ int sinfonia_query_serno(struct libusb_device_handle *dev, uint8_t endp_up, uint
const char *sinfonia_update_targets (uint8_t v) {
switch (v) {
case UPDATE_TARGET_USER:
return "User";
case UPDATE_TARGET_CURRENT:
return "Current";
case UPDATE_TARGET_TONE_USER:
return "User Tone Curve";
case UPDATE_TARGET_TONE_CURRENT:
return "Current Tone Curve";
case UPDATE_TARGET_LAM_USER:
return "User Lamination Data";
case UPDATE_TARGET_LAM_CUR:
return "Current Lamination Data";
case UPDATE_TARGET_LAM_DEF:
return "Default Lamination Data";
default:
return "Unknown";
}

View File

@ -27,7 +27,7 @@
*
*/
#define LIBSINFONIA_VER "0.10"
#define LIBSINFONIA_VER "0.11"
#define SINFONIA_HDR1_LEN 0x10
#define SINFONIA_HDR2_LEN 0x64
@ -102,12 +102,11 @@ int sinfonia_query_serno(struct libusb_device_handle *dev, uint8_t endp_up, uint
const char *sinfonia_bank_statuses(uint8_t v);
#define UPDATE_TARGET_USER 0x03
#define UPDATE_TARGET_CURRENT 0x04
#define UPDATE_TARGET_LAM1 0x10
#define UPDATE_TARGET_LAM2 0x11
// XXX 0x10 (len 0x22e3e0), 0x11 (len 0x447c68 on EK701x)
// XXX 0x10, len 0x884100 on EK8810
#define UPDATE_TARGET_TONE_USER 0x03
#define UPDATE_TARGET_TONE_CURRENT 0x04
#define UPDATE_TARGET_LAM_USER 0x10
#define UPDATE_TARGET_LAM_DEF 0x11
#define UPDATE_TARGET_LAM_CUR 0x12
/* Update is three channels, Y, M, C;
each is 256 entries of 11-bit data padded to 16-bits.
@ -313,11 +312,11 @@ struct sinfonia_readtone_resp {
struct sinfonia_update_cmd {
struct sinfonia_cmd_hdr hdr;
uint8_t target;
uint8_t curve_id;
uint8_t target; // UPDATE_TARGET_TONE_*
uint8_t curve_id; // 00 for lamination, 01 for tone?
uint8_t reset; // ??
uint8_t reserved[3];
uint32_t size;
uint32_t size; // TONE_CURVE_SIZE or lamination data that is rows*cols bytes
} __attribute__((packed));
struct sinfonia_getserial_resp {