mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-12 03:26:26 +00:00
drm: Add local 'plane' variable for tmp->primary
Clean up the ugly tmp->primary-> stuff in __drm_mode_set_config_internal() with a local plane variable. Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180405151400.11326-13-ville.syrjala@linux.intel.com Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
parent
0010ac3ffc
commit
3ed70ecd86
1 changed files with 12 additions and 7 deletions
|
@ -469,8 +469,11 @@ static int __drm_mode_set_config_internal(struct drm_mode_set *set,
|
||||||
* connectors from it), hence we need to refcount the fbs across all
|
* connectors from it), hence we need to refcount the fbs across all
|
||||||
* crtcs. Atomic modeset will have saner semantics ...
|
* crtcs. Atomic modeset will have saner semantics ...
|
||||||
*/
|
*/
|
||||||
drm_for_each_crtc(tmp, crtc->dev)
|
drm_for_each_crtc(tmp, crtc->dev) {
|
||||||
tmp->primary->old_fb = tmp->primary->fb;
|
struct drm_plane *plane = tmp->primary;
|
||||||
|
|
||||||
|
plane->old_fb = plane->fb;
|
||||||
|
}
|
||||||
|
|
||||||
fb = set->fb;
|
fb = set->fb;
|
||||||
|
|
||||||
|
@ -481,11 +484,13 @@ static int __drm_mode_set_config_internal(struct drm_mode_set *set,
|
||||||
}
|
}
|
||||||
|
|
||||||
drm_for_each_crtc(tmp, crtc->dev) {
|
drm_for_each_crtc(tmp, crtc->dev) {
|
||||||
if (tmp->primary->fb)
|
struct drm_plane *plane = tmp->primary;
|
||||||
drm_framebuffer_get(tmp->primary->fb);
|
|
||||||
if (tmp->primary->old_fb)
|
if (plane->fb)
|
||||||
drm_framebuffer_put(tmp->primary->old_fb);
|
drm_framebuffer_get(plane->fb);
|
||||||
tmp->primary->old_fb = NULL;
|
if (plane->old_fb)
|
||||||
|
drm_framebuffer_put(plane->old_fb);
|
||||||
|
plane->old_fb = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in a new issue