Commit Graph

844052 Commits

Author SHA1 Message Date
Algea Cao
f688bcfc62 drm/rockchip: dw-hdmi: Set 4K x 2k 60Hz/50Hz color to YUV420 if tmdsclk over the limit
When 4K x 2k 60Hz/50Hz tmds clock is above the max tmds clock, setting its
color to YUV420. A few TV edid declare that they can't support
4K x 2k 60Hz/50Hz YUV420, we still set color to YUV420 or 4K x 2k 60Hz/50Hz
tmds clock will over the limit.

Change-Id: Id57c9313ab52973927c578d0eb2a7b1b30cb9ec1
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2019-08-26 18:16:04 +08:00
Algea Cao
4088ea06bc drm/rockchip: dw_hdmi-rockchip: get phy config from dts
Change-Id: I6903f3b9498be32f9d4936beb2d6d2aa5db43d09
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2019-08-26 18:13:50 +08:00
Shunqing Chen
e4c31f3d61 drm/bridge: synopsys: dw-hdmi: set hdcp keepout active
Change-Id: Ie5718479bb267238c5461f3ed203ae43d75c46de
Signed-off-by: Shunqing Chen <csq@rock-chips.com>
2019-08-26 18:13:41 +08:00
Huicong Xu
5184a0eb6e drm: bridge: dw-hdmi: add hdcp1.4 support
First, write hdcp key by "ProvisioningTool" if you want to
enable hdcp function, or else will auth fail.

To check whether the hdcp is enable or not
  #cat /sys/class/misc/hdmi_hdcp1x/enable
  0:hdcp is disabled
  1:hdcp is enabled, hdmi screen will be pink if it is failed;
  2:hdcp is enabled, hdmi screen will be normal if it is failed;

Enable or disable hdcp function
  #echo 0 > /sys/class/misc/hdmi_hdcp1x/enable
  #echo 1 > /sys/class/misc/hdmi_hdcp1x/enable
  #echo 2 > /sys/class/misc/hdmi_hdcp1x/enable

Get the status of hdcp
  #cat /sys/class/misc/hdmi_hdcp1x/status
  The result will be one of the follow list:
    hdcp disable;
    hdcp_auth_start
    hdcp_auth_success;
    hdcp_auth_fail;
    unknown status.

Change-Id: Iac6c7d6a1196ce9cf2869d7916bbe6c8941ec13b
Signed-off-by: Huicong Xu <xhc@rock-chips.com>
2019-08-26 18:13:28 +08:00
Algea Cao
cdf220b192 drm/bridge: dw_hdmi: initialize hdmi i2c when system resume
Change-Id: Ie9373517e255c91ded38a4e620d15d5cfd0bd9c4
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2019-08-26 18:11:25 +08:00
Algea Cao
30948dc13f drm: bridge: dw-hdmi: Check whether hdmi is initialized when hdmi suspend or resume
Hdmi suspend or resume may be called before hdmi initialization. We must
verify that hdmi is initialized first.

Change-Id: I2a680209e64b9c1aebc2d9ee19d543927137afd0
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2019-08-26 17:51:30 +08:00
Algea Cao
7139db635b drm/rockchip: Add hdmi shutdown interface
When system shutdown, shutdown interface will be called.
Hdmi should be disabled when system shutdown.

Change-Id: I09ec1d7d3801bf8a8277c91072fa09bd1b430809
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2019-08-26 17:51:18 +08:00
Zheng Yang
36d14bb2b4 drm/bridge: synopsys: dw-hdmi: delete mutex in dw_hdmi_suspend
This patch delete the mutex in dw_hdmi_suspend. For there is no
need to use mutex to protect disable_irq. And the same mutex is
also used in the dw_hdmi_irq, mutex deadlock will occur when
dw_hdmi_suspend and dw_hdmi_irq are called at the same time.

Change-Id: I8cb6a6483aa4d32882e814656dd93317b5da9ad3
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2019-08-26 17:49:19 +08:00
Algea Cao
c4f7203e8f drm/bridge: synopsys: dw-hdmi: Fix crush when system suspend
If HDMI HPD detect delayed work won't be cancel, system will
crush because clk and PD has been disabled. So HDMI HPD detect
workqueue should be flushed when system suspend.

