Commit Graph

1059418 Commits

Author SHA1 Message Date
Ding Wei
ed9fd83aae video: rockchip: mpp: rkvdec2: add rcb-min-width info for rcb usage
tips:
    for rk356x, when image width less than 512, it may occur very
small probability for sram read and write.

Change-Id: I57bdfeb776dc0762870f3d7a3a6d81a1c146240d
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2021-08-19 15:39:20 +08:00
Ding Wei
98eaf1a78a video: rockchip: mpp: Optimize kref_get within mem_regions
tips:
1. If fd has imported, then just copy mem_regiony struct.
2. Task is the unit for running, and mem_region is the
   internal element of task.
3. In mem_regions, it can only kref_get once with the same fd,
   instead of all fds which the same fd.

Change-Id: I7236803a5a263d6e79256036caf580b5ac2c35e9
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2021-08-19 15:39:20 +08:00
Ding Wei
0d6170d606 video: rockchip: mpp: remove ktime_get within a task processing
reason: mem_regions are within a task, and the differ time between
mem_region can be ignore. Thus, it can be remove when attach task fds.

Change-Id: I5986d2dca6eff41d6c6a8fa3f037e183b102e63c
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2021-08-19 15:39:20 +08:00
Ding Wei
2dec1b3bd0 video: rockchip: mpp: rkvdec2: rcb_info move to session->priv
if rcb_info not change, then the infos will not ioctl from userspace.
thus, it needs to restore infos in session.

Change-Id: I4ff3b5bcc22b033b1d7549866af7c253bf46945c
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2021-08-19 15:39:20 +08:00
Alpha Lin
8040e871f3 rockchip: video: iep: enable blending and intra interp
Enable blending and intra interpolation by default.

Change-Id: I3f304714d630b4aab677ab6d09cfea514b03d7b1
Signed-off-by: Alpha Lin <alpha.lin@rock-chips.com>
2021-08-19 15:39:20 +08:00
Ding Wei
70dfc38bd3 video: rockchip: mpp: Add property for disable freq set
if property set, then it will skip get/set/reduce freq.

Change-Id: I56f641807327e9e63b8ebc0c91e79ffb19680b1c
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2021-08-19 15:39:20 +08:00
Tao Huang
db4f1ce5a0 video: rockchip: mpp: rkvdec2: Fix compile warning on ARM
drivers/video/rockchip/mpp/mpp_rkvdec2.c:1029:16: warning:
format '%llx' expects argument of type 'long long unsigned int',
but argument 3 has type 'resource_size_t {aka unsigned int}' [-Wformat=]

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I5bb3ac3a2d5d2d41c802e42ed6a26efb5219d0aa
2021-08-19 15:39:20 +08:00
Ding Wei
aaa1290bc5 video: rockchip: mpp: when meet unknown cmd, not return error.
reason: when kernel version later than mpp which user space, then
it will meet unknow cmd. however, it should not return error, and
let it continue instead.

Change-Id: I1209c27ef8de98f25b47700bc48dfcff305e0c0e
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2021-08-19 15:39:20 +08:00
Ding Wei
404fd28390 video: rockchip: mpp: Reduce frequent malloc/free for memory region
tips: In the whole process, task is the unit, and it can only be
one state. And mem_region is an internal element, so no lock is
required.

Change-Id: I07955d0d7064c3c6aec6968d0d38d6e0ad378289
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2021-08-19 15:39:20 +08:00
Ding Wei
4e227a971c video: rockchip: mpp: Encapsulate the rw lock of IOMMU as functions
Change-Id: I5e176bbcdc33bacafeaa8c3b80b5f8337d13bb9a
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2021-08-19 15:39:20 +08:00
Herman Chen
0fec113a61 video: rockchip: mpp: workaround patch for rv1126 iommu issue
tips:
rv1126/rv1109 use mmu-v1 which may trigger bug, and log shown below.

