diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-07-11 14:02:51 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-07-11 14:02:51 -0400 |
commit | 9cb1680c20037e54f202956adabc446c499b9b1e (patch) | |
tree | f7fc0f6f89db3b8e15f1c3cfa3b61e94de734fed /drivers/gpu/drm/omapdrm/omap_plane.c | |
parent | 2278cb0bb3a177d3a3ef0bd332916180cb2f2121 (diff) | |
parent | 2d28b633c3fa8f53b919a5de86eb1c8e78dde818 (diff) |
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Pull drm fixes from Dave Airlie:
"A bunch of fixes for radeon, intel, omap and one amdkfd fix.
Radeon fixes are all over, but it does fix some cursor corruption
across suspend/resume. i915 should fix the second warn you were
seeing, so let us know if not. omap is a bunch of small fixes"
* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: (28 commits)
drm/radeon: disable vce init on cayman (v2)
drm/amdgpu: fix timeout calculation
drm/radeon: check if BO_VA is set before adding it to the invalidation list
drm/radeon: allways add the VM clear duplicate
Revert "Revert "drm/radeon: dont switch vt on suspend""
drm/radeon: Fold radeon_set_cursor() into radeon_show_cursor()
drm/radeon: unpin cursor BOs on suspend and pin them again on resume (v2)
drm/radeon: Clean up reference counting and pinning of the cursor BOs
drm/amdkfd: validate pdd where it acquired first
Revert "drm/i915: Allocate context objects from stolen"
drm/i915: Declare the swizzling unknown for L-shaped configurations
drm/radeon: fix underflow in r600_cp_dispatch_texture()
drm/radeon: default to 2048 MB GART size on SI+
drm/radeon: fix HDP flushing
drm/radeon: use RCU query for GEM_BUSY syscall
drm/amdgpu: Handle irqs only based on irq ring, not irq status regs.
drm/radeon: Handle irqs only based on irq ring, not irq status regs.
drm/i915: Use crtc_state->active in primary check_plane func
drm/i915: Check crtc->active in intel_crtc_disable_planes
drm/i915: Restore all GGTT VMAs on resume
...
Diffstat (limited to 'drivers/gpu/drm/omapdrm/omap_plane.c')
-rw-r--r-- | drivers/gpu/drm/omapdrm/omap_plane.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c b/drivers/gpu/drm/omapdrm/omap_plane.c index cfa8276c4deb..098904696a5c 100644 --- a/drivers/gpu/drm/omapdrm/omap_plane.c +++ b/drivers/gpu/drm/omapdrm/omap_plane.c | |||
@@ -17,6 +17,7 @@ | |||
17 | * this program. If not, see <http://www.gnu.org/licenses/>. | 17 | * this program. If not, see <http://www.gnu.org/licenses/>. |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include <drm/drm_atomic.h> | ||
20 | #include <drm/drm_atomic_helper.h> | 21 | #include <drm/drm_atomic_helper.h> |
21 | #include <drm/drm_plane_helper.h> | 22 | #include <drm/drm_plane_helper.h> |
22 | 23 | ||
@@ -153,9 +154,34 @@ static void omap_plane_atomic_disable(struct drm_plane *plane, | |||
153 | dispc_ovl_enable(omap_plane->id, false); | 154 | dispc_ovl_enable(omap_plane->id, false); |
154 | } | 155 | } |
155 | 156 | ||
157 | static int omap_plane_atomic_check(struct drm_plane *plane, | ||
158 | struct drm_plane_state *state) | ||
159 | { | ||
160 | struct drm_crtc_state *crtc_state; | ||
161 | |||
162 | if (!state->crtc) | ||
163 | return 0; | ||
164 | |||
165 | crtc_state = drm_atomic_get_crtc_state(state->state, state->crtc); | ||
166 | if (IS_ERR(crtc_state)) | ||
167 | return PTR_ERR(crtc_state); | ||
168 | |||
169 | if (state->crtc_x < 0 || state->crtc_y < 0) | ||
170 | return -EINVAL; | ||
171 | |||
172 | if (state->crtc_x + state->crtc_w > crtc_state->adjusted_mode.hdisplay) | ||
173 | return -EINVAL; | ||
174 | |||
175 | if (state->crtc_y + state->crtc_h > crtc_state->adjusted_mode.vdisplay) | ||
176 | return -EINVAL; | ||
177 | |||
178 | return 0; | ||
179 | } | ||
180 | |||
156 | static const struct drm_plane_helper_funcs omap_plane_helper_funcs = { | 181 | static const struct drm_plane_helper_funcs omap_plane_helper_funcs = { |
157 | .prepare_fb = omap_plane_prepare_fb, | 182 | .prepare_fb = omap_plane_prepare_fb, |
158 | .cleanup_fb = omap_plane_cleanup_fb, | 183 | .cleanup_fb = omap_plane_cleanup_fb, |
184 | .atomic_check = omap_plane_atomic_check, | ||
159 | .atomic_update = omap_plane_atomic_update, | 185 | .atomic_update = omap_plane_atomic_update, |
160 | .atomic_disable = omap_plane_atomic_disable, | 186 | .atomic_disable = omap_plane_atomic_disable, |
161 | }; | 187 | }; |