]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/i915: Enable RGB565 90/270 plane rotation for gen11 onwards.
authorJuha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Mon, 27 Aug 2018 12:37:53 +0000 (15:37 +0300)
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Tue, 25 Sep 2018 13:00:09 +0000 (15:00 +0200)
From gen11 onwards RGB565 90/270 plane rotation is supported on hardware.

IGT: https://patchwork.freedesktop.org/series/48756/
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
[mlankhorst: Rebase on top of current dinq (self), fix grammar (Ville).]
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1535373473-3594-3-git-send-email-juhapekka.heikkila@gmail.com
drivers/gpu/drm/i915/intel_sprite.c

index 46c6336cb85831dcc016faa2f592daba244cd39f..96de5a33dbaf1418d3a1780b28f117d3f0c5aaa5 100644 (file)
@@ -1203,6 +1203,8 @@ vlv_sprite_check(struct intel_crtc_state *crtc_state,
 static int skl_plane_check_fb(const struct intel_crtc_state *crtc_state,
                              const struct intel_plane_state *plane_state)
 {
+       struct intel_plane *plane = to_intel_plane(plane_state->base.plane);
+       struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
        const struct drm_framebuffer *fb = plane_state->base.fb;
        unsigned int rotation = plane_state->base.rotation;
        struct drm_format_name_buf format_name;
@@ -1231,13 +1233,17 @@ static int skl_plane_check_fb(const struct intel_crtc_state *crtc_state,
                }
 
                /*
-                * 90/270 is not allowed with RGB64 16:16:16:16,
-                * RGB 16-bit 5:6:5, and Indexed 8-bit.
-                * TBD: Add RGB64 case once its added in supported format list.
+                * 90/270 is not allowed with RGB64 16:16:16:16 and
+                * Indexed 8-bit. RGB 16-bit 5:6:5 is allowed gen11 onwards.
+                * TBD: Add RGB64 case once its added in supported format
+                * list.
                 */
                switch (fb->format->format) {
-               case DRM_FORMAT_C8:
                case DRM_FORMAT_RGB565:
+                       if (INTEL_GEN(dev_priv) >= 11)
+                               break;
+                       /* fall through */
+               case DRM_FORMAT_C8:
                        DRM_DEBUG_KMS("Unsupported pixel format %s for 90/270!\n",
                                      drm_get_format_name(fb->format->format,
                                                          &format_name));