[  150.542230] rk_iommu ffb80480.iommu: Page fault at 0x02176000 of type write
[  150.542264] rk_iommu ffb80480.iommu: iova = 0x02176000: dte_index: 0x8 pte_index: 0x176 page_offset: 0x0
[  150.542277] rk_iommu ffb80480.iommu: mmu_dte_addr: 0x3ebaf000 dte@0x3ebaf020: 0x375df001 valid: 1 pte@0x375df5d8: 0x10957007 valid: 1 page@0x10957000 flags: 0x6
[  150.542288] mpp_rkvdec ffb80000.rkvdec: fault addr 0x02176000 status ab
[  150.542296] mpp_task_dump_mem_region:1546: --- dump mem region ---
[  150.542304] mpp_task_dump_mem_region:1552: reg[  0]: 0x00000000, size 1000
[  150.542311] mpp_task_dump_mem_region:1552: reg[  4]: 0x0041e000, size 200000
[  150.542319] mpp_task_dump_mem_region:1552: reg[  6]: 0x00201000, size 1000
[  150.542326] mpp_task_dump_mem_region:1552: reg[  7]: 0x02176000, size 1f4000
[  150.542333] mpp_task_dump_mem_region:1552: reg[ 10]: 0x011d6000, size 1f4000
[  150.542340] mpp_task_dump_mem_region:1552: reg[ 11]: 0x013ca000, size 1f4000
[  150.542347] mpp_task_dump_mem_region:1552: reg[ 12]: 0x01b9a000, size 1f4000
[  150.542354] mpp_task_dump_mem_region:1552: reg[ 13]: 0x01b9a000, size 1f4000
[  150.542361] mpp_task_dump_mem_region:1552: reg[ 14]: 0x01b9a000, size 1f4000
[  150.542368] mpp_task_dump_mem_region:1552: reg[ 15]: 0x01b9a000, size 1f4000
[  150.542375] mpp_task_dump_mem_region:1552: reg[ 16]: 0x01b9a000, size 1f4000
[  150.542382] mpp_task_dump_mem_region:1552: reg[ 17]: 0x01b9a000, size 1f4000

method:
    Flush extra iommu tlb before running a task.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Ic1a501bab6583e87c1c340c54e06dc7d021e99fc
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2021-08-19 15:39:20 +08:00
Ding Wei
e3781f86cd video: rockchip: mpp: Reduce frequent malloc/free for dma buffer
Change-Id: I5474dad5b1ba08d05edce8d35765abc13d453a9b
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2021-08-19 15:39:20 +08:00
Ding Wei
9867e44d38 video: rockchip: mpp: printf session fix to %8p
Change-Id: Ide0b15ed64afe577bac48bbb60986dc6b11dbd2b
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2021-08-19 15:39:20 +08:00
Herman Chen
f1a9ec5fe2 video: rockchip: mpp: Add device task capacity
1. Add mpp_dev task capacity and default is 1.
   The task capacity is the task queue length that hardware can accept.
   Default 1 means normal hardware can only accept one task at once.

2. Attach mpp_dev to mpp_taskqueue for status probe. The task queue
   capacity is the minimum task capacity of all the attached mpp_dev.

Change-Id: I8cafe806ec9399902237418d2bbcb088240ed415
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-08-19 15:39:20 +08:00
Herman Chen
ffde99e689 video: rockchip: mpp: Add session index
Change-Id: I1b55227b0692e84ee28a1b229b38a1ad118b1e5b
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-08-19 15:39:20 +08:00
Herman Chen
e2d8ad5075 video: rockchip: mpp: common: remove work_lock
Remove work_lock in mpp_taskqueue.

