rk fb: add lut for CABC
authorhjc <hjc@rock-chips.com>
Mon, 23 Mar 2015 08:29:34 +0000 (16:29 +0800)
committerhjc <hjc@rock-chips.com>
Tue, 24 Mar 2015 11:57:36 +0000 (19:57 +0800)
Signed-off-by: hjc <hjc@rock-chips.com>
arch/arm/boot/dts/lcd-F402.dtsi
arch/arm/boot/dts/lcd-ld089wu1-mipi.dtsi
drivers/video/of_display_timing.c
drivers/video/rockchip/lcdc/rk3288_lcdc.c
drivers/video/rockchip/rk_fb.c
drivers/video/rockchip/rkfb_sysfs.c
include/linux/rk_fb.h
include/linux/rk_screen.h
include/video/display_timing.h

index 7a83aedeac566fcea5f6391381800ad8c187ba9d..0fa497977eed652974e458ba68533ede201f274c 100644 (file)
                                                0x00e6e6e6 0x00e7e7e7 0x00e8e8e8 0x00e9e9e9 0x00eaeaea 0x00ebebeb 0x00ececec 0x00ededed 0x00eeeeee 0x00efefef 
                                                0x00f0f0f0 0x00f1f1f1 0x00f2f2f2 0x00f3f3f3 0x00f4f4f4 0x00f5f5f5 0x00f6f6f6 0x00f7f7f7 0x00f8f8f8 0x00f9f9f9 
                                                0x00fafafa 0x00fbfbfb 0x00fcfcfc 0x00fdfdfd 0x00fefefe 0x00ffffff>; 
