diff options
author | Dave Airlie <airlied@redhat.com> | 2017-12-03 14:38:52 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2017-12-03 14:42:49 -0500 |
commit | 2c1c55cb75a9c72f9726fabb8c3607947711a8df (patch) | |
tree | fa835b954149545970eaa256107876d9a24bbf28 /drivers/gpu/drm/stm/ltdc.c | |
parent | ae64f9bd1d3621b5e60d7363bc20afb46aede215 (diff) | |
parent | 2f51be0945b9e0b9baafe47289c802be6d4c7980 (diff) |
Merge tag 'drm-misc-next-2017-11-30' of git://anongit.freedesktop.org/drm/drm-misc into drm-next
Cross-subsystem Changes:
- device tree doc for the Mitsubishi AA070MC01 and Tianma TM070RVHG71
panels (Lukasz Majewski) and for a 2nd endpoint on stm32 (Philippe Cornu)
Core Changes:
The most important changes are:
- Add drm_driver .last_close and .output_poll_changed helpers to reduce
fbdev emulation footprint in drivers (Noralf)
- Fix plane clipping in core and for vmwgfx (Ville)
Then we have a bunch of of improvement for print and debug such as the
addition of a framebuffer debugfs file. ELD connector, HDMI and
improvements. And a bunch of misc improvements, clean ups and style
changes and doc updates
[airlied: drop eld bits from amdgpu_dm]
Driver Changes:
- sii8620: filter unsupported modes and add DVI mode support (Maciej Purski)
- rockchip: analogix_dp: Remove unnecessary init code (Jeffy Chen)
- virtio, cirrus: add fb create_handle support to enable screenshots(Lepton Wu)
- virtio: replace reference/unreference with get/put (Aastha Gupta)
- vc4, gma500: Convert timers to use timer_setup() (Kees Cook)
- vc4: Reject HDMI modes with too high of clocks (Eric)
- vc4: Add support for more pixel formats (Dave Stevenson)
- stm: dsi: Rename driver name to "stm32-display-dsi" (Philippe Cornu)
- stm: ltdc: add a 2nd endpoint (Philippe Cornu)
- via: use monotonic time for VIA_WAIT_IRQ (Arnd Bergmann)
* tag 'drm-misc-next-2017-11-30' of git://anongit.freedesktop.org/drm/drm-misc: (96 commits)
drm/bridge: tc358767: add copyright lines
MAINTAINERS: change maintainer for Rockchip drm drivers
drm/vblank: Fix vblank timestamp debugs
drm/via: use monotonic time for VIA_WAIT_IRQ
dma-buf: Fix ifnullfree.cocci warnings
drm/printer: Add drm_vprintf()
drm/edid: Allow HDMI infoframe without VIC or S3D
video/hdmi: Allow "empty" HDMI infoframes
dma-buf/fence: Fix lock inversion within dma-fence-array
drm/sti: Handle return value of platform_get_irq_byname
drm/vc4: Add support for NV21 and NV61.
drm/vc4: Use .pixel_order instead of custom .flip_cbcr
drm/vc4: Add support for DRM_FORMAT_RGB888 and DRM_FORMAT_BGR888
drm: Move drm_plane_helper_check_state() into drm_atomic_helper.c
drm: Check crtc_state->enable rather than crtc->enabled in drm_plane_helper_check_state()
drm/vmwgfx: Try to fix plane clipping
drm/vmwgfx: Use drm_plane_helper_check_state()
drm/vmwgfx: Remove bogus crtc coords vs fb size check
gpu: gma500: remove unneeded DRIVER_LICENSE #define
drm: don't link DP aux i2c adapter to the hardware device node
...
Diffstat (limited to 'drivers/gpu/drm/stm/ltdc.c')
-rw-r--r-- | drivers/gpu/drm/stm/ltdc.c | 66 |
1 files changed, 46 insertions, 20 deletions
diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c index 735c9081202a..35e884239f60 100644 --- a/drivers/gpu/drm/stm/ltdc.c +++ b/drivers/gpu/drm/stm/ltdc.c | |||
@@ -33,6 +33,8 @@ | |||
33 | 33 | ||
34 | #define MAX_IRQ 4 | 34 | #define MAX_IRQ 4 |
35 | 35 | ||
36 | #define MAX_ENDPOINTS 2 | ||
37 | |||
36 | #define HWVER_10200 0x010200 | 38 | #define HWVER_10200 0x010200 |
37 | #define HWVER_10300 0x010300 | 39 | #define HWVER_10300 0x010300 |
38 | #define HWVER_20101 0x020101 | 40 | #define HWVER_20101 0x020101 |
@@ -556,7 +558,7 @@ static int ltdc_plane_atomic_check(struct drm_plane *plane, | |||
556 | src_h = state->src_h >> 16; | 558 | src_h = state->src_h >> 16; |
557 | 559 | ||
558 | /* Reject scaling */ | 560 | /* Reject scaling */ |
559 | if ((src_w != state->crtc_w) || (src_h != state->crtc_h)) { | 561 | if (src_w != state->crtc_w || src_h != state->crtc_h) { |
560 | DRM_ERROR("Scaling is not supported"); | 562 | DRM_ERROR("Scaling is not supported"); |
561 | return -EINVAL; | 563 | return -EINVAL; |
562 | } | 564 | } |
@@ -856,18 +858,33 @@ int ltdc_load(struct drm_device *ddev) | |||
856 | struct ltdc_device *ldev = ddev->dev_private; | 858 | struct ltdc_device *ldev = ddev->dev_private; |
857 | struct device *dev = ddev->dev; | 859 | struct device *dev = ddev->dev; |
858 | struct device_node *np = dev->of_node; | 860 | struct device_node *np = dev->of_node; |
859 | struct drm_bridge *bridge; | 861 | struct drm_bridge *bridge[MAX_ENDPOINTS] = {NULL}; |
860 | struct drm_panel *panel; | 862 | struct drm_panel *panel[MAX_ENDPOINTS] = {NULL}; |
861 | struct drm_crtc *crtc; | 863 | struct drm_crtc *crtc; |
862 | struct reset_control *rstc; | 864 | struct reset_control *rstc; |
863 | struct resource *res; | 865 | struct resource *res; |
864 | int irq, ret, i; | 866 | int irq, ret, i, endpoint_not_ready = -ENODEV; |
865 | 867 | ||
866 | DRM_DEBUG_DRIVER("\n"); | 868 | DRM_DEBUG_DRIVER("\n"); |
867 | 869 | ||
868 | ret = drm_of_find_panel_or_bridge(np, 0, 0, &panel, &bridge); | 870 | /* Get endpoints if any */ |
869 | if (ret) | 871 | for (i = 0; i < MAX_ENDPOINTS; i++) { |
870 | return ret; | 872 | ret = drm_of_find_panel_or_bridge(np, 0, i, &panel[i], |
873 | &bridge[i]); | ||
874 | |||
875 | /* | ||
876 | * If at least one endpoint is ready, continue probing, | ||
877 | * else if at least one endpoint is -EPROBE_DEFER and | ||
878 | * there is no previous ready endpoints, defer probing. | ||
879 | */ | ||
880 | if (!ret) | ||
881 | endpoint_not_ready = 0; | ||
882 | else if (ret == -EPROBE_DEFER && endpoint_not_ready) | ||
883 | endpoint_not_ready = -EPROBE_DEFER; | ||
884 | } | ||
885 | |||
886 | if (endpoint_not_ready) | ||
887 | return endpoint_not_ready; | ||
871 | 888 | ||
872 | rstc = devm_reset_control_get_exclusive(dev, NULL); | 889 | rstc = devm_reset_control_get_exclusive(dev, NULL); |
873 | 890 | ||
@@ -928,19 +945,25 @@ int ltdc_load(struct drm_device *ddev) | |||
928 | 945 | ||
929 | DRM_INFO("ltdc hw version 0x%08x - ready\n", ldev->caps.hw_version); | 946 | DRM_INFO("ltdc hw version 0x%08x - ready\n", ldev->caps.hw_version); |
930 | 947 | ||
931 | if (panel) { | 948 | /* Add endpoints panels or bridges if any */ |
932 | bridge = drm_panel_bridge_add(panel, DRM_MODE_CONNECTOR_DPI); | 949 | for (i = 0; i < MAX_ENDPOINTS; i++) { |
933 | if (IS_ERR(bridge)) { | 950 | if (panel[i]) { |
934 | DRM_ERROR("Failed to create panel-bridge\n"); | 951 | bridge[i] = drm_panel_bridge_add(panel[i], |
935 | ret = PTR_ERR(bridge); | 952 | DRM_MODE_CONNECTOR_DPI); |
936 | goto err; | 953 | if (IS_ERR(bridge[i])) { |
954 | DRM_ERROR("panel-bridge endpoint %d\n", i); | ||
955 | ret = PTR_ERR(bridge[i]); | ||
956 | goto err; | ||
957 | } | ||
937 | } | 958 | } |
938 | } | ||
939 | 959 | ||
940 | ret = ltdc_encoder_init(ddev, bridge); | 960 | if (bridge[i]) { |
941 | if (ret) { | 961 | ret = ltdc_encoder_init(ddev, bridge[i]); |
942 | DRM_ERROR("Failed to init encoder\n"); | 962 | if (ret) { |
943 | goto err; | 963 | DRM_ERROR("init encoder endpoint %d\n", i); |
964 | goto err; | ||
965 | } | ||
966 | } | ||
944 | } | 967 | } |
945 | 968 | ||
946 | crtc = devm_kzalloc(dev, sizeof(*crtc), GFP_KERNEL); | 969 | crtc = devm_kzalloc(dev, sizeof(*crtc), GFP_KERNEL); |
@@ -968,7 +991,8 @@ int ltdc_load(struct drm_device *ddev) | |||
968 | return 0; | 991 | return 0; |
969 | 992 | ||
970 | err: | 993 | err: |
971 | drm_panel_bridge_remove(bridge); | 994 | for (i = 0; i < MAX_ENDPOINTS; i++) |
995 | drm_panel_bridge_remove(bridge[i]); | ||
972 | 996 | ||
973 | clk_disable_unprepare(ldev->pixel_clk); | 997 | clk_disable_unprepare(ldev->pixel_clk); |
974 | 998 | ||
@@ -978,10 +1002,12 @@ err: | |||
978 | void ltdc_unload(struct drm_device *ddev) | 1002 | void ltdc_unload(struct drm_device *ddev) |
979 | { | 1003 | { |
980 | struct ltdc_device *ldev = ddev->dev_private; | 1004 | struct ltdc_device *ldev = ddev->dev_private; |
1005 | int i; | ||
981 | 1006 | ||
982 | DRM_DEBUG_DRIVER("\n"); | 1007 | DRM_DEBUG_DRIVER("\n"); |
983 | 1008 | ||
984 | drm_of_panel_bridge_remove(ddev->dev->of_node, 0, 0); | 1009 | for (i = 0; i < MAX_ENDPOINTS; i++) |
1010 | drm_of_panel_bridge_remove(ddev->dev->of_node, 0, i); | ||
985 | 1011 | ||
986 | clk_disable_unprepare(ldev->pixel_clk); | 1012 | clk_disable_unprepare(ldev->pixel_clk); |
987 | } | 1013 | } |