Change-Id: Ideda9e23acae5df9aa91136d9d4678d9ee4e2c7e
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-08-19 15:39:20 +08:00
Guochun Huang
3b04a7c0b8 phy/rockchip: inno-dsidphy: add phy_ops init/exit helper
Change-Id: Id7db9cd6a8948837be3be771af6698e9fbe06f8c
Signed-off-by: Guochun Huang <hero.huang@rock-chips.com>
2021-08-18 17:01:28 +08:00
Guochun Huang
5d53193394 drm/rockchip: dsi: Add support for rockchip kernel logo
Signed-off-by: Guochun Huang <hero.huang@rock-chips.com>
Change-Id: Id5c8911d5d444aaca9fdbfd1996bc8b9e6d2b685
2021-08-18 16:44:28 +08:00
Guochun Huang
7a34356e24 drm/bridge: dw-mipi-dsi: add support for rockchip kernel logo
Change-Id: I3ebbec2cd9f1ab7b643144034be67ade4aa81580
Signed-off-by: Guochun Huang <hero.huang@rock-chips.com>
2021-08-18 16:44:28 +08:00
Sandy Huang
f0d2c7be96 drm/rockchip: drv: add support kernel logo display
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I30afec5114bbad9893a9fb9be4e1ba214a5fccad
2021-08-18 16:44:17 +08:00
Sandy Huang
697bbdf85b drm/panel: simple: Add support loader protect and power invert
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I4abb3739144b5a3c99fd57d76e0ff87ccb664667
2021-08-18 16:44:02 +08:00
Jianqun Xu
55aa440fb8 pinctrl: rockchip: fix mux route error for RK3568
Fixes: 6c671b92dd ("FROMLIST: pinctrl: rockchip: add support for rk3568")

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: Ie4f30c83f5328db277b544dfbbed921381fe9afa
2021-08-17 21:10:48 +08:00
Ankit Nautiyal
1f53369558 UPSTREAM: drm/edid: Parse DSC1.2 cap fields from HFVSDB block
This patch parses HFVSDB fields for DSC1.2 capabilities of an
HDMI2.1 sink. These fields are required by a source to understand the
DSC capability of the sink, to set appropriate PPS parameters,
before transmitting compressed data stream.

v2: Addressed following issues as suggested by Uma Shankar:
-Added a new struct for hdmi dsc cap
-Fixed bugs in macros usage.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
[Jani: Fixed checkpatch PARENTHESIS_ALIGNMENT.]
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201218103723.30844-4-ankit.k.nautiyal@intel.com
(cherry picked from commit 76ee7b9056)
Change-Id: I02d96954736a9dae33cc31e06f411f2ffffddc35
2021-08-17 17:56:20 +08:00
Swati Sharma
4db0f4adfc UPSTREAM: drm/edid: Parse MAX_FRL field from HFVSDB block
This patch parses MAX_FRL field to get the MAX rate in Gbps that
the HDMI 2.1 panel can support in FRL mode. Source need this
field to determine the optimal rate between the source and sink
during FRL training.

v2: Fixed minor bugs, and removed extra wrapper function (Uma Shankar)

Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
[Jani: Fixed checkpatch FROM_SIGN_OFF_MISMATCH, PARENTHESIS_ALIGNMENT.]
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201218103723.30844-3-ankit.k.nautiyal@intel.com
(cherry picked from commit 4499d488f6)
Change-Id: I34cec87592960398eb04e9c2437b9352c14cdf3e
2021-08-17 17:54:11 +08:00
Swati Sharma
f848013c42 UPSTREAM: drm/edid: Add additional HFVSDB fields for HDMI2.1
The HDMI2.1 extends HFVSDB (HDMI Forum Vendor Specific
Data block) to have fields related to newly defined methods of FRL
(Fixed Rate Link) levels, number of lanes supported, DSC Color bit
depth, VRR min/max, FVA (Fast Vactive), ALLM etc.

This patch adds the new HFVSDB fields that are required for
HDMI2.1.