-                       };
-               };
+                               cabc-lut = <
+                                       /*gamma = 2.2*/
+                                       0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
+                                       0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000001
+                                       0x00000001 0x00000001 0x00000001 0x00000001 0x00000001 0x00000001 0x00000001 0x00000001
+                                       0x00000001 0x00000002 0x00000002 0x00000002 0x00000002 0x00000002 0x00000002 0x00000002
+                                       0x00000003 0x00000003 0x00000003 0x00000003 0x00000003 0x00000004 0x00000004 0x00000004
+                                       0x00000004 0x00000005 0x00000005 0x00000005 0x00000005 0x00000006 0x00000006 0x00000006
+                                       0x00000006 0x00000007 0x00000007 0x00000007 0x00000008 0x00000008 0x00000008 0x00000009
+                                       0x00000009 0x00000009 0x0000000a 0x0000000a 0x0000000b 0x0000000b 0x0000000b 0x0000000c
+                                       0x0000000c 0x0000000d 0x0000000d 0x0000000d 0x0000000e 0x0000000e 0x0000000f 0x0000000f
+                                       0x00000010 0x00000010 0x00000011 0x00000011 0x00000012 0x00000012 0x00000013 0x00000013
+                                       0x00000014 0x00000014 0x00000015 0x00000016 0x00000016 0x00000017 0x00000017 0x00000018
+                                       0x00000019 0x00000019 0x0000001a 0x0000001a 0x0000001b 0x0000001c 0x0000001c 0x0000001d
+                                       0x0000001e 0x0000001e 0x0000001f 0x00000020 0x00000021 0x00000021 0x00000022 0x00000023
+                                       0x00000023 0x00000024 0x00000025 0x00000026 0x00000027 0x00000027 0x00000028 0x00000029
+                                       0x0000002a 0x0000002b 0x0000002b 0x0000002c 0x0000002d 0x0000002e 0x0000002f 0x00000030
+                                       0x00000031 0x00000031 0x00000032 0x00000033 0x00000034 0x00000035 0x00000036 0x00000037
+                                       0x00000038 0x00000039 0x0000003a 0x0000003b 0x0000003c 0x0000003d 0x0000003e 0x0000003f
+                                       0x00000040 0x00000041 0x00000042 0x00000043 0x00000044 0x00000045 0x00000046 0x00000047
+                                       0x00000049 0x0000004a 0x0000004b 0x0000004c 0x0000004d 0x0000004e 0x0000004f 0x00000051
+                                       0x00000052 0x00000053 0x00000054 0x00000055 0x00000057 0x00000058 0x00000059 0x0000005a
+                                       0x0000005b 0x0000005d 0x0000005e 0x0000005f 0x00000061 0x00000062 0x00000063 0x00000064
+                                       0x00000066 0x00000067 0x00000069 0x0000006a 0x0000006b 0x0000006d 0x0000006e 0x0000006f
+                                       0x00000071 0x00000072 0x00000074 0x00000075 0x00000077 0x00000078 0x00000079 0x0000007b
+                                       0x0000007c 0x0000007e 0x0000007f 0x00000081 0x00000082 0x00000084 0x00000085 0x00000087
+                                       0x00000089 0x0000008a 0x0000008c 0x0000008d 0x0000008f 0x00000091 0x00000092 0x00000094
+                                       0x00000095 0x00000097 0x00000099 0x0000009a 0x0000009c 0x0000009e 0x0000009f 0x000000a1
+                                       0x000000a3 0x000000a5 0x000000a6 0x000000a8 0x000000aa 0x000000ac 0x000000ad 0x000000af
+                                       0x000000b1 0x000000b3 0x000000b5 0x000000b6 0x000000b8 0x000000ba 0x000000bc 0x000000be
+                                       0x000000c0 0x000000c2 0x000000c4 0x000000c5 0x000000c7 0x000000c9 0x000000cb 0x000000cd
+                                       0x000000cf 0x000000d1 0x000000d3 0x000000d5 0x000000d7 0x000000d9 0x000000db 0x000000dd
+                                       0x000000df 0x000000e1 0x000000e3 0x000000e5 0x000000e7 0x000000ea 0x000000ec 0x000000ee
+                                       0x000000f0 0x000000f2 0x000000f4 0x000000f6 0x000000f8 0x000000fb 0x000000fd 0x000000ff>;
+                               cabc-gamma-base = <
+                                       /*gamma = 2.2*/
+                                       0x00010000 0x0000fdd0 0x0000fba8 0x0000f986 0x0000f76a 0x0000f556 0x0000f347 0x0000f140
+                                       0x0000ef3e 0x0000ed43 0x0000eb4e 0x0000e95e 0x0000e775 0x0000e592 0x0000e3b4 0x0000e1dc
+                                       0x0000e009 0x0000de3c 0x0000dc74 0x0000dab2 0x0000d8f4 0x0000d73c 0x0000d589 0x0000d3db
+                                       0x0000d232 0x0000d08d 0x0000ceee 0x0000cd53 0x0000cbbc 0x0000ca2b 0x0000c89d 0x0000c714
+                                       0x0000c590 0x0000c410 0x0000c294 0x0000c11c 0x0000bfa8 0x0000be39 0x0000bccd 0x0000bb65
+                                       0x0000ba01 0x0000b8a1 0x0000b745 0x0000b5ed 0x0000b498 0x0000b347 0x0000b1f9 0x0000b0af
+                                       0x0000af68 0x0000ae25 0x0000ace5 0x0000aba8 0x0000aa6f 0x0000a939 0x0000a806 0x0000a6d7
+                                       0x0000a5aa 0x0000a480 0x0000a35a 0x0000a236 0x0000a116 0x00009ff8 0x00009edd 0x00009dc5
+                                       0x00009cb0 0x00009b9e 0x00009a8e 0x00009981 0x00009877 0x0000976f 0x0000966a 0x00009567
+                                       0x00009467 0x0000936a 0x0000926f 0x00009176 0x00009080 0x00008f8c 0x00008e9a 0x00008dab
+                                       0x00008cbe 0x00008bd3 0x00008aea 0x00008a04 0x00008920 0x0000883e 0x0000875e 0x00008680
+                                       0x000085a4 0x000084ca 0x000083f3 0x0000831d 0x00008249 0x00008177 0x000080a7 0x00007fd9
+                                       0x00007f0d 0x00007e42 0x00007d7a 0x00007cb3 0x00007bee 0x00007b2b 0x00007a6a 0x000079aa
+                                       0x000078ec 0x0000782f 0x00007775 0x000076bc 0x00007604 0x0000754f 0x0000749a 0x000073e8
+                                       0x00007337 0x00007287 0x000071d9 0x0000712c 0x00007081 0x00006fd8 0x00006f30 0x00006e89
+                                       0x00006de4 0x00006d40 0x00006c9d 0x00006bfc 0x00006b5c 0x00006abe 0x00006a21 0x00006985
+                                       0x000068ea 0x00006851 0x000067b9 0x00006722 0x0000668d 0x000065f9 0x00006566 0x000064d4
+                                       0x00006443 0x000063b4 0x00006325 0x00006298 0x0000620c 0x00006181 0x000060f8 0x0000606f
+                                       0x00005fe7 0x00005f61 0x00005edb 0x00005e57 0x00005dd4 0x00005d51 0x00005cd0 0x00005c50
+                                       0x00005bd1 0x00005b52 0x00005ad5 0x00005a59 0x000059de 0x00005963 0x000058ea 0x00005871
+                                       0x000057fa 0x00005783 0x0000570d 0x00005699 0x00005625 0x000055b2 0x0000553f 0x000054ce
+                                       0x0000545d 0x000053ee 0x0000537f 0x00005311 0x000052a4 0x00005238 0x000051cc 0x00005161
+                                       0x000050f7 0x0000508e 0x00005026 0x00004fbe 0x00004f57 0x00004ef1 0x00004e8c 0x00004e27
+                                       0x00004dc3 0x00004d60 0x00004cfe 0x00004c9c 0x00004c3b 0x00004bdb 0x00004b7b 0x00004b1c
+                                       0x00004abe 0x00004a60 0x00004a03 0x000049a7 0x0000494b 0x000048f0 0x00004896 0x0000483c
+                                       0x000047e3 0x0000478a 0x00004733 0x000046db 0x00004685 0x0000462f 0x000045d9 0x00004584
+                                       0x00004530 0x000044dc 0x00004489 0x00004437 0x000043e5 0x00004393 0x00004342 0x000042f2
+                                       0x000042a2 0x00004253 0x00004204 0x000041b6 0x00004169 0x0000411b 0x000040cf 0x00004083
+                                       0x00004037 0x00003fec 0x00003fa1 0x00003f57 0x00003f0e 0x00003ec5 0x00003e7c 0x00003e34
+                                       0x00003dec 0x00003da5 0x00003d5e 0x00003d18 0x00003cd2 0x00003c8c 0x00003c48 0x00003c03
+                                       0x00003bbf 0x00003b7b 0x00003b38 0x00003af5 0x00003ab3 0x00003a71 0x00003a30 0x000039ef
+                                       0x000039ae 0x0000396e 0x0000392e 0x000038ee 0x000038af 0x00003871 0x00003832 0x000037f5>;
+                                       };
+                       };
 };
