From patchwork Tue Feb 19 21:31:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesse Barnes X-Patchwork-Id: 2165271 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 93C613FCF6 for ; Tue, 19 Feb 2013 21:39:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 86642E6678 for ; Tue, 19 Feb 2013 13:39:27 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from oproxy6-pub.bluehost.com (oproxy6-pub.bluehost.com [67.222.54.6]) by gabe.freedesktop.org (Postfix) with SMTP id D267FE668B for ; Tue, 19 Feb 2013 13:37:50 -0800 (PST) Received: (qmail 31216 invoked by uid 0); 19 Feb 2013 21:37:50 -0000 Received: from unknown (HELO box514.bluehost.com) (74.220.219.114) by cpoproxy3.bluehost.com with SMTP; 19 Feb 2013 21:37:50 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuousgeek.org; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:To:From; bh=2XjFbpRFNrUAYiaOF9EP2CY5Cgb6V2arqIreIhXfw1I=; b=MsEAR6qg1OwyxYMIrTVmX2Ppktt5n8zbAr2r6p0HpmjtozdBKn22grjsmMkQdYLzDNK1fvddUYIvoxGYMnt89PlwAC3Lp6o8dTpeIeCeL6PvDeaJKAktDI4mLLTnjyvk; Received: from [67.161.37.189] (port=56006 helo=localhost.localdomain) by box514.bluehost.com with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.80) (envelope-from ) id 1U7un4-0004Pz-Cb for intel-gfx@lists.freedesktop.org; Tue, 19 Feb 2013 14:31:54 -0700 From: Jesse Barnes To: intel-gfx@lists.freedesktop.org Date: Tue, 19 Feb 2013 13:31:48 -0800 Message-Id: <1361309508-4901-14-git-send-email-jbarnes@virtuousgeek.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1361309508-4901-1-git-send-email-jbarnes@virtuousgeek.org> References: <1361309508-4901-1-git-send-email-jbarnes@virtuousgeek.org> X-Identified-User: {10642:box514.bluehost.com:virtuous:virtuousgeek.org} {sentby:smtp auth 67.161.37.189 authed with jbarnes@virtuousgeek.org} Subject: [Intel-gfx] [PATCH 13/13] drm/i915: check for non-native modes when inheriting a BIOS fb X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org If the mode is non-native using the panel fitter, don't try to re-use the fb the BIOS allocated for it. Signed-off-by: Jesse Barnes Reviewed-by: Imre Deak --- drivers/gpu/drm/i915/intel_fb.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_fb.c b/drivers/gpu/drm/i915/intel_fb.c index b60f277..9ff12aa 100644 --- a/drivers/gpu/drm/i915/intel_fb.c +++ b/drivers/gpu/drm/i915/intel_fb.c @@ -438,6 +438,18 @@ void intel_fbdev_init_bios(struct drm_device *dev) width = ((val >> 16) & 0xfff) + 1; height = ((val >> 0) & 0xfff) + 1; + /* Don't bother inheriting panel fitted modes */ + val = I915_READ(HTOTAL(pipe)); + if (((val & 0xffff) + 1) != width) { + DRM_ERROR("BIOS fb not native width (%d vs %d), skipping\n", width, (val & 0xffff) + 1); + continue; + } + val = I915_READ(VTOTAL(pipe)); + if (((val & 0xffff) + 1) != height) { + DRM_ERROR("BIOS fb not native width (%d vs %d), skipping\n", height, (val & 0xffff) + 1); + continue; + } + DRM_DEBUG_KMS("Found active pipe [%d/%d]: size=%dx%d@%d, offset=%x\n", pipe, plane, width, height, bpp, offset);