Commit Graph

47 Commits

Author SHA1 Message Date
Zheng Yang
905228ba1e video: rockchip: hdmi: add dts property rockchip,defaultdepth
To modify hdmi default output color depth, use following dts:

&hdmi {
	rockchip,defaultdepth = <10>;
}

rockchip,defaultdepth could be following value:
<0>  auto select color depth, prefer 8bit
<8>  8bit
<10> 10bit

Change-Id: Idce0bd080c042edf3939c5c38b76d4d1860b7a9f
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-02-13 11:34:29 +08:00
Zheng Yang
09210b8aa1 video: rockchip: hdmi: support set hdr metedata
Use following command to set hdr metadata:

cd /sys/class/display/HDMI
echo "hdrmdata=1 2 3 4 5 6 7 8 9 10 11 12" > color

Use following command to get current hdr metadata

cat /sys/class/display/HDMI/color

Change-Id: I81a5000801b558728689be912c1a642f3b237e65
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-02-10 11:11:45 +08:00
Zheng Yang
c3620a88e5 video: rockchip: hdmi: support modify color mode and depth simultaneously
Use following command:

echo mode=<value> > /sys/class/display/HDMI/mode

<value> is decimal digits, lower 8bit is color mode, upper 8bit is depth.
For example:
	value = 131 = 0x83 means YCbCr444 8bit output
	value = 164 = 0xa4 means YCbCr422 10bit output
	value = 0 means restore auto mode(8bit, priority YCbCr444)

Change-Id: I256906d91f7075defb4d785cfc15926ca5627093
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2016-12-12 09:19:37 +08:00
Zheng Yang
d3dfca100e video: rockchip: hdmi: v2: fix some format check error
Change-Id: I3432060aed93ccf8745fa7afebd0a5322f8d4121
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2016-11-23 19:46:36 +08:00
Huang, Tao
7e430f844e video: rockchip: hdmi: remove redundant print
before:
Rockchip hdmi driver version 2.0
.
mpp venc_srv.15: mpp_probe enter

after:
Rockchip hdmi driver version 2.0
mpp venc_srv.15: mpp_probe enter

Change-Id: I7571fbc8a2d66933e8c44fc1c6ec43a4e63a0a1b
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
2016-11-18 14:13:02 +08:00
Zheng Yang
39c34527e7 video: rockchip: hdmi: fix CTS HF1-53 HDR test
1. HDR MetaData HB2 is 26.
2. Under HF1-53, HDR MetaData should be sent and
PB1 value should be exist in EDID.

Change-Id: I616b4cdcf321ea0080b845c868d1f4cd4881fd14
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2016-11-18 11:31:57 +08:00
Zheng Yang
0c3397a9b8 video: rockchip: hdmi: improve hdr function when out of sink tmds clk
If output tmdsclk is out of sink max tmds clk, we need to set output
mode to 8bit or YCbCr422.

For example, sink max tmds clk is 600M, but 3840x2160p-60 10bit tmdsclk
is 594*1.25 > 600, we set output mode to YCbCr422 10bit which tmds clk
is 594, so we can get max picture quality.

Change-Id: I13fe30dad06757ec52de8d367f1e10a56e63ad92
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2016-11-16 17:59:52 +08:00
Zheng Yang
08ea9d12f3 video: rockchip: hdmi: support hdr function
HDR is introduced by HDMI2.0a, which need parsing HDR Static
Metedata data Block defined in EDID, and send Dynamic Range
and Mastering InfoFrame to inform TV to switch to HDR mode.

If TV support HDR, it's EOTF is shown in sysfs node
/sys/class/display/HDMI/color with key word "Supported EOTF:".

For example, "Support EOTF: 0x7" means support following EOTF:
BIT0: Traditional gamma - SDR
BIT1: Traditional gamma - HDR
BIT2: ST_2084

To switch eotf mode, you can use following command:
echo eotf=value > /sys/class/display/HDMI/color
value could be:
	0 - Disable sending Dynamic Range and Mastering InfoFrame
	1 - Traditional gamma - SDR
	2 - Traditional gamma - HDR
	4 - ST_2084
0、1 both means SDR mode, 4 is HDR10/Dolby HDR mode.

Change-Id: Ia3d19bbca9b9368cde8dcb11265fbff4684ac603
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2016-11-10 14:36:24 +08:00
Shen Zhenyi
919cb0208a video: rockchip: hdmi: change the way to enable debug log
user can change hdmi_dbg_level value to printf log which you want.
1 : cec
2 : hdmi
3 : hdcp
such as, echo 2 > /sys/module/rockchip_hdmi_sysfs/parameters/hdmi_dbg_level

Change-Id: Iaa5a66c2926789694e0d544196bedc81fb3a755a
Signed-off-by: Shen Zhenyi <szy@rock-chips.com>
2016-10-09 18:40:01 +08:00
Shen Zhenyi
899bf65ac0 video: rockchip: hdmi: contrast uboot and kernel resolution
When box is starting, if kernel resolution is different from uboot,
need to clear hdmi->uboot