v2: Minor fixes + consistent naming for DPCD register masks
(Uma Shankar)

Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
[Jani: Fixed checkpatch FROM_SIGN_OFF_MISMATCH.]
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201218103723.30844-2-ankit.k.nautiyal@intel.com
(cherry picked from commit 9bb85a6e29)
Change-Id: Ibbdea12806897cab0f95d13847b7e3d8bea1931d
2021-08-17 17:54:11 +08:00
Algea Cao
1aadeb7b2d drm/bridge: synopsys: dw-hdmi: Fix cec timeout when resume
Unmute cec irq when resume

Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: Ic3d83ab7721fcf525d64ac08c970af3e51ecee88
2021-08-17 17:54:10 +08:00
Sandy Huang
b1e11053d6 drm/rockchip: dw-hdmi: attach CONNECTOR_ID prop to identify multi HDMI
Change-Id: I10efb880a050b5db54571f8041d5841ac368488d
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2021-08-17 17:54:10 +08:00
Algea Cao
9986819280 drm: rockchip: dw-hdmi: Clean output_if when hdmi disable
To support multi-display output_if must be clean when
hdmi disable.

Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: Ic4205a59ce1adab7f4ac6f673c740a14556fdeae
2021-08-17 17:54:10 +08:00
Shunqing Chen
fb7d5b0d6b drm/bridge: synopsys: dw-hdmi: fix no display between kernel logo and android logo
def_mode picture_aspect_ratio is no HDMI_PICTURE_ASPECT_NONE,
but Android set mode, the picture_aspect_ratio is HDMI_PICTURE_ASPECT_NONE,
When comparing the new mode with the old mode, the two are inconsistent,
so the mode will be changed.

Signed-off-by: Shunqing Chen <csq@rock-chips.com>
Change-Id: Ide07f9f7251a4ad22d4c27136005be77f1dfd4e2
2021-08-17 17:54:10 +08:00
Algea Cao
299266141e drm/bridge: synopsys: dw-hdmi: Check whether color has changed in connector atomic_check
For compatibility with GKI, connector atomic_begin/atomic_flush should
be removed. If hdmi color format has changed, set flag mode_changed
true and start a modeset to config hdmi.

We check whether color format has changed in
dw_hdmi_connector_atomic_check(), but color format variable update in
dw_hdmi_rockchip_encoder_atomic_check(), It runs after
dw_hdmi_connector_atomic_check(). That will lead to misjudgments when
determining whether color format has changed.

To solve this problem, we introduce get_color_changed(). When color
properties are set and color format is changed, get_color_changed()
return true.

Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: Id1fbe80171856f91efa5ae40a0e0608a92ebcbf7
2021-08-17 17:54:10 +08:00
Nickey Yang
d2e5de5116 drm/bridge: synopsys: dw-hdmi: check hdmi status in resume
HDMI status maybe incorrect in the following condition:
HDMI plug in -> system sleep ->  HDMI plug out -> system wake up.
At this time, cat /sys/class/drm/card 0-HDMI-A-1/status is connected.
There is no hpd interrupt, because HDMI is powerdown during suspend.
So we need check the current HDMI status in this case.
Test on rk3288 & rk3399.

Change-Id: I2fbafd1d80b59628bca65e9e45760a24d1668241
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
2021-08-17 17:54:10 +08:00
Shunqing Chen
bca4620737 drm: rockchip: dw-hdmi: add YCbCr420 support for RK3288W
Change-Id: I47621ca905b9e32550f0274efe6dc35df0490e3a
Signed-off-by: Shunqing Chen <csq@rock-chips.com>
2021-08-17 17:54:10 +08:00
Shunqing Chen
ee1900dfde drm: bridge: dw-hdmi: Fix the issue of EXTCON_DISP_HDMI state error
First, echo off > sys/class/drm/card0-HDMI-A-1/status, the EXTCON_DISP_HDMI state is 0.
Then, echo detect > sys/class/drm/card0-HDMI-A-1/status, the EXTCON_DISP_HDMI state still is 0.
As a result, HDMI has no sound.

