From patchwork Wed Mar 8 09:19:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 9610675 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 83AD960414 for ; Wed, 8 Mar 2017 09:23:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4E12128502 for ; Wed, 8 Mar 2017 09:23:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 427B328567; Wed, 8 Mar 2017 09:23:28 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0557428502 for ; Wed, 8 Mar 2017 09:23:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=jNnWCiUS2lzy8d22VjPlut4o3zpEQLpifmO3WBFJew8=; b=K3dzb/YPoeVT9A6wJVackZJkiX rIomJWYdIc9xCGn527wqYmfhfI1y2YFswGh6XPo8qhqoK/KR2Z+YQA08RhxNWzQFu0mssOHv6scrz BMtGkZYLr8NzLXFed99iPSQIYFwmxj5M/sHSXPxonCo2uWLNezm7/CAnHEmOVIG4G8ZIl93iGWr5B 9kor0Alt+oZgPwT7sbsQkJUaYL/DznFsFfj9z09AHlkSlgOtDz7KRAllXwHWzVSjqWE9lkmj9/KtC 1BefnakS1mEEeAyrgScaqDk46/gOf/mqu9Jpsqrq9eptZheIH/gF6zjyds03OIvw8N72Bt/XgmCJ3 fop34qcA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1clXod-00006K-SX; Wed, 08 Mar 2017 09:23:27 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1clXmH-0006QL-T0; Wed, 08 Mar 2017 09:21:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=udCIFZUeyT6fd2FZ+sGO+9DGEK5FC/258FK4ZW74d0A=; b=t1GffeOfE5MiwKSomO0mI1GMN KHn43ekWKO3Yzr0d8Iy3x6o1tdTk79bVVbEI2NNsBjUwJXfQ0gRkD4Pnhu1BaBgGJ73X22ZfqiP9x zDIOz8NDjTQSBEQiIFcxSdn3Dtz0rAMNeRZLnHi/94Xxfwsisz3n5XXM2DQpJBuMW1017rLre3rSo 3mpAtJprgWMWxV+VmFNLRYhfGiIK+UchpQe0r1I2DHPdiLfBX6MUTZL2ptieP3NbEeLdynr00MHOn Iwq/CurS1HBWdhHH6AVgGDtCpYxF1krIg/OKsE4Q2W1LvRZAQncwIdBK0k+grqRmzXExUqtA38SCC oYJh/qvzQ==; Received: from mx1.redhat.com ([209.132.183.28]) by casper.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1clXmD-0003ID-HU; Wed, 08 Mar 2017 09:20:59 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D749DC04B95F; Wed, 8 Mar 2017 09:19:59 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-95.ams2.redhat.com [10.36.116.95]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v289JwI8028737; Wed, 8 Mar 2017 04:19:58 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id EB01680B5A; Wed, 8 Mar 2017 10:19:54 +0100 (CET) From: Gerd Hoffmann To: linux-rpi-kernel@lists.infradead.org Subject: [PATCH 3/4] qxl: read monitors config at boot Date: Wed, 8 Mar 2017 10:19:06 +0100 Message-Id: <1488964751-22763-7-git-send-email-kraxel@redhat.com> In-Reply-To: <1488964751-22763-1-git-send-email-kraxel@redhat.com> References: <1488964751-22763-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 08 Mar 2017 09:20:00 +0000 (UTC) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170308_092057_747825_EBF5DFCD X-CRM114-Status: GOOD ( 13.09 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, ulf.hansson@linaro.org, David Airlie , catalin.marinas@arm.com, will.deacon@arm.com, "open list:DRM DRIVERS" , "open list:DRM DRIVER FOR QXL VIRTUAL GPU" , eric@anholt.net, Gerd Hoffmann , stefan.wahren@i2se.com, f.fainelli@gmail.com, lee@kernel.org, linux@armlinux.org.uk, bcm-kernel-feedback-list@broadcom.com, Dave Airlie , devicetree@vger.kernel.org, rjui@broadcom.com, robh+dt@kernel.org, linux-arm-kernel@lists.infradead.org, sbranden@broadcom.com, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Try to read the client monitors config at driver load time, even without explicit notification. So in case that info was filled before the driver loaded and we've missed the notifications because of that the settings will still be used. With that place we now have to take care to properly handle a empty client monitors config, so we don't trip over an uninitialized client monitors config. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c index 2b99496..cf99ace 100644 --- a/drivers/gpu/drm/qxl/qxl_display.c +++ b/drivers/gpu/drm/qxl/qxl_display.c @@ -81,6 +81,10 @@ static int qxl_display_copy_rom_client_monitors_config(struct qxl_device *qdev) qdev->rom->client_monitors_config_crc); return MONITORS_CONFIG_BAD_CRC; } + if (!num_monitors) { + DRM_DEBUG_KMS("no client monitors configured\n"); + return status; + } if (num_monitors > qdev->monitors_config->max_allowed) { DRM_DEBUG_KMS("client monitors list will be truncated: %d < %d\n", qdev->monitors_config->max_allowed, num_monitors); @@ -1192,6 +1196,7 @@ int qxl_modeset_init(struct qxl_device *qdev) qdev_output_init(&qdev->ddev, i); } + qxl_display_read_client_monitors_config(qdev); qdev->mode_info.mode_config_initialized = true; drm_mode_config_reset(&qdev->ddev);