drm/i915/skl: Use fb modifiers for sprites
authorTvrtko Ursulin <tvrtko.ursulin@intel.com>
Tue, 10 Feb 2015 17:16:13 +0000 (17:16 +0000)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 13 Feb 2015 22:28:20 +0000 (23:28 +0100)
While at it just outright remove the tiling check in
intel_check_sprite_plane because it's impossible: We only allow
untiled and X-tiled. This essentially reverts

commit 94c6419ed8f45e6682d766672b9ceb54867d3d2d
Author: Damien Lespiau <damien.lespiau@intel.com>
Date:   Mon Oct 29 15:14:51 2012 +0000

    drm/i915: Error out when trying to set a y-tiled as a sprite

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
[danvet: Drop the hunk in check_sprite, it's impossible.]
Cc: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_sprite.c

index 5afc89e00a2a50a5e5d2777e8f99b4e7cdc0234a..f2d408dd7c155f00b0fcea93c0853959f7e56f8f 100644 (file)
@@ -245,11 +245,11 @@ skl_update_plane(struct drm_plane *drm_plane, struct drm_crtc *crtc,
                BUG();
        }
 
-       switch (obj->tiling_mode) {
-       case I915_TILING_NONE:
+       switch (fb->modifier[0]) {
+       case DRM_FORMAT_MOD_NONE:
                stride = fb->pitches[0] >> 6;
                break;
-       case I915_TILING_X:
+       case I915_FORMAT_MOD_X_TILED:
                plane_ctl |= PLANE_CTL_TILED_X;
                stride = fb->pitches[0] >> 9;
                break;
@@ -1076,7 +1076,6 @@ intel_check_sprite_plane(struct drm_plane *plane,
        struct intel_crtc *intel_crtc = to_intel_crtc(state->base.crtc);
        struct intel_plane *intel_plane = to_intel_plane(plane);
        struct drm_framebuffer *fb = state->base.fb;
-       struct drm_i915_gem_object *obj = intel_fb_obj(fb);
        int crtc_x, crtc_y;
        unsigned int crtc_w, crtc_h;
        uint32_t src_x, src_y, src_w, src_h;
@@ -1106,16 +1105,6 @@ intel_check_sprite_plane(struct drm_plane *plane,
                return -EINVAL;
        }
 
-       /* Sprite planes can be linear or x-tiled surfaces */
-       switch (obj->tiling_mode) {
-               case I915_TILING_NONE:
-               case I915_TILING_X:
-                       break;
-               default:
-                       DRM_DEBUG_KMS("Unsupported tiling mode\n");
-                       return -EINVAL;
-       }
-
        /*
         * FIXME the following code does a bunch of fuzzy adjustments to the
         * coordinates and sizes. We probably need some way to decide whether