Signed-off-by: Shunqing Chen <csq@rock-chips.com>
Change-Id: I6d7904cb75fec21899389dbaba8acbd266dac7cd
2021-08-17 17:54:10 +08:00
Shunqing Chen
52a3be11d0 drm/bridge: synopsys: dw-hdmi: enable clock termination
Signed-off-by: Shunqing Chen <csq@rock-chips.com>
Change-Id: I4927349acfdd94e0dd7b332bbad73defb9ca4f67
2021-08-17 17:54:09 +08:00
Simon Xue
1661c31d26 iommu: dma-iommu: remove unused file
dma-iommu-ops.c is a temporary patch from FROMLIST, now
it is not used anymore, so remove it.

Change-Id: I07dab330311a90a9683f48b645ccfcb6b03322d4
Signed-off-by: Simon Xue <xxm@rock-chips.com>
2021-08-17 09:54:18 +08:00
Jon Lin
143993e798 soc: rockchip: mtd_vendor_storage: Register vendor_storage later
Since storage drivers register in module_init, So the vendor_storage
should be initiated after it.

Change-Id: Icefce56c54713dd56ef992ec527e65fce4f0c977
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-08-13 21:25:56 +08:00
Jon Lin
ff973dbb0e soc: rockchip: mtd_vendor_storage: Change vendor storage item size realloc strategy
Item size is calculated according to the actual space used

Change-Id: I7133368130689f792f05e82fea04ebf16a755a37
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-08-13 21:23:38 +08:00
Jon Lin
0cabb7688e drivers: rkflash: Add some delay after DMA finish
When internal DMA ready, the last spare data may still in fifo.

Change-Id: I1cf670d2008ea62b67b517641e31386fd0877417
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-08-13 14:07:50 +08:00
Shawn Lin
c005a5bfe6 PCI: rockchip: dw: Request perst IO as output-low state
Requesting perst# as high and then drive it low makes some
buggy devices fail to work properly, for instance Biwin SSD.
It's not mandatory to have a high-low transition for perst#
before powering up. So we request it as output-low state directly
and remove redundant code.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Change-Id: Ib62954f8dccc8a21dd06e7a582263bcf62995f29
2021-08-13 11:36:33 +08:00
Algea Cao
18545b79ed drm: rockchip: dw-hdmi: Fix switch from 4K-60/50Hz to lower resolution failed
The resolution below 4K-60/50Hz don't support YUV420. If switch from
4K-60/50Hz in YUV420 to lower resolution may cause display err.
So if resolution below 4K-60/50Hz, color format should be
RGB/YUV444/YUV422.

Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: Ib96303f3bef1a1b269a9ac8845951b6a895ec5b8
2021-08-12 18:25:04 +08:00
Sandy Huang
689b1973fb drm/bridge: synopsys: dw-hdmi: destroy connector and encoder
connector and encoder should be removed when bind failed, otherwise will
lead to system panic when enable SLUB and SLUB_DEBUG:

[    1.071801] rockchip-drm display-subsystem: failed to bind ff960000.dsi (ops dw_mipi_dsi_ops): -517
[    1.073943] Unable to handle kernel paging request at virtual address 006b6b6b6b6b6b73
……
[    1.442300] pc : drm_mode_config_cleanup+0x4c/0x2f8
[    1.447179] lr : rockchip_drm_bind+0x610/0x1c38

after enable KASAN, we can see the UAF error:

