diff options
author | Dave Airlie <airlied@redhat.com> | 2014-05-15 21:47:13 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2014-05-15 21:47:13 -0400 |
commit | 425a9a3ad1e64a00b4dbc827ae58df2aaf10ef43 (patch) | |
tree | 24486fa04e292f875b7944f7086527819e72862b /drivers/gpu/drm/drm_crtc.c | |
parent | ad222799bec32a2db99c12b4dfa5dc19a1f6eaac (diff) | |
parent | a74591d781a8e445e8d5aec8a8bb9ec43a31138b (diff) |
Merge tag 'topic/core-stuff-2014-05-05' of git://anongit.freedesktop.org/drm-intel into drm-next
Update pull request with drm core patches. Mostly some polish for the
primary plane stuff and a pile of patches all over from Thierry. Has
survived a few days in drm-intel-nightly without causing ill.
I've frobbed my scripts a bit to also tag my topic branches so that you
have something stable to pull - I've accidentally pushed a bunch more
patches onto this branch before you've taken the old pull request.
* tag 'topic/core-stuff-2014-05-05' of git://anongit.freedesktop.org/drm-intel:
drm: Make drm_crtc_helper_disable() return void
drm: Fix indentation of closing brace
drm/dp: Fix typo in comment
drm: Fixup flip-work kerneldoc
drm/fb: Fix typos
drm/edid: Cleanup kerneldoc
drm/edid: Drop revision argument for drm_mode_std()
drm: Try to acquire modeset lock on panic or sysrq
drm: remove unused argument from drm_open_helper
drm: Handle ->disable_plane failures correctly
drm: Simplify fb refcounting rules around ->update_plane
drm/crtc-helper: gc usless connector loop in disable_unused_functions
drm/plane_helper: don't disable plane in destroy function
drm/plane-helper: Fix primary plane scaling check
drm: make mode_valid callback optional
drm/edid: Fill PAR in AVI infoframe based on CEA mode list
Diffstat (limited to 'drivers/gpu/drm/drm_crtc.c')
-rw-r--r-- | drivers/gpu/drm/drm_crtc.c | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index a3fe32439a5b..34f0bf18d80d 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c | |||
@@ -1145,16 +1145,19 @@ EXPORT_SYMBOL(drm_plane_cleanup); | |||
1145 | */ | 1145 | */ |
1146 | void drm_plane_force_disable(struct drm_plane *plane) | 1146 | void drm_plane_force_disable(struct drm_plane *plane) |
1147 | { | 1147 | { |
1148 | struct drm_framebuffer *old_fb = plane->fb; | ||
1148 | int ret; | 1149 | int ret; |
1149 | 1150 | ||
1150 | if (!plane->fb) | 1151 | if (!old_fb) |
1151 | return; | 1152 | return; |
1152 | 1153 | ||
1153 | ret = plane->funcs->disable_plane(plane); | 1154 | ret = plane->funcs->disable_plane(plane); |
1154 | if (ret) | 1155 | if (ret) { |
1155 | DRM_ERROR("failed to disable plane with busy fb\n"); | 1156 | DRM_ERROR("failed to disable plane with busy fb\n"); |
1157 | return; | ||
1158 | } | ||
1156 | /* disconnect the plane from the fb and crtc: */ | 1159 | /* disconnect the plane from the fb and crtc: */ |
1157 | __drm_framebuffer_unreference(plane->fb); | 1160 | __drm_framebuffer_unreference(old_fb); |
1158 | plane->fb = NULL; | 1161 | plane->fb = NULL; |
1159 | plane->crtc = NULL; | 1162 | plane->crtc = NULL; |
1160 | } | 1163 | } |
@@ -2122,9 +2125,13 @@ int drm_mode_setplane(struct drm_device *dev, void *data, | |||
2122 | if (!plane_req->fb_id) { | 2125 | if (!plane_req->fb_id) { |
2123 | drm_modeset_lock_all(dev); | 2126 | drm_modeset_lock_all(dev); |
2124 | old_fb = plane->fb; | 2127 | old_fb = plane->fb; |
2125 | plane->funcs->disable_plane(plane); | 2128 | ret = plane->funcs->disable_plane(plane); |
2126 | plane->crtc = NULL; | 2129 | if (!ret) { |
2127 | plane->fb = NULL; | 2130 | plane->crtc = NULL; |
2131 | plane->fb = NULL; | ||
2132 | } else { | ||
2133 | old_fb = NULL; | ||
2134 | } | ||
2128 | drm_modeset_unlock_all(dev); | 2135 | drm_modeset_unlock_all(dev); |
2129 | goto out; | 2136 | goto out; |
2130 | } | 2137 | } |
@@ -2193,16 +2200,18 @@ int drm_mode_setplane(struct drm_device *dev, void *data, | |||
2193 | } | 2200 | } |
2194 | 2201 | ||
2195 | drm_modeset_lock_all(dev); | 2202 | drm_modeset_lock_all(dev); |
2203 | old_fb = plane->fb; | ||
2196 | ret = plane->funcs->update_plane(plane, crtc, fb, | 2204 | ret = plane->funcs->update_plane(plane, crtc, fb, |
2197 | plane_req->crtc_x, plane_req->crtc_y, | 2205 | plane_req->crtc_x, plane_req->crtc_y, |
2198 | plane_req->crtc_w, plane_req->crtc_h, | 2206 | plane_req->crtc_w, plane_req->crtc_h, |
2199 | plane_req->src_x, plane_req->src_y, | 2207 | plane_req->src_x, plane_req->src_y, |
2200 | plane_req->src_w, plane_req->src_h); | 2208 | plane_req->src_w, plane_req->src_h); |
2201 | if (!ret) { | 2209 | if (!ret) { |
2202 | old_fb = plane->fb; | ||
2203 | plane->crtc = crtc; | 2210 | plane->crtc = crtc; |
2204 | plane->fb = fb; | 2211 | plane->fb = fb; |
2205 | fb = NULL; | 2212 | fb = NULL; |
2213 | } else { | ||
2214 | old_fb = NULL; | ||
2206 | } | 2215 | } |
2207 | drm_modeset_unlock_all(dev); | 2216 | drm_modeset_unlock_all(dev); |
2208 | 2217 | ||
@@ -2245,9 +2254,7 @@ int drm_mode_set_config_internal(struct drm_mode_set *set) | |||
2245 | ret = crtc->funcs->set_config(set); | 2254 | ret = crtc->funcs->set_config(set); |
2246 | if (ret == 0) { | 2255 | if (ret == 0) { |
2247 | crtc->primary->crtc = crtc; | 2256 | crtc->primary->crtc = crtc; |
2248 | 2257 | crtc->primary->fb = fb; | |
2249 | /* crtc->fb must be updated by ->set_config, enforces this. */ | ||
2250 | WARN_ON(fb != crtc->primary->fb); | ||
2251 | } | 2258 | } |
2252 | 2259 | ||
2253 | list_for_each_entry(tmp, &crtc->dev->mode_config.crtc_list, head) { | 2260 | list_for_each_entry(tmp, &crtc->dev->mode_config.crtc_list, head) { |