Commit Graph

238 Commits

Author SHA1 Message Date
Zheng Yang
955745bc12 drm/bridge: synopsys: dw-hdmi: disable phy in dw_hdmi_bind
If hdmi is enabled in uboot and pluged out when booting kernel,
the hdmi phy is still enabled. It's better to disable it to
match the real status.

Change-Id: Ia1c5ede6499ee277d08c35a85c50e3257305f90f
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2018-03-01 16:23:55 +08:00
Zheng Yang
b87d97a99c drm/bridge: synopsys: dw-hdmi: update rxsense status in repo_hpd_event
Under following processes, rxsense will be not match the real
signal status.
1. HDMI plug in, irq is triggered.

2. HDMI irq is mute in dw_hdmi_hardirq, bring up dw_hdmi_irq.

3. For HDMI connection is not stable, phy_stat read in
   dw_hdmi_irq may be zero, then hdmi->rxsense will be false.

4. Connection fallback to stable, but dw_hdmi_irq had not
   unmute the irq, irq is not triggered again, and hdmi->rxsense
   keep false.

5. repo_hpd_event inform HDMI is pluggned in, dw_hdmi_bridge_enable
   is called to enable HDMI. For rxsense is flase, bridge is not
   powered up.

When repo_hpd_event is called, we think HDMI connection is stable,
updating rxsense is reliable.

Change-Id: Ie1f52f65b15e9a603dad9200529202053528a390
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2018-03-01 16:22:43 +08:00
Zheng Yang
5f1c036a65 drm/bridge: synopsys: dw-hdmi: fix kernel logo flash when output YCbCr422 mode
On rockchip platform, hdmi input format is YCbCr444 when output mode
is YCbCr422. Then the value of HDMI_TX_INVID0 on YCbCr422 is same as
the value of YCbCr444, both is 0x09/0x0b. This make enc_out_bus_format
stroed in struct hdmi_data is wrong, which is MEDIA_BUS_FMT_YUV8_1X24
or MEDIA_BUS_FMT_YUV10_1X30.

When android set enc_out_bus_format to YCbCr422, dw_hdmi_setup will be
called and logo will flash.

This patch use colorspace restored in HDMI_FC_AVICONF0 to distinguish them.

Change-Id: I6b913951b58fb47628617c11d6059bc1be4e370a
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2018-02-11 10:21:53 +08:00
Algea Cao
bcc83cb2ff drm/bridge: Support rk1000 kernel logo
Setting connector port to support kernel logo

Change-Id: I594eec0a924ecf1c47c82d61c471dd21c2af1830
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2018-02-09 16:44:17 +08:00
huangjc
6abfe1d617 drm: bridge: synopsys: Fix hdmi can't display in android
Change-Id: I2f3ee8176761b5227c30df25c569e4c34ae773e2
Signed-off-by: Jiancai Huang <huangjc@rock-chips.com>
2018-02-07 12:02:45 +08:00
Zheng Yang
ea56866919 drm: bridge: synopsys: update more hdmi status in dw_hdmi_bind
If hdmi is enabled in uboot, hdmi->disabled and bridge_is_on and
phy status need to be updated.

Change-Id: Ib21d894b673bf12b46a271c91d3e08fe7475ea89
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2018-02-02 19:09:12 +08:00
Zheng Yang
3a61ef4874 drm: bridge: synopsys: update mc_clkdis in dw_hdmi_bind
If vop return error when showing kernel logo, connector atomic flush
will not be call, and mc_clkdis can not be updated.

This patch update mc_clkdis in the dw_hdmi_bind, when phy clock is
locked and HPD is connected.

Change-Id: I1498d787a993961fe75236c309ecc3c898d611a4
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2018-02-01 15:18:41 +08:00
Tao Huang
f9eefeeaa7 rk: add SPDX license identifier to files with no license
Change-Id: I754250669891307b0deab2bdab1bd01512713f79
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2018-01-31 20:56:06 +08:00
Huicong Xu
d4953cfed3 phy: rockchip: inno-hdmi: fix 4k10 bit display abnormal
avoid out of value range calculate catmdsclk when 4k10bit and set
scdc high tmds clock ratio when mtmdsclock is more than 340000000

