Commit de7b6be7 authored by Daniel Stone's avatar Daniel Stone Committed by Daniel Vetter

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: default avatarDaniel Stone <daniels@collabora.com>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20161213181912.92904-1-daniels@collabora.com
parent af913418
...@@ -357,7 +357,10 @@ int drm_mode_getcrtc(struct drm_device *dev, ...@@ -357,7 +357,10 @@ int drm_mode_getcrtc(struct drm_device *dev,
drm_modeset_lock_crtc(crtc, crtc->primary); drm_modeset_lock_crtc(crtc, crtc->primary);
crtc_resp->gamma_size = crtc->gamma_size; 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; crtc_resp->fb_id = crtc->primary->fb->base.id;
else else
crtc_resp->fb_id = 0; crtc_resp->fb_id = 0;
......
...@@ -392,12 +392,16 @@ int drm_mode_getplane(struct drm_device *dev, void *data, ...@@ -392,12 +392,16 @@ int drm_mode_getplane(struct drm_device *dev, void *data,
return -ENOENT; return -ENOENT;
drm_modeset_lock(&plane->mutex, NULL); drm_modeset_lock(&plane->mutex, NULL);
if (plane->crtc) if (plane->state && plane->state->crtc)
plane_resp->crtc_id = plane->state->crtc->base.id;
else if (!plane->state && plane->crtc)
plane_resp->crtc_id = plane->crtc->base.id; plane_resp->crtc_id = plane->crtc->base.id;
else else
plane_resp->crtc_id = 0; plane_resp->crtc_id = 0;
if (plane->fb) if (plane->state && plane->state->fb)
plane_resp->fb_id = plane->state->fb->base.id;
else if (!plane->state && plane->fb)
plane_resp->fb_id = plane->fb->base.id; plane_resp->fb_id = plane->fb->base.id;
else else
plane_resp->fb_id = 0; plane_resp->fb_id = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment