From patchwork Wed Feb 28 11:26:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 129954 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp908789lja; Wed, 28 Feb 2018 03:27:56 -0800 (PST) X-Google-Smtp-Source: AH8x227xXaalucmQkog3m/dxJ/8JX+raMsGqo9+o58vxfViJj5WPVDATpqJRuaPxIUwtGTrNpwAz X-Received: by 10.98.36.25 with SMTP id r25mr17552470pfj.106.1519817276459; Wed, 28 Feb 2018 03:27:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519817276; cv=none; d=google.com; s=arc-20160816; b=M21jMXU9N/fcWcMGSFzWR4GwxKY/PSsdoNbGNOX578BognyQRLgkADyzGqcDQtiOZn ML9S/TMpQCanFTgMvqeBdNqA2+Fv6845L6AeGuepZ493GvQo6BJcPZ1JUd1pIx5JFX3b JDUPkZvGGPs1rmJ0SrR2PE3CtlFI7WQgyzcvaHhozDwCNyY8jyLGLSNOtVyC+FaIClra wY7tKP7Fhwg/xTUxa43QaPSqgFPz5Xf4PBjfSv2a1I2KJAgN+5e54Ve2djfpwuEdAXs/ pGhu/LeBDAZAftDkl4NRK+sau4AEBrh7zlIf61yoJZRyaURjztI6ptGVeoeLGcLgQ4KV v6Sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:delivered-to :arc-authentication-results; bh=TAikGPWqdIR/2tK5ABChytXxxZGaUIg18tEDn33wo3k=; b=fzHXes4SGlhRDGxzgRPvjQnKrwKu4lLUOi6XllbBtYhpMALZqqAMB6MXzjdhso6Btc 4TImGPFruix17N8H8eACmIuSdMll77AfOiz5jbZ5CIOGI/i5mbVad3i88KUJlQdjJP3Z B0GA4eXbm/9QEqK6gVqJpd7pee19ST0zDwqVuzfoJbgvjwB8Wov95wFAiw856/fsuTUz iqTBuXyerFLgOhx8ShPhqtt6LEDSKqANWvVAJAkXynnOBD0lsEgKTiJf8t15iRYu5ZjD LHciC3ygRjkRhi8s3IUKCy93AMlQ7UgMrSqlQTylo1RPwasvm8xlQPGYZDVuzKbOmj3p h04A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b=smGZ4acm; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id m7-v6si1170025pln.711.2018.02.28.03.27.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 28 Feb 2018 03:27:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b=smGZ4acm; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7B99F6E949; Wed, 28 Feb 2018 11:27:24 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from fllnx210.ext.ti.com (fllnx210.ext.ti.com [198.47.19.17]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2C9BD6E932 for ; Wed, 28 Feb 2018 11:27:21 +0000 (UTC) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllnx210.ext.ti.com (8.15.1/8.15.1) with ESMTP id w1SBRJS4022672; Wed, 28 Feb 2018 05:27:19 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1519817239; bh=NijU3khfKFvANNKOBu7MRHgFcjGtSAgk7jJsOCBA0AM=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=smGZ4acmsppj+OQ7p94sBMktc7wWsiLdc0nqkD2Yk2YbMqqh32la/oS1XInMqf3rr dWHKj14zTPCD+k/dxhc9Y/SRmh3FnY5Y+Au+3XKx9oLYuPDKyJhef+NQm0ZVe6HFe8 cN+Up0ZkWbntcF2+88hitv67gz6zLKxevf7xrR1E= Received: from DFLE115.ent.ti.com (dfle115.ent.ti.com [10.64.6.36]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id w1SBRJrd021187; Wed, 28 Feb 2018 05:27:19 -0600 Received: from DFLE110.ent.ti.com (10.64.6.31) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Wed, 28 Feb 2018 05:27:18 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE110.ent.ti.com (10.64.6.31) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Wed, 28 Feb 2018 05:27:18 -0600 Received: from deskari.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id w1SBRAfM024563; Wed, 28 Feb 2018 05:27:16 -0600 From: Tomi Valkeinen To: , Laurent Pinchart Subject: [PATCHv2 03/17] drm/omap: Init fbdev emulation only when we have displays Date: Wed, 28 Feb 2018 13:26:00 +0200 Message-ID: <1519817174-20714-4-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519817174-20714-1-git-send-email-tomi.valkeinen@ti.com> References: <1519817174-20714-1-git-send-email-tomi.valkeinen@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Ujfalusi , Tomi Valkeinen , Jyri Sarha Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Peter Ujfalusi Do not try to init the fbdev if either num_crtcs or num_connectors is 0. In this case we do not have display so the fbdev init would fail anyways. Signed-off-by: Peter Ujfalusi Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Reviewed-by: Sebastian Reichel --- drivers/gpu/drm/omapdrm/omap_fbdev.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/omapdrm/omap_fbdev.c b/drivers/gpu/drm/omapdrm/omap_fbdev.c index be94480326d7..0f66c74a54b0 100644 --- a/drivers/gpu/drm/omapdrm/omap_fbdev.c +++ b/drivers/gpu/drm/omapdrm/omap_fbdev.c @@ -249,6 +249,9 @@ void omap_fbdev_init(struct drm_device *dev) struct drm_fb_helper *helper; int ret = 0; + if (!priv->num_crtcs || !priv->num_connectors) + return; + fbdev = kzalloc(sizeof(*fbdev), GFP_KERNEL); if (!fbdev) goto fail;