From patchwork Tue Dec 23 12:35:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Zanoni X-Patchwork-Id: 5533161 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 79373BEEBA for ; Tue, 23 Dec 2014 12:36:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B66B82011D for ; Tue, 23 Dec 2014 12:36:52 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id DBDB82018E for ; Tue, 23 Dec 2014 12:36:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 648826E4A5; Tue, 23 Dec 2014 04:36:50 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by gabe.freedesktop.org (Postfix) with ESMTP id 3B4CD6E4A5 for ; Tue, 23 Dec 2014 04:36:48 -0800 (PST) Received: by mail-vc0-f182.google.com with SMTP id hq12so2298591vcb.13 for ; Tue, 23 Dec 2014 04:36:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rkdPQq7Eg5yTAU0W0+jUu33jVwPOEzY4dmkJmctHinY=; b=gH3M0d213bCpkYoa08WxxfDeMwG4fhXnp089vYZD3xim6FZYrziEoqbb+I7U3Tsep0 WvKR8e8o9kSUZWscglyB4BHBLKOzNhuUE5ZYVAPFe7RGCvtSGiIogXiWEbwnKiNrxuaL RCw4PKwcTAchBa+Aw/S65x48hQuiPJnKl6XC0NHMcI96BSBEyrb4HofJoKayzgzZ7RyI fOnJFLKhzXNImC391ljYgzIcGy9SscXgFIXn1yuupp+p7DBT6ShDNfsZUM44m/Ge/hW4 4DC2j13TmXWYrQg/duwDOYHkPrWTu8dV4JeTyGkYzpmbl+wXZ6UvZncujKWkmp4bBTpY RtAg== X-Received: by 10.220.87.71 with SMTP id v7mr10033013vcl.18.1419338207864; Tue, 23 Dec 2014 04:36:47 -0800 (PST) Received: from localhost.localdomain ([177.92.19.202]) by mx.google.com with ESMTPSA id at12sm4915045vdc.15.2014.12.23.04.36.46 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 23 Dec 2014 04:36:47 -0800 (PST) From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Tue, 23 Dec 2014 10:35:45 -0200 Message-Id: <1419338145-1912-10-git-send-email-przanoni@gmail.com> X-Mailer: git-send-email 2.1.3 In-Reply-To: <1419338145-1912-1-git-send-email-przanoni@gmail.com> References: <1419338145-1912-1-git-send-email-przanoni@gmail.com> Cc: Paulo Zanoni Subject: [Intel-gfx] [PATCH 9/9] drm/i915: FBC only supports 16bpp and 32bpp X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Paulo Zanoni So check for this. Signed-off-by: Paulo Zanoni --- drivers/gpu/drm/i915/intel_fbc.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_fbc.c b/drivers/gpu/drm/i915/intel_fbc.c index 80bdbde..8c6fb1d 100644 --- a/drivers/gpu/drm/i915/intel_fbc.c +++ b/drivers/gpu/drm/i915/intel_fbc.c @@ -515,6 +515,7 @@ static void __intel_fbc_update(struct drm_device *dev) struct drm_i915_gem_object *obj; const struct drm_display_mode *adjusted_mode; unsigned int max_width, max_height; + int fb_cpp; lockdep_assert_held(&dev_priv->fbc.lock); @@ -598,6 +599,13 @@ static void __intel_fbc_update(struct drm_device *dev) goto out_disable; } + fb_cpp = drm_format_plane_cpp(fb->pixel_format, 0); + if (!(fb_cpp == 2 || fb_cpp == 4)) { + if (set_no_fbc_reason(dev_priv, FBC_UNSUPPORTED_MODE)); + DRM_DEBUG_KMS("FBC only supports 16bpp and 32bpp\n"); + goto out_disable; + } + /* If the kernel debugger is active, always disable compression */ if (in_dbg_master()) goto out_disable; @@ -640,8 +648,7 @@ static void __intel_fbc_update(struct drm_device *dev) __intel_fbc_disable(dev); } - if (i915_gem_stolen_setup_compression(dev, obj->base.size, - drm_format_plane_cpp(fb->pixel_format, 0))) { + if (i915_gem_stolen_setup_compression(dev, obj->base.size, fb_cpp)) { if (set_no_fbc_reason(dev_priv, FBC_STOLEN_TOO_SMALL)) DRM_DEBUG_KMS("framebuffer too large, disabling compression\n"); return;