On 02/24/2015 09:46 PM, Daniel Vetter wrote:
On Mon, Feb 23, 2015 at 03:56:01PM +0000, Tvrtko Ursulin wrote:
From: Tvrtko Ursulin <[email protected]>

By this patch all underlying bits have been implemented and this
patch actually enables the feature.

Signed-off-by: Tvrtko Ursulin <[email protected]>
---
  drivers/gpu/drm/i915/intel_display.c | 13 ++++++++-----
  1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c 
b/drivers/gpu/drm/i915/intel_display.c
index 74d4923..f100086 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -12781,6 +12781,14 @@ static int intel_framebuffer_init(struct drm_device 
*dev,
                        DRM_DEBUG("tiling_mode doesn't match fb modifier\n");
                        return -EINVAL;
                }
+
+               if (INTEL_INFO(dev)->gen < 9 &&
+                   (mode_cmd->modifier[0] == I915_FORMAT_MOD_Y_TILED ||
+                    mode_cmd->modifier[0] == I915_FORMAT_MOD_Yf_TILED)) {
+                       DRM_DEBUG("Unsupported tiling 0x%llx!\n",
+                                 mode_cmd->modifier[0]);
+                       return -EINVAL;
+               }
        } else {
                if (obj->tiling_mode == I915_TILING_X)
                        mode_cmd->modifier[0] = I915_FORMAT_MOD_X_TILED;
@@ -12790,11 +12798,6 @@ static int intel_framebuffer_init(struct drm_device 
*dev,
                }
        }

-       if (mode_cmd->modifier[0] == I915_FORMAT_MOD_Y_TILED) {
-               DRM_DEBUG("hardware does not support tiling Y\n");
-               return -EINVAL;
-       }

Imo the clearer code would be to add a
        
        switch (mode_cmd->modifier[0]) {

        }

here and then shovel the platform checks into the supgroups. At least
that's how we tend to roll these since it reduces the risks that a case is
forgotten when the enumeration is extended. That would also have caught
that we don't reject random garbage in the default: case.

Yes that's true - I'll see what I can do.

Regards,

Tvrtko

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to