From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 635CAC433E0 for ; Tue, 23 Mar 2021 15:40:46 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F0585619B2 for ; Tue, 23 Mar 2021 15:40:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F0585619B2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:35228 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lOj9B-0001as-4M for qemu-devel@archiver.kernel.org; Tue, 23 Mar 2021 11:40:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34814) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOj5A-0004cQ-QT for qemu-devel@nongnu.org; Tue, 23 Mar 2021 11:36:36 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:24656) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lOj52-000314-Ae for qemu-devel@nongnu.org; Tue, 23 Mar 2021 11:36:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616513787; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=r6HkGSRZskuaOzMeEwx/oWOBESHI9UJHgo+0D2TZWTc=; b=he0nDEm+Cbm2+fgBOcrajY8CbJSLTBUOh+MGJV2CA1OWw+42QW3PPsC5SE/5qShRoXEOoU J8/qySnHPpAgYrkXFkCLJ9vXAE/sA7L3WOA+aHvv/G+4CyiwdzmgF4MAl0oHIAnWWv/iNA pjluvkacN16N1eRdk5eFO7lxFClmAxg= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-499-YtW7QXo6O161pkt5jA-tMQ-1; Tue, 23 Mar 2021 11:36:25 -0400 X-MC-Unique: YtW7QXo6O161pkt5jA-tMQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CF1C21007476 for ; Tue, 23 Mar 2021 15:36:24 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-41.ams2.redhat.com [10.36.112.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6227E19705; Tue, 23 Mar 2021 15:36:24 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 22FFD1800624; Tue, 23 Mar 2021 16:36:17 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 5/5] edid: prefer standard timings Date: Tue, 23 Mar 2021 16:36:16 +0100 Message-Id: <20210323153616.873822-6-kraxel@redhat.com> In-Reply-To: <20210323153616.873822-1-kraxel@redhat.com> References: <20210323153616.873822-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Received-SPF: pass client-ip=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Markus Armbruster , Gerd Hoffmann Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Windows guests using the "Basic Display Adapter" don't parse the "Established timings III" block. They also don't parse any edid extension. So prefer the "Standard Timings" block to store the display resolutions in edid_fill_modes(). Also reorder the mode list, so more exotic resolutions (specifically the ones which are not supported by vgabios) are moved down and the remaining ones have a better chance to get one of the eight slots in the "Standard Timings" block. Signed-off-by: Gerd Hoffmann Message-Id: <20210316143812.2363588-6-kraxel@redhat.com> --- hw/display/edid-generate.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/hw/display/edid-generate.c b/hw/display/edid-generate.c index 1665b7cbb29a..a1bea9a3aa35 100644 --- a/hw/display/edid-generate.c +++ b/hw/display/edid-generate.c @@ -25,19 +25,20 @@ static const struct edid_mode { { .xres = 1920, .yres = 1080, .dta = 31 }, /* additional standard timings 3 (all @ 60Hz) */ - { .xres = 1920, .yres = 1440, .xtra3 = 11, .bit = 5 }, { .xres = 1920, .yres = 1200, .xtra3 = 10, .bit = 0 }, - { .xres = 1856, .yres = 1392, .xtra3 = 10, .bit = 3 }, - { .xres = 1792, .yres = 1344, .xtra3 = 10, .bit = 5 }, { .xres = 1600, .yres = 1200, .xtra3 = 9, .bit = 2 }, { .xres = 1680, .yres = 1050, .xtra3 = 9, .bit = 5 }, - { .xres = 1440, .yres = 1050, .xtra3 = 8, .bit = 1 }, { .xres = 1440, .yres = 900, .xtra3 = 8, .bit = 5 }, - { .xres = 1360, .yres = 768, .xtra3 = 8, .bit = 7 }, { .xres = 1280, .yres = 1024, .xtra3 = 7, .bit = 1 }, { .xres = 1280, .yres = 960, .xtra3 = 7, .bit = 3 }, { .xres = 1280, .yres = 768, .xtra3 = 7, .bit = 6 }, + { .xres = 1920, .yres = 1440, .xtra3 = 11, .bit = 5 }, + { .xres = 1856, .yres = 1392, .xtra3 = 10, .bit = 3 }, + { .xres = 1792, .yres = 1344, .xtra3 = 10, .bit = 5 }, + { .xres = 1440, .yres = 1050, .xtra3 = 8, .bit = 1 }, + { .xres = 1360, .yres = 768, .xtra3 = 8, .bit = 7 }, + /* established timings (all @ 60Hz) */ { .xres = 1024, .yres = 768, .byte = 36, .bit = 3 }, { .xres = 800, .yres = 600, .byte = 35, .bit = 0 }, @@ -109,13 +110,13 @@ static void edid_fill_modes(uint8_t *edid, uint8_t *xtra3, uint8_t *dta, if (mode->byte) { edid[mode->byte] |= (1 << mode->bit); - } else if (mode->xtra3 && xtra3) { - xtra3[mode->xtra3] |= (1 << mode->bit); } else if (std < 54) { rc = edid_std_mode(edid + std, mode->xres, mode->yres); if (rc == 0) { std += 2; } + } else if (mode->xtra3 && xtra3) { + xtra3[mode->xtra3] |= (1 << mode->bit); } if (dta && mode->dta) { -- 2.30.2