Change-Id: I8aed4c99813e43c69526f3918d5e7024879d3288
Signed-off-by: Huicong Xu <xhc@rock-chips.com>
2018-01-30 16:24:50 +08:00
Huicong Xu
408f2a3e6f drm/bridge/synopsys: initialize hdmi variable when bootup with hdmi plugin
if bootup with hdmi plugin initialize mtmdsclock to modify voicelessness
and set bridge_is_on true to modify green screen when reboot from recovery

Change-Id: I0ed9f956d62ab4087cb42a54dafba6a0fc9e5a7e
Signed-off-by: Huicong Xu <xhc@rock-chips.com>
2018-01-30 16:24:37 +08:00
Huicong Xu
d7f22ab4c1 drm: bridge: dw-hdmi: fix wrong color if get edid error at bootup
if get edid error at bootup the input bus format will be set as
rgb and hdmi is no reinit, so hdmi color will be wrong if set yuv
in uboot, now reinit hdmi in this case.

Change-Id: I8d117b6e241079ceab44793f6566adf91e9d84c6
Signed-off-by: Huicong Xu <xhc@rock-chips.com>
2018-01-30 16:24:25 +08:00
Jerry Xu
ed6a5401ea drm/bridge: add support for adi adv7125
Change-Id: Ica6080548d9b4e3eb8ae4214b23fba97ba33775c
Signed-off-by: Jerry Xu <xbl@rock-chips.com>
2018-01-26 10:40:58 +08:00
Jerry Xu
751b94a7e9 drm/bridge: add psave gpio control for dumb-vga-dac
Change-Id: If2c5402d842e13df4baf2d608718e0597f5d4ff7
Signed-off-by: Jerry Xu <xbl@rock-chips.com>
2018-01-26 10:39:49 +08:00
Inki Dae
9f27154e19 UPSTREAM: drm/bridge: vga-dac: clean up drm_bridge_add call
This patch removes unnecessary checking of return value.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1499071350-25168-5-git-send-email-inki.dae@samsung.com
(cherry picked from commit 47e3427854)

Change-Id: Id7acd883d688ed187276f0a0d64009714cef82be
Signed-off-by: Jerry Xu <xbl@rock-chips.com>
2018-01-23 14:27:05 +08:00
Rob Herring
9bec06c238 UPSTREAM: drm: convert drivers to use of_graph_get_remote_node
Convert drivers to use the new of_graph_get_remote_node() helper
instead of parsing the endpoint node and then getting the remote device
node. Now drivers can just specify the device node and which
port/endpoint and get back the connected remote device node. The details
of the graph binding are nicely abstracted into the core OF graph code.

This changes some error messages to debug messages (in the graph core).
Graph connections are often "no connects" depending on the particular
board, so we want to avoid spurious messages. Plus the kernel is not a
DT validator.

Signed-off-by: Rob Herring <robh@kernel.org>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Tested-by: Liviu Dudau <liviu.dudau@arm.com>
Tested-by: Eric Anholt <eric@anholt.net>
Tested-by: Jyri Sarha <jsarha@ti.com>
Tested by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
(cherry picked from commit 86418f90a4)

Conflicts:
  Only merge the file of drivers/gpu/drm/bridge/dumb-vga-dac.c

Change-Id: Ie8fd230f6d150ac8585e0b5418cbbca240b1d2f6
Signed-off-by: Jerry Xu <xbl@rock-chips.com>
2018-01-23 14:27:05 +08:00
Laurent Pinchart
33e24b5e17 UPSTREAM: drm: bridge: vga-dac: Add adi,adv7123 compatible string
The ADV7123 is a transparent VGA DAC. Unlike dumb VGA DACs it can be
controlled through a power save pin, and requires a power supply.
However, on most boards where the device is used neither the power save
signal nor the power supply are controllable.

To avoid developing a separate device-specific driver add an
"adi,adv7123" compatible entry to the dumb-vga-dac driver. This will
allow supporting most ADV7123-based boards easily, while allowing future
development of an adv7123 driver when needed without breaking backward
compatibility.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Link: http://patchwork.freedesktop.org/patch/msgid/20170302104728.7150-4-laurent.pinchart+renesas@ideasonboard.com
(cherry picked from commit d29ffab591)