Change-Id: Iec56862fe20dcaccc12fefae21de55b56ab2fe54
Signed-off-by: Shen Zhenyi <szy@rock-chips.com>
2016-07-29 10:46:20 +08:00
Zheng Yang
34468c2b30 video: rockchip: hdmi: set default color depth to 8bit
Change-Id: I2e4f8d9f980c4169e254ad56793503f76f091e7f
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2016-07-12 14:34:45 +08:00
Shen Zhenyi
3e89ee402e hdmi: cec: fix quick standby then wake-up crash
Change-Id: Ic0449e795e55b65112fd65c1685286fbcfbea10b
Signed-off-by: Shen Zhenyi <szy@rock-chips.com>
2016-05-18 10:56:49 +08:00
Zheng Yang
0fdde42e0c video: rockchip: hdmi: skip operation when suspend or disabled
Change-Id: I294d338416a04d751ec5a5771e6b623ba7b69c02
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2016-03-01 14:25:47 +08:00
Zheng Yang
90a3fd2f61 video: rockchip: hdmi: fix code style
Change-Id: Ibe9e70a3011a22051f428aecf3a733f129a2599d
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2016-01-28 14:52:05 +08:00
Zheng Yang
fb32753164 video: rockchip: hdmi: return error when get lcdc device failed
Change-Id: If8ada2cc481afe1508e0e2315e4d80c60ddd885d
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2015-12-08 12:11:51 +08:00
Zheng Yang
d0685315ef video: hdmi: fix dvi mode output depth
Change-Id: I72740d03d2440d5547ec2b0266733520bf9f86c9
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2015-12-03 16:40:20 +08:00
Zheng Yang
98c0900674 video: rockchip: hdmi: fix error of 8/10 bit color depth selection
Change-Id: I3c9c35dced4db9b5f103d0d3de482f33d7257ae0
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2015-10-07 16:45:22 +08:00
Zheng Yang
d50205d8d2 video: rockchip: hdmi: redefine input/output color relationship
For YCbCr420 mode, input color and output color must be same as
HDMI_COLOR_YCBCR420.

Change-Id: I302c1a0572d706abdebf5d2d35bd100e0242edf9
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
(cherry picked from commit c3ed688f02f76dfc5533124c41bbb8c016e3cc97)
2015-10-07 16:44:43 +08:00
Zheng Yang
f6656c7c7f video: rockchip: hdmi: support some vesa dmt mode
Change-Id: I28e935c717ae69fb2b48a7c243f8ce3cc7101a86
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2015-09-15 14:08:46 +08:00
Zheng Yang
468345a502 video: rockchip: hdmi: introduce vic flag HDMI_UBOOT_NOT_INIT
If uboot_vic has HDMI_UBOOT_NOT_INIT flag, it means uboot just
pass the preset vic value, registers has not been set in uboot.
If not, hdmi has been power up in uboot, should not operate phy
register again.