index 241fa949b6b978ff8d9c822a2fff89b3a13044ca..56e46d21ef5ff3feb5830f7fd30af090a5e8327d 100755 (executable)
                                swap-rb = <0>;
                                swap-rg = <0>;
                                swap-gb = <0>;
-                       };
-               };
+                               cabc-lut = <
+                                       /*gamma = 2.2*/
+                                       0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
+                                       0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000001
+                                       0x00000001 0x00000001 0x00000001 0x00000001 0x00000001 0x00000001 0x00000001 0x00000001
+                                       0x00000001 0x00000002 0x00000002 0x00000002 0x00000002 0x00000002 0x00000002 0x00000002
+                                       0x00000003 0x00000003 0x00000003 0x00000003 0x00000003 0x00000004 0x00000004 0x00000004
+                                       0x00000004 0x00000005 0x00000005 0x00000005 0x00000005 0x00000006 0x00000006 0x00000006
+                                       0x00000006 0x00000007 0x00000007 0x00000007 0x00000008 0x00000008 0x00000008 0x00000009
+                                       0x00000009 0x00000009 0x0000000a 0x0000000a 0x0000000b 0x0000000b 0x0000000b 0x0000000c
+                                       0x0000000c 0x0000000d 0x0000000d 0x0000000d 0x0000000e 0x0000000e 0x0000000f 0x0000000f
+                                       0x00000010 0x00000010 0x00000011 0x00000011 0x00000012 0x00000012 0x00000013 0x00000013
+                                       0x00000014 0x00000014 0x00000015 0x00000016 0x00000016 0x00000017 0x00000017 0x00000018
+                                       0x00000019 0x00000019 0x0000001a 0x0000001a 0x0000001b 0x0000001c 0x0000001c 0x0000001d
+                                       0x0000001e 0x0000001e 0x0000001f 0x00000020 0x00000021 0x00000021 0x00000022 0x00000023
+                                       0x00000023 0x00000024 0x00000025 0x00000026 0x00000027 0x00000027 0x00000028 0x00000029
+                                       0x0000002a 0x0000002b 0x0000002b 0x0000002c 0x0000002d 0x0000002e 0x0000002f 0x00000030
+                                       0x00000031 0x00000031 0x00000032 0x00000033 0x00000034 0x00000035 0x00000036 0x00000037
+                                       0x00000038 0x00000039 0x0000003a 0x0000003b 0x0000003c 0x0000003d 0x0000003e 0x0000003f
+                                       0x00000040 0x00000041 0x00000042 0x00000043 0x00000044 0x00000045 0x00000046 0x00000047
+                                       0x00000049 0x0000004a 0x0000004b 0x0000004c 0x0000004d 0x0000004e 0x0000004f 0x00000051
+                                       0x00000052 0x00000053 0x00000054 0x00000055 0x00000057 0x00000058 0x00000059 0x0000005a
+                                       0x0000005b 0x0000005d 0x0000005e 0x0000005f 0x00000061 0x00000062 0x00000063 0x00000064
+                                       0x00000066 0x00000067 0x00000069 0x0000006a 0x0000006b 0x0000006d 0x0000006e 0x0000006f
+                                       0x00000071 0x00000072 0x00000074 0x00000075 0x00000077 0x00000078 0x00000079 0x0000007b
+                                       0x0000007c 0x0000007e 0x0000007f 0x00000081 0x00000082 0x00000084 0x00000085 0x00000087
+                                       0x00000089 0x0000008a 0x0000008c 0x0000008d 0x0000008f 0x00000091 0x00000092 0x00000094
+                                       0x00000095 0x00000097 0x00000099 0x0000009a 0x0000009c 0x0000009e 0x0000009f 0x000000a1
+                                       0x000000a3 0x000000a5 0x000000a6 0x000000a8 0x000000aa 0x000000ac 0x000000ad 0x000000af
+                                       0x000000b1 0x000000b3 0x000000b5 0x000000b6 0x000000b8 0x000000ba 0x000000bc 0x000000be
+                                       0x000000c0 0x000000c2 0x000000c4 0x000000c5 0x000000c7 0x000000c9 0x000000cb 0x000000cd
+                                       0x000000cf 0x000000d1 0x000000d3 0x000000d5 0x000000d7 0x000000d9 0x000000db 0x000000dd
+                                       0x000000df 0x000000e1 0x000000e3 0x000000e5 0x000000e7 0x000000ea 0x000000ec 0x000000ee
+                                       0x000000f0 0x000000f2 0x000000f4 0x000000f6 0x000000f8 0x000000fb 0x000000fd 0x000000ff>;
+                               cabc-gamma-base = <
+                                       /*gamma = 2.2*/
+                                       0x00010000 0x0000fdd0 0x0000fba8 0x0000f986 0x0000f76a 0x0000f556 0x0000f347 0x0000f140
+                                       0x0000ef3e 0x0000ed43 0x0000eb4e 0x0000e95e 0x0000e775 0x0000e592 0x0000e3b4 0x0000e1dc
+                                       0x0000e009 0x0000de3c 0x0000dc74 0x0000dab2 0x0000d8f4 0x0000d73c 0x0000d589 0x0000d3db
+                                       0x0000d232 0x0000d08d 0x0000ceee 0x0000cd53 0x0000cbbc 0x0000ca2b 0x0000c89d 0x0000c714
+                                       0x0000c590 0x0000c410 0x0000c294 0x0000c11c 0x0000bfa8 0x0000be39 0x0000bccd 0x0000bb65
+                                       0x0000ba01 0x0000b8a1 0x0000b745 0x0000b5ed 0x0000b498 0x0000b347 0x0000b1f9 0x0000b0af
+                                       0x0000af68 0x0000ae25 0x0000ace5 0x0000aba8 0x0000aa6f 0x0000a939 0x0000a806 0x0000a6d7
+                                       0x0000a5aa 0x0000a480 0x0000a35a 0x0000a236 0x0000a116 0x00009ff8 0x00009edd 0x00009dc5
+                                       0x00009cb0 0x00009b9e 0x00009a8e 0x00009981 0x00009877 0x0000976f 0x0000966a 0x00009567
+                                       0x00009467 0x0000936a 0x0000926f 0x00009176 0x00009080 0x00008f8c 0x00008e9a 0x00008dab
+                                       0x00008cbe 0x00008bd3 0x00008aea 0x00008a04 0x00008920 0x0000883e 0x0000875e 0x00008680
+                                       0x000085a4 0x000084ca 0x000083f3 0x0000831d 0x00008249 0x00008177 0x000080a7 0x00007fd9
+                                       0x00007f0d 0x00007e42 0x00007d7a 0x00007cb3 0x00007bee 0x00007b2b 0x00007a6a 0x000079aa
+                                       0x000078ec 0x0000782f 0x00007775 0x000076bc 0x00007604 0x0000754f 0x0000749a 0x000073e8
+                                       0x00007337 0x00007287 0x000071d9 0x0000712c 0x00007081 0x00006fd8 0x00006f30 0x00006e89
+                                       0x00006de4 0x00006d40 0x00006c9d 0x00006bfc 0x00006b5c 0x00006abe 0x00006a21 0x00006985
+                                       0x000068ea 0x00006851 0x000067b9 0x00006722 0x0000668d 0x000065f9 0x00006566 0x000064d4
+                                       0x00006443 0x000063b4 0x00006325 0x00006298 0x0000620c 0x00006181 0x000060f8 0x0000606f
+                                       0x00005fe7 0x00005f61 0x00005edb 0x00005e57 0x00005dd4 0x00005d51 0x00005cd0 0x00005c50
+                                       0x00005bd1 0x00005b52 0x00005ad5 0x00005a59 0x000059de 0x00005963 0x000058ea 0x00005871
+                                       0x000057fa 0x00005783 0x0000570d 0x00005699 0x00005625 0x000055b2 0x0000553f 0x000054ce
+                                       0x0000545d 0x000053ee 0x0000537f 0x00005311 0x000052a4 0x00005238 0x000051cc 0x00005161
+                                       0x000050f7 0x0000508e 0x00005026 0x00004fbe 0x00004f57 0x00004ef1 0x00004e8c 0x00004e27
+                                       0x00004dc3 0x00004d60 0x00004cfe 0x00004c9c 0x00004c3b 0x00004bdb 0x00004b7b 0x00004b1c
+                                       0x00004abe 0x00004a60 0x00004a03 0x000049a7 0x0000494b 0x000048f0 0x00004896 0x0000483c
+                                       0x000047e3 0x0000478a 0x00004733 0x000046db 0x00004685 0x0000462f 0x000045d9 0x00004584
+                                       0x00004530 0x000044dc 0x00004489 0x00004437 0x000043e5 0x00004393 0x00004342 0x000042f2
+                                       0x000042a2 0x00004253 0x00004204 0x000041b6 0x00004169 0x0000411b 0x000040cf 0x00004083
+                                       0x00004037 0x00003fec 0x00003fa1 0x00003f57 0x00003f0e 0x00003ec5 0x00003e7c 0x00003e34
+                                       0x00003dec 0x00003da5 0x00003d5e 0x00003d18 0x00003cd2 0x00003c8c 0x00003c48 0x00003c03
+                                       0x00003bbf 0x00003b7b 0x00003b38 0x00003af5 0x00003ab3 0x00003a71 0x00003a30 0x000039ef
+                                       0x000039ae 0x0000396e 0x0000392e 0x000038ee 0x000038af 0x00003871 0x00003832 0x000037f5>;
+                                       };
+                       };
 };