Change-Id: Idb8018c2efcffc3aee5fd80872f1270360809235
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2019-08-26 17:48:43 +08:00
Algea Cao
5a7627a9ea 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>
2019-08-26 17:48:19 +08:00
Algea Cao
496ebbc3cf drm: bridge: dw-hdmi: enable 3d mode
Change-Id: I45c4b0ded4aeaf24122d5cc6eb49b6bc72afc060
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2019-08-26 17:47:47 +08:00
Algea Cao
08d73cce4a drm/bridge: synopsys: dw-hdmi: Clear color depth mask and format if get edid failed
If edid can't be got when hdmi plug in, hdmi color depth mask and format
won't be updated. The color list in the setting are those of the previous
TV. This commit fix the error.

Change-Id: I5ed4be5efa2a69be0b58489f58a3af5de9912292
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2019-08-26 17:44:50 +08:00
Yakir Yang
d69c3b9f74 CHROMIUM: drm: bridge/dw_hdmi: fix i2cm standard mode setting error
I have uploaded a patch to switch DDC to standard mode in
(https://chromium-review.googlesource.com/298270), but that change
have influence the "spare register" in I2CM_DIV, I know this haven't
cause some know bug, but we need to fix it.

BUG=chrome-os-partner:34741
TEST=None

Change-Id: Iff678fb49828db9b8026422e302a03f687a7c862
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
Reviewed-on: https://chromium-review.googlesource.com/302751
Commit-Ready: Douglas Anderson <dianders@chromium.org>
Tested-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
2019-08-26 17:34:51 +08:00
Zheng Yang
0b1aeca342 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>
2019-08-26 17:34:46 +08:00
Yakir Yang
98d6109028 CHROMIUM: drm: bridge/dw_hdmi: assign CD field to zero
When the color depth is 24 bits per pixel video, the CD
field in General Control Packet should be "Color Depth
not indicated", then the colordepth in register vp_pr_cd
& csc_scale should assign to zero.

BUG=chrome-os-partner:38212
TEST=speedy board, Test with Agilent Technologies U4002A
     HDMI Protocal Analyzer

Change-Id: Ifd5767d339fdbff11e234ec0891c8f3df1dd66a5
Reviewed-on: https://chromium-review.googlesource.com/261850
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Yakir Yang <ykk@rock-chips.com>
Commit-Queue: Yakir Yang <ykk@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2019-08-26 17:34:38 +08:00
Algea Cao
156f59a4d1 drm/bridge: synopsys: dw-hdmi: Select formula1 for csc decimation
Formula3 and Formula2 for csc decimation will cause hdmi yuv422
display err.

Formula3:
The pixel color of left 0-14 columns and right 0-12 columns is
err.

Formula2:
The pixel color of left 0-2 columns is err.

Change-Id: I94fdd5fd962a24fde02dde1fe3ac10437ad117ad
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2019-08-26 17:34:33 +08:00
Zheng Yang
eb9ef937d6 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>
2019-08-26 17:34:29 +08:00
Neil Armstrong
e70565e1cb UPSTREAM: drm/bridge: dw-hdmi: disable SCDC configuration for invalid setups
This patch is an attempt to limit HDMI 2.0 SCDC setup when :
- the SoC embeds an HDMI 1.4 only controller
- the EDID supports SCDC but not scrambling
- the EDID supports SCDC scrambling but not for low TMDS bit rates,
  while only supporting low TMDS bit rates

This to avoid communicating with the SCDC DDC slave uncessary, and
setting the DW-HDMI TMDS Scrambler setup when not supported by the
underlying hardware.

Change-Id: I8ec1b7c33f49e4a63196335589d11396c8b9fe0e
Reported-by: Rob Herring <robh@kernel.org>
Fixes: 264fce6cc2 ("drm/bridge: dw-hdmi: Add SCDC and TMDS Scrambling support")
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Tested-by: Rob Herring <robh@kernel.org>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190315095414.28520-1-narmstrong@baylibre.com
(cherry picked from commit 836f90f9e2)
2019-08-26 17:34:22 +08:00
Zheng Yang
22c7219135 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>
2019-08-26 17:30:04 +08:00
Zheng Yang
cfc01699fc 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>
2019-08-26 17:24:44 +08:00
Algea Cao
58d3d8412a drm/rockchip: dw_hdmi: Fix up screen flash when switching color
After switching color, hdmi output signal may be unstable.
If AVMUTE is cleared too early, tv will display err.

Change-Id: I595180bfe6e014de5231bcd75ee259d5702121e0
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2019-08-26 17:24:44 +08:00
Algea Cao
8aad83b839 drm/bridge: synopsys: dw-hdmi: Remove hpd_state judgment of atomic_begin and atomic_flush
There is no need to judge hpd status in atomic_begin and atomic_flush.
And this judgment may cause display error if TV make hpd status change
frequently.

Change-Id: I2ed87ef42b78a8faadc4bcc5b6b16d9390644903
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2019-08-26 17:24:44 +08:00
xuhuicong
7ab28c3914 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>
2019-08-26 17:24:44 +08:00
algea.cao
de13464baa drm/bridge: dw_hdmi: set vdisplay for frame packing 3d mode
This patch is only applicable to 3d frame packing
of progressive mode.
According to HDMI Specification 1.4b 8.2.3.2,
vertical toatal line is x2 of 2D vertical toatal line
and pixel clock frequency is x2 of 2D pixel clock frequency.

vdisplay += vtotal
mpixelclock *= 2

Change-Id: I097c25cd1a930635e33f0a7bc86797ad1c7ed607
Signed-off-by: algea.cao <algea.cao@rock-chips.com>
2019-08-26 17:24:44 +08:00
Nickey Yang
5eb78cfb18 drm: bridge/dw-hdmi: fix 4 block edid read error
msgs[0].addr will be 0x30 when read edid with more than 2 block.
but still a read edid operation with write DDC_ADDR to
HDMI_I2CM_SLAVE register.So fix it.

Change-Id: I5f0cd9172acd4a68d5b54eaf99f17b45385a4263
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
2019-08-26 17:24:44 +08:00
Zheng Yang
b68cf86c03 drm: bridge: dw-hdmi: set ddc scl clock rate according to dts
To set dw hdmi i2c bus adapter scl clock rate, we introduce two device
tree parameter, ddc-i2c-scl-high-time-ns and ddc-i2c-scl-low-time-ns.

ddc-i2c-scl-high-time-ns: how many ns SCL hold high
ddc-i2c-scl-low-time-ns: how many ns SCL hold low

After measurement, 50KHz scl clock rate recommended configuration is:

&hdmi {
	ddc-i2c-scl-high-time-ns = <9625>;
	ddc-i2c-scl-low-time-ns = <10000>;
};

100KHz recommended configuration is:
&hdmi {
        ddc-i2c-scl-high-time-ns = <4708>;
        ddc-i2c-scl-low-time-ns = <4916>;
};

If dts parameter is not available, the default scl rate is 100KHz.

Change-Id: I6f6b0bf1694ab59e70da789ead99e15a53c93e4d
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2019-08-26 17:24:44 +08:00
Zheng Yang
251f26d82e drm: bridge: dw-hdmi: support send BT.2020 colorimetry in avi
Change-Id: I130e151c4576325103e7374e7402718b93ca5da3
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2019-08-26 17:24:44 +08:00
Wyon Bi
aefda0b281 drm/rockchip: dsi: Add support for rockchip kernel logo
Change-Id: Ifb511a5db4c744448bfa02c09ee4c884b6d2a4e8
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2019-08-26 16:02:43 +08:00
Wyon Bi
a96ba7fcd5 drm/rockchip: dsi: Add support for PX30/RK1808/RK3128/RK3368
Change-Id: Ia9934a50c63e046e34ea694e10b0e1d17b53a6f0
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2019-08-26 16:02:43 +08:00
Wyon Bi
b2028b88c9 drm/rockchip: dsi: implement runtime pm to dynamically manage the clock
Change-Id: I7ac757a04b51dded41a9c3f6697bb9390e0e2e5e
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2019-08-26 16:02:43 +08:00
Zheng Yang
fac791be7c drm/rockchip: hdmi: add hdmi output colorimetry property
This patch add hdmi_output_colorimetry to support modify
hdmi output colorimetry. It could be following value:
	- None
	- IUT_2020
Default value is None, which means normal hdmi output
colorimetry.

Change-Id: Ib4883fd0553d9d4193c7295812d2c1433724fe63
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2019-08-23 14:24:32 +08:00
Simon Xue
9e7903733a arm: dts: rockchip: update iommu clk name from "hclk" to "iface"
Change-Id: Id472c4b7cc6161efe5c5edc5daac80a5ba19c472
Signed-off-by: Simon Xue <xxm@rock-chips.com>
2019-08-23 14:15:30 +08:00
Simon Xue
501edcd4d6 arm64: dts: rockchip: update iommu clk name from "hclk" to "iface"
Change-Id: I145f5307814c3300c11ee4281673498c98cf6166
Signed-off-by: Simon Xue <xxm@rock-chips.com>
2019-08-23 14:15:12 +08:00
Simon Xue
53af1d4ee1 iommu/rockchip: make compatible to iommu who use "hclk" in dts
Change-Id: If7c5c48e78cdbf189dd445980a61f4ffeb7082ce
Signed-off-by: Simon Xue <xxm@rock-chips.com>
2019-08-23 14:14:10 +08:00
Algea Cao
1058897b3c FROMLIST: drm: Parse Colorimetry data block from EDID
CEA 861.3 spec adds colorimetry data block for HDMI.
Parsing the block to get the colorimetry data from
panel.

v2: Rebase

v3: No Change

v4: Addressed Shashank's review comments. Updated
colorimetry field to 16 bit as DCI-P3 got added
in CEA 861-G spec, as pointed out by Shashank.

v5: Fixed checkpatch warnings with --strict option.

Change-Id: Ia82d4c04edff53bd4d6c4411dd90391497140e85
Signed-off-by: Uma Shankar <uma.shankar@intel.com>
Reviewed-by: Shashank Sharma <shashank.sharma@intel.com>
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
(am from https://patchwork.kernel.org/patch/10861325/)
2019-08-23 11:01:14 +08:00
Zheng Yang
821bf1091c drm/rockchip: hdmi: disable RK3368 2160P RGB444/YCbCr444/YCbCr422 mode
Change-Id: I573db9cd41031f45cac359fc9314491ebd1ba8fc
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2019-08-23 10:54:32 +08:00
xuhuicong
ae6fbdeed9 drm/rockchip: dw-hdmi: filter color format which is no support
there are maximum TMDS clock limit, when the clock is out of range
reducing frequency by set color format to yuv420 and/or set color
depth to 8bit

Change-Id: I8b79de97329561bf0399d05c0264a5c818f844fc
Signed-off-by: xuhuicong <xhc@rock-chips.com>
2019-08-23 10:54:32 +08:00
Zheng Yang
99b329a400 drm/rockchip: dw-hdmi: set default color depth to 8 bit
If color depth is automatic, it is same as 8bit.
If tmdsclk > max_tmds_clock, fall back to 8bit.

Change-Id: Ia8cbf5206831ef99456ae59add94c6f8b5a33380
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2019-08-23 10:54:32 +08:00
Zheng Yang
18b67f935a drm/rockchip: dw-hdmi: move depth checking into dw_hdmi_rockchip_select_output
For some display device, max_tmds_clock is 0, we think
max_tmds_clock is 340MHz. If tmdsclock > max_tmds_clock,
depth should fall back to 8bit. And If display mode support
YCBCR420, output format is YCBCR420.

Because max tmds clk of RK3368 is 340MHz, hdmi output policy
is same as mentioned above.

It is need to check tmds clock rate at the last. So we move
depth checking into dw_hdmi_rockchip_select_output.

Change-Id: I27e029fc0171b175ddbfa453ed12854ab6a7432b
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2019-08-23 10:54:32 +08:00
Sandy Huang
df04e458f8 drm/rockchip: lvds: update for kernel logo display
Change-Id: Ibc24b0c20027f2d1ade2540cf69e27a8c823ba1c
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2019-08-23 10:45:03 +08:00
Sandy Huang
774d5ecb0e drm/rockchip: driver: some connector maybe not implement detect
Change-Id: I58b580c36f96388a37c2a2b4a02ba6ba9e46e347
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2019-08-23 10:44:35 +08:00
Sandy Huang
9913202a13 drm/rockchip: VOP: update VOP irq control
VOP irq is share with VOP mmu, so the irq_desc is point to the same
address, this maybe case the following bug:
vop_bind()
	devm_request_irq() -> irq_desc->depth is 0
	disable_irq()      -> irq_desc->depth is 1
	encoder/connector/panel maybe bind failed, so next step is:
vop_unbind()
……
vop_bind() again
	devm_request_irq() -> because the irq_desc is share with VOP MMU,
			      the irq_desc isn't freed.so the depth is 1
	disable_irq()      -> irq_desc->depth is 2

next step when we want to enable_irq, the irq_desc->depth is 2, the GIC
will not enable VOP irq realy.

so we update the VOP irq control, delete the GIC VOP interrupt control.
after this the VOP interrupt only control by VOP interrupt register.

maybe we can enable_irq at vop_unbind when vop_bind failed to keep irq
balance, but the enable_irq() at vop_unbind() seem not friendly.

Change-Id: I30ee0b6973e8eebb9209b10d8bbbfb6cbcfb30e8
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2019-08-23 10:44:31 +08:00
Sandy Huang
7c932a6cd6 arm64: dts: rockchip: px30: update rockchip-iommu clk name
Change-Id: I45b9fd681064b57efafe92d2a90486af1a77d293
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2019-08-23 10:44:27 +08:00
Wyon Bi
83fda806f0 phy/rockchip: Add support for INNOSILICON MIPI/LVDS/TTL Video Combo PHY
The Innosilicon Video Combo PHY not only supports MIPI DSI,
but also LVDS and TTL functions with small die size and low
pin count. Customers can choose according to their own applications.

Change-Id: I0e4a5f69af5cc967b5df0fb17a51c43cef9ea33f
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2019-08-23 09:28:18 +08:00
Wyon Bi
7ac1f1bde0 phy: add MIPI/LVDS/TTL modes to the phy_mode enum
This patch adds more generic PHY modes to the phy_mode enum, to
allow configuring generic PHYs to the MIPI/LVDS/TTL mode by
using the set_mode callback.

Change-Id: Ib6966828011aa52f1f133449f69df46c2001a57b
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2019-08-23 09:06:14 +08:00
Leo Wen
3483d7ceb2 drm/rockchip: vop: use win1 for ui instead of win0 in px30 vopb.
PX30 vopb have win0, win1 and win2 layers.the formats they support below:
Win0:   XR24 AR24 XB24 AB24 RG24 BG24 RG16 BG16 NV12 NV16 NV24 NA12 NA16 NA24
Win1/2: XR24 AR24 XB24 AB24 RG24 BG24 RG16 BG16

Only the win0 layer support NV12 format(video decode format).
So change to use win0 for video overlay layer and win1 for ui layer.

Change-Id: I7ef8bda4be908188700ca4d3f1df23a6336e02b2
Signed-off-by: Leo Wen <leo.wen@rock-chips.com>
2019-08-23 09:06:14 +08:00
Nickey Yang
332d7f2a88 drm/rockchip: vop: adjust the layers in RK3399's VOBL
AFAWK, there are four layers in RK3399's VOPB, and two layers for
RK3399's VOPL.

And RK3399's VOBL has the win0 and win2 layers, the formats they support
as below.
win0:
    XR24 AR24 XB24 AB24 RG24 BG24 RG16 BG16 NV12 NV16 NV24 NA12 NA16 NA24
win2:
    XR24 AR24 XB24 AB24 RG24 BG24 RG16 BG16
So only win0 layer supports NV12 format (for video decode format),
adjust the overlay for video and primary layer for display.

It didn't care this case if some platforms had handled the display in
application (e.g android), then on the Linux platform, it's hard to handle
the all kinds of cases in Display application, perhaps the linux needn't
this patch fixes it in the future.

Depend-CL:76144
Fixes: d82f1d3e58
("arm64: dts: rockchip: reasonable alllcation of VOP on rk3399 linux")

Change-Id: Id93b315b6e3ae670bf5ea4dc0a64e140c6e37e80
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
2019-08-23 09:06:14 +08:00
Nickey Yang
e3f50f3518 drm/rockchip: vop: set plane's zpos according to type
The zpos currently configure is the order in vop_win_data array,
which is related to the actual hardware plane.
But in the Linux platform, such as video hardware and camera preview,
it can only be played on the nv12 plane.
So set the order of zpos to PRIMARY < OVERLAY (if have) < CURSOR (if have).

Change-Id: Ia9ab3cb9225fd2c385703109afbfbb42a1564110
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
2019-08-23 09:06:14 +08:00
Sandy Huang
47a4bf661f drm/rockchip: vop: p2i is supported from rk3399
Change-Id: I52206f36caecc01134f9ade7112c6b345e7b9834
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2019-08-23 08:37:28 +08:00
Sandy Huang
480670f19c drm/rockchip: rgb: init eotf and color space for tv output
Change-Id: Ieb5891dbee664c4fe283db6f075a811be1b4bd25
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2019-08-23 08:37:28 +08:00