Change-Id: I64f48bd878ec124a94f25a752a74dc9bae502b2b
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2015-09-06 08:53:15 +08:00
Zheng Yang
06809f0306 hdmi:cec:update driver to match android HDMI CEC HAL.
Android 5.x introduce HDMI CEC, so we need to porting
cec hal and driver to make it work.

Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2015-08-12 09:10:54 +08:00
Zheng Yang
97b1b43aa1 hdmi: reconfigure audio when enable/disable 3D Frame packing mode.
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2015-07-30 10:56:21 +08:00
Zheng Yang
96b23c94c6 hdmi:rk3288/rk3368: support 3D type Frame packing.
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2015-07-30 10:43:04 +08:00
Zheng Yang
f5118000d9 hdmi:use 30bit lcdc interface when output 10bit mode.
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2015-07-24 16:30:44 +08:00
Zheng Yang
71a461a764 hdmi: hdmi_submit_work function support synchronous operation.
If hdmi_submit_work work in synchronous mode, the malloced delayed_work
is free by caller, not by hdmi_work_queue, to prevent delayed_work is
free before flush_delayed_work fucntion is executed.

Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2015-07-24 11:05:37 +08:00
Zheng Yang
54ee81fa6d hdmi: use dps->lock replace of hdmi->lock.
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2015-07-20 14:52:13 +08:00
Zheng Yang
edbf5b6446 hdmi: support parse and modify colorimetry.
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2015-07-14 09:33:45 +08:00
Zheng Yang
20e295642e hdmi: modify debug string mode.
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2015-07-10 16:03:59 +08:00
Zheng Yang
411efa27e3 hdmi: mute output before disabled or suspended.
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2015-07-10 15:12:53 +08:00
Sugar Zhang
6e7b61dec1 HDMI: add a helper function for config hdmi audio.
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2015-07-02 20:08:39 +08:00
Zheng Yang
90e99a4c35 HDMI: modify callback and events for HDCP 2nd auth.
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2015-06-23 16:48:52 +08:00
Zheng Yang
252d3a9b72 hdmi: edid: distinguish deep color mode between YCbCr444 and YCbCr420.
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2015-06-08 16:36:18 +08:00
Zheng Yang
d6f81d1133 HDMI: add mutex lock to edid modelist operation.
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2015-05-29 10:08:34 +08:00
Zheng Yang
1f03967adf HDMI: No need to set audio when hdmi is not connected.
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2015-05-23 11:08:49 +08:00
Zheng Yang
ab64cd261a HDMI: register display type according lcdc property.
If property of lcdc connected by HDMI is EXTERN,
	we register HDMI as a aux display device.

Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2015-05-22 18:38:01 +08:00
Zheng Yang
71e8a27d62 HDMI: support show edid status.
Use /sys/class/display/HDMI/debug node to
	show sink EDID status and raw status.

Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2015-05-21 13:45:22 +08:00
Zheng Yang
33be0d0365 HDMI: calling rk_fb_switch_screen() to close vop related to HDMI
before calling switch_set_state() when HDMI is removed.
      For android hwcompser need to make sure vop is disabled when
      received hdmi removing event.

Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2015-04-11 17:33:19 +08:00
Zheng Yang
2258ac9cca HDMI: call function hdmi->ops->disable() if it is disabled.
For system can not be wakeup under following case:
      step1. Disable HDMI.
      step2. set system to deep sleep mode.
      step3. remove HDMI connection.
      step4. wake up system.

Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2015-04-09 18:07:37 +08:00
Zheng Yang
08cc20b019 HDMI: revert commit 3fe08a661c for
find root reason on commit 7f2f16780d.

Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2015-04-02 17:11:12 +08:00
Zheng Yang
3fe08a661c HDMI: fix crash error when insert HDMI with following log:
Unable to handle kernel paging request at virtual address 40ce80f8
      pgd = ffffffc001022000
      [40ce80f8] *pgd=0000000025b19003, *pmd=000000001cb1f003, *pte=0000000000000000
      Internal error: Oops: 96000005 [#1] PREEMPT SMP
      Modules linked in: pvrsrvkm(O) drmboot(PO)
      CPU: 7 PID: 2558 Comm: kworker/u16:1 Tainted: P        W  O 3.10.0 #66
      Workqueue: hdmi-ff980000.hdmi hdmi_work_queue
      task: ffffffc01ca83f00 ti: ffffffc033e00000 task.ti: ffffffc033e00000
      PC is at hdmi_wq_insert+0xa4/0x2ac
      LR is at hdmi_wq_insert+0x74/0x2ac
      pc : [<ffffffc000341014>] lr : [<ffffffc000340fe4>] pstate: 60000145

      Use inline fuction hdmi_destroy_modelist replace fb_destroy_modelist.
      For unkown reason, variable struct hdmi *hdmi is deferent before and
      after calling fb_destroy_modelist.

Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2015-03-29 17:28:18 +08:00
Zheng Yang
48921e9feb HDMI: remove limited conditions of calling switch_set_state.
Application should read /sys/class/display/HDMI/audioinfo
      to detect sink device support audio or not.

Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2015-03-28 14:37:34 +08:00
Zheng Yang
ad446e7a06 HDMI: add dts node "rockchip,defaultmode" to define HDMI default output mode.
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2015-03-26 16:32:30 +08:00
Zheng Yang
874f30142e HDMI: Modify color output policy.
Introduce feature SUPPORT_YCBCR_INPUT. If VOP can
        output YCbCr, VOP output color mode is equal to HDMI
        output color mode. Otherwise, VOP just output RGB,
        HDMI will conver color space.

Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2015-03-09 11:30:24 +08:00
Zheng Yang
c353bcdcf1 HDMI: add mutex lock when hdmi is set to auto mode, to avoid
system crash by NULL pointer.

Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2015-03-09 11:30:10 +08:00
Zheng Yang
bdb1122f09 HDMI:
1. In DVI mode, input color and output color should be RGB[0-255];
	   In HDMI mode, input color should be YCbCr;
	2. For MID, HDMI is default disabled.

Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2015-02-27 17:36:58 +08:00
Zheng Yang
f4fed0d820 hdmi: fix set hdmi switch state error when remove hdmi.
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2015-02-27 17:36:57 +08:00
Zheng Yang
fa7ee75d42 hdmi: update driver to v2.0:
1. Rename rk3036 hdmi to rockchip_hdmiv1, support hdmi v1.4;
	2. Rename rk3288 hdmi to rockchip_hdmiv2, support hdmi v2.0;
	3. Support transmmit 3D picture.
	4. 3288 hdmi support HDCP, CEC and TMDSCLK 600M.
	5. HDMI video source default is LCDC0, it can be modified in dts by
	   follow:
	   	rockchip,hdmi_video_source = <DISPLAY_SOURCE_LCDC1>;
	   HDCP and CEC function default is disabled , it can be enabled in
	   dts file by follow:
	   	rockchip,hdcp_enable = <1>;
	   	rockchip,cec_enable = <1>;
	   More information please see
		Documentation/devicetree/bindings/video/rockchip_hdmi.txt
2015-02-02 11:06:04 +08:00