Merge tag 'drm-intel-next-2016-10-24' of git://anongit.freedesktop.org/drm-intel...
[platform/kernel/linux-rpi.git] / drivers / gpu / drm / i915 / intel_sprite.c
index e7d2cff..43d0350 100644 (file)
@@ -992,9 +992,7 @@ int intel_sprite_set_colorkey(struct drm_device *dev, void *data,
                drm_modeset_backoff(&ctx);
        }
 
-       if (ret)
-               drm_atomic_state_free(state);
-
+       drm_atomic_state_put(state);
 out:
        drm_modeset_drop_locks(&ctx);
        drm_modeset_acquire_fini(&ctx);
@@ -1052,6 +1050,7 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane)
        struct intel_plane_state *state = NULL;
        unsigned long possible_crtcs;
        const uint32_t *plane_formats;
+       unsigned int supported_rotations;
        int num_plane_formats;
        int ret;
 
@@ -1127,6 +1126,15 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane)
                goto fail;
        }
 
+       if (INTEL_GEN(dev_priv) >= 9) {
+               supported_rotations =
+                       DRM_ROTATE_0 | DRM_ROTATE_90 |
+                       DRM_ROTATE_180 | DRM_ROTATE_270;
+       } else {
+               supported_rotations =
+                       DRM_ROTATE_0 | DRM_ROTATE_180;
+       }
+
        intel_plane->pipe = pipe;
        intel_plane->plane = plane;
        intel_plane->frontbuffer_bit = INTEL_FRONTBUFFER_SPRITE(pipe, plane);
@@ -1149,7 +1157,9 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane)
        if (ret)
                goto fail;
 
-       intel_create_rotation_property(dev, intel_plane);
+       drm_plane_create_rotation_property(&intel_plane->base,
+                                          DRM_ROTATE_0,
+                                          supported_rotations);
 
        drm_plane_helper_add(&intel_plane->base, &intel_plane_helper_funcs);