From patchwork Fri Oct 19 12:30:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Kuoppala X-Patchwork-Id: 10649257 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BF74E13A4 for ; Fri, 19 Oct 2018 12:30:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AF38C286F5 for ; Fri, 19 Oct 2018 12:30:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9E228287A7; Fri, 19 Oct 2018 12:30:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 513CC286F5 for ; Fri, 19 Oct 2018 12:30:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 88E4A6E17C; Fri, 19 Oct 2018 12:30:41 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2DFB96E161 for ; Fri, 19 Oct 2018 12:30:40 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Oct 2018 05:30:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,400,1534834800"; d="scan'208";a="272697607" Received: from rosetta.fi.intel.com ([10.237.72.186]) by fmsmga005.fm.intel.com with ESMTP; 19 Oct 2018 05:30:38 -0700 Received: by rosetta.fi.intel.com (Postfix, from userid 1000) id D37D9840484; Fri, 19 Oct 2018 15:30:37 +0300 (EEST) From: Mika Kuoppala To: intel-gfx@lists.freedesktop.org Date: Fri, 19 Oct 2018 15:30:37 +0300 Message-Id: <20181019123037.17852-1-mika.kuoppala@linux.intel.com> X-Mailer: git-send-email 2.17.1 Subject: [Intel-gfx] [PATCH 1/1] drm/i915: Avoid initializing framebuffer without pipes X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 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-Virus-Scanned: ClamAV using ClamSMTP If we try to initialize a framebuffer without pipes, we get oops as we fail to get valid crtc for a PIPE A, on trying to find pitch limits. This is easily demonstrated by trying to init framebuffer with displays disabled by 'i915.disable_display=1' kernel cmdline. Fix this by omitting framebuffer init early if there are no pipes. Testcase: igt/kms_addfb_basic Cc: Ville Syrjala Signed-off-by: Mika Kuoppala --- drivers/gpu/drm/i915/intel_display.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index fc7e3b0bd95c..c1685395c67c 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -14312,6 +14312,9 @@ static int intel_framebuffer_init(struct intel_framebuffer *intel_fb, stride = i915_gem_object_get_stride(obj); i915_gem_object_unlock(obj); + if (INTEL_INFO(dev_priv)->num_pipes == 0) + goto err; + if (mode_cmd->flags & DRM_MODE_FB_MODIFIERS) { /* * If there's a fence, enforce that