[    3.862556] BUG: KASAN: use-after-free in rockchip_drm_bind+0x474/0x2b58
[    3.862611] Read of size 4 at addr ffffffc00a21f55c by task swapper/0/1
[    3.862691] CPU: 4 PID: 1 Comm: swapper/0 Not tainted 4.19.101 #1820
[    3.862737] Hardware name: Rockchip rk3368 808 evb board (DT)
[    3.862782] Call trace:
[    3.862853]  dump_backtrace+0x0/0x240
[    3.862905]  show_stack+0x14/0x20
[    3.863146]  kasan_report+0xc/0x18
[    3.863265]  rockchip_drm_bind+0x474/0x2b58
……
[    3.864314] Allocated by task 1:
[    3.864376]  __kasan_kmalloc.isra.0+0x100/0x1b8
[    3.864435]  kasan_slab_alloc+0x14/0x20
[    3.864493]  __kmalloc_track_caller+0x154/0x368
[    3.864550]  devm_kmalloc+0x30/0xb0
[    3.864611]  dw_hdmi_rockchip_bind+0xcc/0xa28
[    3.864668]  component_bind_all+0x1d8/0x450
[    3.864728]  rockchip_drm_bind+0x450/0x2b58
……
[    3.865787] Freed by task 1:
[    3.865851]  __kasan_slab_free+0x118/0x220
[    3.865897]  kasan_slab_free+0x10/0x18
[    3.865952]  kfree+0x7c/0x308
[    3.866012]  release_nodes+0x248/0x4a0
[    3.866070]  devres_release_group+0xd4/0x148
[    3.866127]  component_unbind.isra.7+0x98/0xc8
[    3.866183]  component_bind_all+0x3b0/0x450
[    3.866247]  rockchip_drm_bind+0x450/0x2b58

Change-Id: I6378bf34d8b953fb770badfafdd3fe44628505f7
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2021-08-12 18:25:04 +08:00
Jianqun Xu
d4258036e8 drm/rockchip: dw_hdmi fix crash caused by null pointer
Change-Id: I7d5ada5f09d2081440d0098782df6200a83ca2b1
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2021-08-12 18:25:04 +08:00
Nickey Yang
8e6b3fd314 drm/bridge: synopsys: dw-hdmi: set scrambler bypassed when hdmi1.4
Set resolution to 4K when connect an HDMI2.0 monitor
will enable scrambler feature.
At this time, change to connect an hdmi1.4 monitor will
cause black screen because we do not set scrambler feature bypassed.
So fix this.

Change-Id: Ic14b683719c8234c316dc1cacaa62c72a38e0294
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
2021-08-12 18:25:04 +08:00
xuhuicong
0910a82e12 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>
2021-08-12 18:25:04 +08:00
Algea Cao
e7b983189b drm/bridge: synopsys: Delete set device name
There is not need to set dev name without address.

Fixes: 76f27bdd76 ("drm: bridge: dw-hdmi: using extcon instead of switch")
Change-Id: I2c23e29ad8f7b4a0b05b2237ae319e14c69a1cb1
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2021-08-12 18:25:04 +08:00
Zheng Yang
4370e835be 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>
2021-08-12 18:25:04 +08:00
Zheng Yang
b0dc8a579f 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>
2021-08-12 18:25:04 +08:00
Huicong Xu
be496ad4e1 drm: bridge: dw-hdmi: add debugfs_remove_recursive when unbind
On RK3328, dw-hdmi driver is reloaded after bind and unbind
then it will use the first register debugfs address if no run
debugfs_remove_recursive, and cause system crash.

Change-Id: Iafa6b4059962b62c79157a9cf6c3e1d56df48f03
Signed-off-by: Huicong Xu <xhc@rock-chips.com>
2021-08-12 18:24:50 +08:00
Algea Cao
6e144e13c0 drm: bridge: dw-hdmi: fixup kernel crash when reboot with hdmi connected
when other devices bind failed,drm will unbind and re-bind all devices.
if don't cancel the delayed work but flush and destroy workqueue directly,
kernel point is likely to become NULL.

Change-Id: Ib48704186ee298cbd4daac1cdbbac5fb3906b6bb
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2021-08-12 18:24:30 +08:00
Zheng Yang
3627c826d7 drm: rockchip: dw-hdmi: fix 10bit not work when booting up with uboot logo
Default value of hdmi->colordepth is defined by input color mode,
so there is no need to set value again when color depth property
is created.

Change-Id: I2e242fabdaadc0c3b41e48f806cbded5f619c455
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2021-08-12 10:48:27 +08:00