Change-Id: I3447fa126b120911400fd9ec22a05dbb1598251e
Signed-off-by: Jerry Xu <xbl@rock-chips.com>
2018-01-23 14:27:05 +08:00
Bartosz Golaszewski
3fa2491295 UPSTREAM: drm: bridge: add support for TI ths8135
THS8135 is a configurable video DAC, but no configuration is actually
necessary to make it work.

For now use the dumb-vga-dac driver to support it.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1481623759-12786-4-git-send-email-bgolaszewski@baylibre.com
(cherry picked from commit a1f761a592)

Change-Id: I9273f5423cc5f6695bf87fba451340d472acf356
Signed-off-by: Jerry Xu <xbl@rock-chips.com>
2018-01-23 14:27:05 +08:00
Chen-Yu Tsai
438ccb3de4 UPSTREAM: drm/bridge: dumb-vga-dac: Support a VDD regulator supply
Some dumb VGA DACs are active components which require external power.
Add support for specifying a regulator as its power supply.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Link: http://patchwork.freedesktop.org/patch/msgid/20161116154232.872-2-wens@csie.org
(cherry picked from commit af948a25ec)

Change-Id: I711e3b444f72e04ee09e8ca4bfa8c04c3640039b
Signed-off-by: Jerry Xu <xbl@rock-chips.com>
2018-01-23 14:27:05 +08:00
Maxime Ripard
beea87e387 UPSTREAM: drm/bridge: Add RGB to VGA bridge support
Some boards have an entirely passive RGB to VGA bridge, based on DACs
implemented by resistor ladders.

Those might or might not have an i2c bus routed to the VGA connector in
order to access the screen EDIDs.

Add a bridge that doesn't do anything but expose the modes available on the
screen, either based on the EDIDs if available, or based on the XGA
standards.

Acked-by: Rob Herring <robh@kernel.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Link: http://patchwork.freedesktop.org/patch/msgid/20160930143709.1388-3-maxime.ripard@free-electrons.com
(cherry picked from commit 56fe8b6f49)

Conflicts:
  drivers/gpu/drm/bridge/Kconfig
  drivers/gpu/drm/bridge/Makefile

Change-Id: I481b7115b0401c14d990a7574e41b6c76b7d48d6
Signed-off-by: Jerry Xu <xbl@rock-chips.com>
2018-01-23 14:27:05 +08:00
Algea Cao
d9bb4b5cc1 drm/bridge/synopsys: Get mc_clkdis value from uboot.
When uboot logo is enabled, hdmi will not be setup again.
In this case, kernel driver will set wrong mc_clkdis value
when cec enable. So mc_clkdis should be got from uboot.

Change-Id: Idb9984d981489287966f2719f6ed4c729a183b58
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2018-01-20 15:25:14 +08:00
Algea Cao
824179b35e drm/bridge/synopsys: Report hdmi HPD to userspace for cec
When hdmi HPD is occurred, call cec_notifier_repo_cec_hpd.

Change-Id: If2047121c8ccf55e9a49fa4c3c4ec2187248a593
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2018-01-20 15:21:24 +08:00
xuhuicong
0181dc0e9c drm: bridge: dw-hdmi: disable scamble when tmdsclk less than 340Mhz
to Improve signal compatibility disable scamble when tmdsclk less than
340Mhz by default. and can enable it by define "scramble-low-rates;"
in dts file.

Change-Id: I0bd5d8e2ea4df065d84018615d4c39cac7ac441a
Signed-off-by: xuhuicong <xhc@rock-chips.com>
2018-01-18 10:03:23 +08:00
xuhuicong
15939ad840 drm: bridge: dw-hdmi: enable prepclk to fix 480i and 576i no display
Change-Id: Ie2fc362c4a3c6ce65d247898342f59977c48ab44
Signed-off-by: xuhuicong <xhc@rock-chips.com>
2018-01-18 10:04:29 +08:00
xuhuicong
87b681f969 drm/bridge: dw-hdmi: fix display shaking when uboot to kernel show
Change-Id: I899bb0dde7111fe97dd2c89d20afb09562d31300
Signed-off-by: xuhuicong <xhc@rock-chips.com>
2018-01-15 14:11:16 +08:00
Algea Cao
86155ccebc drm/bridge/synopsys: Move cec_notifier_set_phys_addr out of rxsense setup
If put cec_notifier_set_phys_addr in rxsense setup, hdmi->mutex may
become deadlock. Because cec_notifier_set_phys_addr will call
dw_hdmi_cec_enable which cause hdmi->mutex become deadlock.

