Am Montag 16 März 2009 17:44:45 schrieb Brian Johnson:
> You posted a patch for this? i haven't seen one show up in my mail box.
>
Here it is. It fixes some problems (especially the one which causes all values 
< 255 to be b/w. (the function still right-shifted the value by 8 bits. Bad.)

Unfortunatly there seem to be some more issues. Please test.

GWater
From 8d53858ae9e773c9725ba5f3b385126fcafd440b Mon Sep 17 00:00:00 2001
From: Josua Grawitter <[email protected]>
Date: Sat, 14 Mar 2009 20:09:44 +0100
Subject: [PATCH] Attempt to fix saturation

	Attempts to fix issue where any image with saturation < 255 is grey-scale.
	Not yet working correctly.

Signed-off-by: Josua Grawitter <[email protected]>
---
 sn9c20x-bridge.c |   50 +++++++++++++++++++++++++-------------------------
 1 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/sn9c20x-bridge.c b/sn9c20x-bridge.c
index bb0f535..49fbd16 100644
--- a/sn9c20x-bridge.c
+++ b/sn9c20x-bridge.c
@@ -593,43 +593,43 @@ int sn9c20x_set_saturation(struct usb_sn9c20x *dev)
 	__u16 reg;
 	__u8 value;
 	__u16 saturation[10][2] = {
-					{0x10e7, 0xc2},
-					{0x10e8, 0x0f},
-					{0x10e9, 0xa0},
-					{0x10ea, 0x0f},
-					{0x10eb, 0x9e},
-					{0x10ed, 0x7e},
-					{0x10ef, 0x9d},
-					{0x10f0, 0x0f},
-					{0x10f1, 0xe7},
-					{0x10f2, 0x0f},
+		{0x10e7, 0xc2},
+		{0x10e8, 0x0f},
+		{0x10e9, 0xa0},
+		{0x10ea, 0x0f},
+		{0x10eb, 0x9e},
+		{0x10ed, 0x7e},
+		{0x10ef, 0x9d},
+		{0x10f0, 0x0f},
+		{0x10f1, 0xe7},
+		{0x10f2, 0x0f},
 	};
 
 /*	__u16 saturation[10][2] = {
-					{0x10e7, 0xdc},
-					{0x10e8, 0x0f},
-					{0x10e9, 0xb9},
-					{0x10ea, 0x0f},
-					{0x10eb, 0x6b},
-					{0x10ed, 0x59},
-					{0x10ef, 0xb6},
-					{0x10f0, 0x0f},
-					{0x10f1, 0xf2},
-					{0x10f2, 0x0f},
+		{0x10e7, 0xdc},
+		{0x10e8, 0x0f},
+		{0x10e9, 0xb9},
+		{0x10ea, 0x0f},
+		{0x10eb, 0x6b},
+		{0x10ed, 0x59},
+		{0x10ef, 0xb6},
+		{0x10f0, 0x0f},
+		{0x10f1, 0xf2},
+		{0x10f2, 0x0f},
 	};
 */
 
 	for( i = 0; i < 10; i++) {
 		reg = saturation[i][0];
-		value = saturation[i][1]*(dev->vsettings.colour/0xff);
+		value = (saturation[i][1] * dev->vsettings.colour) & 0xff;
 		ret = usb_sn9c20x_control_write(dev, reg, &value, 1);
 		UDIA_DEBUG("Saturation - Reg:0x%X  Value:0x%X\n", reg, value);
+		if (unlikely(ret < 0))
+			return ret;
+
 	}
 
-	if (ret < 0)
-		return ret;
-	else
-		return 0;
+	return 0;
 }
 
 
-- 
1.6.0.6

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to