summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_fb_helper.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2015-10-20 01:01:49 +0200
committerDave Airlie <airlied@redhat.com>2015-10-20 01:01:49 +0200
commitaffa0e033b04996700434312c76df3c78f683870 (patch)
tree4d67cd508404360dccd4dbd0f7bf71059eb7624c /drivers/gpu/drm/drm_fb_helper.c
parentMerge tag 'drm-intel-next-2015-10-10' of git://anongit.freedesktop.org/drm-in... (diff)
parentdrm/fb-helper: Fix fb refcounting in pan_display_atomic (diff)
downloadlinux-affa0e033b04996700434312c76df3c78f683870.tar.xz
linux-affa0e033b04996700434312c76df3c78f683870.zip
Merge tag 'topic/drm-misc-2015-10-19' of git://anongit.freedesktop.org/drm-intel into drm-next
More drm-misc for 4.4. - fb refcount fix in atomic fbdev - various locking reworks to reduce drm_global_mutex and dev->struct_mutex - rename docbook to gpu.tmpl and include vga_switcheroo stuff, plus more vga_switcheroo (Lukas Wunner) - viewport check fixes for atomic drivers from Ville - DRM_DEBUG_VBL from Ville - non-contentious header fixes from Mikko Rapeli - small things all over * tag 'topic/drm-misc-2015-10-19' of git://anongit.freedesktop.org/drm-intel: (31 commits) drm/fb-helper: Fix fb refcounting in pan_display_atomic drm/fb-helper: Set plane rotation directly drm: fix mutex leak in drm_dp_get_mst_branch_device drm: Check plane src coordinates correctly during page flip for atomic drivers drm: Check crtc viewport correctly with rotated primary plane on atomic drivers drm: Refactor plane src coordinate checks drm: Swap w/h when converting the mode to src coordidates for a rotated primary plane drm: Don't leak fb when plane crtc coodinates are bad ALSA: hda - Spell vga_switcheroo consistently drm/gem: Use kref_get_unless_zero for the weak mmap references drm/vgem: Drop vgem_drm_gem_mmap drm: Fix return value of drm_framebuffer_init() drm/gem: Use container_of in drm_gem_object_free drm/gem: Check locking in drm_gem_object_unreference drm/gem: Drop struct_mutex requirement from drm_gem_mmap_obj drm/i810_drm.h: include drm/drm.h r128_drm.h: include drm/drm.h savage_drm.h: include <drm/drm.h> gpu/doc: Convert to markdown harder gpu/doc: Add vga_switcheroo documentation ...
Diffstat (limited to 'drivers/gpu/drm/drm_fb_helper.c')
-rw-r--r--drivers/gpu/drm/drm_fb_helper.c35
1 files changed, 27 insertions, 8 deletions
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index bd6d4ab27512..e673c13c7391 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -360,11 +360,7 @@ retry:
goto fail;
}
- ret = drm_atomic_plane_set_property(plane, plane_state,
- dev->mode_config.rotation_property,
- BIT(DRM_ROTATE_0));
- if (ret != 0)
- goto fail;
+ plane_state->rotation = BIT(DRM_ROTATE_0);
/* disable non-primary: */
if (plane->type == DRM_PLANE_TYPE_PRIMARY)
@@ -1235,7 +1231,7 @@ int drm_fb_helper_set_par(struct fb_info *info)
EXPORT_SYMBOL(drm_fb_helper_set_par);
static int pan_display_atomic(struct fb_var_screeninfo *var,
- struct fb_info *info)
+ struct fb_info *info)
{
struct drm_fb_helper *fb_helper = info->par;
struct drm_device *dev = fb_helper->dev;
@@ -1253,6 +1249,8 @@ retry:
mode_set = &fb_helper->crtc_info[i].mode_set;
+ mode_set->crtc->primary->old_fb = mode_set->crtc->primary->fb;
+
mode_set->x = var->xoffset;
mode_set->y = var->yoffset;
@@ -1268,13 +1266,34 @@ retry:
info->var.xoffset = var->xoffset;
info->var.yoffset = var->yoffset;
- return 0;
fail:
+ for(i = 0; i < fb_helper->crtc_count; i++) {
+ struct drm_mode_set *mode_set;
+ struct drm_plane *plane;
+
+ mode_set = &fb_helper->crtc_info[i].mode_set;
+ plane = mode_set->crtc->primary;
+
+ if (ret == 0) {
+ struct drm_framebuffer *new_fb = plane->state->fb;
+
+ if (new_fb)
+ drm_framebuffer_reference(new_fb);
+ plane->fb = new_fb;
+ plane->crtc = plane->state->crtc;
+
+ if (plane->old_fb)
+ drm_framebuffer_unreference(plane->old_fb);
+ }
+ plane->old_fb = NULL;
+ }
+
if (ret == -EDEADLK)
goto backoff;
- drm_atomic_state_free(state);
+ if (ret != 0)
+ drm_atomic_state_free(state);
return ret;