Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1141980imu; Thu, 20 Dec 2018 10:50:09 -0800 (PST) X-Google-Smtp-Source: AFSGD/XgTctsQeLt05dZ8w2dTfNINyHbjk5/i5zquciTLInXsdrRIdF5Hwh2q1Rjkt8D6p9dsojh X-Received: by 2002:a63:790e:: with SMTP id u14mr24081226pgc.452.1545331809659; Thu, 20 Dec 2018 10:50:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545331809; cv=none; d=google.com; s=arc-20160816; b=d5uv1RboEI1y3/209bqnrAtCM/isYa+g83gPg870fwOfZT+zwHMtebS2HS5ukzyqCr xVLXvzi6EzXXavU4KnFUK/5ZY5jjzsJ4q7QTMqN5kaFzzS6uMjxsQNL3l+PwhUr40O3t B7WyiXqaWc6Ft2weTVghbmaoLiKRQybOnhK0vx4b+wJiK7aPZ0gh8WYZJhKum1pGCQhz iMPkevPoVpwDyJoMImujoDBjOZ9vvk0OZnSbxXqk6yCAIAbvInhIpB+BDmxD0YVQBpCi FbhRqgSrvWCzNWrlzW/fnhzKXo7gjvSwh795dGl+L5Rn3hNX8yzNSRXTmZ32QIxeFQvY 2vkw== 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=TwnryXxZZBe26n0uR8yl2StjCuggXGDksfLc8kFIJeU=; b=KlNW18a7+FH5BNvYzVZ63aT7uAQNnMaWkWOvUSXSGS64PGTuf85qnP6CtZbh/97Lkx EcRZG+/a6pZ0FnZ12dA4DYXJfeUbpIGbOMZluj4JXfOBVim5TYVMtlRK0NmmB8ZIjY14 w7lpBKuDag5+OWa0o/m2sB7UqMcXxZt/HEUxeA/3mfKXTBsKaKTOAc42Pl/mKXy13myi ejfai6MUQhKudcZ2tU96Tc5+L2c9Vme0i2YnhTje8aEHrfuNfaKw9vn6oGt7Aj5d46Id GC7+DdEkVOI4dtqhmiRua4GQTgXGnhobNHy42Vrt23PIKf6IPm0/nb5JOl2PHOhi8tU8 43Pg== 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 l36si16915730plb.433.2018.12.20.10.49.52; Thu, 20 Dec 2018 10:50: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 S1730413AbeLTKL1 (ORCPT + 99 others); Thu, 20 Dec 2018 05:11:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:18047 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725795AbeLTKL0 (ORCPT ); Thu, 20 Dec 2018 05:11:26 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ADFC65D608; Thu, 20 Dec 2018 10:11:26 +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 2A9656063D; Thu, 20 Dec 2018 10:11:23 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 1D398753E; Thu, 20 Dec 2018 11:11:22 +0100 (CET) From: Gerd Hoffmann To: dri-devel@lists.freedesktop.org Cc: andr2000@gmail.com, daniel.vetter@ffwll.ch, 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 v3] drm/bochs: add edid present check Date: Thu, 20 Dec 2018 11:11:21 +0100 Message-Id: <20181220101122.16153-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 20 Dec 2018 10:11:26 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Check header before trying to read the complete edid blob, to avoid the log being spammed in case qemu has no edid support (old qemu or edid support turned off). Fixes: 01f23459cf drm/bochs: add edid support. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/bochs/bochs_hw.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/bochs/bochs_hw.c b/drivers/gpu/drm/bochs/bochs_hw.c index c90a0d492f..d0b4e1cee8 100644 --- a/drivers/gpu/drm/bochs/bochs_hw.c +++ b/drivers/gpu/drm/bochs/bochs_hw.c @@ -86,9 +86,16 @@ static int bochs_get_edid_block(void *data, u8 *buf, int bochs_hw_load_edid(struct bochs_device *bochs) { + u8 header[8]; + if (!bochs->mmio) return -1; + /* check header to detect whenever edid support is enabled in qemu */ + bochs_get_edid_block(bochs, header, 0, ARRAY_SIZE(header)); + if (drm_edid_header_is_valid(header) != 8) + return -1; + kfree(bochs->edid); bochs->edid = drm_do_get_edid(&bochs->connector, bochs_get_edid_block, bochs); -- 2.9.3