aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/imx/imx-drm-core.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2017-03-20 02:49:20 -0400
committerDave Airlie <airlied@redhat.com>2017-03-20 02:49:20 -0400
commit33d5f513c60d5ccd63f8d06d42b4aa4620f4073f (patch)
tree2b239c98e87098487f07bcac0a1ef381faec4449 /drivers/gpu/drm/imx/imx-drm-core.c
parentb7d6c8db498cdbbd0004970d02c86210ce3a6cbc (diff)
parent7d5ed2920d15a8583084f7ca689a30277ef9af55 (diff)
Merge tag 'imx-drm-next-2017-03-17' of git://git.pengutronix.de/git/pza/linux into drm-next
imx-drm PRE/PRG support, deferred plane disabling, separate alpha support - Initial support for the Prefetch Resolve Engine/Gasket on i.MX6QP, improving linear scanout buffer memory bandwidth utilization. This will in the future grow reordering support and allow direct scanout of Vivante tiled renderbuffers from the GPU. - Deferred plane disabling gets rid of some busy waiting in the atomic plane disable and crtc disable paths that lead to wait_for_vblank timeouts. - Add support for RGBA formats with a separate alpha plane, that can reduce memory bandwidth utilization for mostly transparent overlay planes by skipping color reads for completely transparent regions. - Allow moving an active overlay plane without enforcing a modeset. - Add 8-bit and 16-bit bayer formats to ipu_cpmem_set_image. - Set the base address in ipu_cpmem_set_image even for invalid formats to increase robustness against errors. - Use drm_plane_helper_check_state in plane atomic_check. - Some cleanup. * tag 'imx-drm-next-2017-03-17' of git://git.pengutronix.de/git/pza/linux: (22 commits) drm/imx: Remove unneeded definition for structure imx_drm_component drm/imx: use PRG/PRE when possible drm/imx: enable/disable PRG on CRTC enable/disable gpu: ipu-v3: only set non-zero AXI ID for IC when PRG is absent gpu: ipu-v3: hook up PRG unit gpu: ipu-v3: document valid IPUv3 compatibles and extend for i.MX6 QuadPlus gpu: ipu-v3: add driver for Prefetch Resolve Gasket gpu: ipu-v3: add DT binding for the Prefetch Resolve Gasket gpu: ipu-v3: add driver for Prefetch Resolve Engine gpu: ipu-v3: add DT binding for the Prefetch Resolve Engine drm/imx: ipuv3-plane: add support for separate alpha planes drm/imx: extend drm_plane_state_to_eba for separate channel support gpu: ipu-v3: add support for separate alpha channels drm: add RGB formats with separate alpha plane drm/imx: add deferred plane disabling drm/imx: don't wait for vblank and stop calling cleanup_planes in commit_tail gpu: ipu-v3: add unsynchronised DP channel disabling gpu: ipu-v3: remove IRQ dance on DC channel disable gpu: ipu-cpmem: add bayer formats to ipu_cpmem_set_image gpu: ipu-cpmem: set image base address even for incorrect formats ...
Diffstat (limited to 'drivers/gpu/drm/imx/imx-drm-core.c')
-rw-r--r--drivers/gpu/drm/imx/imx-drm-core.c30
1 files changed, 22 insertions, 8 deletions
diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c
index 4b7b92a7bcf7..b6dbcd17f1e6 100644
--- a/drivers/gpu/drm/imx/imx-drm-core.c
+++ b/drivers/gpu/drm/imx/imx-drm-core.c
@@ -30,14 +30,10 @@
30#include <video/imx-ipu-v3.h> 30#include <video/imx-ipu-v3.h>
31 31
32#include "imx-drm.h" 32#include "imx-drm.h"
33#include "ipuv3-plane.h"
33 34
34#define MAX_CRTC 4 35#define MAX_CRTC 4
35 36
36struct imx_drm_component {
37 struct device_node *of_node;
38 struct list_head list;
39};
40
41struct imx_drm_device { 37struct imx_drm_device {
42 struct drm_device *drm; 38 struct drm_device *drm;
43 unsigned int pipes; 39 unsigned int pipes;
@@ -109,6 +105,11 @@ static int imx_drm_atomic_check(struct drm_device *dev,
109 if (ret) 105 if (ret)
110 return ret; 106 return ret;
111 107
108 /* Assign PRG/PRE channels and check if all constrains are satisfied. */
109 ret = ipu_planes_assign_pre(dev, state);
110 if (ret)
111 return ret;
112
112 return ret; 113 return ret;
113} 114}
114 115
@@ -122,6 +123,10 @@ static const struct drm_mode_config_funcs imx_drm_mode_config_funcs = {
122static void imx_drm_atomic_commit_tail(struct drm_atomic_state *state) 123static void imx_drm_atomic_commit_tail(struct drm_atomic_state *state)
123{ 124{
124 struct drm_device *dev = state->dev; 125 struct drm_device *dev = state->dev;
126 struct drm_plane *plane;
127 struct drm_plane_state *old_plane_state;
128 bool plane_disabling = false;
129 int i;
125 130
126 drm_atomic_helper_commit_modeset_disables(dev, state); 131 drm_atomic_helper_commit_modeset_disables(dev, state);
127 132
@@ -131,11 +136,20 @@ static void imx_drm_atomic_commit_tail(struct drm_atomic_state *state)
131 136
132 drm_atomic_helper_commit_modeset_enables(dev, state); 137 drm_atomic_helper_commit_modeset_enables(dev, state);
133 138
134 drm_atomic_helper_commit_hw_done(state); 139 for_each_plane_in_state(state, plane, old_plane_state, i) {
140 if (drm_atomic_plane_disabling(old_plane_state, plane->state))
141 plane_disabling = true;
142 }
143
144 if (plane_disabling) {
145 drm_atomic_helper_wait_for_vblanks(dev, state);
135 146
136 drm_atomic_helper_wait_for_vblanks(dev, state); 147 for_each_plane_in_state(state, plane, old_plane_state, i)
148 ipu_plane_disable_deferred(plane);
137 149
138 drm_atomic_helper_cleanup_planes(dev, state); 150 }
151
152 drm_atomic_helper_commit_hw_done(state);
139} 153}
140 154
141static const struct drm_mode_config_helper_funcs imx_drm_mode_config_helpers = { 155static const struct drm_mode_config_helper_funcs imx_drm_mode_config_helpers = {