index 6522edabfa51d0f8b7ad831a01303d43f5e9017f..9905a39ebcc6c962b48a416f6bc2b1d17f87664f 100644 (file)
@@ -132,6 +132,16 @@ static struct display_timing *of_get_display_timing(struct device_node *np)
                                                         dt->cabc_lut,
                                                         length >> 2);
        }
+
+       prop = of_find_property(np, "cabc-gamma-base", &length);
+       if (prop) {
+               dt->cabc_gamma_base = kzalloc(length, GFP_KERNEL);
+               if (dt->cabc_gamma_base)
+                       ret = of_property_read_u32_array(np,
+                                                        "cabc-gamma-base",
+                                                        dt->cabc_gamma_base,
+                                                        length >> 2);
+       }
 #endif
 
        if (ret) {
index 053cca4f7dd9b8a1b93cc9be3db48e718e270d70..89832b948992095fe9708f7d96364983dcfab529 100755 (executable)
@@ -3362,7 +3362,8 @@ static struct lcdc_cabc_mode cabc_mode[4] = {
        {20,    128,    0},     /*mode 4*/
 };
 
-static int rk3288_lcdc_set_dsp_cabc(struct rk_lcdc_driver *dev_drv, int mode)
+static int __maybe_unused
+rk3288_lcdc_set_dsp_cabc(struct rk_lcdc_driver *dev_drv, int mode)
 {
        struct lcdc_device *lcdc_dev =
            container_of(dev_drv, struct lcdc_device, driver);
@@ -3663,7 +3664,7 @@ static struct rk_lcdc_drv_ops lcdc_drv_ops = {
        .dpi_win_sel            = rk3288_lcdc_dpi_win_sel,
        .dpi_status             = rk3288_lcdc_dpi_status,
        .get_dsp_addr           = rk3288_lcdc_get_dsp_addr,
-       .set_dsp_cabc           = rk3288_lcdc_set_dsp_cabc,
+       /*.set_dsp_cabc                 = rk3288_lcdc_set_dsp_cabc,*/
        .set_dsp_bcsh_hue       = rk3288_lcdc_set_bcsh_hue,
        .set_dsp_bcsh_bcs       = rk3288_lcdc_set_bcsh_bcs,
        .get_dsp_bcsh_hue       = rk3288_lcdc_get_bcsh_hue,
index ff947ac5666b16b14b5d3fadfcfb553151e370b1..31bdd472dfa7834420f296c4a61300a1dd4cee06 100644 (file)
@@ -452,6 +452,7 @@ int rk_fb_video_mode_from_timing(const struct display_timing *dt,
        screen->color_mode = dt->color_mode;
        screen->dsp_lut = dt->dsp_lut;
        screen->cabc_lut = dt->cabc_lut;
+       screen->cabc_gamma_base = dt->cabc_gamma_base;
 
        if (dt->flags & DISPLAY_FLAGS_PIXDATA_POSEDGE)
                screen->pin_dclk = 1;
@@ -3538,8 +3539,6 @@ static int init_lcdc_device_driver(struct rk_fb *rk_fb,
        dev_drv->overscan.bottom = 100;
        rk_disp_pwr_ctr_parse_dt(dev_drv);
        if (dev_drv->prop == PRMRY) {
-               if (dev_drv->ops->set_dsp_cabc)
-                       dev_drv->ops->set_dsp_cabc(dev_drv, dev_drv->cabc_mode);
                rk_fb_set_prmry_screen(screen);
                rk_fb_get_prmry_screen(screen);
        }
index 74ff5c9fdd58549650b178771a865096d1591c61..d8a992df7c26c5e478c69aaa4b5c008d0511e8b5 100644 (file)
@@ -605,14 +605,41 @@ static ssize_t set_dsp_cabc(struct device *dev, struct device_attribute *attr,
        struct fb_info *fbi = dev_get_drvdata(dev);
        struct rk_fb_par *fb_par = (struct rk_fb_par *)fbi->par;
        struct rk_lcdc_driver *dev_drv = fb_par->lcdc_drv;
-       int ret, mode = 0;
-
-       ret = kstrtoint(buf, 0, &mode);
-       if (ret)
-               return ret;
+       int space_max, ret, mode = 0, calc = 0,up = 0, down = 0, global = 0;
+       const char *start = buf;
 
-       if (dev_drv->ops->set_dsp_cabc)
-               ret = dev_drv->ops->set_dsp_cabc(dev_drv, mode);
+       space_max = 10; /*max space number 10*/
+       mode = simple_strtoul(start, NULL, 10);
+       do {
+               start++;
+               space_max--;
+       } while ((*start != ' ') && space_max);
+       start++;
+       calc = simple_strtoul(start, NULL, 10);
+
+       do {
+               start++;
+               space_max--;
+       } while ((*start != ' ') && space_max);
+       start++;
+       up  = simple_strtoul(start, NULL, 10);
+
+       do {
+               start++;
+               space_max--;
+       } while ((*start != ' ') && space_max);
+       start++;
+       down = simple_strtoul(start, NULL, 10);
+
+       do {
+               start++;
+               space_max--;
+       } while ((*start != ' ') && space_max);
+       start++;
+       global = simple_strtoul(start, NULL, 10);
+
+    if (dev_drv->ops->set_dsp_cabc)
+               ret = dev_drv->ops->set_dsp_cabc(dev_drv, mode, calc, up, down, global);
        if (ret < 0)
                return ret;
 
index f20f9978be21ba40504404dffcf148b4e5f6e4c9..43cf5c86ef806f89495e373b27cef9654dda9e13 100644 (file)
@@ -460,7 +460,7 @@ struct rk_lcdc_drv_ops {
        int (*dpi_win_sel) (struct rk_lcdc_driver *dev_drv, int layer_id);
        int (*dpi_status) (struct rk_lcdc_driver *dev_drv);
        int (*get_dsp_addr)(struct rk_lcdc_driver *dev_drv,unsigned int *dsp_addr);
-       int (*set_dsp_cabc) (struct rk_lcdc_driver *dev_drv, int mode);
+       int (*set_dsp_cabc) (struct rk_lcdc_driver *dev_drv, int mode, int calc, int up, int down, int global);
        int (*set_dsp_bcsh_hue) (struct rk_lcdc_driver *dev_drv,int sin_hue, int cos_hue);
        int (*set_dsp_bcsh_bcs)(struct rk_lcdc_driver *dev_drv,bcsh_bcs_mode mode,int value);
        int (*get_dsp_bcsh_hue) (struct rk_lcdc_driver *dev_drv,bcsh_hue_mode mode);
@@ -646,6 +646,7 @@ struct rk_lcdc_driver {
        int *hwc_lut;
        int uboot_logo;
        int bcsh_init_status;
+       bool cabc_pwm_pol;
 };
 
 struct rk_fb_par {
index 4c4b77885864785ac2a415089e0bca0da930b4a1..6edeafa71400849226a80df196523e5645326dfe 100644 (file)
@@ -81,6 +81,7 @@ struct rk_screen {
        u8  ft;
        int *dsp_lut;
        int *cabc_lut;
+       int *cabc_gamma_base;
 
 #if defined(CONFIG_MFD_RK616) || defined(CONFIG_LCDC_RK312X)
        u32 pll_cfg_val;  //bellow are for jettaB
index 82723915e2b3394fd9e26cd56a1d72d66d73e11b..54d70cd8579018cd20a0c05370a30bd8d5e7e5e0 100644 (file)
@@ -82,6 +82,7 @@ struct display_timing {
        u16 color_mode;                         /* input color mode: RGB or YUV */
        u32 *dsp_lut;
        u32 *cabc_lut;
+       u32 *cabc_gamma_base;
 #endif
 };