summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_crtc.c
diff options
context:
space:
mode:
authorDaniel Stone <daniels@collabora.com>2016-12-13 18:19:12 +0000
committerDaniel Vetter <daniel.vetter@ffwll.ch>2016-12-13 22:22:08 +0100
commitde7b6be7f3009fef47a2ca0df237a055147b6d25 (patch)
tree2a865eb661764657c52390f4c2896e7faa3c94d2 /drivers/gpu/drm/drm_crtc.c
parentaf913418261d6d3e7a29f06cf35f04610ead667c (diff)
downloadtalos-op-linux-de7b6be7f3009fef47a2ca0df237a055147b6d25.tar.gz
talos-op-linux-de7b6be7f3009fef47a2ca0df237a055147b6d25.zip
drm: Use atomic state for FB in legacy ioctls
If atomic state is available, use this to read the current plane in GetCrtc/GetPlane, rather than the legacy points. Signed-off-by: Daniel Stone <daniels@collabora.com> Cc: Daniel Vetter <daniel.vetter@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20161213181912.92904-1-daniels@collabora.com
Diffstat (limited to 'drivers/gpu/drm/drm_crtc.c')
-rw-r--r--drivers/gpu/drm/drm_crtc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index e75f62cd8a65..14c58072651b 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -357,7 +357,10 @@ int drm_mode_getcrtc(struct drm_device *dev,
drm_modeset_lock_crtc(crtc, crtc->primary);
crtc_resp->gamma_size = crtc->gamma_size;
- if (crtc->primary->fb)
+
+ if (crtc->primary->state && crtc->primary->state->fb)
+ crtc_resp->fb_id = crtc->primary->state->fb->base.id;
+ else if (!crtc->primary->state && crtc->primary->fb)
crtc_resp->fb_id = crtc->primary->fb->base.id;
else
crtc_resp->fb_id = 0;
OpenPOWER on IntegriCloud