Change-Id: I4fed641c9e9d7674451402a973196ef0efeb198f
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2017-12-29 14:30:42 +08:00
Pierre-Hugues Husson
fc41368466 UPSTREAM: drm/bridge: synopsys/dw-hdmi: Enable cec clock
Support the "cec" optional clock. The documentation already mentions "cec"
optional clock and it is used by several boards, but currently the driver
doesn't enable it, thus preventing cec from working on those boards.

And even worse: a /dev/cecX device will appear for those boards, but it
won't be functioning without configuring this clock.

Changes:
v4:
- Change commit message to stress the importance of this patch

v3:
- Drop useless braces

v2:
- Separate ENOENT errors from others
- Propagate other errors (especially -EPROBE_DEFER)

Signed-off-by: Pierre-Hugues Husson <phh@phh.me>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20171125201844.11353-1-phh@phh.me
(cherry picked from commit ebe32c3e28)

Change-Id: I084e254f7ee1b2c537d3f18897d64578e8bfd482
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2017-12-29 09:17:52 +08:00
Zheng Yang
0168873019 drm/bridge/synopsys: fix uninitialized symbol config0
Change-Id: Ifb2438150a5adda4e9542b70668f545c42138e07
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-12-28 11:05:04 +08:00
Laurent Pinchart
268d7f4e3d drm: bridge: dw-hdmi: Move the driver to a separate directory.
The driver is already made of 5 separate source files. Move it to a
newly created directory named synopsys where more Synopsys bridge
drivers can be added later (for the DisplayPort controller for
instance).

Suggested-by: Jose Abreu <Jose.Abreu@synopsys.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Jose Abreu <joabreu@synopsys.com>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Link: http://patchwork.freedesktop.org/patch/msgid/20170303172007.26541-10-laurent.pinchart+renesas@ideasonboard.com
(cherry picked from commit 35dc8aabc8)

Change-Id: Ibf30c8dcb9f1a326f35dd7e36908d3dd2776091f
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-12-28 10:54:44 +08:00
Algea Cao
1be71d23f0 UPSTREAM: drm/bridge: dw-hdmi: add cec driver
Add a CEC driver for the dw-hdmi hardware.

Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
[hans.verkuil: unsigned -> unsigned int]
[hans.verkuil: cec_transmit_done -> cec_transmit_attempt_done]
[hans.verkuil: add missing CEC_CAP_PASSTHROUGH]
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20170802184108.7913-4-hverkuil@xs4all.nl
(cherry picked from commit a616e63c56)

Change-Id: I9e50f3e87d452bc7291755eae4aa14a3ec7ab0b3
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2017-12-27 16:54:13 +08:00
Algea Cao
e453db15f1 UPSTREAM: drm/bridge: dw-hdmi: add missing cec_notifier_put
The __dw_hdmi_remove() function was missing a call to cec_notifier_put
to balance the cec_notifier_get in the probe function.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Link: https://patchwork.freedesktop.org/patch/msgid/a7688d13-2d61-ed16-f2df-28cbb5007f38@xs4all.nl
(cherry picked from commit e383bf85d3)

Change-Id: I59de801ba6e4c0956b6ba76a49dc57bda34c36a7
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2017-12-27 16:48:24 +08:00
Algea Cao
970623d0d1 UPSTREAM: drm/bridge: dw-hdmi: add better clock disable control
The video setup path aways sets the clock disable register to a specific
value, which has the effect of disabling the CEC engine.  When we add the
CEC driver, this becomes a problem.

Fix this by only setting/clearing the bits that the video path needs to.

Reviewed-by: Jose Abreu <joabreu@synopsys.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Link: https://patchwork.freedesktop.org/patch/msgid/E1dcBha-00088l-DE@rmk-PC.armlinux.org.uk
(cherry picked from commit 7cc4ab225a)

