Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp550442imu; Thu, 20 Dec 2018 01:09:09 -0800 (PST) X-Google-Smtp-Source: AFSGD/Uz5FyQtcdvKTSQ/NXfayOXzz1HV+5giPEwmZCA5RdDWYobF0Vq2CuBecWDTEivvRHOveG1 X-Received: by 2002:a17:902:1e9:: with SMTP id b96mr23355855plb.150.1545296949871; Thu, 20 Dec 2018 01:09:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545296949; cv=none; d=google.com; s=arc-20160816; b=MYcUR7OHliKXSPmh0RvjWZRMejJK19ZOJFv0YGCfU/e+CQ6ybgVq+jgHP6CC7Z7NCt wBcMG1Nqiz7dahGKtmAHUXyNTQWpteVrlxoEGfRgXGKwbbeuumbDnuDMBF4vITBYKKP3 IlNQnkS9TLCzcL5RHFVVP0erG7LmBIFgBq9fKQzAotJPI0jqSH4d5qAQ4ehRWWIBKDhe i+Y6QhCvDs+XWnT7Pvlntx/X1qtAHfivfVMFUyn9x+qH2h79mlOjXzK1Z035kzsF+Iqp FNBm+X7mG8qmkFWruQAR+yNfnD2E+wHVRQtRkihQ5TowPV/04C/Ayqb3qjHDS57pUCuN 6txA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=/PRXPnpZMGVdiwxY79Y3EN8/7UHMYIoGhGC5gqdqH88=; b=Xd4QFdweHQSiL6BPuonacIQRe2+/120HsHy/v6h17UmWwPC1hUomwC+6Y1RPt4DCt+ zTIaGpfzzcNhvHbnU8uJX2198EeiDxB5Kf97VZkQOyHE9bL6LNCMS7oxx+u56Zcz5Pyy qwGwpg9xZLbbVVe6HVJpdvHEQ2j6Cktu5xPDPdmVHSyHZPOi5Z0ascrPI4PDwUz2aFJC Ios0mrTcxTuGOaJWezE8NbnsInkROv1sVSue0OLW6dfp59rT+mWH/905hZp2VFY6Bm82 NooCwrzaP+Z6qqVQrJOKC6wvRVzoi5FFqN65hIEUvFsHYp0UJwwoOyWKajVdwCvM/GCU CD7Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v141si19849359pfc.260.2018.12.20.01.08.54; Thu, 20 Dec 2018 01:09:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729947AbeLTGuG (ORCPT + 99 others); Thu, 20 Dec 2018 01:50:06 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40934 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725300AbeLTGuF (ORCPT ); Thu, 20 Dec 2018 01:50:05 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 82D97C057E1B; Thu, 20 Dec 2018 06:50:05 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-117-174.ams2.redhat.com [10.36.117.174]) by smtp.corp.redhat.com (Postfix) with ESMTP id 59268101F94C; Thu, 20 Dec 2018 06:50:02 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 364F6946; Thu, 20 Dec 2018 07:50:01 +0100 (CET) From: Gerd Hoffmann To: dri-devel@lists.freedesktop.org Cc: andr2000@gmail.com, Gerd Hoffmann , David Airlie , virtualization@lists.linux-foundation.org (open list:DRM DRIVER FOR BOCHS VIRTUAL GPU), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v2] drm/bochs: add edid present check Date: Thu, 20 Dec 2018 07:50:01 +0100 Message-Id: <20181220065001.9594-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 20 Dec 2018 06:50:05 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Check first two header bytes before trying to read the edid blob, to avoid the log being spammed in case qemu has no edid support (old qemu or edid turned off). Fixes: 01f23459cf drm/bochs: add edid support. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/bochs/bochs_hw.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/bochs/bochs_hw.c b/drivers/gpu/drm/bochs/bochs_hw.c index c90a0d492f..e1f8ffce00 100644 --- a/drivers/gpu/drm/bochs/bochs_hw.c +++ b/drivers/gpu/drm/bochs/bochs_hw.c @@ -89,6 +89,14 @@ int bochs_hw_load_edid(struct bochs_device *bochs) if (!bochs->mmio) return -1; + /* + * Check first two EDID blob header bytes to figure whenever + * edid support is enabled in qemu. + */ + if (readb(bochs->mmio + 0) != 0x00 || + readb(bochs->mmio + 1) != 0xff) + return -1; + kfree(bochs->edid); bochs->edid = drm_do_get_edid(&bochs->connector, bochs_get_edid_block, bochs); -- 2.9.3