OSDN Git Service

Revert "minigbm/i915: Add support for I915_FORMAT_MOD_Y_TILED_CCS"
authorMark Yacoub <markyacoub@google.com>
Wed, 21 Aug 2019 19:32:43 +0000 (19:32 +0000)
committerchrome-bot <chrome-bot@chromium.org>
Fri, 23 Aug 2019 20:57:23 +0000 (13:57 -0700)
This reverts commit a0868975d7d0242fd47c0090c2f779f8f2049dba.

Reason for revert: Broke many tests such as the screenshot test and using a 2nd external monitor.

Original change's description:
> minigbm/i915: Add support for I915_FORMAT_MOD_Y_TILED_CCS
>
> This adds support for allocating buffers with the
> I915_FORMAT_MOD_Y_TILED_CCS modifier, which enables Intels render
> buffer compression.
>
> BUG=979736
>
> Change-Id: I2f3d19be8b7661693054da8a153c2412c65233f1
> Reviewed-on: https://chromium-review.googlesource.com/1706735
> Tested-by: Mark Yacoub <markyacoub@google.com>
> Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
> Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
> Reviewed-by: Mark Yacoub <markyacoub@google.com>

Bug: 996011,988559,995549,996036,
Change-Id: I5fbed90c5d8774b9385811a145b14a11423bb707
Reviewed-on: https://chromium-review.googlesource.com/1759155
Tested-by: Mark Yacoub <markyacoub@google.com>
Commit-Ready: Mark Yacoub <markyacoub@google.com>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Mark Yacoub <markyacoub@google.com>
i915.c

diff --git a/i915.c b/i915.c
index 44f08f8..9683bf0 100644 (file)
--- a/i915.c
+++ b/i915.c
@@ -366,7 +366,6 @@ static int i915_bo_create_for_modifier(struct bo *bo, uint32_t width, uint32_t h
                bo->tiling = I915_TILING_X;
                break;
        case I915_FORMAT_MOD_Y_TILED:
-       case I915_FORMAT_MOD_Y_TILED_CCS:
                bo->tiling = I915_TILING_Y;
                break;
        }
@@ -384,47 +383,6 @@ static int i915_bo_create_for_modifier(struct bo *bo, uint32_t width, uint32_t h
                 */
                uint32_t stride = ALIGN(width, 32);
                drv_bo_from_format(bo, stride, height, format);
-       } else if (modifier == I915_FORMAT_MOD_Y_TILED_CCS) {
-               /*
-                * For compressed surfaces, we need a color control surface
-                * (CCS). Color compression is only supported for Y tiled
-                * surfaces, and for each 32x16 tiles in the main surface we
-                * need a tile in the control surface.  Y tiles are 128 bytes
-                * wide and 32 lines tall and we use that to first compute the
-                * width and height in tiles of the main surface. stride and
-                * height are already multiples of 128 and 32, respectively:
-                */
-               uint32_t stride = drv_stride_from_format(format, width, 0);
-               uint32_t width_in_tiles = DIV_ROUND_UP(stride, 128);
-               uint32_t height_in_tiles = DIV_ROUND_UP(height, 32);
-               uint32_t size = width_in_tiles * height_in_tiles * 4096;
-               uint32_t offset = 0;
-
-               bo->strides[0] = width_in_tiles * 128;
-               bo->sizes[0] = size;
-               bo->offsets[0] = offset;
-               offset += size;
-
-               /*
-                * Now, compute the width and height in tiles of the control
-                * surface by dividing and rounding up.
-                */
-               uint32_t ccs_width_in_tiles = DIV_ROUND_UP(width_in_tiles, 32);
-               uint32_t ccs_height_in_tiles = DIV_ROUND_UP(height_in_tiles, 16);
-               uint32_t ccs_size = ccs_width_in_tiles * ccs_height_in_tiles * 4096;
-
-               /*
-                * With stride and height aligned to y tiles, offset is
-                * already a multiple of 4096, which is the required alignment
-                * of the CCS.
-                */
-               bo->strides[1] = ccs_width_in_tiles * 128;
-               bo->sizes[1] = ccs_size;
-               bo->offsets[1] = offset;
-               offset += ccs_size;
-
-               bo->num_planes = 2;
-               bo->total_size = offset;
        } else {
                i915_bo_from_format(bo, width, height, format);
        }
@@ -476,7 +434,6 @@ static int i915_bo_create_with_modifiers(struct bo *bo, uint32_t width, uint32_t
                                         uint32_t format, const uint64_t *modifiers, uint32_t count)
 {
        static const uint64_t modifier_order[] = {
-               I915_FORMAT_MOD_Y_TILED_CCS,
                I915_FORMAT_MOD_Y_TILED,
                I915_FORMAT_MOD_X_TILED,
                DRM_FORMAT_MOD_LINEAR,
@@ -523,9 +480,6 @@ static void *i915_bo_map(struct bo *bo, struct vma *vma, size_t plane, uint32_t
        int ret;
        void *addr;
 
-       if (bo->format_modifiers[0] == I915_FORMAT_MOD_Y_TILED_CCS)
-               return MAP_FAILED;
-
        if (bo->tiling == I915_TILING_NONE) {
                struct drm_i915_gem_mmap gem_map;
                memset(&gem_map, 0, sizeof(gem_map));