[Intel-gfx] [RFC] drm/i915: Add gen check for fb size

Vandana Kannan vandana.kannan at intel.com
Fri Jul 10 04:15:12 PDT 2015


>From gen7, the platform can support fb of size < 3x3.
Adding this check for gen along with fb width & height.
Note: IVB is gen7 but its not clear if it can support width < 3 and
height < 3.

This patch has been tested in Android environment.

Signed-off-by: Vandana Kannan <vandana.kannan at intel.com>
---
 drivers/gpu/drm/i915/intel_sprite.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
index cd21525..310d0a7 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -770,8 +770,13 @@ intel_check_sprite_plane(struct drm_plane *plane,
 		return -EINVAL;
 	}
 
+	if (INTEL_INFO(dev)->gen < 7 && (fb->width < 3 || fb->height < 3)) {
+		DRM_DEBUG_KMS("Unsuitable framebuffer for plane\n");
+		return -EINVAL;
+	}
+
 	/* FIXME check all gen limits */
-	if (fb->width < 3 || fb->height < 3 || fb->pitches[0] > 16384) {
+	if (fb->pitches[0] > 16384) {
 		DRM_DEBUG_KMS("Unsuitable framebuffer for plane\n");
 		return -EINVAL;
 	}
-- 
2.0.1



More information about the Intel-gfx mailing list