mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-24 13:13:57 +08:00
drm-misc-next for 5.19:
UAPI Changes: Cross-subsystem Changes: Core Changes: - Introduction of display-helper module, and rework of the DP, DSC, HDCP, HDMI and SCDC headers - doc: Improvements for tiny drivers, link to external resources - formats: helper to convert from RGB888 and RGB565 to XRGB8888 - modes: make width-mm/height-mm check mandatory in of_get_drm_panel_display_mode - ttm: Convert from kvmalloc_array to kvcalloc Driver Changes: - bridge: - analogix_dp: Fix error handling in probe - dw_hdmi: Coccinelle fixes - it6505: Fix Kconfig dependency on DRM_DP_AUX_BUS - panel: - new panel: DataImage FG040346DSSWBG04 - amdgpu: ttm_eu cleanups - mxsfb: Rework CRTC mode setting - nouveau: Make some variables static - sun4i: Drop drm_display_info.is_hdmi caching, support for the Allwinner D1 - vc4: Drop drm_display_info.is_hdmi caching - vmwgfx: Fence improvements -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCYmpHrQAKCRDj7w1vZxhR xTC3AQDrZx4SIu9p76z9cRCDwvkOFs1H2Q/YJGnv6zU6QiSWBwD9ENTmaJslcSVw +tYfhRo2Z0GEvhiKVmQPZ561TNUJzQU= =4Bw4 -----END PGP SIGNATURE----- Merge tag 'drm-misc-next-2022-04-28' of git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-next for 5.19: UAPI Changes: Cross-subsystem Changes: Core Changes: - Introduction of display-helper module, and rework of the DP, DSC, HDCP, HDMI and SCDC headers - doc: Improvements for tiny drivers, link to external resources - formats: helper to convert from RGB888 and RGB565 to XRGB8888 - modes: make width-mm/height-mm check mandatory in of_get_drm_panel_display_mode - ttm: Convert from kvmalloc_array to kvcalloc Driver Changes: - bridge: - analogix_dp: Fix error handling in probe - dw_hdmi: Coccinelle fixes - it6505: Fix Kconfig dependency on DRM_DP_AUX_BUS - panel: - new panel: DataImage FG040346DSSWBG04 - amdgpu: ttm_eu cleanups - mxsfb: Rework CRTC mode setting - nouveau: Make some variables static - sun4i: Drop drm_display_info.is_hdmi caching, support for the Allwinner D1 - vc4: Drop drm_display_info.is_hdmi caching - vmwgfx: Fence improvements Signed-off-by: Dave Airlie <airlied@redhat.com> # gpg: Signature made Thu 28 Apr 2022 17:52:13 AEST # gpg: using EDDSA key 5C1337A45ECA9AEB89060E9EE3EF0D6F671851C5 # gpg: Can't check signature: No public key From: Maxime Ripard <maxime@cerno.tech> Link: https://patchwork.freedesktop.org/patch/msgid/20220428075237.yypztjha7hetphcd@houat
This commit is contained in:
commit
15e2b419a8
Documentation
devicetree/bindings/display
allwinner,sun4i-a10-display-engine.yamlallwinner,sun4i-a10-tcon.yamlallwinner,sun8i-a83t-de2-mixer.yamlallwinner,sun8i-r40-tcon-top.yaml
panel
gpu
drivers/gpu/drm
KconfigMakefile
amd
bridge
Kconfig
analogix
Kconfiganalogix-anx6345.canalogix-anx78xx.canalogix-i2c-dptx.canalogix_dp_core.canalogix_dp_core.hanx7625.c
cadence
ite-it6505.cparade-ps8640.csynopsys
tc358762.ctc358767.ctc358775.cti-sn65dsi86.cdisplay
KconfigMakefiledrm_display_helper_mod.cdrm_dp_aux_bus.cdrm_dp_aux_dev.cdrm_dp_cec.cdrm_dp_dual_mode_helper.cdrm_dp_helper.cdrm_dp_helper_internal.hdrm_dp_mst_topology.cdrm_dp_mst_topology_internal.hdrm_dsc_helper.cdrm_hdcp_helper.cdrm_hdmi_helper.cdrm_scdc_helper.c
dp
drm_connector.cdrm_edid.cdrm_format_helper.cdrm_mipi_dsi.cdrm_modes.cexynos
gma500
i915
Kconfig
display
msm
mxsfb
nouveau
@ -62,6 +62,7 @@ properties:
|
|||||||
- allwinner,sun8i-r40-display-engine
|
- allwinner,sun8i-r40-display-engine
|
||||||
- allwinner,sun8i-v3s-display-engine
|
- allwinner,sun8i-v3s-display-engine
|
||||||
- allwinner,sun9i-a80-display-engine
|
- allwinner,sun9i-a80-display-engine
|
||||||
|
- allwinner,sun20i-d1-display-engine
|
||||||
- allwinner,sun50i-a64-display-engine
|
- allwinner,sun50i-a64-display-engine
|
||||||
- allwinner,sun50i-h6-display-engine
|
- allwinner,sun50i-h6-display-engine
|
||||||
|
|
||||||
|
@ -33,6 +33,8 @@ properties:
|
|||||||
- const: allwinner,sun8i-v3s-tcon
|
- const: allwinner,sun8i-v3s-tcon
|
||||||
- const: allwinner,sun9i-a80-tcon-lcd
|
- const: allwinner,sun9i-a80-tcon-lcd
|
||||||
- const: allwinner,sun9i-a80-tcon-tv
|
- const: allwinner,sun9i-a80-tcon-tv
|
||||||
|
- const: allwinner,sun20i-d1-tcon-lcd
|
||||||
|
- const: allwinner,sun20i-d1-tcon-tv
|
||||||
|
|
||||||
- items:
|
- items:
|
||||||
- enum:
|
- enum:
|
||||||
|
@ -19,6 +19,8 @@ properties:
|
|||||||
- allwinner,sun8i-r40-de2-mixer-0
|
- allwinner,sun8i-r40-de2-mixer-0
|
||||||
- allwinner,sun8i-r40-de2-mixer-1
|
- allwinner,sun8i-r40-de2-mixer-1
|
||||||
- allwinner,sun8i-v3s-de2-mixer
|
- allwinner,sun8i-v3s-de2-mixer
|
||||||
|
- allwinner,sun20i-d1-de2-mixer-0
|
||||||
|
- allwinner,sun20i-d1-de2-mixer-1
|
||||||
- allwinner,sun50i-a64-de2-mixer-0
|
- allwinner,sun50i-a64-de2-mixer-0
|
||||||
- allwinner,sun50i-a64-de2-mixer-1
|
- allwinner,sun50i-a64-de2-mixer-1
|
||||||
- allwinner,sun50i-h6-de3-mixer-0
|
- allwinner,sun50i-h6-de3-mixer-0
|
||||||
|
@ -41,6 +41,7 @@ properties:
|
|||||||
compatible:
|
compatible:
|
||||||
enum:
|
enum:
|
||||||
- allwinner,sun8i-r40-tcon-top
|
- allwinner,sun8i-r40-tcon-top
|
||||||
|
- allwinner,sun20i-d1-tcon-top
|
||||||
- allwinner,sun50i-h6-tcon-top
|
- allwinner,sun50i-h6-tcon-top
|
||||||
|
|
||||||
reg:
|
reg:
|
||||||
@ -48,31 +49,15 @@ properties:
|
|||||||
|
|
||||||
clocks:
|
clocks:
|
||||||
minItems: 2
|
minItems: 2
|
||||||
items:
|
maxItems: 6
|
||||||
- description: The TCON TOP interface clock
|
|
||||||
- description: The TCON TOP TV0 clock
|
|
||||||
- description: The TCON TOP TVE0 clock
|
|
||||||
- description: The TCON TOP TV1 clock
|
|
||||||
- description: The TCON TOP TVE1 clock
|
|
||||||
- description: The TCON TOP MIPI DSI clock
|
|
||||||
|
|
||||||
clock-names:
|
clock-names:
|
||||||
minItems: 2
|
minItems: 2
|
||||||
items:
|
maxItems: 6
|
||||||
- const: bus
|
|
||||||
- const: tcon-tv0
|
|
||||||
- const: tve0
|
|
||||||
- const: tcon-tv1
|
|
||||||
- const: tve1
|
|
||||||
- const: dsi
|
|
||||||
|
|
||||||
clock-output-names:
|
clock-output-names:
|
||||||
minItems: 1
|
minItems: 1
|
||||||
maxItems: 3
|
maxItems: 3
|
||||||
description: >
|
|
||||||
The first item is the name of the clock created for the TV0
|
|
||||||
channel, the second item is the name of the TCON TV1 channel
|
|
||||||
clock and the third one is the name of the DSI channel clock.
|
|
||||||
|
|
||||||
resets:
|
resets:
|
||||||
maxItems: 1
|
maxItems: 1
|
||||||
@ -129,32 +114,92 @@ required:
|
|||||||
|
|
||||||
additionalProperties: false
|
additionalProperties: false
|
||||||
|
|
||||||
if:
|
allOf:
|
||||||
properties:
|
- if:
|
||||||
compatible:
|
properties:
|
||||||
contains:
|
compatible:
|
||||||
const: allwinner,sun50i-h6-tcon-top
|
contains:
|
||||||
|
const: allwinner,sun8i-r40-tcon-top
|
||||||
|
|
||||||
then:
|
then:
|
||||||
properties:
|
properties:
|
||||||
clocks:
|
clocks:
|
||||||
maxItems: 2
|
items:
|
||||||
|
- description: The TCON TOP interface clock
|
||||||
|
- description: The TCON TOP TV0 clock
|
||||||
|
- description: The TCON TOP TVE0 clock
|
||||||
|
- description: The TCON TOP TV1 clock
|
||||||
|
- description: The TCON TOP TVE1 clock
|
||||||
|
- description: The TCON TOP MIPI DSI clock
|
||||||
|
|
||||||
clock-output-names:
|
clock-names:
|
||||||
maxItems: 1
|
items:
|
||||||
|
- const: bus
|
||||||
|
- const: tcon-tv0
|
||||||
|
- const: tve0
|
||||||
|
- const: tcon-tv1
|
||||||
|
- const: tve1
|
||||||
|
- const: dsi
|
||||||
|
|
||||||
else:
|
clock-output-names:
|
||||||
properties:
|
items:
|
||||||
clocks:
|
- description: TCON TV0 output clock name
|
||||||
minItems: 6
|
- description: TCON TV1 output clock name
|
||||||
|
- description: DSI output clock name
|
||||||
|
|
||||||
clock-output-names:
|
ports:
|
||||||
minItems: 3
|
required:
|
||||||
|
- port@2
|
||||||
|
- port@3
|
||||||
|
|
||||||
ports:
|
- if:
|
||||||
required:
|
properties:
|
||||||
- port@2
|
compatible:
|
||||||
- port@3
|
contains:
|
||||||
|
const: allwinner,sun20i-d1-tcon-top
|
||||||
|
|
||||||
|
then:
|
||||||
|
properties:
|
||||||
|
clocks:
|
||||||
|
items:
|
||||||
|
- description: The TCON TOP interface clock
|
||||||
|
- description: The TCON TOP TV0 clock
|
||||||
|
- description: The TCON TOP TVE0 clock
|
||||||
|
- description: The TCON TOP MIPI DSI clock
|
||||||
|
|
||||||
|
clock-names:
|
||||||
|
items:
|
||||||
|
- const: bus
|
||||||
|
- const: tcon-tv0
|
||||||
|
- const: tve0
|
||||||
|
- const: dsi
|
||||||
|
|
||||||
|
clock-output-names:
|
||||||
|
items:
|
||||||
|
- description: TCON TV0 output clock name
|
||||||
|
- description: DSI output clock name
|
||||||
|
|
||||||
|
- if:
|
||||||
|
properties:
|
||||||
|
compatible:
|
||||||
|
contains:
|
||||||
|
const: allwinner,sun50i-h6-tcon-top
|
||||||
|
|
||||||
|
then:
|
||||||
|
properties:
|
||||||
|
clocks:
|
||||||
|
items:
|
||||||
|
- description: The TCON TOP interface clock
|
||||||
|
- description: The TCON TOP TV0 clock
|
||||||
|
|
||||||
|
clock-names:
|
||||||
|
items:
|
||||||
|
- const: bus
|
||||||
|
- const: tcon-tv0
|
||||||
|
|
||||||
|
clock-output-names:
|
||||||
|
items:
|
||||||
|
- description: TCON TV0 output clock name
|
||||||
|
|
||||||
examples:
|
examples:
|
||||||
- |
|
- |
|
||||||
|
@ -105,6 +105,8 @@ properties:
|
|||||||
- chunghwa,claa101wb01
|
- chunghwa,claa101wb01
|
||||||
# Chunghwa Picture Tubes Ltd. 10.1" WXGA TFT LCD panel
|
# Chunghwa Picture Tubes Ltd. 10.1" WXGA TFT LCD panel
|
||||||
- chunghwa,claa101wb03
|
- chunghwa,claa101wb03
|
||||||
|
# DataImage, Inc. 4.3" WQVGA (480x272) TFT LCD panel with 24-bit parallel interface.
|
||||||
|
- dataimage,fg040346dsswbg04
|
||||||
# DataImage, Inc. 7" WVGA (800x480) TFT LCD panel with 24-bit parallel interface.
|
# DataImage, Inc. 7" WVGA (800x480) TFT LCD panel with 24-bit parallel interface.
|
||||||
- dataimage,scf0700c48ggu18
|
- dataimage,scf0700c48ggu18
|
||||||
# DLC Display Co. DLC1010GIG 10.1" WXGA TFT LCD Panel
|
# DLC Display Co. DLC1010GIG 10.1" WXGA TFT LCD Panel
|
||||||
|
@ -226,40 +226,43 @@ Panel Self Refresh Helper Reference
|
|||||||
HDCP Helper Functions Reference
|
HDCP Helper Functions Reference
|
||||||
===============================
|
===============================
|
||||||
|
|
||||||
.. kernel-doc:: drivers/gpu/drm/drm_hdcp.c
|
.. kernel-doc:: drivers/gpu/drm/display/drm_hdcp_helper.c
|
||||||
:export:
|
:export:
|
||||||
|
|
||||||
Display Port Helper Functions Reference
|
Display Port Helper Functions Reference
|
||||||
=======================================
|
=======================================
|
||||||
|
|
||||||
.. kernel-doc:: drivers/gpu/drm/dp/drm_dp.c
|
.. kernel-doc:: drivers/gpu/drm/display/drm_dp_helper.c
|
||||||
:doc: dp helpers
|
:doc: dp helpers
|
||||||
|
|
||||||
.. kernel-doc:: include/drm/dp/drm_dp_helper.h
|
.. kernel-doc:: include/drm/display/drm_dp.h
|
||||||
:internal:
|
:internal:
|
||||||
|
|
||||||
.. kernel-doc:: drivers/gpu/drm/dp/drm_dp.c
|
.. kernel-doc:: include/drm/display/drm_dp_helper.h
|
||||||
|
:internal:
|
||||||
|
|
||||||
|
.. kernel-doc:: drivers/gpu/drm/display/drm_dp_helper.c
|
||||||
:export:
|
:export:
|
||||||
|
|
||||||
Display Port CEC Helper Functions Reference
|
Display Port CEC Helper Functions Reference
|
||||||
===========================================
|
===========================================
|
||||||
|
|
||||||
.. kernel-doc:: drivers/gpu/drm/dp/drm_dp_cec.c
|
.. kernel-doc:: drivers/gpu/drm/display/drm_dp_cec.c
|
||||||
:doc: dp cec helpers
|
:doc: dp cec helpers
|
||||||
|
|
||||||
.. kernel-doc:: drivers/gpu/drm/dp/drm_dp_cec.c
|
.. kernel-doc:: drivers/gpu/drm/display/drm_dp_cec.c
|
||||||
:export:
|
:export:
|
||||||
|
|
||||||
Display Port Dual Mode Adaptor Helper Functions Reference
|
Display Port Dual Mode Adaptor Helper Functions Reference
|
||||||
=========================================================
|
=========================================================
|
||||||
|
|
||||||
.. kernel-doc:: drivers/gpu/drm/dp/drm_dp_dual_mode_helper.c
|
.. kernel-doc:: drivers/gpu/drm/display/drm_dp_dual_mode_helper.c
|
||||||
:doc: dp dual mode helpers
|
:doc: dp dual mode helpers
|
||||||
|
|
||||||
.. kernel-doc:: include/drm/dp/drm_dp_dual_mode_helper.h
|
.. kernel-doc:: include/drm/display/drm_dp_dual_mode_helper.h
|
||||||
:internal:
|
:internal:
|
||||||
|
|
||||||
.. kernel-doc:: drivers/gpu/drm/dp/drm_dp_dual_mode_helper.c
|
.. kernel-doc:: drivers/gpu/drm/display/drm_dp_dual_mode_helper.c
|
||||||
:export:
|
:export:
|
||||||
|
|
||||||
Display Port MST Helpers
|
Display Port MST Helpers
|
||||||
@ -268,19 +271,19 @@ Display Port MST Helpers
|
|||||||
Overview
|
Overview
|
||||||
--------
|
--------
|
||||||
|
|
||||||
.. kernel-doc:: drivers/gpu/drm/dp/drm_dp_mst_topology.c
|
.. kernel-doc:: drivers/gpu/drm/display/drm_dp_mst_topology.c
|
||||||
:doc: dp mst helper
|
:doc: dp mst helper
|
||||||
|
|
||||||
.. kernel-doc:: drivers/gpu/drm/dp/drm_dp_mst_topology.c
|
.. kernel-doc:: drivers/gpu/drm/display/drm_dp_mst_topology.c
|
||||||
:doc: Branch device and port refcounting
|
:doc: Branch device and port refcounting
|
||||||
|
|
||||||
Functions Reference
|
Functions Reference
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
.. kernel-doc:: include/drm/dp/drm_dp_mst_helper.h
|
.. kernel-doc:: include/drm/display/drm_dp_mst_helper.h
|
||||||
:internal:
|
:internal:
|
||||||
|
|
||||||
.. kernel-doc:: drivers/gpu/drm/dp/drm_dp_mst_topology.c
|
.. kernel-doc:: drivers/gpu/drm/display/drm_dp_mst_topology.c
|
||||||
:export:
|
:export:
|
||||||
|
|
||||||
Topology Lifetime Internals
|
Topology Lifetime Internals
|
||||||
@ -289,7 +292,7 @@ Topology Lifetime Internals
|
|||||||
These functions aren't exported to drivers, but are documented here to help make
|
These functions aren't exported to drivers, but are documented here to help make
|
||||||
the MST topology helpers easier to understand
|
the MST topology helpers easier to understand
|
||||||
|
|
||||||
.. kernel-doc:: drivers/gpu/drm/dp/drm_dp_mst_topology.c
|
.. kernel-doc:: drivers/gpu/drm/display/drm_dp_mst_topology.c
|
||||||
:functions: drm_dp_mst_topology_try_get_mstb drm_dp_mst_topology_get_mstb
|
:functions: drm_dp_mst_topology_try_get_mstb drm_dp_mst_topology_get_mstb
|
||||||
drm_dp_mst_topology_put_mstb
|
drm_dp_mst_topology_put_mstb
|
||||||
drm_dp_mst_topology_try_get_port drm_dp_mst_topology_get_port
|
drm_dp_mst_topology_try_get_port drm_dp_mst_topology_get_port
|
||||||
@ -323,13 +326,13 @@ MIPI DSI Helper Functions Reference
|
|||||||
Display Stream Compression Helper Functions Reference
|
Display Stream Compression Helper Functions Reference
|
||||||
=====================================================
|
=====================================================
|
||||||
|
|
||||||
.. kernel-doc:: drivers/gpu/drm/drm_dsc.c
|
.. kernel-doc:: drivers/gpu/drm/display/drm_dsc_helper.c
|
||||||
:doc: dsc helpers
|
:doc: dsc helpers
|
||||||
|
|
||||||
.. kernel-doc:: include/drm/drm_dsc.h
|
.. kernel-doc:: include/drm/display/drm_dsc.h
|
||||||
:internal:
|
:internal:
|
||||||
|
|
||||||
.. kernel-doc:: drivers/gpu/drm/drm_dsc.c
|
.. kernel-doc:: drivers/gpu/drm/display/drm_dsc_helper.c
|
||||||
:export:
|
:export:
|
||||||
|
|
||||||
Output Probing Helper Functions Reference
|
Output Probing Helper Functions Reference
|
||||||
@ -353,13 +356,13 @@ EDID Helper Functions Reference
|
|||||||
SCDC Helper Functions Reference
|
SCDC Helper Functions Reference
|
||||||
===============================
|
===============================
|
||||||
|
|
||||||
.. kernel-doc:: drivers/gpu/drm/drm_scdc_helper.c
|
.. kernel-doc:: drivers/gpu/drm/display/drm_scdc_helper.c
|
||||||
:doc: scdc helpers
|
:doc: scdc helpers
|
||||||
|
|
||||||
.. kernel-doc:: include/drm/drm_scdc_helper.h
|
.. kernel-doc:: include/drm/display/drm_scdc_helper.h
|
||||||
:internal:
|
:internal:
|
||||||
|
|
||||||
.. kernel-doc:: drivers/gpu/drm/drm_scdc_helper.c
|
.. kernel-doc:: drivers/gpu/drm/display/drm_scdc_helper.c
|
||||||
:export:
|
:export:
|
||||||
|
|
||||||
HDMI Infoframes Helper Reference
|
HDMI Infoframes Helper Reference
|
||||||
|
@ -112,3 +112,63 @@ Please conduct yourself in a respectful and civilised manner when
|
|||||||
interacting with community members on mailing lists, IRC, or bug
|
interacting with community members on mailing lists, IRC, or bug
|
||||||
trackers. The community represents the project as a whole, and abusive
|
trackers. The community represents the project as a whole, and abusive
|
||||||
or bullying behaviour is not tolerated by the project.
|
or bullying behaviour is not tolerated by the project.
|
||||||
|
|
||||||
|
Simple DRM drivers to use as examples
|
||||||
|
=====================================
|
||||||
|
|
||||||
|
The DRM subsystem contains a lot of helper functions to ease writing drivers for
|
||||||
|
simple graphic devices. For example, the `drivers/gpu/drm/tiny/` directory has a
|
||||||
|
set of drivers that are simple enough to be implemented in a single source file.
|
||||||
|
|
||||||
|
These drivers make use of the `struct drm_simple_display_pipe_funcs`, that hides
|
||||||
|
any complexity of the DRM subsystem and just requires drivers to implement a few
|
||||||
|
functions needed to operate the device. This could be used for devices that just
|
||||||
|
need a display pipeline with one full-screen scanout buffer feeding one output.
|
||||||
|
|
||||||
|
The tiny DRM drivers are good examples to understand how DRM drivers should look
|
||||||
|
like. Since are just a few hundreds lines of code, they are quite easy to read.
|
||||||
|
|
||||||
|
External References
|
||||||
|
===================
|
||||||
|
|
||||||
|
Delving into a Linux kernel subsystem for the first time can be an overwhelming
|
||||||
|
experience, one needs to get familiar with all the concepts and learn about the
|
||||||
|
subsystem's internals, among other details.
|
||||||
|
|
||||||
|
To shallow the learning curve, this section contains a list of presentations
|
||||||
|
and documents that can be used to learn about DRM/KMS and graphics in general.
|
||||||
|
|
||||||
|
There are different reasons why someone might want to get into DRM: porting an
|
||||||
|
existing fbdev driver, write a DRM driver for a new hardware, fixing bugs that
|
||||||
|
could face when working on the graphics user-space stack, etc. For this reason,
|
||||||
|
the learning material covers many aspects of the Linux graphics stack. From an
|
||||||
|
overview of the kernel and user-space stacks to very specific topics.
|
||||||
|
|
||||||
|
The list is sorted in reverse chronological order, to keep the most up-to-date
|
||||||
|
material at the top. But all of them contain useful information, and it can be
|
||||||
|
valuable to go through older material to understand the rationale and context
|
||||||
|
in which the changes to the DRM subsystem were made.
|
||||||
|
|
||||||
|
Conference talks
|
||||||
|
----------------
|
||||||
|
|
||||||
|
* `An Overview of the Linux and Userspace Graphics Stack <https://www.youtube.com/watch?v=wjAJmqwg47k>`_ - Paul Kocialkowski (2020)
|
||||||
|
* `Getting pixels on screen on Linux: introduction to Kernel Mode Setting <https://www.youtube.com/watch?v=haes4_Xnc5Q>`_ - Simon Ser (2020)
|
||||||
|
* `Everything Great about Upstream Graphics <https://www.youtube.com/watch?v=kVzHOgt6WGE>`_ - Daniel Vetter (2019)
|
||||||
|
* `An introduction to the Linux DRM subsystem <https://www.youtube.com/watch?v=LbDOCJcDRoo>`_ - Maxime Ripard (2017)
|
||||||
|
* `Embrace the Atomic (Display) Age <https://www.youtube.com/watch?v=LjiB_JeDn2M>`_ - Daniel Vetter (2016)
|
||||||
|
* `Anatomy of an Atomic KMS Driver <https://www.youtube.com/watch?v=lihqR9sENpc>`_ - Laurent Pinchart (2015)
|
||||||
|
* `Atomic Modesetting for Drivers <https://www.youtube.com/watch?v=kl9suFgbTc8>`_ - Daniel Vetter (2015)
|
||||||
|
* `Anatomy of an Embedded KMS Driver <https://www.youtube.com/watch?v=Ja8fM7rTae4>`_ - Laurent Pinchart (2013)
|
||||||
|
|
||||||
|
Slides and articles
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
* `Understanding the Linux Graphics Stack <https://bootlin.com/doc/training/graphics/graphics-slides.pdf>`_ - Bootlin (2022)
|
||||||
|
* `DRM KMS overview <https://wiki.st.com/stm32mpu/wiki/DRM_KMS_overview>`_ - STMicroelectronics (2021)
|
||||||
|
* `Linux graphic stack <https://studiopixl.com/2017-05-13/linux-graphic-stack-an-overview>`_ - Nathan Gauër (2017)
|
||||||
|
* `Atomic mode setting design overview, part 1 <https://lwn.net/Articles/653071/>`_ - Daniel Vetter (2015)
|
||||||
|
* `Atomic mode setting design overview, part 2 <https://lwn.net/Articles/653466/>`_ - Daniel Vetter (2015)
|
||||||
|
* `The DRM/KMS subsystem from a newbie’s point of view <https://bootlin.com/pub/conferences/2014/elce/brezillon-drm-kms/brezillon-drm-kms.pdf>`_ - Boris Brezillon (2014)
|
||||||
|
* `A brief introduction to the Linux graphics stack <https://blogs.igalia.com/itoral/2014/07/29/a-brief-introduction-to-the-linux-graphics-stack/>`_ - Iago Toral (2014)
|
||||||
|
* `The Linux Graphics Stack <https://blog.mecheye.net/2012/06/the-linux-graphics-stack/>`_ - Jasper St. Pierre (2012)
|
||||||
|
@ -36,19 +36,6 @@ config DRM_MIPI_DSI
|
|||||||
bool
|
bool
|
||||||
depends on DRM
|
depends on DRM
|
||||||
|
|
||||||
config DRM_DP_AUX_BUS
|
|
||||||
tristate
|
|
||||||
depends on DRM
|
|
||||||
depends on OF
|
|
||||||
|
|
||||||
config DRM_DP_AUX_CHARDEV
|
|
||||||
bool "DRM DP AUX Interface"
|
|
||||||
depends on DRM
|
|
||||||
help
|
|
||||||
Choose this option to enable a /dev/drm_dp_auxN node that allows to
|
|
||||||
read and write values to arbitrary DPCD registers on the DP aux
|
|
||||||
channel.
|
|
||||||
|
|
||||||
config DRM_DEBUG_MM
|
config DRM_DEBUG_MM
|
||||||
bool "Insert extra checks and debug info into the DRM range managers"
|
bool "Insert extra checks and debug info into the DRM range managers"
|
||||||
default n
|
default n
|
||||||
@ -68,7 +55,8 @@ config DRM_DEBUG_SELFTEST
|
|||||||
depends on DRM
|
depends on DRM
|
||||||
depends on DEBUG_KERNEL
|
depends on DEBUG_KERNEL
|
||||||
select PRIME_NUMBERS
|
select PRIME_NUMBERS
|
||||||
select DRM_DP_HELPER
|
select DRM_DISPLAY_DP_HELPER
|
||||||
|
select DRM_DISPLAY_HELPER
|
||||||
select DRM_LIB_RANDOM
|
select DRM_LIB_RANDOM
|
||||||
select DRM_KMS_HELPER
|
select DRM_KMS_HELPER
|
||||||
select DRM_BUDDY
|
select DRM_BUDDY
|
||||||
@ -82,12 +70,6 @@ config DRM_DEBUG_SELFTEST
|
|||||||
|
|
||||||
If in doubt, say "N".
|
If in doubt, say "N".
|
||||||
|
|
||||||
config DRM_DP_HELPER
|
|
||||||
tristate
|
|
||||||
depends on DRM
|
|
||||||
help
|
|
||||||
DRM helpers for DisplayPort.
|
|
||||||
|
|
||||||
config DRM_KMS_HELPER
|
config DRM_KMS_HELPER
|
||||||
tristate
|
tristate
|
||||||
depends on DRM
|
depends on DRM
|
||||||
@ -187,16 +169,7 @@ config DRM_LOAD_EDID_FIRMWARE
|
|||||||
default case is N. Details and instructions how to build your own
|
default case is N. Details and instructions how to build your own
|
||||||
EDID data are given in Documentation/admin-guide/edid.rst.
|
EDID data are given in Documentation/admin-guide/edid.rst.
|
||||||
|
|
||||||
config DRM_DP_CEC
|
source "drivers/gpu/drm/display/Kconfig"
|
||||||
bool "Enable DisplayPort CEC-Tunneling-over-AUX HDMI support"
|
|
||||||
depends on DRM
|
|
||||||
select CEC_CORE
|
|
||||||
help
|
|
||||||
Choose this option if you want to enable HDMI CEC support for
|
|
||||||
DisplayPort/USB-C to HDMI adapters.
|
|
||||||
|
|
||||||
Note: not all adapters support this feature, and even for those
|
|
||||||
that do support this they often do not hook up the CEC pin.
|
|
||||||
|
|
||||||
config DRM_TTM
|
config DRM_TTM
|
||||||
tristate
|
tristate
|
||||||
@ -250,7 +223,8 @@ config DRM_RADEON
|
|||||||
depends on DRM && PCI && MMU
|
depends on DRM && PCI && MMU
|
||||||
depends on AGP || !AGP
|
depends on AGP || !AGP
|
||||||
select FW_LOADER
|
select FW_LOADER
|
||||||
select DRM_DP_HELPER
|
select DRM_DISPLAY_DP_HELPER
|
||||||
|
select DRM_DISPLAY_HELPER
|
||||||
select DRM_KMS_HELPER
|
select DRM_KMS_HELPER
|
||||||
select DRM_TTM
|
select DRM_TTM
|
||||||
select DRM_TTM_HELPER
|
select DRM_TTM_HELPER
|
||||||
@ -271,7 +245,9 @@ config DRM_AMDGPU
|
|||||||
tristate "AMD GPU"
|
tristate "AMD GPU"
|
||||||
depends on DRM && PCI && MMU
|
depends on DRM && PCI && MMU
|
||||||
select FW_LOADER
|
select FW_LOADER
|
||||||
select DRM_DP_HELPER
|
select DRM_DISPLAY_DP_HELPER
|
||||||
|
select DRM_DISPLAY_HDMI_HELPER
|
||||||
|
select DRM_DISPLAY_HELPER
|
||||||
select DRM_KMS_HELPER
|
select DRM_KMS_HELPER
|
||||||
select DRM_SCHED
|
select DRM_SCHED
|
||||||
select DRM_TTM
|
select DRM_TTM
|
||||||
|
@ -18,7 +18,6 @@ drm-y := drm_aperture.o drm_auth.o drm_cache.o \
|
|||||||
drm_syncobj.o drm_lease.o drm_writeback.o drm_client.o \
|
drm_syncobj.o drm_lease.o drm_writeback.o drm_client.o \
|
||||||
drm_client_modeset.o drm_atomic_uapi.o \
|
drm_client_modeset.o drm_atomic_uapi.o \
|
||||||
drm_managed.o drm_vblank_work.o
|
drm_managed.o drm_vblank_work.o
|
||||||
|
|
||||||
drm-$(CONFIG_DRM_LEGACY) += drm_agpsupport.o drm_bufs.o drm_context.o drm_dma.o \
|
drm-$(CONFIG_DRM_LEGACY) += drm_agpsupport.o drm_bufs.o drm_context.o drm_dma.o \
|
||||||
drm_hashtab.o drm_irq.o drm_legacy_misc.o drm_lock.o \
|
drm_hashtab.o drm_irq.o drm_legacy_misc.o drm_lock.o \
|
||||||
drm_memory.o drm_scatter.o drm_vm.o
|
drm_memory.o drm_scatter.o drm_vm.o
|
||||||
@ -30,8 +29,16 @@ drm-$(CONFIG_PCI) += drm_pci.o
|
|||||||
drm-$(CONFIG_DEBUG_FS) += drm_debugfs.o drm_debugfs_crc.o
|
drm-$(CONFIG_DEBUG_FS) += drm_debugfs.o drm_debugfs_crc.o
|
||||||
drm-$(CONFIG_DRM_LOAD_EDID_FIRMWARE) += drm_edid_load.o
|
drm-$(CONFIG_DRM_LOAD_EDID_FIRMWARE) += drm_edid_load.o
|
||||||
drm-$(CONFIG_DRM_PRIVACY_SCREEN) += drm_privacy_screen.o drm_privacy_screen_x86.o
|
drm-$(CONFIG_DRM_PRIVACY_SCREEN) += drm_privacy_screen.o drm_privacy_screen_x86.o
|
||||||
|
obj-$(CONFIG_DRM) += drm.o
|
||||||
|
|
||||||
obj-$(CONFIG_DRM_NOMODESET) += drm_nomodeset.o
|
obj-$(CONFIG_DRM_NOMODESET) += drm_nomodeset.o
|
||||||
|
obj-$(CONFIG_DRM_PANEL_ORIENTATION_QUIRKS) += drm_panel_orientation_quirks.o
|
||||||
|
|
||||||
|
#
|
||||||
|
# Memory-management helpers
|
||||||
|
#
|
||||||
|
|
||||||
|
obj-$(CONFIG_DRM_BUDDY) += drm_buddy.o
|
||||||
|
|
||||||
drm_cma_helper-y := drm_gem_cma_helper.o
|
drm_cma_helper-y := drm_gem_cma_helper.o
|
||||||
drm_cma_helper-$(CONFIG_DRM_KMS_HELPER) += drm_fb_cma_helper.o
|
drm_cma_helper-$(CONFIG_DRM_KMS_HELPER) += drm_fb_cma_helper.o
|
||||||
@ -40,36 +47,40 @@ obj-$(CONFIG_DRM_GEM_CMA_HELPER) += drm_cma_helper.o
|
|||||||
drm_shmem_helper-y := drm_gem_shmem_helper.o
|
drm_shmem_helper-y := drm_gem_shmem_helper.o
|
||||||
obj-$(CONFIG_DRM_GEM_SHMEM_HELPER) += drm_shmem_helper.o
|
obj-$(CONFIG_DRM_GEM_SHMEM_HELPER) += drm_shmem_helper.o
|
||||||
|
|
||||||
obj-$(CONFIG_DRM_BUDDY) += drm_buddy.o
|
|
||||||
|
|
||||||
drm_vram_helper-y := drm_gem_vram_helper.o
|
drm_vram_helper-y := drm_gem_vram_helper.o
|
||||||
obj-$(CONFIG_DRM_VRAM_HELPER) += drm_vram_helper.o
|
obj-$(CONFIG_DRM_VRAM_HELPER) += drm_vram_helper.o
|
||||||
|
|
||||||
drm_ttm_helper-y := drm_gem_ttm_helper.o
|
drm_ttm_helper-y := drm_gem_ttm_helper.o
|
||||||
obj-$(CONFIG_DRM_TTM_HELPER) += drm_ttm_helper.o
|
obj-$(CONFIG_DRM_TTM_HELPER) += drm_ttm_helper.o
|
||||||
|
|
||||||
|
#
|
||||||
|
# Modesetting helpers
|
||||||
|
#
|
||||||
|
|
||||||
drm_kms_helper-y := drm_bridge_connector.o drm_crtc_helper.o \
|
drm_kms_helper-y := drm_bridge_connector.o drm_crtc_helper.o \
|
||||||
drm_dsc.o drm_encoder_slave.o drm_flip_work.o drm_hdcp.o \
|
drm_encoder_slave.o drm_flip_work.o \
|
||||||
drm_probe_helper.o \
|
drm_probe_helper.o \
|
||||||
drm_plane_helper.o drm_atomic_helper.o \
|
drm_plane_helper.o drm_atomic_helper.o \
|
||||||
drm_kms_helper_common.o \
|
drm_kms_helper_common.o \
|
||||||
drm_simple_kms_helper.o drm_modeset_helper.o \
|
drm_simple_kms_helper.o drm_modeset_helper.o \
|
||||||
drm_scdc_helper.o drm_gem_atomic_helper.o \
|
drm_gem_atomic_helper.o \
|
||||||
drm_gem_framebuffer_helper.o \
|
drm_gem_framebuffer_helper.o \
|
||||||
drm_atomic_state_helper.o drm_damage_helper.o \
|
drm_atomic_state_helper.o drm_damage_helper.o \
|
||||||
drm_format_helper.o drm_self_refresh_helper.o drm_rect.o
|
drm_format_helper.o drm_self_refresh_helper.o drm_rect.o
|
||||||
drm_kms_helper-$(CONFIG_DRM_PANEL_BRIDGE) += bridge/panel.o
|
drm_kms_helper-$(CONFIG_DRM_PANEL_BRIDGE) += bridge/panel.o
|
||||||
drm_kms_helper-$(CONFIG_DRM_FBDEV_EMULATION) += drm_fb_helper.o
|
drm_kms_helper-$(CONFIG_DRM_FBDEV_EMULATION) += drm_fb_helper.o
|
||||||
|
|
||||||
obj-$(CONFIG_DRM_KMS_HELPER) += drm_kms_helper.o
|
obj-$(CONFIG_DRM_KMS_HELPER) += drm_kms_helper.o
|
||||||
|
|
||||||
|
#
|
||||||
|
# Drivers and the rest
|
||||||
|
#
|
||||||
|
|
||||||
obj-$(CONFIG_DRM_DEBUG_SELFTEST) += selftests/
|
obj-$(CONFIG_DRM_DEBUG_SELFTEST) += selftests/
|
||||||
|
|
||||||
obj-$(CONFIG_DRM) += drm.o
|
|
||||||
obj-$(CONFIG_DRM_MIPI_DBI) += drm_mipi_dbi.o
|
obj-$(CONFIG_DRM_MIPI_DBI) += drm_mipi_dbi.o
|
||||||
obj-$(CONFIG_DRM_MIPI_DSI) += drm_mipi_dsi.o
|
obj-$(CONFIG_DRM_MIPI_DSI) += drm_mipi_dsi.o
|
||||||
obj-$(CONFIG_DRM_PANEL_ORIENTATION_QUIRKS) += drm_panel_orientation_quirks.o
|
|
||||||
obj-y += arm/
|
obj-y += arm/
|
||||||
obj-y += dp/
|
obj-y += display/
|
||||||
obj-$(CONFIG_DRM_TTM) += ttm/
|
obj-$(CONFIG_DRM_TTM) += ttm/
|
||||||
obj-$(CONFIG_DRM_SCHED) += scheduler/
|
obj-$(CONFIG_DRM_SCHED) += scheduler/
|
||||||
obj-$(CONFIG_DRM_TDFX) += tdfx/
|
obj-$(CONFIG_DRM_TDFX) += tdfx/
|
||||||
|
@ -24,9 +24,9 @@
|
|||||||
* Alex Deucher
|
* Alex Deucher
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <drm/display/drm_dp_helper.h>
|
||||||
#include <drm/drm_edid.h>
|
#include <drm/drm_edid.h>
|
||||||
#include <drm/drm_fb_helper.h>
|
#include <drm/drm_fb_helper.h>
|
||||||
#include <drm/dp/drm_dp_helper.h>
|
|
||||||
#include <drm/drm_probe_helper.h>
|
#include <drm/drm_probe_helper.h>
|
||||||
#include <drm/amdgpu_drm.h>
|
#include <drm/amdgpu_drm.h>
|
||||||
#include "amdgpu.h"
|
#include "amdgpu.h"
|
||||||
|
@ -30,10 +30,10 @@
|
|||||||
#ifndef AMDGPU_MODE_H
|
#ifndef AMDGPU_MODE_H
|
||||||
#define AMDGPU_MODE_H
|
#define AMDGPU_MODE_H
|
||||||
|
|
||||||
|
#include <drm/display/drm_dp_helper.h>
|
||||||
#include <drm/drm_crtc.h>
|
#include <drm/drm_crtc.h>
|
||||||
#include <drm/drm_edid.h>
|
#include <drm/drm_edid.h>
|
||||||
#include <drm/drm_encoder.h>
|
#include <drm/drm_encoder.h>
|
||||||
#include <drm/dp/drm_dp_helper.h>
|
|
||||||
#include <drm/drm_fixed.h>
|
#include <drm/drm_fixed.h>
|
||||||
#include <drm/drm_crtc_helper.h>
|
#include <drm/drm_crtc_helper.h>
|
||||||
#include <drm/drm_fb_helper.h>
|
#include <drm/drm_fb_helper.h>
|
||||||
@ -44,7 +44,7 @@
|
|||||||
#include <linux/hrtimer.h>
|
#include <linux/hrtimer.h>
|
||||||
#include "amdgpu_irq.h"
|
#include "amdgpu_irq.h"
|
||||||
|
|
||||||
#include <drm/dp/drm_dp_mst_helper.h>
|
#include <drm/display/drm_dp_mst_helper.h>
|
||||||
#include "modules/inc/mod_freesync.h"
|
#include "modules/inc/mod_freesync.h"
|
||||||
#include "amdgpu_dm_irq_params.h"
|
#include "amdgpu_dm_irq_params.h"
|
||||||
|
|
||||||
|
@ -302,9 +302,6 @@ static int amdgpu_vkms_prepare_fb(struct drm_plane *plane,
|
|||||||
struct drm_gem_object *obj;
|
struct drm_gem_object *obj;
|
||||||
struct amdgpu_device *adev;
|
struct amdgpu_device *adev;
|
||||||
struct amdgpu_bo *rbo;
|
struct amdgpu_bo *rbo;
|
||||||
struct list_head list;
|
|
||||||
struct ttm_validate_buffer tv;
|
|
||||||
struct ww_acquire_ctx ticket;
|
|
||||||
uint32_t domain;
|
uint32_t domain;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
@ -316,18 +313,19 @@ static int amdgpu_vkms_prepare_fb(struct drm_plane *plane,
|
|||||||
obj = new_state->fb->obj[0];
|
obj = new_state->fb->obj[0];
|
||||||
rbo = gem_to_amdgpu_bo(obj);
|
rbo = gem_to_amdgpu_bo(obj);
|
||||||
adev = amdgpu_ttm_adev(rbo->tbo.bdev);
|
adev = amdgpu_ttm_adev(rbo->tbo.bdev);
|
||||||
INIT_LIST_HEAD(&list);
|
|
||||||
|
|
||||||
tv.bo = &rbo->tbo;
|
r = amdgpu_bo_reserve(rbo, true);
|
||||||
tv.num_shared = 1;
|
|
||||||
list_add(&tv.head, &list);
|
|
||||||
|
|
||||||
r = ttm_eu_reserve_buffers(&ticket, &list, false, NULL);
|
|
||||||
if (r) {
|
if (r) {
|
||||||
dev_err(adev->dev, "fail to reserve bo (%d)\n", r);
|
dev_err(adev->dev, "fail to reserve bo (%d)\n", r);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
r = dma_resv_reserve_fences(rbo->tbo.base.resv, 1);
|
||||||
|
if (r) {
|
||||||
|
dev_err(adev->dev, "allocating fence slot failed (%d)\n", r);
|
||||||
|
goto error_unlock;
|
||||||
|
}
|
||||||
|
|
||||||
if (plane->type != DRM_PLANE_TYPE_CURSOR)
|
if (plane->type != DRM_PLANE_TYPE_CURSOR)
|
||||||
domain = amdgpu_display_supported_domains(adev, rbo->flags);
|
domain = amdgpu_display_supported_domains(adev, rbo->flags);
|
||||||
else
|
else
|
||||||
@ -337,25 +335,29 @@ static int amdgpu_vkms_prepare_fb(struct drm_plane *plane,
|
|||||||
if (unlikely(r != 0)) {
|
if (unlikely(r != 0)) {
|
||||||
if (r != -ERESTARTSYS)
|
if (r != -ERESTARTSYS)
|
||||||
DRM_ERROR("Failed to pin framebuffer with error %d\n", r);
|
DRM_ERROR("Failed to pin framebuffer with error %d\n", r);
|
||||||
ttm_eu_backoff_reservation(&ticket, &list);
|
goto error_unlock;
|
||||||
return r;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
r = amdgpu_ttm_alloc_gart(&rbo->tbo);
|
r = amdgpu_ttm_alloc_gart(&rbo->tbo);
|
||||||
if (unlikely(r != 0)) {
|
if (unlikely(r != 0)) {
|
||||||
amdgpu_bo_unpin(rbo);
|
|
||||||
ttm_eu_backoff_reservation(&ticket, &list);
|
|
||||||
DRM_ERROR("%p bind failed\n", rbo);
|
DRM_ERROR("%p bind failed\n", rbo);
|
||||||
return r;
|
goto error_unpin;
|
||||||
}
|
}
|
||||||
|
|
||||||
ttm_eu_backoff_reservation(&ticket, &list);
|
amdgpu_bo_unreserve(rbo);
|
||||||
|
|
||||||
afb->address = amdgpu_bo_gpu_offset(rbo);
|
afb->address = amdgpu_bo_gpu_offset(rbo);
|
||||||
|
|
||||||
amdgpu_bo_ref(rbo);
|
amdgpu_bo_ref(rbo);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
error_unpin:
|
||||||
|
amdgpu_bo_unpin(rbo);
|
||||||
|
|
||||||
|
error_unlock:
|
||||||
|
amdgpu_bo_unreserve(rbo);
|
||||||
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void amdgpu_vkms_cleanup_fb(struct drm_plane *plane,
|
static void amdgpu_vkms_cleanup_fb(struct drm_plane *plane,
|
||||||
|
@ -26,6 +26,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <drm/amdgpu_drm.h>
|
#include <drm/amdgpu_drm.h>
|
||||||
|
#include <drm/display/drm_dp_helper.h>
|
||||||
|
|
||||||
#include "amdgpu.h"
|
#include "amdgpu.h"
|
||||||
|
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
@ -34,7 +36,6 @@
|
|||||||
#include "atombios_dp.h"
|
#include "atombios_dp.h"
|
||||||
#include "amdgpu_connectors.h"
|
#include "amdgpu_connectors.h"
|
||||||
#include "amdgpu_atombios.h"
|
#include "amdgpu_atombios.h"
|
||||||
#include <drm/dp/drm_dp_helper.h>
|
|
||||||
|
|
||||||
/* move these to drm_dp_helper.c/h */
|
/* move these to drm_dp_helper.c/h */
|
||||||
#define DP_LINK_CONFIGURATION_SIZE 9
|
#define DP_LINK_CONFIGURATION_SIZE 9
|
||||||
|
@ -20,6 +20,7 @@ config DRM_AMD_DC_DCN
|
|||||||
config DRM_AMD_DC_HDCP
|
config DRM_AMD_DC_HDCP
|
||||||
bool "Enable HDCP support in DC"
|
bool "Enable HDCP support in DC"
|
||||||
depends on DRM_AMD_DC
|
depends on DRM_AMD_DC
|
||||||
|
select DRM_DISPLAY_HDCP_HELPER
|
||||||
help
|
help
|
||||||
Choose this option if you want to support HDCP authentication.
|
Choose this option if you want to support HDCP authentication.
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
#include "amdgpu_dm.h"
|
#include "amdgpu_dm.h"
|
||||||
#ifdef CONFIG_DRM_AMD_DC_HDCP
|
#ifdef CONFIG_DRM_AMD_DC_HDCP
|
||||||
#include "amdgpu_dm_hdcp.h"
|
#include "amdgpu_dm_hdcp.h"
|
||||||
#include <drm/drm_hdcp.h>
|
#include <drm/display/drm_hdcp_helper.h>
|
||||||
#endif
|
#endif
|
||||||
#include "amdgpu_pm.h"
|
#include "amdgpu_pm.h"
|
||||||
#include "amdgpu_atombios.h"
|
#include "amdgpu_atombios.h"
|
||||||
@ -73,10 +73,11 @@
|
|||||||
#include <linux/firmware.h>
|
#include <linux/firmware.h>
|
||||||
#include <linux/component.h>
|
#include <linux/component.h>
|
||||||
|
|
||||||
|
#include <drm/display/drm_dp_mst_helper.h>
|
||||||
|
#include <drm/display/drm_hdmi_helper.h>
|
||||||
#include <drm/drm_atomic.h>
|
#include <drm/drm_atomic.h>
|
||||||
#include <drm/drm_atomic_uapi.h>
|
#include <drm/drm_atomic_uapi.h>
|
||||||
#include <drm/drm_atomic_helper.h>
|
#include <drm/drm_atomic_helper.h>
|
||||||
#include <drm/dp/drm_dp_mst_helper.h>
|
|
||||||
#include <drm/drm_fb_helper.h>
|
#include <drm/drm_fb_helper.h>
|
||||||
#include <drm/drm_fourcc.h>
|
#include <drm/drm_fourcc.h>
|
||||||
#include <drm/drm_edid.h>
|
#include <drm/drm_edid.h>
|
||||||
@ -7583,9 +7584,6 @@ static int dm_plane_helper_prepare_fb(struct drm_plane *plane,
|
|||||||
struct amdgpu_device *adev;
|
struct amdgpu_device *adev;
|
||||||
struct amdgpu_bo *rbo;
|
struct amdgpu_bo *rbo;
|
||||||
struct dm_plane_state *dm_plane_state_new, *dm_plane_state_old;
|
struct dm_plane_state *dm_plane_state_new, *dm_plane_state_old;
|
||||||
struct list_head list;
|
|
||||||
struct ttm_validate_buffer tv;
|
|
||||||
struct ww_acquire_ctx ticket;
|
|
||||||
uint32_t domain;
|
uint32_t domain;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
@ -7598,18 +7596,19 @@ static int dm_plane_helper_prepare_fb(struct drm_plane *plane,
|
|||||||
obj = new_state->fb->obj[0];
|
obj = new_state->fb->obj[0];
|
||||||
rbo = gem_to_amdgpu_bo(obj);
|
rbo = gem_to_amdgpu_bo(obj);
|
||||||
adev = amdgpu_ttm_adev(rbo->tbo.bdev);
|
adev = amdgpu_ttm_adev(rbo->tbo.bdev);
|
||||||
INIT_LIST_HEAD(&list);
|
|
||||||
|
|
||||||
tv.bo = &rbo->tbo;
|
r = amdgpu_bo_reserve(rbo, true);
|
||||||
tv.num_shared = 1;
|
|
||||||
list_add(&tv.head, &list);
|
|
||||||
|
|
||||||
r = ttm_eu_reserve_buffers(&ticket, &list, false, NULL);
|
|
||||||
if (r) {
|
if (r) {
|
||||||
dev_err(adev->dev, "fail to reserve bo (%d)\n", r);
|
dev_err(adev->dev, "fail to reserve bo (%d)\n", r);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
r = dma_resv_reserve_fences(rbo->tbo.base.resv, 1);
|
||||||
|
if (r) {
|
||||||
|
dev_err(adev->dev, "reserving fence slot failed (%d)\n", r);
|
||||||
|
goto error_unlock;
|
||||||
|
}
|
||||||
|
|
||||||
if (plane->type != DRM_PLANE_TYPE_CURSOR)
|
if (plane->type != DRM_PLANE_TYPE_CURSOR)
|
||||||
domain = amdgpu_display_supported_domains(adev, rbo->flags);
|
domain = amdgpu_display_supported_domains(adev, rbo->flags);
|
||||||
else
|
else
|
||||||
@ -7619,19 +7618,16 @@ static int dm_plane_helper_prepare_fb(struct drm_plane *plane,
|
|||||||
if (unlikely(r != 0)) {
|
if (unlikely(r != 0)) {
|
||||||
if (r != -ERESTARTSYS)
|
if (r != -ERESTARTSYS)
|
||||||
DRM_ERROR("Failed to pin framebuffer with error %d\n", r);
|
DRM_ERROR("Failed to pin framebuffer with error %d\n", r);
|
||||||
ttm_eu_backoff_reservation(&ticket, &list);
|
goto error_unlock;
|
||||||
return r;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
r = amdgpu_ttm_alloc_gart(&rbo->tbo);
|
r = amdgpu_ttm_alloc_gart(&rbo->tbo);
|
||||||
if (unlikely(r != 0)) {
|
if (unlikely(r != 0)) {
|
||||||
amdgpu_bo_unpin(rbo);
|
|
||||||
ttm_eu_backoff_reservation(&ticket, &list);
|
|
||||||
DRM_ERROR("%p bind failed\n", rbo);
|
DRM_ERROR("%p bind failed\n", rbo);
|
||||||
return r;
|
goto error_unpin;
|
||||||
}
|
}
|
||||||
|
|
||||||
ttm_eu_backoff_reservation(&ticket, &list);
|
amdgpu_bo_unreserve(rbo);
|
||||||
|
|
||||||
afb->address = amdgpu_bo_gpu_offset(rbo);
|
afb->address = amdgpu_bo_gpu_offset(rbo);
|
||||||
|
|
||||||
@ -7663,6 +7659,13 @@ static int dm_plane_helper_prepare_fb(struct drm_plane *plane,
|
|||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
error_unpin:
|
||||||
|
amdgpu_bo_unpin(rbo);
|
||||||
|
|
||||||
|
error_unlock:
|
||||||
|
amdgpu_bo_unreserve(rbo);
|
||||||
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dm_plane_helper_cleanup_fb(struct drm_plane *plane,
|
static void dm_plane_helper_cleanup_fb(struct drm_plane *plane,
|
||||||
|
@ -26,10 +26,10 @@
|
|||||||
#ifndef __AMDGPU_DM_H__
|
#ifndef __AMDGPU_DM_H__
|
||||||
#define __AMDGPU_DM_H__
|
#define __AMDGPU_DM_H__
|
||||||
|
|
||||||
|
#include <drm/display/drm_dp_mst_helper.h>
|
||||||
#include <drm/drm_atomic.h>
|
#include <drm/drm_atomic.h>
|
||||||
#include <drm/drm_connector.h>
|
#include <drm/drm_connector.h>
|
||||||
#include <drm/drm_crtc.h>
|
#include <drm/drm_crtc.h>
|
||||||
#include <drm/dp/drm_dp_mst_helper.h>
|
|
||||||
#include <drm/drm_plane.h>
|
#include <drm/drm_plane.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
#include "amdgpu.h"
|
#include "amdgpu.h"
|
||||||
#include "amdgpu_dm.h"
|
#include "amdgpu_dm.h"
|
||||||
#include "dm_helpers.h"
|
#include "dm_helpers.h"
|
||||||
#include <drm/drm_hdcp.h>
|
#include <drm/display/drm_hdcp_helper.h>
|
||||||
#include "hdcp_psp.h"
|
#include "hdcp_psp.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -23,10 +23,10 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <drm/display/drm_dp_helper.h>
|
||||||
|
#include <drm/display/drm_dp_mst_helper.h>
|
||||||
#include <drm/drm_atomic.h>
|
#include <drm/drm_atomic.h>
|
||||||
#include <drm/drm_atomic_helper.h>
|
#include <drm/drm_atomic_helper.h>
|
||||||
#include <drm/dp/drm_dp_mst_helper.h>
|
|
||||||
#include <drm/dp/drm_dp_helper.h>
|
|
||||||
#include "dm_services.h"
|
#include "dm_services.h"
|
||||||
#include "amdgpu.h"
|
#include "amdgpu.h"
|
||||||
#include "amdgpu_dm.h"
|
#include "amdgpu_dm.h"
|
||||||
|
@ -27,8 +27,8 @@
|
|||||||
#include <dc_link.h>
|
#include <dc_link.h>
|
||||||
#include <inc/link_hwss.h>
|
#include <inc/link_hwss.h>
|
||||||
#include <inc/link_dpcd.h>
|
#include <inc/link_dpcd.h>
|
||||||
#include <drm/dp/drm_dp_helper.h>
|
|
||||||
#include <dc_dp_types.h>
|
#include <dc_dp_types.h>
|
||||||
|
#include <drm/display/drm_dp_helper.h>
|
||||||
#include "dm_helpers.h"
|
#include "dm_helpers.h"
|
||||||
|
|
||||||
#define END_ADDRESS(start, size) (start + size - 1)
|
#define END_ADDRESS(start, size) (start + size - 1)
|
||||||
|
@ -23,6 +23,8 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <drm/display/drm_dsc_helper.h>
|
||||||
|
|
||||||
#include "reg_helper.h"
|
#include "reg_helper.h"
|
||||||
#include "dcn20_dsc.h"
|
#include "dcn20_dsc.h"
|
||||||
#include "dsc/dscc_types.h"
|
#include "dsc/dscc_types.h"
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
#include "dsc.h"
|
#include "dsc.h"
|
||||||
#include "dsc/dscc_types.h"
|
#include "dsc/dscc_types.h"
|
||||||
#include <drm/drm_dsc.h>
|
#include <drm/display/drm_dsc.h>
|
||||||
|
|
||||||
#define TO_DCN20_DSC(dsc)\
|
#define TO_DCN20_DSC(dsc)\
|
||||||
container_of(dsc, struct dcn20_dsc, base)
|
container_of(dsc, struct dcn20_dsc, base)
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
#define __RC_CALC_FPU_H__
|
#define __RC_CALC_FPU_H__
|
||||||
|
|
||||||
#include "os_types.h"
|
#include "os_types.h"
|
||||||
#include <drm/drm_dsc.h>
|
#include <drm/display/drm_dsc.h>
|
||||||
|
|
||||||
#define QP_SET_SIZE 15
|
#define QP_SET_SIZE 15
|
||||||
|
|
||||||
|
@ -22,10 +22,10 @@
|
|||||||
* Author: AMD
|
* Author: AMD
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <drm/drm_dsc.h>
|
#include <drm/display/drm_dp_helper.h>
|
||||||
|
#include <drm/display/drm_dsc_helper.h>
|
||||||
#include "dc_hw_types.h"
|
#include "dc_hw_types.h"
|
||||||
#include "dsc.h"
|
#include "dsc.h"
|
||||||
#include <drm/dp/drm_dp_helper.h>
|
|
||||||
#include "dc.h"
|
#include "dc.h"
|
||||||
#include "rc_calc.h"
|
#include "rc_calc.h"
|
||||||
#include "fixed31_32.h"
|
#include "fixed31_32.h"
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
#ifndef __DSCC_TYPES_H__
|
#ifndef __DSCC_TYPES_H__
|
||||||
#define __DSCC_TYPES_H__
|
#define __DSCC_TYPES_H__
|
||||||
|
|
||||||
#include <drm/drm_dsc.h>
|
#include <drm/display/drm_dsc.h>
|
||||||
|
|
||||||
#ifndef NUM_BUF_RANGES
|
#ifndef NUM_BUF_RANGES
|
||||||
#define NUM_BUF_RANGES 15
|
#define NUM_BUF_RANGES 15
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
* Authors: AMD
|
* Authors: AMD
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <drm/drm_dsc.h>
|
#include <drm/display/drm_dsc_helper.h>
|
||||||
#include "dscc_types.h"
|
#include "dscc_types.h"
|
||||||
#include "rc_calc.h"
|
#include "rc_calc.h"
|
||||||
|
|
||||||
|
@ -35,8 +35,8 @@
|
|||||||
|
|
||||||
#include <asm/byteorder.h>
|
#include <asm/byteorder.h>
|
||||||
|
|
||||||
|
#include <drm/display/drm_dp_helper.h>
|
||||||
#include <drm/drm_print.h>
|
#include <drm/drm_print.h>
|
||||||
#include <drm/dp/drm_dp_helper.h>
|
|
||||||
|
|
||||||
#include "cgs_common.h"
|
#include "cgs_common.h"
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
#ifndef __DAL_DPCD_DEFS_H__
|
#ifndef __DAL_DPCD_DEFS_H__
|
||||||
#define __DAL_DPCD_DEFS_H__
|
#define __DAL_DPCD_DEFS_H__
|
||||||
|
|
||||||
#include <drm/dp/drm_dp_helper.h>
|
#include <drm/display/drm_dp_helper.h>
|
||||||
#ifndef DP_SINK_HW_REVISION_START // can remove this once the define gets into linux drm_dp_helper.h
|
#ifndef DP_SINK_HW_REVISION_START // can remove this once the define gets into linux drm_dp_helper.h
|
||||||
#define DP_SINK_HW_REVISION_START 0x409
|
#define DP_SINK_HW_REVISION_START 0x409
|
||||||
#endif
|
#endif
|
||||||
|
@ -29,8 +29,8 @@
|
|||||||
#include "mod_hdcp.h"
|
#include "mod_hdcp.h"
|
||||||
#include "hdcp_log.h"
|
#include "hdcp_log.h"
|
||||||
|
|
||||||
#include <drm/drm_hdcp.h>
|
#include <drm/display/drm_dp_helper.h>
|
||||||
#include <drm/dp/drm_dp_helper.h>
|
#include <drm/display/drm_hdcp_helper.h>
|
||||||
|
|
||||||
enum mod_hdcp_trans_input_result {
|
enum mod_hdcp_trans_input_result {
|
||||||
UNKNOWN = 0,
|
UNKNOWN = 0,
|
||||||
|
@ -78,7 +78,10 @@ config DRM_DISPLAY_CONNECTOR
|
|||||||
config DRM_ITE_IT6505
|
config DRM_ITE_IT6505
|
||||||
tristate "ITE IT6505 DisplayPort bridge"
|
tristate "ITE IT6505 DisplayPort bridge"
|
||||||
depends on OF
|
depends on OF
|
||||||
select DRM_DP_HELPER
|
select DRM_DISPLAY_DP_HELPER
|
||||||
|
select DRM_DISPLAY_HDCP_HELPER
|
||||||
|
select DRM_DISPLAY_HELPER
|
||||||
|
select DRM_DP_AUX_BUS
|
||||||
select DRM_KMS_HELPER
|
select DRM_KMS_HELPER
|
||||||
select EXTCON
|
select EXTCON
|
||||||
help
|
help
|
||||||
@ -205,8 +208,9 @@ config DRM_PARADE_PS8622
|
|||||||
config DRM_PARADE_PS8640
|
config DRM_PARADE_PS8640
|
||||||
tristate "Parade PS8640 MIPI DSI to eDP Converter"
|
tristate "Parade PS8640 MIPI DSI to eDP Converter"
|
||||||
depends on OF
|
depends on OF
|
||||||
|
select DRM_DISPLAY_DP_HELPER
|
||||||
|
select DRM_DISPLAY_HELPER
|
||||||
select DRM_DP_AUX_BUS
|
select DRM_DP_AUX_BUS
|
||||||
select DRM_DP_HELPER
|
|
||||||
select DRM_KMS_HELPER
|
select DRM_KMS_HELPER
|
||||||
select DRM_MIPI_DSI
|
select DRM_MIPI_DSI
|
||||||
select DRM_PANEL
|
select DRM_PANEL
|
||||||
@ -277,7 +281,8 @@ config DRM_TOSHIBA_TC358764
|
|||||||
config DRM_TOSHIBA_TC358767
|
config DRM_TOSHIBA_TC358767
|
||||||
tristate "Toshiba TC358767 eDP bridge"
|
tristate "Toshiba TC358767 eDP bridge"
|
||||||
depends on OF
|
depends on OF
|
||||||
select DRM_DP_HELPER
|
select DRM_DISPLAY_DP_HELPER
|
||||||
|
select DRM_DISPLAY_HELPER
|
||||||
select DRM_KMS_HELPER
|
select DRM_KMS_HELPER
|
||||||
select REGMAP_I2C
|
select REGMAP_I2C
|
||||||
select DRM_MIPI_DSI
|
select DRM_MIPI_DSI
|
||||||
@ -298,7 +303,8 @@ config DRM_TOSHIBA_TC358768
|
|||||||
config DRM_TOSHIBA_TC358775
|
config DRM_TOSHIBA_TC358775
|
||||||
tristate "Toshiba TC358775 DSI/LVDS bridge"
|
tristate "Toshiba TC358775 DSI/LVDS bridge"
|
||||||
depends on OF
|
depends on OF
|
||||||
select DRM_DP_HELPER
|
select DRM_DISPLAY_DP_HELPER
|
||||||
|
select DRM_DISPLAY_HELPER
|
||||||
select DRM_KMS_HELPER
|
select DRM_KMS_HELPER
|
||||||
select REGMAP_I2C
|
select REGMAP_I2C
|
||||||
select DRM_PANEL
|
select DRM_PANEL
|
||||||
@ -326,7 +332,8 @@ config DRM_TI_SN65DSI83
|
|||||||
config DRM_TI_SN65DSI86
|
config DRM_TI_SN65DSI86
|
||||||
tristate "TI SN65DSI86 DSI to eDP bridge"
|
tristate "TI SN65DSI86 DSI to eDP bridge"
|
||||||
depends on OF
|
depends on OF
|
||||||
select DRM_DP_HELPER
|
select DRM_DISPLAY_DP_HELPER
|
||||||
|
select DRM_DISPLAY_HELPER
|
||||||
select DRM_KMS_HELPER
|
select DRM_KMS_HELPER
|
||||||
select REGMAP_I2C
|
select REGMAP_I2C
|
||||||
select DRM_PANEL
|
select DRM_PANEL
|
||||||
|
@ -3,7 +3,8 @@ config DRM_ANALOGIX_ANX6345
|
|||||||
tristate "Analogix ANX6345 bridge"
|
tristate "Analogix ANX6345 bridge"
|
||||||
depends on OF
|
depends on OF
|
||||||
select DRM_ANALOGIX_DP
|
select DRM_ANALOGIX_DP
|
||||||
select DRM_DP_HELPER
|
select DRM_DISPLAY_DP_HELPER
|
||||||
|
select DRM_DISPLAY_HELPER
|
||||||
select DRM_KMS_HELPER
|
select DRM_KMS_HELPER
|
||||||
select REGMAP_I2C
|
select REGMAP_I2C
|
||||||
help
|
help
|
||||||
@ -15,7 +16,8 @@ config DRM_ANALOGIX_ANX6345
|
|||||||
config DRM_ANALOGIX_ANX78XX
|
config DRM_ANALOGIX_ANX78XX
|
||||||
tristate "Analogix ANX78XX bridge"
|
tristate "Analogix ANX78XX bridge"
|
||||||
select DRM_ANALOGIX_DP
|
select DRM_ANALOGIX_DP
|
||||||
select DRM_DP_HELPER
|
select DRM_DISPLAY_DP_HELPER
|
||||||
|
select DRM_DISPLAY_HELPER
|
||||||
select DRM_KMS_HELPER
|
select DRM_KMS_HELPER
|
||||||
select REGMAP_I2C
|
select REGMAP_I2C
|
||||||
help
|
help
|
||||||
@ -32,8 +34,10 @@ config DRM_ANALOGIX_ANX7625
|
|||||||
tristate "Analogix Anx7625 MIPI to DP interface support"
|
tristate "Analogix Anx7625 MIPI to DP interface support"
|
||||||
depends on DRM
|
depends on DRM
|
||||||
depends on OF
|
depends on OF
|
||||||
|
select DRM_DISPLAY_DP_HELPER
|
||||||
|
select DRM_DISPLAY_HDCP_HELPER
|
||||||
|
select DRM_DISPLAY_HELPER
|
||||||
select DRM_DP_AUX_BUS
|
select DRM_DP_AUX_BUS
|
||||||
select DRM_DP_HELPER
|
|
||||||
select DRM_MIPI_DSI
|
select DRM_MIPI_DSI
|
||||||
help
|
help
|
||||||
ANX7625 is an ultra-low power 4K mobile HD transmitter
|
ANX7625 is an ultra-low power 4K mobile HD transmitter
|
||||||
|
@ -18,11 +18,11 @@
|
|||||||
#include <linux/regulator/consumer.h>
|
#include <linux/regulator/consumer.h>
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
|
|
||||||
|
#include <drm/display/drm_dp_helper.h>
|
||||||
#include <drm/drm_atomic_helper.h>
|
#include <drm/drm_atomic_helper.h>
|
||||||
#include <drm/drm_bridge.h>
|
#include <drm/drm_bridge.h>
|
||||||
#include <drm/drm_crtc.h>
|
#include <drm/drm_crtc.h>
|
||||||
#include <drm/drm_crtc_helper.h>
|
#include <drm/drm_crtc_helper.h>
|
||||||
#include <drm/dp/drm_dp_helper.h>
|
|
||||||
#include <drm/drm_edid.h>
|
#include <drm/drm_edid.h>
|
||||||
#include <drm/drm_of.h>
|
#include <drm/drm_of.h>
|
||||||
#include <drm/drm_panel.h>
|
#include <drm/drm_panel.h>
|
||||||
|
@ -18,10 +18,10 @@
|
|||||||
#include <linux/regulator/consumer.h>
|
#include <linux/regulator/consumer.h>
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
|
|
||||||
|
#include <drm/display/drm_dp_helper.h>
|
||||||
#include <drm/drm_atomic_helper.h>
|
#include <drm/drm_atomic_helper.h>
|
||||||
#include <drm/drm_bridge.h>
|
#include <drm/drm_bridge.h>
|
||||||
#include <drm/drm_crtc.h>
|
#include <drm/drm_crtc.h>
|
||||||
#include <drm/dp/drm_dp_helper.h>
|
|
||||||
#include <drm/drm_edid.h>
|
#include <drm/drm_edid.h>
|
||||||
#include <drm/drm_print.h>
|
#include <drm/drm_print.h>
|
||||||
#include <drm/drm_probe_helper.h>
|
#include <drm/drm_probe_helper.h>
|
||||||
|
@ -7,8 +7,8 @@
|
|||||||
*/
|
*/
|
||||||
#include <linux/regmap.h>
|
#include <linux/regmap.h>
|
||||||
|
|
||||||
|
#include <drm/display/drm_dp_helper.h>
|
||||||
#include <drm/drm.h>
|
#include <drm/drm.h>
|
||||||
#include <drm/dp/drm_dp_helper.h>
|
|
||||||
#include <drm/drm_print.h>
|
#include <drm/drm_print.h>
|
||||||
|
|
||||||
#include "analogix-i2c-dptx.h"
|
#include "analogix-i2c-dptx.h"
|
||||||
|
@ -1708,8 +1708,10 @@ analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data)
|
|||||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||||
|
|
||||||
dp->reg_base = devm_ioremap_resource(&pdev->dev, res);
|
dp->reg_base = devm_ioremap_resource(&pdev->dev, res);
|
||||||
if (IS_ERR(dp->reg_base))
|
if (IS_ERR(dp->reg_base)) {
|
||||||
return ERR_CAST(dp->reg_base);
|
ret = PTR_ERR(dp->reg_base);
|
||||||
|
goto err_disable_clk;
|
||||||
|
}
|
||||||
|
|
||||||
dp->force_hpd = of_property_read_bool(dev->of_node, "force-hpd");
|
dp->force_hpd = of_property_read_bool(dev->of_node, "force-hpd");
|
||||||
|
|
||||||
@ -1721,7 +1723,8 @@ analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data)
|
|||||||
if (IS_ERR(dp->hpd_gpiod)) {
|
if (IS_ERR(dp->hpd_gpiod)) {
|
||||||
dev_err(dev, "error getting HDP GPIO: %ld\n",
|
dev_err(dev, "error getting HDP GPIO: %ld\n",
|
||||||
PTR_ERR(dp->hpd_gpiod));
|
PTR_ERR(dp->hpd_gpiod));
|
||||||
return ERR_CAST(dp->hpd_gpiod);
|
ret = PTR_ERR(dp->hpd_gpiod);
|
||||||
|
goto err_disable_clk;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dp->hpd_gpiod) {
|
if (dp->hpd_gpiod) {
|
||||||
@ -1741,7 +1744,8 @@ analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data)
|
|||||||
|
|
||||||
if (dp->irq == -ENXIO) {
|
if (dp->irq == -ENXIO) {
|
||||||
dev_err(&pdev->dev, "failed to get irq\n");
|
dev_err(&pdev->dev, "failed to get irq\n");
|
||||||
return ERR_PTR(-ENODEV);
|
ret = -ENODEV;
|
||||||
|
goto err_disable_clk;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = devm_request_threaded_irq(&pdev->dev, dp->irq,
|
ret = devm_request_threaded_irq(&pdev->dev, dp->irq,
|
||||||
@ -1750,11 +1754,15 @@ analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data)
|
|||||||
irq_flags, "analogix-dp", dp);
|
irq_flags, "analogix-dp", dp);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dev_err(&pdev->dev, "failed to request irq\n");
|
dev_err(&pdev->dev, "failed to request irq\n");
|
||||||
return ERR_PTR(ret);
|
goto err_disable_clk;
|
||||||
}
|
}
|
||||||
disable_irq(dp->irq);
|
disable_irq(dp->irq);
|
||||||
|
|
||||||
return dp;
|
return dp;
|
||||||
|
|
||||||
|
err_disable_clk:
|
||||||
|
clk_disable_unprepare(dp->clock);
|
||||||
|
return ERR_PTR(ret);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(analogix_dp_probe);
|
EXPORT_SYMBOL_GPL(analogix_dp_probe);
|
||||||
|
|
||||||
|
@ -9,8 +9,8 @@
|
|||||||
#ifndef _ANALOGIX_DP_CORE_H
|
#ifndef _ANALOGIX_DP_CORE_H
|
||||||
#define _ANALOGIX_DP_CORE_H
|
#define _ANALOGIX_DP_CORE_H
|
||||||
|
|
||||||
|
#include <drm/display/drm_dp_helper.h>
|
||||||
#include <drm/drm_crtc.h>
|
#include <drm/drm_crtc.h>
|
||||||
#include <drm/dp/drm_dp_helper.h>
|
|
||||||
|
|
||||||
#define DP_TIMEOUT_LOOP_COUNT 100
|
#define DP_TIMEOUT_LOOP_COUNT 100
|
||||||
#define MAX_CR_LOOP 5
|
#define MAX_CR_LOOP 5
|
||||||
|
@ -21,13 +21,13 @@
|
|||||||
#include <linux/of_graph.h>
|
#include <linux/of_graph.h>
|
||||||
#include <linux/of_platform.h>
|
#include <linux/of_platform.h>
|
||||||
|
|
||||||
|
#include <drm/display/drm_dp_aux_bus.h>
|
||||||
|
#include <drm/display/drm_dp_helper.h>
|
||||||
|
#include <drm/display/drm_hdcp_helper.h>
|
||||||
#include <drm/drm_atomic_helper.h>
|
#include <drm/drm_atomic_helper.h>
|
||||||
#include <drm/drm_bridge.h>
|
#include <drm/drm_bridge.h>
|
||||||
#include <drm/drm_crtc_helper.h>
|
#include <drm/drm_crtc_helper.h>
|
||||||
#include <drm/dp/drm_dp_aux_bus.h>
|
|
||||||
#include <drm/dp/drm_dp_helper.h>
|
|
||||||
#include <drm/drm_edid.h>
|
#include <drm/drm_edid.h>
|
||||||
#include <drm/drm_hdcp.h>
|
|
||||||
#include <drm/drm_mipi_dsi.h>
|
#include <drm/drm_mipi_dsi.h>
|
||||||
#include <drm/drm_of.h>
|
#include <drm/drm_of.h>
|
||||||
#include <drm/drm_panel.h>
|
#include <drm/drm_panel.h>
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
# SPDX-License-Identifier: GPL-2.0-only
|
# SPDX-License-Identifier: GPL-2.0-only
|
||||||
config DRM_CDNS_MHDP8546
|
config DRM_CDNS_MHDP8546
|
||||||
tristate "Cadence DPI/DP bridge"
|
tristate "Cadence DPI/DP bridge"
|
||||||
select DRM_DP_HELPER
|
select DRM_DISPLAY_DP_HELPER
|
||||||
|
select DRM_DISPLAY_HDCP_HELPER
|
||||||
|
select DRM_DISPLAY_HELPER
|
||||||
select DRM_KMS_HELPER
|
select DRM_KMS_HELPER
|
||||||
select DRM_PANEL_BRIDGE
|
select DRM_PANEL_BRIDGE
|
||||||
depends on OF
|
depends on OF
|
||||||
|
@ -35,14 +35,14 @@
|
|||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <linux/wait.h>
|
#include <linux/wait.h>
|
||||||
|
|
||||||
|
#include <drm/display/drm_dp_helper.h>
|
||||||
|
#include <drm/display/drm_hdcp_helper.h>
|
||||||
#include <drm/drm_atomic.h>
|
#include <drm/drm_atomic.h>
|
||||||
#include <drm/drm_atomic_helper.h>
|
#include <drm/drm_atomic_helper.h>
|
||||||
#include <drm/drm_atomic_state_helper.h>
|
#include <drm/drm_atomic_state_helper.h>
|
||||||
#include <drm/drm_bridge.h>
|
#include <drm/drm_bridge.h>
|
||||||
#include <drm/drm_connector.h>
|
#include <drm/drm_connector.h>
|
||||||
#include <drm/drm_crtc_helper.h>
|
#include <drm/drm_crtc_helper.h>
|
||||||
#include <drm/dp/drm_dp_helper.h>
|
|
||||||
#include <drm/drm_hdcp.h>
|
|
||||||
#include <drm/drm_modeset_helper_vtables.h>
|
#include <drm/drm_modeset_helper_vtables.h>
|
||||||
#include <drm/drm_print.h>
|
#include <drm/drm_print.h>
|
||||||
#include <drm/drm_probe_helper.h>
|
#include <drm/drm_probe_helper.h>
|
||||||
|
@ -15,9 +15,9 @@
|
|||||||
#include <linux/mutex.h>
|
#include <linux/mutex.h>
|
||||||
#include <linux/spinlock.h>
|
#include <linux/spinlock.h>
|
||||||
|
|
||||||
|
#include <drm/display/drm_dp_helper.h>
|
||||||
#include <drm/drm_bridge.h>
|
#include <drm/drm_bridge.h>
|
||||||
#include <drm/drm_connector.h>
|
#include <drm/drm_connector.h>
|
||||||
#include <drm/dp/drm_dp_helper.h>
|
|
||||||
|
|
||||||
struct clk;
|
struct clk;
|
||||||
struct device;
|
struct device;
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
#include <asm/unaligned.h>
|
#include <asm/unaligned.h>
|
||||||
|
|
||||||
#include <drm/drm_hdcp.h>
|
#include <drm/display/drm_hdcp_helper.h>
|
||||||
|
|
||||||
#include "cdns-mhdp8546-hdcp.h"
|
#include "cdns-mhdp8546-hdcp.h"
|
||||||
|
|
||||||
|
@ -21,13 +21,13 @@
|
|||||||
|
|
||||||
#include <crypto/hash.h>
|
#include <crypto/hash.h>
|
||||||
|
|
||||||
#include <drm/dp/drm_dp_helper.h>
|
#include <drm/display/drm_dp_helper.h>
|
||||||
|
#include <drm/display/drm_hdcp_helper.h>
|
||||||
#include <drm/drm_atomic_helper.h>
|
#include <drm/drm_atomic_helper.h>
|
||||||
#include <drm/drm_bridge.h>
|
#include <drm/drm_bridge.h>
|
||||||
#include <drm/drm_crtc.h>
|
#include <drm/drm_crtc.h>
|
||||||
#include <drm/drm_crtc_helper.h>
|
#include <drm/drm_crtc_helper.h>
|
||||||
#include <drm/drm_edid.h>
|
#include <drm/drm_edid.h>
|
||||||
#include <drm/drm_hdcp.h>
|
|
||||||
#include <drm/drm_print.h>
|
#include <drm/drm_print.h>
|
||||||
#include <drm/drm_probe_helper.h>
|
#include <drm/drm_probe_helper.h>
|
||||||
|
|
||||||
|
@ -13,9 +13,9 @@
|
|||||||
#include <linux/regmap.h>
|
#include <linux/regmap.h>
|
||||||
#include <linux/regulator/consumer.h>
|
#include <linux/regulator/consumer.h>
|
||||||
|
|
||||||
|
#include <drm/display/drm_dp_aux_bus.h>
|
||||||
|
#include <drm/display/drm_dp_helper.h>
|
||||||
#include <drm/drm_bridge.h>
|
#include <drm/drm_bridge.h>
|
||||||
#include <drm/dp/drm_dp_aux_bus.h>
|
|
||||||
#include <drm/dp/drm_dp_helper.h>
|
|
||||||
#include <drm/drm_mipi_dsi.h>
|
#include <drm/drm_mipi_dsi.h>
|
||||||
#include <drm/drm_of.h>
|
#include <drm/drm_of.h>
|
||||||
#include <drm/drm_panel.h>
|
#include <drm/drm_panel.h>
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
# SPDX-License-Identifier: GPL-2.0-only
|
# SPDX-License-Identifier: GPL-2.0-only
|
||||||
config DRM_DW_HDMI
|
config DRM_DW_HDMI
|
||||||
tristate
|
tristate
|
||||||
|
select DRM_DISPLAY_HDMI_HELPER
|
||||||
|
select DRM_DISPLAY_HELPER
|
||||||
select DRM_KMS_HELPER
|
select DRM_KMS_HELPER
|
||||||
select REGMAP_MMIO
|
select REGMAP_MMIO
|
||||||
select CEC_CORE if CEC_NOTIFIER
|
select CEC_CORE if CEC_NOTIFIER
|
||||||
|
@ -77,7 +77,6 @@ static int audio_hw_params(struct device *dev, void *data,
|
|||||||
struct hdmi_codec_params *params)
|
struct hdmi_codec_params *params)
|
||||||
{
|
{
|
||||||
struct snd_dw_hdmi *dw = dev_get_drvdata(dev);
|
struct snd_dw_hdmi *dw = dev_get_drvdata(dev);
|
||||||
int ret = 0;
|
|
||||||
u8 ca;
|
u8 ca;
|
||||||
|
|
||||||
dw_hdmi_set_sample_rate(dw->data.hdmi, params->sample_rate);
|
dw_hdmi_set_sample_rate(dw->data.hdmi, params->sample_rate);
|
||||||
@ -91,7 +90,7 @@ static int audio_hw_params(struct device *dev, void *data,
|
|||||||
params->iec.status[0] & IEC958_AES0_NONAUDIO);
|
params->iec.status[0] & IEC958_AES0_NONAUDIO);
|
||||||
dw_hdmi_set_sample_width(dw->data.hdmi, params->sample_width);
|
dw_hdmi_set_sample_width(dw->data.hdmi, params->sample_width);
|
||||||
|
|
||||||
return ret;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void audio_shutdown(struct device *dev, void *data)
|
static void audio_shutdown(struct device *dev, void *data)
|
||||||
@ -102,14 +101,13 @@ static int audio_mute_stream(struct device *dev, void *data,
|
|||||||
bool enable, int direction)
|
bool enable, int direction)
|
||||||
{
|
{
|
||||||
struct snd_dw_hdmi *dw = dev_get_drvdata(dev);
|
struct snd_dw_hdmi *dw = dev_get_drvdata(dev);
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
if (!enable)
|
if (!enable)
|
||||||
dw_hdmi_audio_enable(dw->data.hdmi);
|
dw_hdmi_audio_enable(dw->data.hdmi);
|
||||||
else
|
else
|
||||||
dw_hdmi_audio_disable(dw->data.hdmi);
|
dw_hdmi_audio_disable(dw->data.hdmi);
|
||||||
|
|
||||||
return ret;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int audio_get_eld(struct device *dev, void *data,
|
static int audio_get_eld(struct device *dev, void *data,
|
||||||
|
@ -25,14 +25,14 @@
|
|||||||
#include <uapi/linux/videodev2.h>
|
#include <uapi/linux/videodev2.h>
|
||||||
|
|
||||||
#include <drm/bridge/dw_hdmi.h>
|
#include <drm/bridge/dw_hdmi.h>
|
||||||
|
#include <drm/display/drm_hdmi_helper.h>
|
||||||
|
#include <drm/display/drm_scdc_helper.h>
|
||||||
#include <drm/drm_atomic.h>
|
#include <drm/drm_atomic.h>
|
||||||
#include <drm/drm_atomic_helper.h>
|
#include <drm/drm_atomic_helper.h>
|
||||||
#include <drm/drm_bridge.h>
|
#include <drm/drm_bridge.h>
|
||||||
#include <drm/drm_edid.h>
|
|
||||||
#include <drm/drm_of.h>
|
#include <drm/drm_of.h>
|
||||||
#include <drm/drm_print.h>
|
#include <drm/drm_print.h>
|
||||||
#include <drm/drm_probe_helper.h>
|
#include <drm/drm_probe_helper.h>
|
||||||
#include <drm/drm_scdc_helper.h>
|
|
||||||
|
|
||||||
#include "dw-hdmi-audio.h"
|
#include "dw-hdmi-audio.h"
|
||||||
#include "dw-hdmi-cec.h"
|
#include "dw-hdmi-cec.h"
|
||||||
|
@ -61,7 +61,6 @@
|
|||||||
struct tc358762 {
|
struct tc358762 {
|
||||||
struct device *dev;
|
struct device *dev;
|
||||||
struct drm_bridge bridge;
|
struct drm_bridge bridge;
|
||||||
struct drm_connector connector;
|
|
||||||
struct regulator *regulator;
|
struct regulator *regulator;
|
||||||
struct drm_bridge *panel_bridge;
|
struct drm_bridge *panel_bridge;
|
||||||
bool pre_enabled;
|
bool pre_enabled;
|
||||||
|
@ -31,9 +31,9 @@
|
|||||||
#include <linux/regmap.h>
|
#include <linux/regmap.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
|
|
||||||
|
#include <drm/display/drm_dp_helper.h>
|
||||||
#include <drm/drm_atomic_helper.h>
|
#include <drm/drm_atomic_helper.h>
|
||||||
#include <drm/drm_bridge.h>
|
#include <drm/drm_bridge.h>
|
||||||
#include <drm/dp/drm_dp_helper.h>
|
|
||||||
#include <drm/drm_edid.h>
|
#include <drm/drm_edid.h>
|
||||||
#include <drm/drm_mipi_dsi.h>
|
#include <drm/drm_mipi_dsi.h>
|
||||||
#include <drm/drm_of.h>
|
#include <drm/drm_of.h>
|
||||||
|
@ -19,10 +19,10 @@
|
|||||||
|
|
||||||
#include <asm/unaligned.h>
|
#include <asm/unaligned.h>
|
||||||
|
|
||||||
|
#include <drm/display/drm_dp_helper.h>
|
||||||
#include <drm/drm_atomic_helper.h>
|
#include <drm/drm_atomic_helper.h>
|
||||||
#include <drm/drm_bridge.h>
|
#include <drm/drm_bridge.h>
|
||||||
#include <drm/drm_crtc_helper.h>
|
#include <drm/drm_crtc_helper.h>
|
||||||
#include <drm/dp/drm_dp_helper.h>
|
|
||||||
#include <drm/drm_mipi_dsi.h>
|
#include <drm/drm_mipi_dsi.h>
|
||||||
#include <drm/drm_of.h>
|
#include <drm/drm_of.h>
|
||||||
#include <drm/drm_panel.h>
|
#include <drm/drm_panel.h>
|
||||||
|
@ -23,12 +23,12 @@
|
|||||||
|
|
||||||
#include <asm/unaligned.h>
|
#include <asm/unaligned.h>
|
||||||
|
|
||||||
|
#include <drm/display/drm_dp_aux_bus.h>
|
||||||
|
#include <drm/display/drm_dp_helper.h>
|
||||||
#include <drm/drm_atomic.h>
|
#include <drm/drm_atomic.h>
|
||||||
#include <drm/drm_atomic_helper.h>
|
#include <drm/drm_atomic_helper.h>
|
||||||
#include <drm/drm_bridge.h>
|
#include <drm/drm_bridge.h>
|
||||||
#include <drm/drm_bridge_connector.h>
|
#include <drm/drm_bridge_connector.h>
|
||||||
#include <drm/dp/drm_dp_aux_bus.h>
|
|
||||||
#include <drm/dp/drm_dp_helper.h>
|
|
||||||
#include <drm/drm_mipi_dsi.h>
|
#include <drm/drm_mipi_dsi.h>
|
||||||
#include <drm/drm_of.h>
|
#include <drm/drm_of.h>
|
||||||
#include <drm/drm_panel.h>
|
#include <drm/drm_panel.h>
|
||||||
|
49
drivers/gpu/drm/display/Kconfig
Normal file
49
drivers/gpu/drm/display/Kconfig
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
# SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
config DRM_DP_AUX_BUS
|
||||||
|
tristate
|
||||||
|
depends on DRM
|
||||||
|
depends on OF
|
||||||
|
|
||||||
|
config DRM_DISPLAY_HELPER
|
||||||
|
tristate
|
||||||
|
depends on DRM
|
||||||
|
help
|
||||||
|
DRM helpers for display adapters.
|
||||||
|
|
||||||
|
config DRM_DISPLAY_DP_HELPER
|
||||||
|
bool
|
||||||
|
depends on DRM_DISPLAY_HELPER
|
||||||
|
help
|
||||||
|
DRM display helpers for DisplayPort.
|
||||||
|
|
||||||
|
config DRM_DISPLAY_HDCP_HELPER
|
||||||
|
bool
|
||||||
|
depends on DRM_DISPLAY_HELPER
|
||||||
|
help
|
||||||
|
DRM display helpers for HDCP.
|
||||||
|
|
||||||
|
config DRM_DISPLAY_HDMI_HELPER
|
||||||
|
bool
|
||||||
|
depends on DRM_DISPLAY_HELPER
|
||||||
|
help
|
||||||
|
DRM display helpers for HDMI.
|
||||||
|
|
||||||
|
config DRM_DP_AUX_CHARDEV
|
||||||
|
bool "DRM DP AUX Interface"
|
||||||
|
depends on DRM
|
||||||
|
help
|
||||||
|
Choose this option to enable a /dev/drm_dp_auxN node that allows to
|
||||||
|
read and write values to arbitrary DPCD registers on the DP aux
|
||||||
|
channel.
|
||||||
|
|
||||||
|
config DRM_DP_CEC
|
||||||
|
bool "Enable DisplayPort CEC-Tunneling-over-AUX HDMI support"
|
||||||
|
depends on DRM
|
||||||
|
select CEC_CORE
|
||||||
|
help
|
||||||
|
Choose this option if you want to enable HDMI CEC support for
|
||||||
|
DisplayPort/USB-C to HDMI adapters.
|
||||||
|
|
||||||
|
Note: not all adapters support this feature, and even for those
|
||||||
|
that do support this they often do not hook up the CEC pin.
|
16
drivers/gpu/drm/display/Makefile
Normal file
16
drivers/gpu/drm/display/Makefile
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
obj-$(CONFIG_DRM_DP_AUX_BUS) += drm_dp_aux_bus.o
|
||||||
|
|
||||||
|
drm_display_helper-y := drm_display_helper_mod.o
|
||||||
|
drm_display_helper-$(CONFIG_DRM_DISPLAY_DP_HELPER) += drm_dp_dual_mode_helper.o \
|
||||||
|
drm_dp_helper.o \
|
||||||
|
drm_dp_mst_topology.o \
|
||||||
|
drm_dsc_helper.o
|
||||||
|
drm_display_helper-$(CONFIG_DRM_DISPLAY_HDCP_HELPER) += drm_hdcp_helper.o
|
||||||
|
drm_display_helper-$(CONFIG_DRM_DISPLAY_HDMI_HELPER) += drm_hdmi_helper.o \
|
||||||
|
drm_scdc_helper.o
|
||||||
|
drm_display_helper-$(CONFIG_DRM_DP_AUX_CHARDEV) += drm_dp_aux_dev.o
|
||||||
|
drm_display_helper-$(CONFIG_DRM_DP_CEC) += drm_dp_cec.o
|
||||||
|
|
||||||
|
obj-$(CONFIG_DRM_DISPLAY_HELPER) += drm_display_helper.o
|
@ -4,19 +4,19 @@
|
|||||||
|
|
||||||
#include "drm_dp_helper_internal.h"
|
#include "drm_dp_helper_internal.h"
|
||||||
|
|
||||||
MODULE_DESCRIPTION("DRM DisplayPort helper");
|
MODULE_DESCRIPTION("DRM display adapter helper");
|
||||||
MODULE_LICENSE("GPL and additional rights");
|
MODULE_LICENSE("GPL and additional rights");
|
||||||
|
|
||||||
static int __init drm_dp_helper_module_init(void)
|
static int __init drm_display_helper_module_init(void)
|
||||||
{
|
{
|
||||||
return drm_dp_aux_dev_init();
|
return drm_dp_aux_dev_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __exit drm_dp_helper_module_exit(void)
|
static void __exit drm_display_helper_module_exit(void)
|
||||||
{
|
{
|
||||||
/* Call exit functions from specific dp helpers here */
|
/* Call exit functions from specific dp helpers here */
|
||||||
drm_dp_aux_dev_exit();
|
drm_dp_aux_dev_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
module_init(drm_dp_helper_module_init);
|
module_init(drm_display_helper_module_init);
|
||||||
module_exit(drm_dp_helper_module_exit);
|
module_exit(drm_display_helper_module_exit);
|
@ -19,8 +19,8 @@
|
|||||||
#include <linux/pm_domain.h>
|
#include <linux/pm_domain.h>
|
||||||
#include <linux/pm_runtime.h>
|
#include <linux/pm_runtime.h>
|
||||||
|
|
||||||
#include <drm/dp/drm_dp_aux_bus.h>
|
#include <drm/display/drm_dp_aux_bus.h>
|
||||||
#include <drm/dp/drm_dp_helper.h>
|
#include <drm/display/drm_dp_helper.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* dp_aux_ep_match() - The match function for the dp_aux_bus.
|
* dp_aux_ep_match() - The match function for the dp_aux_bus.
|
@ -35,9 +35,9 @@
|
|||||||
#include <linux/uaccess.h>
|
#include <linux/uaccess.h>
|
||||||
#include <linux/uio.h>
|
#include <linux/uio.h>
|
||||||
|
|
||||||
|
#include <drm/display/drm_dp_helper.h>
|
||||||
|
#include <drm/display/drm_dp_mst_helper.h>
|
||||||
#include <drm/drm_crtc.h>
|
#include <drm/drm_crtc.h>
|
||||||
#include <drm/dp/drm_dp_helper.h>
|
|
||||||
#include <drm/dp/drm_dp_mst_helper.h>
|
|
||||||
#include <drm/drm_print.h>
|
#include <drm/drm_print.h>
|
||||||
|
|
||||||
#include "drm_dp_helper_internal.h"
|
#include "drm_dp_helper_internal.h"
|
@ -11,9 +11,9 @@
|
|||||||
|
|
||||||
#include <media/cec.h>
|
#include <media/cec.h>
|
||||||
|
|
||||||
|
#include <drm/display/drm_dp_helper.h>
|
||||||
#include <drm/drm_connector.h>
|
#include <drm/drm_connector.h>
|
||||||
#include <drm/drm_device.h>
|
#include <drm/drm_device.h>
|
||||||
#include <drm/dp/drm_dp_helper.h>
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Unfortunately it turns out that we have a chicken-and-egg situation
|
* Unfortunately it turns out that we have a chicken-and-egg situation
|
@ -27,8 +27,8 @@
|
|||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <linux/string.h>
|
#include <linux/string.h>
|
||||||
|
|
||||||
|
#include <drm/display/drm_dp_dual_mode_helper.h>
|
||||||
#include <drm/drm_device.h>
|
#include <drm/drm_device.h>
|
||||||
#include <drm/dp/drm_dp_dual_mode_helper.h>
|
|
||||||
#include <drm/drm_print.h>
|
#include <drm/drm_print.h>
|
||||||
|
|
||||||
/**
|
/**
|
@ -30,10 +30,10 @@
|
|||||||
#include <linux/seq_file.h>
|
#include <linux/seq_file.h>
|
||||||
#include <linux/string_helpers.h>
|
#include <linux/string_helpers.h>
|
||||||
|
|
||||||
#include <drm/dp/drm_dp_helper.h>
|
#include <drm/display/drm_dp_helper.h>
|
||||||
|
#include <drm/display/drm_dp_mst_helper.h>
|
||||||
#include <drm/drm_print.h>
|
#include <drm/drm_print.h>
|
||||||
#include <drm/drm_vblank.h>
|
#include <drm/drm_vblank.h>
|
||||||
#include <drm/dp/drm_dp_mst_helper.h>
|
|
||||||
#include <drm/drm_panel.h>
|
#include <drm/drm_panel.h>
|
||||||
|
|
||||||
#include "drm_dp_helper_internal.h"
|
#include "drm_dp_helper_internal.h"
|
@ -38,7 +38,7 @@
|
|||||||
#include <linux/math64.h>
|
#include <linux/math64.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <drm/dp/drm_dp_mst_helper.h>
|
#include <drm/display/drm_dp_mst_helper.h>
|
||||||
#include <drm/drm_atomic.h>
|
#include <drm/drm_atomic.h>
|
||||||
#include <drm/drm_atomic_helper.h>
|
#include <drm/drm_atomic_helper.h>
|
||||||
#include <drm/drm_drv.h>
|
#include <drm/drm_drv.h>
|
@ -10,7 +10,7 @@
|
|||||||
#ifndef _DRM_DP_MST_HELPER_INTERNAL_H_
|
#ifndef _DRM_DP_MST_HELPER_INTERNAL_H_
|
||||||
#define _DRM_DP_MST_HELPER_INTERNAL_H_
|
#define _DRM_DP_MST_HELPER_INTERNAL_H_
|
||||||
|
|
||||||
#include <drm/dp/drm_dp_mst_helper.h>
|
#include <drm/display/drm_dp_mst_helper.h>
|
||||||
|
|
||||||
void
|
void
|
||||||
drm_dp_encode_sideband_req(const struct drm_dp_sideband_msg_req_body *req,
|
drm_dp_encode_sideband_req(const struct drm_dp_sideband_msg_req_body *req,
|
@ -11,9 +11,10 @@
|
|||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
#include <linux/errno.h>
|
#include <linux/errno.h>
|
||||||
#include <linux/byteorder/generic.h>
|
#include <linux/byteorder/generic.h>
|
||||||
|
|
||||||
|
#include <drm/display/drm_dp_helper.h>
|
||||||
|
#include <drm/display/drm_dsc_helper.h>
|
||||||
#include <drm/drm_print.h>
|
#include <drm/drm_print.h>
|
||||||
#include <drm/dp/drm_dp_helper.h>
|
|
||||||
#include <drm/drm_dsc.h>
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DOC: dsc helpers
|
* DOC: dsc helpers
|
@ -13,7 +13,7 @@
|
|||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <linux/firmware.h>
|
#include <linux/firmware.h>
|
||||||
|
|
||||||
#include <drm/drm_hdcp.h>
|
#include <drm/display/drm_hdcp_helper.h>
|
||||||
#include <drm/drm_sysfs.h>
|
#include <drm/drm_sysfs.h>
|
||||||
#include <drm/drm_print.h>
|
#include <drm/drm_print.h>
|
||||||
#include <drm/drm_device.h>
|
#include <drm/drm_device.h>
|
||||||
@ -21,8 +21,6 @@
|
|||||||
#include <drm/drm_mode_object.h>
|
#include <drm/drm_mode_object.h>
|
||||||
#include <drm/drm_connector.h>
|
#include <drm/drm_connector.h>
|
||||||
|
|
||||||
#include "drm_internal.h"
|
|
||||||
|
|
||||||
static inline void drm_hdcp_print_ksv(const u8 *ksv)
|
static inline void drm_hdcp_print_ksv(const u8 *ksv)
|
||||||
{
|
{
|
||||||
DRM_DEBUG("\t%#02x, %#02x, %#02x, %#02x, %#02x\n",
|
DRM_DEBUG("\t%#02x, %#02x, %#02x, %#02x, %#02x\n",
|
199
drivers/gpu/drm/display/drm_hdmi_helper.c
Normal file
199
drivers/gpu/drm/display/drm_hdmi_helper.c
Normal file
@ -0,0 +1,199 @@
|
|||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
#include <linux/module.h>
|
||||||
|
|
||||||
|
#include <drm/display/drm_hdmi_helper.h>
|
||||||
|
#include <drm/drm_connector.h>
|
||||||
|
#include <drm/drm_edid.h>
|
||||||
|
#include <drm/drm_modes.h>
|
||||||
|
#include <drm/drm_print.h>
|
||||||
|
#include <drm/drm_property.h>
|
||||||
|
|
||||||
|
static inline bool is_eotf_supported(u8 output_eotf, u8 sink_eotf)
|
||||||
|
{
|
||||||
|
return sink_eotf & BIT(output_eotf);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* drm_hdmi_infoframe_set_hdr_metadata() - fill an HDMI DRM infoframe with
|
||||||
|
* HDR metadata from userspace
|
||||||
|
* @frame: HDMI DRM infoframe
|
||||||
|
* @conn_state: Connector state containing HDR metadata
|
||||||
|
*
|
||||||
|
* Return: 0 on success or a negative error code on failure.
|
||||||
|
*/
|
||||||
|
int drm_hdmi_infoframe_set_hdr_metadata(struct hdmi_drm_infoframe *frame,
|
||||||
|
const struct drm_connector_state *conn_state)
|
||||||
|
{
|
||||||
|
struct drm_connector *connector;
|
||||||
|
struct hdr_output_metadata *hdr_metadata;
|
||||||
|
int err;
|
||||||
|
|
||||||
|
if (!frame || !conn_state)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
|
connector = conn_state->connector;
|
||||||
|
|
||||||
|
if (!conn_state->hdr_output_metadata)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
|
hdr_metadata = conn_state->hdr_output_metadata->data;
|
||||||
|
|
||||||
|
if (!hdr_metadata || !connector)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
|
/* Sink EOTF is Bit map while infoframe is absolute values */
|
||||||
|
if (!is_eotf_supported(hdr_metadata->hdmi_metadata_type1.eotf,
|
||||||
|
connector->hdr_sink_metadata.hdmi_type1.eotf)) {
|
||||||
|
DRM_DEBUG_KMS("EOTF Not Supported\n");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
err = hdmi_drm_infoframe_init(frame);
|
||||||
|
if (err < 0)
|
||||||
|
return err;
|
||||||
|
|
||||||
|
frame->eotf = hdr_metadata->hdmi_metadata_type1.eotf;
|
||||||
|
frame->metadata_type = hdr_metadata->hdmi_metadata_type1.metadata_type;
|
||||||
|
|
||||||
|
BUILD_BUG_ON(sizeof(frame->display_primaries) !=
|
||||||
|
sizeof(hdr_metadata->hdmi_metadata_type1.display_primaries));
|
||||||
|
BUILD_BUG_ON(sizeof(frame->white_point) !=
|
||||||
|
sizeof(hdr_metadata->hdmi_metadata_type1.white_point));
|
||||||
|
|
||||||
|
memcpy(&frame->display_primaries,
|
||||||
|
&hdr_metadata->hdmi_metadata_type1.display_primaries,
|
||||||
|
sizeof(frame->display_primaries));
|
||||||
|
|
||||||
|
memcpy(&frame->white_point,
|
||||||
|
&hdr_metadata->hdmi_metadata_type1.white_point,
|
||||||
|
sizeof(frame->white_point));
|
||||||
|
|
||||||
|
frame->max_display_mastering_luminance =
|
||||||
|
hdr_metadata->hdmi_metadata_type1.max_display_mastering_luminance;
|
||||||
|
frame->min_display_mastering_luminance =
|
||||||
|
hdr_metadata->hdmi_metadata_type1.min_display_mastering_luminance;
|
||||||
|
frame->max_fall = hdr_metadata->hdmi_metadata_type1.max_fall;
|
||||||
|
frame->max_cll = hdr_metadata->hdmi_metadata_type1.max_cll;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL(drm_hdmi_infoframe_set_hdr_metadata);
|
||||||
|
|
||||||
|
/* HDMI Colorspace Spec Definitions */
|
||||||
|
#define FULL_COLORIMETRY_MASK 0x1FF
|
||||||
|
#define NORMAL_COLORIMETRY_MASK 0x3
|
||||||
|
#define EXTENDED_COLORIMETRY_MASK 0x7
|
||||||
|
#define EXTENDED_ACE_COLORIMETRY_MASK 0xF
|
||||||
|
|
||||||
|
#define C(x) ((x) << 0)
|
||||||
|
#define EC(x) ((x) << 2)
|
||||||
|
#define ACE(x) ((x) << 5)
|
||||||
|
|
||||||
|
#define HDMI_COLORIMETRY_NO_DATA 0x0
|
||||||
|
#define HDMI_COLORIMETRY_SMPTE_170M_YCC (C(1) | EC(0) | ACE(0))
|
||||||
|
#define HDMI_COLORIMETRY_BT709_YCC (C(2) | EC(0) | ACE(0))
|
||||||
|
#define HDMI_COLORIMETRY_XVYCC_601 (C(3) | EC(0) | ACE(0))
|
||||||
|
#define HDMI_COLORIMETRY_XVYCC_709 (C(3) | EC(1) | ACE(0))
|
||||||
|
#define HDMI_COLORIMETRY_SYCC_601 (C(3) | EC(2) | ACE(0))
|
||||||
|
#define HDMI_COLORIMETRY_OPYCC_601 (C(3) | EC(3) | ACE(0))
|
||||||
|
#define HDMI_COLORIMETRY_OPRGB (C(3) | EC(4) | ACE(0))
|
||||||
|
#define HDMI_COLORIMETRY_BT2020_CYCC (C(3) | EC(5) | ACE(0))
|
||||||
|
#define HDMI_COLORIMETRY_BT2020_RGB (C(3) | EC(6) | ACE(0))
|
||||||
|
#define HDMI_COLORIMETRY_BT2020_YCC (C(3) | EC(6) | ACE(0))
|
||||||
|
#define HDMI_COLORIMETRY_DCI_P3_RGB_D65 (C(3) | EC(7) | ACE(0))
|
||||||
|
#define HDMI_COLORIMETRY_DCI_P3_RGB_THEATER (C(3) | EC(7) | ACE(1))
|
||||||
|
|
||||||
|
static const u32 hdmi_colorimetry_val[] = {
|
||||||
|
[DRM_MODE_COLORIMETRY_NO_DATA] = HDMI_COLORIMETRY_NO_DATA,
|
||||||
|
[DRM_MODE_COLORIMETRY_SMPTE_170M_YCC] = HDMI_COLORIMETRY_SMPTE_170M_YCC,
|
||||||
|
[DRM_MODE_COLORIMETRY_BT709_YCC] = HDMI_COLORIMETRY_BT709_YCC,
|
||||||
|
[DRM_MODE_COLORIMETRY_XVYCC_601] = HDMI_COLORIMETRY_XVYCC_601,
|
||||||
|
[DRM_MODE_COLORIMETRY_XVYCC_709] = HDMI_COLORIMETRY_XVYCC_709,
|
||||||
|
[DRM_MODE_COLORIMETRY_SYCC_601] = HDMI_COLORIMETRY_SYCC_601,
|
||||||
|
[DRM_MODE_COLORIMETRY_OPYCC_601] = HDMI_COLORIMETRY_OPYCC_601,
|
||||||
|
[DRM_MODE_COLORIMETRY_OPRGB] = HDMI_COLORIMETRY_OPRGB,
|
||||||
|
[DRM_MODE_COLORIMETRY_BT2020_CYCC] = HDMI_COLORIMETRY_BT2020_CYCC,
|
||||||
|
[DRM_MODE_COLORIMETRY_BT2020_RGB] = HDMI_COLORIMETRY_BT2020_RGB,
|
||||||
|
[DRM_MODE_COLORIMETRY_BT2020_YCC] = HDMI_COLORIMETRY_BT2020_YCC,
|
||||||
|
};
|
||||||
|
|
||||||
|
#undef C
|
||||||
|
#undef EC
|
||||||
|
#undef ACE
|
||||||
|
|
||||||
|
/**
|
||||||
|
* drm_hdmi_avi_infoframe_colorimetry() - fill the HDMI AVI infoframe
|
||||||
|
* colorimetry information
|
||||||
|
* @frame: HDMI AVI infoframe
|
||||||
|
* @conn_state: connector state
|
||||||
|
*/
|
||||||
|
void drm_hdmi_avi_infoframe_colorimetry(struct hdmi_avi_infoframe *frame,
|
||||||
|
const struct drm_connector_state *conn_state)
|
||||||
|
{
|
||||||
|
u32 colorimetry_val;
|
||||||
|
u32 colorimetry_index = conn_state->colorspace & FULL_COLORIMETRY_MASK;
|
||||||
|
|
||||||
|
if (colorimetry_index >= ARRAY_SIZE(hdmi_colorimetry_val))
|
||||||
|
colorimetry_val = HDMI_COLORIMETRY_NO_DATA;
|
||||||
|
else
|
||||||
|
colorimetry_val = hdmi_colorimetry_val[colorimetry_index];
|
||||||
|
|
||||||
|
frame->colorimetry = colorimetry_val & NORMAL_COLORIMETRY_MASK;
|
||||||
|
/*
|
||||||
|
* ToDo: Extend it for ACE formats as well. Modify the infoframe
|
||||||
|
* structure and extend it in drivers/video/hdmi
|
||||||
|
*/
|
||||||
|
frame->extended_colorimetry = (colorimetry_val >> 2) &
|
||||||
|
EXTENDED_COLORIMETRY_MASK;
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL(drm_hdmi_avi_infoframe_colorimetry);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* drm_hdmi_avi_infoframe_bars() - fill the HDMI AVI infoframe
|
||||||
|
* bar information
|
||||||
|
* @frame: HDMI AVI infoframe
|
||||||
|
* @conn_state: connector state
|
||||||
|
*/
|
||||||
|
void drm_hdmi_avi_infoframe_bars(struct hdmi_avi_infoframe *frame,
|
||||||
|
const struct drm_connector_state *conn_state)
|
||||||
|
{
|
||||||
|
frame->right_bar = conn_state->tv.margins.right;
|
||||||
|
frame->left_bar = conn_state->tv.margins.left;
|
||||||
|
frame->top_bar = conn_state->tv.margins.top;
|
||||||
|
frame->bottom_bar = conn_state->tv.margins.bottom;
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL(drm_hdmi_avi_infoframe_bars);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* drm_hdmi_avi_infoframe_content_type() - fill the HDMI AVI infoframe
|
||||||
|
* content type information, based
|
||||||
|
* on correspondent DRM property.
|
||||||
|
* @frame: HDMI AVI infoframe
|
||||||
|
* @conn_state: DRM display connector state
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void drm_hdmi_avi_infoframe_content_type(struct hdmi_avi_infoframe *frame,
|
||||||
|
const struct drm_connector_state *conn_state)
|
||||||
|
{
|
||||||
|
switch (conn_state->content_type) {
|
||||||
|
case DRM_MODE_CONTENT_TYPE_GRAPHICS:
|
||||||
|
frame->content_type = HDMI_CONTENT_TYPE_GRAPHICS;
|
||||||
|
break;
|
||||||
|
case DRM_MODE_CONTENT_TYPE_CINEMA:
|
||||||
|
frame->content_type = HDMI_CONTENT_TYPE_CINEMA;
|
||||||
|
break;
|
||||||
|
case DRM_MODE_CONTENT_TYPE_GAME:
|
||||||
|
frame->content_type = HDMI_CONTENT_TYPE_GAME;
|
||||||
|
break;
|
||||||
|
case DRM_MODE_CONTENT_TYPE_PHOTO:
|
||||||
|
frame->content_type = HDMI_CONTENT_TYPE_PHOTO;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
/* Graphics is the default(0) */
|
||||||
|
frame->content_type = HDMI_CONTENT_TYPE_GRAPHICS;
|
||||||
|
}
|
||||||
|
|
||||||
|
frame->itc = conn_state->content_type != DRM_MODE_CONTENT_TYPE_NO_DATA;
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL(drm_hdmi_avi_infoframe_content_type);
|
@ -21,11 +21,12 @@
|
|||||||
* DEALINGS IN THE SOFTWARE.
|
* DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <linux/i2c.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <linux/delay.h>
|
#include <linux/delay.h>
|
||||||
|
|
||||||
|
#include <drm/display/drm_scdc_helper.h>
|
||||||
#include <drm/drm_print.h>
|
#include <drm/drm_print.h>
|
||||||
#include <drm/drm_scdc_helper.h>
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DOC: scdc helpers
|
* DOC: scdc helpers
|
@ -1,9 +0,0 @@
|
|||||||
# SPDX-License-Identifier: MIT
|
|
||||||
|
|
||||||
obj-$(CONFIG_DRM_DP_AUX_BUS) += drm_dp_aux_bus.o
|
|
||||||
|
|
||||||
drm_dp_helper-y := drm_dp.o drm_dp_dual_mode_helper.o drm_dp_helper_mod.o drm_dp_mst_topology.o
|
|
||||||
drm_dp_helper-$(CONFIG_DRM_DP_AUX_CHARDEV) += drm_dp_aux_dev.o
|
|
||||||
drm_dp_helper-$(CONFIG_DRM_DP_CEC) += drm_dp_cec.o
|
|
||||||
|
|
||||||
obj-$(CONFIG_DRM_DP_HELPER) += drm_dp_helper.o
|
|
@ -1486,40 +1486,6 @@ int drm_connector_attach_content_type_property(struct drm_connector *connector)
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL(drm_connector_attach_content_type_property);
|
EXPORT_SYMBOL(drm_connector_attach_content_type_property);
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* drm_hdmi_avi_infoframe_content_type() - fill the HDMI AVI infoframe
|
|
||||||
* content type information, based
|
|
||||||
* on correspondent DRM property.
|
|
||||||
* @frame: HDMI AVI infoframe
|
|
||||||
* @conn_state: DRM display connector state
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
void drm_hdmi_avi_infoframe_content_type(struct hdmi_avi_infoframe *frame,
|
|
||||||
const struct drm_connector_state *conn_state)
|
|
||||||
{
|
|
||||||
switch (conn_state->content_type) {
|
|
||||||
case DRM_MODE_CONTENT_TYPE_GRAPHICS:
|
|
||||||
frame->content_type = HDMI_CONTENT_TYPE_GRAPHICS;
|
|
||||||
break;
|
|
||||||
case DRM_MODE_CONTENT_TYPE_CINEMA:
|
|
||||||
frame->content_type = HDMI_CONTENT_TYPE_CINEMA;
|
|
||||||
break;
|
|
||||||
case DRM_MODE_CONTENT_TYPE_GAME:
|
|
||||||
frame->content_type = HDMI_CONTENT_TYPE_GAME;
|
|
||||||
break;
|
|
||||||
case DRM_MODE_CONTENT_TYPE_PHOTO:
|
|
||||||
frame->content_type = HDMI_CONTENT_TYPE_PHOTO;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
/* Graphics is the default(0) */
|
|
||||||
frame->content_type = HDMI_CONTENT_TYPE_GRAPHICS;
|
|
||||||
}
|
|
||||||
|
|
||||||
frame->itc = conn_state->content_type != DRM_MODE_CONTENT_TYPE_NO_DATA;
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL(drm_hdmi_avi_infoframe_content_type);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drm_connector_attach_tv_margin_properties - attach TV connector margin
|
* drm_connector_attach_tv_margin_properties - attach TV connector margin
|
||||||
* properties
|
* properties
|
||||||
|
@ -42,7 +42,6 @@
|
|||||||
#include <drm/drm_edid.h>
|
#include <drm/drm_edid.h>
|
||||||
#include <drm/drm_encoder.h>
|
#include <drm/drm_encoder.h>
|
||||||
#include <drm/drm_print.h>
|
#include <drm/drm_print.h>
|
||||||
#include <drm/drm_scdc_helper.h>
|
|
||||||
|
|
||||||
#include "drm_crtc_internal.h"
|
#include "drm_crtc_internal.h"
|
||||||
|
|
||||||
@ -5883,78 +5882,6 @@ static bool is_hdmi2_sink(const struct drm_connector *connector)
|
|||||||
connector->display_info.color_formats & DRM_COLOR_FORMAT_YCBCR420;
|
connector->display_info.color_formats & DRM_COLOR_FORMAT_YCBCR420;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool is_eotf_supported(u8 output_eotf, u8 sink_eotf)
|
|
||||||
{
|
|
||||||
return sink_eotf & BIT(output_eotf);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* drm_hdmi_infoframe_set_hdr_metadata() - fill an HDMI DRM infoframe with
|
|
||||||
* HDR metadata from userspace
|
|
||||||
* @frame: HDMI DRM infoframe
|
|
||||||
* @conn_state: Connector state containing HDR metadata
|
|
||||||
*
|
|
||||||
* Return: 0 on success or a negative error code on failure.
|
|
||||||
*/
|
|
||||||
int
|
|
||||||
drm_hdmi_infoframe_set_hdr_metadata(struct hdmi_drm_infoframe *frame,
|
|
||||||
const struct drm_connector_state *conn_state)
|
|
||||||
{
|
|
||||||
struct drm_connector *connector;
|
|
||||||
struct hdr_output_metadata *hdr_metadata;
|
|
||||||
int err;
|
|
||||||
|
|
||||||
if (!frame || !conn_state)
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
connector = conn_state->connector;
|
|
||||||
|
|
||||||
if (!conn_state->hdr_output_metadata)
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
hdr_metadata = conn_state->hdr_output_metadata->data;
|
|
||||||
|
|
||||||
if (!hdr_metadata || !connector)
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
/* Sink EOTF is Bit map while infoframe is absolute values */
|
|
||||||
if (!is_eotf_supported(hdr_metadata->hdmi_metadata_type1.eotf,
|
|
||||||
connector->hdr_sink_metadata.hdmi_type1.eotf)) {
|
|
||||||
DRM_DEBUG_KMS("EOTF Not Supported\n");
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
err = hdmi_drm_infoframe_init(frame);
|
|
||||||
if (err < 0)
|
|
||||||
return err;
|
|
||||||
|
|
||||||
frame->eotf = hdr_metadata->hdmi_metadata_type1.eotf;
|
|
||||||
frame->metadata_type = hdr_metadata->hdmi_metadata_type1.metadata_type;
|
|
||||||
|
|
||||||
BUILD_BUG_ON(sizeof(frame->display_primaries) !=
|
|
||||||
sizeof(hdr_metadata->hdmi_metadata_type1.display_primaries));
|
|
||||||
BUILD_BUG_ON(sizeof(frame->white_point) !=
|
|
||||||
sizeof(hdr_metadata->hdmi_metadata_type1.white_point));
|
|
||||||
|
|
||||||
memcpy(&frame->display_primaries,
|
|
||||||
&hdr_metadata->hdmi_metadata_type1.display_primaries,
|
|
||||||
sizeof(frame->display_primaries));
|
|
||||||
|
|
||||||
memcpy(&frame->white_point,
|
|
||||||
&hdr_metadata->hdmi_metadata_type1.white_point,
|
|
||||||
sizeof(frame->white_point));
|
|
||||||
|
|
||||||
frame->max_display_mastering_luminance =
|
|
||||||
hdr_metadata->hdmi_metadata_type1.max_display_mastering_luminance;
|
|
||||||
frame->min_display_mastering_luminance =
|
|
||||||
hdr_metadata->hdmi_metadata_type1.min_display_mastering_luminance;
|
|
||||||
frame->max_fall = hdr_metadata->hdmi_metadata_type1.max_fall;
|
|
||||||
frame->max_cll = hdr_metadata->hdmi_metadata_type1.max_cll;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL(drm_hdmi_infoframe_set_hdr_metadata);
|
|
||||||
|
|
||||||
static u8 drm_mode_hdmi_vic(const struct drm_connector *connector,
|
static u8 drm_mode_hdmi_vic(const struct drm_connector *connector,
|
||||||
const struct drm_display_mode *mode)
|
const struct drm_display_mode *mode)
|
||||||
{
|
{
|
||||||
@ -6076,76 +6003,6 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL(drm_hdmi_avi_infoframe_from_display_mode);
|
EXPORT_SYMBOL(drm_hdmi_avi_infoframe_from_display_mode);
|
||||||
|
|
||||||
/* HDMI Colorspace Spec Definitions */
|
|
||||||
#define FULL_COLORIMETRY_MASK 0x1FF
|
|
||||||
#define NORMAL_COLORIMETRY_MASK 0x3
|
|
||||||
#define EXTENDED_COLORIMETRY_MASK 0x7
|
|
||||||
#define EXTENDED_ACE_COLORIMETRY_MASK 0xF
|
|
||||||
|
|
||||||
#define C(x) ((x) << 0)
|
|
||||||
#define EC(x) ((x) << 2)
|
|
||||||
#define ACE(x) ((x) << 5)
|
|
||||||
|
|
||||||
#define HDMI_COLORIMETRY_NO_DATA 0x0
|
|
||||||
#define HDMI_COLORIMETRY_SMPTE_170M_YCC (C(1) | EC(0) | ACE(0))
|
|
||||||
#define HDMI_COLORIMETRY_BT709_YCC (C(2) | EC(0) | ACE(0))
|
|
||||||
#define HDMI_COLORIMETRY_XVYCC_601 (C(3) | EC(0) | ACE(0))
|
|
||||||
#define HDMI_COLORIMETRY_XVYCC_709 (C(3) | EC(1) | ACE(0))
|
|
||||||
#define HDMI_COLORIMETRY_SYCC_601 (C(3) | EC(2) | ACE(0))
|
|
||||||
#define HDMI_COLORIMETRY_OPYCC_601 (C(3) | EC(3) | ACE(0))
|
|
||||||
#define HDMI_COLORIMETRY_OPRGB (C(3) | EC(4) | ACE(0))
|
|
||||||
#define HDMI_COLORIMETRY_BT2020_CYCC (C(3) | EC(5) | ACE(0))
|
|
||||||
#define HDMI_COLORIMETRY_BT2020_RGB (C(3) | EC(6) | ACE(0))
|
|
||||||
#define HDMI_COLORIMETRY_BT2020_YCC (C(3) | EC(6) | ACE(0))
|
|
||||||
#define HDMI_COLORIMETRY_DCI_P3_RGB_D65 (C(3) | EC(7) | ACE(0))
|
|
||||||
#define HDMI_COLORIMETRY_DCI_P3_RGB_THEATER (C(3) | EC(7) | ACE(1))
|
|
||||||
|
|
||||||
static const u32 hdmi_colorimetry_val[] = {
|
|
||||||
[DRM_MODE_COLORIMETRY_NO_DATA] = HDMI_COLORIMETRY_NO_DATA,
|
|
||||||
[DRM_MODE_COLORIMETRY_SMPTE_170M_YCC] = HDMI_COLORIMETRY_SMPTE_170M_YCC,
|
|
||||||
[DRM_MODE_COLORIMETRY_BT709_YCC] = HDMI_COLORIMETRY_BT709_YCC,
|
|
||||||
[DRM_MODE_COLORIMETRY_XVYCC_601] = HDMI_COLORIMETRY_XVYCC_601,
|
|
||||||
[DRM_MODE_COLORIMETRY_XVYCC_709] = HDMI_COLORIMETRY_XVYCC_709,
|
|
||||||
[DRM_MODE_COLORIMETRY_SYCC_601] = HDMI_COLORIMETRY_SYCC_601,
|
|
||||||
[DRM_MODE_COLORIMETRY_OPYCC_601] = HDMI_COLORIMETRY_OPYCC_601,
|
|
||||||
[DRM_MODE_COLORIMETRY_OPRGB] = HDMI_COLORIMETRY_OPRGB,
|
|
||||||
[DRM_MODE_COLORIMETRY_BT2020_CYCC] = HDMI_COLORIMETRY_BT2020_CYCC,
|
|
||||||
[DRM_MODE_COLORIMETRY_BT2020_RGB] = HDMI_COLORIMETRY_BT2020_RGB,
|
|
||||||
[DRM_MODE_COLORIMETRY_BT2020_YCC] = HDMI_COLORIMETRY_BT2020_YCC,
|
|
||||||
};
|
|
||||||
|
|
||||||
#undef C
|
|
||||||
#undef EC
|
|
||||||
#undef ACE
|
|
||||||
|
|
||||||
/**
|
|
||||||
* drm_hdmi_avi_infoframe_colorimetry() - fill the HDMI AVI infoframe
|
|
||||||
* colorimetry information
|
|
||||||
* @frame: HDMI AVI infoframe
|
|
||||||
* @conn_state: connector state
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
drm_hdmi_avi_infoframe_colorimetry(struct hdmi_avi_infoframe *frame,
|
|
||||||
const struct drm_connector_state *conn_state)
|
|
||||||
{
|
|
||||||
u32 colorimetry_val;
|
|
||||||
u32 colorimetry_index = conn_state->colorspace & FULL_COLORIMETRY_MASK;
|
|
||||||
|
|
||||||
if (colorimetry_index >= ARRAY_SIZE(hdmi_colorimetry_val))
|
|
||||||
colorimetry_val = HDMI_COLORIMETRY_NO_DATA;
|
|
||||||
else
|
|
||||||
colorimetry_val = hdmi_colorimetry_val[colorimetry_index];
|
|
||||||
|
|
||||||
frame->colorimetry = colorimetry_val & NORMAL_COLORIMETRY_MASK;
|
|
||||||
/*
|
|
||||||
* ToDo: Extend it for ACE formats as well. Modify the infoframe
|
|
||||||
* structure and extend it in drivers/video/hdmi
|
|
||||||
*/
|
|
||||||
frame->extended_colorimetry = (colorimetry_val >> 2) &
|
|
||||||
EXTENDED_COLORIMETRY_MASK;
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL(drm_hdmi_avi_infoframe_colorimetry);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drm_hdmi_avi_infoframe_quant_range() - fill the HDMI AVI infoframe
|
* drm_hdmi_avi_infoframe_quant_range() - fill the HDMI AVI infoframe
|
||||||
* quantization range information
|
* quantization range information
|
||||||
@ -6201,23 +6058,6 @@ drm_hdmi_avi_infoframe_quant_range(struct hdmi_avi_infoframe *frame,
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL(drm_hdmi_avi_infoframe_quant_range);
|
EXPORT_SYMBOL(drm_hdmi_avi_infoframe_quant_range);
|
||||||
|
|
||||||
/**
|
|
||||||
* drm_hdmi_avi_infoframe_bars() - fill the HDMI AVI infoframe
|
|
||||||
* bar information
|
|
||||||
* @frame: HDMI AVI infoframe
|
|
||||||
* @conn_state: connector state
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
drm_hdmi_avi_infoframe_bars(struct hdmi_avi_infoframe *frame,
|
|
||||||
const struct drm_connector_state *conn_state)
|
|
||||||
{
|
|
||||||
frame->right_bar = conn_state->tv.margins.right;
|
|
||||||
frame->left_bar = conn_state->tv.margins.left;
|
|
||||||
frame->top_bar = conn_state->tv.margins.top;
|
|
||||||
frame->bottom_bar = conn_state->tv.margins.bottom;
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL(drm_hdmi_avi_infoframe_bars);
|
|
||||||
|
|
||||||
static enum hdmi_3d_structure
|
static enum hdmi_3d_structure
|
||||||
s3d_structure_from_display_mode(const struct drm_display_mode *mode)
|
s3d_structure_from_display_mode(const struct drm_display_mode *mode)
|
||||||
{
|
{
|
||||||
|
@ -411,6 +411,90 @@ void drm_fb_xrgb8888_to_rgb888_toio(void __iomem *dst, unsigned int dst_pitch,
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL(drm_fb_xrgb8888_to_rgb888_toio);
|
EXPORT_SYMBOL(drm_fb_xrgb8888_to_rgb888_toio);
|
||||||
|
|
||||||
|
static void drm_fb_rgb565_to_xrgb8888_line(void *dbuf, const void *sbuf, unsigned int pixels)
|
||||||
|
{
|
||||||
|
u32 *dbuf32 = dbuf;
|
||||||
|
const u16 *sbuf16 = sbuf;
|
||||||
|
unsigned int x;
|
||||||
|
|
||||||
|
for (x = 0; x < pixels; x++, ++sbuf16, ++dbuf32) {
|
||||||
|
u32 val32 = ((*sbuf16 & 0xf800) << 8) |
|
||||||
|
((*sbuf16 & 0x07e0) << 5) |
|
||||||
|
((*sbuf16 & 0x001f) << 3);
|
||||||
|
*dbuf32 = 0xff000000 | val32 |
|
||||||
|
((val32 >> 3) & 0x00070007) |
|
||||||
|
((val32 >> 2) & 0x00000300);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void drm_fb_rgb565_to_xrgb8888_toio(void __iomem *dst, unsigned int dst_pitch,
|
||||||
|
const void *vaddr, const struct drm_framebuffer *fb,
|
||||||
|
const struct drm_rect *clip)
|
||||||
|
{
|
||||||
|
size_t linepixels = drm_rect_width(clip);
|
||||||
|
size_t dst_len = linepixels * 4;
|
||||||
|
unsigned int y, lines = drm_rect_height(clip);
|
||||||
|
void *dbuf;
|
||||||
|
|
||||||
|
if (!dst_pitch)
|
||||||
|
dst_pitch = dst_len;
|
||||||
|
|
||||||
|
dbuf = kmalloc(dst_len, GFP_KERNEL);
|
||||||
|
if (!dbuf)
|
||||||
|
return;
|
||||||
|
|
||||||
|
vaddr += clip_offset(clip, fb->pitches[0], 2);
|
||||||
|
for (y = 0; y < lines; y++) {
|
||||||
|
drm_fb_rgb565_to_xrgb8888_line(dbuf, vaddr, linepixels);
|
||||||
|
memcpy_toio(dst, dbuf, dst_len);
|
||||||
|
vaddr += fb->pitches[0];
|
||||||
|
dst += dst_pitch;
|
||||||
|
}
|
||||||
|
|
||||||
|
kfree(dbuf);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void drm_fb_rgb888_to_xrgb8888_line(void *dbuf, const void *sbuf, unsigned int pixels)
|
||||||
|
{
|
||||||
|
u32 *dbuf32 = dbuf;
|
||||||
|
const u8 *sbuf8 = sbuf;
|
||||||
|
unsigned int x;
|
||||||
|
|
||||||
|
for (x = 0; x < pixels; x++) {
|
||||||
|
u8 r = *sbuf8++;
|
||||||
|
u8 g = *sbuf8++;
|
||||||
|
u8 b = *sbuf8++;
|
||||||
|
*dbuf32++ = 0xff000000 | (r << 16) | (g << 8) | b;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void drm_fb_rgb888_to_xrgb8888_toio(void __iomem *dst, unsigned int dst_pitch,
|
||||||
|
const void *vaddr, const struct drm_framebuffer *fb,
|
||||||
|
const struct drm_rect *clip)
|
||||||
|
{
|
||||||
|
size_t linepixels = drm_rect_width(clip);
|
||||||
|
size_t dst_len = linepixels * 4;
|
||||||
|
unsigned int y, lines = drm_rect_height(clip);
|
||||||
|
void *dbuf;
|
||||||
|
|
||||||
|
if (!dst_pitch)
|
||||||
|
dst_pitch = dst_len;
|
||||||
|
|
||||||
|
dbuf = kmalloc(dst_len, GFP_KERNEL);
|
||||||
|
if (!dbuf)
|
||||||
|
return;
|
||||||
|
|
||||||
|
vaddr += clip_offset(clip, fb->pitches[0], 3);
|
||||||
|
for (y = 0; y < lines; y++) {
|
||||||
|
drm_fb_rgb888_to_xrgb8888_line(dbuf, vaddr, linepixels);
|
||||||
|
memcpy_toio(dst, dbuf, dst_len);
|
||||||
|
vaddr += fb->pitches[0];
|
||||||
|
dst += dst_pitch;
|
||||||
|
}
|
||||||
|
|
||||||
|
kfree(dbuf);
|
||||||
|
}
|
||||||
|
|
||||||
static void drm_fb_xrgb8888_to_xrgb2101010_line(u32 *dbuf, const u32 *sbuf,
|
static void drm_fb_xrgb8888_to_xrgb2101010_line(u32 *dbuf, const u32 *sbuf,
|
||||||
unsigned int pixels)
|
unsigned int pixels)
|
||||||
{
|
{
|
||||||
@ -583,6 +667,14 @@ int drm_fb_blit_toio(void __iomem *dst, unsigned int dst_pitch, uint32_t dst_for
|
|||||||
drm_fb_xrgb8888_to_rgb888_toio(dst, dst_pitch, vmap, fb, clip);
|
drm_fb_xrgb8888_to_rgb888_toio(dst, dst_pitch, vmap, fb, clip);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
} else if (dst_format == DRM_FORMAT_XRGB8888) {
|
||||||
|
if (fb_format == DRM_FORMAT_RGB888) {
|
||||||
|
drm_fb_rgb888_to_xrgb8888_toio(dst, dst_pitch, vmap, fb, clip);
|
||||||
|
return 0;
|
||||||
|
} else if (fb_format == DRM_FORMAT_RGB565) {
|
||||||
|
drm_fb_rgb565_to_xrgb8888_toio(dst, dst_pitch, vmap, fb, clip);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
} else if (dst_format == DRM_FORMAT_XRGB2101010) {
|
} else if (dst_format == DRM_FORMAT_XRGB2101010) {
|
||||||
if (fb_format == DRM_FORMAT_XRGB8888) {
|
if (fb_format == DRM_FORMAT_XRGB8888) {
|
||||||
drm_fb_xrgb8888_to_xrgb2101010_toio(dst, dst_pitch, vmap, fb, clip);
|
drm_fb_xrgb8888_to_xrgb2101010_toio(dst, dst_pitch, vmap, fb, clip);
|
||||||
@ -590,6 +682,9 @@ int drm_fb_blit_toio(void __iomem *dst, unsigned int dst_pitch, uint32_t dst_for
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
drm_warn_once(fb->dev, "No conversion helper from %p4cc to %p4cc found.\n",
|
||||||
|
&fb_format, &dst_format);
|
||||||
|
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(drm_fb_blit_toio);
|
EXPORT_SYMBOL(drm_fb_blit_toio);
|
||||||
|
@ -25,16 +25,16 @@
|
|||||||
* USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <drm/drm_mipi_dsi.h>
|
|
||||||
|
|
||||||
#include <linux/device.h>
|
#include <linux/device.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/of_device.h>
|
#include <linux/of_device.h>
|
||||||
#include <linux/pm_runtime.h>
|
#include <linux/pm_runtime.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
|
|
||||||
#include <drm/drm_dsc.h>
|
#include <drm/display/drm_dsc.h>
|
||||||
|
#include <drm/drm_mipi_dsi.h>
|
||||||
#include <drm/drm_print.h>
|
#include <drm/drm_print.h>
|
||||||
|
|
||||||
#include <video/mipi_display.h>
|
#include <video/mipi_display.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -735,8 +735,8 @@ EXPORT_SYMBOL_GPL(of_get_drm_display_mode);
|
|||||||
* @dmode: will be set to the return value
|
* @dmode: will be set to the return value
|
||||||
* @bus_flags: information about pixelclk, sync and DE polarity
|
* @bus_flags: information about pixelclk, sync and DE polarity
|
||||||
*
|
*
|
||||||
* The Device Tree properties width-mm and height-mm will be read and set on
|
* The mandatory Device Tree properties width-mm and height-mm
|
||||||
* the display mode if they are present.
|
* are read and set on the display mode.
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* Zero on success, negative error code on failure.
|
* Zero on success, negative error code on failure.
|
||||||
@ -761,11 +761,11 @@ int of_get_drm_panel_display_mode(struct device_node *np,
|
|||||||
drm_bus_flags_from_videomode(&vm, bus_flags);
|
drm_bus_flags_from_videomode(&vm, bus_flags);
|
||||||
|
|
||||||
ret = of_property_read_u32(np, "width-mm", &width_mm);
|
ret = of_property_read_u32(np, "width-mm", &width_mm);
|
||||||
if (ret && ret != -EINVAL)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
ret = of_property_read_u32(np, "height-mm", &height_mm);
|
ret = of_property_read_u32(np, "height-mm", &height_mm);
|
||||||
if (ret && ret != -EINVAL)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
dmode->width_mm = width_mm;
|
dmode->width_mm = width_mm;
|
||||||
|
@ -4,6 +4,7 @@ config DRM_EXYNOS
|
|||||||
depends on OF && DRM && COMMON_CLK
|
depends on OF && DRM && COMMON_CLK
|
||||||
depends on ARCH_S3C64XX || ARCH_S5PV210 || ARCH_EXYNOS || ARCH_MULTIPLATFORM || COMPILE_TEST
|
depends on ARCH_S3C64XX || ARCH_S5PV210 || ARCH_EXYNOS || ARCH_MULTIPLATFORM || COMPILE_TEST
|
||||||
depends on MMU
|
depends on MMU
|
||||||
|
select DRM_DISPLAY_HELPER if DRM_EXYNOS_DP
|
||||||
select DRM_KMS_HELPER
|
select DRM_KMS_HELPER
|
||||||
select VIDEOMODE_HELPERS
|
select VIDEOMODE_HELPERS
|
||||||
select SND_SOC_HDMI_CODEC if SND_SOC
|
select SND_SOC_HDMI_CODEC if SND_SOC
|
||||||
@ -66,7 +67,7 @@ config DRM_EXYNOS_DP
|
|||||||
bool "Exynos specific extensions for Analogix DP driver"
|
bool "Exynos specific extensions for Analogix DP driver"
|
||||||
depends on DRM_EXYNOS_FIMD || DRM_EXYNOS7_DECON
|
depends on DRM_EXYNOS_FIMD || DRM_EXYNOS7_DECON
|
||||||
select DRM_ANALOGIX_DP
|
select DRM_ANALOGIX_DP
|
||||||
select DRM_DP_HELPER
|
select DRM_DISPLAY_DP_HELPER
|
||||||
default DRM_EXYNOS
|
default DRM_EXYNOS
|
||||||
select DRM_PANEL
|
select DRM_PANEL
|
||||||
help
|
help
|
||||||
|
@ -29,9 +29,9 @@
|
|||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
|
|
||||||
|
#include <drm/display/drm_dp_helper.h>
|
||||||
#include <drm/drm_crtc.h>
|
#include <drm/drm_crtc.h>
|
||||||
#include <drm/drm_crtc_helper.h>
|
#include <drm/drm_crtc_helper.h>
|
||||||
#include <drm/dp/drm_dp_helper.h>
|
|
||||||
#include <drm/drm_simple_kms_helper.h>
|
#include <drm/drm_simple_kms_helper.h>
|
||||||
|
|
||||||
#include "gma_display.h"
|
#include "gma_display.h"
|
||||||
|
@ -5,8 +5,9 @@
|
|||||||
* Authors:
|
* Authors:
|
||||||
* Eric Anholt <eric@anholt.net>
|
* Eric Anholt <eric@anholt.net>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <drm/display/drm_dp_helper.h>
|
||||||
#include <drm/drm.h>
|
#include <drm/drm.h>
|
||||||
#include <drm/dp/drm_dp_helper.h>
|
|
||||||
|
|
||||||
#include "intel_bios.h"
|
#include "intel_bios.h"
|
||||||
#include "psb_drv.h"
|
#include "psb_drv.h"
|
||||||
|
@ -10,7 +10,10 @@ config DRM_I915
|
|||||||
# the shmem_readpage() which depends upon tmpfs
|
# the shmem_readpage() which depends upon tmpfs
|
||||||
select SHMEM
|
select SHMEM
|
||||||
select TMPFS
|
select TMPFS
|
||||||
select DRM_DP_HELPER
|
select DRM_DISPLAY_DP_HELPER
|
||||||
|
select DRM_DISPLAY_HDCP_HELPER
|
||||||
|
select DRM_DISPLAY_HDMI_HELPER
|
||||||
|
select DRM_DISPLAY_HELPER
|
||||||
select DRM_KMS_HELPER
|
select DRM_KMS_HELPER
|
||||||
select DRM_PANEL
|
select DRM_PANEL
|
||||||
select DRM_MIPI_DSI
|
select DRM_MIPI_DSI
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
* Jani Nikula <jani.nikula@intel.com>
|
* Jani Nikula <jani.nikula@intel.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <drm/display/drm_dsc_helper.h>
|
||||||
#include <drm/drm_atomic_helper.h>
|
#include <drm/drm_atomic_helper.h>
|
||||||
#include <drm/drm_mipi_dsi.h>
|
#include <drm/drm_mipi_dsi.h>
|
||||||
|
|
||||||
|
@ -25,7 +25,8 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <drm/dp/drm_dp_helper.h>
|
#include <drm/display/drm_dp_helper.h>
|
||||||
|
#include <drm/display/drm_dsc_helper.h>
|
||||||
|
|
||||||
#include "display/intel_display.h"
|
#include "display/intel_display.h"
|
||||||
#include "display/intel_display_types.h"
|
#include "display/intel_display_types.h"
|
||||||
|
@ -27,8 +27,8 @@
|
|||||||
|
|
||||||
#include <linux/string_helpers.h>
|
#include <linux/string_helpers.h>
|
||||||
|
|
||||||
|
#include <drm/display/drm_scdc_helper.h>
|
||||||
#include <drm/drm_privacy_screen_consumer.h>
|
#include <drm/drm_privacy_screen_consumer.h>
|
||||||
#include <drm/drm_scdc_helper.h>
|
|
||||||
|
|
||||||
#include "i915_drv.h"
|
#include "i915_drv.h"
|
||||||
#include "intel_audio.h"
|
#include "intel_audio.h"
|
||||||
|
@ -35,11 +35,11 @@
|
|||||||
#include <linux/string_helpers.h>
|
#include <linux/string_helpers.h>
|
||||||
#include <linux/vga_switcheroo.h>
|
#include <linux/vga_switcheroo.h>
|
||||||
|
|
||||||
|
#include <drm/display/drm_dp_helper.h>
|
||||||
#include <drm/drm_atomic.h>
|
#include <drm/drm_atomic.h>
|
||||||
#include <drm/drm_atomic_helper.h>
|
#include <drm/drm_atomic_helper.h>
|
||||||
#include <drm/drm_atomic_uapi.h>
|
#include <drm/drm_atomic_uapi.h>
|
||||||
#include <drm/drm_damage_helper.h>
|
#include <drm/drm_damage_helper.h>
|
||||||
#include <drm/dp/drm_dp_helper.h>
|
|
||||||
#include <drm/drm_edid.h>
|
#include <drm/drm_edid.h>
|
||||||
#include <drm/drm_fourcc.h>
|
#include <drm/drm_fourcc.h>
|
||||||
#include <drm/drm_plane_helper.h>
|
#include <drm/drm_plane_helper.h>
|
||||||
|
@ -31,11 +31,11 @@
|
|||||||
#include <linux/pwm.h>
|
#include <linux/pwm.h>
|
||||||
#include <linux/sched/clock.h>
|
#include <linux/sched/clock.h>
|
||||||
|
|
||||||
#include <drm/dp/drm_dp_dual_mode_helper.h>
|
#include <drm/display/drm_dp_dual_mode_helper.h>
|
||||||
#include <drm/dp/drm_dp_mst_helper.h>
|
#include <drm/display/drm_dp_mst_helper.h>
|
||||||
|
#include <drm/display/drm_dsc.h>
|
||||||
#include <drm/drm_atomic.h>
|
#include <drm/drm_atomic.h>
|
||||||
#include <drm/drm_crtc.h>
|
#include <drm/drm_crtc.h>
|
||||||
#include <drm/drm_dsc.h>
|
|
||||||
#include <drm/drm_encoder.h>
|
#include <drm/drm_encoder.h>
|
||||||
#include <drm/drm_fourcc.h>
|
#include <drm/drm_fourcc.h>
|
||||||
#include <drm/drm_probe_helper.h>
|
#include <drm/drm_probe_helper.h>
|
||||||
|
@ -35,10 +35,11 @@
|
|||||||
|
|
||||||
#include <asm/byteorder.h>
|
#include <asm/byteorder.h>
|
||||||
|
|
||||||
|
#include <drm/display/drm_dp_helper.h>
|
||||||
|
#include <drm/display/drm_dsc_helper.h>
|
||||||
|
#include <drm/display/drm_hdmi_helper.h>
|
||||||
#include <drm/drm_atomic_helper.h>
|
#include <drm/drm_atomic_helper.h>
|
||||||
#include <drm/drm_crtc.h>
|
#include <drm/drm_crtc.h>
|
||||||
#include <drm/dp/drm_dp_helper.h>
|
|
||||||
#include <drm/drm_edid.h>
|
|
||||||
#include <drm/drm_probe_helper.h>
|
#include <drm/drm_probe_helper.h>
|
||||||
|
|
||||||
#include "g4x_dp.h"
|
#include "g4x_dp.h"
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
* Sean Paul <seanpaul@chromium.org>
|
* Sean Paul <seanpaul@chromium.org>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <drm/dp/drm_dp_helper.h>
|
#include <drm/display/drm_dp_helper.h>
|
||||||
#include <drm/dp/drm_dp_mst_helper.h>
|
#include <drm/display/drm_dp_mst_helper.h>
|
||||||
#include <drm/drm_hdcp.h>
|
#include <drm/display/drm_hdcp_helper.h>
|
||||||
#include <drm/drm_print.h>
|
#include <drm/drm_print.h>
|
||||||
|
|
||||||
#include "intel_ddi.h"
|
#include "intel_ddi.h"
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#ifndef __INTEL_DP_LINK_TRAINING_H__
|
#ifndef __INTEL_DP_LINK_TRAINING_H__
|
||||||
#define __INTEL_DP_LINK_TRAINING_H__
|
#define __INTEL_DP_LINK_TRAINING_H__
|
||||||
|
|
||||||
#include <drm/dp/drm_dp_helper.h>
|
#include <drm/display/drm_dp_helper.h>
|
||||||
|
|
||||||
struct intel_crtc_state;
|
struct intel_crtc_state;
|
||||||
struct intel_dp;
|
struct intel_dp;
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
#include <linux/i2c-algo-bit.h>
|
#include <linux/i2c-algo-bit.h>
|
||||||
#include <linux/i2c.h>
|
#include <linux/i2c.h>
|
||||||
|
|
||||||
#include <drm/drm_hdcp.h>
|
#include <drm/display/drm_hdcp_helper.h>
|
||||||
|
|
||||||
#include "i915_drv.h"
|
#include "i915_drv.h"
|
||||||
#include "intel_de.h"
|
#include "intel_de.h"
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
#include <linux/i2c.h>
|
#include <linux/i2c.h>
|
||||||
#include <linux/random.h>
|
#include <linux/random.h>
|
||||||
|
|
||||||
#include <drm/drm_hdcp.h>
|
#include <drm/display/drm_hdcp_helper.h>
|
||||||
#include <drm/i915_component.h>
|
#include <drm/i915_component.h>
|
||||||
|
|
||||||
#include "i915_drv.h"
|
#include "i915_drv.h"
|
||||||
|
@ -32,11 +32,12 @@
|
|||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <linux/string_helpers.h>
|
#include <linux/string_helpers.h>
|
||||||
|
|
||||||
|
#include <drm/display/drm_hdcp_helper.h>
|
||||||
|
#include <drm/display/drm_hdmi_helper.h>
|
||||||
|
#include <drm/display/drm_scdc_helper.h>
|
||||||
#include <drm/drm_atomic_helper.h>
|
#include <drm/drm_atomic_helper.h>
|
||||||
#include <drm/drm_crtc.h>
|
#include <drm/drm_crtc.h>
|
||||||
#include <drm/drm_edid.h>
|
#include <drm/drm_edid.h>
|
||||||
#include <drm/drm_hdcp.h>
|
|
||||||
#include <drm/drm_scdc_helper.h>
|
|
||||||
#include <drm/intel_lpe_audio.h>
|
#include <drm/intel_lpe_audio.h>
|
||||||
|
|
||||||
#include "i915_debugfs.h"
|
#include "i915_debugfs.h"
|
||||||
|
@ -23,9 +23,9 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <drm/display/drm_dp_dual_mode_helper.h>
|
||||||
|
#include <drm/display/drm_hdmi_helper.h>
|
||||||
#include <drm/drm_atomic_helper.h>
|
#include <drm/drm_atomic_helper.h>
|
||||||
#include <drm/dp/drm_dp_dual_mode_helper.h>
|
|
||||||
#include <drm/drm_edid.h>
|
|
||||||
|
|
||||||
#include "intel_de.h"
|
#include "intel_de.h"
|
||||||
#include "intel_display_types.h"
|
#include "intel_display_types.h"
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* Copyright © 2021 Intel Corporation
|
* Copyright © 2021 Intel Corporation
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <drm/drm_dsc.h>
|
#include <drm/display/drm_dsc.h>
|
||||||
|
|
||||||
#include "i915_utils.h"
|
#include "i915_utils.h"
|
||||||
#include "intel_qp_tables.h"
|
#include "intel_qp_tables.h"
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
#include <linux/i2c.h>
|
#include <linux/i2c.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
|
|
||||||
|
#include <drm/display/drm_hdmi_helper.h>
|
||||||
#include <drm/drm_atomic_helper.h>
|
#include <drm/drm_atomic_helper.h>
|
||||||
#include <drm/drm_crtc.h>
|
#include <drm/drm_crtc.h>
|
||||||
#include <drm/drm_edid.h>
|
#include <drm/drm_edid.h>
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
*/
|
*/
|
||||||
#include <linux/limits.h>
|
#include <linux/limits.h>
|
||||||
|
|
||||||
|
#include <drm/display/drm_dsc_helper.h>
|
||||||
|
|
||||||
#include "i915_drv.h"
|
#include "i915_drv.h"
|
||||||
#include "intel_crtc.h"
|
#include "intel_crtc.h"
|
||||||
#include "intel_de.h"
|
#include "intel_de.h"
|
||||||
|
@ -12,7 +12,8 @@ config DRM_MSM
|
|||||||
select IOMMU_IO_PGTABLE
|
select IOMMU_IO_PGTABLE
|
||||||
select QCOM_MDT_LOADER if ARCH_QCOM
|
select QCOM_MDT_LOADER if ARCH_QCOM
|
||||||
select REGULATOR
|
select REGULATOR
|
||||||
select DRM_DP_HELPER
|
select DRM_DISPLAY_DP_HELPER
|
||||||
|
select DRM_DISPLAY_HELPER
|
||||||
select DRM_KMS_HELPER
|
select DRM_KMS_HELPER
|
||||||
select DRM_PANEL
|
select DRM_PANEL
|
||||||
select DRM_BRIDGE
|
select DRM_BRIDGE
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
#include <linux/of_platform.h>
|
#include <linux/of_platform.h>
|
||||||
|
|
||||||
#include <drm/dp/drm_dp_helper.h>
|
#include <drm/display/drm_dp_helper.h>
|
||||||
#include <drm/drm_edid.h>
|
#include <drm/drm_edid.h>
|
||||||
|
|
||||||
#include "dp_catalog.h"
|
#include "dp_catalog.h"
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#define _DP_AUX_H_
|
#define _DP_AUX_H_
|
||||||
|
|
||||||
#include "dp_catalog.h"
|
#include "dp_catalog.h"
|
||||||
#include <drm/dp/drm_dp_helper.h>
|
#include <drm/display/drm_dp_helper.h>
|
||||||
|
|
||||||
int dp_aux_register(struct drm_dp_aux *dp_aux);
|
int dp_aux_register(struct drm_dp_aux *dp_aux);
|
||||||
void dp_aux_unregister(struct drm_dp_aux *dp_aux);
|
void dp_aux_unregister(struct drm_dp_aux *dp_aux);
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
#include <linux/phy/phy.h>
|
#include <linux/phy/phy.h>
|
||||||
#include <linux/phy/phy-dp.h>
|
#include <linux/phy/phy-dp.h>
|
||||||
#include <linux/rational.h>
|
#include <linux/rational.h>
|
||||||
#include <drm/dp/drm_dp_helper.h>
|
#include <drm/display/drm_dp_helper.h>
|
||||||
#include <drm/drm_print.h>
|
#include <drm/drm_print.h>
|
||||||
|
|
||||||
#include "dp_catalog.h"
|
#include "dp_catalog.h"
|
||||||
|
@ -11,8 +11,9 @@
|
|||||||
#include <linux/phy/phy.h>
|
#include <linux/phy/phy.h>
|
||||||
#include <linux/phy/phy-dp.h>
|
#include <linux/phy/phy-dp.h>
|
||||||
#include <linux/pm_opp.h>
|
#include <linux/pm_opp.h>
|
||||||
|
|
||||||
|
#include <drm/display/drm_dp_helper.h>
|
||||||
#include <drm/drm_fixed.h>
|
#include <drm/drm_fixed.h>
|
||||||
#include <drm/dp/drm_dp_helper.h>
|
|
||||||
#include <drm/drm_print.h>
|
#include <drm/drm_print.h>
|
||||||
|
|
||||||
#include "dp_reg.h"
|
#include "dp_reg.h"
|
||||||
|
@ -10,7 +10,8 @@
|
|||||||
#include <linux/interrupt.h>
|
#include <linux/interrupt.h>
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/platform_device.h>
|
#include <linux/platform_device.h>
|
||||||
#include <drm/dp/drm_dp_helper.h>
|
|
||||||
|
#include <drm/display/drm_dp_helper.h>
|
||||||
#include <drm/drm_bridge.h>
|
#include <drm/drm_bridge.h>
|
||||||
#include <drm/drm_crtc.h>
|
#include <drm/drm_crtc.h>
|
||||||
|
|
||||||
|
@ -6,7 +6,8 @@
|
|||||||
#include <linux/clk.h>
|
#include <linux/clk.h>
|
||||||
#include <linux/gpio/consumer.h>
|
#include <linux/gpio/consumer.h>
|
||||||
#include <linux/regulator/consumer.h>
|
#include <linux/regulator/consumer.h>
|
||||||
#include <drm/dp/drm_dp_helper.h>
|
|
||||||
|
#include <drm/display/drm_dp_helper.h>
|
||||||
#include <drm/drm_crtc.h>
|
#include <drm/drm_crtc.h>
|
||||||
#include <drm/drm_edid.h>
|
#include <drm/drm_edid.h>
|
||||||
|
|
||||||
|
@ -96,6 +96,57 @@ static void mxsfb_set_formats(struct mxsfb_drm_private *mxsfb,
|
|||||||
writel(ctrl, mxsfb->base + LCDC_CTRL);
|
writel(ctrl, mxsfb->base + LCDC_CTRL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void mxsfb_set_mode(struct mxsfb_drm_private *mxsfb, u32 bus_flags)
|
||||||
|
{
|
||||||
|
struct drm_display_mode *m = &mxsfb->crtc.state->adjusted_mode;
|
||||||
|
u32 vdctrl0, vsync_pulse_len, hsync_pulse_len;
|
||||||
|
|
||||||
|
writel(TRANSFER_COUNT_SET_VCOUNT(m->crtc_vdisplay) |
|
||||||
|
TRANSFER_COUNT_SET_HCOUNT(m->crtc_hdisplay),
|
||||||
|
mxsfb->base + mxsfb->devdata->transfer_count);
|
||||||
|
|
||||||
|
vsync_pulse_len = m->crtc_vsync_end - m->crtc_vsync_start;
|
||||||
|
|
||||||
|
vdctrl0 = VDCTRL0_ENABLE_PRESENT | /* Always in DOTCLOCK mode */
|
||||||
|
VDCTRL0_VSYNC_PERIOD_UNIT |
|
||||||
|
VDCTRL0_VSYNC_PULSE_WIDTH_UNIT |
|
||||||
|
VDCTRL0_SET_VSYNC_PULSE_WIDTH(vsync_pulse_len);
|
||||||
|
if (m->flags & DRM_MODE_FLAG_PHSYNC)
|
||||||
|
vdctrl0 |= VDCTRL0_HSYNC_ACT_HIGH;
|
||||||
|
if (m->flags & DRM_MODE_FLAG_PVSYNC)
|
||||||
|
vdctrl0 |= VDCTRL0_VSYNC_ACT_HIGH;
|
||||||
|
/* Make sure Data Enable is high active by default */
|
||||||
|
if (!(bus_flags & DRM_BUS_FLAG_DE_LOW))
|
||||||
|
vdctrl0 |= VDCTRL0_ENABLE_ACT_HIGH;
|
||||||
|
/*
|
||||||
|
* DRM_BUS_FLAG_PIXDATA_DRIVE_ defines are controller centric,
|
||||||
|
* controllers VDCTRL0_DOTCLK is display centric.
|
||||||
|
* Drive on positive edge -> display samples on falling edge
|
||||||
|
* DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE -> VDCTRL0_DOTCLK_ACT_FALLING
|
||||||
|
*/
|
||||||
|
if (bus_flags & DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE)
|
||||||
|
vdctrl0 |= VDCTRL0_DOTCLK_ACT_FALLING;
|
||||||
|
|
||||||
|
writel(vdctrl0, mxsfb->base + LCDC_VDCTRL0);
|
||||||
|
|
||||||
|
/* Frame length in lines. */
|
||||||
|
writel(m->crtc_vtotal, mxsfb->base + LCDC_VDCTRL1);
|
||||||
|
|
||||||
|
/* Line length in units of clocks or pixels. */
|
||||||
|
hsync_pulse_len = m->crtc_hsync_end - m->crtc_hsync_start;
|
||||||
|
writel(set_hsync_pulse_width(mxsfb, hsync_pulse_len) |
|
||||||
|
VDCTRL2_SET_HSYNC_PERIOD(m->crtc_htotal),
|
||||||
|
mxsfb->base + LCDC_VDCTRL2);
|
||||||
|
|
||||||
|
writel(SET_HOR_WAIT_CNT(m->crtc_htotal - m->crtc_hsync_start) |
|
||||||
|
SET_VERT_WAIT_CNT(m->crtc_vtotal - m->crtc_vsync_start),
|
||||||
|
mxsfb->base + LCDC_VDCTRL3);
|
||||||
|
|
||||||
|
writel(SET_DOTCLK_H_VALID_DATA_CNT(m->hdisplay),
|
||||||
|
mxsfb->base + LCDC_VDCTRL4);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
static void mxsfb_enable_controller(struct mxsfb_drm_private *mxsfb)
|
static void mxsfb_enable_controller(struct mxsfb_drm_private *mxsfb)
|
||||||
{
|
{
|
||||||
u32 reg;
|
u32 reg;
|
||||||
@ -191,6 +242,12 @@ static int mxsfb_reset_block(struct mxsfb_drm_private *mxsfb)
|
|||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* It seems, you can't re-program the controller if it is still
|
||||||
|
* running. This may lead to shifted pictures (FIFO issue?), so
|
||||||
|
* first stop the controller and drain its FIFOs.
|
||||||
|
*/
|
||||||
|
|
||||||
ret = clear_poll_bit(mxsfb->base + LCDC_CTRL, CTRL_SFTRST);
|
ret = clear_poll_bit(mxsfb->base + LCDC_CTRL, CTRL_SFTRST);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
@ -201,43 +258,9 @@ static int mxsfb_reset_block(struct mxsfb_drm_private *mxsfb)
|
|||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
return clear_poll_bit(mxsfb->base + LCDC_CTRL, CTRL_CLKGATE);
|
ret = clear_poll_bit(mxsfb->base + LCDC_CTRL, CTRL_CLKGATE);
|
||||||
}
|
if (ret)
|
||||||
|
return ret;
|
||||||
static dma_addr_t mxsfb_get_fb_paddr(struct drm_plane *plane)
|
|
||||||
{
|
|
||||||
struct drm_framebuffer *fb = plane->state->fb;
|
|
||||||
struct drm_gem_cma_object *gem;
|
|
||||||
|
|
||||||
if (!fb)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
gem = drm_fb_cma_get_gem_obj(fb, 0);
|
|
||||||
if (!gem)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
return gem->paddr;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void mxsfb_crtc_mode_set_nofb(struct mxsfb_drm_private *mxsfb,
|
|
||||||
const u32 bus_format)
|
|
||||||
{
|
|
||||||
struct drm_device *drm = mxsfb->crtc.dev;
|
|
||||||
struct drm_display_mode *m = &mxsfb->crtc.state->adjusted_mode;
|
|
||||||
u32 bus_flags = mxsfb->connector->display_info.bus_flags;
|
|
||||||
u32 vdctrl0, vsync_pulse_len, hsync_pulse_len;
|
|
||||||
int err;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* It seems, you can't re-program the controller if it is still
|
|
||||||
* running. This may lead to shifted pictures (FIFO issue?), so
|
|
||||||
* first stop the controller and drain its FIFOs.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Mandatory eLCDIF reset as per the Reference Manual */
|
|
||||||
err = mxsfb_reset_block(mxsfb);
|
|
||||||
if (err)
|
|
||||||
return;
|
|
||||||
|
|
||||||
/* Clear the FIFOs */
|
/* Clear the FIFOs */
|
||||||
writel(CTRL1_FIFO_CLEAR, mxsfb->base + LCDC_CTRL1 + REG_SET);
|
writel(CTRL1_FIFO_CLEAR, mxsfb->base + LCDC_CTRL1 + REG_SET);
|
||||||
@ -248,12 +271,22 @@ static void mxsfb_crtc_mode_set_nofb(struct mxsfb_drm_private *mxsfb,
|
|||||||
if (mxsfb->devdata->has_overlay)
|
if (mxsfb->devdata->has_overlay)
|
||||||
writel(0, mxsfb->base + LCDC_AS_CTRL);
|
writel(0, mxsfb->base + LCDC_AS_CTRL);
|
||||||
|
|
||||||
mxsfb_set_formats(mxsfb, bus_format);
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
clk_set_rate(mxsfb->clk, m->crtc_clock * 1000);
|
static void mxsfb_crtc_mode_set_nofb(struct mxsfb_drm_private *mxsfb,
|
||||||
|
struct drm_bridge_state *bridge_state,
|
||||||
|
const u32 bus_format)
|
||||||
|
{
|
||||||
|
struct drm_device *drm = mxsfb->crtc.dev;
|
||||||
|
struct drm_display_mode *m = &mxsfb->crtc.state->adjusted_mode;
|
||||||
|
u32 bus_flags = mxsfb->connector->display_info.bus_flags;
|
||||||
|
int err;
|
||||||
|
|
||||||
if (mxsfb->bridge && mxsfb->bridge->timings)
|
if (mxsfb->bridge && mxsfb->bridge->timings)
|
||||||
bus_flags = mxsfb->bridge->timings->input_bus_flags;
|
bus_flags = mxsfb->bridge->timings->input_bus_flags;
|
||||||
|
else if (bridge_state)
|
||||||
|
bus_flags = bridge_state->input_bus_cfg.flags;
|
||||||
|
|
||||||
DRM_DEV_DEBUG_DRIVER(drm->dev, "Pixel clock: %dkHz (actual: %dkHz)\n",
|
DRM_DEV_DEBUG_DRIVER(drm->dev, "Pixel clock: %dkHz (actual: %dkHz)\n",
|
||||||
m->crtc_clock,
|
m->crtc_clock,
|
||||||
@ -262,49 +295,16 @@ static void mxsfb_crtc_mode_set_nofb(struct mxsfb_drm_private *mxsfb,
|
|||||||
bus_flags);
|
bus_flags);
|
||||||
DRM_DEV_DEBUG_DRIVER(drm->dev, "Mode flags: 0x%08X\n", m->flags);
|
DRM_DEV_DEBUG_DRIVER(drm->dev, "Mode flags: 0x%08X\n", m->flags);
|
||||||
|
|
||||||
writel(TRANSFER_COUNT_SET_VCOUNT(m->crtc_vdisplay) |
|
/* Mandatory eLCDIF reset as per the Reference Manual */
|
||||||
TRANSFER_COUNT_SET_HCOUNT(m->crtc_hdisplay),
|
err = mxsfb_reset_block(mxsfb);
|
||||||
mxsfb->base + mxsfb->devdata->transfer_count);
|
if (err)
|
||||||
|
return;
|
||||||
|
|
||||||
vsync_pulse_len = m->crtc_vsync_end - m->crtc_vsync_start;
|
mxsfb_set_formats(mxsfb, bus_format);
|
||||||
|
|
||||||
vdctrl0 = VDCTRL0_ENABLE_PRESENT | /* Always in DOTCLOCK mode */
|
clk_set_rate(mxsfb->clk, m->crtc_clock * 1000);
|
||||||
VDCTRL0_VSYNC_PERIOD_UNIT |
|
|
||||||
VDCTRL0_VSYNC_PULSE_WIDTH_UNIT |
|
|
||||||
VDCTRL0_SET_VSYNC_PULSE_WIDTH(vsync_pulse_len);
|
|
||||||
if (m->flags & DRM_MODE_FLAG_PHSYNC)
|
|
||||||
vdctrl0 |= VDCTRL0_HSYNC_ACT_HIGH;
|
|
||||||
if (m->flags & DRM_MODE_FLAG_PVSYNC)
|
|
||||||
vdctrl0 |= VDCTRL0_VSYNC_ACT_HIGH;
|
|
||||||
/* Make sure Data Enable is high active by default */
|
|
||||||
if (!(bus_flags & DRM_BUS_FLAG_DE_LOW))
|
|
||||||
vdctrl0 |= VDCTRL0_ENABLE_ACT_HIGH;
|
|
||||||
/*
|
|
||||||
* DRM_BUS_FLAG_PIXDATA_DRIVE_ defines are controller centric,
|
|
||||||
* controllers VDCTRL0_DOTCLK is display centric.
|
|
||||||
* Drive on positive edge -> display samples on falling edge
|
|
||||||
* DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE -> VDCTRL0_DOTCLK_ACT_FALLING
|
|
||||||
*/
|
|
||||||
if (bus_flags & DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE)
|
|
||||||
vdctrl0 |= VDCTRL0_DOTCLK_ACT_FALLING;
|
|
||||||
|
|
||||||
writel(vdctrl0, mxsfb->base + LCDC_VDCTRL0);
|
mxsfb_set_mode(mxsfb, bus_flags);
|
||||||
|
|
||||||
/* Frame length in lines. */
|
|
||||||
writel(m->crtc_vtotal, mxsfb->base + LCDC_VDCTRL1);
|
|
||||||
|
|
||||||
/* Line length in units of clocks or pixels. */
|
|
||||||
hsync_pulse_len = m->crtc_hsync_end - m->crtc_hsync_start;
|
|
||||||
writel(set_hsync_pulse_width(mxsfb, hsync_pulse_len) |
|
|
||||||
VDCTRL2_SET_HSYNC_PERIOD(m->crtc_htotal),
|
|
||||||
mxsfb->base + LCDC_VDCTRL2);
|
|
||||||
|
|
||||||
writel(SET_HOR_WAIT_CNT(m->crtc_htotal - m->crtc_hsync_start) |
|
|
||||||
SET_VERT_WAIT_CNT(m->crtc_vtotal - m->crtc_vsync_start),
|
|
||||||
mxsfb->base + LCDC_VDCTRL3);
|
|
||||||
|
|
||||||
writel(SET_DOTCLK_H_VALID_DATA_CNT(m->hdisplay),
|
|
||||||
mxsfb->base + LCDC_VDCTRL4);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int mxsfb_crtc_atomic_check(struct drm_crtc *crtc,
|
static int mxsfb_crtc_atomic_check(struct drm_crtc *crtc,
|
||||||
@ -346,7 +346,9 @@ static void mxsfb_crtc_atomic_enable(struct drm_crtc *crtc,
|
|||||||
struct drm_atomic_state *state)
|
struct drm_atomic_state *state)
|
||||||
{
|
{
|
||||||
struct mxsfb_drm_private *mxsfb = to_mxsfb_drm_private(crtc->dev);
|
struct mxsfb_drm_private *mxsfb = to_mxsfb_drm_private(crtc->dev);
|
||||||
struct drm_bridge_state *bridge_state;
|
struct drm_plane_state *new_pstate = drm_atomic_get_new_plane_state(state,
|
||||||
|
crtc->primary);
|
||||||
|
struct drm_bridge_state *bridge_state = NULL;
|
||||||
struct drm_device *drm = mxsfb->drm;
|
struct drm_device *drm = mxsfb->drm;
|
||||||
u32 bus_format = 0;
|
u32 bus_format = 0;
|
||||||
dma_addr_t paddr;
|
dma_addr_t paddr;
|
||||||
@ -382,10 +384,10 @@ static void mxsfb_crtc_atomic_enable(struct drm_crtc *crtc,
|
|||||||
if (!bus_format)
|
if (!bus_format)
|
||||||
bus_format = MEDIA_BUS_FMT_RGB888_1X24;
|
bus_format = MEDIA_BUS_FMT_RGB888_1X24;
|
||||||
|
|
||||||
mxsfb_crtc_mode_set_nofb(mxsfb, bus_format);
|
mxsfb_crtc_mode_set_nofb(mxsfb, bridge_state, bus_format);
|
||||||
|
|
||||||
/* Write cur_buf as well to avoid an initial corrupt frame */
|
/* Write cur_buf as well to avoid an initial corrupt frame */
|
||||||
paddr = mxsfb_get_fb_paddr(crtc->primary);
|
paddr = drm_fb_cma_get_gem_addr(new_pstate->fb, new_pstate, 0);
|
||||||
if (paddr) {
|
if (paddr) {
|
||||||
writel(paddr, mxsfb->base + mxsfb->devdata->cur_buf);
|
writel(paddr, mxsfb->base + mxsfb->devdata->cur_buf);
|
||||||
writel(paddr, mxsfb->base + mxsfb->devdata->next_buf);
|
writel(paddr, mxsfb->base + mxsfb->devdata->next_buf);
|
||||||
@ -488,9 +490,11 @@ static void mxsfb_plane_primary_atomic_update(struct drm_plane *plane,
|
|||||||
struct drm_atomic_state *state)
|
struct drm_atomic_state *state)
|
||||||
{
|
{
|
||||||
struct mxsfb_drm_private *mxsfb = to_mxsfb_drm_private(plane->dev);
|
struct mxsfb_drm_private *mxsfb = to_mxsfb_drm_private(plane->dev);
|
||||||
|
struct drm_plane_state *new_pstate = drm_atomic_get_new_plane_state(state,
|
||||||
|
plane);
|
||||||
dma_addr_t paddr;
|
dma_addr_t paddr;
|
||||||
|
|
||||||
paddr = mxsfb_get_fb_paddr(plane);
|
paddr = drm_fb_cma_get_gem_addr(new_pstate->fb, new_pstate, 0);
|
||||||
if (paddr)
|
if (paddr)
|
||||||
writel(paddr, mxsfb->base + mxsfb->devdata->next_buf);
|
writel(paddr, mxsfb->base + mxsfb->devdata->next_buf);
|
||||||
}
|
}
|
||||||
@ -506,7 +510,7 @@ static void mxsfb_plane_overlay_atomic_update(struct drm_plane *plane,
|
|||||||
dma_addr_t paddr;
|
dma_addr_t paddr;
|
||||||
u32 ctrl;
|
u32 ctrl;
|
||||||
|
|
||||||
paddr = mxsfb_get_fb_paddr(plane);
|
paddr = drm_fb_cma_get_gem_addr(new_pstate->fb, new_pstate, 0);
|
||||||
if (!paddr) {
|
if (!paddr) {
|
||||||
writel(0, mxsfb->base + LCDC_AS_CTRL);
|
writel(0, mxsfb->base + LCDC_AS_CTRL);
|
||||||
return;
|
return;
|
||||||
|
@ -4,7 +4,9 @@ config DRM_NOUVEAU
|
|||||||
depends on DRM && PCI && MMU
|
depends on DRM && PCI && MMU
|
||||||
select IOMMU_API
|
select IOMMU_API
|
||||||
select FW_LOADER
|
select FW_LOADER
|
||||||
select DRM_DP_HELPER
|
select DRM_DISPLAY_DP_HELPER
|
||||||
|
select DRM_DISPLAY_HDMI_HELPER
|
||||||
|
select DRM_DISPLAY_HELPER
|
||||||
select DRM_KMS_HELPER
|
select DRM_KMS_HELPER
|
||||||
select DRM_TTM
|
select DRM_TTM
|
||||||
select DRM_TTM_HELPER
|
select DRM_TTM_HELPER
|
||||||
|
@ -33,14 +33,14 @@
|
|||||||
#include <linux/component.h>
|
#include <linux/component.h>
|
||||||
#include <linux/iopoll.h>
|
#include <linux/iopoll.h>
|
||||||
|
|
||||||
|
#include <drm/display/drm_dp_helper.h>
|
||||||
|
#include <drm/display/drm_scdc_helper.h>
|
||||||
#include <drm/drm_atomic.h>
|
#include <drm/drm_atomic.h>
|
||||||
#include <drm/drm_atomic_helper.h>
|
#include <drm/drm_atomic_helper.h>
|
||||||
#include <drm/dp/drm_dp_helper.h>
|
|
||||||
#include <drm/drm_edid.h>
|
#include <drm/drm_edid.h>
|
||||||
#include <drm/drm_fb_helper.h>
|
#include <drm/drm_fb_helper.h>
|
||||||
#include <drm/drm_plane_helper.h>
|
#include <drm/drm_plane_helper.h>
|
||||||
#include <drm/drm_probe_helper.h>
|
#include <drm/drm_probe_helper.h>
|
||||||
#include <drm/drm_scdc_helper.h>
|
|
||||||
#include <drm/drm_vblank.h>
|
#include <drm/drm_vblank.h>
|
||||||
|
|
||||||
#include <nvif/push507c.h>
|
#include <nvif/push507c.h>
|
||||||
|
@ -33,10 +33,10 @@
|
|||||||
#include <nvhw/class/cl907d.h>
|
#include <nvhw/class/cl907d.h>
|
||||||
#include <nvhw/drf.h>
|
#include <nvhw/drf.h>
|
||||||
|
|
||||||
|
#include <drm/display/drm_dp_helper.h>
|
||||||
#include <drm/drm_crtc.h>
|
#include <drm/drm_crtc.h>
|
||||||
#include <drm/drm_edid.h>
|
#include <drm/drm_edid.h>
|
||||||
#include <drm/drm_encoder.h>
|
#include <drm/drm_encoder.h>
|
||||||
#include <drm/dp/drm_dp_helper.h>
|
|
||||||
#include <drm/drm_util.h>
|
#include <drm/drm_util.h>
|
||||||
|
|
||||||
#include "nouveau_crtc.h"
|
#include "nouveau_crtc.h"
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user