Change-Id: Ic5603e5197d8107cba821ba4bc1bfbad2d12a1e2
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2017-12-27 16:45:52 +08:00
Algea Cao
c1a59df015 UPSTREAM: drm/bridge: dw-hdmi: add cec notifier support
Add CEC notifier support to the HDMI bridge driver, so that the CEC
part of the IP can receive its physical address.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Tested-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Link: https://patchwork.freedesktop.org/patch/msgid/E1dcBhV-00088e-8x@rmk-PC.armlinux.org.uk
(cherry picked from commit e84b8d75ac)

Change-Id: Ib3b3f6fc9e08fc3872b043f5dc36b77b50a378aa
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2017-12-27 16:45:32 +08:00
Zheng Yang
a7d17fdc65 drm: bridge: dw-hdmi: fix tmds clk in status show
According to HDMI 2.0 chapter 6.1, for TMDS character Rates
avove 340Mcsc, the TMDS Clock Rate shall be one fourth of
the TMDS Character Rate.

Change-Id: I4cc78aa1a5fbf6cec93e787dde49e482d0b4d342
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-12-13 18:34:49 +08:00
Zheng Yang
f8fbbc4520 drm: bridge: dw-hdmi: introduce mpll_cfg_420
RK3368/RK3399 mpll input clock rate is twice of mpll output
in YCBCR420 mode. This patch introduce mpll_cfg_420 to get
the platform YCBCR420 phy setting. If mpll_cfg_420 is not
exist, use mpll_cfg.

Change-Id: I7910a75394cf371a8008f8a83e3ab9ec14e9a68a
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-12-11 15:27:58 +08:00
Zheng Yang
1d2df5571a drm: bridge: dw-hdmi: fix VP_PR_CD pixel repetition factor configuration
The configured value sets H13T PHY PLL to multiply pixel clock by the
factor in order to obtain the desired repetition clock. For the CEA
modes some are already defined with pixel repetition in the input video.
So for CEA modes this shall be always 0.

Change-Id: Iea4a00247f25c134dbd67ba77c00eb4393622385
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-12-11 15:27:05 +08:00
Zheng Yang
27b2871f98 drm: bridge: dw-hdmi: Implement connector atomic_begin
To avoid screen flash when updating CSC, we introduce connector
atomic_begin. Before flush crtc and connector, it's need to send
AVMUTE flag to make screen black, and clear flag after CSC updated.

AVMUTE -> Update CRTC -> Update HDMI -> Clear AVMUTE

Change-Id: Id47caac1e25fcce5a5aa7b879da4a6b9a9bab8a1
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-12-11 15:17:31 +08:00
Zheng Yang
b240a5aae0 drm: bridge: dw-hdmi: add hdmi status debugfs node
Introduce status node in debugfs to show HDMI output status,
such as phy status, color and eotf.

Here is a sample log:

PHY enabled                     Mode: HDMI
Pixel Clk: 594000000Hz          TMDS Clk: 594000000Hz
Color Format: YUV422            Color Depth: 10 bit
Colorimetry: ITU.BT2020         EOTF: ST2084
x0: 0                           y0: 0
x1: 0                           y1: 0
x2: 0                           y2: 0
white x: 0                      white y: 0
max lum: 0                      min lum: 0
max cll: 0                      max fall: 0

Change-Id: I5d458b633dd3bd9aab67cc91f1695621937e58f5
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-12-01 15:52:17 +08:00
Zheng Yang
d1943fde81 drm: bridge: dw-hdmi: support Dynamic Range and Mastering Infoframe
The Dynamic Range and Mastering InfoFrame carries data such as
the EOTF and the Static Metadata associated with the dynamic
range of the video stream.

This function is introduced in the 2.11a version.

Change-Id: I279cc0665e34d75209774013882ccc8946ce6da5
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-11-22 09:31:48 +08:00
Zheng Yang
c9ed636f38 drm: bridge: dw-hdmi: fix phy cpce setting in YCBCR420 mode
To support YCBCR420 10bit, we need to enable mpll output divider.
It is also compatible with YCBCR420 8bit mode.

Change-Id: I6028cfb045efd05c2cb2b9920e32901ea5aa95dc
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-11-16 14:40:33 +08:00
Zheng Yang
55c75a9da2 drm: bridge: dw-hdmi: fix GCP default phase in deep color mode
According to HDMI 1.4b specification: If the transmitted video
format has timing such that the phase of the first pixel of
every Video Data Period corresponds to pixel packing phase 0
(e.g. 10P0, 12P0, 16P0), the Source may set the Default_Phase
bit in the GCP. The Sink may use this bit to optimize its filtering
or handling of the PP field.

This means that for 10-bit mode the Htotal must be dividable by 4;
for 12-bit mode, the Htotal must be divisible by 2.

Change-Id: I02e632d095141cbabcba06dc1321ae0dc69dc736
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-11-16 14:40:23 +08:00
Zheng Yang
d2e0476319 drm: bridge: dw-hdmi: Implement connector atomic_flush
Introduce dw_hdmi_connector_atomic_flush to implement connector
atomic_flush.

Only when enc_in_encoding/enc_out_encoding/enc_in_bus_format/
enc_out_bus_format changed, dw_hdmi_setup is called.

Introduce previous_pixelclock/previous_tmdsclock/mtmdsclock to
determine whether PHY needs initialization. If phy is power off,
or mpixelclock/mtmdsclock is different to previous value, phy is
neet to be reinitialized.

Change-Id: I1984fb188ba486de18f6d51b7a51320bbf2bc27d
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-11-16 14:39:39 +08:00
Zheng Yang
36a3883514 drm: Add HDR panel metadata property
HDR_PANEL_METADATA is used to indicate HDR capacity of sink device.

Change-Id: I598a7bb5634f14b57f94135fd3be6b0ad2075116
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-11-08 16:45:50 +08:00
Zheng Yang
aaa09dc626 drm: bridge: dw-hdmi: support send BT.2020 colorimetry in avi
Change-Id: I130e151c4576325103e7374e7402718b93ca5da3
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-11-02 15:46:41 +08:00
Zheng Yang
3b85c52032 drm: bridge: dw-hdmi: support deep color mode
Introduce mtmdsclock to record tmds clock, which is different
to mpixelclock in deep color mode. Use this variable to select
synopsys phy curr_ctrl/phy_config, and audio N/CTS.

Change-Id: Ia78dee9c4901d2f1ca7f339dfb030d65bbf6861d
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-11-01 11:43:52 +08:00
Zheng Yang
a7a73c3770 drm: bridge: dw-hdmi: support attach property
Introduce struct dw_hdmi_property_ops in plat_data to attach
vendor connector property.

Change-Id: I3d23e40e9d342b22ca47f723b3f81057b58010e8
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-11-01 09:08:04 +08:00
Zheng Yang
81ba0ec901 drm: bridge: dw-hdmi: add switch state in dw_hdmi_connector_force
Application need to listen HDMI connector state when connector is
forced on/off, so we add switch_set_stat in dw_hdmi_connector_force.

Change-Id: I2b76a0a647eb6a4cfde7584e085f53540d0fa27f
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-10-30 20:57:34 +08:00
Zheng Yang
9156d7504c drm: bridge: dw-hdmi: fix ycbcr_420_allowed condition of RK3288
The version of RK3288 HDMI is 0x200a, it doesn't support ycbcr420 mode.

Change-Id: I65ee16ae79f42fd13514db8e5819db6d07db9d3d
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-10-30 09:15:55 +08:00
xuhuicong
727e0fe68d drm/edid: output common tv resolution and hdmi mode if no read the correct edid
Change-Id: Ib7379340e8c1d59382553d21b60165fe5fb371e8
Signed-off-by: xuhuicong <xhc@rock-chips.com>
2017-09-29 16:59:09 +08:00
Algea Cao
7ed0a48a76 drm: bridge: dw-hdmi: set hdmi ddc pin HI-Z when suspend
Set hdmi ddc pin HI-Z to save power.

Change-Id: Ic5e15cac43c486e7de6be8526daea9b36da68bc8
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2017-09-28 17:17:59 +08:00
Zheng Yang
dd52956a41 drm: bridge: dw-hdmi: enable ycbcr_420_allowed
Change-Id: I8920d8193ba0675b58ae156986b991ab9dc6f025
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-09-13 15:22:15 +08:00